#arma3_scripting
1 messages Β· Page 742 of 1
To get the diag exe just switch branch to development in steam.
Does it work with the profiling branch as well?
Seem to remember using something similar on that branch
rather CONDITION not the parent statement. gotcha. thanks...
Does arma have an audio source limit? I seem to be having a crash related to audio. I disable the audio creation and it works perfectly fine no crashes, but as soon as I re-enable my audio I get crashes.
Need to use the diag.exe iirc
Does anyone have experience with the GRAD Persistence script that could help me figure out how to save some custom variables from the Ravage mod? I'm following this page about saving variables, and this is what's in the CfgGradPersistence customVariables class:
https://github.com/gruppe-adler/grad-persistence/wiki/Saving-Variables
class customVariables {
class HG_Cash {
varName = "HG_Cash";
varNamespace = "player";
public = 1;
};
class hunger {
varName = "hunger";
varNamespace = "player";
public = 1;
};
class thirst {
varName = "thirst";
varNamespace = "player";
public = 1;
};
class radiation {
varName = "radiation";
varNamespace = "player";
public = 1;
};
class rvg_array_bases {
varName = "rvg_array_bases";
varNamespace = "mission";
public = 1;
};
};
i can see in the Ravage MP saving function that the public variables for hunger/thirst/radiation are these, so I'm not sure why these aren't working:
player getVariable ["thirst", ""],
player getVariable ["hunger", ""],
player getVariable ["radiation", ""],
player getVariable ["status", ""],
player getVariable ["rad_status", ""]//vars to a single array would be best
@undone dew where is the save running
it's saving to profile in the description.ext
Since grad-persistence only saves on server, you can only save variables that are known to the server. So if a client defines a variable locally, without making it public, you will not be able to save this variable.
are those public variables?
hrm, perhaps they aren't
maybe I'm misunderstanding how the persistence script that you're using works
but if it's using player on the server I don't see how that would work
If you have a script that saves a variable in a unit, for example _unit setVariable ["mcd_myVariable_test",1337], this variable is saved in the unit's namespace and you need to use varNamespace = "unit";.
I think you probably want to useunit
i can try it, I saw that list of varNamespace values but wasn't sure what to use - the example they gave used Player i think
this is a bit of a #arma3_config question but: how do I select vehicles dynamically for a faction that have no gun turrets but do have a certain number of seats
does diag_log throw an error when not executed on dedicated server?
In as simple terms as possible, does anyone know why when I use group to return the name of the player's group, it does return it but with a capital B in front of it? I assume this is for Blufor, but how can I make it not do that lmao
it is the string representation BI has chosen for groups
use groupId to get the callsign
_name = groupId (group player);
Thanks I'll keep trying to make groupId work, so far it hasn't but now that I know it's the way to go I'll stick with it instead of just group
it is not working?
Is there any way either to check that an ai group or vehicle is able to navigate to a waypoint, or to choose a waypoint position that it definitely can navigate to? A2OA.
@ takadoshiki, no I couldn't quite get it working with my code tonight and ended up switching projects, but I will try again tomorrow evening.
No
Hey guys using the in game console, how would one edit what a player soldier's voice is?
Like this setSpeaker "Male01CHI";
Except I need it to change a specific player's voice and I am unsure how to call that
heyo, I have some old custom made structures/buildings from id guess before the 3d editor or something idk, anyway every single wall/window etc has code in its init with setPos etc, is there a simple way to get rid of all the code in the init?
Open the sqm file with a text editor and find and replace the inits
gotcha seems easy enough, another quick question, if there are random ints/floats like 3873,4173.974609,8.5981 in the init, will it break anything/cause errors?
Depends. But I don't see what's the point
Largely just me hoping to be lazy and not need to delete 377 individual lines and just remove the brackets around the numbers
That'll break everything
gotcha π¦
hello im trying to get an rvmat right so i made a simple build with out doors so how do i define it as an a3 rvmat #define ARMA or #define ARMA_3 ,,, also how do i define this
class CfgPatches
{
class work_shop_new
{
units[]={};
weapons[]={};
requiredVersion=0.1;
requiredAddons[]=
{
"what i need to add here "
"whats i need to add here"
};
};
};
Is there a command to randomly shuffle the data in the array?
For example, from [1,2,3,4,5] make [3,1,5,4,2]
what you trying to make like a random selection?
I want to shuffle the array and then use it with the command {} forEach Array
BIS_fnc_arrayShuffle π
see #arma3_config π
thanks π
is there possibly a way to point at a secondary magazine within the primary weapon? i.e. integrated grenade launcher
im trying to use this script, but cant get it working, ive used localexec in debug and i get an error regarding invalid expression, im no coder or scripter so ive been trying to get it worknig for a week now and still cant, someone please help or give me some advice
well, it would help knowing the error (and what you tried)
effectively, i have a script that swaps the gun you're currently using, with an identical gun with different texture. it also carries over any and all attachments, magazine and capacity, the whole nine yards. is there a way that i can specifically point the script to a secondary magazine in any fashion?
I have no idea what you mean by "pointing"
like
primaryWeaponMagazine
but for the primary weapon's "other" magazine
oooh thank you lou
this might be what i've needed
try what Lou said. or getUnitLoadout (more reliable)
now for the question i dread asking
would i just ask for _unit weaponsItems # 7 and # 8 in the variable assignment?
all i have is a screenshot, i cant find any mention of the script in the report, and the message im getting in deubg is 'I#I/* setup options for INC_undercover und...' Error Invalid number in expression - unfortualtely i dont know what any of it means
it means you can't use comments in debug console
at least not the vanilla debug console
its the CBA one i think
that's the same as vanilla
ah ok
ok ill go download it
no
i can confirm i have no idea what it is or how to use it π
how would you recommend i draw those values as strings then?
that's a command... 
and for reassigning them within a script, not sure how to handle that one either.
using the proper syntax for one π
i am new to scripting, sorry
hi new, I'm dad!
as I told you it's better to use getUnitLoadout
weaponsItems shows the weapons in no particular order
you can't tell which one is what
getUnitLoadout returns an array in this format https://community.bistudio.com/wiki/Unit_Loadout_Array
well, if select 0 == primaryWeapon
i think i have a reliable way around the issue of primaryWeaponItems not being great
it is in a file, and how do i use command? ive come here becuase i dont understand a thing on the wiki π imma go find a new game soon cos arma is beyond me haha
https://community.bistudio.com/wiki/execVM tells you how to use it
if your file is "myFile.sqf":```sqf
execVM "myFile.sqf"; // without arguments
[1, 2] execVM "myFile.sqf"; // with arguments
of course here "myFile.sqf" is placed at the root of your mission directory
is it possible to open command line in editor? or only in game?
i already started loading mission, gimme 5, takes me a little longer than the normal person haha honestly appreciate the help, its hard to find when your a complete novice
i have it open now, so would i be typing *execVM "UCR_Setup.sqf"; * in the debug console?
yes
after pressing localexec it gave me a directory to my mission folder under the debug console box but nothing else happened
then the script was executed
does that mean im super sneaky now? imma go walk through a crowd of opfor and find out
Β―_(γ)_/Β―
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
my script is in a folder called INC_Undercover, should it therefor be "INC_Undercover/UCR_Setup.sqf";?
yes
ok now now my pc is doing something because its froze π update pending lol
no directory this time
Yes Arma has a limit, but hitting a limit wouldn't crash.
USB Headest?
No, using a Xonar u5 audio driver, with audio technica headphones
Gonna do more testing, but so far if I disable my remote exec for Say3D the crashing stops.
It's a hard crash to desktop too
if (_sound == "" || {isNull _object} || {isNil "SM_SoundDistance"}) exitWith {true};
_object say3D [_sound, SM_SoundDistance];
true```
I'm not the only one that gets crashing too, everyone does, some times the server.
do you get crashdumps?
Speaking of crashdumps; I'm messing around with functions, but am not getting very good debug info, besides short temporary messages and the RPT.
I know there are several tools that help with sqf scripting; can anyone recommend a few?
Yes, I also got a ArmaReport_Log zip file, trying to login to the feedback tracker
still doing more testing to see if I can find the source of the issue.
Well; going to have a go with Arma.Studio (and Arma Script Profiler). But I'm all ears for other suggestions for improved debugging.
Any more details?
ArmaDebugEngine and its VSCode plugin exist, tho I'm not sure if they currently work.
What do you need?
For now, very basic: a way of compiling script files and getting runtime errors, without having to restart missions.
BIS_fnc_recompile will recompile all your CfgFunctions
without a mission restart
But it needs to be enabled, see the wiki page
Thank you! And if I wanted the game to give longer error messages that I could read in a text editor (instead of a few seconds of black-boxed text in the middle of the screen), what could I do for that?
Just open the RPT in a text editor
its all in there
If you start arma with the -debug start parameter, you also get calltrace for the errors
Fair enough. But there's no program that combines these features. OK.
thanks again.
does anyone know a script where i can make the player get damage when they get close to a object? as in stuff like razorwires so if a player touches them they get damaged
you could use (invisible) particles with a fire effect - the longer you stay, the more you take damage
do you have a example by any chance? im like really new and also dumb with scripts lmao
not so much, but I have a tutorial:
https://community.bistudio.com/wiki/Particles_Tutorial
or via a trigger:
Activation: Any Player
Condition: this && (round time) % 1 > 0.5
Repeatable: Yes
On Activation: {_x setDamage (damage _x + 0.01)} forEach thisList;
heyo, ive got this script that works fine on my local machine however once its on the dedicated server calling it like normal does nothing and I dont get any errors surprisingly. Any idea whats up?
if (!isServer) exitWith {};
// Ensure the targets do not pop up again once shot
nopop = true;
// Step 1a
_selection = _this select 3 select 0; // Gets the first element in the list (list is at index 3), should be array of targets
// Step 1b
_selectedRandom = _this select 3 select 1; // Gets the second element in the list (list is at index 3), should be an integer
// Step 1c
_offset = _this select 3 select 2; // Gets the third element in the list (list is at index 3), should be an integer
// Step 1d
_display = _this select 3 select 3; // Gets the fourth element in the list (list is at index 3), should be a boolean
// Step 2
_offset = round random _offset; // Where random returns floating point, round gets us an integer
_polarity = round random [0,0.5,1]; // [min,mid,max]
if (_polarity == 0) then {
_offset = 0 - _offset; // Set to negative if the coin flip is zero
};
_selectedRandom = _selectedRandom + _offset;
// Initialize array of accepted targets (allows for global scope)
_targets = [];
if (_selectedRandom > 0) then
{
// Step 3a
_target = _selection call BIS_fnc_selectRandom;
_targets = [_target];
_selectedRandom = _selectedRandom - 1;
// Step 3b
while {_selectedRandom > 0} do
{
_target = _selection call BIS_fnc_selectRandom;
while {_target in _targets} do
{
_target = _selection call BIS_fnc_selectRandom;
};
_targets append [_target];
_selectedRandom = _selectedRandom - 1;
};
}
else
{
// Step 4a
_targets = +_selection;
};
// Step 5
{
_x setDamage 0;
_x animate["terc",0];
} foreach _targets;
// Step 5a
if (_display) then {
hint format ["Targets: %1", count _targets];
};
how are you calling the script?
Sorry took a shower I'll get the exact code in just a second but I believe I'm providing the script with an array of target variables and a few strings/ints
As an addaction on a laptop prop
this addAction["Sector Targets","popup.sqf",[[target_218,target_223,target_224,target_226,target_229,target_231,target_232,target_236,target_238,target_244,target_250,target_219,target_220,target_221,target_222,target_225,target_230,target_237,target_243,target_249],0,1,true]];this setObjectTexture [0, "readytarget.jpg"]```
This is just one of the times the script is called. Its on multiple laptop props with different targets
I'm not familiar with how locality works with addAction, but I would try
if (!isServer) exitWith {["Failed"] remoteExec ["hint"]};
so it notifies you if the script is terminated at the start
you might not be getting an error if it's exiting the script at line 1
ah gotcha, ill try that and see what happens
if it hits you with Failed then it's just a matter of executing your script on the server with remoteExec
afaik
makes sense
I cant test it just yet since I already threw the server back to our public preset but when I try it later ill let you know how it turns out
@still forum dunno if this is the right place to ask, but.. kind of an out there request, how hard do you think a command to get texture data given a texture path would be to implement?
didnt we recently get one for size?
by this I also mean, if I do this with intercept what are the odds that I can get you or another dev to put it in the game
https://community.bistudio.com/wiki/getTextureInfo here KK added this
how hard would it be to have that also return texture data
what is texture data
as in, an array of arrays of size x,y where each point has the rgba values of that pixel
usecase?
I don't think I like that
translating that stuff into script values will be hella expensive
I'm floating my idea again of dynamically figuring out camo values
I could give you average color
since cf bai is dead
that is stored directly in the paa
is it? avg color is probably good enough
yes. Make FT ticket for getting it added to getTextureInfo. I can just add more return values
how long would it be before that gets added? dunno what arma's release cadence is like
but yes ok will do
couple months
be quick. Its couple months if you get it till branch split which is gonna be next week
oh also. how will that work with alpha pixels
does paa avg color ignore alpha pixels?
avg color is RGBA, it also averages the alphas afaik
ok I will make the ticket once I get to my computer
hmmmm that might be a bit annoying
you may need to remind me tomorrow afternoon
but eh. probably good enough
will do
what tz are you in?
is tomorrow afternoon... 12 hours from now?
π cool cool
will set an alarm
@still forum look good? https://feedback.bistudio.com/T162872
does anyone know if i can grab the rotor speed or a value stating the rotor is in its blur state
Hi I have an problem and it is very important. I have scripted a vanilla Giga Rabbit armed with a 30mm gatling gun. He is king of the skies of Altis. However, whenever he flies over the water at any altitude, the rabbit is de-spawned leaving only an invisible Xi'an in his core. I assume this is because the game was not designed for rabbits to spawn over water. This is clearly the result of poor foresight on the part of the dev team but I am wondering if anyone has a workaround I could try? Thanks in advance
lmao
@crystal lodge could you maybe use just the rabbit model with createSimpleObject?
Dunno if it'll animate though
also, anyone have any ideas on how to make a respawn position only visible to one unit?
Hmm, I considered making it a simple object, but then the problem is that he will lose his animations and not be able to gallop majestically through the air. (edit, turns out he still despawns even with damage disabled as well)
As far as respawn visibility, the only way I know how to separate visibility between groups is if those groups are on different factions. Same faction, they always all see it unless there is some script I don't know about.
hey guys, so iv been playing with
[_logic,nil,true] call BIS_fnc_moduleCAS; and i somewhat understand what its doing.
_logic is
params [
"_position",["_vehicle","B_Plane_CAS_01_dynamicLoadout_F"],["_type",0],"_logic"
];
_logic = "Logic" createVehicleLocal _position;
_logic setVariable ["vehicle",_vehicle];
_logic setVariable ["type",_type];
and true is if it spawns or not but im not sure what kind of numbers you can pass in place of nil. like how high is the max number it understands? does the number variable even matter?
so i think i figured it out [_logic,nil,true] call BIS_fnc_moduleCAS;
_logic is as i stated above
nil is from 0-1 and its for probability of presence
true is either true or false and its for condition of presence
Heyo, just tested it and I do indeed get the message Failed However even throwing a execVM into the init_server.sqf which is loaded by the init.sqf it still throws a Failed message
are you familiar with remoteExec?
not particularly, ill take a loot at the link
if you use remoteExec you can have your script execute on just the server
Gotcha, so something like ["popup.sqf"] remoteExec ["call", -1]; and call normally from the addaction on the laptops?
also as for -1 I see -2 is all but the server so I assume -1 is the opposite?
you're missing your parameters for your script
ahhh, I need to throw this in the init of the laptop with the parameters not in some script?
i'll show you in a minute
much appreciated, in the meantime ill fiddle with it some
so the way remoteExec works is it tells another machine to execute the given command
there might be a better way to do it but in this case you could use execVM https://community.bistudio.com/wiki/execVM to execute the script
Right, and I was doing so in another script like this
execVM "popup.sqf";
exactly
so to do that on the server you write "popup.sqf" remoteExec ["execVM",2]
if you need to include parameters you can do
["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]
_targetsArray of course being that ghastly array of targets
note I may have done the syntax wrong but that's the general idea
shit
i forgot the script itself
lol yeah the array is a bit bad, and its all good I was just about to ask about that
fixed it
yep thats what I figured it was gonna be
so for big ghastly arrays you can define a local variable with it so you dont have that big block of numbers
_myArray = [1,2,3,4];
a little trick i've learned is you can create an object in the editor, let's call it myTargets, and then you can right click and synchronize it with all the pop-up targets
then you can just do ```sqf
_targetsArray = synchronizedObjects myTargets;
ohhh that would be much better.
also referring to this again, could I just
this addAction [["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]];
Thats probably incorrect, ill go check the documentation on addAction
no
go check the documentation
if you put {curly brackets} around your code you can slap that in your addAction where it says script
if I were you i'd bookmark https://community.bistudio.com/wiki/SQF_Syntax
so that you know how to structure your stuff to fit a command's parameters
that explains the difference between scripting in singleplayer and multiplayer
Ill do so, and something like this?
this addAction["Sector Targets",{["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]}];
yeah that's what i'd try
gotcha, ill give it a shot
something that might happen is your _targetsArray may not be defined in the addaction scope
which an easy fix is to make it a global variable
or even better make it an argument in addAction
π§ you can synchronize the targets with the laptop itself as well
Alrighty, sorry for the slow responses lol im slowly writing/catching up with everything said so far in-game/script
will _targetsArray refer to the variable in the script named _targetsArray?
the variable will have to be passed to the script
ah I see now, I was thinking I would have this line written in the script and pass in myTargets variable name
that makes sense
refer to the addAction page to pass the variable
i cant really speak confidently to this since I don't have the game open
this addAction["Sector Targets",{
_targetsArray = _this select 3;
["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]
},_targetsArray];
arguments: Anything - (Optional, default nil) arguments to pass to the script. Accessible with _this select 3 inside the script. If Array is used as an argument for example, its first element reference would be _this select 3 select 0
essentially _targetsArray cant be accessed {inside the curly brackets} unless you pass it as an argument in the addAction command
hmm, why _this select 3 ? shouldnt I be calling something like this _targets = synchronizedObjects controlLaptop_16;?
watch
_targets = synchronizedObjects this;
this addAction["Sector Targets",{
_targetsArray = _this select 3;
["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]
},_targets];
you define it in line 1, then pass it as an argument
ah ok
let me edit for clarity
then _this select 3 grabs _targets from the addAction argument
and slaps it into _targetsArray localized within the {curlybrackets}
right, it makes sense now
so hypothetically pasting this in the laptop's init should activate your script for all the synchronized targets when you hit the "Sector Targets" button
even better you can do ```sqf
if (!isServer) exitWith {};
_targets = synchronizedObjects this;
this addAction["Sector Targets",{
_targetsArray = _this select 3;
["script.sqf", [_targetsArray,0,1,true]] remoteExec ["execVM",2]
},_targets];
gotcha, I gave it a quick test locally before throwing it on the server and got some errors saying _this is undefined.
Also would It matter having the isServer exitWith in the init if its already in the script itself?
ah and errors being
0:53:46 Error in expression <hint"]};
nopop = true;
_selection = _this select 3 select 0;
_selectedRand>
0:53:46 Error position: <_this select 3 select 0;
_selectedRand>
0:53:46 Error Undefined variable in expression: _this
it shouldnt be necessary since the script will only be executed on the server with remoteExec
i think i wrote the remoteexec backwards (?)
it doesnt look like it in the documentation
i think the arguments are supposed to come before the file name
[[_targetsArray,0,1,true],"script.sqf"] remoteExec ["execVM",2]
my take
im ready for a sqf vet to come in and tell us we're barking up the wrong tree
at the very least you've learned a couple commands
it seems weird that the error pops up as soon as the server starts rather than when I hit the Sector Targets addAction at the laptop
did you leave it in the init
oh yeah, im slowly but surely learning
yeah
oh was I not supposed to?
no
then how does this refer to the laptop? now im confused
I still dont understand, you want me to throw that code in the init.sqf?
it should be in the object init
i was asking if you put the code in an init sqf file somewhere
oh like the popup.sqf script, your asking if I left the execVM including it in a file?
if what we worked on is only in the laptop's init box then there shouldnt be an issue
i was confused when you said the error happens before you hit the button
ah actually that makes sense, I forgot to remove the execVM from the init_server.sqf
yeah that'll do it
so _this refers to arguments passed to the script
and if you execVM without arguments then it'll be confused
hmmm
does synchronizedObjects return false?
after hitting the button I get the error
1:10:33 Error in expression <p = true;
_selection = _this select 3 select 0;
_selectedRandom = _this sele>
1:10:33 Error position: <select 0;
_selectedRandom = _this sele>
1:10:33 Error select: Type Bool, expected Array,String,Config entry
no looks like it should only return an empty array
hmm
oh
maybe I need to unreverse the order
you can try it I think the remoteExec will just fail
i think what's happening is it's looking for an array in the fourth argument
which is true
so just swap out select 3 for select 0 to indicate the first argument
or move your _targetsArray to the end
that's probably a better plan
in hindsight it initially might've thrown Failed because it executed locally and on the server
you were right
1:15:20 Error in expression <(_this select 0) execvm (_this select 1)>
1:15:20 Error position: <execvm (_this select 1)>
1:15:20 Error execvm: Type Array, expected String
ill give that a shot real quick
i figured it out
this addAction["Sector Targets","popup.sqf",[_array,0,1,true]];this setObjectTexture [0, "readytarget.jpg"]
no i lied i didnt
lmao
it's interpreting the arguments differently because you're using execVM instead of executing the script straight from addAction
by differently i mean in a different order
alright I tried swapping _targetsArray with true and got two errors
1:18:33 Error in expression <f (_polarity == 0) then {
_offset = 0 - _offset;
};
_selectedRandom = _selected>
1:18:33 Error position: <_offset;
};
_selectedRandom = _selected>
1:18:33 Error Undefined variable in expression: _offset
1:18:33 Error in expression <t 0;
_selectedRandom = _this select 3 select 1;
_offset = _this select 3 sel>
1:18:33 Error position: <select 1;
_offset = _this select 3 sel>
1:18:33 Error Zero divisor
before we do anything else
I think your right
can you go back and do the original thing you did at the very start
and check if it executes on the server
just add in the sqf script if (isServer) do {"Success" remoteExec ["systemChat"];
because if it works on the server then you can just ditch all this
and it's a different issue entirely
i didnt stop to think it might be executing both locally and on the server, hence failing once and succeeding once
hmm if that was the case wouldnt the targets have popped up?
and also my editor is saying there is something wrong with the line you sent
it could just be a separate issue
Missing if operation after condition
yeah I was just about to say it doesnt like do lol
just checking, would adding this line make it stop working locally?
ah wait
no, all that will do is write "Success" in the game chat if it executes on the server
nvm syntax error, missing an end bracket lol
no all good, I shoulda noticed
systemChat is a good tool for debugging
especially with the previous pain ive gone through with those kinda errors lol
Oh wow just figured out you dont need to restart the server/local server everytime you change the script
π¦
well it works locally, lemme throw it on the server
if my hypothesis is correct it'll hint "Failed" and chat "Success" and i will look dumb
usually someone swoops in and corrects me by now
If you launch the server from Eden Editor, you just need to restart the mission
alright I threw this line above the previous !isSever line
if (isServer) then {"Success" remoteExec ["systemChat"]};
starting the server now
I think the mission scripted settings turn off restart or something, I dont usually have that option

you could also login as admin and do #missions or whatever method is quickest
It's a builtin Eden Editor feature
almost came back and told you it didnt chat success, then I remembered we disabled system chat, now I gotta restart the server again:\
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, false, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, true}, //--- Group Chat
{4, false, true}, //--- Vehicle Chat
{5, false, true}, //--- Direct Chat
{6, true, true} //--- System Chat
};
nope its not chatting success
only getting failed
alright then
back to remoteExec I guess
all you need to do is make sure it's being fed the right arguments
put the following, perhaps because its not in brackets?
if (isServer) then {"Success" remoteExec ["systemChat"]};
if (!isServer) exitWith {["Failed"] remoteExec ["hint"]};
you can try it but it shouldnt be necessary for one parameter
ok
wut? aren't branches already split? 
also for consistency's sake you can replace hint with systemChat
Well anyway while the server starts, I think what you were saying is correct. It said that _offset was getting a divisor by zero error, the only zero given should be provided to _selectedRandom
You can go back to editor and start the mission again
luckily everything is explained in the comments so you can replace the selects
gotcha, and you were right again, brackets didnt matter
right, so its basically backwards?
by the looks of it you can just delete select 3
since your arguments are in an array rather than a subarray
What command do you use to place it over water?
Not possible. You can measure the time since engine start tho
hmm, did so however im getting the following now
1:50:03 Error in expression <tedRandom - 1;
};
}
else
{
_targets = +_selection;
};
{
_x setDamage 0;
_x a>
1:50:03 Error position: <+_selection;
};
{
_x setDamage 0;
_x a>
1:50:03 Error +: Type Bool, expected Number,Array,Not a Number,HashMap
guess the order is still wrong
for the selects
Wat?
What's the code?
And what's the problem here?
_targetsArray = synchronizedObjects this;
this addAction["Sector Targets",{
_targetsArray = _this select 3;
[[_targetsArray,0,1,true],"script.sqf"] remoteExec ["execVM",2]
},_targetsArray];
is this what you have?
arguments should be in the original order
that'd do it
just adjusting a pre-made script to fit execVM arguments rather than addAction arguments
we're a little goofy so it's taking a minute
This code doesn't match those args
Also you're broadcasting a huge constant array over the network
It can just be embedded in the code
this addAction["Sector Targets",{
_targetsArray = synchronizedObjects _this select 3;
[[_targetsArray,0,1,true],"script.sqf"] remoteExec ["execVM",2]
},this];
is this what you mean?
No
no more errors, code seems to execute successfully locally however the is getting 0 targets, so I think synchronizedObjects is coming back empty
edited
also not sure what you mean, are you talking about the double selects?
Yes
Yes to artisan?
To you
oh, we removed a set of the selects, the original code had the arguments in a subarray
thats what we just fixed
You're still sending the whole array using remoteExec
are you saying just create the array of pre-placed targets variablenames in the sqf file itself?
do you mean the object should be passed to the sqf file to create the array there?
the script rather
no. like I said it should be embedded. altho I'm not sure how many times it's gonna be called. but anyway:
//some_file.sqf
_array = [target_1, .... , target_100];
[_array] call some_code
remoteExec ["some_file.sqf", ...];
yes
also iirc synchronizedObjects doesn't work on normal objects
why not do this?
//some_file.sqf
_array = synchronizedObjects _this;
[_array] call some_code
also iirc synchronizedObjects doesn't work on normal objects
hmm, ok manually writing down each targets variable is doable, however im curious how would I reference that variable from the objects inits?
For instance I would create a variable for each building with targets, would I just do
// some_file.sqf
_targBuilding1 = [target_1, etc];
_targBuilding2 = [target_5, etc];
// obj init
this addAction["Sector Targets",{
[[_targBuilding2,0,1,true], "popup.sqf"] remoteExec ["execVM",2]
},_targBuilding2];
that's not what I meant
ah sorry hang on
oh
_array = [];
for "_i" from 1 to 100 do {
_array pushBack (missionNamespace getVariable ["target_" + str _i, objNull])
}
i have a mission file where I use ```sqf
{deleteVehicle _x} forEach synchronizedObjects _object
it lets me just point and click on what i want gone once the script is executed
convenient for me at least
perhaps it works in eden then. but I'm pretty sure it didn't work when you did it the scripted way (using synchronizedObjectsAdd)
e.g. when I synced two units the array was always empty
didn't you confirm it here?
hmm, that could work, I guess I could rename each target to have a prefix for its house and do
_house1 = [];
_house2 = [];
for "_i" from 1 to 25 do {
_house1 pushBack (missionNamespace getVariable ["target_house1_" + str _i, objNull])
_house2 pushBack (missionNamespace getVariable ["target_house2_" + str _i, objNull])
}
However they dont all have the same number of targets so if it doesnt find the variable will it simply not add anything?
that synchObjs was empty?
I didnt, I can though. How do I turn an int to a string in sqf? couldnt print the number of items in the array because of that lol
dont forget you can always ```sqf
systemChat str _array;
ah there we go
they will be null objs. but not sure what this has to do with that code 
also you can write two separate loops
does this not work in the init? its not giving an error but there was no chat message, maybe it was sent before I was fully loaded in and could see it?
_targetsArray = synchronizedObjects this;
systemChat str count _targetsArray;
has anything come through systemChat on that server
as for this, the loop was in the scenario that I manually write down each variableName for the targets
yeah whenever I execute the code it chats Success
the sector target I mean
add Action
locally
no
maybe because it's running unscheduled
it must run with some delay
ok
_targetsArray spawn {
sleep 1;
systemChat str _this
}
no. it's unscheduled
leopard you write those code blocks damn fast
huh, I know your helping me with the code atm but whats the _targetsArray spawn {} for?
I'm passing it to the spawn
spawn has its own scope
it doesn't inherit the current scope. so you must pass the variables to it
huh ok
or better said, it just executes "somewhere else" (not in the current script)
I cant seem to send images here but it looks like its outputting an empty array
[] is what it looks like basically, except no space inbetween because of the font
[] 
yeah like I guessed sync objs was gonna be empty. so use the other method (loop)
why is synchronized objects so finicky
Β―_(γ)_/Β―
i love arma 3
I've only found it to work with modules
it works spot-on for me for whatever reason
{deleteVehicle _x} forEach (synchronizedObjects hideShit);
{_x hideObjectGlobal false} forEach (synchronizedObjects showShit);
I manually write down each variableName for the targets
you don't have to
just name one, then copy paste it
their names will be like name_1 name_2, etc.
my caveman method of getting already-named objects would be ```sqf
_targetsArray = nearestObjects [_reference, _targetClassname, _radius]
gotcha, yeah im gonna replace all of them now, I have this in my init, anything else I need to change?
_targetArray = [];
for "_i" from 1 to 20 do {
_targetArray pushBack (missionNamespace getVariable ["target_house5_" + str _i, objNull])
};
this addAction["Sector Targets",{
_targetsArray = _this select 3;
[[_targetsArray,0,1,true], "popup.sqf"] remoteExec ["execVM",2]
},_targetsArray];
yeah but I have multiple houses with the same target classes all pretty close to each other
understandable
so unless I could define a rectangular radius
its probably best to do it this way lol
lol yeah that would have been so much easier
I don't see anything wrong
how does it always get this late when I do arma stuff
wont be the first time
im trying to get this mission working for my little group before saturday lol, and every time something works, another thing decides thats too much happiness
and then the firing range has me worried because the first round idk if the guy testing it was blind or what but he said he didnt see the first few pop up lol, but then it ran smoothly
so, hopefully all works out
Iβve been sitting on a SOG PF mission since SOG PF came out
lmao
I got so burnt out making it because I decided I absolutely had to have the players insert on a helicopter with a cutscene and now all thatβs left is the briefing
Iβll run it one day
but since it's a constant array you might want to do what I said earlier
instead of passing the whole array over the network
do what? put the array of classes in the file itself?
classes? you mean objects? yes
yeah sorry, the variableNames I guess
hmm
I could do that actually, and instead have the laptop send back the house number instead of an array, then just do a simple if-else-if statement or something to assign the array to _selection based on the house
if your array is not large it's not that important.
so far the biggest house has 20 targets, so each time the script is activated its 20 targets or less
just wanted to point out that sending arrays over the network is not good (unless you have no choice)
it used to be 200+, but got rid of a bunch
I guess it's fine then
nah, there might be bigger houses in the future so ill just attempt that. if it doesnt work out before saturday ill go with the original way.
Just curious but is this the correct way to go about it? instead of the array I tried sending back 5 in its place
if (_this select 0 == 5) then {
_selection = _house5; // Gets the first element in the list (list is at index 3), should be array of targets
};
_house5 is created a few lines above
_house5 = [target_218,target_223,target_224,target_226,target_229,target_231,target_232,target_236,target_238,target_244,target_250,target_219,target_220,target_221,target_222,target_225,target_230,target_237,target_243,target_249];
if you name them like target_house1_1, etc.:
_targetArray = [];
for "_i" from 1 to 20 do {
_targetArray pushBack (missionNamespace getVariable [format ["target_house%1_%2", _houseIdx, _i], objNull])
};
hey so im having an issue with removing an object from being editable from zeus
_group = createGroup [west, true];
_AI = _group createUnit ["B_Soldier_F", _pos, [], 0, "FORM"];
_Jug = createVehicle ["3as_Jug", _pos];
_AI hideObjectGlobal true;
_AI setUnitPos "Down";
_Jug attachTo [_AI, [0,0.5,0]];
_Jug setObjectScale 0.5;
_Jug removeCuratorEditableObjects [[_x],true];``` this is what I have right now everything but the remove curator works
_Jug removeCuratorEditableObjects [[_x],true];
this is wrong
I was assuming it was wrong google wasnt doing me justice
what should I be using instead?
I tried _Jug instead of _x and that didnt work
Also I know im probably not seeing the obvious answer, coffee isnt helping me much right now
there is no curator module in your code
there is no answer rn
if that's your curator, maybe
but still it depends when the object is added to the curator
you have to remove it after it's been added
would that be the variable name of the 3den module?
how can i get the impact position of the bullet when a gun is fired?
even if it has missed entirely
yes
then I know the name thanks
the only way is looping rn
what does that mean?
add a Fired/FiredMan event handler
get the projectile
launch a loop to find out when the projectile dies
the last position before its death is roughly the impact pos
what about ricochets?
idk what that is but i suppose i could end the loop when the z value starts getting higher
ricochet doesn't always cause the projectile to go higher
it simply changes its direction
apologies I am back, neither the variable name nor the owner name work as the curatorModule
like I said, it has to be removed after it was added
so it being the last thing on the list would not be that would I need to add a delay for it?
even a delay may not be enough
so im better off using the "remove from Zeus" module then trying to get it to do it for me automatically
what I mean is, use an event handler or something
oh
gotcha
are there any way to have an invisible object that works with a HitPart eventhandler?
Depending on the object you may be able to make all its textures invisible using setObjectTexture. It will still have collision etc though
why isn't this working? In theory it should only show the hint once teh while loop is done, instead it shows up immediately with the muzzle position
this addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
projectilepos;
while {alive _projectile} do
{
projectilepos = _projectile;
};
hint str position projectilepos;
}];```
event handlers are unscheduled
this addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
projectilepos; // useless
while { alive _projectile } do // in an unscheduled environment, this does max 10000 iterations then stops
{
projectilepos = _projectile;
};
hint str position projectilepos;
}];
what does it being unscheduled mean?
this addEventHandler ["FiredMan", {
params ["", "", "", "", "", "", "_projectile"];
[_projectile] spawn {
params ["_projectile"];
private _projectilePos = 0;
while { sleep 0.01; alive _projectile } do // scheduled
{
_projectilePos = getPosASL _projectile;
};
hint format ["final position: %1", _projectilePos];
};
}];
basically, unscheduled is "run everything at once now (therefore no sleep or waitUntil) whereas the scheduler is a pile of scripts where each gets 3ms runtime per loop then it goes to the next
i notice you use sleep, does that not require [] spawn to work?
it does
there is a spawn
line 3
oh i see it now
anyway thanks
i always get [0,0,0] though
also an error if the impact is close: Error getposasl : Type number expected Object
@still forum oops meant to ping a few hrs ago https://feedback.bistudio.com/T162872
oh yep, my mistake - I fixed the code
thanks, what was the mistake?
I did _pos = projectile then getPosASL _pos which obviously did not work
was busy with other stuff today anyway :u
oh i see
some time next week
what on earth is branch cutting? 
I call it branch split. When we split off a release
so you mean next week you go from 2.07 to 2.09?
yeah
And after the split everything that goes into the "stable" branch needs to be manually checked and approved, and usually only bugfixes and critical stuff goes through
yeah I know the process π
I just didn't know what @brazen lagoon meant by branch cutting π
hopefully you get time for it before branch cut but oh well
yes @little raptor some places call it splitting some place call it cutting ive heard a lot of different phrases for the same thing
I'm thinking of making an addon similar to CF_BAI but in reverse, so I'm hoping to get an addition to getTextureInfo that gets you the avg color of a texture so that I can generate how good a uniform/vest/helmet/etc should be, camo-wise, in relation to the ground texture
I once had the same idea. but since it wasn't possible I didn't persue
worst case scenario I can do this manually for the stuff in EBOs and write something in Intercept to pull the data externally for stuff in pbos.
but having it in the command would make it much easier
actually both you and @still forum might have some input on this - this script would likely need to do a nearObjects call on all units to get trees nearby - is this going to be a performance nightmare?
should I write that using intercept w/ C++?
if it's just a small radius and for player only no
otherwise could be
the performance of nearObjects is the same in intercept
ok
nearObjects is now multithreaded. so larger distances work quite a bit better than before
neat
so as long as the individual thing I'm doing on each object is simple, it should be fine
heyo leapard, I got that script from last night working locally however whenever I throw it on the dedicated server it doesnt work, however im sure its not exiting due to the server anymore as it chats success but doesnt hint Failed. Any Idea what could be the issue?
// Check to make sure this script is executed on the server ONLY
if (isServer) then {"Success" remoteExec ["systemChat"]};
if (!isServer) exitWith {["Failed"] remoteExec ["hint"]};
there is no issue
referring to this script that we modified last night (for me )
you're always executing it on the server
yeah, but im confused why its working on my local machine, pops the targets up fine but doesnt work when I throw it on a dedicated server
how did you execute it again?
im confused why its working on my local machine, pops the targets up fine but doesnt work when I throw it on a dedicated server
could be a locality issue
but as far as I can see that script doesn't have one
all commands have global effect/args
Throw this in the init of a laptop
_targetArray = [];
for "_i" from 1 to 20 do {
_targetArray pushBack (missionNamespace getVariable [format ["target_house%1_%2", 5, _i], objNull])
};
this addAction["Sector Targets",{
_targetArray = _this select 3;
[[_targetArray,0,1,true], "popup.sqf"] remoteExec ["execVM",2]
},_targetArray];
and trigger the addAction, sends a chat in systemChat Success so the script runs, and it works just fine locally
I even got it to print the array showing it has all of the targets
but when I do so on the server, it doesnt hint saying 0 targets or do anything at all besides chat Success
I'm guessing the only remaining thing is the global variable
according to the wiki animate is global effect
I'm gonna take its word for it for now
this addAction["Sector Targets",{
_targetArray = _this select 3;
nopop = true;
[[_targetArray,0,1,true], "popup.sqf"] remoteExec ["execVM",2]
},_targetArray];
what about this?
locally?
or on the server?
isnt nopop a local variable to the script? and no just locally, ill try doing so on the server.
And one more thing, I have a firing range script that instead of animate uses animateSource, would that make any difference?
isnt nopop a local variable to the script
no
instead of animate uses animateSource
maybe
if your script is too old maybe the object animations have changed
I don't know what those target objs use
hmm, ill just try doing all of the above real quick, and I dont know how old the script is to be honest. However my firing range script, which works for the most part, uses event handlers such as this
//Target is in line, initalize it
_x setVariable ["RQR_controller", _laneController];
_x animateSource ["terc", 1];
_x addEventHandler [
"HandleDamage",
{
params ["_target", "_selection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator"];
if(_target animationPhase "terc" == 0) then {
if(_projectile isKindOf ["BulletBase", configFile >> "CfgAmmo"]) then {
playSound3D [SOUND_POPDOWN, _target, false, getPosASL _target, 1, 1, 300];
_target spawn {
waitUntil {(_this animationPhase "terc" == 1)};
waitUntil {(_this animationPhase "terc" < 1)};
_this animateSource ["terc", 1];
};
} else {
_target animateSource ["terc", 0];
};
};
0
}
];
waitUntil {(_this animationPhase "terc" == 1)};
waitUntil {(_this animationPhase "terc" < 1)};
wut? do these targets move back up automatically?
yeah, its a firing range with multiple rounds
its code thats way to complicated for me to replicate/modify lol
well looks like whoever wrote this script didn't know about the nopop thing
uh
changing animate to animateSource worked, the targets popup now
I assume the reason there is no hint Targets: 20 message is because the script is only executed on the server
hmm the targets do keep poping back up though
So that was a lie
// Ensure the targets do not pop up again once shot
nopop = true;
hmmm
the targets stay down locally though
yes. you should've remoteExeced that
Ah I just decided to use systemChat instead
does anyone know a script where when the trigger is activated it ONLY damages the nearest player to the trigger?
currently my issue is that it damages all players
sort them by dist and damage the nearest player only
do you have a example by any chance? im kinda dumb when it comes to that
_sortedList = [thisList, [], {_x distance thisTrigger}, "ASCEND"] call BIS_fnc_sortyBy;
_nearest = _sortedList#0;
_nearest setDamage damage _nearest + 0.1;
thank you very much
Not sure where to post this since there isn't a mod help channel - I'm having a problem here. I have all my pbos signed in my mod and they are all binarized but when I export one pbo and edit something and repack it with pbo and try and join the server with the same updated mod it says its not signed with the key in the server and if I use addon builder the server says a list of mods require it the pbo but its in there. what is a fix for this?
anyone know why when i use this script
while {alive barb1} do {
sleep 1;
_distance = player distance _this;
if (_distance < 2) then {
sleep 0.5;
[player, 1, "leg_l", "stab"] call ace_medical_fnc_addDamageToUnit;
[player, 1, "leg_r", "stab"] call ace_medical_fnc_addDamageToUnit;
};
};
just breaks when in multiplayer?
@warm coral where is it running
if that's not running local to the player that's why
how can i make it run local to the player?
i honestly have no idea how to check
@warm coral where is it being called from
this might be a facepalm moment but i dont know how to check that either. im like extremly new to scripting i can only do surface level with like lots of help lol
nvm for some reason it just works now
any help for me π
are you re-signing after update
yep
then idk
I haven't actually figured out pbo signing yet so I'm sorry I can't be more helpful
Ok dumb, abstract idea I need help with because I can't script for the life of me. So I've got this thing, where I'm planning on having an "Ice Mage", I'm just planning on using the VR Arrows, and just calling them "Ice". I would like them to "throw" these ice arrows at the players, with two different types of attacks, one directly from them, and one from above that descends down. Any ideas for the scripting?
Should marker manipulations like resize or hide be in init.sqf or initPlayerLocal.sqf ?
I'm trying to get a pulsing or "ripple effect" from a marker but
while {true} do {
sleep 4;
"marker_81" setMarkerAlpha 1;
["marker_81",[50,50],3] spawn BIS_fnc_resizeMarker;
["marker_81",3] spawn BIS_fnc_hideMarker;
["marker_81",[0,0],0.0001] spawn BIS_fnc_resizeMarker;
};
Is flickering on dedicated server, and even when editor testing it flickers back on one time after fully fading out
so you need to add a delay after each of the resize functions because right now, all 3 of the resize commands are being called almost instantly causing your flicker
Thanks, would sleep x be sufficient in between each or is there another delay I'm not aware of
Edit: Adding a sleep in between each has done the trick, going to dial in the exact numbers a bit but this is quite promising, thank you again
Edit 2: Still flickering on dedicated, even though editor testing is now perfect.
Could this have anything to do with where I'm running it?
I've got an [] execVM "markerPulse.sqf"; inside my init.sqf
Or is sleep not reliable enough on dedicated server, hence why it's only flickering there?
Edit 3: Moving the execVM to initPlayerLocal did the trick on the dedicated server. Everything is good now =D
My mission objective requires that a terrain object be destroyed. After some lazy searching I came upon a script executed on a game logic:
0 = [this] spawn
{
waitUntil{!alive (nearestObjects [_this select 0, ["Land_TTowerBig_1_F"], 3] select 0)};
boomradio1 = true;
publicVariable "boomradio1";
};
But I'm rethinking this for two reasons: 1) the waitUntil and nearestObjects is spamming the RPT. 2) A publicvariable is a bit inefficient networkwise.
Is there a more efficient way of detecting the destroyed object, then synchronizing a change in player objectives for everyone?
First thing I could do would be to hide the terrain "Land_TTowerBig_1_F" and replace it with a variable named one. But I rather liked this set up for not needing to replace objects.
The key you signed the pbo with must be uploaded to the server as well
Is that why you think it's inefficient? 
No.
- It's using a waitUntil and no sleep
- It's using nearestObjects
- It doesn't even check if the list is empty and just does
select 0 - It uses a loop for something that doesn't even need a loop -> waste of performance
And publicVariable is not inefficient per se. But doing it for no reason, in bursts and more importantly sending large data is.
Anyway, there are event handlers for something like that. See BuildingChanged or something like that
Thanks for replying π. Not sure why you start with a "No". As (implicitly) stated, I'm aware that waitUntil and nearestObjects are repeatedly flooding the program with errors; by definition inefficient. Wasn't aware of the list checking aspect π€ ; interesting! Didn't think of "BuildingChanged", will check it out.
Yes, publicVariable isn't automatically inefficient. But in this looping check, with a long variable name, it of course is in terms of network bandwidth. I suppose I was asking a second question: how to efficiently synchronize a task state across clients on dedicated.
With thanks for your patience to my programming naivety.
I have a lot to learn
looping check
public var is outside the loop
long variable name
that var name is not long
in terms of network bandwidth
it's just sending a simple boolean variable.
Not sure why you start with a "No".
because the publicVar is not the reason it's inefficient
waitUntil and nearestObjects are repeatedly flooding the program with errors
neither waitUntil nor nearestObjects have errors
the error is probably because of what I said in my 3rd note
have you considered using https://forums.bohemia.net/forums/topic/236310-project-psykers/ ?
init.sqf executes for the server and all clients. since those functions have global effect they will overwrite each other. try to use it in initServer instead
im trying to make animals spawn on players if they go to certain parts of the map but i like it to be random amount and times when it dose so this what i can think of tbh _unit = group player createUnit ["RaptorAIM1", position player, [], 10, "FORM"]; // is there a little script laying around i can adapt to what i need
for random times:
if (random 1 > 0.5) then {
// spawn
};
``` for random amounts:
```sqf
for "_i" from 0 to (ceil random 5) do {
// spawn
};
thanks you so random time anything from 1 sec to 0.5 and the amounts is anything from 0 to 5 ?
the if would only spawn in 50% of the cases, the for loop will spawn between 1 and 6 units
ok kinda follow i'll make something up see if works i'll drop in again if i broke my server lol π
if (random 1 > 0.5) then {
for "_R" from 0 to (ceil random 5) do {
_spawn = ["R1","R2","R3","R4","R5","R6","R7","R8","R9","R10","R11","R12"] call bRs_fnc_selectRandom
spawnmodule = [["RaptorF1_ID1","RaptorF1_ID2","RaptorF1_ID3","RaptorF1_ID4" ["createVehicleLocal", "getMarkerPos _spawn"]];
removeallweapons _x; // not sure this is needed
removeallmagazines _x; // not sure this is needed
spawnmodule setvariable ["LifeR_Spawn_move","MOVER",true];
spawnmodule setvariable ["LifeR_Spawn_pos",position player,true];
};
};
};
hmm this kinda s**t but can think of a way lol
Yes, conditions can be combined using logical AND and logical OR: https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting#Booleans
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Wow this is actually so much more then I was hoping for, I'm so surprised I didn't find this! Thank you so much!
hi, i'm creating a gui and i want to know if we can have a "Listbox" with a text automatically resized or the text move left to right until the text reach the end ?
Hey, question
Why is BIS_fnc_replacewithsimpleobject not recommended for use in MP or for use with large numbers of objects?
it might be performance-expensive
Hmmm
Like, in what way? Just while things are converting, or long-term after everything has been converted to simple objects?
Currently, a method our unit uses for optimization is converting compositions with large numbers of static objects to simpleobjects at the start of the mission, using a script we used that forces excecution in the scheduled environment to keep the unscheduled queue from overloading
In our experience it's laggy at the start of missions, but in missions it levels out
Of course since I'm still learning things, I'm looking to review whether that's the best option or not
one thread, all the config reading the network deletion-creation, etc all for only one object I would tend to believe
Hmm okay
@little raptor hey bro, what was that link you sent before on converting image formats please? didnt save it to my favorite
Nvrm - found it
#arma3_model message
and, do you know the dimensions of the weapon picturs for loadout screen please?
someone have an idea ?
You can get the text's width and resize the listbox
You could also cut the text and display the full text in a tooltip
yeah but i want to resize only the text line
not the listbox
i don't know if you see what i mean
The text line's width is almost the full width of the listbox
minus some margin left and right
so not sure how you would resize the the row without the listbox
Don't randomly ping devs. Also #arma3_gui
interesting i will post my message there then
no. find a vanilla one and see what dimensions it has
put it in a controls group
oh you mean create a custom listbox. This is interesting i will check thx
no
just put the listbox in a controls group
but what is the difference ?
when you resize the listbox in a controls group the visual size will be that of the controls group
ok but it will resize what ? just the row i want ?
do you even know what a controls group is?
yeah you can put a lot of controls in
it's like a listbox for controls
i already used a controls group
Hey there, this script is returning "error undefined variable _tokensWithdrawable" and I can't find any issues with it.
addAction itself pops up and a systemChat before it is able to show the value of _ctokens (0)```
_atmID addAction
[
"Withdraw 5 Tokens",
{
[(_this select 0), _atmInv, 5, _ctokens] execVM "WithdrawTokens.sqf";
},
nil,
1.5,
true,
false,
"",
"true",
3,
false,
"",
""
];
In ``WithdrawTokens.sqf``:
_tokensWithdrawable = (_this select 3);
systemChat str _tokensWithdrawable;
no. a controls group is like a "window"
that's the point of it
not "putting a lot of controls in it"
yeah a window and you can put control on or in
it's the same
and when you move the control groups
all controls on will move
without moving all controls one by one
but i haven't tried to resize a control groups
i just tried a control groups with a lot of combo box in
I didn't say resize the controls group
I said resize the listbox
ok
then i will try
but i will get what after ? because i haven't really understand sorry
a systemChat before it
before what?
Before the addAction is created
systemChat str _ctokens;
_atmID addAction
[
"Withdraw 5 Tokens",
{
[(_this select 0), _atmInv, 5, _ctokens] execVM "WithdrawTokens.sqf";
},
nil,
1.5,
true,
false,
"",
"true",
3,
false,
"",
""
];
what happens when you cut a rectangular hole in a sheet and look through it? (or just put it on something)
the same thing will happen here
Here it it is with the systemChat included
the code block you give inside the addaction creation has a different context which does not have the _ctokens variable
it is undefined in that context
you can try to systemchat the value of _ctokens inside that codeblock before your execVM and it will tell you the same
ok so if i understand i need to put my listbox in a control group and resize the listbox
i will tell you what i get thx for your help
That's certainly what it is pointing towards, I'm guessing that _atmInv doesn't work either and that may have been what was previously causing unknown errors.
Hey question- so for the titles config entry in CfgSounds
Got a voice line sound where I have subtitles configured
How do I play the voice line with the subtitles on screen? Is there a way to do that?
Checked https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_playSubtitles but it doesn't mesh perfectly IIRC
Ah nvm I'm a fool, it's baked into playSound XD
Thanks!
Anyone good with Main Page buttons that instantly connect to your server? I have it all setup and everything but when clicking it won't connect before I changed the IP to new one it used to bring me to server browser since it wasn't the updated one
Okay thx. I just made a new line with getroadinfo where it filters out bridges. Performance wise would there be any benefits in running it in a single line with βand,βorβ ?
Quite possibly yes. You can measure the code execution time in the Debug Console and compare the results π€·ββοΈ
anyone?
hello everyone!
I need a little help. I would like to spawn a vehicle using a script and i need the vehicle to be a medical vehicle - i'm referencing to ace3 mod where (in attributes) you can check a checkbox of each vehicle whether the vehicle will or won't be a medical vehicle, this is the script i use and works: ```sqf
this addAction ["Means CV EMS", {
private _vehicle = createVehicle ["M_CVPI_EMS", [14909,13771]];
_vehicle addAction ["Last 112 call", {
[caller_position] spawn gps_fnc_main;
}];
_vehicle addAction ["Last 911 call", {
[caller_position2] spawn gps_fnc_main;
}];
_vehicle addBackpackCargoGlobal ["B_Bergen_hex_F", 1];
_vehicle addBackpackCargoGlobal ["TFAR_rt1523g", 1];
_vehicle addBackpackCargoGlobal ["CUP_B_SearchLight_Gun_Bag", 1];
_vehicle addBackpackCargoGlobal ["CUP_B_SearchLight_Tripod_Bag", 1];
_vehicle addBackpackCargoGlobal ["ACE_TacticalLadder_Pack", 1];
_vehicle addItemCargoGlobal ["TDD_Talon_Mag", 6];
[_vehicle, true] remoteExec ["enableDynamicSimulation", 0];
}];
hmm i found different scripts to make a vehicle a medical one. first one seems to be used in other scripts:
_vehicle setVariable ["ace_medical_medicClass", 1]
``` https://github.com/acemod/ACE3/issues/5545
second one is from the moduleSetMedicalVehicle:
```sqf
_unit setVariable [QEGVAR(medical,isMedicalVehicle), true, true]
while {alive BEE} do {
sleep 1;
if (BEE distance (getPosASL player) < 50) then
{
player switchmove "AmovPercMstpSrasWrflDnon_AinvPercMstpSrasWrflDnon";
};
};```
Having looping problems
Trying to make it repeatedly check the distance from the player and if it is inside of its distance, it will run the script
i'll give it a try, thank you
the first one doesn't work and the second one returns error
the second one requires the macro to be defined
well i have no idea what it is
anyways, have you any other suggestion, how to make a vehicle medical vehicle using a script?
What are you attempting?
maybe
_vehicle setVariable ["ace_medical_isMedicalVehicle", true, true]
nice, this one works β thank you very much π
while {alive BEE} do {
sleep 1;
if (BEE distance (getPosASL player) < 50) then
{
player switchmove "AmovPercMstpSrasWrflDnon_AinvPercMstpSrasWrflDnon";
};
};```
needa help looping
what is the issuie whats not happening
BEE distance (getPosASL player)
you are supplying an ASL position as an ATL
it's best to use either 2 objects or 2 positions ATL
I personally perfer to use vectordistance e.g.
(getPosWorld BEE) vectordistance (getPosWorld player)
Also make sure you are running your script in a scheduled environment
Is it possible to use structured text in systemChat?
no
dang
the wiki says it all
I'm blind I guess
"String" π
Yeah I kept searching for ways to make it a string but couldn't find any so that's why I asked
if you want funny colors in chat, you can create other custom chat channels with colors, but its just the channel title that will be a different color
I managed to get it working with some RscStructuredText
addEventHandler, which event handlers are persistent (i.e. they stay attached to the unit, even after it dies and respawns) ?
If it's not on the wiki, then you'll have to test it yourself.
So I could need some help here. I'm trying to execute code when a variable is equal to DisplayNull . I did this with if (someThing && {isNull (uiNamespace getVariable "my_var")}) then { , but it never executes. When I check the comparison via systemchat, it does not provide the expected false, but it returns bool instead. I also tried this with (uiNamespace getVariable "my_var") isEqualTo displayNull and (uiNamespace getVariable "my_var") == displayNull. Everything returns bool instead of false.
What am I missing here?
isNull (uiNamespace getVariable ["my_var", displayNull])
it returns bool
it means the variable is not defined. use what Terra said to give it a default value if it doesn't exist
how do I configure what to whitelist or blacklist for BIS_fnc_3DENExportSQF?
How would this generate zero divisor error?
_pointerY = (matrixMdlSpc select 1) select 0;
if matrixMdlSpc is empty
Sorry if this is the wrong channel and #arma3_scenario Would be better but I need help, this mission needs to be ready in 2 hours.
I am looking to put the MW2 Radio Chatter into a mission but I cant find the page that says how to. I want it to start when the players enter a trigger that way it doesnt all play before they get there
this is the channel, I deleted in #arma3_scenario to avoid crossposting
if I define function in initServer.sqf can I use it already in initPlayerLocal.sqf or should I re-define it in initPlayerLocal.sqf again ?
// initServer.sqf
MY_fnc_somethingToDo = compile preprocessFile "fn_somethingToDo.sqf";
// initPlayerLocal.sqf
[player] call MY_fnc_somethingToDo;
the player wouldn't even know about the function in the first place (unless it is a hosted mp)
so I need to redefine it in initPlayerLocal.sqf again, or do it via cfgFunctions
CfgFunctions is the best option anyway
could it work with initServer.sqf and then publicVariable function ?
technically: yes. but that only makes sense in certain situations
otherwise you are wasting performance and bandwidth
Does anyone know if backpackSpaceFor still works? Tried to run it and it just returns a generic error in expression.
https://community.bistudio.com/wiki/backpackSpaceFor
Edit: Nevermind, the example using (backpack player) seems to be wrong and should be (backpackContainer player)
Hello! I have a public variable in my init.sqf
ma = _nearestMarker;
publicVariable "ma";
I tried using the variable itself in my initServer.sqf but it seems to not recognize it
How do I make sure the publicVariable is useable ALSO in other SQF files?
Thanks in advance
you are using it in init.sqf which is run on every machine
also, initServer.sqf is executed before init.sqf in MP, see https://community.bistudio.com/wiki/Initialization_Order
So if I use publicVariable in initServer.sqf..It would be recognized in init.sqf?
Of course make sure it's a server thing running there..
Thanks for the link, very useful!
Ok, learning all the time π
Thanks again!
a global variable is available anywhere on a machine as long as it's defined before it's used(obviously)
Roger that. Solves my question about why it's not recognized in other SQF but it IS ingame
ππ
Much Appreciated!
how do I configure what to whitelist or blacklist for BIS_fnc_3DENExportSQF?
Probably via the 4th parameter @slim spire
But how would I blacklist an object?
I believe via it's Eden Entity ID
Where would I use that number to blacklist it?
Sorry if I'm not understanding, but say for example, I want to grab only a specific amount of AI. I'm not sure how to whitelist that group or blacklist every other object before calling that command
How do you attachTo with automatic offset but without it changing the rotation of the attached obj?
Found it -> BIS_fnc_attachToRelative
Am I correct to assume that the effect of setTriggerStatements gets synchronized to all machines if applied to a trigger created with the makeGlobal true?
Apparently I'm wrong 
wiki says effect local
I have a script in initPlayerLocal that executes when a player joins the server. It references an array and sets a local variable on the player so that we can reference it later (i.e, player rank = private). It's annoying to this do on every mission.
Is there a way to do player JIP scripting from a mod?
Anything like an event handler for a player connecting?
found onPlayerConnected actually, that'll work I think
not sure about mods but any function with the preInit or postInit attribute will run on mission start
anyone know a easy way to make a vehicle follow a object like train tracks?
@still forum did you happen to take a look at https://feedback.bistudio.com/T162872 btw?
that'sβ¦ not #arma3_scripting π
besides, give him time
well he did tell me to ping him about it
fair enough
hi, anyone aware of a way to get a telling name for a keybind defined via custom keybinds, https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding ?
CBA_A3 keybindings offer something like that, for example sqf private _keys = ((_keybinds # 8) apply {_x call CBA_fnc_localizeKey}) joinString ",";
Is there a Command to check how strong a object is? Or some way to Measure its Resistance/Bullet Pen Value? Basically the Armor of an Object
Yeah, but local effect doesn't automatically mean that a state can't be propagated by synchronization later.
what example do you have in mind?
weather-related commands perhaps?
Maybe, I remember there were some discussion about such cases recently, but I can't find it π
hello, i've got a problem and i would like to try to fix it with a script but i have no idea what should i do, the things is, that no matter how hard i try, players still get marked as team killers by game (tried adding huge score, disabling negative points, ...) for example when they survive a plane crash. So since there is no way to prevent this from happening, at least i want to let players know they got marked as teamkillers and force them to relog. My idea is to have a script, that checks for teamkillers and once someone is a teamkiller, he gets a hint saing to relog and an annoying sound in a loop π€·ββοΈ in terms of identifying teamkillers, i found this https://community.bistudio.com/wiki/sideEnemy does anyone have any idea how to solve this issue? thank you
So I uh overwrote the BIS_fnc_endMission with my own code cause I wanted to run something before the mission ended (Mission ends when tickets are 0) and now no matter what end mission command I use the mission doesn't end anymore... anyone know what to do?
I have a question... I can't test because my potato laptop will burn down if I open 2 armas
Are joining players considered to be in the group?
With joining I mean people who were on the briefing section, now loading the game but still not in the actual game.
I'm trying to wait to start the mission when everyone is ready, so i've made a trigger set to wait for the whole group and another to wait for no blufor units in the area, something like this:
A * B, where the first trigger will register a variable when the group is ready and then the second will register when they are gone, so only true when 1 and 1, = 1
But i suspect people join the group as they spawn, so the first person is considered to be a full group.
Maybe i should check if allPlayers are currently alive and then register that trigger, but testing is hard here
Now I don't know if allPlayers return people loading the mission 
You should be fine to check a players rating, and if negative, add the difference to equal 0 in the end
no, players are only considered in the group after they get through briefing and start inits
i got something in the think tank for you but it won't be tonight
how about you not overwrite game functions as a starter...
would it be possible to make a mod that shows you your own sensor targets on the map?
not spotted targets, i mean the actual sensor info
possibly even display stuff like the radar cone and other sensor radius's
hey does anyone know hot to make setObjectScale work in MP? I've seen some youtube videos featuring it but I couldn't find a script or make it on my own
It says Global Effect. So there's no problem
hmm I tried using it when it first came out but couldnt get it to work. I'll try again xD
βIt didn't work xDβ won't help you. Write what's wrong and what's the code
trying to find it
[] spawn {
while {alive dude} do {
dude setObjectScale 1.5;
};
};```
had this which partially worked
What does partially you mean
It's normal
can I get over it?
Better not to
/=
https://community.bistudio.com/wiki/setObjectScale
Literally BIKI says
Setting the scale of actively simulated objects (vehicles with players/AI in them) is possible, but not officially supported, you may encounter issues.
π€
sad
wanted to make a toy soldiers op π
anyway thanks for your time mate
Make everything else bigger instead of making soldiers small.
yeah that's my idea rn
You ll face some other issues depending on scenes but, well up to a point it can be handled I believe.
I'll try and see. the issue I saw was that only the texture gets scaled not the hitbox, units could walk thru a scaled building's walls
Yep thats one of those issues right there.
maybe I can put invisible walls to prevent it
I have heard a myth that AI can phase thru objects with disabled sim. Is it true ?
If the AI didn't recognize the wall/object, yes
It doesn't matter if the simulation is enabled or not
Nothing. If you place an object in Eden Editor (aka not as a terrain object), it won't be recognized AFAIK
I still have to test it out myself, but I believe in MP it either has to be an attached or simple object. If there isnt a checkbox in the eden editor to make it a simple object then you can use https://community.bistudio.com/wiki/createSimpleObject
or (presumably) attachTo
ππΏ
Arma 3: Dynamic Simulation
Limit by View Distance Limits all activation distances to player's object view distance (default: true). Dynamically simulated entities beyond the object view distance will be disabled.
I can off option Limit by View Distance in game with script?
no
you can just write a script that adjusts dyn sim dist based on view distance tho
Hi there. Anyone knows how 3den gets info for surface snapping on buildings? Tried all available LOD's in LineIntersectSurfaces and I can't get to the real intersect point
probably roadway
you can try getPos
I have the interesect positions, they just don't match the surface snapping point on some buildings
sadly that doesn't give the surface normal 
I told you. it uses the roadway LOD
no
anyway to get it by script?
beware I could quote you on that π π
again I told you. getPos
this is one of getPos exceptions π
Sorry, getpos seemed such a weird answer that I thought you didn't understand my question. Iim going to see how it works. Thanks!!
have you tried the handlerating eventhandler?
You mean getting the keys assigned to a bind?
https://community.bistudio.com/wiki/actionKeysNames
https://community.bistudio.com/wiki/actionKeysNamesArray
https://community.bistudio.com/wiki/actionKeys
thanks! Awesome
btw you wouldn't happen to be interested in implementing a command that gives all triangles in a lod right?
I'm working on something right now to use lineIntersectsSurfaces to "dump" the LOD and its animations (for path finding, using its convex hull)
but if I could simply get all the triangles it would save me a lot of effort (and performance
)
correct, I wouldn't very much
I'm talking about VIEW/GEOM/FIRE LODs, not the high quality res LODs
I guess I should change my question then. Is there any way to run code and delay the mission end when a sides tickets get to 0?
Geom I would potentially.. but.... not.. no
FTon of data to export :u
well I only want the triangles, in one array of 3D positions (e.g. [[1,2,3], [4,5,6], [7,8,9], ...])
if the game also stores indices that can reduce the number of vertices (so you'd return two arrays: one array of vertices, and one array of indices)
possible... but eh
maybe you'd be more interested in the final product π
I'll show it to you when it's done
I can smell burned cheese from my baguette. Thats not good
it worked!!! It fits the snapping position exactly. But I have to create an object to use getpos, there is no other way that doesn't involve creating an object and getposing it?
no
at least not as of now
I've asked in #arma3_feedback_tracker again just in case
so I'll be creating a bunch of them, I'm using 10cm balls
I personally need it a lot too
and deleting them
wat no
that's super slow
just use one
and setposasl it, right!
so i create my helper objects in the beginning of the script and move them around as needed. It's amazing that it never crossed my mind before
if that's a code for something else I worry for your health & safety π
It was a good baguette, it has now been eaten
uwu
does sqf have a ternary operator
no
you can recreate similar behaviour with other commands, like this:
_something = ["Player is dead", "Player is alive"] select alive player
though, with the select both of the values will be evaluated(i won't explain how it works), so in cases where you have constant literals, or very cheap computations, it's fine, otherwise you can use if:
_something = if alive player then {something expensive to compute} else {blablabla}
Become a big modder and community figure and be invited to bohemias next big anniversary party and meet me there at the bar
damn
Trust me, thats the best for all of us
or just support him on Patreon
:pout_kitty:
oh right you have a patreon
Hey guys, i ran into a problem while scripting a small script. My problem is im trying to make a unit come close up to the player like this:
_npc domove getposATL _player
But the unit stops 20m away of the player and i dont seem to get it working. I hope someone of you guys got a clue π
if by "20m" you mean 5m, that's natural
yeh that could be sorry π
can i make it work that they dont stay 5m away?
not really. they always stay outside the bounding box of objects.
you can try moveTo too. that one usually gives better results than doMove
also setDestination could help, no?
it only works on agents
another method is using animations directly
that one will definitely work but needs a lot more work compared to a simple doMove, etc.
ahh nice. I will try it
I want to replicate a behaviour like the zombies in the Ryen Zombies & Demons mod
i tryed to look up like how the zombies behaviour was build and they did it just like this _zombie domove getposATL _target;
but i will give it a shoot
thx @little raptor β€οΈ
arma is weird and ryan zombies & demons is a bad example since the boundingbox of a heli can already stop them from moving torwards a person. ^^
I know itβs a little weird but you could have an invisible unit (The AI/Brain of unit) and attach another unit (What you see) and just animate the visible unit. Seeing as the unit is invisible I think it will move closer to the targeted unit from what Iβve experienced before
Iβve done this before when I made some rabid rabbits and they would literally run and sit on the feet of the unit
yeah this is a tough one
just to be clear @tired delta what do you want to happen? You want AI units to walk up to players and attack them, correct?
Hi guys, how could generate a random number?
random
ooor⦠this ^
both of those work, random is faster
the bis functions are useful if you want random numbers between a range
thanks guys π
random can do that too
https://community.bistudio.com/wiki/random
second syntax π [min, mid, max]
otherwise (10 + random 80)
YEah, right now I'm reading this
right right. I think the only real reason to use the bis fnc is for a random int simply
but you can achieve the same yourself ofc
yep, the functions are shortcuts
I need an Script that generate a random number tu desactivate a bomb, but in each game play I want the number could generated randomly
I reading the function how do this
https://feedback.bistudio.com/T162925 created :3
