#arma3_scripting
1 messages ยท Page 462 of 1
There is this https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorMarkerPlaced but that is just for curator
I built my own handler for that so I guess Arma doesn't have one. But ACE has a event for it if ACE markers is enabled
I just found that CBA has one as you posted that
what's it called?
Should replace my crap self-made implementation by the proper CBA one then ๐
Although no.. I need to know who deleted the marker :/
the CBA one just retrieves all markers every frame and checks if anything changed
Does anyone here know how I could find out what the pending module is for a curator?
If they select a rifleman from the Create window on the right hand side, can I know they have that selected before they place the unit, or a module, prop, etc.
@inner swallow setObjectTextureGlobal is (according to the wiki), persistent and JIP compatible, since the F3 loadout script is only ran local to the unit there's no need to use remoteExec - The global command does this all for you. If you were to use 'setObjectTexture' then yes, you would need to use remoteExec.
@runic rose , yes but something strange is definitely going on. I have used setObjectTexture, the local variant on CBA init event handlers without problems. But yesterday, on a dedicated server, I had both a setObjectTexture globally applied through init box, and a setObjectTextureGlobal on another unit applied from only server. Neither worked when joining on mission start, unless I spawned a delay, but it worked fine for JIPs.
Yeah I don't claim to understand it fully. All I can say is that I haven't had any problems when using a delay so I've continued to use that method.
Yeah, but what I meant was, at the point you're putting a delay, does it matter if you do it like that or via remoteExec?
Since they're both equally reliable
(delay + global command Vs no delay but local command + RE with JIP set to true)
I would expect them both to work, but who really knows without testing. ๐
Do you know if it's possible to remove the camera in jets completely?
Probably via config?
@ LSD well, they both work, since I know the RE method works, and you know that the delay method works ๐
any way to move the pistol and ammo to vest via script? witout removing and readding it?
no
Is there any way to deliberately check the call time of extension via callExtension?
Well arma does that when time is taking more than 2000ms, so just was interested on how to make it by my own.
ran into an issue with my phone, its works fine with small interface size, but looks buggy with normal https://steamcommunity.com/sharedfiles/filedetails/?id=1396939702 any ideas ?
you may have to work with safezone and all related stuff
safezone is used
if you want the ui to scale with the resolution then use safezone
if you want the ui to be the same on all resolutions (as in, smaller on higher resolutions), don't use safezone
in A2 anyway ๐
a before and after screenshot would be useful though
if you use safezone you'll have to use it pretty much everywhere
x,y,w,h
on all controls
I guess the text controls don't scale properly or something
seems like it
you should be able to scale font size with safezone as well
hmmmm
can you make a screenshot of it where it's good?
ok so I guess the edit box is too small for it to contain the text
making it get this weird offset
can you post the config?
sure
yup, it's me again ๐
someone tell me, the hell i'm doing wrong here
player addAction ["<t color='#00BFFF'> -- Use Earplugs</t>", {
5 fadeSound 0.5;
earPlugsOn = true;
}, nil, 0, true, true, "", {!earPlugsOn}, -1, false, "", ""];
What's not working?
19:09:33 Error in expression <Sound.sqf [SNDC_fnc_FadeSound]"
player addAction [" <t color='#00BFFF'> -- Use >
19:09:33 Error position: <addAction [" <t color='#00BFFF'> -- Use >
19:09:33 Error Type code, expected String
19:09:33 File functions\fn_FadeSound.sqf [SNDC_fnc_FadeSound], line 1
Well then use "code" instead of {code} maybe then works
ahh dam, it's that?
Also, make sure earPlugsOn is defined at the begin of the mission, otherwise the condition will fail because the variable doesn't contain a bool but is nil
@late gull Dunno, test it
yes, it is defined to false at start
Good
yes, makes sense what u said, the error it's pointing a bad place
yep, thx, the error gone
just now showing, but no error xD
are there any other ways of storing an array as a text datatype inside a db?
so the easiest one is text, right?
I was searching on w3school and encountered also json
But depends on what you have available. I have a json serializer that I would use
json is text
I'll take the easy road then
can someone point me in the right direction in adding virtual arsenal to wasteland server
tried that
but where with in mission file
wherever you need it ยฏ_(ใ)_/ยฏ
yeah thats the bit im stuck on lol
if you want it on a box. Then use the init script of that box
If you don't know where you want it then I don't know either
yeah. Arsenal is usually used to load gear..
indeed but its so when you respawn you can enter the virtual arsenal not a box as such
i tried in the init.sqf that broke stuff lol
If you can't or don't want to tell me where exactly you want it.. I can't help you
so i want it as respawn load out
you want it to open when the player respawns? Once?
player addEventHandler ["Respawn", {
["Open", [true] ] call BIS_fnc_arsenal;
}];
There. Add that to the end of your init script. If you also want it to open when the player joins for the first time then
player addEventHandler ["Respawn", {
["Open", [true] ] call BIS_fnc_arsenal;
}];
["Open", [true] ] call BIS_fnc_arsenal;
cool man will try it
I made a loot spawning system that creates loot around players. https://i.imgur.com/6MUexsI.jpg
It uses a loot table where I can define amount of certain item to spawn. It also caches the loot, so if
I drop an item in the pile and leave and come back it creates the same ones.
There's no way to get attachments off guns and items out of vests/bags, right?
Any other things I should add to this?
There's no way to get attachments off guns and items out of vests/bags, right? correct
and items out of vests/bags incorrect.
๐ค
Ohhhhh
you can use these to get the container of the vest/bag and then use the normal cargo commands
I can probably
Make attachments work
But I need to remake inventory
for that
If I take the gun apart, that can work
so i guess !="Logic" 3:16 [3745,7947," on line 11 but the wasteland filters are confusing lol
No idea what that's supposed to be
guys, how i do escape characters? i want to escape % inside format[] not working with %
i got a createvehicle restriction #11
28.05.2018 19:15:49: morg morgan morgason (127.0.0.1:2322) 554ec544eb97590b2e96e18bfe0934ce - #11 "Logic" 3:14 [3744,7949,8]
normally 11 is like line 13 on most filters
@slim bobcat not #arma3_scripting no Idea what that is
@slim bobcat #arma_battleye :p
format should only replace %<number>
the code you gave me for the init works but i get kicked
so as long as you don't have a number it should be fine
kk
// Set everything to 1 if you are using Zeus
// Warning: 128-char limit between double-quotes
// Vehicles
5 "^[BOI]_(?!\d)(T_)?(APC|Heli|(Life)?Boat|LSV|MBT|MRAP|Plane|Quadbike|SDV|Truck|U[AG]V|VTOL)(_|$)" !"_UAV_(AI|01|06)(_|$)" // Allows quadcopter
5 "^[BOI]_(?!\d)(T_)?([HG]MG|Mortar|static_A[AT])_" !"_(weapon|support)_" // Allows disassembly
// Ammo boxes
5 "^Box_" !="Logic\" 3:16 [3745,7947,"
5 "^[CBOI]G?_(T_)?supplyCrate_"
5 "^([BOI]_)?CargoNet_"
5 "^B_Slingload_"
// Civilian & guerilla stuff
5 "^C_" !"_UAV_(AI|01|06)(_|$)" // Comment this line if you need to allow civilian units
// 5 "^C_(IDAP_)?(Hatchback|Heli|Offroad|Plane|Quadbike|(Rubber)?Boat|Scooter|SUV|UGV|Van)(_|$)" // Uncomment this line if line above is commented
5 "^[BOI]_[CG]_" // Comment this line if you need to allow guerilla units
// 5 "^[BOI]_[CG]_(Boat|Heli|Mortar|Offroad|Plane|Quadbike|Van)_" // Uncomment this line if line above is commented
5 "^B_(CTRG|GEN)_" // Comment this line if you need to allow CTRG or gendarmerie units
// 5 "^B_(CTRG|GEN)_(LSV|Heli|Offroad|Van)_" // Uncomment this line if line above is commented
// Buildings & objects
5 "^Land_" !"^Land_(BakedBeans|BarrelEmpty|BottlePlastic|Can(ister(Fuel|Oil))?|CashDesk|Ground_sheet|Money|Sleeping_bag|Suitcase|TentDome)_" !"^Land_(Rope|Tablet)_" !"_(dam|ruins)_F$"
// Game logic (comment these if it causes problems with some addons)
5 "^Lightning"
5 "^Logic"
5 "^Module"
// VR entities (blue/red/green/purple ghosts)
5 "^[CBOI]_Soldier_VR_"
no it's not a number
lol that was alot lol
You posted %
that doesn't have a number after it
format should only replace the first %1
right, but it's not showing up
the % at the end is not showing up in the output?
yep
How about %%%%?
or just move the end % outside of the format if it's at the end anyway
how i do that? just + "%" ?
yes
oki, thx, but there should be a way
to do that in format direclty
or just adding %2, "%" xD
not pretty, but maybe work
I think I'm having issues passing vars from a trigger to an array; I'm trying to get this statement pass an array for use inside a while loop.
_trg setTriggerStatements ["{typeOf _x == ""CargoNet_01_box_f""} count thislist > 0", "_objinside = thisList", ""];
to be used by this line;
_cnt = "CargoNet_01_box_f" countType _objinside;
I've declared the array & count, what am I missing?
is that working with double double quitation?
at the end of the script _objinside goes out of scope and disappears
yes that is working.
understood
ok
yes you have to double quote it like that
" 'asd' "
you can make your _objinside a global variable. Or use setVariable to set the variable directly onto the trigger and grab it out of there again
ohh setVariable might be useful, can I setVariable inside a if the trigger was made before the loop?
you have to actually
if what you are implying is otherwise passing local variables into the trigger statements
which you can't
no im drawing from the trigger
https://gyazo.com/4cfa8e2f95ab44724109acfb6f8822ae
systemChat format["Sound Volume: %1", (soundVolume*100)] + "%";
not working
use braces.
(systemChat format["Sound Volume: %1", (soundVolume*100)]) + "%"; That is what you are doing.
which yeah.. obviously doesn't work
I've been working on that for days and cant seem to get the variables i want in the right places. It either runs forever or gives errors lol. im so bad
nope, still not working like that
like what?
you solution
but i get it
systemChat format["Sound Volume: %1%2", (soundVolume*100), "%"];
this work -.-
So.. You mean the thing that I said "which obviously doesn't work" doesn't work for you? wow.
LOL
I'm sure I dreamed about exactly this half a year or so ago ^^
But my brain tells me I did ._.
I would totally post a meme here, but this is scripting help :L
grrrrr be filters
eh?
Battleye filters have been the save for a lot of public servers from what I've observed
Does anyone here know how I could find out what the pending module is for a curator?
If they select a rifleman from the Create window on the right hand side, can I know they have that selected before they place the unit, or a module, prop, etc.
Try looking at Curator event handlers maybe?
I wasn't able to find one that would do this sadly
It could be a normal UI control that you can access via script
just check every frame what's currently selected
That's my only idea
Yeah, that's what I was thinking earlier. I just have 0 experience finding the control IDs. That's why I asked yesterday how to go about doing that. Was really hoping I had just missed an event handler that did this.
you look in config viewer and experiment around till it works
private _tree = (findDisplay 312) displayCtrl 270;
private _class = _tree tvData (tvCurSel _tree)
This was able to get me the class of the currently selected blufor unit, thanks @still forum
Lets say I have an array
[1000,1000,1000]
and I wanted to add another array to it of [500,500,500]
to make it return
[1500,1500,1500]
What would be the script command to do such operation?
vectorAdd
Thanks, that was my initial thought, just didnt know what it meant by 3D vectors
a vector is an array with numbers, 2D means 2 number 3D 3 numbers and so on
3 dimensional
XYZ. is 3 dimensions
meaning it won't add like.. arrays of 5 numbers together
๐
yes, as long as they are of equal size
https://community.bistudio.com/wiki/vectorAdd says 3D vectors though
so 2 arrays of any (same) size can be added with vectorAdd
Actually, can Vector add 5D vectors and 2D vectors? The description say 3D
So is that true or not?
It could. But we are still talking about Arma here
Programmer was probably lazy
But then again larger 3D is irrelevant for arma, but 2D should work at least
Alright, only 3D
What a pity
Not that I need it, but is there a solution to addition of arrays larger than 3
_vector1 = [100,100,100,100];
_vector2 = [50,50,50,50];
_vectorAdded = _vector1 apply {_x + (_vector2 select _forEachIndex)}
Not sure if apply has forEachIndex?
That solution isn't easy? ^^
I would do essentially the same on c++ side
Well. Combined with some SSE magic for specific array sizes ^^
@late gull better option for your "Earplugs" thingy with setUserActionText
private _id = player addAction ["Earplugs", {
params ["_target", "_caller", "_id"];
if (soundVolume isEqualTo 1) then {
2 fadeSound 0.15;
_caller setUserActionText [_id, "Remove earplugs"];
} else {
2 fadeSound 1;
_caller setUserActionText [_id, "Earplugs"];
};
}, [], -1, false, true, "", "_target isEqualTo vehicle _this"];
hmm thx, already done one xD
but btw, where _caller comes from?
it's a kind of magic var?
check this https://community.bistudio.com/wiki/addAction ๐
caller (_this select 1): Object - the unit that activated the action
oki, thx will read it at bed :p
btw new addAction page looks ๐
@meager heart
how about
isNull objectParent _target
versus
_target isEqualTo vehicle _this
try it ๐
@gleaming cedar https://community.bistudio.com/wiki/Arma_3_Actions#SwitchWeapon
by having an enemy tank in front of it ๐
what's your goal?
switch to launcher, then shoot on target
player1r fireAtTarget [boat1l,"launch_NLAW_F"];
I have this
Now when I play it
put a tank, AI will do the rest?
Yes it does work, obviously your execution or syntax is incorrect
๐ฆ
it's muzzlename, not weapon name. Are you sure launch_NLAW_F is muzzle?
No, it's not a muzzle
let me try different name
should be under cfgWeapons entry
think so
@gleaming cedar , tried https://community.bistudio.com/wiki/BIS_fnc_fire ?
nope not working
I just want AI shoot on a boat when there is a trigger
Anyone has an idea
How to switch to launcer/
weaponState returns on PCML:
["launch_NLAW_F","launch_NLAW_F","Single","NLAW_F",1]
(weapon, muzzle, firemode, magazine, ammoCount)
joe1 doFire car; // works on an empty MRAP
@gleaming cedar even works on an empty friendly boat
also that ^^
joe1 fire "launch_NLAW_F"; // will shot straight without aiming or thinking
0 spawn {
private _shooter = createGroup playerSide createUnit ["B_soldier_LAT_F", player modelToWorld [0,20,0], [], 0, "NONE"];
private _target = createGroup east createUnit ["O_pilot_F", player modelToWorld [0,100,0], [], 0, "NONE"];
_shooter doWatch _target;
waitUntil {[objNull, "VIEW"] checkVisibility [eyePos _shooter, aimPos _target] > 0.5};
_shooter fire secondaryWeapon _shooter;
};
```into the console ^
btw he always misses, just tried that few times lol
even if that checkVisibility 1 ๐
use doFire, fire only shoots, no target required ^^
with doFire he will fire with primary
or task is to make him just fire ?
also maybe laser target will fix his accuracy
@meager heart
private _vDirView = eyePos _shooter vectorFromTo getPosWorld _target;
private _vDirWeapon = _shooter weaponDirection secondaryWeapon _shooter;
acos (_vDirView vectorDotProduct _vDirWeapon) < 5
Less than 5 degree between the view and the weapon direction.
hax
How so?
_target have no chances ๐
Never had any.
you are to brutal man ๐
I have this script that makes pos1 fire a missile at pos2 and always misses by x degree, i.e. 10.
Is there any actual way to force a vehicle drive by its own, like when you put a brick on a gas pedal?
yeah saw that, commy
like when you put a brick on a gas pedal?
No.
Dammit, I know I can use something like addForce or setVelocity but I want it to respect vehicle properties.
addForce will work like push
You can't, Demellion sadly.
addForce will just make it fling around, not spin the wheels.
I remember some day in Arma 2, where you could hold shift and drive forward to eject straight after, it acted like i just described
๐ญ
Too advanced for PhysX.
I'd just script the missile. Not make an ai actually fire one. It's not like anyone will notice the difference, and with script one can actually aim.
Ok, what about manually forcing "CarForward" inputs on driver keyboard, just no idea about that too.
If I write "you can't", then you can't.
check this, maybe you will see something usable, Demellion http://killzonekid.com/arma-scripting-tutorials-one-man-tank-operation/
also maybe something possible with invisible agent ๐ค
(never tried)
This is a waste of time, but I guess everyone has to make the experience themself.
Well i believe commy pretty much, since I lack of any ideas on that too because of the same reasons: you can't
i'm checking for addons in mission from description.ext (enabled/not enabled) and depends on that #include different inventory configs, question is, how to make it selectable via mission params and have this check by default at the same time ? ๐ค
#define RHS_LOADED __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
#ifndef RHS_LOADED
#include "cfgInventoryDefault.hpp"
#else
#include "cfgInventory.hpp"
#endif
with #undef ? and define it again ?
That's not how you use __EVAL. __EVAL is always placed after =.
If what you wrote were possible, there would be no need for x_compat_ace addons etc.
I think its __EXEC you to have there?
If what you wrote was possible
that possible, i mean it works ๐
Pardon?
hmmm... it works ?
What you wrote? No, that's broken on three different levels.
what difference in this
RHS_LOADED = __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
vs
#define RHS_LOADED __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
The first one works, though is kind of pointless, while the second one is just broken.
The other issue with your original macros is, that include is evaluated first when preprocessing the file, regardless of any ifdefs.
And that ifdef check wheter or not a macro is defined. Not if it evaluates to a boolean - those don't exist at preprocessing time anyway.
Doesn't seem like you understand the preprocessor.
#define - define keyword and assign definition to it, correct ?
Yeah, potentially with arguments.
well... maybe i missed something... still don't get what the problem there
What you're doing doesn't work, because none of what you assume how it works, actually works like that.
__EVAL only works for assigning a config entry.
And it's so limited that it currently only works for STRING and NUMBER, not even ARRAY.
ifdef and infdef check if a macro is defined, not wheter or not it would be true or false.
And the conditional include doesn't work together with the #include command, though I'm not entirely sure for the technical reason atm.
that why i'm asking about how to mix it with params, where you have to define it
What you're attempting to do is not possible.
commy2: If what you wrote were possible, there would be no need for x_compat_ace addons etc.
Why tho? Just make all configs and adjust your scripts accordingly instead.
Not like you're losing anything. The people that would've reason to be sad are the one writing the mods.
yeah sure, that is np at all, was just looking for ez way... ๐
"The westward road seems easiest. Therefore it must be shunned."
what is "BIS_variable" described in https://community.bistudio.com/wiki/BIS_fnc_loop examples
//Hints time every frame after BIS_variable is assigned ["itemAdd", ["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }]] call BIS_fnc_loop;
Arbitrary global variable.
just found out, that i have couple new reflexes after tonks release, i can really fast close popup messages with random errors and whenever vscode is opened, i do instant last rpt check... even if that wasn't needed or logs disabled...
What do you mean
do you know that popup message (afaik that is bis_fnc_guiMessage) with errors like No entry 'bin\config.bin/... ? when you have to press close button ? that is the first thing what i have to do in one mission... i just keep practicing, some addons outdated after tonks and i think i will have time to master that skill even more. ๐
Anyone know how to get gravity to not exist or turn you into a solid rocket booster when you put a Gatling gun on a static mg using addWeaponTurret?
Btw I'm new to the scripting scene so dumb it down for me maybe? :/
Kim Jong Un, rockets, hmmโฆ ๐ค
no gravity setting, reality for you.
setVelocity exists though. What do you want to accomplish?
Like when you fire the Gatling gun it sends you to space
Don't want that to happen xD
I just want it to stay where it has been placed
what gatling gun?
When you add it onto a vehicle or emplacement using addWeaponTurret
I put it on a static mg
you could create an empty helipad, place it where you want the gatling to be then in its init field do
if (isServer) then { myMG attachTo [this, [0,0,0]];
also setMass maybe
also please provide all useful information about what you do; which "gatling", which MG, what script command, how who why?
Yeah new to this stuff but I can't remember of the top of my head but it was one of them raised static turrets that you assemble like it's from ikea
I put the a 10 Gatling gun on it using addWeaponTurret
What's the purpose of that empty helipad?
addWeaponTurret + "Gatling_30mm_Plane_CAS_01_F" , right?
addWeapon alone may work though, as there is only one turret
the empty helipad would be an invisible lock point, attachTo would make it immovable
โ faster with setMass
https://community.bistudio.com/wiki/setMass
"argument must be local" means you should execute it on server if the turret is empty
or simply put in the init field
if (local this) then { this setMass 10000; };
does negative work? ๐
please!
not even 0, or 0.001? ๐ข
weeeeeeeee
so anything* > 0
guys, how to say "wait until this var is defined"
i'm using SQF waitUntil { !isNull myVar }:
waitUntil {!isNil โmyVarโ}
but the var it's a boolean and then it says that it's wrong
umm ok, will try like that
Or waitUntil {!isNil {namespace getVariable โmyVarโ}}
btw, i'm defining this var in client side
but i want hook this var to server, i'm using publicVariableServer "myVar"
it's that correct?
If you wait for remote var, you can use addPublicVariableEventHandler
will check it out, thx
G'day boys, just wondering if you can tell me how to add a texture to a button for a dialog, been searching the interwebs left right and center. Ta.
@tough abyss you can use shortcutbutton: https://community.bistudio.com/wiki/DialogControls-Buttons#CT_SHORTCUTBUTTON.3D16
Hey mate, I have actually tried that already, however my configuration must be wrong. Mind if I send you the code?
@tough abyss i canโt check it now
Ahh no worries, when you're free I'd much appreciate it. Here is a hastebin anyway, cheers. https://hastebin.com/ubitebevey.swift
@meager heart the addAction page is not new. It didn't get remade ^^ Only the warning messages have a new style if you mean that. And that's everywhere on biki.
he he
`[]spawn {
while {true} do {
car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];
sleep 0.4;
car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];
sleep 0.4;
car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];
sleep 0.4;
car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];
sleep 0.4;
};
};`
What am I doing wrong here
car1 is the car the person is hooting from
Boat1m is the boat that needs to be shot
The person in car1 shoots but it doesnt aim on the target
Use two sets of ``` so we can read it properly
doFire?
It does fire
But it doesnt aim
This exact same script worked in another mission to
so something else breaks it ยฏ_(ใ)_/ยฏ
I assume so I am going to check that other mission
I'm 100% sure that someone told you yesterday why that happens and how to fix it
when you asked the exact same question yesterday
No
try in an empty editor ; if it works there, then something else breaks it (or maybe shooter doesn't knowsAbout the target
I asked how to switch to launcer
Yes I used the same script from sunday
But the stuff that the others told you will fix it. Is not in your script
Mite I add, never use while {true} do {}
Always add an exit condition
I am tired of this arma coding stuff i am gonne use unit capture
but i am the most tired of stupid installers installing anti virus software which is crashing arma
๐
@winter rose My life in one sentence
Kind of an niche question, I am replacing the text of a control that has a black and white image by default. I am trying to change it to a color image, but they are displayed in gray scale. Any one know how I could get it to display in color?
is your paa in multiple of 2 format?
Using the exact same path for the mod.cpp logo, it's color in the menu, black and white on the controls ๐
๐คฆ
_control ctrlSetTextColor [1, 1, 1, 1];
Have to do that for each control
Maybe the control class has a different color set in config, @fringe yoke ?
That's what I eventually found yeah
Ah :~)
anyone know here to find sound clases like "Alarm" ?
ok, let me see
Anyone knows how I can retrieve a full list of arma 3 functions ingame, with categories etc?
Nevermind, it was too obvious...CfgFunctions
Why did you even assume something like this existed while not knowing about CfgFunctions?
Anyone ever made a zombie script here?
Or any ideas how to make zombies in a decent way?
Issues I've seen with the ones out there right now are like, they walk through walls and are stupid and fail at navigating buildings. Would there be a way of getting around that?
Trolling level: 0 bytes
ah crap XD
The guy that makes the Linter wanted this half a year or so ago.. I know it's a little late... But I just got back into the mood to dev on my debugger. If anyone has contact to him give him this pls.
@little eagle I know about CfgFunctions, but didn't think of it.
Brainfart.
Eh. Just recreating it? I don't se why not? Or are you talking about setOwner ??
setOwner
according to the wiki it seems like it may just be from server to client. Not sure tho
this command should not be used to transfer ownership of units with AI (agentsare an exception to this rule). Using command in an unintended way will display an on-screen warning and log a message to .rptย
Yeh it's a server only command
Say I wanted a sound to play when a player dies on my server, what would I do? I've been playing around with onPlayerKilled and I can't seem to get it to work.
Any player or the local player?
Local would mean it would only play to the character killed, correct?
The local player is the avatar you're controlling yourself on your machine.
Remote players would be those playing on the same server as you.
// initPlayerLocal.sqf
params ["_unit"];
_unit addEventHandler ["Killed", {
params ["_unit"];
private _name = name _unit;
[_name, {
params ["_name"];
playSound "Alarm";
systemChat format ["%1 died!", _name];
}] remoteExec ["call"];
}];
This is what I'd do... probably.
Don't see why. You probably made a mistake.
I just copypasta'd that into initPlayerLocal.sqf
In the editor?
event script. initPlayerLocal doesn't exist as a field in eden
In the mission file
only init
Well, you need to save the mission and start it in MP as well.
Also, idk anything about that mission. Maybe it has things disabled or a script error in a previous script preventing this one from being executed. Hard to tell.
There's RPT files for this.
Maybe typo.
anyone else had issues with text not scaling correctly with interface size ?
size and sizeEx config entry, depending on STRING vs. TEXT.
I have tried safeZone but doesnt seem to work for me.
What exactly is the problem?
I'm fixing up Drongos Artillery script and one of the issues is script making the gunner fire before he aims the gun. The thing is there is a sleep that was supposed to let him enough time to aim the gun, but there are instances when the sleep time is not enough. So instead of a waiting for a specified amount of time I would rather check if the gunner is looking at a specified point in space.
Currently the script tells the gunner to aim at a specific point using this code:
(gunner _tube) doWatch [_x,_y,_z];```
Now I would need a waituntil or something similar that checks if the gunner is actually aiming/watching that specific point in space, if not then wait a second then check again.
However I'm not exactly sure how to check if the gunner is looking at that point in space.
I would like to note that the [_x,_y,_z]; position is actually working perfectly fine, and once the gunner does manage aim the gun properly at it the shells fall where they are supposed to.
You could do something like this.
_aimPos = [_x,_y,_z];
waitUntil {
_wepDir = _tube weaponDirection (currentWeapon _tube);
_azimuth = (_wepDir # 0) atan2 (_wepDir # 1);
if (_azimuth < 0) then
{
_azimuth = _azimuth + 360;
};
_elevation = acos (_wepDir # 2);
(((round _azimuth) == (round (_tube getDir _aimPos))) && (_elevation < 45))
};
It waits until the gun is pointing in the right direction (horizontally) and has more than a 45ยฐ vertical aim. You could try to work out what the correct elevation needs to be and use that instead of the hard 45.
Never mind, the script does not work with MLRS artillery for some reason. I think I will pass on fixing it.
Incidentally, does anyone know any good addon that lets you call in artillery and air support from using any assets placed in the mission?
There waas that post killzonekid made
Where he showed how he can script a join into a different server.
Wouldn't it be cool if there was a scripted matchmaking system or a join with friends?
need steam api extension, but I guess it would be possible.
ESL Versus 5v5 competitive Altis life ยฉ
Sponsored by KECAL (or how that skype version was called in laws of war ๐)
@gleaming oyster Why steam?
Nah not for 5v5. Just I think it would be nice to be able to join a server with multiple people at once (party leader chooses server or match making)
nvmnd. Misread
maybe it would be nice option to have for the new guys, but afaik your "party with friends platform" is team speak atm (maybe discord in a future) ๐คท
just as "extra option", sure it sounds nice
mhm
Yeah, I wouldn't wanna go and try to join a public server with my friends if it's nearly full
What if someone can't get in. Has to wait for like 10 minutes
And people just wanna get in and play the game
anyone know a way to set the direction/elevation of an empty artillery vehicles turret on mission start?
G'day, anybody know why this is happening: Here is what I am trying to achieve https://gyazo.com/e6557438aaa27d0e0106a8b07416f2d7, versus what appears in game - https://gyazo.com/ead3b9d0d9e640aaf85e0baddf2e0b18. I have played around a lot, but can't seem to get it to show properly. Cheers.
Dimensions are also valid.
Just link the images normally please.
I didn't think it would obscure the hyperlink aha. My bad.
the button on bottom right is wrong?
I'd say use pixelGrid.. I don't do UI stuff... ^^
Yes the texture is not appearing, all button functions work, and call the correct things, however the blue button does not appear in game.
is the button clickable and no texture is on it, or just no button at all like it never existed?
Button is clickable, however there is no texture
I have tried making it a background control, still no hope
May I post the code for the button?
try leaving colorText and background color out of the button config
That is for the button though isn't it? if it isn't transparent then it will cover where the texture should be?
@peak plover thanks
I guess the texture is also made transparent. Thus the button is invisible
Thats the wierd thing, because the screen has the same characteristics, and is visible, so i just copied the same properties to the button picture, assuming it would work
or maybe the button is behind the screen
Hmm Ill remove the screen and see
^^ without screen^^
Woah ok... I think I have found a breakthrough...
^^ replaced the directory to another texture to suss it out^^
Ahh wow I am so confused rn
FIXED, the bit-depth was invalid. yikes
Is it possible to add the engineer/medic skill to a unit why in mission via script?
guys, any place wher i get info about those settings:
sceneComplexity=40000;
shadowZDistance=100;
viewDistance=1000;
preferredObjectViewDistance=800;
terrainGrid=25;
volumeCD=10;
volumeFX=10;
volumeSpeech=10;
volumeVoN=10;
vonRecThreshold=0.029999999;
If biki then biki else common sense else no
Like.. All besides sceneComplexity are clear to me.
Well and terrainGrid. I know what it is but not the possible values. But I have seen them on biki before
but, it i set those to the server, iex: viewDistance= 1k the player will have only 1k of vd? no matter his own config?
or how it does work?
I think the server only defines the max
And most of these settings don't apply to server at all
that's why i'm looking for infos, there is nothing about those in the wiki
change first person camera fov with a script
oof...
Or move the third person camera extcampos
I don't know a way.... A easy battleye proof way to do that.
But can in theory intercept do that? ๐ค
in theory a extension can do that
in theory a extension could turn Arma into Battlefield 5 running on a quantum computer
It's quite stupid 'tho. I can set my FOV in the profile file to like 30 and literally every scope and even ironsights are equivalent to normal sniper scopes
I thought I had fixed it, but the texture still won't show :/ anyone have ideas?
sceneComplexity < that is max number of the polygons in the scene mixed with object details ? (never saw any official info about it)
๐
thank you ๐
is possible to set interface size with script?
Nay
Yes.. Theoretically. But no you almost definetly don't want to do that
thanks
allowFunctionsRecompile = 1;
This flag set to 1 should allow me to overwrite functions that have already been defined right?
https://community.bistudio.com/wiki/Description.ext#allowFunctionsRecompile
It does not seem to allow me to do that. Tested on Dedicated and in SP Editor.
Setting it to 0 seems to work....
1: compile, 0 (default): compileFinal (copy from ui namespace)
The flag has a poor name. It actually just disables the functions cache.
Huh..
0 is acting like 1. And if I dont put this flag in my description then I can recompile whatever I want
From initFunctions.sqf:
//--- Allow recompile in dev version, in the editor and when description.ext contains 'allowFunctionsRecompile = 1;'
_compileFinal =
//--- Dev version
!cheatsEnabled
&&
//--- Editor mission
((uinamespace getvariable ["gui_displays",[]]) find (finddisplay 26) != 1)
&&
//--- Manual toggle
getnumber (missionconfigfile >> "allowFunctionsRecompile") == 0;
0 is not acting like 1.
Maybe 0 is acting like you imagined 1 would act, but they certainly are different.
surely by default I should not be allowed to recompile functions. Isn't that what the security feature is?
shouldn't the 0 in the code you posted be 1?
and when description.ext contains 'allowFunctionsRecompile = 1;'
"allowFunctionsRecompile") == 0;
It's not a security feature. The functions cache is always protected from recompiling. This just controls whether you copy the protected values from the cache generated at game boot, or recompile them every mission start, which takes a long ass time.
Does the Hit event handle returns a _source when its a other player and MPHit fire 2 times on the host pc and the people that did the causedBy?
Anyone know the marker name of the parachute? https://gyazo.com/a7e57ae871bc81eae2d467e8914f1c87
Isn't listed under https://community.bistudio.com/wiki/cfgMarkers
Isn't it an icon, instead of a marker?
โ ui_f_data\Map\VehicleIcons\iconParachute_ca.paa โ there
Oh, so #particlesource cant recieve a setVariable
Anybody working on a dynamic repair script with the new tank parts? ๐
Is there a simple way to get the clients SystemTime?
@winter rose Come on wiki man.
Returns time elapsed since mission started (in seconds). The value is different on each client. If you need unified time, use serverTime.
I read it, but I also read from serverTime
I had hoped it didn't JIP, and time would have been a good workaround
@willow rover you could store serverTime locally on start/connect, then substract it from serverTime when you want to know.
okay
What is "system time" supposed to be? The time of day? Then the answer is not without a all extension.
Btw I heard lots of people complain about SQF scheduler race conditions that it could suspend in the middle of a statement. It actually can't. Scheduled scripts only suspend at end of statement.
meaning missionNamespace setVariable ["var", player getVariable "var2"] is race condition free
I never really believed that (the scheduler stops mid statement). Though still plenty of possibilities for race conditions between statements.
would wrapping everthingy in a "call { .. };" prevent suspension then? ๐ค
maybe this is what they referred to if the answer is no
No, not at all. isNil {...} will though.
_unit call {
private _damage = damage _unit + (...Cool computation);
_unit setDamage _damage;
};```
^ Race condition if not run in unscheduled
no. Because there are multiple statements inside the call
If it does the first line and then another script edits damage, it will race
but for example
_unit setDamage damage _unit + (...Cool computation);
won't. Unless cool computation is a function call or smth
I wanted to try if I can make SQF faster by replacing the vtable based interpreter by a switch statement based one...
Literally.. All my scripts run 2x as fast now. I only changed 10 lines in the interpreter... BI.. pls.
Can someone please verify this? I cannot really believe that..
Profile some script in Arma's debug console and note the runtimes.
Then load my mod and do the same again. Does the script indeed run faster?
Only x64 and without battleye.
https://github.com/dedmen/Intercept_FastScript/releases/download/0.1/dedmen_fastscript.zip
no
just whatever script
it only optimizes the instructions not the commands. So stuff like nearestObjects will still be slow.
So the bigger your script is the bigger the impact I'd say
@still forum
Btw I heard lots of people complain about SQF scheduler race conditions that it could suspend in the middle of a statement. It actually can't. Scheduled scripts only suspend at end of statement.
The solution is clear:
Mass replace every semi colon with a comma.
Does comma end a statement as far as the scheduler is concerned?
Well, mass replace it is then.
but it pushes the return values onto the stack so you have to be careful not to cause a stack overflow
whoop whoop
Don't start a MP mission with that fastScript mod... Or I think editorPreview might be bad too.
I think I broke something and waitUntil is now executing in unscheduled...
You didn't break anything, you fixed it.
Always knew the scheduler is why sqf is so slow, thanks for confirming it, kappa
I didn't confirm that though ^^
Last word.
; > .,
my scheduler specific optimization only got a about 10% speed increase
Which is also a simple 2 line fix btw...
You could've instead also invented another non standard script language for the game tho.
Hey guys so i have a question?
I'm working on a tanoa server and i noticed that the repair script isn't working when i try repair the vehicle when it is damaged, like for example the vehicle repair wont allow you to click it.
Does anyone know how to fix it?
@still forum I can gib a go
and the unflip is also playing up as it only wants to work with some people
@pine leaf Give context. What repair script?? Clicking on the vehicle? None of what you have said makes sense to those who are not insiders
So when I click windows key a interaction menu pops up saying if I want to repair or unflip
we can't help you without seeing the code
Oh god. So it's lifer code. ๐
But you now have had two questions asked, but nothing to show for. Post the code please.
@pine leaf just hire someone #creators_recruiting
@peak plover Just hire someone to do MORE LIFE?
It's like an endless line of crap that gets shoveled out every week
there's no money to make in there and only endless amounts of pain
yeah. That's what I said not to do before ^^
ohh. Didn't see
I don't know why yet.. I think I moved a waitUntil into unscheduled
Have PiP stopped working on dialogs or something?
@peak plover any results? Editor debug console?
I got the freeze once but can't reproduce it anymore
Is there any resource for A3's CfgIdentities? In particular I would like to ge the Identity of Solomon Maru so I can use it in a Mission
Open ingame config viewer and look through CfgIdentities.
I can try again. But I didn't see any improvements when doing the test scenario in singleplayer (infantry)
all my slow scripts are in a mission
So I gotta load that
Thanks @errant jasper seems that I missed it while I was searching the viewer
found it now
you probably won't feel the improvement. But you can measure it
Yeah I was using the brofiler
brofiler makes the script slower again ^^
yeah. Works fine for me now ๐
Maybe I fixed it by accident and my newer build is just working
yeh, i crash on mission load
I've got a good script to test with a lot of iterations
v1
Result:
7839 ms
none
Result:
7914 ms
I'll try the updated one too
I only optimize instructons. Slow script commands are still slow
This has tons of loops
with
sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351)) * sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351))
I got 2x speed
๐
๐ฎ
insane
I'll test that too now
Result:
0.0039 ms
Cycles:
10000/10000
Code:
sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351)) * sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351))
jesus christ...
Depends on memory speed and CPU cache size.. So could be that your's are so good that the impact is too low
wow.. 0.0039.. With vanilla Arma that one is 0.015ms for me ๐
Vanilla, Modded. Why would that make a difference if you're comparing script speeds that don't need the mod as a resource?
Because the mod is a new VM interpreter
Ay
wut ur cpu nugel
4770k
Is there anything opposite to BIS_fnc_timeToString?
(_timeText splitString ':') apply {parseNumber _x} params [["_hour", 0], ["_minute", 0], ["_seconds", 0], ["_millis", 0]];```
Thanks but just was asking for BIS_ similar ๐
Result:
1032 ms
Cycles:
1/10000
Code:
_buildings = missionNamespace getVariable ['ten_buildings',nil];
if (isNil '_buildings') exitWith {};
{private _b = _x;({_x distance _b < 100} count _buildings) > 0} count _buildings
mod
Result:
1161 ms
Cycles:
1/10000
Code:
_buildings = missionNamespace getVariable ['ten_buildings',nil];
if (isNil '_buildings') exitWith {};
{private _b = _x;({_x distance _b < 100} count _buildings) > 0} count _buildings
๐ค
Wha
I don't get it
I guess it helps if calculating somethingg ?:
as I said. commands aren't faster. Only instructions are. The cheaper and the more cheap commands the bigger the impact
But if your CPU already has the vtables in it's cache the impact will be close to 0. I guess your CPU is just better than mine and already does the optimum
https://s.sqf.ovh/arma3_x64_2018-05-31_20-12-34.png Since when does Arma actually display what scripts are what in diag_captureFrame?
Wow.. That's a weird screenshot
๐ฎ
@still forum try ace arsenal loadout screen, the verifyLoadout func uses a shitload of expensive instructions
I can try loading a mission with the newer version
and by a shitload I mean a SHITLOAD
there are no "expensive instructions" atleast not at the point where I optimize
calling the instructions function takes the same time for all instructions
I wonder if profiling that func still crashes brofiler
it would spit out a 600MB file then crash whenever I tried to open it ๐
If that was before the duplicate string fix then that shouldn't crash anymore
I don't have that version ^
guys, how do you limit arsenal items?
like, i want only Unsung items in arsenal
but i wont write one by one all of them
@late gull You can use configs to determine them by DLC, types, parents... etc.
can u show me a example or something?
'yourCondition' configClasses(configFile >> "CfgWeapons");
so you can use get(Text|Array|Number) along with it.
hmm ok, will try it
'isClass _x && count getArray(_x >> "arraySometung") > 0)" configClasses(configFile >> "CfgWeapons");
like, i want only Unsung items in arsenal
but i wont write one by one all of them
BIS_fnc_addVirtualBackpackCargoBIS_fnc_addVirtualItemCargoBIS_fnc_addVirtualMagazineCargoBIS_fnc_addVirtualWeaponCargo
yes, but those u need add one on one xD
yes, getting these array in some way
We just explained this
_listOfWeapons = "yourConditionCheckUnsungModHere" configClasses(configFile >> "CfgWeapons") apply {configName _x};
souds great, but no idea how to filter that, the condition
how i do check that it's from unsung mod
i'm reading the whole weapon descriptin and i can't find something that show it's from unsung
or i dont know
You have _x magic var in a codition which represents current config according to a parent config.
In case mudnut stated it will lookup for every CfgWeapons sub-classes
configfile >> "CfgWeapons" >> "uns_20mm_Cannon_m24A1"
idk if u sayin the same
but should i look for every weapon that start's from uns_ ?
Yes.
ok, great, so there is a function like "startWith" ? xD
Or you can determine that by Author or whatever (cant remember if classes has an author entry in CfgWeapons)
startWith?
not author there
I think he wants to find class names starting with uns_
Which is simply:
"(_x find 'uns_') > -1 " configClasses(configFile >> "CfgWeapons") apply {configName _x};
or atleast that's what i see
_listOfWeapons = "(configName _x) find 'uns_' != -1" configClasses(configFile >> "CfgWeapons") apply {configName _x};
?
Hmmm
oh yeah configName _x since apply goes afterwards.
๐
u done that for me
i want to learn xD
apply {configName _x}
๐คท not understanding what is that doing
yeah, i surely, but it's hard sometimes when u dont speak English xD
but i think i get it
i think it's like: "if that condition are meet so take the config name _x" and _x contains the examined class
or something like that
If to explain it more explicitly:
private _UNSWeaponClasses = "(configName _x) find 'uns_' != -1" configClasses(configFile >> "CfgWeapons");
private _UNSWeaponClassnames = _UNSWeaponClasses apply {configName _x};
hmm it is
_haystack findIf {_x == _needle}
guys and where do i get
BIS_fnc_addVirtualBackpackCargo
BIS_fnc_addVirtualItemCargo
BackPackCargo and ItemCargo
ther is not cfg for those
oki, i mean CfgBackPackCargo or CfgItemCargo :p
that doesn't exist
Did anybody tried using serverCommand called #restartserver? Is it reliable?
I can't remember, though how is this #arma3_scripting ?
Because serverCommand is a scripted command.
@unborn ether Yeah should work
what would be the best way to disable some UAV AI's? In particular the ones from the Jet DLC's carrier the CIWS. Should I use disableAI or is there any better way? I have named them all and want to disable them and enable them manually
ok thanks
hmm tried with ```sqf
RIM7LB disableAI "AUTOTARGET"; RIM7LB disableAI "TARGET"; RIM7LB setCombatMode "BLUE";
RIM7RF disableAI "AUTOTARGET"; RIM7RF disableAI "TARGET"; RIM7RF setCombatMode "BLUE";
PhalanxRF disableAI "AUTOTARGET"; PhalanxRF disableAI "TARGET"; PhalanxRF setCombatMode "BLUE";
PhalanxLM disableAI "AUTOTARGET"; PhalanxLM disableAI "TARGET"; PhalanxLM setCombatMode "BLUE";
PhalanxCB disableAI "AUTOTARGET"; PhalanxCB disableAI "TARGET"; PhalanxCB setCombatMode "BLUE";
RIM116LF disableAI "AUTOTARGET"; RIM116LF disableAI "TARGET"; RIM116LF setCombatMode "BLUE";
RIM116RB disableAI "AUTOTARGET"; RIM116RB disableAI "TARGET"; RIM116RB setCombatMode "BLUE"; ``` but the CIWS are still shooting. Should I really use ``disableAI "ALL"`` ?
Hello all! I have a question thats probably an easy one. In arma you can set keybinds to Use Actions. How would I code something to where when a user clicks on their Use Action 4 it does something? Like for example systemChat "You clicked use action 4!". Also, is this possible to do with a server side mod and not have the client be required to install anything?
*Better worded as: When a user presses their Use Action 4 button.
Hey, has anyone any experience in regard to smooth camera movement using the UI Event Handler "MouseMoved"? The latter returns [<display>, <horizontal angular change (>0, if mouse moved rightwards)>, <vertical angular change (>0, if mouse moved downwards)>], which yields (those angles seem to be in degrees) [0,0,-1] and [-1,0,0] as rotational axes when using Euler's angles or Hamilton Number's (Quaternionic Transformation), which should transform the Camera's vectorDir and vectorUp according to User Mouse Input respectively. But this only works when looking at the horizontal/vertical Mouse Movement independently.
Because for whatever reason vectorDir and vectorUp seem to have redundant information to some degree. So vectorUp needs to be rotated horizontally, too, if Roll (Principal axes) isn't wished for (which makes it less easy, but makes somewhat sense). OK! No it get's a little ridiculous, because vectorDir alone doesn't seem to allow to set an objects Pitch (because setVectorDir ignores z-Values) it is, however, required to set the correct z-Value for vectorDir when wanting to alter an object's Pitch by setVectorUp, which is, obviously, neither reasonable nor makes it things any easier.
Has anybody here ever made any usefull things with setVectorDirAndUp and other commands of that ilk? Does the angle between vectorDir and vectorUp always have to be 90ยฐ? I'm kinda lost on this, because the maths aren't trivial when dealing with Quaternions (while they are avoiding any gimbal locks) and I don't know how A2 is handling those vectors.
if you haven't seen it yet https://community.bistudio.com/wiki/camCommand
Can I execute a script while in the editor to place objects?
Ok so how would you change the background color of something to red in gui editor? currently [-1,-1,-1,-1]
and also what on earth is active color?
Ok so how would you change the background color of something to red in gui editor? currently [-1,-1,-1,-1]
[R,G,B,A] - Red, Green, Blue, Alpha aka transparency ๐
[1,0,0,1]< ๐ด
ahh ok ty
and also what on earth is active color?
that is active color
(you will get it, just keep digging ๐)
into clipboard if you exporting, check this for more info https://community.bistudio.com/wiki/User_Interface_Editor_(Arma_3)
@icy light
ty!
does this remoteExec look wrong to anyone? I'm trying to make the say3D do this so I can get away with a random sfx.
[[_obj_eff,_StoneSFX, 500] remoteExec ["say3D"]]; //trying to make this
_emit say3D ["_StoneSFX", 500]; //do this but with the _StoneSFX
[<object>, [<soundName>, <maxDistance>, <soundPitch>]] remoteExec ["say3D"];
[<object>, [<soundName>, <maxDistance>]] remoteExec ["say3D"];
[<object>, <soundName>] remoteExec ["say3D"];
@tough abyss
TY gonna try that
glhf
@wheat geyser There is no MouseMoved eventhandler. There is MouseMoving though. MouseMoving does not report any angles, it reports cartesian coordinates.
vectorDir and vectorUp are not redundant, but they are always perpendicular. I made lots of useful things with setVectorDirAndUp. Yes, these vectors always have to be perpendicular. There're no quaternions in the game.
You sound confused.
Recently I've been using CBA's implementation of Rodriguez Rotation Formula to rotate vectors in 3d: https://github.com/CBATeam/CBA_A3/blob/master/addons/vectors/fnc_vectRotate3D.sqf
Using it to draw a scripted mildot reticle to help creating weapon optic reticles.
G'day, so... sqf { _x ctrlSetFade 1;//true _x ctrlCommit 2; } forEach
Seems to fade out of defined dialogs, however if I would want to fade in a certain button, image etc. what would I change?
1 to 0
Replace _x with the CONTROL you want to fade.
What you posted before is a loop, that does this "forEach" things. I guess things is an array of all controls of your display.
Yes, I have an array of controls that are defined with _display
Use setFade/commit on every one of them you want to hide or unhide.
It may get a bit wonky with controls groups controls, but otherwise it's pretty straight forward.
Hmm I think I am interpreting the function very wrong... I'd like to clarify something
{
_x ctrlSetFade 0;//true
_x ctrlCommit 2;
} forEach [_BACKGROUND, _KEYCHAIN];```
My interpretation is that it will fade in these controls
This will unhide the background and keychain in 2 seconds.
My interpretation is that it will fade in these controls
Yes.
Fading in control buttons doesn't seem to work, it only works with textures, yes?
I would need to ctrlShow the buttons
I never heard that it wouldn't work with every type of control.
Actually I just realised it kind of makes sense why, especially if you have transparent button, then there is no point
You hid the wrong control?
I'm not sure fading a (transparent) button would disable it. You can use ctrlEnable false to disable the button instead.
Though I have recently learned that fading a map control disables it's draw eventhandler. So there's that.
@umbral fiber https://community.bistudio.com/wiki/create3DENEntity
fading in vs, fading out must be different functions when applied to controls, because it only hides the controls by fading them
Transition delay is defined by ctrlCommit.
yep and that is fine, but All controls are shown regardless of being asked to being faded in, so it's as if they are fading in even though they begin 100% visible
^^ Not in general, this is just a problem I am having
Independent from Arma, I generally hate fading ui. It just slows me down using the ui as I'm waiting for pointless fading.
Even if the fading is very fast, it's just pointless. UI has to be functional.
True that, but depending on what you're making I think this view of yours could change
No, my views never change, because it's convenient to live that way. JK, but fading ui will always suck, because it objectively sucks.
can I PM you a video of what I made? Maybe you could better understand where I am coming from
Sure, but you'll have to wait 10 hours for me to check it out, because I g2g now.
No worries, catch you soon then
@little eagle Just imagine! Fading settings menu! How splendid it would be
๐ฉ
is A3DC still being updated? it lacks like 50 control attributes
Let's say for example, my onLoad of a dialog executes this function. That is supposed to show a background, then after 1 second, a button fades in.
Would this be accurate: ```sqf
_display = findDisplay blahblah dialog; //whole dialog file
_screenBackground = displayCtrl 1;
_screenButtonImage = display Ctrl 2;
}
ctrlShow [_x, true];
} forEach [_screenBackground];
uiSleep 1;
{
_x ctrlSetFade 0;
_x ctrlCommit 1;
} forEach [_screenButtonImage];```
Christ ๐
?
you have a syntax error. It won't work
but other than that.. And the missing privates it looks... still bullshit as the forEach is useless.. But other than that.... I guess.. It could be okey
In my script, there are lots of displays, and the forEach is long. I purposely chose to only include one in there to save you the cancer.
Yea my bad I typed that fast af
As a tip then. If there are more but you just deliberately make it shorter. Show that you made it shorter like [_screenBackground, ...]
Makes sense, will do. Cheers brother
Can you please take a look at my function? Doesn't seem to be working accurately, would be much appreciated
i'm try'ing make waitUntil {} in cicle, but getting error - suspending not allowed in this context
for "_i" from 0 to 10 step 1 do {
_loading_pb ctrlSetPosition [0,0,0,0.01];
_loading_pb ctrlCommit 0;
_loading_pb ctrlSetPosition [0.282,0.5544,0.428788,0.01];
_loading_pb ctrlCommit _time;
waitUntil {ctrlCommitted _loading_pb};
};
๐
Well. I guess.. Suspending is not allowed in that context....
you'll have to use spawn.. Which is looots of fun with dialog/control type variables
fading in controls replaces the need to ctrlShow them right?
I'm trying to open a dialog, showing the frame, waiting one second, then fading in the controls. But nothing works.
can i send you the script
I don't do UI scripting. So if it's a problem with the used UI commands I probably can't help you
its more just getting the bloody things to appear hehe, https://hastebin.com/uzerefuqoj.makefile
I don't understand..
you are using control ctrlSetFade x but then again ctrlShow [idc, x]
why are you mixing variants?
the ctrlShow [_x, true] just enables the buttons, not the images
I realise I should probably use ctrlEnable instead
yeah.. But why are you using the IDC variant instead of the control one? While you already use the control variant elsewhere
@still forum ty
Wait a minute, the control variants arent defined for the buttons
only for the images
did you mean that it should be forEach [_settings instead of forEach [4234234 for example?
you wouldn't believe me if i told u....
this whole time onLoad has been empty "";
fuck
my
lif
I'm actually speechless
@tough abyss you trying something like this?
{_x ctrlShow false;} forEach [ctrl1,ctrl2,ctrl3...];
do I need to hide the controls prior to fading them in? Or can I just fade them in?
So I can just _x ctrlShow false; everything on dialog open, and then just fade in the controls needed?
For example, https://hastebin.com/ceyaxoqime.makefile this does not hide everything, yet I do get the hint
@tough abyss ```sqf
{
_x ctrlShow false;
} forEach [_backgroundIMAGE,_borderScreenIMAGE,_whiteBackgroundIMAGE,_batteryInfoIMAGE,_keyChainIMAGE,_messagesIMAGE,_gangIMAGE,_playerInventoryIMAGE,_licensesIMAGE,_adminIMAGE,_syncIMAGE...];
@tough abyss if you need just hide all controls - you can use https://community.bistudio.com/wiki/allControls
something like this sqf _allCtrls = allControls findDisplay 16999; {_x ctrlShow false;} forEach _allCtrls;
you need fadeOut?
or fadeIn
fadeIn: sqf _allCtrls = allControls findDisplay 16999; {_x ctrlSetFade 1; ctrlCommit 0;} forEach _allCtrls; {_x ctrlSetFade 0; ctrlCommit 3;} forEach _allCtrls;
not needed to hide
@tough abyss
oh I see, so if you fade them in, then it replaces the ctrlShow function
wouldn't you need a sleep between fading out and in?
oh wait it does the first function first
nvm
hmm I used your code but every control just shows up anyway with no fade
_allCtrls = allControls findDisplay 16999;
{
_x ctrlSetFade 1;
_x ctrlCommit 0;
} forEach _allCtrls;
sleep 1;
{
_x ctrlSetFade 1;
_x ctrlCommit 3;
} forEach _allCtrls;
yes
oh I think the second sqf _x ctrlSetFade 1; needs to be sqf _x ctrlSetFade 0;
since it is fading in
i now realise you said that in the first place
lmao
anybody know what command used in laws of war for opening the ann webpage?
hmm still opens every control without fade
Even if I literally just have sqf _allCtrls = allControls findDisplay 16999; {_x ctrlShow false;} forEach _allCtrls; nothing hides
and the function is being executed, because I am getting the hint
display number 16999 is also correct
systemChat str (findDisplay 1699);
systemChat str _allCtrls;
โ debug pls ^_^