#arma3_scripting
1 messages ยท Page 282 of 1
ah no clue about that
try the shadow property I guess
shadow float optional shadow style: 0 = none (default), 1 = drop shadow, 2 = outline
is this The Daily WTF material or is there a question associated with it? ๐
@hasty violet Wouldn't a switch be better?
switch(true)do
{
case (alive UnitCIV_W1) : {UnitCIV_W1 say3D "Chanttwo";};
case (alive UnitCIV_W2) : {UnitCIV_W2 say3D "Chanttwo";};
case (alive UnitCIV_W3) : {UnitCIV_W3 say3D "Chanttwo";};
case (alive UnitCIV_W4) : {UnitCIV_W4 say3D "Chanttwo";};
case (alive UnitCIV_W5) : {UnitCIV_W5 say3D "Chanttwo";};
case (alive UnitCIV_W6) : {UnitCIV_W6 say3D "Chanttwo";};
case (alive UnitCIV_W7) : {UnitCIV_W7 say3D "Chanttwo";};
case (alive UnitCIV_W8) : {UnitCIV_W8 say3D "Chanttwo";};
};```
done in < 60s
๐
But looks like ๐ฉ
๐
+runtime difference of, erm.. 0.00Xms?
Isn't this way less ugly
#define ALL_UNITS [UnitCIV_W1, UnitCIV_W2, UnitCIV_W3, UnitCIV_W4, UnitCIV_W5, UnitCIV_W6, UnitCIV_W7, UnitCIV_W8]
{
if (alive _x) exitWith {
_x say3D "Chanttwo";
};
} forEach ALL_UNITS;
?
meh
+why define it? A simple
_ALL_UNITS = [UnitCIV_W1, UnitCIV_W2, UnitCIV_W3, UnitCIV_W4, UnitCIV_W5, UnitCIV_W6, UnitCIV_W7, UnitCIV_W8];
would do the same (or even put the Array directly after "forEach", when its not beeing used somewhere else )
some people need their macro fix ๐ /jk
^^
Anyone got an idea why my script is bypassing an exitWith statement (x2)... It gives me the debug message but doesn't exit....
{
if (count (_x select 0) > (_x select 1)) exitWith { ["Error", "A field entered is too long", true] spawn H_fnc_Notifications; };
} forEach _fields3;
@little eagle I tried both a config entry and through ctrlSetFont and both have the exact same result
When commenting out the config line that chnages the font it works fine
just a little heads up that this also happens on Esc menu, everything else is fine (Both vanilla and custom UI elements)
_startMins and _startHours are defined in higher scope than setDate is
You can private them before condition
Or you can rewrite your condition so that declaration would be in same scope as setDate
_startMins = (if (!isNil "param_time") then {
switch (param_time) do
{
case 0: { 38 };
case 1: { 28 };
case 2: { 18 };
};
} else { 28 });
you might end up with nil _startMins if param_time is not 0 1 2 though, might want to add default into the switch just in case
If I just establish them outside of the if-then-switch-do entirely (essentially replacing the default conditions) would that fix it?
Yes it would work too
Basically if there was no private variable defined in earlier scope, it will be defined wherever you first assign it
Or just do it like that:
_startMins = 28;
if (!isNil "param_time") then {
_startMins = switch (param_time) do
{
case 0: { 38 };
case 1: { 28 };
case 2: { 18 };
};
};
...
...
setDate [2018, 11, 12, _startHours, _startMins];```
@hasty violet
^^
- you also don't need that "else"
_startMins = (switch(currentNamespace getVariable ["param_time", -1]) do {
case 0: { 38 };
case 1: { 28 };
case 2: { 18 };
default { 28 };
});
Yeah, i will call you a wizard if you could change a Var with that GETVariable ๐
38-((currentNamespace getVariable ["param_time", 1])*10)
? ๐
๐ซ ๐บ ๐ฆ
Is there a solution for setName in multiplayer?
currentNamespace getVariable
???
wtf guys
Hey maybe it's part of a super complicated system that dynamically cycles through parsing, profile, ui and mission namespaces with the same variable names ๐
I'd say use param instead, but that errors out in scheduled environment, which some people use.
param errors out in scheduled?
in scheduled Nil is undefined. Undefined -> error
Scheduled
undefinedVariable param [0,1] -> error undefined
unschedules
undefinedVariable param [0,1] -> 1
but is it the fault of param or is it the fault of whoever wrote the call / spawn? I mean it's supposed to have some stuff passed in to it
I've implemented a second HUD to my game. The first one shows the health of the player at the bottom of the screen. The second HUD displays the cash. They both automatically update once the values of each change. Both of the functions work however when I add the cash HUD to the bottom right of my screen the health bar dissapears. If I comment the cash HUD back out of the game then the health bar shows again, any ideas what I could be doing wrong?
Post the code you use to initialise them both
core\init,sqf
[] call life_fnc_hudCashSetup;```
As in the very line that makes them appear
fn_hudSetup.sqf
cutRsc ["playerHUD", "PLAIN", 2, false];
fn_hudCashSetup.sqf
cutRsc ["playerCashHUD", "PLAIN", 2, false];
That displays the resource defined in RscTitles in Description.ext. They are both the .hpp files which create the display
Description.ext
#include "dialog\progress.hpp"
#include "dialog\hud_nameTags.hpp"
#include "dialog\hud_stats.hpp"
#include "dialog\hud_moneyStats.hpp"
};```
Interesting right? They both work yet cann't have both displaying at the same time
๐ ๐ซ
@halcyon crypt Its the fault of the Engine.. Inside scheduled Nil is error inside unscheduled Nil is not error. Param is fine
Is it possible to create and setup properties/sync'd objects of an editor module at runtime?
@tacit pebble Try using the alternative syntax to cutRsc
"playerCashHUD" cutRsc ["playerCashHUD", "PLAIN", 2, false];```
So you're on different layers, not the same
That makes sense! Hope is restored! I will try that brother fingers crossed
@dusk sage love you
๐
Is there a version of cursorTarget that returns a position array? I'm trying to use an addAction to create an object exactly where the player is looking (to place a flag on a cleared mine). I've tried screenToWorld but that just seems to place it at a random point on the screen regardless of what values i place in the array (screenToWorld [0.5,0.5], screenToWorld [0,0] etc)
getPosASL cursorTarget
???
think he wants his mouse position
I think he wants a lineIntersectSurface from 0.5,05 in view direction
getPosASL cursorTarget doesn't throw an error (which is an improvement), but it's not creating the object either.
I'll try lineIntersectSurface
#define MAX_DISTANCE 1000
private _unit = player;
private _intersects = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0, 0, 0],
AGLToASL positionCameraToWorld [0, 0, MAX_DISTANCE],
_unit, objNull,
true, 1
];
_intersects param [0, [[0,0,0]]] select 0
???
I just want express how awesome param is.
Should report the position of the first collision with a FIRE or GEO LOD or the terrain one km max in view direction from the cameras origin.
Could replace _unit/player with cameraOn, so it works with Zeus. Also might collide with the vehicle you're sitting in otherwise
Thanks for the responses all. @little eagle I'll try to take that apart with diag_logs so I understand what it's actually doing/how to use the output in a createvehicle
The last expression just reports a position. That position can be used with createVehicle
You could put that whole thing in a function if you want to use it elsewhere.
@little eagle
again:
Why?
#define MAX_DISTANCE 1000
Do you have any particular reason to do that or just habbit?
Magic numbers. They told me to put them in macros in headers or at the top of the file, so I do that.
It's common in C / C like languages
Hm, okayyyy
I'm trying out the following to automagically assign AI units to the headless client if it exists, any suggestions/improvements?
waitUntil {not (isNil "HeadlessClient");};
private _HC = owner "HeadlessClient";
["HC_addAllAI", "onEachFrame", {
if (isPlayer || (_x in units group _HC)) exitWith {};
if (isNull _HC) exitWith {};
{
_x setGroupOwner _HC;
} forEach allUnits;
}] call BIS_fnc_addStackedEventHandler;
going to end up staggering it a bit so its not each frame but not sure what else to improve
_HC is a local variable. That will not exist inside the EventHandler
Check isNull _HC before in units group _HC for performance reasons.
also in _x in units group _HC _x is undefined
also isPlayer needs an argument
In short.. 90% of your code is an error/wrong
Pass _HC as variable and check _this in the scope of the event handler
yeah woops, thats what I get for copying from the forum
good spots, cleaning it up
Also, this OEF handler is strange. it never stops
Like, it does literally setGroupOwner every frame
wtf
A little aggressive to say the least
And pointless too
Sorry me again, I've been playing around with just createVehicle at the players position. Running this:
'FlagSmall_F' createVehicle (getPosATL player);
sleep 0.05;
};```
results in the objects getting placed in a radius around the player rather than at the player position itself? Is it collision avoidance?
https://www.youtube.com/watch?v=-j6zGz7NOEY
https://community.bistudio.com/wiki/createVehicle
Desired placement position. If the exact position is occupied, nearest empty position is used.
doh, missed that
createVehicle will almost never create the Vehicle at the location you tell it to. Always use setPos... or.. that
It's on the wiki
Also avoid [0,0,0] as initial spawn location.
1.) Other stuff may already happen there
2.) According to Suma its a crazy land and full of weird engine stuff already happens there, so avoid.
all the fun happens on null island
what does ATL stand for? As in getPosATL
Aah ok thanks
Short Q: I am creating a guard point with CreateGuardedPoint per script - what is the right way to delete it? Deletevehicle like with triggers?
Hey guys having abit of a problem. I'm trying to have a script run that will remove all gear, uniforms, weapons, ect from a player at spawn. In the initPlayerLocal.sqf I have null = [this] execVM "emptyloadout.sqf"; In the emptyloadout.sqf itself I have "waitUntil {!isNull player};
_unit = _this select 0;
removeAllWeapons this;
removeallassigneditems this;
removeuniform this;
removevest this;
removebackpack this;
if(true) exitWith{};
any ideas?
initPlayerLocal passes the player object in _this
params ["_unit", "_isJIP"];
then just pass _unit instead of this to your loadout script
@quicksilver how else do I create a "guarded by" trigger?
Is it ok to use perFramehandeler instead of while?
I think while is faster
thanks guys I'll give that a try
Thanks again, looks like it is working. Doing it this way I shouldn't have any JIP issues correct?
Hi bois and girls. Im further developing on David's HUD script from altisliferpg.com. I had made it different form his but he is still the owner of the structure. I had implentent FPS in the system. The thing here I want to ask you guys is that the fps thing take the first fps value from the game when its gets called. Everytime the HUD update. The hole HUD update. How do i make a function that update my fps, health, thrist, hunger, cash, bank and players without the hole HUD need to blink when updating? Do you guys have a toturial I can learn or some exsamples ๐ I do not what it hand over. You can see the code her. http://pastebin.com/gv8gYzm7
anyone know whats up with units randomly losing their loadout after they are assigned to a headless client?
no clue, but I've seen it several times myself
is the HC running the correct mods?
you can use per frame handlers all day as long as you make sure you don't do it in a bad way. remember you are putting stuff into each frame. it's very powerful but also has bigger consequences, if your code is slow. also make sure you have a way to suspend things, as in, use time stamps to actually not do stuff EVERY frame unless you really need/want it to.
check this out. haven't used it myself but it might make use of perframe stuff: https://community.bistudio.com/wiki/BIS_fnc_loop
@blissful fractal Control the element from another function?
Also that file man
Jesus
exsample that is what I thought too. But how to make it that is the think I do not know
yup xD
Thanks Badbenson I will take a look ๐
Get the display -> displayCtrl, ctrlSetStructuredText (on the control). The file does all this already, but for every control
Just abstract that logic to just one
I don't think he was replying to you
oh ๐
Hey, how would one set a picture using CT_ACTIVETEXT? I do ```SQF
picture="textures\radio.paa";
but that doesn't work
picture[] = {"textures\radio.paa"};
``` doesn't work either
hmmm
Well my coding experience is not create when we come to .hpp files ๐ But what about
text = "textures\DanskLifeStudioIcon.paa";
That is what I use for logo ๐
That's for RscText, not CT_ACTIVETEXT
@indigo snow Yeah, HC is running a copy of the server's mods
Oh well now Ik that ๐
Hi guys, is there a way for a progress bar to go vertical instead of horizontal?
Anyone got an idea about how to set a picture to CT_Activetext?
Is there a way to get the DISPLAY NAME of a certain vehicle / unit? I'm not talking about the variable name, but display name as in like, the name you would see when placing down a vehicle, like "Hunter (HMG)"?
@hasty violet What was your idea?
Ok. How many poor AI's died in the process of trying that?
@turbid thunder
_Typename = typeOf cursorTarget;
_Obj_Name = getText(configfile >> "CfgVehicles" >> _Typename >> "displayname");
systemchat str _Obj_Name;```
@jade abyss Thank you ๐ Thought it had something to do with getting the infos from the configs, but I literally never did that before
And if you want the EditorPreviewPic:
_Pic = getText(configfile >> "CfgVehicles" >> _Typename >> "editorPreview");
(just had some old files open)
Error Reserved variable in expression
what reserved variable names are there other than "setAttributes"?
ah, should've checked
setAttributes is a strange name for a command which returns a structured text
test for a specific sound config?
@tough abyss why no check for patches?
Why would you need a different way is what I wonder :P
If you need an expensive way, i believe the command activatedAddons returns pbo names
With lots of mods that array becomes huge tho
But technically you can check if a jsrs pbo exists in that array
But marcels way is faster :)
finally one can disable animal life without env sounds:
https://community.bistudio.com/wiki?title=enableEnvironment&diff=98650&oldid=73447&rcid=&curid=4763
gg ๐
starting to think you are stalking kk edits on the biki. but nice change
@velvet merlin A welcome change especially because rabbits arent synced anyways and sometimes cause LOCKED doors to magically open
I think he's more like stalking this page: https://community.bistudio.com/wiki/Special:RecentChanges ๐
is KK part of BI now or is he still a modder/external?
KK edits on the wiki are a faster and more reliable alternative to reading the actual (dev branch) changelogs.
Does anyone know how to change the background colour of an RscListNBox ? This is what I have for it
{
style = 16;
type = 102;
shadow = 0;
font = "RobotoCondensed";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
color[] = {0.95,0.95,0.95,1};
colorText[] = {1,1,1,1.0};
colorDisabled[] = {1,1,1,0.25};
colorScrollbar[] = {0.95,0.95,0.95,1};
colorSelect[] = {0,0,0,1};
colorSelect2[] = {0,0,0,1};
colorSelectBackground[] = {0.8,0.8,0.8,1};
colorSelectBackground2[] = {1,1,1,0.5};
colorPicture[] = {1,1,1,1};
colorPictureSelected[] = {1,1,1,1};
colorPictureDisabled[] = {1,1,1,1};
soundSelect[] = {"",0.1,1};
soundExpand[] = {"",0.1,1};
soundCollapse[] = {"",0.1,1};
period = 1.2;
maxHistoryDelay = 0.5;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
class ListScrollBar: Life_RscScrollBar{};
class ScrollBar: Life_RscScrollBar{};
};
@tough abyss so...which ones of the color properties have you tried?
Is it possible to change the XY WH of a dialog built in hpp through sqf?
Thank you
love the new call extension syntax
but hows the 64bit naming convention for shared librarys on linux
myExtension_x64.so or myExtension_x64?
it doesn't look at the extension (for choosing between x86 and x64 anyway)
so both I guess ๐
Linux has no x64 Arma branch, because there is no port so far
and that
Linux will have 64bit version, arma just doesnt do a public dev branch for it.
And yeah it will be xxxxxxxx_x64.so
I doubt anyone has even begun porting these changes to Linux.
on static turrets, is it possible with making of mods to create like a optic you can put on a static turret when its alredy ingame and placed down?
You mean just like you would do with rifles?
yes
No
what about gun seperate and then you have a script that attach the gun to the turrent base? like mounting the gun you have in your hand to the static turret base
You would have to replace the whole model of the static weapon.
The whole object. Because changing the available optics is not supported by SQF.
what about in atributes when you place down the static turret in 3EDEN you got a option in there to add a optic to it?
You would have to replace the whole model of the static weapon.
Might as well just make two different objects at that point. Because that would be easier to use.
okay thanks
@tough abyss thx for the answer :)
Hi!
Tip that everyone knows: enableSimulation false does magic with fps. Setting it to 500 zombies make server fps still 50... OOOOoohooohooOOOHOHoohooooooohHHh,....!
Because he's not online
Oh, wait that matters? I thought you could tag anyways and they'd be notified upon returning :/
They will. It just does not highlight blue when they're not online.
Oh, ok then
Anyone got an idea when I do isNil for a variable that is nil it doesn't return anything? ```SQF
player setVariable ["Test",nil];
test = isNil (player getVariable "Test")
Test doesn't even respond, however if I do it asSQF
player setVariable ["Test, ""];
I'm going to check if ```SQF test = isNil str (player getVariable "Test")
works
Because isNil requires a STRING
Ye, that will work then
isNil "player getVariable 'test'" That works too
@cerulean whale Did you know that getVariable also has a syntax for a default return value? varspace getVariable [name, defaultValue]
I thought it would but didn't really look into it
just realised this won't work because the object I am testing on is configurated
just a p3d
but I have a workaround
isNil "player getVariable 'test'" No thta doesn't work. isNil "test" is the correct way
The second is definitively doing something else
@still forum Ehm, you are wrong sir http://i.imgur.com/acU3c88.png
isNil {player getVariable "test"} would work too but using the default variable is better in the end
Oooh.. Overlooked the player
@indigo snow Ahhh, now I get the "Code" syntax requirement
But true, default variables have made everything so much easier
It calls the code and sees it it returns nil
Never thought about the brackets myself though
Never knew isNil can have code in "" Wiki is saying nothing about that
isNil {hint "hi"; a = time + 1; nil}
{} is a CODE type in arma, SQS used to put it all in quotes instead iirc
Pretty sure thats why some commands have the code as strings instead of in code blocks
fnc_a = { hint str damage player }; a = isNil fnc_a < cant always check if functions are undefined with isNil
GVAR is Global VARiable
Soo... for captives module QGVAR is ACE_captives_isHandCuffed
wait, is QGVAR assigned to the value of ACE_captives_isHandCuffed?
_unit getVariable [QGVAR(isHandcuffed), false]
_unit getVariable ["ACE_captives_isHandcuffed",false]
Correct?
yes
there should exist an app to translate ace into english
ACE is english
In today's post-post Ironic era it's hard to tell the differnece...
REALY HARD
Anyhow. How do I save all the variables in ace for persistance. I'm stuck at the medical
what type of persistance?
If someone's game crashes or he gets disconnected whatever. He must rejoin, if he was bleeding prior to this, I wish him to continue bleeding.
gather every Variable Names and store it in missionNameSpace with his GUID.
When he connects in -> Update his Vars (i guess they are client side) by just sending them over with remoteExecCall (quickest/dirtiest/fastest/easiest Version)
Ohh I got that part figured out
I thought missionNamespace was local to the client, I'm probably wrong though
I just need to know if there's a function to gather the needed values, or should I just sniff through ace code
missionNameSpace setVariable ["VarName", "BlaStuff", true]; = global/JIP
ah, thank you
Uhm, really great that ArmA 3supports hyperlinks in hint messages . But how is the user supposed to click on them? xD any hints how to open a website? else i'll just make a workaround via callExtension ^^
you can whitelist URLs in cfg and then use a dialog to open those URLs
but i'm not sure it works in MP
wait no, you can load whitelisted URLs in to a dialog https://community.bistudio.com/wiki/htmlLoad
either way you're never gonna be able to click a hint. start testing dialogs
Yea, I already use as that for job descriptions. But htmlLoad can't handle more complex HTML which is why I'm asking if I cant open it in webbrowser somehow ^^
i doubt it
think of the security issues if any mission maker could make people open websites
well yea, there could be something like a confirmation request or via steam browser ^^ but then I'll probably have no other option than to force it via callExtension, of course only with users approval ๐
yet thanks for your help ๐
what are htmlLoad's limitations anyway? i've never used it
do you mean it doesn't load all HTML tags or what?
htmlLoad only seems to accept the very-very basics like headers (h1,h2,h3..) or paragraphs (p-Tag). tables are broken. Things like hr or divs are not even displayed for me ^^ but I even need forms which is just too much for htmlLoad. Something like the linked pages on https://armitxes.net/api/a3/jobs/_webIndex would work with htmlLoad but nothing else.
@still forum
Never knew isNil can have code in "" Wiki is saying nothing about that
It can't. It searches for a variable name that looks like code instead. Which could be used withmissionNamespace s/getVariable
@peak plover https://github.com/CBATeam/CBA_A3/blob/master/addons/main/script_macros_common.hpp
should help for macros
if it's not there then check ace3 macros
anybody had problems arma not loading an extension as soon as it trys to mysql_init()?
if I comment that line out it will load the dll just fine
Thats question is prob better off asking in tool makers.
Also you should consider making a program to load dlls for testing with
Plus you havent given any code and mentioned which mysql connector library you are using etc
So basically not enough info to help you with your problem
But chances are you didnt take into account mysql_init is not thread safe when it auto inits the library.
ok, I will write on over there
anyone here?
im looking at a script atm. and it has a "duration" set to 9999999999999... isnt it possible to set it to -1 or something?
Just use the scientific notation and write 1e10 if you dislike the eye cancer that is writing eight nines consecutively.
That equals over 300 years, so it basically is infinite for our purposes.
Quick question, when a mod that has 4 different PBOs inside of it, players download the mod trough A3L, and the mod initiates every single PBO on joining, is there any way we can disable it trough initplayerlocal? :]
Nope
Any way?? ๐
(I mean disable certain PBOs that come with the mod (different features))
Ask the addon creator(s) to add that feature in.
Whats the addon am curious now
PM
don't PM, it's good to "shame" such modders ๐
its not to shame him, it's his decision in the end... :/
shame was the wrong word ๐
haha :p
Ah well, he said he was going to separate the mod features, in different mods, in his next update. I asked this 2 months ago, I guess it won't be happening soon. I'll just disable it then, thanks for the help โค
Another quick question for the gods here, is there any way where I can disable the "F" key when people are in vehicles? :]
would you like to disable F or the action it performs?
And also what action it does on your keybinds
oh just an annoying menu that comes with the "enhanced movement" mod. There's no way to disable it so yea.. The F key is tied to a function, I'm guessing, If I could disable that only, would be way better
Don't know how to do that other than editing the mod itself if it already overwrites the key.
but that has its issues too
you should ask the mod author
yea ๐ Thought so.. feelsbadman ^^
cant you just not press F when you use the mod though?
or do you need it for something else
Is there not a menu when you press escape that enables you to rebind the keys
if its a modded key it might be scripted in and not in the keybinds
yeah it should be an option in the EM settings
Yeah the option isn't in the controls section, there is a window to the right side of the screen when you press escape with the settings for EM
@warped moon Enhanced Movement will get an update in a few weeks. I've been working with the Author to do performance improvements.
And AFAIK you can disable any hotkey in EM
I know the F key.. And I just unbound it or bound it to a key I never use... No problem whatsoever
there you go then!
@still forum yea Ive talked to him too, was just wondering if there was a way around it. Since people are abusing it atm ๐ ^^
You should be able to disable the key with a script. I'm currently running EM beta I don't have the latest release version right now to look up how to do scripts
could u help me with that? ๐
ugh... yeah... 5 min
thanks bud
@warped moon as Im not familiar with EM myself what kind of abuse you're talking about?
Okey.. No sorry.. The code is so bad you can't remove the key handlers without editing the clientside Mods pbo.
So you have to wait for next EM release which will be soon anyway
haha okay thanks for letting me know ๐
You could detect if players have the interaction part of his Mod loaded and kick them if they do.
Maybe but It may be a little complicated to get that fully working
can't you constantly overwrite the variable that EM tests for the key? ๐
Keyhandler is called every Frame. You would have to remove it after the keyDown eventhandler and before the next Frame...
true @still forum it's just annoying that it CAME WITH the mod in the first place :/
I know servers who disabled it though @still forum but I don't know how, sadly
@still forum I meant the variable that gets set by the settings menu thing
@still forum I've gotten to the point where I could both "disable" the menu and the actionmenu, but when a user presses F, it kicks him out of a locked vehicle either way. Thats only EM mod that is causing it.
Commands used:
waituntil {!isNil "babe_int_init"};
["EH_action"] call babe_core_fnc_removeEH;
["EH_ModMenu"] call babe_core_fnc_removeEH;
profilenamespace setVariable ["babe_int_b1",[[0],"babe_int_fnc_use","[]"]] //Use
profilenamespace setVariable ["babe_int_b2",[[0],"babe_int_fnc_self","[]"]] //Selfinteraction
This should overwrite the hotkeys with key 0. But will also save it in the players settings
okay cool, ill try that
When defining a macro over multiple lines do I have to use <space>\ as a line delimiter or is a simple \ sufficient?
no space needed. \ just escapes the newline
Okay then the wiki is misleading ^^
Thank you! ๐
Is that a "new" behaviour since ArmA 3 or has it been in th game for longer?
wiki?
I will correct it but I need to know whether I have to add an annotation that this is only since ArmA 3 or not
shrug. You don't need a space.
๐
the wiki itself shows it's not needed on that first #define line ๐
Yeah I just edited it ๐
It no longer states that a space is needed either ๐
Oh and while we're still at it... can I start a preprocessor somewhere later in a line? Something like that: <SomeStuffInHere> #define myMacro?
No.. It detects preproc macros by scanning for a # at the start of the line
Okay thank you
SQF preprocessor is advanced enough so you can have whitespace before the #. It doesn't have to be the first char in the line.
I guess thats just because the preprocessor is skipping any spaces anyway.
Yeah It's skipping all whitespaces before the #
whitespaces being any character <0x21
That's what it does, but that is not true for every preprocessor as I was taught.
Yeah.... Yeah.. There are preprocessors that do stuff differently.. also heard that
It's good to know the differences, in case someone asks why you can do X in Arma when you can't do it elsewhere or vice versa.
To that one guy that had problems with animate in MP
Fixed: The "animate" parameter of the animateSource script command was not correctly passed to remote clients
Is there a script version of enhanced movement?
Also, does anyone here know how to create a waypoint based on another unit's waypoint??
@TAG me if you have anything for me. Thanks! I'm getting back to it in the mean time.
@shadow sapphire retrieve the respective waypoints via waypoints then add the new waypoint via addWaypoint (you can read the necessary information out of the old waypoint... Just look into the "See also" category in the BIKI)
https://community.bistudio.com/wiki/waypoints
https://community.bistudio.com/wiki/addWaypoint
You might also look into copyWaypoints: https://community.bistudio.com/wiki/copyWaypoints
thats pretty normal
you can do...
newArr = oldArr - [valueToRemove];
...I think
@scarlet spoke, thanks a ton! Will try now!
Is there a way to findout if a vehicle is Blufor, Opfor, .. when empty?
even complicated ones are okay.
When empty -> Civilian
always
What you can try is:
attach a Variable to the Car with the Side on it.
getNumber (configFile >> "CfgVehicles" >> (typeOf _veh) >> "side");
works well. ๐
Was just going to post it.
sure sure.
but (side _veh) when empty = civilian
0 = EAST
1 = west
2 = INDEPENDENT
3 = CIVILIAN
What I wanted to know is what side it usually is on when empty.
--Is there a way to findout if a vehicle is Blufor, Opfor, .. when empty?
I think it stands there pretty clear.
If you handle with so many beginners for certain amount of time... you just think basic (wich would be the Command "side").
Sure. ๐
anyone know how to create an effect similar to setLightUseFlare that works in the daylight? perfect at night, not seen during the day. I've played with particle effects, but cant get a similar effect yet
@hallow spear! What's up, brother??
How can I make this work?
[group _G1, getPos this, 1000] call BIS_fnc_taskPatrol;```
@tough abyss, rats! I should have checked here sooner, haha. I already figured it out. Thanks so much, though!
Oh... why do you have the parenthesis, though? I did it without them and it works fine. Is it better to have them anyway?
Haha
How might I create an offset for copywaypoints?
I'm trying to get AI to move in more secure platoon formations, instead of running around on top of each other or thousands of meters away from each other.
origin getPos [distance, heading]
Origin?
A position or object
Syntax:
origin getPos [distance, heading] (Since Arma 3 v1.55.133361)
Parameters:
origin: Object, Position2D or Position3D
[distance, heading]: Array
distance: Number - distance from position
heading: Number - in which compass direction
Return Value:
Array - format [x,y,z], where z is land surface in format PositionAGL
So in this context:
_G2 = [(getMarkerPos "M1"), EAST, ["O_Soldier_SL_F","O_Soldier_TL_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x execVM "Gear\FN_centralRed.sqf";} forEach units _G2;
_G2 copyWaypoints _G1;```
May I have a link to that page?
protip, type sqf after the three backticks
Oh. I know getpos.
that enables syntax highlightning
after the first three backticks
not the last ones
gimme a sec
_G2 = [(getMarkerPos "M1"), EAST, ["O_Soldier_SL_F","O_Soldier_TL_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x execVM "Gear\FN_centralRed.sqf";} forEach units _G2;
_G2 copyWaypoints _G1;
so you do three backticks, and then sqf, and then new line
then code, then new line, and then three backticks
Wow! That's neat!
yup
If you just use copyWaypoints, then you have to retroactively iterate through the waypoints of the second group and you have to move each of them.
I see.
Hmm...
Maybe I'll come back to that and just stick with sleeping thirty seconds between groups for now.
Doesn't sound too hard tbh. Like 5 lines.
But I'm VERY ignorant about this stuff, haha. Five lines in new territory for me would probably take five hours.
Especially because I want for the groups to maintain relative position as they move, so there would be some waiting and stuff in there that I don't think I grasp yet.
searching the wiki for the needed commands...
_wPos = waypointPosition waypoint;
waypoint setWPPos _wPos;
waypoints groupName
{
private _waypoint = _x;
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [90, 1000]; // move position 1000 meters east
_waypoint setWPPos _wpPosition;
} forEach waypoints _group;
I think that's it? lol
Idk. It moves all waypoints of _group 1000 meters to 90 (east)
Oh! Okay, so I replace group with the relevant group name. Got it.
Yeah. They're variables. Can insert anything there. If it's a group, the game won't complain
usually
oh wait
origin getPos [distance, heading]
might have to switch around the 1000 meters and the 90
idk.
Yeah, had to switch them. This works quite well, but I fear that over time, it would get them all jumbled up again, since they don't maintain relative position or wait for each other.
Yeah. That'd be more complicated
You mean that the individual groups maintain a "super formation" among each other, right?
Just like IRL
Haha, yeah, I mean a super formation @little eagle.
@tough abyss, I still think it would be sorta worth it, because if they are in an appropriate formation when they take contact, that's the important part.
Oh, I was thinking a platoon moving to contact.
Yours @tough abyss is more like a platoon deliberate attack, which is also something I'm working on!
And you're right, without disabling certain parts, a platoon attack with sub elements is not going to work well!
The best thing I can come up with is having them wait at their individual waypoints until all groups have reached their equivalent waypoint.
That's pretty cool!
@little eagle, that would be my first move. Do you have any tips about how to get that to happen?
waypoint setWaypointStatements [condition, statement]
@tough abyss, yeah, the disableAI stuff is a friggin treasure. Thanks to that, my community developer was able to write a break contact script for our AI. We won't have ridiculously high casualties on both sides now, because when they are beaten, they will leave!
statement would set a variable to true and condition would check all the other ones of the other groups
@little eagle, and this would work with the copied waypoints?
If you use arrays ...
It's very abstract, but simple if you know what you're doing.
May be a error: if you never used moveTo on a agent, if you use moveToCompleted on it, it must return true, not false.
Haha, "if you know what you are doing." That's not me, unfortunately. I'm not going to try to compel you to keep doing stuff for me, but as long as you're giving me help and attention, I'll take it!
Yeah, I don't think anyone here besides QS knows what I mean.
@tough abyss, that's why you make it into a campaign featuring that stuff, haha.
It would be a very elegant solution. I can see it already. But it wouldn't look like anything you find in a random mission. : P
We're doing that with our AI for our campaign sandbox. Dang... Where do you live @tough abyss? Too bad you're not in my community, I think you'd be very interested in some of the stuff we'be been working on.
We have support scripts that do some things like that. Are we allowed to link videos here?
@tough abyss, what are your moveto comments about?
BAD SATAN!
(of course can you post links to Vids, when it belongs to the topic ๐ )
I'll check it out!
@shadow sapphire its to move agents. Some logic wait for the agent to have **moveToCompleted _agnt ** as true to performe the next action. But before you use moveTo on the agent for the first time moveToCompleted return false, and its like if the agent if moving forever. I believe if you never used moveTo on an agent, moveToCompleted must return true, not because of my case, because its more logic.
Here is an example of our AI calling for indirect fire support on a player position. They bracket their shots and then fire for effect: https://youtu.be/kv7LFm78_dE?t=10m20s
@tough abyss, thanks for the explaination! That's all way over my head, though, haha. I'm... terrible.
@shadow sapphire no problem mate, thanks anyway!
Yeah, basically, we disable the mortar AI, then we make it where if any group leader from the mortar's side can see players and the AI can pin us down for a certain amount of time, they will start bracketting shots, when they land a shot close enough to the player position, then the next shot is a fire for effect with three rounds from each of the mortars in the group. That's the gist of it anyway.
It's a pretty convincing simulation of requesting indirect fire support. The mortars are usually very far from the fight.
Vanilla mortars are OP, haha.
We also disabled all of the therman and night vision optics on all vehicles and static weapons and we disable the artillery computer for our server.
We are working on ways to make everything as immersive and realistic as practical.
Haha, that's good, though! Motivation to break contact.
If your group isn't breaking contact at least some of the time, then you need to jack up the difficulty, I feel.
We are working on some very neat things in my community, but the problem is that to fully appreciate the stuff we are putting into it, we will need at least sixty active players and I have no idea how to go about that. Doesnt matter right now anyway, we haven't had a session in over six months, because we've just been in heavy development.
Haha, right. We don't need the players for testing so much.
How big is your community?
@civic maple, right now? Hard to say. IDK who we will actually have retained through this development cycle. We were at low twenties every session, we've peaked at forty players one session, but that was rare. Most common was low twenties.
I think we'll have low teens who still are on board after our eight month break, haha.
I'm building a website with search optimization and the like, so hopefully that will allow us to reach some potential recruits.
How does one have too many people?
Well, we play with popular streamers, which create an influx of new people
we have usually 60-70 people per mission, and we play 2-3 missions per day
@tough abyss, it looks like you were working on something similar to what we are doing!
@civic maple, right now, I wouldn't be into that, but man... if I could tap those numbers when our project is ready to play, I'd be SO happy!
well, if you need people for it, feel free to send me a PM
We play a rather serious scenario. We play persistent campaigns where AI think and act with strategic and tactical goals and who fight like humans (break contact, treat wounded, call for support). We also have a PR system where based on our relationship with the civilian AI, militia will spawn and be allies or enemies. We also have to handle our own logistics. AI deliver our logistics to our main operating base in theater, but players have to move it from there to our child bases. Speaking of bases, we have bases that players of sufficient rank can deploy or dismantle. The bases are where we can store our stuff and it's also where you log out and log in. If you die, then you are deployed back to the main base and the community suffers a penalty. Otherwise, whatever base you log out at will be the base you log in at.
@civic maple, it might be a few months before everything is cleared to go, but I'd love to tap you for human resources, if you think they'd be into it.
yeah sure, if we're still a community at that point :P
We formed around 6 months ago, and there's been a bit of drama recently
OH, no!
That's really impressive that you have presumably over a hundred members and you only started six months ago. My community has never gotten close to that.
We have around 400 members in total, but as I said, we've had big streamers playing with us
That's pretty friggin sweet.
Is there a way to see which role a player currently is in ? https://community.bistudio.com/wiki/Arma_3_Respawn:_New_Respawn_Screen So i could basicly read it out when the player spawned via sqf?
roleDescription?
What even does that do.
One thing you should know about roles. When switching to units placed in editor on the fly in MP, it could mess up the role of the player. Could be bug, could be intended, but I would not recommend doing this. Create new unit dynamically if you need to switch to. Anyway, if role of the unit is messed up so is roleDescription.
Commy2 thanks for your awnser from my question in the morning does the duration affect the performance?
and if so how big is it ?
lets say i make a script that needs to stay as long as a server period lets say 4 hours... would it be easyer to write 10e10 or 9999999 or go for the 14400 or type 144e100
_unit = _x select 0;
hintsilent format ["%1",_unit];
_string = _x select 1;
_flaggy addAction [format ["Spawn as: %1",_string], {loadoutUnit = _unit;}];
} foreach loadout_west_list;```
Apperently, ```_unit``` is undefined within the addAction code, but defined in the ```hintsilent format``` code. Anyone got an idea why and how to fix that?
@turbid thunder try this
_flaggy addAction [format ["Spawn as: %1",_string], {loadoutUnit = _this select 3;},_unit];
the code block in addAction is in a separate scope (scheduled environment)
_unit isn't defined there
that is, slightly confusing right now
you can pass parameters to that scope/block using the third parameter of addAction (= arguments)
there are already 3 default parameters passed to that code block. _target, _caller and _id
the fourth parameter can be anything, whatever you fill in ๐
I see
To make it easier for yourself, pretend that code block is a different SQF file that was execVM'ed
So basically, I insert variables into the return array from addaction by simply typing them down at the end of the codeblock? Ok thx ๐ Didnt know one could do that
if you want to pass multiple variables into the code block you'd need to put them in an array of course
makes sense
i.e.
_flaggy addAction [format ["Spawn as: %1",_string], {loadoutUnit = (_this select 3) select 0; potatoUnit = (_this select 3) select 1;},[_unit,_localPotato]];
๐
@royal abyss It makes no difference, but e100 might be too large and overflow (that is one hundred zeroes). No idea.
To make it easier for yourself, pretend that code block is a different SQF file that was execVM'ed
That is exactly what it is actually. A different script instance where local variables don't carry over.
Hi everyone, I have a trigger that must fire for only certain vehicles, defined in an array, that moves into the trigger area. But the script must only execute once per vehicle and only on those that are entering the area for the first time. What would the activation code and condition code be? I have been trying for a while now without luck
Nvm, think I have found what I need: https://forums.bistudio.com/topic/146777-how-do-i-activate-trigger-only-if-certain-vehicles-enter/
You could just do if and in
Yes I am going to vehArray in thisList and thrn a custom script to add and remove vehicle in execute array
You cannot do vehArray in thisList, because in command can only search for elements inside an array. I think the best way would be something like this:
count (myTag_vehArray arrayIntersect thisList) > 0
Actually you can do vehArray in thislist but this will search for exactly this array inside of thisList and not for the components of vehArray ^^
Yeah. You can do it, but it does not do what you think it does.
Yep
@little eagle thanks yes, I quickly realised the error while testing. Just didnt bother correcting it here
Okay, could anyone help me turn the directions in this script from absolute directions to relative directions? I think the easiest way may be to grab the group leader's heading and use that, but I'm too ignorant to know where to start with that.
_G1 = [(getMarkerPos "M1"), EAST, ["O_Soldier_SL_F","O_Soldier_TL_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x execVM "Gear\FN_centralRed.sqf";} forEach units _G1;
[_G1, getPos leader _G1, 500] call BIS_fnc_taskPatrol;
Sleep 30;
_G2 = [(getMarkerPos "M1"), EAST, ["O_Soldier_TL_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x execVM "Gear\FN_centralRed.sqf";} forEach units _G2;
_G2 copyWaypoints _G1;
{private _waypoint = _x;
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [100, 90];
_waypoint setWPPos _wpPosition;
} forEach waypoints _G2;
_G3 = [(getMarkerPos "M1"), EAST, ["O_Soldier_TL_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x execVM "Gear\FN_centralRed.sqf";} forEach units _G3;
_G3 copyWaypoints _G1;
{private _waypoint = _x;
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [200, 270];
_waypoint setWPPos _wpPosition;
} forEach waypoints _G3;```
@shadow sapphire are you aware of the _obj getPos... syntax?
I am not.
look for alternate syntax: https://community.bistudio.com/wiki/getPos
I mean, I think I'm using that here, but is there something more to it?
no, that's the way to do relative positions imo
I am doing relative positions already.... I should have phrased my question differently.
_wpPosition getPos [200, 270]; replace the 270 with getDir leader _G1/2/3 (depending in which bit of code you replace it)
I need relative directions to plug into here.
Oh! @indigo snow got me already!
But what's the syntax for getDir leader _G1 +90?
You know what I'm talking about or no?
well what you put there would probably already work, if it errors do (getDir leader _G1) + 90
your only danger is that it takes the way the groupleader is facing and hes not guaranteed to be facing exactly along his axis of travel
so grabbing the relative dir between current pos and next WP pos might work better
Yeah... I know.... but I'm not good enough to know a better way.
Oh? Would you have any links or tips on where to start with that?
Okay!
how do you get the position of a waypoint?
in your script, _wpPosition should be the position of the next waypoint
Thanks a ton! I think this is what I needed!
since when can you only fail once with loading something through loadfile or preprocess.. ?
I trying to figure out if i can preProcess a config.cpp correcty, and i can't load anything, and after the first "not found " error Mesaage i don't get any reaction from the "load" commands.
i need to relaod the world to fix it and even then it only works once.
And my test file is in the arma root folder.
so .. loadFile "bla.sqf"; = file not found !
same for "/bla.sqf","\bla.sqf";
It fails every time, but you get the pop up only once.
ok
once per session.
doesen't feel like it but ok.
how about the file and path ?
i mean root and bla.sqf
loadFile reports "" if there is no file under that path
but root folder ?
Are you doing this for a mission?
mod
thats what i thought .
It should be the same paths as you have with textures, models
bla = loadFile "bla.sqf";
bla.sqf is in the arma 3 root folder.
it contains something
sqf should be allowed to be loaded
Is bla.sqf just a file in root? You need to enable filePatching to load unbinarized files.
thx
that is probably the reason
yes it was -...-
lol
my test config contained includes... bb arma ....
Strange: if agents get stuck, if i minimize and then return to the game, they unstuck.
@halcyon crypt i believe the command doWatch have priority over moveTo on the agents.
So the agent preffer to keep watching instead to move.
(confirming this now)
But strangely when i minimize, they stop to watch.
Heya there
Guys, how I can make checker by uniform class?
Nah, other way...
I have 8 SSIs (arm patches)
For different &a common uniform types
So, they ' re running locally
"checker by uniform class"
???
one patch per uniform class?
If no one from list, load default (rebellion) full colored
Is this for a mission?
It's local yup
And you want to assign those insignias on unit spawn?
For mp or sp ***
Sure. initPlayerLocal.sqf works in SP, MP
The issue not in loading structure
That is the first thing I think about when doing stuff
SQF?
Maybe u have any suggestions?! Logically - one holder will be loaded if uniform class doesn't match with any listed and if equal then load right SSI img
You should read this probably to get started on the SQF syntax:
https://community.bistudio.com/wiki/Control_Structures#if-Statement
Well u was right it's a checker by uniform class. Ty for basics but that's not what I really searching for. ๐ maybe u have any ideas how to wright it?!
R
@halcyon crypt found the problem was a but on my part.
maybe u have any ideas how to wright it?!
A bunch of if's?
or a switch?
I don't see the problem
A bunch of if's
Can't imagine switch way, but I understand ur suggestion
Difference between our exp , u don't see but I see. ๐
Ty anyway
Hi bois, I got this code. I know that the left position in x is x = 0
But what is the value for the right side ๐
type=CT_STRUCTURED_TEXT;
idc=13371;
style=ST_LEFT;
x = 0.01 * safezoneW + safezoneX;
y = 0.700 * safezoneH + safezoneY;
w = 0.55;
h = 0.11;
valign = "left";
sizeEx=0.035;
size=0.035;
font="PuristaMedium";
colorBackground[]={0,0,255,0.6};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=false;
text="";
x+w
Well w means how width it is. But I want to move the class to the right side of the screen instead the left side.
So for I can do that I need to know the vaule for x and when I know that I need to take the x - w ๐
Or I'm wrong?
got a super duper noob question for yall
so right
how do i filter stuff inside an array
like if i have an array of stuff in a trigger area
and i want just the vehicles from that array
is there some sort of way of going vehicles in airfieldObjects
etc
What exactly does setWindForce do?
because I set it to 7200 setWindForce 0.8;, and the wind is fucking insane
@static spire ```sqf
_array select { _x isKindOf "AllVehicles"; };
should work
@civic maple not really what i needed, but i got it working anyway. cheers.
kk
Is there a way to attach an object to another object but keep it in it's current position?
This should give you the position relative to the model https://community.bistudio.com/wiki/worldToModel
Then you can attach it with that relative position
object1 attachTo [object2]
if you set not offset and mempoint, it will attach with the current offset
Oh ok, I was trying worldToModel earlier however it always inverted the sides (I figured thaat out but commy's method is easier). Thanks for the help
Is there also a way to maintain direction? I tried getDir and setDir but that didn't work
I got getRelDir working, I just had player and cursorObject round the wrong way
setDir will be relative to the object you're attached to, so you just have to do a bit of math and subtract the direction of the object you're attached on from the direction of the attached object.
this is kind of a vague hint but i remember when working with attachto that the order in which you execute stuff like setdir and setvector matters. so before you give up on something that SHOULD make sense, be sure to try changing around the order. i can't remember the details so excuse me if it's bullshit ๐
badbenson
you are the man for making enhanced movement
have an internet beer on me
is there a way to do the inverse of the arrayIntersect command?
union?
copy pasting this from Slack:
private _fnc_arrayUnion = {
params [["_array1", [], [[]]], ["_array2", [], [[]]]];
_array1 = _array1 + _array2;
_array1 arrayIntersect _array1 // return
};
triggers check every 0.5 seconds and not every frame
Is there a way to spawn the gbu visual without the explosive damage? And other explosives of the same nature?
That just created the actual bomb, commy. haha
https://community.bistudio.com/wiki/Talk:getUnitLoadout Does anyone know if thats still correct? That It is WIP and layout may change?
safeZone is your master now @peak plover
nah my pointer would be to create a blank dialog in your description.ext and then do everything in script with ctrlCreate til you're comfortable
Allright
Question: Might anyone know where I can find a list of all BIS made particle effects? I want to spawn explosion effects without damage. Any help would be greatly appreciated and before anyone possibly gets upset with me... I have searched; Google, the Wiki, and BIS Forums.
@knotty iron as long as you don't ask "how easy would it be to.." and ask specific questions, i don't see the problem
this is good for reference too, if you jsut want to see it and not hunt for files https://community.bistudio.com/wiki/ParticleArray
actually. i don't know how close the arma 2 sprite sheet is to the arma 3 one. it's very close but might not be identical
there's a particle FX editor mission which is pretty good too
i got high and played with that for like 5 hours straight once, fun times
you too?
it's a pretty far-out mission, man
arma 3 is featured on that site
side note. there are more used than that one now
so i guess going for the path nigel gave is the safest route
I was sincere when saying I've searched the wiki and I could've been more clear in what I'm looking for which is a list of pre-made particle effects/explosions without the blast... for example, creating an artillery explosion itself on command
and the wiki post only displays the A2 stuff as well as it doesn't show a list :\
i knew you were. no sarcasm. i thought your question was ok
ah wait. so you only want the effect? not make a new one? look for particleClass command
sec
look at the bottom under "see also"
bunch of good shit there
I'd prefer not to but ultimately won't mind if I have to make the list myself but I just need to know where to compile all the particle effect names from? Such as
C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Addons\data_f.pbo
class CfgCloudlets
and I've been to https://community.bistudio.com/wiki/setParticleClass but the example of "ObjectDestructionFire1Smallx" is EXACTLY what I want (err at least I think so right?) but I want a list of all of them
btw. slightly talking out of my ass here. but as far as i remember. some particle effects won't work with that command. my theory was always that it is because the engine uses some hardcoded variables like "intensity" to scale certain anims based on config values to be able to reuse them for certain values.
if you open the main config that has class CfgCloudlets in those folders nigel gave you. you will come across it. i think there are other similar ones too
also to get the list
"true" configclasses (configfile >> "CfgCloudlets")
I hadn't clicked that link from Nigel (ty Nigel) till you referenced it but I don't know where those folders are located?
data_f as you said i think
btw. note that above code will get you config entries. to get classnames do this
_cfgs = "true" configclasses (configfile >> "CfgCloudlets");
_classnames = _cfgs apply {configname _x};
Thank you both and I love how nigel only communicates in images :p
No easy way to get an array with near units even the ones inside vehicles?
doesn't nearEntities catch crew?
Are the default (bis created) particleclasses used in mods like BlastCore cause I just realized if I Blastcore, wouldn't I need their class names instead or do they use the vanilla particleclassnames?
nope nearentities does not catch crew
@polar folio @peak plover yes, nearEntities dont get it.
dang
what's wrong with reading out the crew though? isn't that pretty straight forward?
Try this : _nearUnits = [];{if (_x distance player < 100) then {_nearUnits pushback _x}} count allunits;
Aah donnava.
@peak plover i'm using a code like that.
@polar folio its because for that you need to detect all vehicles on the same radius and search on all of then for players. Too heavy.
@peak plover thanks.
@peak plover Pls stop posting simple pics as answers.
Codelblock can be used with
```sqf
bla
```
lol
If you add ```sqf
it uses the sqf-Syntax for highlighting
_test = find deleteVehicle _Var;
setpos getpos _me```sqf
```sqf <- Single line -> Enter -> Code starts -> Code Ends -> ```
makes it easier to read and modify, if errors are in it + i personaly hate opening img just to see a simple answer (just like with the path's before, but thats just my personal note)
On how you can do cache scripts without comparing distance
createmarkerlocal that's an ellipse where the unit is. then ```sqf
count (allPlayers inAreaArray _marker) > 0
Isn't that what the new dynamic simulation uses?
true dat
@peak plover this inAreaArray command is fast?
With that code now my zombies can see players inside vehicle ๐
Nah the inAreaArray seems slower ๐ญ
Ahhh ๐ฆ
Slower than distance
Yes player count would matter
I switched allPlayers with allUnits
nearentities is still the fastest, but does not work for crewed units
Therefor it is what some might call fecal matter
Currently takes me "0.491013" seconds to check ~350 groups distance to player
The distance comparision is not that bad
MS not S, or?
S
0.4 seconds
I'll try a few more
3:29:55 "TOTAL AIMASTER GROUPS - 1439"
3:29:55 "2.59302"
But it does not seem to work with crewed units
try something like:
if(!isNull (objectparent _x)then{ forEach crew objectParent _x} blablub stuff
could try this one too sqrt (selectMin (allPlayers apply {_pos distanceSqr _x}))
1.6ms running it on an array of 1000 positions instead of allplayers
What does that even do?
doesn't give you the unit though, just the smallest distance between a player and _pos
distanceSqr gave me some wierd numbers ๐ญ
yeh its better performing but gives you the distance squared as advertised
so sqrt makes it a normal distance again
but does that not undo the benefits
benefits?
The faster speed
you're best to do as few sqrts as possible, yeah (which normal distance does internally)
if you can, best to just square the value you're comparing it to (X*X)
or sqrt it at the end
seems like it's going to end up redundant
what is?
its just a different way to do it.. using distanceSqr is faster but less readable
than using distance
using x*x it's 3 times as fast you say ?
i didn't say that
and no, it might not even be noticable at all with SQF overheads, but computers aren't good at doing square roots
We'll then I got atleast something in common with a computer
anyone home?
cannot for the life of me get this to function correctly in the Condition field of a trigger "{typeof _x isEqualTo "B_truck_01_box_F"} count thisList > 0"
no error, trigger just isn't firing
if i change the > to a == then it will fire but that's obvious
And it is the "B_truck_01_box_F" that goes in?
Add a systemchat Log for you, to see what he finds.
{
typeof _x isEqualTo "B_truck_01_box_F";
systemchat str (typeOf _x);
} count thisList > 0```
yes the correct class name object is being inserted into the trigger area
spams the class name in sys chat
Correct one?
yeah
and? Is it beeing executed or not?
negative
at this ppoint all im trying to do is a hint
Whats beeing executed?
SP in editor, ill try MP quickly
Stuff someone need to know, if he wants to help you
If it's not working in SP, it shouldn't work in MP also
@tepid heath
...
"Whats beeing executed?"
So its spamming in Systemchat the Classname of the found Vehicle, correct?
yes
{
typeof _x isEqualTo "B_truck_01_box_F";
systemchat str ((typeOf _x == "B_truck_01_box_F") count thisList);
} count thisList > 0```
Pls put that in.
Generic error in expression
i am
Add braces in his systemChat @tepid heath
omfg i got it working
What was it?
by just repasting the literall same code and putting the same class name in
wtf arma?
Something was wrong then.
Heh
clearly but i have no idea what it was.
Magic
its just a simple basic trigger with only 1 condition
Something must be done differently this time.
ah well, that trigger now saved as a composition so i dont have to mess it up again ever
thanks guys appreciate it
yepyep
Its possible to make a mod like Epoch or Exile without the use of sqf scripts?
Why sqf is seens like a villain?
you err...kinda need SQF to do anything
@tough abyss dude, what?
You can use ASM/C/C++/Rust etc.. but your mod will break after every binary patch. :)
ez pz
Welll, not my fault, its not me saying "SQF is the source of all badies". So Efusion will have a script language? :)
I don't get the hate on SQF so much. I mean sure it isn't low level like C++ and yes there are limits. But for a scripting language within a game I don't see the hate some have and/or spread justified.
My two cents
No OOP, no optimizer, dynamic typing, no pointers/references, easy multithreading but no synchronization
etc..
Shame the (planned) Java implementation was dropped
Efusion will have somthing like SQF?
no, it'll be C++-ish
I think @grizzled cliff mentioned that it's somewhat close to https://en.wikipedia.org/wiki/C%2B%2B/CLI
wonder how that will affect any future linux/mac ports though ๐ฆ
@halcyon crypt it will be possible to do all the mods we do today with Arma 3?
sure, probably, just not SQF I guess
no clue to be honest, don't think there's anything public about it?
there might even never be an A4 ๐
You think BI just drops their best selling series?
things happen ๐
but no, I don't think so
did A3 outperform DayZ in sales?
according to steamspy DayZ has more sales
3,607,877 ยฑ 53,862 vs 2,906,221 ยฑ 48,388 (# of sales, not revenue)
no clue about accuracy though
If they say so then probably.
Arma has a healthier community ๐
Isn't the DayZ game still unfinished or something?
probably, haven't played it in ages
@little eagle it is but it has seen quite some updates. Still early access though
Question: Is there actually any situation where SQS is worth using over SQF?
when making a mission in OFP
Why's that?
since SQF wasnt around until armed assault 1 ๐
Ah so basically just one of many leftovers from the past. Its weird since I once downloaded a paradrop script and it was SQS and I forgot it even existed until someone her mentioned it
dayz standalone is looking good...60+FPS in chernogorsk, better than arma 3
someone tell me why the hell this is flagging up an error cheers :))))
{_actions = actionIDs _x; if (_actions == [0]) then {_x addAction ["<t color='#FF0000'>Despawn</t>",{deleteVehicle _x},"",0,false,true]} else {};} forEach vicsNoSupply;
its saying that the comparison is an issue, but i dont see how it could be
@static spire else {}; can be safely removed from code unless you actually want it to have an alternative outcome. Can you describe the issue more specific? Usually the game tells you that it expected something different than it recieved. What does it tell you it expected and what does it tell you that it recieved?
it just tells me theres a generic error
Oh arma.... ohwell I need to boot up arma myself, mayby I can figure smth out
if it helps this error only shows up when _actions = [0], it works fine when its an empty array
generic error > This error occurs when the type of data an operator is expecting does not match.
what is _actions?
you cant compare == over different types
Should be an array
are you on dev?
check the return of that command
both arrays, definately
_actions isEqualTo [0] is probably "better"
you shouldn't be able to compare arrays with ==
alright, let me test that
< missed out on that
https://community.bistudio.com/wiki/isEqualTo It can compare Arrays, Scripts and Booleans (alive player isEqualTo true) I like, never had to use that ever ๐
๐
isEqualTo can compare across types which is mainly why its nice
sorry to ask so much, but yano im p terrible at this
here is my current stuff
{_actions = actionIDs _x; hint format ["%1",_actions]; if (_actions isEqualTo []) then {_x addAction ["<t color='#FF0000'>Despawn</t>",{deleteVehicle _x},"",0,false,true]} else {};} forEach vicsNoSupply;
it works, but the problem is that deleteVehicle _x doesnt work, because its in an action on a vehicle outside of the forEach
so when i do the action, it tells me _x is not defined
I believe not.
_x addAction ["<t color='#FF0000'>Despawn</t>", {deleteVehicle (_this select 3)}, _x, 0, false, true]
something like that
^
The entire thing could be simplified to:
{
if (count (actionIDs _x) == 0) then {
_x addAction ["<t color='#FF0000'>Despawn</t>", {deleteVehicle (_this select 3)}, _x, 0, false, true]
};
} forEach vicsNoSupply;
or (actionIDs _x) isEqualTo [], not sure which is "faster"
would (_this select 0) work without the _x argument if i just wanted the object name?
Yup
As long as the vehicle you want to delete = the vehicle the addaction is attached to
yeah
then yeah that'll work
works perfectly, thanks guys
Anyone know if I can apply a custom texture to the AAF's Gorgon via a script?
setObjectTexture
@lavish ocean or someone else who can edit the wiki:
Command: inAreaArray
For syntax: positions inAreaArray [center, a, b, angle, isRectangle, c]
The wiki says center: Array or Object - center of the area in format Position3D, Position2D, Object or Group
However using an object returns the error:
if (>
18:48:33 Error Type Object, expected Array```
using `inAreaArray [getPosASL _x, 20, 20, 0, false, 10];` works.
Wiki needs to be edited or bug needs to be fixed
I think you got it wrong?
If you want ot use that syntax then positons must be an ```sqf
[getpos unit1,getpos unit2]inAreaArray [town_1, 500, 500, 0, false, 10]
what does the "default" return mean? https://community.bistudio.com/wiki/locked
if i trow a unit in the air with setVelocity, it will be affected by wind?
nvm. found it. answer here: https://community.bistudio.com/wiki/setVehicleLock
Sorry to ask, but vehicle vehicle player for a player in a jeep return the jeep? Thanks!
vehicle player returns the vehicle. ```SQF
typeOf vehicle player
@cerulean whale but for the sake of optimization vehicle vehicle player can occur... Any problem on that?
... how would that optimize anything?
Less treatment.
i do not understand what that has to do with vehicle vehicle player
What do you mean vehicle vehicle player?
How would that make any sense? What are you trying to achieve?
I have a var that can be a player or a vehicle
But if its a player, i know is a player in a vehicle
and i want the vehicle
vehicle player returns the vehicler....
thanks
player returns the playter
vehicle player returns the vehicle
typeOf vehicle player returns the type of vehicle that the player is in\
Ok, there is a g force in Arma 3? ๐
i'm doing ballistics
Trowing a zombie in a helicopter
From the ground
you can fall so there is gravity, yes
@peak plover no, the first array can take an array of objects
array inAreaArray [position, a, b, rotation, isRectangle, z]
i.e. in your example town_1 needs to be an array (i.e. position)
So i'm pretty sure the wiki needs to be tweaked.
because it says town_1 can be an object
which it can't
Just sharing: make a unit crouch and jump in a heli (for zombies): ```Sqf
private ["_calc1"];
_o = getPosworld _agnt; //ORIGIN (THE JUMPER)
_t = getPosWorld vehicle _killer; //TARGET (THE HELI)
_v = 50; //VELOCITY
_g = 9.8; //GRAVITY
_dx = _o distance2D _t; //HORIZONTAL DISTANCE
_dy = (_t select 2) - (_o select 2); //VERTICAL DISTANCE
for "_i" from 1 to 6 do {
_calc1 = _v^4 -_g*(_g*_dx^2 + 2*_dy*_v^2);
if (_calc1 > 0) exitWith {};
_v = _v + 10;
};
if (_calc1 > 0) then {
_a = atan ((_v^2 - sqrt(_calc1))/(_g*_dx)); //TROW ANGLE
_h = [_t select 0,_t select 1,(tg _a)*_dx]; //TARGET TO HIT
_velVec = (vectorNormalized (_h vectorDiff _o)) vectorMultiply _v;
_agnt setDir ([_agnt,_killer] call BIS_fnc_dirTo);
_agnt setUnitPos "MIDDLE";
_agnt doWatch ASLToAGL _t;
_agnt setVelocity _velVec;
};
no