#arma3_scripting

1 messages · Page 651 of 1

distant oyster
sonic thicket
#

@willow hound I actually managed to get it working using scripts, just have to make sure it executes on al clients

worn obsidian
#

I have a fun script for an auto-opening gate if anyone wants it?

sonic thicket
#
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", 
{
    _this select 0 drawIcon 
    [
        getMissionPath '\image\Icons\RadBase_0_8.paa',
        [1,0,0,1],
        getPos player,
        32,
        32,
        getDir player,
        "Player Vehicle",
        1,
        0.03,
        "TahomaB",
        "right"
    ]
}];

That's what it requires ^

ripe sapphire
# distant oyster actually there has been a similar discussion on the forums: https://forums.bohem...

thanks so much!
so following your example this my code

#include "\a3\ui_f\hpp\definecommongrids.inc" 

[ "<t font='PuristaBold'  size='3'>Exocet</t><br /><t size='2' >Presents<\t>", 
 GUI_GRID_TOPLEFT_X + 10 * GUI_GRID_TOPLEFT_W,  
 GUI_GRID_TOPLEFT_Y + 10 * GUI_GRID_TOPLEFT_H,  
 2, 
 1, 
 0, 
 222 
] spawn BIS_fnc_dynamicText;

it displays the text center of screen for me, and it should be for other aspect ratios and resolutions too right?

ebon citrus
#

Im not sure you want to run a lot of those on "draw" EH... but you suit yourself

sonic thicket
#

Nica, you realize I asked for advice right?

#

It's not too late for that 😛

#

@ebon citrus if you know a better way please tell me, I couldn't find much information on it

#

feel free to tag me

distant oyster
ocean folio
#

Hey lads, I’m having an issue with setFog

#

From what I understand the time is in seconds

#

If I set the time to 0, I get the desired fog amount. If I set the time to 1, I get a much lesser effect

#

Any time less than 0 produces a lesser fog amount than it should

#

Never tried to use such extreme fog values before so I haven’t had this issue

fading crest
#

What’s the script to make a fully controllable goat?

#

I’m new to scripting and know it pertains to create unit iirc

tribal onyx
#

So I ran into a particularity; if I have an array filled with groups (let's call it squads), and those groups are set to "Delete on Empty", on removal the squads (e.g. B Alpha 1-1) are getting replaced by <NULL-group>, so once the groups are dead and cleaned up, the array will look something like [<NULL-group>,<NULL-group>,<NULL-group>].

How can I clean-up that array? I tried everything I could think of, including stuff like squad = squad - [<NULL-group>] but that just throws up an error. Similarly, can't seem to find a way how to actually check if only the <NULL-group> are remaining, isNull is not recognising it.

tribal onyx
#

Is there a better way to do this, or did I actually figure out a solution?

tribal onyx
brazen lagoon
#

Is it possible to get texture data programatically?

#

or would I have to do this in intercept?

warm hedge
#

What do you mean by texture data?

languid oyster
#

I'm currently setting up a rearm script for AI units. They are to rearm heavy vehicles by replacing empty or partly empty magazines of vehicles, and replacing them with full magazines.
How can I remove a certain magazine from a vehicle? With removeMagazinesTurret I can not tell, which one is to be removed. Is there any other command I could use instead?

languid oyster
#

Oh no 😱 poor cracks have all been taken down by the unforgiving pandemic!!
But don't worry! You will not be forgotten!

hallow mortar
# languid oyster I'm currently setting up a rearm script for AI units. They are to rearm heavy ve...

Although you can find a magazine's unique ID by using magazinesDetail, I can't find any way to then use that ID to do anything useful.

That being said, it actually doesn't matter. Any full magazine is indistinguishable from another full magazine of the same type, so it's completely safe to simply remove all magazines, regardless of whether they're full or not, and replace them with a standard load.

still forum
#

Afaik there is no way to use that id

sturdy patrol
#

Hi, any know or have a snippet to change the logo of arma 3 on the bar of the Main Menu ? i want to add the logo from my unit in replace thx in advanced

hallow mortar
still forum
sturdy patrol
#

I've seen some mods that do it but I couldn't find anything on the internet

#

I am making a custom menu for the unit along with the loading screens

exotic flax
#

simply find the control with the logo in it, and change the value of it

#

if you're building a custom menu yourself, you should be able to that as well 😉

still forum
#

Don't think I like the idea of removing the Arma logo of Arma

#

One mod once modified Arma to remove everything that said that the game is "Arma" including copyright notices and such.
It got dunked from the workshop for that

sturdy patrol
exotic flax
#

I also made a custom main menu for a private mod, and I also made some big changes there...
But I do respect Arma, so the logo and copyright notices are still present (just moved around).

#

afaik are there some mods which modify the logo (eg. say "Arma 3 - my special mod" or something)

still forum
#

I also have a custom-ish main menu for my unit. But I left the Arma logo there.

#

I don't know if its not allowed to remove the logo, but I don't feel good about it

#

For me having my unit logo in the center of the screen is enough

sturdy patrol
still forum
#

yeah

sturdy patrol
still forum
#

If you do it you should use the new connectToServer script command tho

still forum
#

That looks like the one that got dumped from workshop for removing all Arma stuff and also containing lots of ripped/stolen content

#

I guess they added some Arma stuff back and reuploaded it

sturdy patrol
#

ok

toxic dirge
#

Does anyone know how to change the main menu background image like something you'd see in SWOP? I tried asking in their discord and got banned immediately, I'm not talking about the cutscene, but about the image you can see when the menu world is disabled.

sturdy patrol
# toxic dirge Does anyone know how to change the main menu background image like something you...
class RscDisplayMain : RscStandardDisplay {
    enableDisplay = 1;
    class RscActiveText ;
    class RscActivePicture : RscActiveText
    {
        style = 48;
        color[] = {
                1, 1, 1, 0.500000
        };
        colorActive[] = {
                1, 1, 1, 1
        };
    };
    
    class controls {
        class Spotlight1 {};
        class Spotlight2 {};
        class Spotlight3 {};
        class BackgroundSpotlightRight {};
        class BackgroundSpotlightLeft {};
        class BackgroundSpotlight {};
    };
    class controlsBackground {
        class LoadingPic : RscPicture {
            idc=1;
            x = SafeZoneX;
            y = SafeZoneY;
            h = SafeZoneH;
            w = SafeZoneW;
            text = "path\image";
        };
    };
};
``` try it i hope i copy the correct
toxic dirge
#

@sturdy patrol didn't seem to work sadly

sturdy patrol
#

puff give a second 1 make a pbo with all the code and share with you

crude prism
#

So I have stumble upon another question, this works fine with booth activation and deactivation getting triggered.

if (isServer) then    
{   
 _trigger = createTrigger ["EmptyDetector", getPosWorld this, false];    
 _trigger setTriggerArea [47, 32, 0, false];  
 _trigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];    
 _trigger setTriggerStatements ["this", "se1 sideChat format ['What is this? A fresh mind that I have not seen before. Ooooh, all those emotions, we can come to like this! Be good now my dear, and come to me. I will be waiting for you at my tower dear %1.', name player]", "se1 sideChat format ['Aaaaaaaaaaaaaaah, I can not wait until we get to know each other so much better, please hurry my sweet sweet %1. I can already feel a deep longing for you!', name player]"]; 
};

But if I switch setTriggerActivation to false on the repeating part, only activation gets triggered. Is it supposed to be like this, or am I doing something wrong?

sturdy patrol
#

that is a pbo to change alls i use a example image

toxic dirge
#

works great thank you

sturdy patrol
#

ok now i have the custom load screen and menu but when load all the mods y get overwrite the load screens any idea how can set priority to my load screens ?

toxic dirge
exotic flax
#

Perhaps move this to #arma3_config , since this has nothing to do with scripting...

hallow mortar
#

When using the expected data types parameter of params, should the list of data types be strings, or...?

winter rose
#

no, array

hallow mortar
#

yeah, but an array of strings or not-strings?

winter rose
#
[0, "one", [2], player] params [
  ["_zero", 0, [0]],
  ["_one", "", [""]],
  ["_two", [], [[]]],
  ["_three", objNull, [objNull]]
];
hallow mortar
#

okay, so if I want it to only accept strings the array should be [""]

winter rose
#

correct!

hallow mortar
#

neat, thanks

hallow mortar
#

if you run forEach on an empty array, does it cause an error or just do nothing?

hollow thistle
#

nothing to iterate on, nothing.

hot kernel
#

This page,
https://community.bistudio.com/wiki/CT_BUTTON
says,

The variable "this" is available, and contains the unit that pressed the button, but unlike User Interface Event Handlers no "_this" information about the current control is passed.
How do I actually get "the unit that pressed the button"?

#

for example,

Action = "systemChat format ['%1', this]";

is undefined (error/any)

distant oyster
hot kernel
#

@distant oyster,
Perfect. I was using player because, logically to me it's the same as you said-- who else could press the button!? I noticed the option and thought to try it. But it's all good!

Thanks!

distant oyster
#

must be some remnant from old times. the action attribute's code is in sqs and that is from OFP times

sonic thicket
#

Hey everyone, I've been messing around with setting textures on objects again but for some reason adding the following lines to the init of the object makes the first texture go on both sides rather then each side having its own texture: ( Here's a screenshot by the way: http://prntscr.com/yferwp )

this setObjectTextureGlobal [0, "image\trials\floravontuur4_1.jpg"];
this setObjectTextureGlobal [1, "image\trials\floravontuur4.jpg"];

The object i am trying to put these two textures on is the "Land_Billboard_04_blank_F" I have tried selections 0 to 7 and none of them worked. Also getObjectTextures returns the two different textures set in ini. I also tried exiting to main menu and reloading the scenario.

So, could anyone tell me what I am doing wrong here as I feel like I've hit a brick wall.

winter rose
sonic thicket
#

They are not, but wouldnt that result in the image not loading?

#

(im changing it up as we speak though but I feel as if that's not it. Hopefully im wrong)

hallow mortar
#

Out of curiosity, is the picture you're trying to put on the billboard...a picture of another billboard?

sonic thicket
#

Yeah it is, scenery to find it ( Making a mini quest trail of "find the keys to get some nice reward" )

#

one of the steps entail finding that billboard in the picture

hallow mortar
sonic thicket
#

The files will run from each client separately so that should be fine

#

@winter rose I've changed both images to 1024x512 but without luck, the same image still displays on both side rather then each side having its unique image

#

Strange is that if I define only this setObjectTextureGlobal [0, "image\trials\floravontuur4_1.jpg"]; then it displays on one side and the other side would be blank

hallow mortar
winter rose
sonic thicket
sonic thicket
winter rose
#

then don't

#

indeed

hallow mortar
#

That should be fine if they switch to the local variant of the command

winter rose
#

yep

hallow mortar
#

On the texture problem itself, just as an experimental thought, have you tried combining your two images into one 1024x1024 (pictures stacked one above the other) and seeing what that does when you plug it into the selection that textures both sides?

sonic thicket
#

I figured out what happened I think

#

Its being very weird though

#

some sort of cache somewhere, ill try and restart arma3 completely

winter rose
#

ah yes
once loaded, rename or restart

sonic thicket
#

Ah bummer that is why

#

Thanks for helping me out on this 🙂

hot kernel
#

I'm having a difficult time formatting a render surface dynamically.

Here's a non-dynamic test script that works,

camera_object = "Camera" camCreate (player modelToWorld [0,0,0]);
        camera_object cameraEffect ["internal","back", "render_surface"];
        "render_surface" setPiPEffect [0];

private     _display= (format ["#(argb,512,512,1)r2t(%1,1.0)", "render_surface"]);
screen_object setObjectTextureGlobal [0, _display];

This shows how I intend to format the render surface for texture format.

Here's the dynamic function I'm trying to create,

you_cam_create={
    params [["_cam", objNull, []], ["_target", objNull, []], ["_screen", [objNull], []], ["_effect", 0, []], ["_fov", 1, []], ["_surface", "rtt_1", []]];

        private _cam_obj = "Camera" camCreate (_cam modelToWorld [0,0,0]);
        _cam_obj cameraEffect ["internal","back", _surface];
        _surface setPiPEffect [_effect];
        _cam_obj camSetDir (position _cam vectorFromTo position _target);
        _cam_obj camSetFov _fov;
        _cam_obj camCommit 0;

        private     _display= (format ["#(argb,512,512,1)r2t(%1, 1.0)", _surface]);
        {
            _x setObjectTextureGlobal [0, _display]
        }forEach _screen;
true
};

the latter fails to apply the texture with a screen error about "likely incorrectly formatted texture...". Ironically the error message shows the texture formatted as it should be (ex. without string).

Want a repo with the objects?
Why can't I send a desired rtt surface name through params?

little raptor
hot kernel
#

@little raptor,
the space between my ears is the root problem, for sure. But more specifically?
😄

little raptor
#

"#(argb,512,512,1)r2t(%1, 1.0)"

#

it should be:
"#(argb,512,512,1)r2t(%1,1.0)"

hot kernel
#

I'll be so sad and yet relieved if that works...

#

Unfortunately not,
that is how it is formatted in the function which doesn't work,

private     _display= (format ["#(argb,512,512,1)r2t(%1, 1.0)", _surface]);
little raptor
hot kernel
#

Well I'd be happy to address general clunkiness as well but primarily I'd like to be able to send the desired string to define the surface (for later reference and to prevent overriding active displays)

little raptor
# hot kernel Well I'd be happy to address general clunkiness as well but primarily I'd like t...

one reason why I call it "clunky" is that you pass the surface name to it manually, while it should be handled by the function.
The second reason is all the unnecessary parameters
The third reason is , [] in params (which does nothing)
The forth reason is ["_screen", [objNull].... Why not: ["_screen", []]?

Also, I already use such thing in my mod, and it works perfectly fine. I'm almost 100% sure that the only problem with your function is the space

#

and in case you want to check:

_r2t = format ["dbug_r2t_%1", TAG(cams) pushBack _cam];
_cam cameraEffect ["terminate", "back", _r2t];
_cam cameraEffect ["Internal", "Back", _r2t];
_pic ctrlSetText format["#(argb,512,512,1)r2t(%1,1.0)", _r2t];
hot kernel
#

I want to define the surface name. Otherwise how do I output multiple surface without overriding?
There are no unnecessary params, there are three optional params.
The final array in the param is incase I ever decided to put a default type
_screen is an array in the script (objects in array)

hot kernel
#

so destroy the old surface before creating a new one?

little raptor
#

no

#

_r2t = format ["dbug_r2t_%1", TAG(cams) pushBack _cam];

#

creates a new r2d surface every time you call a function

#

_screen is an array in the script (objects in array)

#

Which is why it should be empty by default

hot kernel
#

ah okay that makes sense-- I'm still absorbing the above...

hallow mortar
#

before all else, can you just...try removing the space?

#

for science?

hot kernel
#

the space is missing in the script that works

little raptor
#

not add it

hot kernel
#

for science, you say?

little raptor
#

That's the current problem you're having

#

Not just "science"

#

I'm 100% sure of it

hot kernel
#

it isn't, I'm sorry. I gave it the old science try...

little raptor
#

and how does it look like right now?

hot kernel
#
private     _display= (format ["#(argb,512,512,1)r2t(%1,1.0)", _surface]);
hot kernel
little raptor
hot kernel
#

yes! I promise! Formatted like the default "rtt_1"

#

I'll let the function define the surface like you showed above.

#

@little raptor
thanks for your help!

little raptor
#

np

exotic flax
#

Short question: on the headless client, can I access "itself" with player?
All I want to know is the name of the HC which is currently running a script.

still forum
#

I think so

tough abyss
#

I hope this is the right channel. Does anyone know why I can't derap/read texHeaders.bin? cheers.

still forum
#

why do you want to?!

#

not the right channel, but doesn't matter

tough abyss
#

I am editing the CFP mod, editing the Iranian units to add modern equipment. However I am now am stuck at trying to add modern insignia/patches to them. I think the magic is in texHeaders.bin...

exotic flax
#

🤦‍♂️

tough abyss
#

I have done everything succesfully and stuck at adding insignias to them from the USP patches mod

exotic flax
#

you are aware CFP is on GitHub

tough abyss
#

Sorry man I am new to this lol...

exotic flax
#

and just a quick tip; don't mash mods together, or steal content from mods...

tough abyss
#

no not at all. I am mainly playing singleplayer and was doing a Iranian scenario.

exotic flax
#

so download both mods, and make your own loadout?

tough abyss
#

So I downloaded Iranian modern equipment to merge and "update" the units. To look more realistic in 2020 era

#

Yes but I am really new to this and my knowledge is very low.

#

I get an error everytime with the randomisedUnits.sqf when I try adding the insignias to them...

#

to the units.

still forum
#

texheaders.bin is not a file you ever touch

winter rose
tough abyss
#

Cheers. I have tried for hours to add insignias to them but get an error with randomisedUnits.sqf. The only thing why I am reverse editing the CFP files are because of their CFP randomisation feature. Cheers guys. Which channel is appropiate?

#

Config_makers?

still forum
#

I think thats probably best yeah

#

you add insignias in config

tough abyss
#

cheers m8

#

can we continue this in config makers..

hoary saddle
#

trying to get my friends and I to start a mission with a waking up animation, it works in editor, but not MP. Ideas?

winter rose
#

Ideas?
there is a mistake somewhere

exotic flax
ocean folio
#

oof no pictures here

#

cmere imgur

#

so I am trying to create a thick snowstorm, and I am using setFog to try and make it roll in somewhat gradually, but whenever the time is greater than 0 it doesnt seem to work right

winter rose
#

[ ]

ocean folio
#

i stg

#

1 setFog [1, 0.1, 250];

#

like that?

#

wait that works but then it becomes clear after

#

ah, it was my other numbers

#

thanks man

lean anchor
#

hey guys, i was wondering if it is possible to respawn the a vehicle ( a cas unit) with a crew and the same init and same name?
Would some advice and/or code so i can work it out

brazen lagoon
#

my initial guess is that I'd have to do it in intercept

warm hedge
#

Impossible

cosmic lichen
#

@brazen lagoon pythia might work as well

brazen lagoon
#

@cosmic lichen neat! now do you think you could load the actual texture data in that from a config path?

still forum
#

What exactly do you need the data for

brazen lagoon
#

trying to find the avg color of a texture

still forum
#

I have a mod that can dynamically load textures from in-game, and convert them to argb bitmap and send it out via websocket.

drifting sky
#

Are unit's weapons and mags automatically synced over the network? For example, if I addWeapon on the server, to a player unit, does the player automatically see that weapon on their end?

brazen lagoon
#

@still forum something like this but slightly modified to just calculate the avg color is what I want

still forum
#

What i do is. Find the PBO file on disk, that contains the texture.
Open it, extract the paa and parse it out

#

you don't need to calculate avgColor because thats already a property inside the paa that you can just read

brazen lagoon
#

OH

#

OK that makes this a ton easier

still forum
#

Its quite a bit of code though, and multiple of my projects combined together, in a C++ extension

brazen lagoon
#

I will come back to this it seems fun

brazen lagoon
#

@still forum can I ask what taccontrol is supposed to be?

still forum
#

Its a second screen/second computer/phone/tablet map display/utility thing.
Show map, place markers, draw lines, configure your ingame radios, transmit on your ingame radios with a proper panel-like thing, second screen for aircraft info like whether your gear is out or slingloading help or stuff

brazen lagoon
#

neat. kind of like athena?

still forum
#

Yes basically

#

Athena in new and better and completely open source and easy to extend with custom functionality

brazen lagoon
#

nice! that sounds very cool

#

I will be monitoring this bc something along these lines (like the one I had was opening the ALiVE tablet in another window/in a web page) would be cool

still forum
#

Sadly TacControl doesn't work yet because it needs features from next Arma update 😄

brazen lagoon
#

ah

sturdy patrol
#

dedmen sorry for writing here but is there any way to debug the class that is modifying the main menu

exotic flax
#

debug how?

#

you can check the Config Viewer (can be accessed from the editor) and check the current config

sturdy patrol
#

for example on editor i can view all the class for a armor

#

ok

#

i will try it

exotic flax
#

however it's not possible to see who or what made the changes

sturdy patrol
#

i only need the class name to add as a requiredAddon on my mod

final storm
#

main menu is RscDisplayMain if that what you want

#

inside A3_Ui_F

exotic flax
#

just add A3_Data_F_Oldman_Loadorder and you're done with it...
but again, this is the scripting channel, not #arma3_config

violet gull
#

Does this error imply that the physical position of an object is invalid or something:
21:33:53 Error position: <ch6+5),(ch7+5),(ch8+5)]};publicVariable">
(Client-side log)

still forum
#

That is not the error.
It just shows the position that a error occurred at.
Which error was it?

violet gull
#

Getting issue with my radio script -- made absolutely no changes to it, but it won't initialize properly on JIP -- dedicated server seems to not broadcast the publicVariables anymore upon init. Works if I client-host though/MP test.

#

Apparently the radio channels aren't being created with the correct name, they get created as "CUSTOM1" etc.

#

If I connect to my dedicated server and globally execute the block of code to create the radio channels server-side (Via debug console), it works

#
21:33:53   Error position: <ch6+5),(ch7+5),(ch8+5)]};publicVariable">
21:33:53   Error Undefined variable in expression: ch6
21:33:53 Transfer of uninitialized variables is not supported
21:33:53 Transfer of uninitialized variables is not supported
21:33:53 Transfer of uninitialized variables is not supported
21:33:54 Error in expression <{(_x#0)enableChannel[false,false];(_x#1)radioChannelRemove[r_p]}count[[_ch6,ch6]>
21:33:54   Error position: <radioChannelRemove[r_p]}count[[_ch6,ch6]>
21:33:54   Error Type Nothing, expected Bool
21:33:54 Error in expression <_ch6=(ch6+5);_ch7=(ch7+5);_ch8=(ch8+5);
if(pl>
21:33:54   Error position: <ch6+5);_ch7=(ch7+5);_ch8=(ch8+5);
if(pl>
21:33:54   Error Undefined variable in expression: ch6
21:33:54 Error in expression <awnTemplates")&&(true in channelEnabled(ch9+5)))then{(ch9+5)enableChannel[false,>
21:33:54   Error position: <ch9+5)))then{(ch9+5)enableChannel[false,>
21:33:54   Error Undefined variable in expression: ch9```
Client-side log
hot kernel
#

may we take another look at this,

you_cam_create={
    params [["_cam", objNull, []], ["_target", objNull, []], ["_screen", [objNull], []], ["_effect", 0, []], ["_fov", 1, []], ["_surface", "rtt_1", []]];

        private _cam_obj = "Camera" camCreate (_cam modelToWorld [0,0,0]);
        _cam_obj cameraEffect ["internal","back", _surface];
        _surface setPiPEffect [_effect];
        _cam_obj camSetDir (position _cam vectorFromTo position _target);
        _cam_obj camSetFov _fov;
        _cam_obj camCommit 0;

        private     _display= format ["#(argb,512,512,1)r2t(%1,1.0)", _surface];
        systemChat _display;
        {
            _x setObjectTextureGlobal [0, _display]
        }forEach _screen;
true
};

//call
[player, cam_target, [screen_obj_0]] call you_cam_create

I tried leo's alternative solution above but it produced the same result I've been getting. The screen turns on but doesn't display the feed (just white). Of course if "rtt_1" is used in place of the _surface param it works properly.

systemChat for _display shows the line is formatted correctly. I don't understand why _surface can't be a param.

slim oyster
#

params for accepted dataType with code (along with a boolean), like [false, {}] ?

#

["_groupInit", false, [false, {}]]

#

it doesn't seem to be accepting it

warm hedge
#
[{}] params [["_test",{},[{}]]] ;
_test```Worked for me
#

(Dev-Branch rn)

slim oyster
#

["_groupInit", {}, [{}]] works, but not with the additional dataType

#

I'll just forgo the bool if init is empty and return {}

warm hedge
#
[{}] params [["_test",false,[false,{}]]] ;
_test```Worked
little raptor
hot kernel
#

the conflict arises when a camera with that surface has been successfully made. In fact the whole game must be restarted to clear it. However I currently have not successfully created "rtt_1" surfaces since I launched the game for testing

violet gull
#

Any reason why this code works fine on clients but not on the dedicated server, unless I manually execute on server via debug window?


if((!(isServer&&hasInterface))&&(isNull player || didJIP))then{waitUntil{!isNull player};systemChat"[AFAR: JIP Detected]"};//JIP Compatibility

if((isClass(configFile>>"CfgPatches">>"task_force_radio"))||{(isClass(configFile>>"CfgPatches">>"acre_main"))})exitWith{};

#include"CFG.sqf"

{_x enableChannel[false,false]}count[0,1,2,3,4,6,7,8,9];

waitUntil{!isNil"r_chat"};

diag_log format["r_chat loaded: %1",r_chat];```The issue is that the variables that are supposed to be included via CFG.sqf aren't loading on the server. The script which spawns the code above is:
```[]spawn compileFinal(preprocessFile"AFAR\init.sqf");```
hot kernel
#

I mean the render surface string can be anything, including "render_surface". So I don't understand why it works when we say "render_surface" but when we say _surface to represent "render_surface" it doesn't. We use strings all the time, right? It's complicated only by the fact that in the texture format "render_surface" becomes, render_surface, as you know-- and we formatted to accommodate for that.

ripe sapphire
#

any idea why this wont work?

{_x enableSimulationGlobal true} forEach units aafjetsgrp;
#

group consists of 2 jets

#

maybe i need to enablesimulation their vehicles instead?

violet gull
#

Instead of referencing the group, need to reference the objects/vehicles.

ripe sapphire
#

ye the forEach units references each member

violet gull
#

Is it being called by host?

ripe sapphire
#

i guess that only enablesimulation the pilots

#

yes

#

if i do deletevehicle it deletes the pilots

violet gull
#

Yeah that will work for pilots only

#

{_x enableSimulationGlobal true;(objectParent _x)enableSimulationGlobal true} forEach units aafjetsgrp;

#

That should work for the pilots and their vehicle

ripe sapphire
#

confirmed thank you!

thorny rampart
#

How do you play effects locally for a player that walks into the trigger,
I basically want a object that emits an effect that causes the players vision to get blurry and it acts like a sharp headache pain.

Any idea how I would go about making this.

violet gull
#

Could try to set condition as:
this && player inArea thisTrigger

thorny rampart
#

But does it do it locally?

violet gull
#

The player check should make it local

thorny rampart
#

Still gotta figure out how to do the effects also

violet gull
#

I personally just create local triggers for players and the server

thorny rampart
#

how do you make the trigger locally? especially for a sound

violet gull
#

_myHappyLittleTrigger01 = createTrigger["EmptyDetector",_whateverPosition,false];

#

Third parameter makes it local or global, as long as it is being created where you want it local. So if you do it on initServer.sqf, it will be local to server. If you do it in initPlayerLocal.sqf, it'll be local to player.

thorny rampart
#

Got it

lunar plume
#

Hello, I hope you are well?
I found a script that allows to put two weapons in the back but problem this script would have an error and I don't know anything about script I would like to know if someone could help me to fix this little problem thank you

ebon citrus
#

@lunar plume saying what the error is could help people get started in helping you

lunar plume
#

yes sorry i'm new

winter rose
#

Hi new, I'm dad!

lunar plume
#

seriously

warm hedge
#

He's always serious

winter rose
#

jokingly 😁

lunar plume
#
Player setUserActionText [|#|action_hideWpn, format [localize "str_ac...'
Error Indefinite variable in an expression action_hidewpn
File E/\Documents\Arma 3 - Other 
Profile\Perceval\Mpmissions\Malden.Malden\scripts\misc\Weapon\AALSSW.sqf...,
line 402

#

LOL @winter rose

#

here is the error displayed when I use the script

winter rose
willow hound
#

https://github.com/nesmonartis/AALSSW/blob/master/AALSSW.sqf#L394
action_hideWpn is only defined if ACE is active (see the link above), but it is later used without checking for ACE presence again.
Thus, when the code is executed without ACE running, it tries to access the variable action_hideWpn despite that variable not existing.

drowsy plank
#

As I have been told this is the best place for this:
In a cut scene in multiplayer is there anyway I can have it as if everyone is looking through the eyes of someone in a animation?

slate cypress
#

If the animated person isn’t a player then I think you might have to update the local cameras in a loop

#

Unless there is a method for targeting a moving object

little raptor
heady quiver
#

Hi guys im trying to connect a object (laptop) to some markers with setRandomSpawn but they wont connect for some reason..

still forum
still forum
#

&&{(didJIP)}
why are you wasting performance with lazy eval here?

Have you checked that didJIP actually returns false on dedicated server?

[]spawn compileFinal(preprocessFile"AFAR\init.sqf");
that compileFinal is nonsense, same as the needless paranthesis there
Why not just use execVM?

Any reason why this code works fine on clients but not on the dedicated server
Well have you added logging and checked where it actually stops or doesn't work. That would show you the reason.

heady quiver
#

Nevermind, im stupid. 🙂

west portal
#

How to enable the other sides in Zeus modules, without adding the sides' lobby slots (that can't be removed in not-started-mission lobby) ? (only blue and civ is available in Control Sector and etc)

proper sail
#

Is there an easy way to find out where wrong color format error/warning comes from?

autumn swift
#

Question regarding the output of the actionKeys command. If I for example do actionKeys "User7" with User action 7 being bound to the T key then I correctly get [20] as expected. However if I rebind User7 to something like Ctrl + T then the output is [4.87784e+008] which is weird because I do not understand how it calculated this huge number. I need to be able to check this in KeyDown and determine if the keybinding includes the ctrl or not.

distant oyster
proper sail
#

wrong color format

#

Thats it

distant oyster
#

is it getting logged only in the mission?

proper sail
#

yes

distant oyster
#

so i suppose it has to do with one of the mission files? have you tried an empty mission and see if it still occurs?

proper sail
#

yes i know it has to do with our mission files

#

no it doesnt occur with empty mission file

#

A bunch of mods got updated, and now our mission file spams this

distant oyster
#

might be a structured text with wrong attributes. correct format would be: <t color='#RRGGBB'>text</t> or <t color='#AARRGGBB'>text</t>

proper sail
#

Right

#

Ill check everything again, but it only happens ever I updated the main mod. Maybe there is some reference which got changed and now the function im hooking into is spamming this

distant oyster
proper sail
#

Interesting, im on a2 tho. But might still be relatable

distant oyster
#

given the same warning message it's a very good chance it might be the cause

proper sail
#

Ill have a look at our statusbar and gui's that constantly update

#

Thanks chief

distant oyster
#

np

smoky rune
#

What happens to player's event handlers when player dies and respawns? is there any need to manually remove them in onPlayerRespawn.sqf?

fresh wyvern
#

Hi. Anyone who know how to spawn in a scripted vehicle (Black Wasp) with a preset loadout?
(etc
["PylonRack_Missile_AMRAAM_D_x2","PylonRack_Missile_AMRAAM_D_x2","PylonRack_Missile_AGM_02_x2","PylonRack_Missile_AGM_02_x2","PylonMissile_Missile_BIM9X_x1","PylonMissile_Missile_BIM9X_x1","PylonMissile_Missile_AMRAAM_D_INT_x1","PylonMissile_Missile_AMRAAM_D_INT_x1","PylonRack_Bomb_SDB_x4","PylonRack_Bomb_SDB_x4","PylonMissile_1Rnd_BombCluster_01_F","PylonMissile_1Rnd_BombCluster_01_F"];
)

hallow mortar
hot kernel
#

I was bugging yesterday about my cam-to-screen function not working properly. The screen would only show white and I thought it was an issue with formatting the render surface for texture format. Turns out the function was working properly the whole time (sorry leo)-- however the feed will not display until player walks near the screen. This is of course not usual behavior. Render surfaces created outside of the function display immediately regardless of distance.

Any idea why the texture won't display until player is ~1 m from screen object? Once displaying properly the screen will continue playing regardless of distance.

So weird.

hot kernel
#

note: the distance required to start the feed seems to be relative to the size of the screen object. EX ~1 m for a computer screen but several meters for a billboard.

little raptor
hot kernel
#

That's what I was thinking it just seemed sloppy. As a test I sent "player" as a screen object and it worked straight away (but of course turned me into the predator).

little raptor
#

I said ctrl

#

not object

hot kernel
#

okay, how does that look?

little raptor
#

what?

hot kernel
#

a ctrl?

little raptor
#

do you even know what a ctrl is?

hot kernel
#

apparently not...

little raptor
exotic flax
#

Any idea why the texture won't display until player is ~1 m from screen object? Once displaying properly the screen will continue playing regardless of distance.
I have seen the same issue with normal textures as well; seems to be related to how heavy the texture is us.

little raptor
#

create an RscPicture ctrl on display 46

#

@hot kernel
example:

_pic = findDisplay 46 ctrlCreate ["RscPicture", -1];
_pic ctrlSetText _r2t;
ctrlDelete _pic;
hot kernel
#

@little raptor ,
That totally works. I have to spawn the ctrlDelete with a brief sleep but it works. Can I hide the ctrl for that 1/2 second?

little raptor
#

it might be better to show the ctrl somewhere else

#

eg display 12 (map)

hot kernel
#

it seems like the ctrl briefly showing onscreen is actually what makes it work. This will have to do for now. Thanks again for your help, @little raptor

little raptor
hot kernel
#

oh I did try both (a different display 12) and ctrlShow-- I'll try ctrlSetFade

austere hawk
#

thonk did anyone try making a crane via attaching a fake helicopter to the crane and using its cargo lifting functionality yet?

pale finch
#

why does the AI squad get out of the car im driving (vip_car) after I teleport them into it?

_units = Units vip_group;
vip_group addVehicle vip_car;
{_x AssignAsCargo vip_car} ForEach _units;
_units orderGetIn true;
{_x moveInCargo vip_car} ForEach _units;
#

Also

{_x AssignAsCargo vip_car} ForEach _units;
_units orderGetIn true;

does nothing.

lunar plume
#

thank you for the prompt response @winter rose and @willow hound

pale finch
#

yes

#

well no I tell them to get in at a certain waypoint, and it does nothing

#

even if i teleport them they just get out

winter rose
#

mods?

pale finch
#

ace, most of the CUP stuff

#

that's it

little raptor
pale finch
#

They have a "unload" waypoint out of a heli, and then I have get in vip_car code the "on activation" part of the unload waypoint

#

But "On Activation" should mean the waypoint has been completed, right?

winter rose
hallow mortar
#

When you say get in vip_car is that just a simplified representation of the real code or is that the actual real code you put?

#

Because if it's the actual real code........that's not how you do it

#

if it's just a representation and the real code is proper, try either a Get In waypoint type, or also using assignAsCargo

hallow mortar
#

oh ok then

#

try vip_car setUnloadInCombat [false,false]

pale finch
#

ok it works, but is there any way to get them in the car without teleporting? They're just standing there.

pale finch
#

How do I create waypoints via scripting?

pale finch
#

Thanks for the help @hallow mortar and @winter rose

dreamy kestrel
#

Q: dealing with an odd stringtable issue, what is cannot be localized client-side - move to global stringtable (?). the keys in question are in a <Package name="General"/> grouping at the moment, but I gather the keys need to be moved out of that package?

winter rose
#

packages don't impact anything

#

they are only a sorting info, nothing more.

winter rose
pale finch
# winter rose the `GET IN` waypoint?

I tried doing this but they're just standing outside the car.

_units = Units vip_group;
vip_group addVehicle vip_car;
{_x AssignAsCargo vip_car} ForEach _units;
_units orderGetIn true;
wp = vip_group addWaypoint [vip_car, 0];
wp waypointAttachVehicle vip_car;
vip_car setUnloadInCombat [false,false];
hallow mortar
#

setWaypointType otherwise it's just a move waypoint

#

also, check whether the car is locked

winter rose
fresh wyvern
dreamy kestrel
#

@winter rose re: General, no, for brevity. that is the package containing the keys in question.

fresh wyvern
#

Anyone who knows how to make the "ModuleWLSpawnPoint_F" in warlords also work so that it sends the same vehicles to each other connected sector when they in turn is targeted?

winter rose
dreamy kestrel
#

@winter rose yes ofc, no worries. based on the error, I assume I probably cannot present the keys in that package. only question is how/where else to present them.

winter rose
#

it seems that they are simply not detected, so idk really 🤷‍♂️

dreamy kestrel
#

hmm, well, they are 'there', I know that much. unless it is an engine timing thing pulling assets from an SSD, or even an NVMe.

#

the full message is literally, i.e. 13:55:12 @STR_KPLIB_TITLE: string @STR_KPLIB_TITLE cannot be localized client-side - move to global stringtable

winter rose
#

to me it says "cannot find the key, let's see in the game itself" or something

dreamy kestrel
#

except it is there, i.e. <Package name="General"><Key ID="STR_KPLIB_TITLE"/></Package> (brevity)

winter rose
#

(brevity)
yeah, I was jumping on that already 😄

#

with xml utf8 header etc?

dreamy kestrel
#

because XML syntax, you know 😉

winter rose
dreamy kestrel
#

yes, along the lines of, <?xml version="1.0" encoding="UTF-8"?><Project name="..."><Package name="General"/></Project>

winter rose
#

but I have never seen/heard the game not loading stringtables?

#

where is the stringtable located, how is it named?

dreamy kestrel
#

it is located and named in the expected places, I get localize working in many, many spots.

#

the error seems to happen when A3 is warming up from cold launch.

winter rose
#

(I honestly expect a weird > somewhere 😆)

dreamy kestrel
#

to me it seems like maybe a timing issue loading assets during description.ext evaluation

#

another (related?) symptom is that the MP slots do not appear while A3 is thinking about finding the keys

winter rose
#

you mean, it is a mod-loading issue?

dreamy kestrel
#

yes, while loading the mission

exotic flax
#
hint localize "str_BIS_Discord_WrongChannel";
``` works perfectly fine
dreamy kestrel
#

So, it's in the mission file itself. Maybe I should leave those for description.ext to setup.

briefingName="@STR_KPLIB_TITLE";
overviewText="@STR_KPLIB_DESCRIPTION";
#

i.e.

briefingName = $STR_KPLIB_TITLE;
#

which would explain, when mission first loads, has not seen the string table yet.

spice axle
#

I have a global variable like MyGlobalVariable and i want to pass the var to a function.
Is this a pass by reference or is it a duplicate?
if i do:

_fnc_myFunction = {
    _this select 0 = (_this select 0) + 1;
};

[MyGlobalVariable] call _fnc_myFunction;

Will it work?

winter rose
#

it will work (passing the array)

#

if MyGlobalVariable is an array, it will be passed as reference - use +MyGlobalVariable to copy it

spice axle
#

@winter rose but how would I assign _this select 0 to something since above function will return an error

winter rose
#

_this set [0, value]

winter rose
spice axle
#

this is not working.
Debug console:

KATVariable = 0;
_fnc_increaseGVAR = {
    _this set [0, (_this select 0) + 1];
};
[KATVariable] call _fnc_increaseGVAR;

KATVariable will still be 0 on server exec

winter rose
#

yes but you should adapt to your code

#

here would be sqf (_this select 0) set [0, (_this select 0 select 0) + 1]

#

ooor, use params 👀

spice axle
#

params will create a private var for it iirc

winter rose
#

a local variable to the reference

_fnc_increaseGVAR = {
  params [["_array", [], [[]]];
  _array set [0, (_array select 0) + 1];
};
#

it will not copy an array, just make a private variable to its reference

willow hound
#

What are you doing

#

KATVariable is a Number...

winter rose
#

oh, yes xD

#

his select threw me off!!!1!

willow hound
#

Modifying _this inside a function won't have any outside effect...

winter rose
#

you would need to send the variable as string, and use missionNamespace @spice axle

spice axle
#

I complicated it myself

#

It is a array but for easier test I used a integer. Works now, thanks

willow hound
winter rose
#
var1 = 0;
var2 = 0;
private _fnc_addOne = {
  private _value = missionNamespace getVariable [_this, 0];
  missionNamespace setVariable [_this, _value + 1];
};

"var1" call _fnc_addOne; // var1 = 1
violet gull
#

@still forum NEVERMIND MY UNREADABLE CHINESE CODE!!! corvid19pepe

Also #include"CFG.sqf" works without a whitespace, at least in MP client host and when I manually execute it via debug console (Have to change path if I do it via debug console). I think I need to add a sleep after the #include, some reason the waitUntil after isn't doing the trick.

still forum
#

"and when I manually execute it via debug console" huh? debug console has no preprocessor

violet gull
#

Oh nevermind, this is the code I execute manually in the debug console and it sudden works:

if(isServer)then{
waitUntil{!isNil"r_mCHName"};diag_log format["r_mCHName loaded: %1",r_mCHName];
private _txt="("+r_mCHName+") "+"%UNIT_NAME";private _txt2=" channel";
ch6=radioChannelCreate[[0.2,0.2,1,0.8],r_mCHName+_txt2,_txt,[]];
ch7=radioChannelCreate[[0.2,1,0.2,0.8],r_mCHName+_txt2,_txt,[]];
ch8=radioChannelCreate[[1,0.2,0.2,0.8],r_mCHName+_txt2,_txt,[]];
{publicVariable _x}forEach["ch6","ch7","ch8"];
ch9=13;
if("Spectator"in getMissionConfigValue"respawnTemplates")then{ch9=radioChannelCreate[[0.2,1,1,0.8],"Spectator channel","(Spectator) %UNIT_NAME",[]]};
publicVariable"ch9"};
still forum
violet gull
#

The issue is that r_mCHName (Name of radio channel) isn't loaded on server via the #include like it's supposed to, so it creates the channel as CUSTOM1 or something and doesn't store it as ch6

still forum
#

🚪 👈

violet gull
#

My code is beautiful and very readable

#

FOR BLIND PEOPLE HAHAHHAHA

#

((((((My code)still doesn't like)to work when)I init it on)a dedicated)server)

violet gull
dreamy kestrel
#

Q: maybe an obvious stupid question... is there a way to embed unicode characters, like a checkmark, in structured text? i.e. that I could add in a list box. or better yet, even a baked in .paa image that I could lever.

winter rose
#

you can add image to structured text iirc?

violet gull
#

Can you not #include code inside of this spawned script:
[]spawn compileFinal(preprocessFileLineNumbers"AFAR\init.sqf");

#include isn't working unless I execute it through the Leopard20's sexy Advanced Debug Console thingy on the server... works fine on clients though.

violet gull
#

Figured it out... some reason these lines in the beginning cause the server to exit or wait indefinitely:

if((!(hasInterface))&&{(didJIP)})exitWith{};//Do not initialize on HC

if((!(isServer&&hasInterface))&&(isNull player || didJIP))then{waitUntil{!isNull player};systemChat"[AFAR: JIP Detected]"};//JIP Compatibility

if((isClass(configFile>>"CfgPatches">>"task_force_radio"))||{(isClass(configFile>>"CfgPatches">>"acre_main"))})exitWith{};```Not sure which one yet, probably the 2nd check
winter rose
#

(see pinned message)

violet gull
#

Is it not?

winter rose
#

negative

violet gull
#

ooooh that's cool

#

Good to know. Reading good.

winter rose
#

(((too))) many (((parentheses)))

#

notenoughspaces

#
if((!(hasInterface))&&{(didJIP)})exitWith{}; // bad

if (!hasInterface && { didJIP }) exitWith {}; // good
violet gull
#

Sometimes I get an error for the ! if it's not before parenthesis so I developed a fun habit of making my code even less readable to avoid it hehe

winter rose
#

yeah, ! needs a direct boolean or nular or unary operator, e.g```sqf
!isServer
!alive player
!player in jeep // error, "!player" cannot be processed

violet gull
#

okie

#

Huh... that fixed it.

still forum
#

or my habit
if !(bla bla bla)

winter rose
#

I dislike it, but I dislike if (!(bla bla bla)) even more

dreamy kestrel
#

i.e. "<t>&#2714;</t>" for a listnbox element? does not seem to like the structured text. or know how to decode a unicode checkmark.

dreamy kestrel
#

I get those. specifically, inserting such a structured text into an listnbox as one of its element.

distant oyster
#

listnbox does not support structured text

dreamy kestrel
#

ah, right. fair nuff. thanks.

#

anyone happen to know what the checkmark image path is in CBA?

hot kernel
#

how should I do something like this,

_val=3;
_array=[3, 6, 9];
if (_val in _array) then {
    _val_array_pos= ??? (want to return 0)
}

?

#

how do I get the index value for the found element?

winter rose
#

find

idle jungle
#

hey guys does anyone know how i can turn this script below into damage replenish rather than fuel?

_vehicle = (_this select 0); 
_h = [_vehicle]spawn
{while {true} do
{ if ((fuel (_this select 0)) < 0.8) then         
{ (_this select 0) setFuel 1;};```
#

i tried replacing the word fuel -> damage and setdamage 0 rather than setfuel

little raptor
#

wat?

#

a while loop without sleep?

idle jungle
#

i found the script on the forums lol i didnt make it

little raptor
#

well it's a horrible script

idle jungle
#

where should the sleep go?

#

oh okay haha

little raptor
#

inside the loop

idle jungle
#

so without the sleep the games constantly checking every like milisecond?

little raptor
#

but the sleep is not the only pronlem

little raptor
idle jungle
#

omg

#

nawty

hot kernel
#

@winter rose , thanks!

idle jungle
#

so wheres the loop im not so knowledgeable in loops

#

ah sqf _vehicle = (_this select 0); _h = [_vehicle]spawn {while {true} do { if ((fuel (_this select 0)) < 0.8) then { (_this select 0) setFuel 1;}; sleep 120;};};

little raptor
#

@idle jungle this is a more "normal" replenish script:

while {true} do {
_veh setFuel ((fuel _veh + 0.1) min 1);
sleep 1;
};

damage variant:

while {true} do {
_veh setDamage ((getDammage _veh - 0.1) max 0);
sleep 1;
};
#

it works by increments

idle jungle
#

thats very nice of you thanks a lot

little raptor
#

not "if fuel less than 80% jump to 100%"

idle jungle
#

Very kind of you 🙂

#

while im at it..

this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]``` is this okay lol
spice axle
#

It is

idle jungle
#
while {true} do { 
_veh set>
 2:29:32   Error position: <sleep 1; 
};
while {true} do { 
_veh set>
 2:29:32   Error Generic error in expression
 2:29:32 Suspending not allowed in this context
 2:29:32 Error in expression <veh setFuel ((fuel _veh + 0.1) min 1); 
sleep 1; ``` i had that error come up leopard
hallow mortar
#

You're trying to run this script in an unscheduled environment. In other words, you're running it in the wrong place. Where are you currently running it? (e.g. script .sqf file, object init field, etc.)

idle jungle
#

init field

hallow mortar
#

there's your problem

#

what's the full code in the init field?

idle jungle
#
while {true} do {
_veh setFuel ((fuel _veh + 0.1) min 1);
sleep 1;
};
while {true} do {
_veh setDamage ((getDammage _veh - 0.1) max 0);
sleep 1;
};
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}];```
#

i dont want it on every vehicle

hallow mortar
#

Where is _veh being defined?

idle jungle
#

its probably not lol

#

im novice

hallow mortar
#

well, that's your other problem

#

At the top of the vehicle's Attributes window, you'll see a field marked "variable name". Put something recognisable in that.

idle jungle
#
_vehicle = (_this select 0); 
_h = [_vehicle]spawn
{while {true} do
{ if ((fuel (_this select 0)) < 0.8) then         
{ (_this select 0) setFuel 1;};          
sleep 120;};};``` 

i was using that one but im told its very resource intensive
#

im familair with variable names 🙂 yeah

hallow mortar
#

Just give me a second, I need to sort this script out

idle jungle
#

okie doke thank you

hallow mortar
#

Okay. Make a file in your mission directory called replenish.sqf (or whatever you like but ends in .sqf). Open it in a text editor and put this in it:

params ["_veh"];

{
    _x addEventHandler ["Fired",{[(_this select 0),1] remoteExec ["setVehicleAmmo",(_this select 0)];}];

    [_x] spawn {
        
      params ["_veh"];
        
      while {true} do {
        [_veh,((fuel _veh + 0.1) min 1)] remoteExec ["setFuel",_veh];
        [_veh,((getDammage _veh - 0.1) max 0)] remoteExec ["setDamage",_veh];
            sleep 1;
        };
    };
} forEach _veh;```
Now create another file called `initServer.sqf` and put this in it:
```sqf
[[VEHVARNAME]] execVM "replenish.sqf";

Now if you have multiple vehicles you want to apply this to, you can do this:

[[VEHVARNAME1,VEHVARNAME2]] execVM "replenish.sqf";
#

And don't put anything in the init field, otherwise Lou Montana comes to your house at night and breaks your legs

#

I can sense someone coming to breathe down my neck about that spawn, so here's my logic: yes, it would work without it, but someone after me could put something after the loop then be surprised when it doesn't work. The spawn makes it expansion-safe(r)

agile pumice
#

I'm messing around in the editor with projectiles with a little proof of concept

_player addEventHandler ["Fired", {
    params [
        "_unit", 
        "_weapon", 
        "_muzzle", 
        "_mode", 
        "_ammo", 
        "_magazine", 
        "_projectile"
    ];
    
    if (isNull _projectile) then {
        _projectile = nearestObject [_unit, _ammo];
    };
    
    _pos = getpos _projectile;
    _vectorDir = vectorDir _projectile;
    _speed = speed _projectile;
    deleteVehicle _projectile;
    _missile = "Missile_AA_04_F" createVehicle _pos;
    _missile setVectorDir _vectorDir;
    _missile setspeed _speed;
}];
#

how would I accomplish something like this? replacing a projectile

hallow mortar
#

Are you sure you want speed/setSpeed rather than velocity/setVelocity?

agile pumice
#

its probably velocity

#

I forgot about velocity haha

hallow mortar
#

Otherwise you're pretty close afaik, with the caveat that smart projectiles like missiles will not be made active/locked/guided/etc by default

hallow mortar
#

Ooh, you can use setMissileTarget if you want to make the missiles work...... probably

#

You probably want setVectorDirAndUp too as vectorDir is 2D only

reef edge
#

create

thorny rampart
#

Is it possible to use the CBRN Hoses for the gas masks in multiplayer?

final storm
#

context?

thorny rampart
final storm
#

are you asking if the bi function works in multiplayer?

thorny rampart
#

Yes

final storm
#

i dont see why not

thorny rampart
#

Well It woked fine singleplayer and now im hosting it, theres no hose

final storm
#

needs to be executed localy tho

thorny rampart
#

idk how to do that

#

Like what do you mean it needs to be executed locally

#

So put it in the init file?
player call BIN_fnc_CBRNHoseInit;

final storm
#

can you just put it in the unit init?

thorny rampart
#

I did but the hose doesnt appear

#

it only worked for singleplayer

#

and now im trying to get it to work for multiplayer

final storm
#

Im not sure sorry, maybe someone else has an answer

thorny rampart
#

all good

#

I figured the reason, it's the respawning when you respawn on a position it gets rid of it.

warm hedge
#

Then do remoteExecCall maybe

thorny rampart
#

Im using this line of code.

(backpackContainer this) setObjectTexture [1, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
(backpackContainer this) setObjectTexture [2, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
this linkItem "G_AirPurifyingRespirator_02_black_nofilter_F";  
#

Which is on the unit.init

final storm
#

use setObjectTextureGlobal

#

maybe

thorny rampart
#

Lets see

#

Nah

#

didnt work

warm hedge
#
this remoteExecCall ["BIN_fnc_CBRNHoseInit"];```Maybe? It's pretty sure meant to use only in singleplayer, so make sure everyone's running it
thorny rampart
#

It's gonna be on all the units.

warm hedge
#

Wha?

thorny rampart
#

So using that removed the gasmask completely

warm hedge
#

Excuse me?

thorny rampart
#

Okay so using that line of code on the init of the unit got rid of the mask completely.

warm hedge
#

Looks like BIN_fnc_CBRNHoseInit will refuse to do that when trying to do that in multiplayer. Gotta do some workaround?

thorny rampart
#

Well the code I posted earlier worked when you first spawn in.

#

but as soon as you die and respawn it gets rid of it

warm hedge
#

Because respawned unit isn't the unit who died

thorny rampart
#

I wonder if I can just do a trigger that calls that code

#

what would I put in the condition if I only want it to do it locally for the person who activates it

warm hedge
#

No trigger is preferred to call when a respawn, but Event Handler

thorny rampart
#

I didnt catch that.

thorny rampart
#

So I put that on the trigger?

#

Doesnt really say where i put it

warm hedge
#

No trigger, nono. Init line preferred:

if (local this) then {
  this addEventHandler ["Respawn", {
    params ["_unit", "_corpse"];
    (backpackContainer _unit) setObjectTextureGlobal [1, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
    (backpackContainer _unit) setObjectTextureGlobal [2, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
    _unit linkItem "G_AirPurifyingRespirator_02_black_nofilter_F";  
  }];
};```I think?
thorny rampart
#

Oh ok

#

Learning how arma's code works

#

Yeah doesnt seem to be working.

#

hold on

#

Nah the code didnt work.

warm hedge
#

Hmm

thorny rampart
#

frustrating

#

remoteExec'ed?

#

Like hit escape and exec it server side?

cosmic lichen
#

I updated the code

#

This should work in multiplayer

thorny rampart
#

I was gonna say Im not seeing a hose

cosmic lichen
#

although

#

no

#

The function will actually exit on remote machines

little raptor
#

Function must be executed where the unit is local.

cosmic lichen
#

so forget about remote exec

warm hedge
#

I think BIN_fnc_CBRNHoseInit uses setObjectTexture and filters local units?

thorny rampart
#

Yeah the new code still doesnt work

#

Think this would work locally?

cosmic lichen
#

Is a mod an option for you @thorny rampart ? Because I think there is a mod which does all that

thorny rampart
#

Yeah a mod is an option

#

Just figured Id try to use scripting to try and learn

#

How would you make this code exec locally

#
(backpackContainer this) setObjectTexture [1, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"]; 
(backpackContainer this) setObjectTexture [2, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"]; 
this linkItem "G_AirPurifyingRespirator_01_nofilter_F";
cosmic lichen
#

if (local this) then { your code };

thorny rampart
#

Does this look right

if (local this) then {  
  this addEventHandler ["Respawn", {  
    params ["_unit"];  
    (backpackContainer this) setObjectTexture [1, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
(backpackContainer this) setObjectTexture [2, "a3\supplies_f_enoch\bags\data\b_cur_01_co.paa"];  
this linkItem "G_AirPurifyingRespirator_01_nofilter_F";  }];  
};
little raptor
#

no

cosmic lichen
#

this is incorrect

#

inside the event handler

warm hedge
#

There's no this in an Event Handler

thorny rampart
#

So just get rid of the this

warm hedge
#

Replace with _unit

thorny rampart
#

Okay yeah that code didnt work

#

Just gonna get the mod and work on other things

#

Thanks for the help though guys

drowsy plank
#

Does anyone know if you can do that?

ebon citrus
drowsy plank
#

Great thanks!

little raptor
#

Why do you ask the same question?

meager granite
#

So, after all these years, is there a way to reliably tell if unit is in ragdoll state or not?

ebon citrus
#

i just removed ragdolls

#

replaced them with static animations from arma 2

#

arma 2 was better anyways

#

when i return to arma 3, i will probably continue my arma 2 arma 3 conversion project

#

we cant backport from arma 3 to arma 2

#

but nobody is stopping us from porting from arma 2 to arma 3

thorn saffron
#

Is there any command to get the all the enemies a specific units knows about or do I have to construct that one myself with select and knowsAbout?

finite sail
#

erm, perhaps I'm being silly, but am I doing something wrong with resize?

#

its ferusing to make arrays smaller

#

*refusing

#

getpos player ... [9728.38,22282.3,0.00143814]

#

(getpos player) resize 2 ... nothing

#

in debug

#

tried resizing testv arrays too, like [1,2,3,4,5]

#

resize 2 on that

#

no return

#

also.. on the test array, resize 8 gives nothing

cosmic lichen
#

resize doesn't return anything, you are aware of that?

finite sail
#

yes, it returns to resized

#

ah no

#

it changes the imput

cosmic lichen
#

it modifies the original array

#

doesn't create a new one

finite sail
#

so, it cant change a pos

cosmic lichen
#

sure it can

#

_pos = getPos player;
_pos resize 2;

finite sail
#

yeah,, but getpos player resize 2 wont work

cosmic lichen
#

no

finite sail
#

because debug is getting the pos constantly

cosmic lichen
#

well it probably does, but no way to return it

finite sail
#

ya

#

ok, so the answer to the original question is... yes, I am doing something silly

#

would be nice to have a getPos2d command

#

[x,y]

cosmic lichen
#

Don't need that often.

exotic flax
#

and most other commands are able to handle both 2d and 3d positions, so I don't think there's much reason for it 🤔

crude vigil
#

@finite sail I dont know what you are up to, but maybe select? as in ... (getpos player) select [0,2];

finite sail
#

yes, that is what im doing 🙂

#

thanks everyone

pine solstice
#
waitUntil {!isNull player};
_unit = _this select 0;

removeAllWeapons this;
removeallassigneditems this;
removeallcontainers this;
removeuniform this;
removevest this;
removebackpack this;
//====  GEAR  ====//
_unit addVest "VSM_LBT6094_MG_Multicam";
_unit addUniform "VSM_Multicam_BDU_Camo";
_unit addBackPack "VSM_Multicam_carryall";
_unit addGoggles "rhs_ess_black";
_unit addHeadgear "VSM_Mich2000_2_Multicam";
//====  ITEMS  ====//
_unit linkItem 'ItemWatch';
_unit linkItem 'ItemMap';
_unit linkItem 'ItemCompass';
_unit linkItem 'TFAR_anprc152';
_unit linkItem 'Itemandroid';
_unit addWeapon 'Binocular';
_unit addWeapon 'NVGoggles';
//====  MAIN WEAPON  ====//
_unit addWeapon "rhs_weap_m4a1_blockII_d";
_unit addPrimaryWeaponItem "CUP_muzzle_snds_M16_desert";
_unit addPrimaryWeaponItem "CUP_acc_ANPEQ_15_Top_Flashlight_Tan_L";
_unit addPrimaryWeaponItem "ACE_optic_Arco_PIP";
_unit addPrimaryWeaponItem "CUP_bipod_VLTOR_Modpod";
//==== ADD TO UNIFORM ====//
_unit addItemToUniform "ACE_EarPlugs";
_unit addItemToUniform "ACE_splint";
_unit addItemToUniform "ACE_tourniquet";
_unit addItemToUniform "ACE_EntrenchingTool";
for "_i" from 1 to 20 do {_unit addItemToUniform "ACE_elasticBandage";};
for "_i" from 1 to 10 do {_unit addItemToUniform "ACE_morphine";};
for "_i" from 1 to 5 do {_unit addItemToUniform "ACE_epinephrine";};
//==== ADD TO VEST ====//
_unit addItemToVest "B_IR_Grenade";
for "_i" from 1 to 4 do {_unit addItemToVest "SmokeShell";};
for "_i" from 1 to 4 do {_unit addItemToVest "HandGrenade";};
for "_i" from 1 to 20 do {_unit addItemToVest "rhs_mag_30Rnd_556x45_M855A1_Stanag";};

//==== ADD TO BACK PACK ====//
for "_i" from 1 to 20 do {_unit addItemToBackpack "rhs_mag_30Rnd_556x45_M855A1_Stanag";};
if(true) exitWith{};
#

I have made a custom loadout the problem i have is in the editor the backpack is on my back but when I start up a server the backpack isn't there. wonder if I could get some help

thorn saffron
#

Maybe the script only runs locally?

pine solstice
#

i call it on the players init everything else works just the backpack not being there

tribal onyx
#

Maybe that backpack doesn't exist? (as in typo or something)

hallow mortar
#

First of all, don't put it in the init. Every time someone joins the game the script will run again

#

Furthermore, why are you doing this as a script and not just using the 3den loadout editor?

pseudo kernel
#

How to make ai heli avoid flying over e. g. 150 m? What i want, is to avoid losing speed by pulling up heli nose.

tribal onyx
hallow mortar
#

forceAddUniform is for the uniform slot, not backpacks

tribal onyx
pine solstice
# tribal onyx check the RPT files?
waitUntil {!isNull player};

_unit = _this select 0>
2021/02/07, 15:27:08   Error position: <!isNull player};

_unit = _this select 0>
2021/02/07, 15:27:08   Error Generic error in expression```
thorn saffron
#

@pseudo kernel flyInHeight

pseudo kernel
#

tried

hallow mortar
#

flyInHeightASL?

pseudo kernel
#

too.

#

Even with that, ai still pulls up nose.

hallow mortar
#

AI helo control is kind of semi-impossible so there isn't a good answer

#

Best you could do is to unitCapture the flight, but obviously that doesn't work for every application

hallow mortar
tribal onyx
#

Or how exactly are you calling this script?

pine solstice
#

[this] call compile preprocessFileLineNumbers "loadouts\Medic.sqf";

#

putting this in the players init

tribal onyx
pine solstice
#

i tried this too and got the same result

tribal onyx
thorn saffron
#

I'm trying to get classnames of terrain objects like wrecks and stuff. I am able to detect the nearestTerrainObjects. However car wrecks do not return their classname if I use typeOf it just returns "". The telephone poles and such properly return the classname. I checked the configs and the wreck has the class and all in cfgVehicles.

tribal onyx
#

Actually... why even have that entire thing be a script in the first place, and not just use the editor arsenal?

#

If those units are already placed in the editor.

pine solstice
#

so other people can use the script for there op's

hallow mortar
#

Allow me to introduce you to a little thing called the Export and Import buttons in the arsenal

#

It is possible and reasonable to have a loadout script in some circumstances - the framework I use, F3, has such a thing - but it's not necessary and unless you're doing a lot of prebuilt loadout assignment, you don't really need to develop one

#

If you are going to develop a loadout script that's actually better than just using the editor arsenal, you'll want to do it properly, including such things as JIP and locality protection

tribal onyx
#

I'm also going out here on a limb and gonna just assume, you're not too familiar with scripting Arma ||(3)||, cause there's a lot of weird things I'm not quite understanding why you added them, like the call compile preprocessFileLineNumbers or the waitUntil {!isNull player}; at the top or the if(true) exitWith{}; at the end, none of which I really see what the point is.
While everyone starts somewhere, and copying over code you found that others have done is central in learning... but sometimes just using what BIS has already implemented is perfectly fine, and copying over things without understanding how they work or what they mean is a recipe for problems.

pine solstice
#

i have been away for 6 years trying to learn it over again 🙂

tribal onyx
#

ah okay.
The Eden Editor has become so much more powerful in the meantime. A ton of things that needed scripts back in the days, especially pre-Arma 3, can now be done effortlessly without the need for any scripting directly in the editor. Even I run into situations where I'm realising something I'm trying to do with a script, can actually simply be done using some simple modules and triggers in the editor.

#

Just recently I cracked open some pbo's of vanilla missions, and was shocked how nearly all of it was made using only the editor tools and no to nearly no additional scripting.

hallow mortar
#

Some of that is because BI gets to make the editor tools to do what they need :P

winter rose
#

also, think that earlier missions did not use Eden Editor!

tribal onyx
queen junco
#

Hey, I found this script to disable the vanilla global and side chat. It would have to be implemented via the description.ext. But would it be possible to run the script in the server.cfg? It would be a hassle to create a description.ext for every missionfile.

disableChannels[] = {
    {0, true, true}, //--- Global Chat
    {1, true, true}, //--- Side Chat
    {2, true, true}, //--- Command Chat
    {3, false, false}, //--- Group Chat
    {4, false, false}, //--- Vehicle Chat
    {5, false, false}, //--- Direct Chat
    {6, true, true} //--- System Chat
};
real tartan
#

how to get active search range of AA? is there some config I should check ? want to place radius marker for AA detection to prevent players to fly into it's hunting zone

high marsh
queen junco
cosmic lichen
oblique arrow
#

Hm I feel like I remember reading about someone wanting to remove one of the map location names, at some point
Any chance anyone remembers if thats possible?

finite sail
#

it can't be done without a mod

ripe sapphire
#

hey guys used this code in MP to create new notes for every player after they do an action (via addaction) however, it didnt work and only created the note for the person who triggered it

[player, ["intel","PHOTO INTEL"]] remoteExec ["createDiarySubject", 0, true];
[player, ["intel",["Mysterious Device Schematics","<img image='img\pc.jpg' width='256' height='256'/>"],taskNull,"",true]] remoteExec ["createDiaryRecord", 0, true];
#

anything wrong

wintry cypress
#

Did you make it repeatable

manic sigil
#

Is it possible to pass an increasing integer variable to Select? Such that

Array select intvariable
Intvariable = intvariable +1
Array select intvariable

etc?

willow hound
willow hound
manic sigil
#

Yeah, the script im working on is in a while-do loop with a 5 second delay.

ripe sapphire
manic sigil
#

Its updating a list of markers with new text, but if I could make the variables being referenced confined to an array, and then select sequentially from that array, itd be a lot easier to expand :p

ripe sapphire
#

So to resolve this i should remoteExec a call command?

#
[player createDiarySubject ["intel","PHOTO INTEL"]] remoteExec ["call", 0, true];
#

Like this yeah?

winter rose
#

nope

little raptor
median abyss
#

Is there a way to get the currently open inventory? (display 602, control 632 or 640).

willow hound
# ripe sapphire So to resolve this i should remoteExec a call command?

Ideally you would make a small function that does the diary stuff for you so that you can just remote execute that function, but yes,

{player createDiarySubject ["intel","PHOTO INTEL"]; player createDiaryrecord ["intel", ["Mysterious Device Schematics", ...], ...];} remoteExec ["call", 0, true];
```would also work if you can be sure that remote execution of `call` is allowed in your mission (you could disable it for security).
willow hound
distant oyster
median abyss
#

That returns the display, not a reference to the inventory

distant oyster
#

what inventory do you mean?

#

the container that is opened?

median abyss
#

Yes

#

Either the dummy container that is created if I open my inventory while not looking at anything, or the inventory of a vehicle Im currently accessing

#

I "solved" it by saving the target inventory in the InventoryOpened event handler.

manic sigil
willow hound
#

Variables do work with select, yes.

manic sigil
#

Yey :3 thats gonna save me a lot of fiddly code work.

#

Been working on this mission for nearly a year now. Feature creep is real.

pseudo shadow
#

in Ace Fortify, is there a way to take the current budget, and then add to it? I know in the register function you can specify the budget, but is there a sort of "GetCurrentFortifyBudget" function?
[west, 5000, [["Land_BagFence_Long_F", 5], ["Land_BagBunker_Small_F", 50]]] call acex_fortify_fnc_registerObjects

paper haven
#

can someone help me with a cas script, i want to have a a-10 script but i cant find any videos

tough abyss
#

how would i go about getting the position of a random target from thisList.

hallow mortar
#

Do you know that thisList only contains things you consider valid targets?

#

If yes, then _targetPos = getPos (selectRandom thisList)

tough abyss
#

and if no what does that mean for me ?

hallow mortar
#

then you need to figure out what the criteria are for a valid target, what sorts of things thisList does contain, and construct an appropriate filter

tough abyss
#

ok then say i wanted to target only soldiers from one side ?

hallow mortar
#

Then you can make the trigger's activation condition "BLUFOR present" (or whichever side) and then thisList will only contain valid targets

tough abyss
#

ohhh ok

#

cool that makes it simple

#

so would this work m1 doArtilleryFire [getPos (selectRandom thislist),"8Rnd_82mm_Mo_shells", 4];

#

on an opfor present trigger

hallow mortar
#

Assuming the mortar is in range / outside minimum range, it should do

tough abyss
#

huzzah it works

hallow mortar
#

Bear in mind the position will be the position at the time the trigger was activated, so if they move while the artillery piece is aiming and the round is travelling, it's not a guaranteed hit.

tough abyss
#

now to figure out how to loop it XD also @hallow mortar you seem to know a bit about scripting could you remind me what the different brackets are for

i know [] is for arrays

but i keep forgetting what {} and () are used for.

hallow mortar
#

{} is for a separate piece of code. () is for order of operations.

#

So in getPos (selectRandom thisList) it's an instruction to figure out the selectRandom thisList part before anything else, to make sure nothing gets confused.

tough abyss
#

cool also the fact the arty fires on when the trigger is tripped is better

#

gives the player chance to move

tough abyss
#

would this do for looping while {"east" knowsAbout group player} do {m1 doArtilleryFire [getPos (selectRandom thislist),"8Rnd_82mm_Mo_shells", 4];sleep 20};

hallow mortar
#

Can't do that in a trigger, sleeps aren't allowed

#

You'd have to make that a script file and execVM it on trigger activation, passing thisList as a parameter

tough abyss
#

ok other than the sleep bit would it work

hallow mortar
#

I think so

hot lichen
#

You can have sleep if you use spawn, but it's probably better to have it in a file

tough abyss
#

im getting a generic error while {group player #knowsAbout "east"} do {m1 doArtilleryFire [getPos (selectRandom thislist),"8Rnd_82mm_Mo_shells", (selectRandom [1, 2, 3, 4])]}; while trying to test

#

the hash isnt in my code thats where the error is

hot lichen
#

Maybe parantheses around (group player)?

tough abyss
#

yeah no (group player) dosnt fix it

hallow mortar
#

You can't check if someone knowsAbout a side

#

Only a specific thing

#

also (and it's my fault for not spotting this before) knowsAbout doesn't return a true/false you can use for a while true loop

#

while {("east" knowsAbout player) > 1.5} would work.

#

assuming East detecting the player is the condition you want.

tough abyss
#

bah need a break right now as it stands i have an arty script that will select a random target in a trigger area and fire a random number of shots up to 4 im partially happy.

hallow mortar
#

I'm going to write something I think might solve your problem. Take your break!

ripe sapphire
#

Thanks

hallow mortar
tough abyss
#

@hallow mortar thanks

harsh vine
#

[[], "active.sqf"] remoteExec ["execVM",0];
Inside active.sqf I put this : activated = true;
Is there a way to remoteExec (activated = true;) without using a sqf file??

warm hedge
#
{activated = true;} remoteExecCall ["call"];```or simply```sqf
activated = true;
publicVariable "activated"```
harsh vine
#

thank you very much 👍

languid oyster
# hallow mortar Although you can find a magazine's unique ID by using magazinesDetail, I can't f...

Bit late, but thank you. I stumbled into the problem, when vehicles have multiple magazines of the same type. Would have been cool to just figure out, which magazine has used up it's ammo, and replace only that very magazine. The idea was to have a reloading time dependent on how much magazines would have to be replaced. And when the player would decide to break up the reloading process early, at least some magazines would have been replaced. But I think I will give up that overly complicated procedure and simplify it due to the given limitations.

digital vine
#

Running into some difficulties with creating a limited ACE arsenal on a MP server, please bear with....

I’ve tried White listing in the Editor, and simple scripting such as:

[This, [

“Item 1”, “Item n”

]] call ace_arsenal_fnc_initbox;

Both of which work in the editor and SP, but do not port across to MP.
I am very much a complete newbie to coding, what is the simplest and most foolproof way I can create a limited ace arsenal in MP, with a step by step guide if possible. Many thanks 🙂

ebon citrus
#

@digital vine youre missing the 3rd parameter

#

Set it to true

#

That will add the box script globally

#

Disclaimer: i am not affiliated with ACE and i believe questions about their script commands belong on their own platforms

digital vine
#

@ebon citrus many thanks for the quick reply.
Unfortunately I am a complete beginner at this, had a quick flick through your link and still couldn’t determine where to put the “True” variable

Would it be like this?:

[This, [

“Item 1”, “Item n”

], True] call ace_arsenal_fnc_initbox;

ebon citrus
#

true

#

It's case sensitive

#

Otherwise correct

slate cypress
ebon citrus
#

Sorry for the slow repply, i just got to the hospital

#

Cant text in the car

digital vine
#

That’s 100% fine, thank you very much 😊

You’ve probably just saved hours of me getting frustrated in front of my screen 😂

winter rose
ebon citrus
#

@winter rose really?

#

Sqf doesnt care about it?

finite sail
#

only for strings and even then, not always

ebon citrus
#

I thought it did because the syntax highlighter only accepted true

finite sail
#

which highlighter?

ebon citrus
#

A community made one

#

Welp, here on out, i shall be using tRuE

finite sail
#

i think it might be an overzealous author of the highlighter forcing their personal style on others

ebon citrus
#

For enhanced readability

finite sail
#

is it the notepad ++?

ebon citrus
#

Yep

finite sail
#

yes, i know this one

ebon citrus
#

I dont care for other platforms and IDE's

finite sail
#

he's enforcing style which he shouldnt

ebon citrus
#

I like ++ because i can write my own plugins for it and it doesnt have all the unnecessary bloat of an IDE

finite sail
#

all good reasons

ebon citrus
#

But thanks for clearing that up for me

#

😅

finite sail
#

np 🙂

slate cypress
#
systemChat format["%1 has just taken the sector from %2!", _this select 1, _this select 2];

// Passed arguments are [<module>, <ownerSide>, <previousOwnerSide>]

Why does it say "UNKNOWN has just taken the sector from WEST" when OPFOR capture the sector?

#

_this select 1 should point to "EAST" but it's pointing to "UNKNOWN"

#

Either that or something is wrong with my format expression

languid oyster
#

And what does the diagLog output say about _this select 1?

finite sail
#

just to check... you know the _this array is zero based?

#

the first one is select 0

slate cypress
slate cypress
#

Only ownerSide and previousOwnerSide

finite sail
#

ah yes, i couldnt see your // line

#

on this monitor

#

too dark

slate cypress
#

oof

#

@languid oyster I found out that the output of _this select 1 is "UNKNOWN".

finite sail
#

the culprit is the script creating the variable

languid oyster
#

Now you just have to trace back your code, WHERE the error is 🙂

finite sail
#

thats what is broken

slate cypress
slate cypress
finite sail
#

if that's what is creating the variable, yes

slate cypress
#

I forgot to mention that this is the Sector module.

#

Default BIS one

#

This expression of mine is running inside the module

finite sail
#

this?

slate cypress
#

yes

finite sail
#

that returns nothing

slate cypress
#

the physical module in editor which you place down

#

it has an Expression property

finite sail
#

ok

slate cypress
#

the expression is supposed to run when the sector ownership changes

#

I found out that the expression is instead running whenever someone enters the sector...

#

this isn't the intended behaviour of the property

finite sail
#

, im gonna bow out at this point... never used editor placed modules or sector stuff.... not in my pay grade 🙂

slate cypress
#

no worries i'll go ask in #arma3_editor to see if anyone gets the same behaviour

coarse orchid
#

hey, random question. how would one get 3d sound to play serverside vs client side?

slate cypress
ebon citrus
#

There is no "server side" sound

#

You want to execute playSound3D locally

#

That way you have it play locally only

coarse orchid
#

thats precisely what i want. for instance, a radio playing music, for all to hear, without them having to individually press a button

ebon citrus
#

Never mind

#

Playsound3d has global effect

coarse orchid
#

''class CfgSounds
{
sounds[] = {};
class radio
{
name = "radio";
sound[] = {"\sound\radio.ogg", 300, 1};
titles[] = {0,""};
};
class briefing
{
name = "briefing";
sound[] = {"\sound\briefing.ogg", 300, 1};
titles[] = {0,""};
};
};''

ebon citrus
#

Say3D for local effect only

coarse orchid
#

so thats my current desc.ext

ebon citrus
#

?

coarse orchid
#

//radio
_sound = selectRandom ["radio"];

[c1, [_sound, 100, 1]] remoteExec ["say3D'];

#

thats my current sqf

ebon citrus
#

You can also playSound3D

#

And then you wont have to define a sound or use remoteExec

coarse orchid
#

so im not entirely sure exactly where im going wrong on getting it to play locally

#

could you provide an example of how id use playSound3d?

ebon citrus
#

@coarse orchid open the community wiki page

#

It has examples

coarse orchid
#

im currently using say3D to no avail. one sec

fresh wyvern
#

Hi, anyone know how to add to this script

_veh="I_LT_01_AA_F"createVehicle(player modelToWorld [-8,0,0]);

so that it spawns in with "Components" "Show Camo Net (Hull)"
and "Camouflage" "AAF (Camo Desert Net)"

coarse orchid
#

playSound3D ["A3\Sounds_F\sfx\blip1.wav", player]

so this is what id put, i assume in the items init in the editor?

slate cypress
coarse orchid
#

for each player from a set position, meaninfg if they walk away from it, it fades away to where they dont hear it.

#

i tried to do this solely with a trigger, but it was heard on all clients, all across the map, no matter where they were

slate cypress
#

swap player with this

#

this points to the object when inside its init field

slate cypress
slate cypress
tough abyss
#

Hello, is netID constant for a given object even if the server is rebooted ?

winter rose
#

reboot = reloading a mission

tough abyss
#

because I have a problem: I made a housing system and I would like to determine if it was bought from DB

#

except from its position, how can I store the object in DB precisely

winter rose
#

Arma does not have a db by itself

#

you could store a variable into it

tough abyss
#

I know

#

but it is a persistent mission

#

loading things from DB with an addon (ext lib)

ebon citrus
#

@tough abyss position is constant for structures

#

Unless you remove them

#

It is VERY unlikely that 2 structures inhabit the exact same place

#

Because a structure isnt an area, it has a position

tough abyss
#

yeah ok

#

because in our script we have custom buildings placed with eden editor

#

so I would like to know if there was a more precise method (in case of we move some buildings)

#

but there isnt, thanks for your answers

winter rose
#

setVariable

tough abyss
#

no its toxic

#

useless network variables

winter rose
tough abyss
#

it must be persistent

#

so at each reboot

#

houses must be loaded

#

or you want me

#

to store it server side

winter rose
#

have you heard of our lord and saviour "server-side" yeah? 😄

tough abyss
#

hmm that way ok

#

I see

#

I will do that

#

thanks

tough abyss
#

stupid question is the groups name whatever i place in the variable name when i click on the units banner

little raptor
little raptor
tough abyss
#

ok the hell is you problem arma, I ask you to land then force me anbd squad out of chopper but you kick us out of the chopper mid air, if i make sure your on the ground before executing the get out script you dont eject anyone

tough abyss
#

helo land "LAND"; {_x action ["GetOut", helo]} forEach units group alpha1; if i use this in a move way point it ejects in the air, if i use transport unload waypoint it only ejects me

#

ive also tried helo land "LAND"; wait until {isTouchingGround helo} {_x action ["GetOut", helo]} forEach units group alpha1;

little raptor
# tough abyss `helo land "LAND"; {_x action ["GetOut", helo]} forEach units group alpha1;` if ...

This is something I wrote a while ago for someone else (just modified it for your case):

_landPad = createVehicle ["Land_HelipadEmpty_F", _landPos];

helo land "GET OUT";

waitUntil {
sleep 1;
isTouchingGround helo || getPos helo select 2 < 1
};

{_x action ["GetOut", helo]} forEach units alpha1;

waitUntil {
  sleep 1;
  units alpha1 findIf {alive _x && _x in helo} == -1
};

deleteVehicle _landPad;
helo land "NONE"; //take off
#

note that if you use waypoints, you have to execute that when the waypoint is complete (you can use it as waypoint completion statement)

tough abyss
#

@little raptor thanks good to see there were no errors in my bit of scipt just missing a few steps

little raptor
# fresh wyvern Hi, anyone know how to add to this script ```cpp _veh="I_LT_01_AA_F"createVehicl...

They are animation sources:
to get animations:

_animSources = (configProperties [configOf _vehicle >> "animationSources", "isclass _x && {getText(_x >> 'displayName') != ''}", true]) apply {configName _x};

to apply it, all you have to do is select the animation source you want from the array and apply it like this:

_vehicle animateSource [_anim, 1, true];

similarly to get textures:

_textures = (configProperties [configOf _vehicle >> "textureSources", "isclass _x && {getText(_x >> 'displayName') != ''}", true]) apply {configName _x};
hollow cloak
#

If I have multiple add actions and want to only display one after the other has been completed how would I do so? Eg-

[car1, //Name of object
"Request vehicle exit", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // The icon shown on the screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // progress icon shown on the screen
"player distance car1 < 5", //The condition for the Action to be shown
"player distance car1 < 5", // The condition for the action  to progress
{}, //The code executed when the Action starts
{}, //The code executed on every tick
{driver1 leaveVehicle car1}, // The code Executed on completion
{hint "Stopping action"}, // The code executed when the player is interrupted
[], // Arguments passed to the script
3, // The duration (in seconds)
0, // priority
true, // Remove the action when its complete
false // show in unconcious state
] remoteExec ["BIS_fnc_holdActionAdd", [0,-2] select isDedicated, true]; // allows to work on servers

[car1, //Name of object
"Let through", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa", // The icon shown on the screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa", // progress icon shown on the screen
"player distance car1 < 5", //The condition for the Action to be shown
"player distance car1 < 5", // The condition for the action  to progress
{}, //The code executed when the Action starts
{}, //The code executed on every tick
{car1 enableAI "Move"}, // The code Executed on completion
{hint "Stopping action"}, // The code executed when the player is interrupted
[], // Arguments passed to the script
3, // The duration (in seconds)
0, // priority
true, // Remove the action when its complete
false // show in unconcious state
] remoteExec ["BIS_fnc_holdActionAdd", [0,-2] select isDedicated, true]; // allows to work on servers
#

They both show at the same time is there a way to set it so the "let through" is after "request vehicle exit" (is what im trying to say) sorry if its a bad explanation

little raptor
#

@hollow cloak ```sqf
see the pins

hollow cloak
#

Sorry I will rewrite

little raptor
#

no need just edit it

slate cypress
#

@winter rose i think i found an error in the biki

#

HandleScore is said to not persist after respawn

#

After testing, it does in fact persist after respawn.

#

I ended up having two callbacks after respawning because I expected to have to create another one

slate cypress
little raptor
# hollow cloak If I have multiple add actions and want to only display one after the other has ...

The script was too big. So I just uploaded it as a message.
Anyway, what you have to do is add the second action inside the completion code of the first action.
This is what the script does:

  1. add action1 to everyone. also save the actionID locally to delete it later for everyone.
  2. action1 completes -> remove action1 from everyone, and add action2 and save its ID
  3. action2 completes -> remove it from everyone
winter rose
winter rose
slate cypress
#

I was a player and when I respawned, the callback was still alive

winter rose
hollow cloak
slate cypress
winter rose
slate cypress
#

sorry I meant will it get destroyed after I respawn or will it get destroyed after the other client respawns?

little raptor
winter rose
slate cypress
#

ah ok thanks 😄

hollow cloak
outer fjord
#

What would be the best method to use to check a AI's ammo count on a turret, and order them to dismount once it's out?

winter rose
#

@outer fjord ↑

outer fjord
#

Broken when vehicle has multiple magazines of the same typeSo probably won't work with a 50.cal turret?

#

Or does it mean it couldn't count the multiple mags? So I would just want to make sure it = 0?

winter rose
#

dunno how it is broken sorry 🤷‍♂️

dusky pier
#

Hello.

Trying to make AI script (bots must defend point) and have troubles with creating group.

I trying this:

_ai_grup = createGroup sideEnemy;

Because west, east, civilian and independent - used for players in my mission, and AI must to be an enemy for every player.

But bot's don't spawn. When i tryed to solve why - find problem with group, is not created and return to me -

<NULL-group>

Can you help me, please?

outer fjord
#

All good thank you!

little raptor
dusky pier
#

hm, understood. But how to make - my AI's enemy to all players? (if i use sides like west, or east)

little raptor
dusky pier
#

@little raptor thank you!

have one more question 🙂

Is possible to have enemy's in player's side bots are the enemy for everyone (regardless of the player's side)?

little raptor
#

@dusky pier also you can do something like this, but it'll make the unit enemy to everyone (good for "deathmatch" style):

_unit addRating -10000; //make the unit a renegade (SideEnemy)
little raptor
little raptor
#

for example, make independent enemy to west and east:

#
independent setFriend [west, 0];
west setFriend [independent, 0];
independent setFriend [east, 0];
east setFriend [independent, 0];
wind hedge
#

Guys, question about remoteExec: will this last line work when the whole fnc is executed on the server? (The idea is that the effect is executed on all players but called on the server

#

vWeatherSandStorm = {
    private _headlessClients = [];
    private _humanPlayers = [];
    private _nearTerrainObjs = [];
    _headlessClients = entities "HeadlessClient_F";
    _humanPlayers = allPlayers - _headlessClients;
    private _rdmPlayer = selectRandom _humanPlayers;
    private _anyNearestLocation = nearestLocation [_rdmPlayer, ""];
    _nearTerrainObjs = nearestTerrainObjects [_anyNearestLocation, ["House"], 50, true];
    if (_nearTerrainObjs isEqualTo []) exitWith {};
    private _rdmTerrainObj = selectRandom _nearTerrainObjs;
    [[_rdmTerrainObj,0.07,0.1,true,60], vSandStormEffect] remoteExec ["call", 0];
}; ```
little raptor
#

three `
sqf
next line

wind hedge
#

Fixed!

winter rose
#

no? yes? maybe?

…nah you should use [_rdmTerrainObj,0.07,0.1,true,60] remoteExec ["vSandStormEffect", 0];

#

and define your function in a CfgFunctions

#

and use prefixes like VAL_fnc_sandStormEffect

little raptor
#

(functions always have tags)

wind hedge
#

Ok got it!

#

Any way to define fnc on CfgFunctions but the fnc are all on a single sqf file?

little raptor
#

no

#

but CfgFunctions is always preferred

wind hedge
#

can CfgFunctions be replaced by compile? I have all my functions on a single SQF called vClientFnc.sqf and then: if (!isDedicated && !isServer) then { call compile preprocessFileLineNumbers "vScripts\vClient\vClientFnc.sqf"; };

little raptor
steep nova
#

Leopard20, quick question: Is there a way to make an extended task/action like the revive mechanic? if so how?

cosmic lichen
#

"Quick question" 🤣

little raptor
#

you probably can't

#

afaik

little raptor
steep nova
#

you have a mod that will do that?

little raptor
steep nova
#

mods are fine

#

Example: I have generator in the mission I don’t want it to turn on instantly I would like some delay for the player similar to the revive mechanic if possible. As it stands now its one click and the lights are on/off.