#arma3_scripting
1 messages · Page 651 of 1
@willow hound I actually managed to get it working using scripts, just have to make sure it executes on al clients
I have a fun script for an auto-opening gate if anyone wants it?
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 ^
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?
Im not sure you want to run a lot of those on "draw" EH... but you suit yourself
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
nope that places your ui in the top left like the macro says. try GUI_GRID_CENTER instead, see here: https://community.bistudio.com/wiki/Arma_3:_GUI_Coordinates#GUI_GRID
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
What’s the script to make a fully controllable goat?
I’m new to scripting and know it pertains to create unit iirc
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.
Okay, so after some thinking and some double checking on how stuff like array checking and isNull and groupID works, I actually found a way to clean up <NULL-group> which as it turns out is the "name" of grpNull.
And to clean the squad array of grpNull this seems to work:
squad deleteAt (squad findIf {isNull _x});```
Is there a better way to do this, or did I actually figure out a solution?
Giving it a second thought, I overthought it and
squad = squad - [grpNull];``` is all that's needed
Is it possible to get texture data programatically?
or would I have to do this in intercept?
What do you mean by texture data?
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?
Oh no 😱 poor cracks have all been taken down by the unforgiving pandemic!!
But don't worry! You will not be forgotten!
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.
Afaik there is no way to use that id
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
As a low-priority feature request, it would be kinda cool if removeMagazine commands did accept a magazine ID as a parameter. Be a good way to clean up partial mags or whatever.
How about you change the button in the center out for a button that connects to your units server, with your units logo on it?
I refer about the logo is between the navbar buttons
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
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 😉
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
To clarify if you confirm that it is not valid to replace the logo of Arma 3 in the Main menu, it would not touch the subject as I told you I saw a mod that does it, so I thought it was valid, since otherwise it would not be given the option of do it by config or so I would think
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)
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
I also don't want to remove the copyright, ok and that i make with the Spotlight config yet ?
here is an example of what I say https://steamcommunity.com/sharedfiles/filedetails/?id=1719458680&searchtext=41st about mod that remove the logo
If you do it you should use the new connectToServer script command tho
thx i will look it
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
ok
And here's a wiki page with an example configuration aswell https://community.bistudio.com/wiki/Arma_3:_Main_Menu#Configuration_2
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.
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
@sturdy patrol didn't seem to work sadly
puff give a second 1 make a pbo with all the code and share with you
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?
https://www.mediafire.com/file/i4rwbdndhcpbclo/gui.pbo/file here is, sorry but i cant upload file in the chat
that is a pbo to change alls i use a example image
works great thank you
np
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 ?
name of the mod or load order I'm guessing also did use cfgWorlds for load screen because that might conflict
Perhaps move this to #arma3_config , since this has nothing to do with scripting...
When using the expected data types parameter of params, should the list of data types be strings, or...?
no, array
yeah, but an array of strings or not-strings?
an array of values of the expected types
[0, "one", [2], player] params [
["_zero", 0, [0]],
["_one", "", [""]],
["_two", [], [[]]],
["_three", objNull, [objNull]]
];
okay, so if I want it to only accept strings the array should be [""]
correct!
neat, thanks
if you run forEach on an empty array, does it cause an error or just do nothing?
nothing to iterate on, nothing.
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)
this page also says
It is recommended to use onButtonClick instead.
the unit that pressed the button is ALWAYS the player, so you can useplayerinstead. I am still wondering why the player is passed as this to the code since literally no one else than the player can press the button
@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!
must be some remnant from old times. the action attribute's code is in sqs and that is from OFP times
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.
are your textures 2^n × 2^o ? e.g 256×1024, 512×512, etc
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)
Out of curiosity, is the picture you're trying to put on the billboard...a picture of another billboard?
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
I notice you're using this, implying this is going in an init field. Be aware of the two notes regarding init fields at https://community.bistudio.com/wiki/setObjectTextureGlobal (tl;dr: don't)
(this is not the source of the current problem)
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
If every client runs its own copy of this script then using setObjectTextureGlobal is redundant; using the local version of the command will save network traffic. I don't see how you could be using this in a script that's not in an init field, though.
where are you running this
Good point, ill use the local variant. I used global without thinking much about it
That would be in the object's init field
That should be fine if they switch to the local variant of the command
yep
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?
I figured out what happened I think
Its being very weird though
some sort of cache somewhere, ill try and restart arma3 completely
ah yes
once loaded, rename or restart
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?
probably because of the space?
@little raptor,
the space between my ears is the root problem, for sure. But more specifically?
😄
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]);
there's nothing else wrong with that function (apart from being really clunky)
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)
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];
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)
see my code
so destroy the old surface before creating a new one?
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
ah okay that makes sense-- I'm still absorbing the above...
the space is missing in the script that works
you must REMOVE the space
not add it
for science, you say?
it isn't, I'm sorry. I gave it the old science try...
and how does it look like right now?
private _display= (format ["#(argb,512,512,1)r2t(%1,1.0)", _surface]);
I'm sure this is the answer I'm just coming to grips with it
btw, you're trying lowercase names for the surface right?
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!
np
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.
I think so
I hope this is the right channel. Does anyone know why I can't derap/read texHeaders.bin? cheers.
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...
🤦♂️
I have done everything succesfully and stuck at adding insignias to them from the USP patches mod
you are aware CFP is on GitHub
Sorry man I am new to this lol...
and just a quick tip; don't mash mods together, or steal content from mods...
no not at all. I am mainly playing singleplayer and was doing a Iranian scenario.
so download both mods, and make your own loadout?
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.
Its not. And I sure hope you have permission to do that
texheaders.bin is not a file you ever touch
aaand not #arma3_scripting please.
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?
trying to get my friends and I to start a mission with a waking up animation, it works in editor, but not MP. Ideas?
Ideas?
there is a mistake somewhere
I can confirm that player is used on HC's as well to reference itself. Including accessing name player to get the name of HC logic.
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
0 setFog 1, 0.1, 250;
https://imgur.com/a/IqLVXiX
1 setFog 1, 0.1, 250;
https://imgur.com/a/FahAqJf
[ ]
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
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
so the end goal I had was to figure out the average color of a texture. is something like that possible?
my initial guess is that I'd have to do it in intercept
Impossible
@cosmic lichen neat! now do you think you could load the actual texture data in that from a config path?
What exactly do you need the data for
trying to find the avg color of a texture
I have a mod that can dynamically load textures from in-game, and convert them to argb bitmap and send it out via websocket.
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?
@still forum something like this but slightly modified to just calculate the avg color is what I want
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
Its quite a bit of code though, and multiple of my projects combined together, in a C++ extension
https://github.com/WolfCorps/TacControl/blob/master/src/ArmaExt/src/Modules/ModuleImageDirectory.cpp#L139
Here is after I already found the pbo that contains the paa, and have extracted the paa data out of the pbo.
Then after parsing the paa, the TextureFile class has avgColor entry (usually)
https://github.com/arma3/MipMapTool/blob/244f9cfdfaa7414923413712ebd17e4feca67738/TextureFile.hpp#L67
I will come back to this it seems fun
@still forum can I ask what taccontrol is supposed to be?
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
neat. kind of like athena?
Yes basically
Athena in new and better and completely open source and easy to extend with custom functionality
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
Sadly TacControl doesn't work yet because it needs features from next Arma update 😄
ah
dedmen sorry for writing here but is there any way to debug the class that is modifying the main menu
debug how?
you can check the Config Viewer (can be accessed from the editor) and check the current config
however it's not possible to see who or what made the changes
i only need the class name to add as a requiredAddon on my mod
just add A3_Data_F_Oldman_Loadorder and you're done with it...
but again, this is the scripting channel, not #arma3_config
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)
That is not the error.
It just shows the position that a error occurred at.
Which error was it?
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
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.
params for accepted dataType with code (along with a boolean), like [false, {}] ?
["_groupInit", false, [false, {}]]
it doesn't seem to be accepting it
["_groupInit", {}, [{}]] works, but not with the additional dataType
I'll just forgo the bool if init is empty and return {}
[{}] params [["_test",false,[false,{}]]] ;
_test```Worked
Are you getting any errors?
I'd say it's a camera r2t conflict, because you keep using rtt_1. You have to terminate the old one before creating a new instance
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
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");```
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.
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?
Instead of referencing the group, need to reference the objects/vehicles.
ye the forEach units references each member
Is it being called by host?
i guess that only enablesimulation the pilots
yes
if i do deletevehicle it deletes the pilots
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
confirmed thank you!
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.
Could try to set condition as:
this && player inArea thisTrigger
But does it do it locally?
The player check should make it local
Still gotta figure out how to do the effects also
I personally just create local triggers for players and the server
how do you make the trigger locally? especially for a sound
_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.
Got it
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
@lunar plume saying what the error is could help people get started in helping you
yes sorry i'm new
Hi new, I'm dad!
seriously
He's always serious
jokingly 😁
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
The error says it all: the variable is not defined
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.
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?
I don’t know if this helps you
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
@drowsy plank @slate cypress https://community.bistudio.com/wiki/switchCamera
I think the effect is local, but not sure
Hi guys im trying to connect a object (laptop) to some markers with setRandomSpawn but they wont connect for some reason..
just read your error message.
Error Undefined variable in expression: ch6
There you go.
First, what the frick is going on with your excessive parenthesis and missing whitespace. Makes it horrible to read this.
Also
#include"CFG.sqf" kinda should have whitespace.
&&{(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.
Nevermind, im stupid. 🙂
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)
Is there an easy way to find out where wrong color format error/warning comes from?
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.
I know of some sources but what does the error say exactly?
is it getting logged only in the mission?
yes
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?
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
might be a structured text with wrong attributes. correct format would be: <t color='#RRGGBB'>text</t> or <t color='#AARRGGBB'>text</t>
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
This is also a possible cause: https://feedback.bistudio.com/T139588
Interesting, im on a2 tho. But might still be relatable
given the same warning message it's a very good chance it might be the cause
the note on https://community.bistudio.com/wiki/actionKeys explains the origin of this number
np
What happens to player's event handlers when player dies and respawns? is there any need to manually remove them in onPlayerRespawn.sqf?
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"];
)
I have a vague memory that EHs are removed, or at least remain with the original body, when a unit is killed. I can't find where I read it on the wiki though, so...
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.
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.
you can create a temporary ctrl, set the texture on it so that the r2t initializes, then delete the ctrl.
Not sure if it works but worth a try
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).
okay, how does that look?
what?
a ctrl?
do you even know what a ctrl is?
apparently not...
it's a GUI element:
https://community.bistudio.com/wiki/ctrlCreate
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.
create an RscPicture ctrl on display 46
@hot kernel
example:
_pic = findDisplay 46 ctrlCreate ["RscPicture", -1];
_pic ctrlSetText _r2t;
ctrlDelete _pic;
@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?
ctrlSetFade
it might be better to show the ctrl somewhere else
eg display 12 (map)
I can try that. This maybe,
https://community.bistudio.com/wiki/ctrlShow
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
well if you mean you tried ctrlShow and failed, use ctrlSetFade as I told you
oh I did try both (a different display 12) and ctrlShow-- I'll try ctrlSetFade
did anyone try making a crane via attaching a fake helicopter to the crane and using its cargo lifting functionality yet?
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.
thank you for the prompt response @winter rose and @willow hound
in the editor?
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
mods?
maybe their leader has a waypoint
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?
Why not use the get in waypoint?
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
see above
#arma3_scripting message
ok it works, but is there any way to get them in the car without teleporting? They're just standing there.
the GET IN waypoint?
How do I create waypoints via scripting?
Thanks for the help @hallow mortar and @winter rose
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?
<Package name="General"/>
self-closing tag in the stringtable as well?
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];
setWaypointType otherwise it's just a move waypoint
also, check whether the car is locked
but, if you already have an unload waypoint from the editor, why not place this new waypoint from the editor?
Thanx I'll try it out.
@winter rose re: General, no, for brevity. that is the package containing the keys in question.
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?
okido - just wanted to make sure ofc 😉
@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.
it seems that they are simply not detected, so idk really 🤷♂️
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
to me it says "cannot find the key, let's see in the game itself" or something
except it is there, i.e. <Package name="General"><Key ID="STR_KPLIB_TITLE"/></Package> (brevity)
because XML syntax, you know 😉
(see the example https://community.bistudio.com/wiki/Stringtable.xml#Example)
otherwise try to start from a blank one and add little by little
yes, along the lines of, <?xml version="1.0" encoding="UTF-8"?><Project name="..."><Package name="General"/></Project>
but I have never seen/heard the game not loading stringtables?
where is the stringtable located, how is it named?
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.
(I honestly expect a weird > somewhere 😆)
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
you mean, it is a mod-loading issue?
yes, while loading the mission
hint localize "str_BIS_Discord_WrongChannel";
``` works perfectly fine
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.
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?
it will work (passing the array)
if MyGlobalVariable is an array, it will be passed as reference - use +MyGlobalVariable to copy it
@winter rose but how would I assign _this select 0 to something since above function will return an error
_this set [0, value]
_this set [0, (_this select 0) + 1];
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
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 👀
params will create a private var for it iirc
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
Modifying _this inside a function won't have any outside effect...
you would need to send the variable as string, and use missionNamespace @spice axle
I complicated it myself
It is a array but for easier test I used a integer. Works now, thanks

var1 = 0;
var2 = 0;
private _fnc_addOne = {
private _value = missionNamespace getVariable [_this, 0];
missionNamespace setVariable [_this, _value + 1];
};
"var1" call _fnc_addOne; // var1 = 1
@still forum NEVERMIND MY UNREADABLE CHINESE CODE!!! 
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.
"and when I manually execute it via debug console" huh? debug console has no preprocessor

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"};

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

🚪 👈
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)
make it

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.
you can add image to structured text iirc?
https://community.bistudio.com/wiki/Structured_Text#Image
unicode should work with a flag, but idk if it is on release yet
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.

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
```sqf plz
(see pinned message)
Is it not?
negative
(((too))) many (((parentheses)))
notenoughspaces
if((!(hasInterface))&&{(didJIP)})exitWith{}; // bad
if (!hasInterface && { didJIP }) exitWith {}; // good
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
yeah, ! needs a direct boolean or nular or unary operator, e.g```sqf
!isServer
!alive player
!player in jeep // error, "!player" cannot be processed
or my habit
if !(bla bla bla)
I dislike it, but I dislike if (!(bla bla bla)) even more
i.e. "<t>ચ</t>" for a listnbox element? does not seem to like the structured text. or know how to decode a unicode checkmark.
oh wait, I think I misunderstood you. See:
https://community.bistudio.com/wiki/toString
https://community.bistudio.com/wiki/format
I get those. specifically, inserting such a structured text into an listnbox as one of its element.
listnbox does not support structured text
ah, right. fair nuff. thanks.
anyone happen to know what the checkmark image path is in CBA?
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?
find
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
i found the script on the forums lol i didnt make it
well it's a horrible script
inside the loop
so without the sleep the games constantly checking every like milisecond?
but the sleep is not the only pronlem
you wish
it does that multiple times every frame
@winter rose , thanks!
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;};};
@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
thats very nice of you thanks a lot
not "if fuel less than 80% jump to 100%"
Very kind of you 🙂
while im at it..
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]``` is this okay lol
It is
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
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.)
init field
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
Where is _veh being defined?
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.
_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
Just give me a second, I need to sort this script out
okie doke thank you
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)
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
Are you sure you want speed/setSpeed rather than velocity/setVelocity?
Otherwise you're pretty close afaik, with the caveat that smart projectiles like missiles will not be made active/locked/guided/etc by default
😮
Ooh, you can use setMissileTarget if you want to make the missiles work...... probably
You probably want setVectorDirAndUp too as vectorDir is 2D only
create
Is it possible to use the CBRN Hoses for the gas masks in multiplayer?
context?
Here is the video im referring to
https://www.youtube.com/watch?v=h_QHDqJ4uJQ
are you asking if the bi function works in multiplayer?
Yes
i dont see why not
Well It woked fine singleplayer and now im hosting it, theres no hose
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;
can you just put it in the unit init?
I did but the hose doesnt appear
it only worked for singleplayer
and now im trying to get it to work for multiplayer
Im not sure sorry, maybe someone else has an answer
all good
I figured the reason, it's the respawning when you respawn on a position it gets rid of it.
Then do remoteExecCall maybe
You'll have to excuse me im new to arma scripting.
where would I put that.
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
this remoteExecCall ["BIN_fnc_CBRNHoseInit"];```Maybe? It's pretty sure meant to use only in singleplayer, so make sure everyone's running it
It's gonna be on all the units.
Wha?
So using that removed the gasmask completely
Excuse me?
Okay so using that line of code on the init of the unit got rid of the mask completely.
Looks like BIN_fnc_CBRNHoseInit will refuse to do that when trying to do that in multiplayer. Gotta do some workaround?
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
Because respawned unit isn't the unit who died
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
No trigger is preferred to call when a respawn, but Event Handler
I didnt catch that.
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?
Oh ok
Learning how arma's code works
Yeah doesnt seem to be working.
hold on
Nah the code didnt work.
Hmm
I was gonna say Im not seeing a hose
Function must be executed where the unit is local.
so forget about remote exec
I think BIN_fnc_CBRNHoseInit uses setObjectTexture and filters local units?
Is a mod an option for you @thorny rampart ? Because I think there is a mod which does all that
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";
if (local this) then { your code };
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"; }];
};
no
There's no this in an Event Handler
So just get rid of the this
Replace with _unit
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting This might be a good place to start
Okay yeah that code didnt work
Just gonna get the mod and work on other things
Thanks for the help though guys
If I could just link it to a characters camera that would be nice
Does anyone know if you can do that?
@drowsy plank https://community.bistudio.com/wiki/switchCamera
Great thanks!
Why do you ask the same question?
So, after all these years, is there a way to reliably tell if unit is in ragdoll state or not?
no 😁
maybe animation = ""
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

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?
targets
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
resize doesn't return anything, you are aware of that?
so, it cant change a pos
yeah,, but getpos player resize 2 wont work
no
because debug is getting the pos constantly
well it probably does, but no way to return it
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]
Don't need that often.
and most other commands are able to handle both 2d and 3d positions, so I don't think there's much reason for it 🤔
@finite sail I dont know what you are up to, but maybe select? as in ... (getpos player) select [0,2];
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
Maybe the script only runs locally?
i call it on the players init everything else works just the backpack not being there
check the RPT files?
Maybe that backpack doesn't exist? (as in typo or something)
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?
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.
try forceAddUniform see if it works with that https://community.bistudio.com/wiki/forceAddUniform
Could be maybe some kind of restriction with the backpack (not familiar with CUP, and especially not how ACE3 interacts with cup)
forceAddUniform is for the uniform slot, not backpacks
oh yeah derp, forgot it's the backpack not the uniform that's the issue
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```
@pseudo kernel flyInHeight
tried
flyInHeightASL?
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
Hold on, I thought you said this was in the player's init? This says it's in a separate sqf file
So, are you using something like [this] execVM "loadouts\Medic.sqf" on the editor-placed unit's init field?
Or how exactly are you calling this script?
[this] call compile preprocessFileLineNumbers "loadouts\Medic.sqf";
putting this in the players init
- You are saying the script works except the backpack, but looking
removeAllWeapons this;(and the other remove commands) thethisactually doesn't point at the soldier, and should also be_unit
removeAllWeapons _unit;
removeallassigneditems _unit;
[...]``` as far as I can tell
i tried this too and got the same result
- I'm not quite sure why you have the whole
[this] call compile preprocessFileLineNumbers "loadouts\Medic.sqf"
Why not just[this] execVM "loadouts\Medic.sqf"?
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.
just trying this now
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.
so other people can use the script for there op's
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
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.
i have been away for 6 years trying to learn it over again 🙂
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.
Some of that is because BI gets to make the editor tools to do what they need :P
also, think that earlier missions did not use Eden Editor!
I mean... fair. But also, it means one can basically recreate anything they did using only the editor. Well, mission wise only, obviously unless you have an art team and a recording studio the presentation is gonna be less shwanky 
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
};
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
@queen junco https://community.bistudio.com/wiki/server.cfg#Server_Behaviour See: disableChannels
thanks a lot, somehow didnt see it there
It's kinda easy to miss. I made the tables sortable now so things should be easier to find.
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?
it can't be done without a mod
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
Did you make it repeatable
Is it possible to pass an increasing integer variable to Select? Such that
Array select intvariable
Intvariable = intvariable +1
Array select intvariable
etc?
https://community.bistudio.com/wiki/remoteExecCall#Example_5
Read that; the example might be about remoteExecCall, but that doesn't make a difference here, the root cause remains the same (as far as I can tell).
https://community.bistudio.com/wiki/Control_Structures#Loops
Are you familiar with loops?
This sounds like a staple use case for either a for-loop or a forEach-loop.
Yeah, the script im working on is in a while-do loop with a 5 second delay.
Ahhh i see! So if i understand correctly it didnt work because the client who executed it broadcasted a command to add a note on HIS player object instead of every individual client’s player object right?
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
So to resolve this i should remoteExec a call command?
[player createDiarySubject ["intel","PHOTO INTEL"]] remoteExec ["call", 0, true];
Like this yeah?
nope
call takes a code. that's not code
Is there a way to get the currently open inventory? (display 602, control 632 or 640).
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).
So what do you need help with? Combining loops with arrays? Getting your markers into an array?
two options:
findDisplay 602
// or
uiNamespace getVariable "RscDisplayInventory"
That returns the display, not a reference to the inventory
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.
At the moment, just making sure select {n}, n=n+1, select{n} is a thing. Ill have to manually build the array each time I build a mission... or I could use generic variable names, but I feel like thats more trouble than its worth.
Variables do work with select, yes.
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.
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
can someone help me with a cas script, i want to have a a-10 script but i cant find any videos
how would i go about getting the position of a random target from thisList.
Do you know that thisList only contains things you consider valid targets?
If yes, then _targetPos = getPos (selectRandom thisList)
and if no what does that mean for me ?
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
ok then say i wanted to target only soldiers from one side ?
Then you can make the trigger's activation condition "BLUFOR present" (or whichever side) and then thisList will only contain valid targets
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
Assuming the mortar is in range / outside minimum range, it should do
huzzah it works
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.
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.
{} 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.
cool also the fact the arty fires on when the trigger is tripped is better
gives the player chance to move
would this do for looping while {"east" knowsAbout group player} do {m1 doArtilleryFire [getPos (selectRandom thislist),"8Rnd_82mm_Mo_shells", 4];sleep 20};
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
ok other than the sleep bit would it work
I think so
You can have sleep if you use spawn, but it's probably better to have it in a file
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
Maybe parantheses around (group player)?
yeah no (group player) dosnt fix it
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.
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.
I'm going to write something I think might solve your problem. Take your break!
Oh right got itt i’ll make it a function easy
Thanks
Here - read the included instructions carefully. If it gives you issues someone else might have to troubleshoot, it's quite late here. Good luck!
https://sqfbin.com/ecocajugecederavukeg
@hallow mortar thanks
[[], "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??
{activated = true;} remoteExecCall ["call"];```or simply```sqf
activated = true;
publicVariable "activated"```
thank you very much 👍
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.
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 🙂
@digital vine youre missing the 3rd parameter
Set it to true
That will add the box script globally
Read more here about the usage of ace arsenal:
https://ace3mod.com/wiki/framework/arsenal-framework.html
Disclaimer: i am not affiliated with ACE and i believe questions about their script commands belong on their own platforms
@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;
[this, ["Item 1", "Item 2", "Item 3"], true] call ace_arsenal_fnc_initBox;
That’s 100% fine, thank you very much 😊
You’ve probably just saved hours of me getting frustrated in front of my screen 😂
true or TRUE, no difference 😉
only for strings and even then, not always
I thought it did because the syntax highlighter only accepted true
which highlighter?
i think it might be an overzealous author of the highlighter forcing their personal style on others
For enhanced readability
is it the notepad ++?
Yep
yes, i know this one
I dont care for other platforms and IDE's
he's enforcing style which he shouldnt
I like ++ because i can write my own plugins for it and it doesnt have all the unnecessary bloat of an IDE
all good reasons
np 🙂
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
And what does the diagLog output say about _this select 1?
I will check. Does diag_log work in preview mode?
Yes but I'm not interested in module.
Only ownerSide and previousOwnerSide
the culprit is the script creating the variable
Now you just have to trace back your code, WHERE the error is 🙂
thats what is broken
That's literally my entire code
The module itself?
if that's what is creating the variable, yes
I forgot to mention that this is the Sector module.
Default BIS one
This expression of mine is running inside the module
yes
that returns nothing
ok
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
, im gonna bow out at this point... never used editor placed modules or sector stuff.... not in my pay grade 🙂
no worries i'll go ask in #arma3_editor to see if anyone gets the same behaviour
hey, random question. how would one get 3d sound to play serverside vs client side?
Do you want it to play for specific players only?
If you use: https://community.bistudio.com/wiki/playSound3D
the sound will play from a source which will only be heard by players in close proximity (unless specified otherwise as the distance arg
There is no "server side" sound
You want to execute playSound3D locally
That way you have it play locally only
thats precisely what i want. for instance, a radio playing music, for all to hear, without them having to individually press a button
''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,""};
};
};''
Say3D for local effect only
so thats my current desc.ext
?
//radio
_sound = selectRandom ["radio"];
[c1, [_sound, 100, 1]] remoteExec ["say3D'];
thats my current sqf
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?
im currently using say3D to no avail. one sec
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)"
playSound3D ["A3\Sounds_F\sfx\blip1.wav", player]
so this is what id put, i assume in the items init in the editor?
do you intend to have the music playing from each player
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
so you want to play it from the object (the radio)?
swap player with this
this points to the object when inside its init field
this is because you're playing it from each player 😄
if you do it with a trigger, ensure it's not global execution
Hello, is netID constant for a given object even if the server is rebooted ?
no
reboot = reloading a mission
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
I know
but it is a persistent mission
loading things from DB with an addon (ext lib)
@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
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
they can be local, but hey ¯_(ツ)_/¯
it must be persistent
so at each reboot
houses must be loaded
or you want me
to store it server side
have you heard of our lord and saviour "server-side" yeah? 😄
stupid question is the groups name whatever i place in the variable name when i click on the units banner
yes
Go to the UDL settings (Language -> User Defined Language -> Define your language -> Select SQF) and check "Ignore Case".
Or maybe they simply forgot to check that? It's actually very easy to miss.
Also I'm not sure which NP++ syntax highlighting you use, but I recommend this one:
https://forums.bohemia.net/forums/topic/138891-arma-3-notepad-syntax-highlighting/
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
code?
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;
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)
@little raptor thanks good to see there were no errors in my bit of scipt just missing a few steps
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};
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
@hollow cloak ```sqf
see the pins
Sorry I will rewrite
no need just edit it
@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
also it says that it must be registered on the server but it works completely fine when run on a client
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:
- add action1 to everyone. also save the actionID locally to delete it later for everyone.
- action1 completes -> remove action1 from everyone, and add action2 and save its ID
- action2 completes -> remove it from everyone
well, maybe it started one way and evolved another; anyway thanks for your tests, we will think of a fix in #community_wiki
for remote units
It says
like players
I was a player and when I respawned, the callback was still alive
yes, but you added the event handler on your machine, not a remote one
Yeah okay thanks alot for the help appreciate the time 😉
ohhh. so if I add a handler to another client other than myself, it will get destroyed after I respawn or they respawn?
it might yes (according to the current description at least)
sorry I meant will it get destroyed after I respawn or will it get destroyed after the other client respawns?
np. I didn't test it but I think it should work, so you can go ahead and try that script I sent you.
you add the EH on your machine, targeting the other player.
he dies.
he respawns.
the EH is not there anymore (should not)
ah ok thanks 😄
Yup I will let you know if I come across any errors I can't fix
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?
https://community.bistudio.com/wiki/Category:Command_Group:_Turrets
but magazineTurretAmmo is partially broken…
@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?
dunno how it is broken sorry 🤷♂️
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?
All good thank you!
sideEnemy doesn't mean "enemy to player".
SideEnemy is a side the game uses for renegades. Like TKers
hm, understood. But how to make - my AI's enemy to all players? (if i use sides like west, or east)
you can do something like this:
_enemies = [east,west,independent,civilian] select {_x getFriend side player < 0.6}; //list of enemy sides
_sideEnemy = _enemies param [0, sideUnknown]; //pick the first one
@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)?
@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)
you can go with the second option, but the AI will be enemy to everyone, including themeselves.
If you want to use the first option, it's best to reserve one side for the "bots"
thank you a lot!
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];
@dusky pier also, remember that 1. the command must be executed on the server and 2. it should preferably be used before you create the AI (you can use the editor)
https://community.bistudio.com/wiki/setFriend
understood, thank you!
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];
}; ```
three `
sqf
next line
Fixed!
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
(functions always have tags)
Ok got it!
Any way to define fnc on CfgFunctions but the fnc are all on a single sqf file?
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"; };
no, they're not "functions" anymore. just code
the best option is to split them into multiple files, and put them in a folder
if you don't want to do that, you can create a function with preInit = 1 or postInit = 1 (depending on where you need it) that points to that file (vScripts\vClient\vClientFnc.sqf)
That would be my solution!
Leopard20, quick question: Is there a way to make an extended task/action like the revive mechanic? if so how?
"Quick question" 🤣
I'm not sure if you can use [] remoteExec ["fncName"] anymore (if you don't use CfgFunctions for your function names)
you probably can't
afaik
Are you referring to my mod?
you have a mod that will do that?
https://steamcommunity.com/sharedfiles/filedetails/?id=1893300731
But I guess you meant like vanilla tasks?

