#arma3_scripting
1 messages · Page 114 of 1
to have required parameters, adding a simple check could do the trick: if (count _this < NumOfRequiredParameters exitWith { ["Your error message"] call BIS_fnc_cannotRememberTheErrorFunctionName; }; but requiring something is kinda stupid (use isNil check instead)
true
can cause troubles indeed (mostly because nil errors just go unnoticed) but there is plenty of ways to double check theese things
well, count would return if you have nothing for 1, but something for 2
oh, also, you can make it so it accepts different param orders :D
not too concerned with how many ways.. more concerned I am constrained to 'a certain way' if I am supplying functions to be used by others. Just because spawn/scheduled is grumpy with nil values
especially if that certain way could be reduced to an easier method that works fine in unscheduled cases
params[
"_object",
["_argA",objNull,[objNull,1,true]],
["_argB",objNull,[objNull,1]],
["_argC",1,[1]]
];
//this spawn{[_this,true,1000,1] call ratchet_common_fnc_tankRefiller;};
//[object,refillOthers,maxAmount,StartAmount]
//[object,maxAmount,StartAmount]
if (isNil "ratchet_refillAceFuelTanks") then { ratchet_refillAceFuelTanks = []; };
if(isNil "_argA")then{
["Unexpected variable for first argument. Called by %1",typeOf _object] call BIS_fnc_error;
}else{
_maxAmount = -1;
_startAmount = 1;
_isSource = false;
if(typeName _argA == "SCALAR")then{
_maxAmount = _argA;
if(typeName _argB != "SCALAR")then{
_startAmount = 1;
}else{
_startAmount = _argB;
};```
(This is deprecated code tho, so x3)
... bloody filter
Just guard your stuff against that by checking the different conditions first:
params [
["_unit", objNull, [objNull]],
["_unitVariableName", "", [""]],
["_value", nil]
];
// Throw an exception if the unit is not provided.
if isNull _unit exitWith {
throw [
XMS_UNIT_VARIABLES_EXCEPTION_INVALID_UNIT_PROVIDED,
"The '_unit' argument must be provided, must be an object and must not be null.",
_this
];
};
// Throw an exception if the unit not initialized.
if !(_unit getVariable["XMS_Unit_Initialization_var_Initialized", false]) exitWith {
throw [
XMS_UNIT_VARIABLES_EXCEPTION_UNIT_NOT_INITIALIZED,
"The '_unit' argument must be initialized by the Extensive Medical System.",
_this
];
};```
cannot link here due to something triggering content block
but that wont fail if they supplied a string for _argA
or am i wrong?
part of my code. Is argA is it they supply a string, it will be objNull
right. I want to catch a wrong type AND nil
_argA accepts bool, scalar, and object types
which params boolean does really well
Does this function:
Stacks?
Stack meaning as in: everytime I use it, it ques the function to keep running after the previous iterations ends?
I've tried using it some times but I always have some issue that make me discard it. Sometimes it feels like it ques, sometimes I can clearly see it be invoked multiple times at once. Instead of trying to guess, better come here and ask people around right?
oh darn it, I forgot the not
params["_aaa",["_aab","default",[""]]];
if(isNil "_aaa" || {typeName _aaa != "STRING"})exitWith{...}; // exit if nil or if not of type string
...
could check via function viewer :P
yes, works. very wordy though. Not saying it cant be done as my last example in original code works fine. I just think it's redundant and stupid when first example should work fine for both sched/unsched
well, I dunno what to tell ya
sad times, no one to give me opinions on my map in terrain makers v.v
I realize its the VM but params and private command should put the local variables on the stack and allow nils is all I am saying. Undefined variable error should only trigger if it's not defined or passed in e.g. like a typo of a local variable - if we should even have undefined variable error at all.
problem could exist beyon just parameters - e.g. repassing a nil value through to another function
I like Advanced Debug Tools' console, and notepad++
regarding the if and if not of duck typed languages, it is this way for everything, because duck typing demands it or a hard crash
Which is nowhere implemented
as an unassigned variable is defined as nil
yea, normally I try to avoid nil's. Heh, I have redundant checks. Idk why you'd call my script with a nil, but juuuust in case!
Nah
what you are doing there is just plain madness 🤣
I use both. I have been coding in C# for 16 years since VS Pro 2003 . Not complaining about 'I cant seem to do this' I'm just more wondering why the VM complains about nils at all
oh, the ArgA is just me being weird ;P
because
hey guys. playing around with flat empty area (optional empty. i can just hideglobal everything in the area an unhide later). can't seem to find a reliable way to do it (dynamically). fnc findsafepos with isflatempty check can take long and freeze for a few seconds. and its not exactly reliable tbh. what's your method?
anyone here use acre and have made custom presets for it?
Im trying to rack my head around on how to do this and Im completely lost
It's something that's painfully expensive in SQF. If you check findSafePos it's just trying random spots within the radius until it finds one that fits.
Depending on your input parameters it might be better to do a recursive search.
while {(RPR_intelHQLoc isFlatEmpty [-1, -1, 0.1, 20, 0, true, objNull] isEqualTo []);} do {RPR_intelHQLoc =
[getMarkerPos "AO", 100, 600, 1, 0, 0.1, 0, [], []] call BIS_fnc_findSafePos;};
that's about how generous i can be with the search params. not that they way im implementing this is the best anyway.
what would be a recursive search? 😬
Like split the initial search into a bunch of larger circles, check for object count in those. Then pick the one with fewest objects and search within that.
or just make the terrain flat
don't play with my feelings... i was actually wondering if that was even possible. point me to the right direction?
It is possible lol
setTerrainHeight
Terrain Lib https://steamcommunity.com/sharedfiles/filedetails/?id=2966168738
Bucket (zeus mod) https://steamcommunity.com/sharedfiles/filedetails/?id=2967119946
setTerrainHeight is an option. the other 2 not really. the positions are randomly selected by script and change several times during mission. also mod dependency.
mod links provided for you to reference how the command is used.
ohhhh.. sorry.
before i embark on this quest, is setTerrainHeight "light"? or it sinks FPS like a mofo?
@fair drum come on dont hold back 😛
got me own question lol
anyone got anything made to convert a multidimensional array to multidimensional config array?
["index1", ["index2", ["index3", ["index4", "index5"]]]]
to
{"index1", {"index2", {"index3", {"index4", "index5"}}}}
Run it in the console and see what the time in ms it gives back it
Doesn't really cover it because it'll have a persistent effect.
Ah
Do you just need to change the symbols? If so regex could probably handle that
this is what I got so far which seems to work. Can I condense this further? I'm terrible at regex lol:
// Convert to config array
private _array = str getUnitLoadout _unit;
_array = _array regexReplace ["\[", "{"];
_array = _array regexReplace ["\]", "}"];
copyToClipboard _array;
fixed
well it may seem that isflatempty and findsafepos are rather stupid. sometimes gives me crappy locations when there are at least two other much better suited locations just meters away.
anyone got a working garbage clean script?
It'll just pick the first valid location.
The "first dimension" thing you wrote already takes care of all
okay sweet
we can build you one if you let us know what you want
The purpose is to have all ai/dead unit delete once players exit the trigger area
all (live?) AI: allUnits select { !isPlayer _x }
all dead units: allDeadMen
so something like this?
{
if (!isPlayer _x) then {
deleteVehicle _x;
};
} forEach allUnits;
{
deleteVehicle _x;
} forEach allDeadMen;
yes
well you also have to delete the weapon holder that a dead body creates
How would that look like?
add in
{ deleteVehicle _x } forEach (allMissionObjects "WeaponHolder");
{ deleteVehicle _x } forEach (allMissionObjects "WeaponHolderSimulated");
{ deleteVehicle _x } forEach (allUnits select { !isPlayer _x });
{ deleteVehicle _x } forEach allDeadMen;
{ deleteVehicle _x } forEach (allMissionObjects "WeaponHolder");
{ deleteVehicle _x } forEach (allMissionObjects "WeaponHolderSimulated");
didnt work
what are these looters?
the vanilla looters, independent under looter classname
i have a trigger that spawns them in and i need something that on deactivation works as a garbage clean
Deleting a dead body automatically deletes the weapon holders that it created.
what about deleting a ai that has not been killed?
They should be deleted by the allUnits line.
you got time to hop on vc so i can show you the issue?
What is the best approach to smoothly changing and randomizing weather during game (apart from initial randomization)? I am not sure how to handle the overcast and its forecast. Thanks
Is there a way i can make an obj in game with an add action set the server to nopop = true and nopop = false?
i mean you could lock the server so people can't join if thats what you want?
nopop as in targets popping back up...
ooooh lol
yea lol
why would that work on the console but not from script?
"It doesn't work" does not tell us anything. If you have an error, post it
no error whatsoever
does work if exec in console. does nothing when execVM. self hosted. ran global, server, and local.
to be even more clear. run code in console. works everytime. copy/ paste code to sqf, execvm "said.sqf" on console... nothing.
You sure the file exists where you're specifying
yup. deleted one ;, saved, execvm ... error missing ;. so, super sure im execvm'ing the right file.
Post the entire script
if you run that code on console, be aware, there is a few seconds freeze.
forgot to change it to getpos player instead of getmarker pos.
but eitherway, same thing.
Ok can someone please help me, im gonna start pulling out my hair and teeth.
I've made a init and put line 15-28 in the init. It works perfectly on editor but when I put the mission file on the server it doesnt work
Just to cover the basics, if you put a hint at top of that file, does it display? Like to make sure the init.sqf in admin folder is called?
That’s not my mission template, that was provided to me by someone on the ace discord
oh gotcha
so vanilla init.sqf in mission folder? anything else in it? if so, does that work fine?
Oh thank fuck I think I got it
waitUntil { ([] call acre_api_fnc_isInitialized) }; [(["ACRE_PRC343"] call acre_api_fnc_getRadioByType), 2] call acre_api_fnc_setRadioChannel;
I added this to it
but to answer your question yes the init.sqf is in the mission folder and no there isnt anything else but the mission.sqm
Kinda odd, because init.sqf is supposed to be last in the MP init order.
Now I do have another question. How do I make more tabs like these?
createDiarySubject
I have a drone vehicle that is spawned via the server, and theres some issues when trying to take control with the UAV terminal. I was thinking maybe its a locality issue. Is this the command to change the vehicles localitly from server to whatever player https://community.bistudio.com/wiki/setOwner
Should be
i might be close to something...
okay cool
I'm pretty sure it is because both Debug Console and your execVM do work properly and both failed to satisfy the while condition. In Debug Console (aka Unscheduled Environment) while is limited to 10000 or 100000 (I don't recall right now) so it will exit regardless the condition has met to prevent the game freeze. Meanwhile execVM (aka Scheduled Environment) can do it infinitely
10000, I just checked
I'm sorry, but is this the proper channel to ask about mod scripting (ie. config.cpp files, etc. while making a mod)?
yes i figured it was related to shceduled vs unscheduled. so i tried with isnil {code} as if it was call and it worked. sorry i didn't reply on that.. it still freezes and takes too long.. and not the best flat results. its a pain.
For config, #arma3_config . This is a channel to discuss/ask for help about SQF scripting. Regardless it is from/for vanilla or modded
i mean it does return somewhat flat areas, but then 10 meters away there is a WAY better spot that was not chosen because arma. not worth the 2 seconds freeze everytime i spawn a compo.
Thank you very much. I'm super novice but just stuck on a seemingly simple thing atm, so knowing where to go for information or ask a question is super helpful ❤️ I don't think my question super pertains to SQF scripting as far as I'm aware. I'm trying to use CBA's Settings System (which I'm fully aware is not Vanilla) to change a value in the CfgWeapons of a mod I'm making (if that's even possible in the first place).
to change a value in the CfgWeapons of a mod I'm making (if that's even possible in the first place)
There is no way to change a config parameter on the fly
Depends on what exactly is your goal, you may make it happened via some scripts though by mimicking it
Ahh... That probably stops me in my tracks then (which isn't the end of the world). I know this is super off topic, but just to be blunt with what I'm looking to do:
- I want to make a mod that overrides ACE's
ace_nightvisionaddon'sNVGogglesclass that has a unique value calledace_nightvision_border. - It has a default value of
"\z\ace\addons\nightvision\data\nvg_mask_binos_4096.paa", but I want to replace it with my own custom path to a .paa in my addon directory. I have already accomplished this successfully via class overriding (overloading? forget what it's technically called). - I want to go a step further and have a CBA Setting of type
LISTgive the user an option to choose what image is used for this value. I already got the Setting created and visible in game, but I'm stuck on how to "apply the global variable value to the config" for lack of better words 😅 Like, I'm not even sure what the work around would be, or if it's even possible.
You'd have to use a mod (could maybe do it in a mission config as well)
Yeh, I'm trying to make that mod... But I don't even know how to begin with linking the CBA setting to the value in a CfgWeapons class that's already restricted by having to modify a specific value of a different mod (ACE).
I'll take it to #arma3_config though, which should be a better place. Sorry to derail! Thanks! ❤️
But I don't even know how to begin with linking the CBA setting to the value in a CfgWeapons
You can't
Even though I literally have zero experience with ACE scripting/modding and barely for CBA but sounds like ace_nightvision is very scripted
The actual overlays are done in config, they have two versions of each NVG type, one for green overlay (vanilla) and one for white/blue
It is for the effects, but ace_nightvision_border is literally just a static .paa they throw on the screen when nightvision is activated.
Would I maybe have better luck in the ACE Discord then?
I just figured they wouldn't take kindly to inquires about modding their mod.
A vanilla overlay is not a paa, but p3d for whatever reason
Hence I suspect it is scripted after it took a paa
Oh I thought you were trying to do something else, the effects are done through post processing effects
I know, I'm trying to change just the border; the simpler of all things considered 😅
Why would they?
They have channels dedicated to helping people learn and mod ace
Oh sick, I'll give them a ring then. Thanks 🙂
ida soooo sllllooooow
anyone made comething like this?
BIN_fnc_showHorizontalCompass dont work in arma vanilla
Squad DUI Radar is the closest I know of.
yea good old DUI
Let me do some research
https://github.com/LarrowZurb/Compass/tree/master
this will work
I want to save all players in a radius around the player on which the script is running in an array. I would use the nearestObjects command for this.
Can someone tell me which type (class name) I have to enter so that I only get players?
nearestObjects is very costly. You can get all players with allPlayers and filter it out with inAreaArray
private _players = allPlayers inAreaArray [getPos player, 100, 100];
Thanks. The first 100 probably stands for the distance, but what does the second 100 stand for?
Read the article, its x and y radiuses of a ellipse or half of the side for rectangle.
Okay thanks 🙂
Before I do this myself, does anyone know of a module / script or something that's been written that intercepts Zeus placed objects and forces the server to create them instead?
Help , please. I need to count "FirstAidKit" in box. Something like this ?
{"FirstAidKit" == _x} count (getitemCargo cont1);
try itemCargo instead
@proven charm that's right
Is there anyway to check if a black screen is active?
what black screen?
hey guys, before i keep bashing my head against this non flat nor empty wall. have any of managed to come up with a reliable solution for finding good flat areas (dont even care about empty at this point). everything i've tried so far is unreliable, returns positions that are mediocre with very good positions near by that are ignored. if you tell me there is a way, ill keep chewing on it. but maybe you could spare me the headache and just tell me "look, don't bother, go in the editor, pick your places and store them, and work on that" or something in those lines.
what are you using said flat areas for? spawning compositions on?
It's fundamentally an expensive problem in SQF. You can do it, and there are better ways than findSafePos, but they're algorithmically complex and maybe too slow for your use case anyway.
This is the sort of problem where even in native code you'd want to be a bit smart about it.
And then SQF is 1000x slower.
On the other hand, if you already have a method that's nearly good enough but neglects better positions nearby, then just check for better positions nearby.
What are you trying now?
that, findsafepos, shk_pos script, selectbestplaces (meadows), combos of it in steps, all together... even tried to do my own... don't laugh too hard (state is super WIP):
findFlatArea = {
params ["_pos", "_radius"];
// Check for flat areas in the radius
for "_i" from 0 to 360 step 5 do {
private _angle = _i;
private _checkPos = _Pos getPos [_radius, _angle];
private _elevation = _checkPos select 2;
// Compare the elevation of the current point with the elevation of the marker position
private _gradient = _elevation - (_checkPos select 2);
// If the gradient is close to 0, it's relatively flat
if (abs(_gradient) < 0.01) then {
RPR_intelHQLoc = _checkPos;
break;
};
};
publicVariable "RPR_intelHQLoc";
};
// Usage:
[_finalLoc, 300] call findFlatArea;
what values were you putting into isFlatEmpty?
that was a hell of a headache and i don't even know what im doing thre tbh
"yes"
let me find the last attempt. i don't even know were i stopped. i know im not checking for objects anymore.
Your gradient check there always passes. You're just comparing the Z value of the point with itself.
yeah i was up till 6 am, i don't even know what i tried last.
Using BIS_fnc_blackIn, and BIS_fnc_blackOut, is there a way to tell if it's blacked in, or blacked out?
looks like it sets BIS_fnc_blackIn_completed to true. check Out for similar
hey guys what would the script look like to delete just dead bodies within the trigger
Dead bodies don't trigger the trigger
i want to as blufor the player exits the trigger for any dead ai to be deleted as if tis a garbage clean
{
deleteVehicle _x
} forEach (allDead inAreaArray thisTrigger)
Any way to tell if it's for your specific tag?
its for a mp server so just using any player
Deleting many units in a single frame will freeze your game in the next frame tho (for a few ms)
something like 30-40 units hopefully it wont be too bad
Dunno. It might be a bit noticeable
thanks its working, i will keep an eye on the frames but luckily the server is running at a stable 110fps
It's a lot better than killing a lot of units in a single frame :P
Apparently the animation + ragdoll is extremely expensive.
Yeah. But that's due to ragdoll
Can't say I noticed hitching from mass delete, but then I probably have strong tolerance for hitching in Arma.
Yeah probably only noticeable with 1000+ objs. If you run deleteVehicle createSimpleObject [_model, _pos] via code performance you'll notice your game freezes in the next frame. But I guess in that case it deletes several thousand objs
Anyone have a script to trigger a camera that follows bullets shot from a mounted HMG?
I found this one
player addEventHandler ["Fired", {
_null = _this spawn {
_missile = _this select 6;
_cam = "camera" camCreate (position player);
_cam cameraEffect ["External", "Back"];
waitUntil {
if (isNull _missile) exitWith {true};
_cam camSetTarget _missile;
_cam camSetRelPos [0,-3,0];
_cam camCommit 0;
};
sleep 0.4;
_cam cameraEffect ["Terminate", "Back"];
camDestroy _cam;
};
}];
But it only works with normal weapons.
The Fired event handler responds to the exact unit (/vehicle) it's added to. So if you add it to player it will only respond to shots fired by the player unit. When the player is using a vehicle's weapons, the player unit isn't firing - that vehicle is.
So you just need to do exactly the same thing, but replace player with the vehicle you want it to work on, in this case presumably the static HMG turret.
Is there a way to figure out on what machine a given unit is local
i.e. send a hint only to one player with remoteExec
If you have the unit, just pass that as the remoteExec target parameter and that machine will be used as the target
Hm, I"ll have to re-test it
See, ZEN has a feature where you can double-click a unit and execute code on it
it has a _this to specify the unit as the target of scripts
I'm wondering if the person didn't notice the hint or if it doesn't quite work right
thanks
Also, there's gotta be a way to do this right but also compact
_pos = getPosATL _this; _pos select 2 = (_pos select 2) + 50;
"SmokeShellRed" createVehicle [_pos];
but my syntax brain is somewhere between python and node rn so I can't remember sqf so good
oh
because it makes a new array doesn't it
Right, got it.
_pos set [2,(_pos#2) +50];
Yeah, I got there eventually <3
can also one-liner it with this. Not sure if faster or slower:
_pos = getPosATL _this vectorAdd [0,0,50];
:o
I didn't know that was an option!
It's under Vector, is why
but it'll work on pos?
It sure will.
Vectors and Positions are technically interchangeable. They're not a unique data type, they're just arrays of 2 or 3 numbers.
Now if I can just get spawn to behave.
Let's say I wanted to do the previous thing with a 5 second delay between multiple grenades.
private _pos = getPosATL _this vectorAdd [0,0,50];
sleep 5;
"SmokeShellRed" createVehicle _pos;
sleep 5;```
For this to execute properly, it needs to be "spawned" so it's in the scheduler
so it can be slept
now, I see a lot of just like
[] spawn { private _pos = getPosATL _this vectorAdd [0,0,50];
sleep 5;
"SmokeShellRed" createVehicle _pos;
sleep 5;
"SmokeShellRed" createVehicle _pos;}```
But this doesn't seem to... work
spawn is a separate scope to the original script, and local variables from the original script don't work unless you pass them in as arguments
_var = "blah";
[] spawn {
systemChat _var; // fails, _var doesn't exist here
};
_var spawn {
systemChat _this; // works - _this in this scope is _var
};
[_var] spawn {
params ["_text"];
systemChat _text; // works - _this in this scope is an array containing _var, which params can interpret
};```
Oh, I see. Thanks
Can someone that knows acre coding well, help me out please?
I’m trying to figure out why I’m having an issue… as I’m completely new to coding
Whats the issue? Is there an error? What isnt working
So the first person that connects can hear the second person that connects, but the second person cannot hear the first person.
I dont know what I need to do. Im not sure if its a code issue or not
That code just looks like it sets presets on the radio, is that correct?
Yea. which works now thankfully we just cant hear each other
Hm, I havnt used acre before, but can you hear eachother normally when setting channels manually?
Is there any easy way to find the middle position of a road object?
Yea before I started even touching custom presets we could hear each other perfectly
And you've confirmed that the players are all on the same channel?
Yea, all on channel 1 of the 152
Is there a webpage or wiki that you got the info to so this from?
Follow that. I honestly can't test the TS voice itself since I don't have TS or a TS server. But everything works fine as far as the correct channels locally.
His post above leaves out what I pointed out on the acre documentation.
Ok, did he implement the things you mentioned though?
@past cobalt particularly assigning it before giving it to them
But I'm signing off helping him because I don't have the TS platform.
I honestly don't know if he did or not. He didn't post much to confirm all he said was it didn't work.
Alright, I also dont have access to a ts server or acre so I dont have experience with this either
I want to ask for someone that might be interested in creating a mod since I cannot. My idea...
1st
…toss a grenade into a building,
…the building may or may not catch fire,
…scripting will be written to determine the probability of a fire/smoke,
…options = 0 to 100%,
…scripting will be written to determine the amount/duration/volume of fire/smoke,
“a burning vehicle ends the burn cycle, and the smoke suddenly stops and rises into the sky! I would like to see that fixed. I have numerous smoke effects that I made for a port that I made on Stazsow”. They could be used to respond to scripting that, over time the smoke slowly becomes less and less thick until it is finally spent. The Stazsow terrain also has burnt areas in the fields where fires had previously occurred. Do you know if something similar is available or could they be made as a spawnable object?
2nd
… toss a grenade at enemy out in the open, (on dry grass)
…the grass may or may not catch fire,
…scripting will be written to determine the probability of a fire/smoke,
…options = 0 to 100%,
…scripting will be written to determine the amount/duration/volume of fire/smoke,
…could a decal be placed where the fire is, to show dead, burnt area?
…enemies might be hurt by fire.
3rd
…Rockets, grenades, or any explosives do leave a decal, but I would like to see the decals last much longer as well as continue to burn to show a terrible war zone.
…Do decals influence fps?
… scripting will be written to determine the amount of time decals remain.
… options = 1-30 minutes?,
Wdym assigning it?
Hypoxic said that you need to set the radio presets before giving the players the radios. Do you do this?
They players aren’t given radios anymore. It didn’t work when I put that in
So how do they use the radios if they arent given them...?
They go into the arsenal
Oh interesting, I wonder if it has to do with the init order of assigning the radio channels
🤷♂️ Im not sure, Im green to coding and have no idea what Im doing
I wonder if theres an acre discord
As far as I read, you can't do this. I could take a deep dive through the documentation and code, but the team does a good job at documenting so you'll just have to learn the basics then return and read very carefully.
It's in the Ace discord
They aren't going to help him with basic scripting help though.
Idk if id consider this basic scripting, its very specific to acre
He's been on there today asking. Just needs to be more persistent and read the documentation that Pabst posted carefully I would think. But his responses definitely shows how green he is as he's not able to pull the important info on his own. Here's this if you want to help him further.
Still stuck at work tonight.
https://github.com/IDI-Systems/acre2/blob/master/extras/examples/mission_setupCompanySignals.sqf
@past cobalt
Take a read through this, paint that green.... Red? Or something lol
I'm having a lot of trouble with addactions that UAVs are meant to use. For some reason, the addaction shows up fine, but no matter how simple the actual code, it won't fire.
_this addAction ["kill",
{_target setDamage 1;}
,[], 10, false, true];
Like, this is super simple, and yet...?
I don't get it. What's the addAction placed on, and what are you expecting that to do?
So, it's placed on a UAV
and it destroys the UAV. Don't worry about why, it's placeholder code.
I had something more complex but realized that it wouldn't fire. So I kept trying simpler code and simpler code.
You walk up to the UAV on the ground, use the action, and it doesn't destroy it?
I use the action while piloting the UAV.
I have tried with like 15 different UAVs :(
The UAV stuff is a shitshow.
maybe use diag_log to check what _target actually is there.
(fwiw, this doesn't work even if I walk up to it and use the addaction that way)
hmmm point
oh, that's different then.
incredibly accurate comment tho
Wait, you have the addAction script wrong anyway.
Okay, that's what I suspected. What's wrong with it?
you need params ["_target", "_caller", "_actionId", "_arguments"]; at the top of it.
_target isn't a magic variable there.
You just get a _this with that data in it.
Now _target is a magic variable in the condition.
Thanks. I guess I thought for some reason they'd pass it in automatically if it wasn't a script file @_@
Is there an existing scripting command to make an object align with the terrain?
dont know but here's code from the wiki: _obj setVectorUp surfaceNormal position _obj;
Fixed: playSound3d was not taking into account the speed of sound on remote clients - https://feedback.bistudio.com/T176809
vindication
fixed
heh- Probably a better way to do this, but my group position setter script- didn't take scale into consideration. So now-
private _allItems = [];
private _allobjs = get3DENSelected "object";
private _primary = _allobjs deleteAt 0;
private _oScale = getObjectScale _primary;
{
_primary setObjectScale getObjectScale (_x);
private _data = [_x,_primary worldToModel ASLToAGL getPosASL _x];
_allItems pushBack _data;
}forEach _allobjs;
_allItems;
_primary setObjectScale _oScale;
_primary set3DENAttribute ["position",_newPrimaryPosition];
{
_primary setObjectScale getObjectScale (_x # 0);
(_x select 0) set3DENAttribute ["position",ASLToATL AGLToASL (_primary modelToWorld (_x select 1))];
}forEach _allItems;
_primary setObjectScale _oScale;
it just sets the primary object's scale when getting the relative and then when setting relative position xD
Maybe should have it set 3DEN Enhanced scale? idk
wait, can I do vectorModelToWorld and vectorWorldToModel to do this?
wait no- uh-
I don't think this works x3
3den you see, so it doesn't simulate
Oh it's in 3DEN. then everything needs to be set3DENAttibute.
yeeea. And- trig? isn't my strong suit xD
is the issue that the scale resets when you change its position?
oh no, the code above is working fine. Scale was messing it up, but I fixed that.
Now, I wanna add it so it copies input'd direction.
so it'd need to get the difference between final rotation and primary object's current rotation. Then, it'd rotate the object and all 'sub' objects that amount
Basically, when you use the widget in 3den to rotate multiple objects at once
then yes, put everything in primary's modelspace. position, vectorDirAndUp. when you set new orientation you'll need to go from vector to pitch/bank though
Hmm- Do I need to do it via vectorDirAndUp?
I vaglue remember vectorDirAndUp being able to be done via like- I think BIS_fnc_pitchBank or something?
if you want to take the easy way, setVectorDirAndUp eachobject, and copy its rotation 3DEN attribute
But, it doesn't update the attritube when you set it not via set3denAttribute
I know, but it's just to get the world pitch bank yaw. to actually put into the attribute, without doing the math
oh- oh yea, as the input?
wait no-
confused xD
ok, well, going off of what Lou suggested- what exactly is sqf [ x * cos angleRad - y * sin angleRad, x * sin angleRad + y * cos angleRad, 0, // Y rotation - 2D only ]
doing?
is this to plug into my own code or-
to understand and implement, yeah.
Where would it go? After the setting of group position?
(I don't wanna sound like I want you to do it for me, but then- I learn best when I see what works so xD)
oh also, what is render time scope-
oh, is it just a better-for-visual version?
waait, set at new would be in the 2nd for loop, save in the first, I think
this will rotate the player and keep the selected object at the relative pos and orientation
private _playerDir = ((player get3DENAttribute "Rotation") # 0 # 2) + 90;
private _v = get3DENSelected "" # 0 # 0;
private _vdu = [vectorDir _v, vectorUp _v] apply {player vectorWorldToModelVisual _x};
private _pos = player worldToModelVisual (_v get3DENAttribute "position") # 0;
player set3DENAttribute ["Rotation", [0,0,_playerDir]];
_v set3DENAttribute ["Position", ASLToATL (player modelToWorldVisualWorld _pos)];
_vdu apply {player vectorModelToWorldVisual _x} params ["_vy", "_vz"];
_vx = _vy vectorCrossProduct _vz;
_rv = [_vz, _vy, _vx];
_r0 = [
[0,0,1],
[0,1,0],
[1,0,0]
];
_r = _r0 matrixMultiply matrixTranspose _rv;
_rotation = [
(_r#1#0) atan2 (_r#0#0),
asin -(_r # 2 # 0),
(_r#2#1) atan2 (_r#2#2)
];
_v set3DENAttribute ["Rotation", _rotation];
getAttritube doesn't get current object value, but what ever 3den has saved, so position is right, but rotation of individual objects are not xP
although...
_v set3DENAttribute ["Rotation", _v get3DENAttribute "Rotation"];
so I need to convert from vector dir and up to 3den's rotation myself
or- maybe I could just add the new rot attrib for the primary object and the individual object rot?
no
wait
I think it's working?
I will need to update the input params tho
updated =)
oh matrix's confuse me so so much xD
ngl same. It's why I hadn't attempted this until now for my snapping mod
Has anyone managed to get a working version of teh SC-173 mod working in MP? I can get it to run just fine in SP, but the blink doesn't work, and the unit doesn't move.
Is there a command I could put in to unit init for them to die as soon as mission starts?
I want to have some corpses my players run into, but setting their health to 0 causes them all to die in the same exact way, causing there to be just bunch of copy/paste looking bodies, which looks really weird.
setDamage 1 ?
I don't know the code for it, but give them all different move orders, and then have the setdamage run after .5 or 1 second.
Paint?
A combination of setVelocity (maybe with random) and setDamage will do the trick
How would you use setVelocity here? Can't really wrap my head around what the wiki says.
@zenith stump _this setVelocity [random 3, random 3, random 3];
maybe not the z :P
What exactly does it do with infantry?
haha maybe not lol
it pushes them in a direction
you could also kill them and then use addForce to push the ragdoll
What would be the simplest way to do it? Still not super comfortable with scripts.
You're doing it in the init of each unit right?
if so, try
[]spawn{
_this setVelocity [random 3, random 3, 0];
sleep 0.1;
_this setDamage 1;
};
That will begin to move the unit in a random direction, and then 0.1 seconds later it will kill them.
Why not LUA?
Got this when I put it in unit init field.
ah mb, use this instead of _this
_this is just a blank array because that's how you ran the spawn. Need to use something like this:
this spawn{
_this setVelocity [random 3, random 3, 0];
sleep 0.1;
_this setDamage 1;
};
yo
currently looking at changing the main logo on the menu screen - I've seen it done before in mods and such, and I've already got a custom main menu set up but I've been struggling with finding the exact steps needed to change it
It's not done with scripting, you'll need a mod to do it. Check out #arma3_config
yeah, you say you are green at scripting. there's the resources to make you not green anymore.
Where can I find a compiled list of all the arma 3 radio callouts from AI?
Do you mean this?
More like how the AI call out "Man, 300 meters, front" and similar. Or calling out fast movers, etc. I'm trying to find a script for all the callouts for doing voicelines
Basically I'm just trying to find out what lines I need to cover to have the equivalent amount of lines to Arma 3
(vanilla)
If anyone does know, do send me a DM or a ping
Do you mean you want to make a new set of voicelines?
Yeah. Best way to say that lol
I just want to know what people use as a baseline for the voicelines
Then basically the article says all
So for the types of enemy vehicles I just have to guess? lol
No, literally everything you need to have is there
Also there barely are modders who makes such set of audio and config, I only know one or two
Maybe I'm in the wrong channel, and I'm confusing you. I'm just looking for the voicelines to record
It's on that page under "full list of words". It's collapsed by default to save page space so make sure you expand the table.
I'm so mad for not seeing that. Thank you, fellas]
anyone done base building scripting stuff here?
what kind of base building?
like players able to put down buildiings and barricades
oh well like you probably already know zeus does that
i guess i mean without an external camera/zeus interface
ok
i made script to allow player to place machineguns and other statics but buildings is a lot harder to do
yea im just wondering what the standard thing to do is to prevent people from placing floating stuff
like, allow multi-story construction, but prevent totally floating objects
that's going to be tricky
@cold pebble doesn't Frontlines have a base building feature?
i did some stuff, but never use it in a mission lol
i made that you place it where you are looking, with a maximum radius, but always in the ground, so you cant build stuff on top of other stuff.
and to prevent to build objects inside other objects i used the boundingSphereDiameter given from https://community.bistudio.com/wiki/boundingBox
you can also check with that command if a objects is clipping... but requiere a lot of code.
other alternative i was working on, was using the memory points of buildings to make fortifications stick to windows or other points you can define, its a good alternative so you can store that easly in a variable, and delete them if the building is destroyed
I have no idea if this is a thing, but is it possible to vary the height of AI units (like somehow in their config) when you spawn them in? They are all spawned in as exactly the same height as each other .. which is kinda unusual
how would i make a script that checks if a player has an item out of a list of items and then remove this item?
or one of the items randomly if the player has more than 1 out of the list
i already got the command for removing the item and also know how to make the array and stuff
just confused about what to put in if ()
how it would know a player has one of the items of the array
Do you mean items or magazines too?
items specifically
for context i am working on a survival scenario
where players can give other survivor npcs food or water through ace
// Hashmap storing item limits, key:lower case classname, value: max allowed count
private _max_items = createHashMapFromArray [
[toLower "FirstAidKit", 2]
,[toLower "SomeOtherItem", 0]
];
// Temporary hashmap to store found item counts, only ones mentioned in _max_items are counted
private _found_counts = createHashMap;
{
// Only care if this item is in _max_items keys
private _class = toLower _x;
if(_class in _max_items) then {
// Increase found items counter of this class
private _new_count = (_found_counts getOrDefault [_class, 0]) + 1;
_found_counts set [_class, _new_count];
// Check if found counter exceeds one in _max_items
private _max_count = _max_items get _class;
if(_new_count > _max_count) then {
systemChat format ["%1 removed, can't have more than %2!", _x, _max_count]; // _x instead of _class to print original letter casing
player removeItem _class;
};
};
} forEach items player;
There is another way through arrayIntersect, but I think hashmaps are perfect for this
classes have to be toLower'ed in _max_items because key look up in hashmaps is key sensitive
Could probably make that simpler with https://community.bistudio.com/wiki/uniqueUnitItems
Oh, I completely missed that command
Yea, 3D preview and the like. Build stuff found here: https://github.com/DomT602/Frontlines/tree/master/Frontlines.Malden/Logistics
A triangle/square snap system like Rust might be a good balance. Are you looking to give more freedom than snapping standard sized components?
lua is ugly as hell
Lua (fanboys hate allcaps) could work, but they'd probably need to abandon the whole "scheduled" (preemptively pausing scripts) thing, so badly made scripts would impact framerate like in arma1. And it would usually not be obvious until it combined with all the other badly made scripts.
They'd also need extra libraries to handle savegames.
Is there a video of it somewhere? Very curious how it looks
_helmets = ((getItemCargo _container) select 0) select {
_itemConfig = _weaponsConfig >> _x;
((getText (_itemConfig >> "simulation")) == "Weapon") and { (getNumber (_itemConfig >> "type")) == 131072 } and {
_itemInfoConfig = _itemConfig >> "ItemInfo";
(getNumber (_itemInfoConfig >> "type")) == 605
} and { (getNumber (_itemInfoConfig >> "HitPointsProtectionInfo" >> "Head" >> "armor")) >= 2 }
};
_helmet = if ((count _helmets) > 0) then { selectrandom _helmets } else { "" };
Can someone tell me. Can I use instead of selectrandom some command that will select the maximum value of the parameter "Head" >> "armor". It must be selectmax i think, but how can i use it here?
private _max_armor = selectMax(_helmets apply {getNumber(configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "HitPointsProtectionInfo" >> "Head" >> "armor")});
private _best_helmets = _helmets select {getNumber(configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "HitPointsProtectionInfo" >> "Head" >> "armor") == _max_armor};
selectRandom _best_helmets;
"ItemInfo" >> "HitPointsProtectionInfo" >> "Head" is not guaranteed way to get head armor btw, hitpointName = "HitHead"; inside that class is what matters, class name "Head" might not mean anything if mod designer names it something else
I’ve not got a specific video for it, but once I’m back home at PC can do a quick video of it
So true head armor lookup is a bit more complex
Thanks, searching youtube and its all action with no base building there
@meager granite thanks, will try this way.
Yea, I imagine it’ll be in some videos but you’d have to find it within 8 hours or something 😂
Is there a way that a player or a group could have their default map marker color set to something specific? For example if I want everyone on Alpha to automatically have blue as their selected marker color
Probably by force changing the dropdown listbox with colors on the map?
Exactly, that in theory should work but I can’t find anything about it on the wiki sadly
findDisplay 12 displayCtrl 1090 lbSetCurSel 1
```sets second map color (red by default)
Oh wow, thanks
findDisplay 12 displayCtrl 1090 lbText 1 => Red
findDisplay 12 displayCtrl 1090 lbValue 1 => 3
lbValue seems to return class index in CfgMarkerColors
configName((configFile >> "CfgMarkerColors") select 3) => "ColorRed"
What about lua was ugly again? Syntax, like using do and end instead of { and } or language as a whole?
Thank you so much!
As an example of what I consider an ugly language, see body foreach array.
Better quality is coming but here it is atm: https://www.youtube.com/watch?v=6T08rc0787U
Demo of Frontlines Building System.
Github: https://github.com/DomT602/Frontlines
I never really got the collision detection as well as I wanted 😦
BoundingBox seems rather large. Have you tested the "new" syntax?
I think yu can reference different geometries
I agree ref BB, I haven't really done a huge amount of scripting for it, but I'll take a looksie
Ah yea, syntax 3 for bbr. Which LOD would be the best for this use I wonder
https://cdn.discordapp.com/attachments/918185900381437982/1172219259921895515/20231109170018_1.jpg?ex=655f8542&is=654d1042&hm=886a94e81598a55ae5f0bd6ac8fda87ac24c0654390a360384e0f0c10140d327& "memory" looks good for vehicles, less so for buildings
Geometry appears to work well...
private _collisionZone = (boundingBoxReal [_previewObject,"Geometry"] select 2) + 0.5;
May be the best option
hey guys. i was hoping to use DAC, but it's pooping some errors. is it not longer working with the current ver. of arma?
DAC ver. 3.1b, script.
couldn't catch the other errors, fast moving.
_Values = ["AO",[1,0,0],[6,8,20,5],[3,2,30,5],[2,2,30,5],[1,2,5],[0,0,0,0]] ;
_Pos_1 = getmarkerPos "AO";
[_Pos_1,600,600,1,0,_Values] call DAC_fNewZone;
marker IS there. spawns only vehicles.
check the rpt
i did.. would have to post it here. still, not sure if the thing is just obsolete and longer works. would start with that.
idk what DAC is so you should also post the link to its doc
Thank you for making this!
Dynamic AI creator, by silola?
i was just wondering if anyone knew about it's current state. maybe ppl just don't bother with it anymore.
maybe its my error, maybe the script is obsolote.
well A3 is mostly backward compatible. also you're getting undefined var error which means it's most likely not due to broken backward compat
anyway check the rpt to see what the first error was
Reminds me that I still have to make my script have rotation built in (and find either better anchorpoints or integrate user modify able positioning)
Looks dope good stuff. Looks way better than my rinky dink building system
Cheers ^_^
yea just trying to prevent placement of obviously floating structures with nothing underneath
so id want some check of whatever is below the bounding box to be at least somewhat substantial (so a house isnt sitting ontop of a food tin as example
for snapping i hope i wouldnt have to go thru and define snap points for all assets
my build stuff is on some public servers if you want to have a play with it
There's a mod called snapping for eden and zeus, not sure how exactly it works as I haven't looked at the code for it
I wonder if you could get more precise by using a rectangle instead of a circle.
Have you tried the 2nd syntax with clipping?
I tried the syntax 3 for BBR with "Geometry" and it gives a better value for both vehicles and buildings
I see
If the geometry is tight, most rectangular prisms corners are good enough
Hey there, I am looking to either make or find a script that allows me to close all doors within an area via a laptop interaction. For the purpose of closing the doors on a shoothouse once a run has been completed. Does anyone know of a script/composition that exists already for this purpose, or perhaps assist in making one?
I used ACE Object: Hold Action to recruit AI to squad with _this joinSilent player;
Next I need to have any AI following the player to leave the squad and move to another location once they reach specific area, but I have no idea how to do this. Any suggestions?
Also, the _this joinSilent player; seems to make AI the squad leader whenever I try it. Any way to have player be the squad leader?
I can't really have it join specific squad as this is for multiplayer mission and I can't predict which player might recruit each AI character.
I think it's because you are passing _this which is an array of probably more than just the unit. I'm not at a pc right now but I think it's easily correctable. When I get to one, I will double check.
OK, I checked, I believe in this case _this is referring to [_target, _lpayer, _actionParams] so you are having both the target and the player rejoin the group. Make it instead [_this select 0] joinSilent player;
To have them leave:
private _newGroup = group [side player, true];
[ units group player - [player] ] joinSilent _newGroup;
private _newWp = _newGroup addWaypoint [ <position> , 0];
<set any waypoint specifics like type, mode etc.. here on down> ```
First one worked great, thanks! Gonna test out the second one.
How do you set that one up? A lot of stuff I'm unfamiliar with.
Used a trigger before?
I have for some basic stuff like completing objectives.
Set one up that has the activation as "Any Player" and "Present" and in the OnActivation code just paste the above into it. But you will have to provide a position. For example, if you were using a marker called "MoveHere" you could replace <position> with
markerpos "Movehere"
I created market called Movehere to test it and
I get error "On Activation: group: TypeArray, expected Object"
Actually scratch that.. Make it Group Leader instead of Any Player if you want it to only affect one group at a time.
Right now it looks like this.
private _newGroup = group [side player, true]; [ units group player - [player] ] joinSilent _newGroup; private _newWp = _newGroup addWaypoint [ markerpos "Movehere" , 0];
Oops.. One sec.
OK, sorry was back and forth from PC. Set up trigger "Any Player" is "Present" and then paste in this which is MP safe:
if (player in thislist) then {
private _newGroup = creategroup [side player, true];
(units group player-[player]) join _newGroup;
private _newWp = _newGroup addWaypoint [ markerpos "MoveHere" , 0];}
I had typos in the above... paranthesis, group instead of create group etc.. I just tested and its ok
see above - had to edit another typo
if you want it to repeat, set repeating. Especially if you have multiple players. Another consideration is to randomize the destination otherwise groups will all just pile up in one spot
Yea, it works perfectly. Thanks!
Having them pile up is not as issue since that makes it easier to count how many they rescued once the mission is over.
I just realized you can take the if (player in thislist) then { ...} out too and just put player in thislist in the condition box. I am rusty with triggers. I dont think I have used one in many years lol.
It's fine. I would still be struggling to figure this out without your help.
I'm honestly impressed by all the wizardy people here manage and make it seem easy.
Glad I could help!
2 questions about doArtilleryFire:
-
There seems to be weird gaps in the map where the artillery cannot fire upon. Any one know what the deal is with that?
-
Is there a reliable way to predict how long a doArtilleryFire fire mission will last?
- How is your code and where exactly is the arty?
- You may want to calc by RPM
what is rpm edit: how can i poll rpm?
Check for config, weapon's firemode should have its own "rechamber" time by seconds
How is my code is a complicated question. In this case, there's a mortar sitting on a hill. There are unexplained gaps in its coverage over open terrain that it should be able to easily target, and well within range.
Well I wanted to know if it is a reproducable "issue"
it's reproducable in the sense that it has happened a number of times.
Is there any way to configure what settings the ai use to calculate a firing solution? For example, high vs. low arc?
https://community.bistudio.com/wiki/inRangeOfArtillery
This or something maybe
Lua is a disgusting language
Isn't there a command to convert bool to 1 or 0?
You might be thinking of getNumber, but that's specifically for config.
Otherwise no, I don't think so, but some commands are able to treat bools as numbers if given them (select for instance)
It's a simple conversion to make though:
_number = if (_bool) then {1} else {0};```
Slightly faster would be _number = [0,1] select _bool as well
But the question is why?
because I have use for it.
Okay...
I'm encountering a problem where checkvisibility seems to incorrectly return that there is LOS between two positions is. Does an area need to be preloaded to work correctly with this function?
How do you use that command?
if (([objNull, "VIEW"] checkVisibility [_road_pos_asl,_test_pos]) == 1) then {
... if view is clear between road_pos_asl and _test_pos.
What exactly are _road_pos_asl and _test_pos?
standby i think I might see the problem.
I think you completely missed my point wrt foreach.
Hey yall, sorry I don't know if this is the place to ask, but I'm looking for a vehicle garage spawner. Like VSS, but something that reliable works. Anyone know of anything up to date?
https://community.bistudio.com/wiki/BIS_fnc_garage
Not sure what VSS is but this?
This wouldn't pull up modded vehicles tho correct?
I might be dumb, but I can't get it to work. Also a fun fact, its grouped into the "broken functions" group on the wiki
Then please post what exactly you've done. Also not sure about how it is broken
Think you did not understood SQF
Sqf reads like "X is to be done for each Y" instead of "for each Y do X" - the latter gives the context of the body, needed to understand it, before the body itself, and is found in practically every other language with such a concept.
This is what makes sqf uglier than even cobol IMO.
As i said: i think you did not understood sqf
oh?
not at home right now so cannot explain sadly
I'll look forward to reading it later then.
In short: foreach ARRAY do CODE would "degrade" foreach to the same like if ... it would just mark the variable for the do so that that command knows what to do
and such practise is memory wasting BS
It's pretty much what 'for' does already. And I think the other loops too.
- makes the code you have harder to maintain (from BI perspective)
Haven't seen the bi code, so I can't speak for that, but it's not obvious it would be harder to maintain than a completely separate foreach.
The other version would make the sqf code easier to read and thus maintain, and they have plenty more of that.
Not rly
forach is just a count more or less
And changing it would just mess around more with the lang
I can certainly agree on the 'changing it now' part - but what I'm saying is that these (old) decisions make it an "ugly" language. With the note that my "pretty/ugly" has little to do with the glyphs ('}' vs end, I don't care) themselves, but more with how ideas are expressed.
(On a semi-related note, if there was a C api to the commands, we could implement our own languages as extensions.)
Such a new foreach could be added, and be backwards compatible, but I will agree that it will be harder to maintain to have both. And the old one can't go away anytime soon.
Ok, so I have initPlayerLocal.sqf script, with introduction text for players. It works as [] spawn (and then the intro code)
Is there any idea on how to make this script not working for admin logged or specific slots? I want to skip this as Zeus and prepare something for players while they are loading in intro
I had simple idea:
if (!(isGameMaster player)) then {
}
else {
[] spawn
// intro code here
}
but it didn't really work
isGameMaster not being listed in https://community.bistudio.com/wiki/Category:Command_Group:_Curator 😉
private _allCuratorUnits = allCurators apply { getAssignedCuratorUnit _x };
if (player in _allCuratorUnits) then
{
// ...
}
else
{
// ...
};
I suppose 🙂
Anybody remembers any object which has really weird bounding box where center is very offset?
Units have that with Z, but I want an object where center is offset with XY
I remember Zamaks having it, but it seems to have been fixed
Found it, carrier parts fit this very well, like Land_Carrier_01_hull_01_F
boundingBox => [[-33.8187,-25.4193,-13.9649],[33.3638,16.2517,28.1443],36.1704]
Thanks, I'll check it out, I remember seeing 'isGameMaster' earlier, but now I think it might have been a class name in some script
if you use ChatGPT to code for you, don't 👀 😄
I don't xD
does someone know how to get the information of the current keyboard preset from the profilenamespace ?
Is it even stored there?
it isnt never mind , it is stored in the other file profilename.Arma3Profile
I want to change the keybinds of the player per script but not sure if I can
I don't think you can edit controls through script
Only make scripted keybinds through key press event handlers
there is the button presets in controls , maybe there is a way to make a own preset per config ?
CBA has a system for custom keybinds in missions - if you're using CBA already, I'd recommend using that for better compatibility with other mods and scripts.
If you're making a mod (not mission), you can use https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
I would not recommend trying to change the player's existing keybinds, especially for default game controls; if they want to do that they already have the option to do it themselves, and no one likes having their keybinds forcibly changed.
Check CfgDefaultKeysPresets
thanks guys, I got my keybinds already configured via the CfgDefaultKeysPresets, I wanted to change the defaultl arma movement keybinds to some other keys. Maybe I can do it via CfgDefaultKeysPresets, I will check
hey guys, quick question. 1st player to join is #3 correct? so if i wanted to remoteExec on that player i'd do for example "{code} remoteExec ["call", 3, true];". the thing is, if the player 3 disconnects, will some other player take that ID? also, if so, might a JIP take it?
(this is not a quick question)
IIRC the client IDs are UID-persistent, so if a client rejoins then they get the same one.
Not the easiest thing to test though.
And completely undocumented.
Had a fun bug with this. remoteExec ["whatever", -clientOwner, true] will not just skip execution on the current client now, but also if that same client rejoins later.
So don't use negatives except -2 for JIP.
got it.
There are several other options for how the allocation could work that you'd need multiple clients to distinguish between. But reassignment is certainly possible.
better general rule would be "don't use machine IDs for JIP"
Help please. Error in {_x in _FirstAidKit} Where is the right way?
_firstaidkit = getNumber (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "type") == 401;
_amountofFirstAidKit = {_x in _FirstAidKit} count (items loh);
_firstaidkit = {getNumber (configFile >> "CfgWeapons" >> _this >> "ItemInfo" >> "type") == 401};
_amountofFirstAidKit = {_x call _FirstAidKit} count (items loh);
```Did you mean this?
@meager granite yeah, it works. Thanks
Is there a proper way to have units say words from radio protocol? Say I want ScreamingE sound.
Figured it out:
private _cfg_voice = configFile >> "CfgVoice" >> speaker player;
private _protocol = getText(_cfg_voice >> "protocol");
private _dir = getArray(_cfg_voice >> "directories") select 0;
private _file = selectRandom getArray(configFile >> _protocol >> "Words" >> "Combat" >> "ScreamingE");
playSound3D [format ["%1%2", _dir, _file], player];
```will do random scream
Wrap that with onEachFrame for Serious Sam kamikaze scream 
HAAAAAAAAAAAA—💣 =(°□°)=💣
SQF is also damaged language.
But LUA would be same if not a downgrade in my opinion :)
I'm going to start uppercaseing it to annoy people
lil help. can't seem to find the right syntax to remoteExec a titleText with format. paticular case since its in a for _i loop and the magic variable is what feels the %1.
RPR_uploadCount = {for "_i" from 0 to 100 step 10 do {
[format ["UPLOADING DATA %1 PERCENT", _i], "PLAIN DOWN"] remoteExec ["titleText", 0, true]; sleep 15;} };
[] spawn RPR_uploadCount;
thats one of the many tries.
can't do { titletext stuf here} remoteExec ["call"] cos then _i gets isolated.
["something", "Plain down"] → [["something", "Plain down"]]
ohh. "double tap". thanks!
It's kinda weird because the engine knows that you're remoteExecing a unary command, but you still have to double-wrap the thing for some goddamn reason.
dude, i still have to gack and read what unari is. be gentle haha.
binary, two parameters, unary, one parameter :P
it does not work tho. adding the format part makes me dizzy.
the JIP there is pretty busted. Well, I don't think JIP is valid there at all?
anyone know what im doing wrong (using intercept db)
every inteceptdb command says im missing a semi-colon
[[format ["UPLOADING DATA %1 PERCENT", _i], "PLAIN DOWN"]] remoteExec ["titleText", 0, true];
thats the one
why oh why didnt i take the blue pill
shouldn't stop it working for non-JIP though.
It says the command does not exist
that's what i figured but idk why that would be, is intercept out of date or something?
We don't know what is your intention
I'm just trying to use this intercept-database https://github.com/intercept/intercept-database
It is not a command but extension
I used this in exactly the same manner 2ish years ago in accordance with the docs here https://intercept-database.readthedocs.io/en/latest/api/connection.html#dbcreateconnection-configname
Your intercept is outdated
Intercept can add commands
Ah hmm
well i took the latest intercept-db release and i dont wanna build intercept from source so i guess im stuck for a while lol
Try the steam workshop release of intercept
Also which branch of the game are you using?
should just be the main production branch i'm not on dev or anything
Then this should work
nah doesn't work, maybe its just not updated for latest update
since the date is Jul 22nd
Did you delete the ones from the db?
i overwrote them with the ones from the workshop
the releases are same date, it looks like the git repo has had commits since then but idk
i was looking into Pythia so I might just make my own thing with that, so I can use postgres as well
Yeah looks like it is up to date
All I can say is it does work on 2.14
ohhhh wait a sec
Which is the current stable
do you still need to disable battleye for intercept?
Yes
Is there a way to have multiple objects detect when a player is nearby? I have this so far
_unitInArea = nearestObjects [Tower1, ["Man"], 30];
_allUnits = allPlayers - entities "HeadlessClient_F";
_notInArea = _allUnits - _unitInArea;``` But if I wanted to add tower2 or more, could I expand this to search all areas without having to run more loops (which would obviously be crap for performance). I'm not sure on how to go about this one, or if I should rewrite it in a different way.
Also I realise I should use nearObjects instead, because it doesn't need to be based on distance 
if i wanted a condition that is essentially (_variable <= 50%) what would the syntax need to be?
I want it to trigger at 50% of the total number, but my brain isnt working rn and i know what i have there will not work < ->
i know sqf can do percentages, is it like
_variable <%= 50 or something?
Couldn't you do a percentage as a decimal? _variable < 0.5 ?
For reference https://forums.bohemia.net/forums/topic/193099-counting-units-percentage/
Not sure what you're using it for, but this is what I found 
it complains about missing semicolon, because it thinks the script command doesn't exist.
so intercept database wasn't loaded for some reason
Intercept iteslf no shouldn't. Intercept database yes. But not on dedicated server, where you would usually run it
perhaps?
but since it recognizes decimals as values wouldnt it just be like
"okay boss ill wait till it gets to 0.5"
?
oh i could do the entirety of the math probably
so 0.5 * 1000 would be half of that but i want it to be able to work with any number given
A scuffed way of doing it might be just what you said, something like
variable = _input * 0.5;```
lmao
_variable <= 0.05 * _variable
only then for the second check it would get 10% of the new number and then change rather than from the overall total
It's currently 2am so I'm working on autopilot, sorry for the dumbassery
bro im cracked out of my mind rn i cant think about anything longer than a second for some reason so i feel ya, appreciate the help reguardless, helps me think about the problem
i feel like i know the solution i want but i cant think of it
its right there in a haze
Question:
best way in arma 3, taking a random position that may presently be intersecting solid structures (rocks, buildings, etc), move the position so that it is at the top of the structure.
EDIT:
Any way better than this?
if (count _surf > 0) then {
_pos_asl = ((_surf select 0) select 0);
};
Not really. You can fiddle around with different intersects functions and geometries, but the methods are all basically the same.
Even setPos does the same thing, which is why it's so slow.
@rancid lance It's just _var <= 0.5 * _total
on a side note from my previous question
taking the _selection from the HitPArt event handler, when calculating damage to parts in my own lil damage system here i can just do
if (_slection == "shield") then {nil damage};
if (_selection == "body") then {normal damage};
And so on?
ty ty is "_total" just the outcome of that equation within the condition, so i could use it again and it wont get the total of the total?
HandleDamage can overwrite the damage IIRC while HitPart doesn't
No, I'm just guessing what you mean because your description is scrambled.
Like give a concrete example.
aight one sec
if (_newHealth <= 0.5 * _newHealth && !_recharging) then {
_target setObjectTextureGlobal [0, "808_tangent\data\paa\enforcer_sent\10percent\metal_main_CO.paa"];// we apply the heavily damaged texture
};
Yeah that doesn't make any sense. _newHealth is always going to equal _newHealth.
You need to be comparing one value with a different value.
isnt the condition saying that if _newhealth equals the sum of 0.5 * _newhealth (its a variable that fluctuates, not static )
new health's # comes from this equation
private _newHealth = [_currentHealth - _ProjSpeed, 0, 1000] call BIS_fnc_clamp;
blinks
proj speed is also a custom variable that has nothing to do with projectile speed lmao
Ok I think you have issues to sort out before we get to SQF.
no, i dont think we do
anyway, thanks for what help you've given. have a nice night.
_newHealth <= 0.5 * _currentHealth might make sense? hard to tell.
perhapse, i am updating the overall "health" variable every time it gets hit to reflect current health
Feels more like it should just be _newHealth < 500, if the starting health is 1000.
well yea thats what im using as a stand in
but i intend for this function to be usable on other things
so i can just put this setVariable ["health",whatevervalue,true];
If the maximum health of these things is variable then you'd need to store that somewhere and reference it.
i can easily just go outside the if-then and make a new variable and have that one hold the maths = w=then just say (_newHealth <= _50percent)
since i want it to remain pulling from the static total health
like i said, im a little braindead rn, im writing the code and its working as i want it to but i have a vague memory/hazy idea of doing this another way and making it more universal, but ill save all that for another update later down the line
wanted to see if anyone knew what i was on about, and from what i gather it is a thing- i just havent been thinking about it in the right direction.
ty fo tha help

I'd like to see C#, static typing wooo
If health is your dynamic variable then you want it to be _newHealth <= (0.5 * health) since that is what you are changing and also comparing against
I think you are consfusing _newHealth with health but only in that one spot of your code
_newHealth updates "health" so that number doesnt remain static
but also thanks for showing me that i'd have to put the math in "()" i didnt htink about that
wait do i?
No.
oah oke
idk im not worried about it, ill come back to it when my brain is actually working ; w; idk what wrong with me rn but i cant really think too hard on something or else it all gets foggy so i just finished what i originally settled in to do instead.
imma go eat
maybe get some rest
ty ty
here is a clip of it working as intended
whole reason im doin this is because the lad has two seperate parts that i need to track the health of seperately
so im making it to where hitting his body doesnt do much, however hitting his red spots does extra
then his largest red spots are protected by teh shield
which is part of the model
so it will have its own health value off to the side
which i already have worked out from my other mod
all i need to do is combine it into one function
did you hit the shield?
yes: damage shield, not bod
no: did you hit a weakpoint? yes: deal 1.5x damage/ no: deal basic damage, do not damage shield
ill be sure to come back if i need anymore help but i believe it will be pretty straight forward 
Get away with python!
If you have more towers, run search around players. If you have more players, run the search around towers
Also use inAreaArray instead
Just plain c++ with a vm and youre fine
If they are specific objects could they do like
_tower = "class_name_object"
player distance _tower <10
?
Asking for myself as well 
Or would it be more like
{Player distance _x <10} forEach (syntax I don't know that makes _x = the objects with the class name in question
yes, not in this context but I consider it a good practice
otherwise things like
systemchat "I like a good Ho" + "memade Dinner"
happen
it turns out i actually used something similar to what i just said as a condition on a trigger to add custom voicelines to bad actors, it looked like this
getPos player nearestObject "O_soldier_Melee_RUSH" distance player <10
and it worked freat, the extra variable i have there is a cooldown variable so that it doesnt repeat constantly
swap conditions around and make it lazy
so nearestObject check doesn't fire if your cooldown is active
Ye, hopefully that helps that fella, idk if they will need the cool down
Just didn't feel like erasing it for the screenshot
Cuz I'm lazy

Don't use getpos
Yea use like getPosATL or getPosASL
But for this case I don't think it's that important since we aren't moving something, just getting a general position.
I also just scrolled up to view the original question and idk if they even needed a condition in the first place lol
Here that is for anyone who can help them
Consider this a bump(link to original message so you don't have to scroll)
#arma3_scripting message
Deterministic finalization ftw!
It does matter in terms of performance tho
I see I see :0
negligibly
Something like:
_positions = [tower1, tower2,tower3] apply {[getPosATL _x, 30, 30, 0, false, 30]};
_players select { count (_x inAreaArray _positions) > 0 }
It's not always negligible
Its cost varies depending on roadway complexity
e.g. it's much slower on multi story buildings compared to in an empty field
I did not know that was the reason!
I would have assumed that it just narrows down it's calculation so it doesn't have to do as much.
(sorry, im in the wrong chat, this is for Reforger, will move)
a3 will probably get that enfusion scripting language or whatever it's called eventually
supposed to be closer to c++ and "300% faster" than SQF
Can someone suggest, how can i define is rifle with grenade launcher?
its in TOM so you can test it there
What’s the code I need to create a Zeus module? I have a 3den module and it’s function so how would i be able to convert that into a Zeus place able module
i heard the plan was to switch a3 to dayz's new engine if all goes well?
dayz atm runs 2 engines sooo not sure
i'll be happy sticking to sqf tbh...i don't want to have wasted time learning it
Check for extra muzzles, check if magazines are explosives indirectHit > 0
anything object oriented would be nice
scopeCurator = 2
Don't see BIS changing the scripting engine for Arma3. Its abit late for them todo that, it would prob break to much
You are better off hoping they finish Dayz SA,
i.e finish the work so its only running a single engine & adding in modding support.
legend
Regarding compileFinal for hashmaps would this code:
Test = compilefinal createhashmapfromarray [["A",1]];
Test_Holder = compilefinal createhashmapfromarray [["X",Test],["Y",Test]];
Test_Holder get "X" isEqualRef (Test_Holder get "Y"); // returns false
be considered expected normal? If I do not compileFinal Test_Holder, result is true. Which is what I expected would be for both circumstances.
Actually, that's just my test code. My use case is more:
Test = compilefinal createhashmapfromarray [["A",1]];
Test_Holder = compilefinal createhashmapfromarray [["X",Test]];
Test isEqualRef (Test_Holder get "X"); // returns false
@tender sable Disclaimer: I have never used compileFinal before and the documentation doesn't really explain what its effect on hashmaps is, so I'm basically just guessing here.
A = createHashMap;
B = createHashMapFromArray [["A", A]];
C = compileFinal B;
```Assuming that *final* means that you may neither modify `C` nor its contents, it makes sense for `compileFinal` to create a deep copy of `B` and `A`. Otherwise one could modify something that is contained in `C` by doing `A set [_k, _v]`.
If we assume that the deep copy implementation just deep copies everything (regardless of whether it is final or not), then we get the behaviour that you described.
Good insight. I didn't think of that because I was compileFinal'ing the first hashmap (which would prevent edits). So I assume to get the refs to match, compileFinal under the hood would need to check if it's an already compileFinal'd map and branch between keeping the ref or making a deep copy (if not final). e.g. Extra work
Ok, so I can work around this but I have more of a "What would make more sense" type situation. I am making a set of cF'd HashmapObjects that are basically type safe Enumerations. So think : Pets_Cat, Pets_Dog, Pets_Bird and a helper 'class' called Pets which can return a ref by name or value. Would it make more sense to cF the Pets helper class and require this code to return a ref : Pets call ["GetEnum","Dog"] / Pets call ["GetEnum",1] - OR- just leave the helper class as "Sealed" and "NoCopy" and make it easier on the dev to use Pets get "Dog" or Pets get 1 but someone could overwrite Pets variable or it's contents and destroy the helper? I'm leaning towards former but, maybe I am being 'too safe'?
Ultimately, I want isEqualRef to work. I know I could do latter and cF it and just rely on isEqualTo but... it's just part of me really wants the refs to be the same.
Maybe I'm over doing it by that requirement. Idk
https://community.bistudio.com/wiki/enableUAVConnectability says uav can be Object or Array, but when I pass allUnitsUAV(array), it is throwing error that it is expecting Object. Is that documentation typo ? or what kind of array it is expecting
same for disableUAVConnectability
can confirm I get same error ^ looks broken or wrong on biki
"Enables unit's AV terminal(s) connecting to UAV."
You pass it drones, ofcourse it's gonna give an error.
yes
fixed
There is kind of oop behavior nowadays in arma 3: (createHashMapObject)[https://community.bistudio.com/wiki/createHashMapObject]
isEqualRef will work for all hashMaps, just like it does for all arrays
Given you do not copy them, you are fine
Tho given your prior explaination, createHashMapObject probably solves your Y problem
Actully that's what I am using. A Hashmap and HashmapObject act the same with compileFinal though and the issue is the same in my code above whether HM or HMO. I'm making a HMO framework to extend createhashmapobject capabilities and provide a core library of sorts and running into these types of issues. I just used a quick hashmap to verify my actual code results and demo here.
If you explain your X problem, i might be able to help you
But i guess you do have the answers you asked already here by now
Oh it was simple it turns out. Trying to keep a ref to a compileFinal'd HM (or HMO) which is inside another compileFinal'd HM (or HMO) but compileFinal seems to deep copy everything. So I am using an alternative to keep ref in tact
You can see the issue/code a few posts above the one you replied to
When adding a event handler "KeyDown", to close a display, how would i define which key is to be pressed? I have the keycodes just a bit confused on how to if key down then cancel sort of thing
_this select 1 is
Thank you 👍
don't know if this is the right channel to ask but, how exactly do you put a headless client into your game?
i own a dedicated server and i'm assuming that's one of the benefits of buying one
There is https://ptb.discord.com/channels/105462288051380224/105465015364018176, they probably have a better idea of how to set one up
Arma 3 still has the Java code in it but its not initializing and the script commands to access it are disabled
ouh.... The main init function is not in anymore... That..... Makes hacking it back in kinda hard... ^^
Is there an easy way to check if there are any kind of trees, bushes rocks, or buildings near a position?
when was java working? during alpha?
i think a short period in alpha or even beta...
But i dont think they will change SQF i hope they dont... At least they have to keep SQF in and working... And why implement a second scripting system while they already have one that does its job
i agree but it's shit for beginners or people coming from other languages
nearestTerrainObjects
sqf design looks a bit like a friday afternoon project with the deadline on the same night
@tough abyss have you read the story of OFPs developement? ^^
With other words, SQF is shit for anyone
wait incoming call :P
Doesn't take on Mars support java? Why did they choose that approach?
Out of curiosity, It is better to do if statement or CASE, when dealing with detecting if the user has an object and then executing code
i love how ppl read maintenance announcements
switch - case is a bit slower than if - exitWith, but can produce more readable code
If you're not running your check 100 times a frame, do whatever is more conventient to you
Alright
EDIT: Sigh, never mind... was testing from the wrong position after all!
@mint goblet as far as i know there were complaints from the ArmA community about Java
in regards of "SQF is shit lang"
thats what projects like ASL or my personal project OOS are targeting on
providing you other tools to make your code look "better"
What would be the best way about going about adding a highlighted selection to an already existing progress bar dialog?
In my case, I've generated two random numbers for selections as the progress bar goes from 0 -> 1.00, with the minimum number being 0.10 and highest 0.90.
Then with those selections I've checked if the user has pressed space to exit out of the progress bar using ``inputAction "Action", and if they have exited in the given parameters then good otherwise fail.
But now I'm stuck on getting those to appear on the progress bar so you know when to hit space. If that makes sense
@queen cargo what complaints? That they didn't want it?
Yes I have seen your work, looks very nice
security BS and other stuff
but thats kinda #offtopic_arma
Java is utter shit anyway
@nocturne bluff the language it self is well defined, but the underlying and attached stuff is really ugly
Java is kinda nice
but the people programming it are not
((stuff like "hey, why dont we create 5 anonymous objects to archive async tasks where each object has to define its code whilst the code that is to be executed last has to come first" just fucks me off ...))
What's so shit with Java?
no lambdas for example
also java is strictly bound to OOP
thus if youre not safe in OOP then you are fucked with java and your output code will be garbage
and ... as no-fucking-body is 100% safe in OOP java programmers tend to just fuck around with objects
"lambdas" in java
{
bool getSuccess();
}
// ...
bool result = DoSomething();
Result objResult = new Result() {
bool getSuccess() { return result; }
}```
how can I open this terminal with a script? I tried searching for the bis_fnc but I havent found anything and the animation sources dont dont open it as well (but maybe Im doing something wrong, dunno). Im pretty certain its one of the new objects that were ported from argo.
https://i.imgur.com/ZQ9pvSt.png
https://i.imgur.com/GgO0ZBL.png
oh, and animationNames seems to return all the individual locks/latches and stuff but surely you wont have to animate each individual one right?
Well that is the function to do that
what would be _value then?
0 or 1, so 0 or 100
hmm, alright seems to work. However, Is there a way to make the animation gradual? With the fnc the transitions are instant
Make the last true false I guess
Sorry to bother, am I blind or there was no where information that the assinging an array to getVariable value will automatically change array value if setVariable is used?
NER_globalArray = [];
NER_globalArray = player getVariable["testVar1", [] ];
player setVariable ["testVar1",["test"] ];
NER_globalArray;
Result will be: ["test"]
I don't really recall if it does get the array data or getting that as a reference, but if it is, this likely to happen
I couldnt find information about that, if so, then we are screwed because all the mod authors probably also didn't know about it
holy... thanks a lot
missed that
btw another way for deep copy is array1 = [] + array2; EDIT: it’s not deep copy actually but shallow copy
the + operator is faster tho
When using CTPROGRESS are you able to add a separate section of colour aside from the original one? And that sections position will be decided by 2 random numbers?
add a separate section of colour aside from the original one
What do you mean?
And that sections position will be decided by 2 random numbers
I also am not sure about this
One second I will draw something and send it in now, my wording is terrible 🤣
Is there any reason to use CT_PROGRESS?
I don't think you can smoothly animate the progress like you can with ctrlSetPosition + ctrlCommit on any elements
Well, if you're not bothered about making it smooth (because of small increments or because it just doesn't matter) it's easier to set up than manually making your own progress bar
https://i.postimg.cc/yN9fQhWt/progress.png
@meager granite I am making it via controls, sorry, bad at explaining what I mean..
I have attached the progress bar that I want, so with the little section that is on there, I need that a different colour but I need to define it's position as it needs to be different everytime. Does that make sense?
Is this for one of those timing minigames where the cursor moves along the bar and you have to do the thing while it's in the zone?
Not sure what's your issue. Do you want to show your progress as a rectangle inside another rectangle?
I'm trying to do it for a skillcheck, so as the progress bar goes from 1% -> 100%, it fills up as it should, but then when it gets to that 'highlighted' section (grey bit), the user should press space and then that would pass the function and hint them 'check passed' or if they missed it, 'check failed'..
if this did create a deep copy, this code should return [[1, 2], [3]] rather than [[1, 2], [3, 4]]: sqf _x = [[1, 2], [3]]; _y = [] + _x; _y # 1 pushBack 4; _x only the outer-most array is copied but its elements still reference the same values (shallow copy), hence why the nested arrays of _x can be modified through _y # 1
So I think what I need to is add another class in my .hpp for the seperate rectangle, and write that into the script? @meager granite
Sorry I'm really terrible at dialogs
I still didn't get your idea exactly, how many % there are in your picture example?
But overall, just do two CT_STATICs inside each other
So the progress bar runs from 0% to 100%, but I need the rectangle to appear say inbetween 25% and 50% at a different colour
Well so far the only difference I see is 1 scripting command (progressSetPosition) vs 2 scripting commands (ctrlSetPosition + ctrlCommit)
I'd suggest to have two STATICs within one CONTROLSGROUP
thank you
To set up. CT_PROGRESS comes with all the elements properly positioned and grouped up in a single control. For someone who's not that into UI making, it's more intuitive and simpler to work with.
That's not deep copy
java is shit. its entire philosophy is complex verbosity for the same of being verbose
Hi, Im using a wingman script and wondered if its possible to automatically give an inverse value in the VectorDir but not UP in this: {
_x setPosASL ((getPosASLVisual Heli) vectorAdd [(_forEachIndex+1) * 20,(_forEachIndex+1) * 40,0]) ;
_x setVectorDirAndUp [vectorDir Heli,vectorUp Heli] ;
_x setVelocity velocity Heli ;
} forEach [BA2] ;
} ;}
You're trying to make the heli fly backwards?
the only benefit is cross platform, and even then its still crap because its ugly as sin, and if you are doing something without a gui then 99% of the time you could do it in c++ and have it be just as cross platform and not as shit
kind of, I want the other heli to do the opposite maneuver while retaining vector and height
and dont get me started on its use for the web
sorry that was wrong
holy crap
Im hoping it will fly the same but in a different direction but not change height
just wondering if there is a syntax to try in there
In that code, everything is defined relative to the first heli.
So you'd have to decide what you want it to do relative to the first heli.
can I ask for a negative value in there?
Inverted vector is just _vector vectorMultiply -1
hello
Does anyone know how to dynamically reference an object that an ace action is assigned to?
Current code:
actiondebugIntel1 = [
"CheckIntel1",
"Collect Intel",
"",
{
//While actioning
[1, [],
{
//Success
"Intel recovered - Intel updated" remoteExec ["hint", 0];
deleteVehicle this;
},
{
hint "Aborted";
},
//Action bar
"Grabbing..."] call ace_common_fnc_progressBar
},
{true},
{},
[],
[0,0,0], 100] call ace_interact_menu_fnc_createAction;
[testobject1_1, 0, ["ACE_MainActions"], actiondebugintel1] call ace_interact_menu_fnc_addActionToObject;
I want to be able to delete the object that action is attached to, with the action, without calling the object itself explicitly, so I can use the same action multiple times
But this code sets the position and velocity directly as well, so that's likely to be the difficult part.
params ["_object"]
oh yeah... it will.... so maybe the same -1 for postion?
Where do I pass this? In the params section when I create the object?
@inland valve You haven't even managed to express in language what you want the heli to do yet. That's the starting point.
{
//Success
params ["_object"];
"Intel recovered - Intel updated" remoteExec ["hint", 0];
deleteVehicle _object;
},
thanks mate
@granite sky just trying to understand it
Examples: Mirror in x=1000 plane. Rotate by 180 degrees.
yes!
what I don't understand is that you say you want a wingman script, yet why do you want to reverse the dir?
Im trying to see if I can get the second plane to fly perfectly in the opposite direction
I thought he had a wingman script and he wanted to do some blue angels shit :P
then you just want to reverse the dir and velocity, pos is irrelevant
I do! @granite sky ..@little raptor If I use them both I can do some amazing blue Angels stuff
type array expected object
what does systemChat str _this return?
Just setting velocity works for one airplane simulation but not the other. I forget which way around.
One to fly in formation, the other to fly a symetrical flight path
With the other one it just hangs in the air.
I think airplanex was fine, airplane wasn't.
Thing is, there are a lot of different forms of "symmetrical". You have to define it.
[[],1.01465,1,0]
makes no sense. ACE docs says this:
The simplest action is just a condition and statement. The code to these are passed [_target, _player, _actionParams]. _player is ace_player; _target is the object being interacted with; and the 3rd argument is the optional action parameters (default []).
ah nvm you're running that in the progress bar code
If the wingman gets velocity and height from "Heli" but gets (x)-1 and dir-1?
@agile flower
actiondebugIntel1 = [
"CheckIntel1",
"Collect Intel",
"",
{
params ["_obj"];
//While actioning
[1, _obj,
{
//Success
_this#0 params ["_obj"];
"Intel recovered - Intel updated" remoteExec ["hint", 0];
deleteVehicle _obj;
},
{
hint "Aborted";
},
//Action bar
"Grabbing..."] call ace_common_fnc_progressBar
},
{true},
{},
[],
[0,0,0], 100] call ace_interact_menu_fnc_createAction;
[testobject1_1, 0, ["ACE_MainActions"], actiondebugintel1] call ace_interact_menu_fnc_addActionToObject;
or x-1 will just become dir-1...
actiondebugIntel1 = [
"CheckIntel1",
"Collect Intel",
"",
{
params ["_obj"];
systemChat str _obj;
//While actioning
[1, [_obj],
{
//Success
params ["_obj"];
"Intel recovered - Intel updated" remoteExec ["hint", 0];
deleteVehicle _obj;
},
{
hint "Aborted";
},
//Action bar
"Grabbing..."] call ace_common_fnc_progressBar
},
{true},
{},
[],
[0,0,0], 100] call ace_interact_menu_fnc_createAction;
[testobject1_1, 0, ["ACE_MainActions"], actiondebugintel1] call ace_interact_menu_fnc_addActionToObject; ```
type array expected object
systemchat is variablename testobject1_1
@little raptor
change [_obj] to just _obj then
@ Misconduct, John Jordan:
you might find these useful - https://community.bistudio.com/wiki/BIS_fnc_transformVectorDirAndUp
https://community.bistudio.com/wiki/BIS_fnc_rotateVector3D
https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_progressBar.sqf#L6
* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
{
//Success
_this#0 params ["_obj"];
"Intel recovered - Intel updated" remoteExec ["hint", 0];
deleteVehicle _obj;
}``` 
@grizzled cliff JBoss, Tomcat Servlets etc etc? Yeah, its bad...
Despite the Horrors of .WAR they had the containerization bit right.
_mirrorVehicle = {
private ["_originalPos", "_offset", "_newPos", "_newVectors"];
_originalPos = getPosASLVisual BA2;
_offset = (_this select 0) * 20;
if (_offset != 0) then {
if (abs(direction BA2 % 180) < 0.001) then {
_newPos = [
_originalPos select 0 + _offset,
_originalPos select 1,
_originalPos select 2
];
_newVectors = [
[vectorDir BA2, vectorUp BA2],
getDir BA2,
_offset,
0
] call BIS_fnc_transformVectorDirAndUp;
} else {
_newPos = [
_originalPos select 0 - _offset * sin (rad direction BA2),
_originalPos select 1 - _offset * cos (rad direction BA2),
_originalPos select 2
];
_newVectors = [
[vectorDir BA2, vectorUp BA2],
getDir BA2,
_offset * -1,
0
] call BIS_fnc_transformVectorDirAndUp;
};
vehicle player setPosASL _newPos;
vehicle player setVectorDirAndUp (_newVectors select 0);
vehicle player setVelocity vectorVelocity BA2;
};
};
missing ; ?
@granite sky
this is the new attempt
sry format
I am trying to achieve, that I spawn a plane, going from A to B over position of an object, but vehicle do not fly directly above object when distance from A to B is 2000m. When I shorten the A - B distance (500m), it does get pretty close to fly over object position, but it breaks immersion as players can see plane spawn/despawn.
private _pos = getPos _object;
private _dir = random 360;
private _range = 800;
private _alt = 100;
private _start = _pos getPos [_range, _dir];
private _end = _pos getPos [_range, _dir + 180];
[_start, _end, _alt, "LIMITED", "B_T_VTOL_01_vehicle_F"] call BIS_fnc_ambientFlyby;
Where's the object relative to A and B?
oh, A and B are start and end.
Code looks fine. Maybe that function is busted.
Can you make a certain section of a progress bar a different colour than the rest?
I've already gave you the possible solution
By two statics with one controlsgroup do you mean two static classes in class controlsBackground?
No
- CGrp
- Static with color A
- Static with color B
And adjust CGrp and call it a progress bar
{
idc = 350;
colorFrame[] = {0.72,0.72,0.72,1};
colorBar[] = {0.641,0.25,0.109,1};
text = "#(argb,8,8,3)color(1,1,1,1)";
x = 0.295781 * safezoneW + safezoneX;
y = 0.758445 * safezoneH + safezoneY;
w = 0.403542 * safezoneW;
h = 0.0413333 * safezoneH;
class Progress_Colour
{
};
class Progress_Colour2
{
}```
Like this @warm hedge ? Sorry, I'm really new at dialogs
You need to have class controls to define control within control
I have class controlsbackground at the top of my dialog, or does it have to be controls?
https://community.bistudio.com/wiki/CT_CONTROLS_GROUP#Other_examples
This is one example
Finally got that done 🙂 Just one quick thing, the new rectangle i added in there is covering the text, am i able to bring the text to the front somehow?
No, there is no Z-sorting command for GUI
Ah okay, I didn't think about this until now but what would be the best way to check if progress bar is inside the designated section?
I got the positions for them both but that's a very specific margin..
For what purpose?
It's just a skill check, so if is inside = true (pass), if not false (fail)
Well, you can check the X pos and W size, calculate X + W * progress
Using ctrlPosition to get those axis', that's okay?
Ye
And, of course, having (pos > desiredPosStart and pos < desiredPosEnd) or such can detect if it is within the range
Hmm im having issues getting the position of the progress bar, i think its just getting the value of the frame, not the moving bar? I can get which percent it is on though?
0 - 1 which means 0 to 100%
Yes, but how would the script know if the percent is in the rectangle? As I'd be checking against different things?
No result will not be, it shouldn't be.
You are replacing the variable on player with a new one. You are not modifying NER_globalArray.
You are doing something wrong in your testing
Like if you would run your test script twice, you would get ["test"] as output. But if you run it once you wouldn't
If you really do get that on one run, then thats a serious bug. But I'm very sure you're testing wrong
I'm using ctrlcreates for a progress bar in a script, and I've added a percentage counter, how could I convert say, 0.2 is 100% and 0 is 0%?
_actionTime is a param
_percentage ctrlSetStructuredText parseText format ["<t size='1.8' font='RobotoCondensed' align='center' color='#B8B8B8'>%2%1</t>","%",_i];
hint format ["%1", _i * _actionTime];
sleep 1;
};```
linearConversion
or just _value * 500 for the specific use-case of converting 0...0.2 to 0...100 
is disabledAI = 1; in description.ext only meant to prevent AI taking over player units on disconnect?
say i've got 20 playable blufor units and only 2 blufor players - how can I prevent 18 blufor AI?
By doing it manually
righto, thanks!
Quick question to create particleSource in MP i use createVehicle inseat od CreatevehicleLocal ?
particleSource cannot be global
how would i create particle for everybody on server then ?
remoteExec
Like this would work ?
LEG_MyParticles = {
params ["_pos"];
private _posATL = getPosATL _pos;
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 2.5], 0, 10, 7.9, 0.066, [2, 6, 12],
[[0.2, 0.2, 0.2, 0], [0.2, 0.2, 0.2, 0.3], [0.2, 0.2, 0.2, 0.3], [0.35, 0.35, 0.35, 0.2], [0.5, 0.5, 0.5, 0]],
[0.25], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps1 setDropInterval 0.2;
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 16, 0], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 2.5], 0, 10, 7.9, 0.066, [2, 6, 12],
[[0.33, 0.33, 0.33, 0], [0.33, 0.33, 0.33, 0.8], [0.33, 0.33, 0.33, 0.8], [0.66, 0.66, 0.66, 0.4], [1, 1, 1, 0]],
[0.25], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps2 setDropInterval 0.2;
};
[getpos player] remoteExec ["LEG_MyParticles",[0,-2] select isDedicated,false];
Essentially, but make sure LEG_MyParticles exists on other clients - either by defining it in a script that runs everywhere, by publicVariable it, or by defining it with CfgFunctions
Also your argument is wrong, you're passing the return from getPos player as the argument and then doing getPosATL on it in the function. You can't do that, getPosATL only works on objects. Either pass getPosATL player to begin with, or pass player and let the function do getPosATL on that.
Is there any reason to set waypoint position's z-coord properly for 'addWaypoint' command? In other words - does waypoint height matters?
Yes
(think foot soldiers vs helicopters)
Ok, thanks
Does anyone know if there is a way to block chat on a server with sqf temporary and then be able to re enable it later? I can't seem to find anything online about it.
you can grab the displayCtrl and move it out of sight i think
Any idea what the IDC is? Or even how I can find it myself?
no idea right now... ill look maybe ill find something :X
Okay thanks.
RscDisplayChat idd = 24;
x = "(profilenamespace getvariable ["IGUI_GRID_CHAT_X", (safezoneX + 1 * ( ((safezoneW / safezoneH) min 1.2) / 40))])";
ChatBackground idc = 1083;
try out that profilenamespace thing.. i think that may work easiest
Thanks! I'll see what I can do.
Would anyone happened to have faced something similar to this?
I'm having issues with a mission that we've been working on for a long time now in the export aspect.
Whenever we export there is basically a 50% chance of just randomly failing on us with no apparent reason, specially when the mission is binarized, for example:
-
Rpt would whine about mission files or errors in lines that doesn't report when actively testing them while in editor
-
Re-exporting multiple times could yield the same result until it doesn't, without changing absolutely anything in the file itself.
-
Preprocessing randomly breaks between exports, even if in editor the files are found.
-
Re-exporting multiple times could yield the same result until it doesn't, files are found by engine magically.
-
Exporting would give us no issue sometimes and could be played on lan hosted and net hosted, but suddenly on dedis everything breaks as mentioned above?
-
Changing person that exports seems to fix all issues mentioned above, both with binarization active and inactive.
Could this be an issue with some sort of game corruption or should I look harder into code?
Asking here, since the most persistent issues seem to be randomly broken sqfs that works well when they want to.
Edit:
Similar to this issue?
https://forums.bohemia.net/forums/topic/223353-arma-multiplayer-issue/
that would be #arma3_editor or #arma3_scenario
is the sqm… just too big?
Is there a limit in how big it can go?
we are at 6mb right now, just the sqm
not really, but I would assume a performance/memory/timeout issue at one point - which may explain why it works on another's machine
I would never had imagined that could be a possibility, the total file size is 17.5mb if unbinarized, from that its 6mb on the sqm
does anyone know if its possible to adjust armor values of vest using a fnc
Short answer is no. You have to use config.
ok
Long answer is still no, but you can sort of fake it using a HandleDamage event handler. It's complicated though and still doesn't work exactly the same way.
im working on making a armor plate mod using ace and thats what im wondering is do i need to use handle damage if i want to buff the base armorvalue or could i have the config call for the fnc and use an if statement to change the armor value
ACE adds extra complications because it obviously has its own handleDamage. You have to wait for it to install that, remove & replace with your own and then chain call the ACE one with your modified inputs.
The mod ACE Armor Adjuster does that.
Also the ACE function to reverse the Arma damage calc was slightly wrong, last time I checked.
(uniform armour actually multiplies base armour, ACE thinks it's additive)
Probably good to reference this mod https://github.com/diwako/armor_plates_system
uniform armour was disabled or something like that in hotfix
may just be the passthrough values disabled
Issue is that it starts by reversing the original damage calc, but gets that wrong.
For most uniforms it's only slightly wrong. because it's 2x1 vs 2+1. The CSAT uniforms are special though.
Quick question how would i spawn objects in grid like fassion. With custom spacing and custom number of objects in grid ?
for loops
If it's an arbitrary number of objects and arbitrary grid width then I'd go with single loop and %
It's just logic though. Nothing much SQF-specific.
I got it guys thanks. Its a bit randomised but i need it like this 😄
private _pos1 = getPos player;
private _num = 31;
for "_i" from 0 to _num do {
private _number = random 64;
private _xPos = _number mod 8;
private _yPos = _number / 8;
private _pos = _pos1 vectorAdd [_xPos,_yPos,0];
private _creater = createVehicle ["CUP_p_Helianthus_summer",_pos,[],0,"None"];
_creater enableSimulation false;
};
That's not a grid, it's just a square :P
inb4 CUP Hilux Plaza
potato potato... 😉
(grid would have integer rounding)
integers do not exist in ARMA, but I read you...
Hi guys quick question about nearestTerrainObjects:
So i want to remove terrain objects with a certain type of class name:
Now when I execute this Code i get this:
//code:
nearestTerrainObjects [player, [], 10, false];
//result:
[232095: ,214769: krovi2.p3d,214767: powlines_transformer_f.p3d]
Now i get the model of a a object i want to remove and that is this Model:
powlines_transformer_f.p3d and the class name is: Land_PowLines_Transformer_F
But when i want to remove objects with this code it dosen't work:
private _allPowerLines = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["Land_PowLines_Transformer_F"], worldSize, false];
{ _x hideObjectGlobal true } forEach _allPowerLines;
And nearestTerrainObjects return empty
Also
Land_PowLines_Transformer_F is in Hide layer on map.
So what would be a way to remove all these objects from a map when i try to remove it with class name it dosent work ?
nearestTerrainObjects doesn't take classnames as input.
you'd have to find its map property and then filter by classname, I guess.
Oh ok i found the map property then but how would i filter it. Map property is HIDE.
There are only 2224 POWER LINES on Altis :P
ah yes, HIDE, the obscure category that has fences, clothing lines and power lines
ah shit
_array select { _x isKindOf "Land_PowLines_Transformer_F" }, but if it's in HIDE that's going to be monstrously slow.
Its only gonna run once and at the start so is it that big of a performace imact ?
Feel free to measure it, but that sort of operation is painful in SQF.
it depends on the map, as jhon mentioned there is 2.2k power lines in altis, Redux for example has 14k or so
This code is still returning empy array:
private _HideObJ = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["HIDE"], worldSize, false];
private _testArray = _HideObJ select {_x isKindOf "Land_PowLines_Transformer_F"};
copyToClipboard str _testArray;
Then you either have the classname or the map property wrong.
or it's not a terrain object, but rather just an object...
Code:
nearestTerrainObjects [player, ["HIDE"], 10, false];
//result:
[214754: r2_boulder1.p3d,224666: powlines_wood1.p3d]
Class name:
https://imgur.com/zUnyrgY
nearestTerrainObjects [player, ["HIDE"], 10, false] apply { typeof _x }
This is result:
["",""]
Whatever that is, it doesn't have a class.
A lot of terrain objects don't. They're just models.
So how would i remove models from the map ?