#arma3_scripting
1 messages Β· Page 423 of 1
there are none
Solved my own problem. Forgot one of my favorite loops; Check = time, then run the loop when check < time, and at the end check=time+1.
because literally all of them are either outdated or contain wrong info
Turned a bogged down script into three lines in two triggers.
i think gui editor in debug console can export UI templates?
@tender fossil yes
or better: you use tools as for most UI related stuff you do not need specialized UI elements anyways
@still forum I asked it once before and got no answer, that's why I'm asking again
So I should learn the basics from VBS wiki and then just start building stuff with GUI editor?
as such available are the one i provided (which i would not recommend simply because it is buggy and not supported anymore) https://forums.bohemia.net/forums/topic/191187-alpha-arma-ui-editor-the-future-of-ui-editing-in-arma
or the one k-town created https://forums.bohemia.net/forums/topic/190427-arma-intellij-plugin-smart-editing-for-header-and-sqf-files/ though ... i am not sure if it is a separate plugin or was in that intellij sqf plugin of his
no, you should learn to use the tools you get provided by the community first
and only if you need to dive in deep, you shall utilize vbs wiki and biki
Alright
Thanks for the info π
So I shouldn't use the default A3 GUI editor but community tools instead?
yes
Oh, I see
the default ui editor is community made too btw
Also check Karel Moricky Template: UI Controls... in workshop
Thanks for the tip @meager heart π
Is there a way to force the player to zoom in or out
Go to his house amd press his mouse buttons
maybe you can get distance from 2 points and if its not in the right range then do something to make him zoom
i recall long ago a served did camera distance player to if mission was being played in 3rd person , if so then the mission closed lol
well this case was if admins allowed 3rd π
Ah
inputAction "zoomOut" (zoomIn) ? don't know what are you doing... but maybe you can use it
also if that for your zeus thing there is curatorCamera
yep, that would be nice
could do so much more
sad_face.paa
ah, for fucks sake. thought i was being smart, but my idea doesnt work. damn, i'm pissy now.
the new keyframe animation system is great, but it could be even better..
Well don't be pissy
i spend lots of work on this
wanted to record a helicopter flight, but i am a really crappy pilot. so what do i do? i use the new keyframe system to plot the helicopter path. it looks really good. but now the problem: i can't just use that for what i need. the helicopter doesn't seem to be "a real object" or something. particle effects don't travel with it, attached objects remain at the original position, etc..... So then i tried being smart and wanted to record the path of the keyframed object.... but instead of recording the objects movement, it just recorded its original position. e.g. as if it doesn't move at all.
now the question is, how do i get this data.
traditionally it's always been BIS_fnc_unitCapture
yes of course, but like i said, it doesn't work in this case
apparently from a mechanic kind of view, the helicopter never moves.
i know unitcapture and i used it more than once already
please read again, i know this.
I dont think those work at all with the new keyframe system
using unitCapture means i'll have to fly the helicopter on my own, which is not something that gives me great results.
i want to use it, i just dont want to fly the helicopter on my own.
if you are having problems with keyframe
that's why i used the keyframe system: to have it fly in the path i need
it's annoying, because it would solve plenty problems
i mean, in the end of it... the object is moving, so there must be something that you can fetch the coordinates from, no?
breathe?
I like the new key frame system, especially for camera work, but it definitely has some oddities about it.
hmm. getpos does recognize the objects shift in position. it seems unitcapture is not working with it.
@west grove are you confused as to how to grab a position of a vehicle?
getPosATL _veh;
no π
getPos is going to run once when not in a loop
ok, again. this is what i do: setup keyframe animation. have it start. once started, i record the units movement. once done, i save it and later do UnitPlay
it's not going to ever change unless it's updated
@west grove im sure this means you cant use unitCapture on keyframed objects
yes, that's why i hoped someone in here knows a solution :p
flying by myself is not a solution :>
then there is none
already asked, as always nobody is out to help
Then there is no solution.
if you dont do shit on your own, nothing gets done. it's how it is.
Then you're outta luck.
do you have asthma by chance? you're writing about breathing so often.
not that i know of
I'm having an issue loading a player's inventory from a database using sqf getUnitLoadout player It's saving the array as a VARCHAR and when I try to select it back from the database I end up with this error: Error in expression <[1,[["[["arifle_MX_ACO_pointer_F","","acc_pointer> Error position: <arifle_MX_ACO_pointer_F","","acc_pointer> Error Missing ] Been trying a lot of things for the last few days and would appreciate if anyone has some ideas
its getting cutoff, either varchar size is to short (use TEXT) or you are using format in sqf which has 8k limit
Can u pastebin the rpt output, looks odd i.e quotations are off
sure, one sec
extDB2/3 using SQL Protocol ? Use TEXT for storing arrays, VAR Char is wrapped in quotations (legacy thing)
ok, I'll switch to text, and yes extdb3 using sql
Its legacy thing from life, VARCHAR is for strings, TEXT is for arrays etc (arrays are normally longer aswell). https://bitbucket.org/torndeco/extdb3/wiki/extDB3 - SQL
If you need more control, use SQL_CUSTOM (abit more complicated since you predefine everything in a ini file).
Yeah that was the problem, switching to TEXT had the desired effect, thanks.
so using createvehicle,is there away to position a vic relative to say a certain player, like use that players cordinate system rather then the globla cordinate system?
so like +Y would be direct front
and +X would be direct right
What im tryna do is
spawn several smoke grenades in a line infront of the player
and what I have sofar is this
removeAllActions _this;
_this addAction ["<t color='#A668C2'>Smokey</t>",
{
for [{_j=0}, {_j<25}, {_j=_j+5}] do
{
comment "front";
_frag_grenade = createvehicle ["smokeshellpurple",((position (_this select 0)) vectorAdd [((vectordir ((_this select 0))) select 1)*-_i,((vectordir ((_this select 0))) select 0)*-_j,0]),[],0,"none"];
};
hint format["%1",time];
},[1],0,false,true,"User16"," driver _target == _this"];
``` however it spawns the grenades infront,which is good,but at a slight angle about 10 degrees right
Use:
origin getPos [distance, heading]
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
ah thx
Is there a way to allow players to wear offside uniforms?
Or hell, just civilian clothes?
forceAddUniform ?
maybe fixed now
works https://gyazo.com/feb22247b27ef1649262b35097f14bbe
player forceAddUniform (uniform cursortarget);
player addVest (vest cursorTarget);
@manic sigil It's just a bit of config work. Take a look at www.armaholic.com/page.php?id=25418 as example.
Only the unlocked_uniforms.pbo is interesting for you
Thats is so old by now itll be missing a ton of stuff
Hello guys. I use task force on my server. When the player leave the server, I would like to save the frequency he sets on his radio on my database. Then when he will reconnect, I want the frequency to be set again automatically on his radio. Is there an existing function thatβs set a frequency on radios ? Thanks
What is task force?
Task force radio is a mod that use team speak to simulate voices in game
Task Force Arrowhead Radio aka TFAR.
Not task force
yeah there is a function to set radio frequency
This is what I just wrote lol
Did you use that function before ?
Even has a example
Thanks for the link π
I might have come into contact with that function before yes.
Also there is a function to GET the actual frequencies used by the players ?
How about you use CTRL+F
The set function is TFAR_fnc_setSwFrequency I give you one chance to guess the name of the get function.
im having trouble keep lock on a laser object moving +100km, would this be a reveal issue? do laser objects need more than just LOS to keep player lock?
in other words how do you keep lock on a laser object regardless of conditions? LOS, speed, weather, etc.
What vehicle are you in
player trying to lock with vanilla titan
while my remote desig is tracking a target
I'm unsure if the titan can actually lock to laser designated targets.
I know the titan is laser guided so you can actually move and follow the target and the missile will track ur movement.
it can but for arguments sake lets just use whatever valid laser lockable
doesnt have to be titan lets call it a GBU
Are you certain ur lock target keys are setup corrrectly, i have trouble locking onto anything in an aircraft due to that.
reveal target
so i should loop
_target = laserTarget _remoteDesignatorObj;
player reveal _target
like that?
Good question, looking into it.
ive already given up trying to order the AI it turn on the laser themselves
guess this is why everyone just creates fake laser objects out of nowhere
nice catch dom thanks
is it too late to PV a variable for debrief with a MEH βEndedβ?
Yeah, I had issues with that. I think it worked 1/10 times for me
If you use BIS_fnc_endMission
Do it before that, because endMission has that animation/music/screen
ye got a wrapper atm
How is ListNBox column sorting handled? Do I need to do something with scripting commands or something because right now im doing it like ive seen, where people have 1 ListNBox as the filter/header, and another for the actual items that are contained in it.
For some reason mine isnt showing any sorting arrows or anything, just the names of each column.
@austere granite Do you know what class the Eden GUI uses in place of RscControlsTable? I cant find it
From what I can see, they just use ListNBoxes, 1 for the filter (columns), and 1 for the actual content
Why all want sorting in the listbox? Sort stuff before adding it and all problems are solved
@queen cargo https://i.imgur.com/wJXmEwx.jpg This is all I want, just the way Eden editor does it. You can sort columns alphabetically and what not.
those are listboxes or listnboxes and they use lb / lnbSort
class Filter: ctrlListNBox
{
idc = 107;
@lone glade Yeah I thought so, I've got a dialog all set up and code for adding items to it, but I thought the sorting functionality was default functionality? I can see the columns, but theres no sort arrows or anything
that's a ctrlCombo that runs code when you change it
I have a similar setup for ACE Arsenal
oh right, I also forgot, you can set hidden values and sort by them too using lnbSortByValue
that's how I do "sort by amount" (or is it for by weight... can't remember)
@lone glade So this replicates the same behavior as the sorting arrows I showed in the link I put just before? Just confused because in the Eden dialog files I only see the 2 ListNBoxes, and no combo boxes or anything so I guess thats all done on the engine?
the sorting arrows sort by ascending descending but it's the same idea
just one more button and a bit different code
it's not done engine side, those buttons are controls, you just haven't found the one
they're just buttons with onButtonClick EHs that sort by ascending /descending based on which one you clicked
Ah okay, interesting. Just using Display3DENSave as a reference, and when I just saw the 2 listnboxes was just confused how it was producing the sorting functionality
Managed to get it working with a simple call to BIS_fnc_initListNBoxSorting
So there are lnbSort commands after all. Yesterday someone said there weren't any. lb only, not lnb.
They were confused, and I wasn't sure either if it exists. Not really a fan of lnb.
more columns
the black outline is stronger it seems
Consider following code:
[3,4] select 1 + 1
Will it return 4 or 5?
it will return nil since Arma starts arrays with index 0
+ has higher precedence than other binary commands
Oh right... Well the main question was whether + really has a higher precedence. I found that grammar too but I thought it might be an error
try it out and know for sure /shrug
But for that I had to start my other computer... So I was kinda hoping someone around here'd know the answer
it will never return 4, at least
Yeah that was an thinking error on my end π€·
Should have made it like this:
[3,7] select 0 + 1
But now I am really curious. I'm gonna fire up my other computer to test this π
Okay I just tested: Above code will return 7 which proves that + does have a higher precedence than select
@indigo snow
Plus has higher precendence as other binary commands.
[3,7] select 0 + 1
[3,7] select 1
7
This happens with all binary math commands essentially. + - * / ^ min max atan2 etc.
"all" assuming consistency is a thing in SQF.
Give me a counter example.
Well I guess the vector commands are one. They have normal binary precendence. The lowest.
tbh, I don't like operator precedence. I wish it was all left to right in math. So I'm fine with vectorAdd being the same as vectorMultiply. It pretty easy to work with.
Are there any other binary math operators than +, -, *, /, ^, %, mod, min, max, atan2?
Oops xD
I can't think of anything else. Oh else also has elevated precendce.
Also: What about random? It is listed as a math command but can be used as a binary command. Is it also treated differently from "normal" binary commands?
https://github.com/intercept/intercept/blob/master/src/client/intercept/client/sqf/uncategorized.cpp#L13-L17
ln log exp deg cos rad sin sqrt
Yeah the else-thing I know π
random is unary.
seed random x (Since Arma 3 v1.67.139663)```
https://gist.github.com/dedmen/2e37f5eaec28757f63738a3d48b26376 Here is a list of all commands and their priorities
Those all say bim 4
Oh, stuff like > < <= >= == and != have lower precence than binary commands.
Ah yeah... I thought they are ordered by precedence so I only scrolled through them
Also || or and and &&
I wonder if
ARRAY + ARRAY
has the same precedence as
NUMBER + NUMBER
First one isn't technically a math command.
What does "bim" stand for?
weeeelll, isn't array + array array append + copy?
binary math?
bimbam buhle
or bin mispelled
Ah.. yeah that could be
member getDammage? π
I always get confused on how to write damage because of that xD
@still forum in your list <= has a 3 while normal commands have a 4... But aren't all comparisons performed after the binary commands? π€
Yeah I know... But "special"
3 is lower priority. Which means they get executed "later"
Lower means done later, so where's the problem?
what else could they be ded?
Ah okay then I confused that xD
@lone glade special magic
Like sometimes I dream about variables and nular commands being seperate
That's kinda similear to that i guess
Ask again in a few weeks. π
comparisons being different to binary commands Β―_(γ)_/Β―
Sure hope so.
You should've sorted your list dedmen.
Just put it into notepad++ and press the sort button Β―_(γ)_/Β―
@still forum according to wikipedia the higher numbers are executed later. That's the way I have it in my parser as well which is why I got confused π
wikipedia has an article about things in the SQF engine implementation that are not publicly visible?
Bikipedia π
If you name everything bimmelbammel, you won't find it again in a few months.
I just look at the previews in my gist list
No of course not... But about the "normal" way to number these precedences ^^
But it shouldn't suprise me that SQF does it differently π€·
atan2 is weird being the same as multiplication etc.
is weird too, but I guess it's usefull.
I'm weird too, but I guess I'm also useful.
/ is also slower
Nah, it's 7 actually.
You should see the internal implementation of / vs >> ....
I want someone to confirm that NUMBER / NUMBER has the same precedence as CONFIG / STRING. Somehow I still doubt it.
ah yeah my code only shows first command with that name
indicates subentry with the left one being the parent and right one child.
1 x > meme arrow
2 x > config arrow
1 > is quote in most markdown implementations
GODDAMNIT I WANT A MARKDOWN STANDARD PLS
True, would be a lot easier to use everything without looking up small things they did differenetly
There is a difference between / and >> internally?!
will this script work?
_baditem = "Weapon_srifle_DMR" in "Weapon_srifle_DMR_04_Tan_F" ;
rgr, thx mate
only asked here because it would have been a bear to just quick test it.
@queen cargo Yes.
configFile >> "Cfg" + "Vehicles" // works
configFile / "Cfg" + "Vehicles" // ERROR
configFile / ("Cfg" + "Vehicles") // works
Because + has priority over >>, but not over /. Therefore the variant with / needs parenthesis.
>> prio 3
+ prio 6
/ prio 7
This is because + and / double as math commands.
I suggest always using >>.
where you checking priority for the operators, commy ?
thanks
i understand now where that confusion came from, about " config File / "Cfg".. is faster/better than config File >> "Cfg".." just priority difference
@little eagle Was talking about the implementation not the precedence
That's an important part of it, no?
no
that just means you have to be careful using it
just tells us that somebody was either lazy or thought "they are the same operators and thus should share the same precedence"
Β―_(γ)_/Β―
hi all, can someone tell me the proper syntax for using the ContainerClosed event handler on a container? i want to call a function when they leave the virtual arsenal
//--- Arsenal
[missionnamespace,"arsenalClosed", {/* your code */}] call bis_fnc_addScriptedEventhandler;
//--- Cargo container
_container addEventHandler ["ContainerClosed",{
params ["_container","_player"];
/* your code */
}];
@exotic tinsel
thanks so much mate
where should i put this? in the init of the arsenal? or can i put it in a file?
[missionnamespace,"arsenalClosed", {[player] call TLS_fnc_RoleItemRestrictions;}] call bis_fnc_addScriptedEventhandler;
@meager heart
player init scripts... initPlayerLocal.sqf
rgr rgr, thanks again mate @meager heart
np
@queen cargo / is also slower than >> If they were the same internally, they would be equal
that is what i was wondering
how do they differ?
it is not like there are many ways to traverse a tree
/ calls the >> implementation. Instead of them just using the >> implementation for both
If i execute this localy (via a addaction) https://community.bistudio.com/wiki/openMap will it execute for all players on the server or only the one? And if No is there a local one?
Roger thanks
still should be stated there
If I do this locally will it happen locally?
it doesn't need to be stated because it's obvious
What kinda question is that even
question was more about if the effects are local only
And if No is there a local one
No. A local player doesn't exist
non local ^
It's all an illusion
The command has local effects and ideally the wiki should say so. Even if it seems obvious.
Wiki page says so
sneaky breeky
cheeki breeki* https://www.youtube.com/watch?v=BnTW6fZz-1E
IV DAMKE
If i have a script and call a function in there that has a waitUntil the script is stopped until the function is done, isn Β΄t it?
depends if scheduled or not
it does not depends
call always will block
nah
no?
yes
it is a scheduled script.
No, call in scheduled is non blocking
in unscheduled you will get a script error and the script will abort
If you mean with "script" the code that contains the call No. That's not stopped
.... dude
Calling a function, calls the function and when it returns continues on
that's like the most basic programming thing.
The "script" is not stopped because there is no seperate script. It's all just one single script
yeah okay. but it waits for the function to return smth. So if the function needs 60 seconds due to waitUntil the code that called the function is waiting for 60 seconds for that return?
It's just one script.
the call is just an extra scope
1;
2;
3;
yes. The 3 doesn't execute before the 2
Which is what I guess you want to know?
If i have a script and call a function in there that has a waitUntil the script is stopped until the function is done, isn Β΄t it?
Yes.
Is there way to figure out the projectile, source... when a building is destroyed?
Just like HandleDamage EH when the unit is damaged, we can figure out the unit, hitSelection, source, projectile...etc from EH arguments.
What does this mean?
[1, 2] call {
if (!params ["_var1", "_var2", ["_var3", true, [true]]]) exitWith {
hint str [_var1, _var2, _var3];
};
};
especially that
["_var3", true, [true]]
It's a piece of script
look at what params returns
default value true and only allowed types are booleans
and so if the parameters passed are invalid according to params then it exits
That's what I understood
But regarding the piece of script I pasted under it
I just don't understand what's happening there / the syntax
["var3", true, [true]]
?
Just told you that
Puts the third parameter into _var3, verifies it's type, default value
heh
(once again)
So the last argument represents the data type, which is presented by an example of that data type?
So instead of writing something like [String] I make it clear by writing [""]
yea
check the wiki
and you can have several types
Ah, that makes sense
I'm just surprised that I rather give an example than include the actual data type (try to understand me, I'm moving from Java to Armaverse and its quirks) π
You didn't fully understand how SQF works then
Yup, trying to learn it
There are no static types
so there are also no names for these types that don't exist
well thereβs only typeName for that and it reports strings for everything
Ew, they used true as sample for BOOL instead of false.
I thought I'd add a data type listed here https://community.bistudio.com/wiki/Data_Types
Well, you thought wrong.
I see π
in SQF eh.. "things" can only be commands or variables
keyword!
Sometimes you are lucky and there exists a command that just returns the type
That's good to know
like true being a command returning a boolean that happens to be true
lol
technically, operator
nullary operator
but variables are no operators
and they are the same as a nullary operator
So what are both? keywords?
true is a nullary operator. It executes a function in the game
variables are not operators.
"things" can only be commands or variables
so.. operators can be variables?
or keywords can be operators or variables?
iβd say semantically an operator not technically ; )
I was talking about true or player or asfadasrfasf being either command or variable and nothing else.
I guess you can't call them operators because variables are not operators
Technically, yes. It is registered as a nullary operator in the game. Variables are not operators as they do not operate. Operators performs an operation, whether with operands or not.
true, false, player, pi are all nullary operators, not variables
diag_fps is also a nullary operator, but doesn't return the same value on every call
So... "keyword" would be correct then?
"keywords" can only be commands or variables
Or did you refer to like true being a command returning a boolean that happens to be true
I wouldn't call it that, since keyword has a special meaning
The only actual keyword is private
I was refering to command. They're technically operators
Ahh.. Yeah. Thought you were refering to the other message
I believe the wiki calls them commands.
A lot of people find SQF difficult to understand. I just think they don't realize it's purely an expression evaluator. If you know elementary algebra, more specifically, arithmetic, SQF is easy to learn.
But names don't matter. I dub them not-variables henceford.
It's true, SQF is more like LISP than like Python.
functional programming language
but it's harder to learn it that way I guess
SQF is easy to learn, if you realize it's purely operators and operands, and you can get your head around operators taking other data types than just numbers.
hey there, anyone know by any chance how to check if a mission has an ACE3 dependency via script? perhaps something like isNil (Alive_required) or something? Want to check to ACE3 exists before using a function that uses ACE3 functions
It's like the easiest thing ever if you understand the lowest level. But I guess that's hard to understand?
and you can get your head around operators taking other data types than just numbers
Ha, well, that's the core of the problem.
@tough abyss Search for ace. If you found one then it probably has a ace dependency
@fossil yew Well, not that hard if you understand what an operator is
{code}+{code}=?
can I do that per server-side script?
@fossil yew Invalid
@fossil yew {code}+{code}=bool
The operators has to support it.
that operator doesn't exist. but theoretically possible XD
And each one can have multiple arities
@tough abyss check CFG patches. Or just check for ACE_main variable not being nil
Eg. - is both a binary and unary operator, taking either 2 numbers, or one numbers.
But it also operates on arrays
I guess the simplest way to present the notion of other types to newbies is through an imaginary operator mixing colors
hahaha
eg. red + green = yellow
well, ok
(red + green) + blue = white
But then you also have to teach them how color mixing works
Not necessarily
how do I check with a script the content of CfgPatches? π€ @still forum the Wiki isn't very helpful on it
Most, if not all people know that colors mix. They don't need to know exactly how they mix.
@tough abyss https://community.bistudio.com/wiki/isClass
CfgPatches >> ACE_Main
marvelous! thanks @still forum
_ace_enabled = isClass (configFile >> "CfgPatches" >> "ACE_main"); let's see
Or
_ace_enabled = !isNil "ACE_main";
Too bad SQF doesn't support associativity
Makes the exponent operator return incorrect results
Dedmen, wouldn't that always return nil or is ACE_main defined somewhere?
Hm.
isn't ACE almost purely CBA settings right now?
Yes? Why?
by module he means PBOs
do you guys have the latest notepad++ plugin for SQF somewhere? I've tried from ACE but it lacks newer commands
oh
as in separate components
I thought map modules
Okey ace_main doesn't.
But ace_common does
https://github.com/acemod/ACE3/blob/master/addons/common/XEH_preInit.sqf#L46
Right there. Totally obvious!
ace_main is never defined, but ace_common is: https://github.com/acemod/ACE3/blob/master/addons/common/XEH_preInit.sqf#L46
Yep.
would it even return true if ACE is configured using purely CBA settings?
oh I wondered if that !isNil would still work if ACE3 was set up using only the mod on the server and CBA settings, i.e. no map modules
You just repeated yourself. And it's still not related to this
Sorry to bother again but can someone tell me why this is happening:
https://i.imgur.com/PLqauKB.jpg
missing bracket
Fml.
Other than that.. No I have absolutely no idea why that's not working
shouldn't it be switch(test)?
15 mins. And i didnt find a f**king bracket
missing };
You're missing a closing bracket, Silent.
after the switch
I think you are missing a squirly bracket
Yeah thanks guys. I think i missed a bracket there
you can do
switch _var do
just fine
i've done that mistake so many times I recognize it instantly π
You might be missing a bracket dere boi
start using tools for theese things @knotty mantle
inb4 sqf vm plug
Why not just post the code in discord next time?
Use proper indentation and you would've found it right away
I normally do. π¦
π
π°
I thought a switch needed a _var not a string? π€
Wat
hmm alright, must've mixed it up with another language then
Is there a benefit/point in structuring statements in this fashion vs. the other?
vehicle player == player && !isNull cursorObject && cursorObject distance player <= 5 && count (nearestObjects [player, ["landVehicle"], 5, true]) >= 1
{vehicle player == player && {!isNull cursorObject && {cursorObject distance player <= 5 && {count (nearestObjects [player, ["landVehicle"], 5, true]) >= 1}}}}
Does it process inwards out?
one doesn't use lazy eval the other does
For instance, if being checked frequently, does it exit if the inner most fails instead of evaluating all conditions?
yes. That's like.. the definition of lazy eval...
Never worked with it before, so I was simply curious
The most outer curly brackets are too much though. That makes the whole thing a code block that is never executed.
vehicle player == player && {!isNull cursorObject && {cursorObject distance player <= 5 && {count (nearestObjects [player, ["landVehicle"], 5, true]) >= 1}}}
Is the proper syntax.
So it will evaluate if any landvehicles are within 5m before trying everything else?
And if that fails, it doesn't evaluate all else?
No, left to right.
wha what about wrapping each of them in a block
Ok, So it would be evaluated last
true && cond1 // cond1 is evaluated
false && cond1 // cond1 is evaluated
true || cond1 // cond1 is evaluated
false || cond1 // cond1 is evaluated
true && {cond1} // cond1 is evaluated
false && {cond1} // cond1 is ignored
true || {cond1}// cond1 is ignored
false || {cond1} // cond1 is evaluated
if (condition1 || {condition2} || {condition3}) then {}; // condition3 is only evaluated if condition1 and condition2 are false
if (condition1 && {condition2} && {condition3}) then {}; // condition3 is only evaluated if condition1 and condition2 are true
Thank you, much appreciated for the examples π
For more than 2 boolean expressions,
cond1 && {cond2 && {cond3}}
is more effective.
That was the method I was using, it is for use in an addAction, so less calculations the better
(woops)
I wonder what you were trying to say.
Knowing you, you were about to appeal and disagree.
Newspaper? Who knows what was written on it
Nah, i actually wasn't going to say anything
[_veh, ["Instant Medical Attention", { player setDamage 0; if(_ace_enabled) then {[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;};}]] remoteExec ["addAction", -2, _veh];``` where _veh is an object on the map somewhere. I'm either using the wrong ACE heal functions or the code isn't executed clientside at all and _ace_enabled is `true`
hey commy, can I leave custom script profiler scopes with an ifdef for arsenal debugging?
#ifdef DEBUG_MODE_FULL
private _scopeHandleStats = createProfileScope "handle stats";
profilerTrigger;
#endIf
_ace_enabled is undefined.
you're not logged in on slack so i'm asking here
Sure, why not alganthe.
noice π
oh right that might be it
That IS it.
@lone glade Make a macro for create scope and trigger
_ace_enabled is known to server, you're right. Thanks @little eagle !
That way it can easilly be disabled seperatly. You might want debug mode without profiler
If heard the first time about lazy eval but basically i shoul rewrite this (({side _x == WEST} count (list _trigger) > {side _x == East} count (list _trigger)) && !_markerOccupiedByWest) to (!_markerOccupiedByWest && {({side _x == WEST} count (list _trigger) > {side _x == East} count (list _trigger))}) ?
true ded
@tough abyss You still don't understand. Local variables don't carry over into the scope of addAction, because it's a completely different script instance.
@knotty mantle Your brackets don't work.
Yeah just noticed.
I figured @little eagle, rewriting it now to determine the sent message server side
!_markerOccupiedByWest && {
{side _x == west} count list _trigger > {side _x == east} count list _trigger
}
There. All parenthesis deleted and now it works.
_ace_enabled = !isNil "ACE_common";
if(_ace_enabled) then {
_medical_attention = [_veh, ["Instant Medical Attention", {[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;}]];
} else { _medical_attention = [_veh, ["Instant Medical Attention", {player setDamage 0;}]]; };
_medical_attention remoteExec ["addAction", -2, _veh];``` reckon this would circumvent it?
( @little eagle )
I know :/
_ace_enabled = !isNil "ACE_common";
if(_ace_enabled) then {
_medical_attention = [_veh, ["Instant Medical Attention", {[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;}]];
} else {
_medical_attention = [_veh, ["Instant Medical Attention", {player setDamage 0;}]];
};``` better?
private _fnc_heal = {
player setDamage 0;
};
if (!isNil "ACE_medical") then {
_fnc_heal = {
[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
};
};
[_veh, ["Instant Medical Attention", _fnc_heal]] remoteExec ["addAction", 0, _veh];
There. Beauty.
climax material right there
Whatβs the most simple way to script in a runway? You can place helipads as objects... but runways are map objects, I wonder if we could get that functionality from a script
createSimpleObject ?
I think, airports, as they are called, are hard coded into the map and cannot be created by script.
airports are indeed hardcoded
This says something about dynamic airports, but only mentions the aircraft carriers.
In cup terrains couple runways
Dunno, haven't seen the video. But "dynamic airport" is what I'd look for if I wanted scripted airports. No idea if possible though.
How to disable the thermal vision of the targeting pod?
It works. Thanks
Isn't that just a side effect of https://community.bistudio.com/wiki/setTaskState?
Not really, with the create task module we can set a task type
that also give it a icon like a car, armor or ammo
that is it , thanks.
on side note though, i need to remote exec that or does that already by default apears to other players?
isGlobal (Optional): Boolean - true to set task globally (default), false to set it only locally
Thanks
btw for icons _icon = ["land"] call BIS_fnc_taskTypeIcon;
```desc: Array or String - Task description in the format ["description", "title", "marker"] or CfgTaskDescriptions class````
what is that "marker"?
im having an issue trying to get the pos after a player seat switched. here is my call to my function```sqf
player addEventHandler ["SeatSwitchedMan", {[_this, "SeatSwitchedMan"] call TLS_fnc_PlayerAllowed;}];
here here is the top of the function where the issue is occuring```sqf
params ["_v_this", "_v_type"];
_v_player = _v_this select 0;
_v_veh = _v_this select 2;
if (_v_type == "GetInMan") then
{
_v_pos = _v_this select 1;
}
else
{
_v_pos = (assignedVehicleRole _v_player select 1);
};
[str _v_pos] remoteExec ["hint", _v_player];
use params, change that if
and for the love of god nothing stops you from using properly named vars
assignedVehicleRole reports the role your group leader has assigned for you, not your current position. It only happens to be the same iff you are the group leader.
But I think your real problem is _v_pos being undefined in the main scope of your script.
Therefore it remains undefined in the remoteExec line. The last one.
thanks, ill clean it up. thanks guys
if (_v_type == "GetInMan") then
{
_v_pos = _v_this select 1;
}
else
{
_v_pos = (assignedVehicleRole _v_player select 1);
};
to
private _v_pos = if (_v_type == "GetInMan") then {
_v_this select 1
} else {
assignedVehicleRole _v_player select 1
};
Nah, this:
params ["_v_this", "_v_type"];
_v_this params ["_v_player", "_v_pos", "_v_veh"];
if (_v_type != "GetInMan") then {
_v_pos = assignedVehicleRole _v_player select 1;
};
_v_pos remoteExec ["hint", _v_player];
Snake case does still look ugly though.
just goddamn terrible
Could easily get rid of the _v tag of the variables and it could fit into ACE.
Well, apart from the RE.
how do i detect postion on seat switch for everyplayer?
TLS_fnc_PlayerAllowed = {
_this params ["_unit"];
private _position = assignedVehicleRole _unit;
[str _position] remoteExec ["hintSilent", _unit];
};
player addEventHandler ["SeatSwitchedMan", {_this call TLS_fnc_PlayerAllowed}];
for everyplayer with EH added to 1 ?
yes id like to assign the EH to every player. currently putting it in the initplayerlocal
thanks alot mate @meager heart
np
is there away to get the thurst angle of a vtol?
https://community.bistudio.com/wiki/currentMuzzle for muzzle maybe?
@astral tendon
Nope, that returns the name of the weapon not the index
damn im sorry
question, would it be possible in anyway to force a weapon to fire ammo it doesn't normally after something happens in a mission?
for example an MX suddenly firing 20mm grenade rounds or something out the main barrel
Does anyone know how the Eden editor blocks input to background displays when overlayed displays (attribute editing menus etc) are created? I want to do it the same way, but not sure how because I cant see any full-spanning controls they use to block any input.
@Namenai#3053 there should be animation source for that if I recall right.
@warm gorge keydown keyup EVH override any default input if they return true. Also you might read how 'createDialog' and 'createDisplay' displays are different on interaction
@unborn ether Basically ive just got a main dialog created with createDialog, and then im creating an overlaying display with createDisplay. I want the overlaying display to only be interactable while its open, but not the one behind it. This is how the 3DEN editor does it, and was just curious how its achieved because I cant see any special controls used by the dialogues.
@warm gorge Example - add a keydown for Display 46 with output of true - you will loose your unit/vehicle inputs as it will override it. You can manage it same way
But why would I need to do anything with a keyDown event? A dialog is already still open, so there will be no control over the player's movement. Im just trying to prevent interaction (interacting with its controls e.g buttons) with the background dialog, and only allow interaction with the overlayed display
Just gave you an example of how do you override input on displays created. Unit movements is also a keydown on display 46
So are you saying that will prevent mouse clicks as well? Through a keyDown event handler
For that use mousebttondown and mouzezchangrd
Maybe just the topmost display get's focus. And only that receives inputs then?
Or you can simply create another dialogue instead of display
key inputs fall through all displays of a dialog. 3den seems to be hard coded, there is no config entry I can recognize. But you should be able to replicate the behavior by using a keyDown handler.
MouseButtonDown cannot block, but those inputs shouldn't fall through the display anyway as the display should cover the whole screen. If not, just create a transparent control that does cover the whole screen (including tripple screens by using the Abs variants).
Thats what I've tried to do now @little eagle . I made an invisible ctrlStatic that spans the whole screen, but for some reason the back display can still be interacted with until a control is clicked on the overlaying display (created with createDisplay).
I tried ctrlSetFocus on one of the controls to move the focus to the overlaying display, but it didnt work at all.
Did you use the unary or the binary version of ctrlSetFocus?
I used ctrlSetFocus _control
Be aware for that control to be enabled
Ah, right. I meant the CONTROL version you used instead of the IDC NUMBER version.
Yeah, some controls start out disabled. Like RscText that are not multiline.
I tried it on a few different controls including a ctrlEdit, ctrlTree, and ctrlStatic. None of them worked.
controls or controlsBackground? It has to be controls I believe.
controls
No idea about ctrlX, I always use RscX
Pretty much the same, just look different. Id like to use the ctrlEdit/RscEdit for focusing, but not sure why its not working
Did you color it transparent red to check if it really covers the screen?
Ill give it a go, but im fairly sure it does because as soon as I manually click on one of the controls in the overlaying display, the it becomes no longer interactable.
You should use a RscText, enable it manually with it's onLoad eh, and give that a transparent background color for debugging. That's how I've been doing exactly this for years.
Is the display not a child display of the one you want to block or are both child displays of one dialog?
So I create the main background dialog with createDialog, and then use a createDisplay on the 2nd display to overlap the first one ((findDisplay 46) createDisplay "")
You might want to consider to use controls groups instead of multiple displays.
((findDisplay 46) createDisplay "")
Nonono, that's wrong.
createDialog your dialog
Then use your dialog as base for the child display.
_yourDialog createDisplay "blah"
That makes it a proper child display of the dialog.
Alright ill give that a go 1 sec
@little eagle Just gave that a go. But now the main background dialog (created with createDialog) is no longer visible when the child display is created.
Hmm, consider to make your child display a controls group.
I would like to do that, but I plan to use this overlaying display with multiple other dialogues, so I dont want to hardcode it in for every dialog.
Because atm you have two displays interacting with each other at the same time.
Just make the controls group a base class and inherit it.
Thats true, I could do that. Curious about what @unborn ether meant by just creating an additional dialog with createDialog for blocking the input though
@warm gorge another dialog, not display exactly. You can create dialogs on top of another. All the inputs works only on the topmost dialog
createDisplay is better solution if you don't want to block previous dialogue or display inputs, such as in-game unit gear. You can run while browsing your gear
I dont want them to be able to run around, so thats not an issue, but in terms of this additional dialog, what controls would it contain? A full screen spanning one orr? @unborn ether
@warm gorge New dialog is created on top covering previous one. If you really want something like sub-dialog where you can see previous content - you would like to use functional controls groups
@warm gorge You just need to split all the dialog with groups and fade them, disable them for your purpose
Anything inside of a controls group inherits its attributes, so if you disable the group, all buttons etc in it will also be disabled
Yeah I understand what you're saying, ill give it a go. Thanks for your help guys
Does anyone know if KKs redirectClientToServer function still works?
+. I've modified it to accept domain names and works fine
question, would it be possible in anyway to force a weapon to fire ammo it doesn't normally... for example an MX suddenly firing 20mm grenade rounds or something out the main barrel...
@ocean hare
player addEventHandler ["Fired",
{
private _b = _this select 6;
private _k = createVehicle ["Cock_random_F", getPosATL _b, [], 0, "CAN_COLLIDE"];
_k attachTo [_b, [0,0,0]];
}];
π₯
Was messing around with it is all thanks for the info guys
was experience with attaching to nades with unlimited ammo and seems working... not sure about bullets will it fails or not at some point, commy
You say attachTo works for hand grenades?
yep
Let me start my game. I'll be using your code snippet.
@little eagle I mean.... you should already know that
didn't you make the chemlight shoulder module thingy?
No, I did not.
Also, it's about attaching anything to grenades, not attaching grenades/chemlights to soldiers.
wait.... so you're saying I can attach a grenade to a grenade....
time to make grenade clusters π
huge maybe
When did you do this first, sldt1ck?
It works btw. For grenades and bullets.
I can attach the chicken to the bullet.
we've attached tanks to bullets
Ive attached players to bullets
Do you remember when or which version?
The past half year?
I haven't tried in years honestly, but when I did, it didn't work no matter what.
tanks to bullets was 2 years ago https://www.youtube.com/watch?v=V-X_4S8eI48
Time to retry setVariable too, because that could be very interesting.
From recent experiments that still doesnt work iirc
player addEventHandler ["Fired", {
private _b = _this select 6;
_b setVariable ["a", 1];
_v = _b getVariable ["a", 0];
systemChat str _v;
}];
0
: /
BUT
don't remember exactly... i think first time was after 1.60 + game version, commy
With this you can attach simple objects to the ammo and store variables on those that way.
oh nice, a new CBA feature π /s
Nah.
Could be something for mines in ACE though. Although different methods were found for those anyway.
attaching handgrenades to your bullets is fun.
lol
also we was inspired by this https://gyazo.com/80a9d1daf3b29292dfe71747d1a62767
If i do missionNamespace setVariable ["test", 1, true] do i actually need the true? I could image as it is set in missionnamespace it is known to everyone.
Furthermore in SP test = 1; publicVariable "test" was faster than setVar. Is this the same in MP?
.....
Do you even know what the true and publicVariable do?
You should look it up on the wiki
@knotty mantle missionNamespace data is both local and global to every PC. Bool argument specifies if it should be broadcasted or held locally
aw man, I have to save that quote
@lone glade Easier to explain
both local and global to every PC uh... wait a minute...
πΏ
π
π π
por_que_no_los_dos.avi
Anybody knows how to execute sqf in post init from addon not using CfgFunctions?
No CfgFunctions? Also no CBA?
Copy the postInit code from CfgFunctions init script. Basically a spawn with a waitUntil isNil on a variable.
Thanks will try
That should be a copy paste from the cfgfunctions init script
I guess easiest way is to spawn a waitUntil till bis_fnc_init get's true.
Nice
Have to be careful to spawn it early enough. If you do it late in init.sqf it might fire a short or long time after the CfgFunctions postInit. But you can't get the timing exact anyway
ooooooooooor you use CfgFunctions because there's 0 reasons not to and you're good to go.
njet
I can accept the phrase:
"missionNamespace data is either local and global"
but not "both".
walking on burning coal is easy, just don't stand there and you'll be fine
njet!
how to execute sqf in post init from addon not using CfgFunctions?
By starting to use CfgFunctions?
I mean, there is literally no reason not to. π€
@little eagle Any function from CfgFunctions is visible, just trying to make it not
π
Exactpmondo
Visible?
Your best bet is to make a srv add-on and pubvar the functions. And hope no is running hacks on ur srv
Like in the functions viewer?
Yep, or simply browsing it in its classes
He is making mad dollar making life functions. Doesn't want anyone to steal
OK then. So it's a petty reason like that.
In that case: No support! :3
π
you say that because you jelly guys
Anyone can open your addon and check out your code and there is nothing you can do about it.
But commy, I heard EBO give ultimate proteksjun
You just bullying me π
Make Srv only funcs or send funcs from srv
Better joke than "Atom is fast"
I'd say you just use CfgFunctions. Why would you discuss anything super secret in public discord anyway?
EBOs are the equivalent of
"we need to do this from a legality standpoint, buuuuut if you wanna snoop around..."
I actually don't think BI wanted EBOs to be broken Β―_(γ)_/Β―
Just make a public, visible postInit script but still hide the actual script you want it to execute
Yeah, by calling a function or using #include or something.
14 hours ago
Hey in case y'all were not aware the latest ACE update added its own version of the arsenal that ovverides the ones in the editor, It does not have mod support for some items unless its using some form of vanlla asset like a backpack reskin
14 hours ago
I am aware, I disabled ACE arsenal ;)
The postInit script itself doesn't have to contain anything major.
til ACE Arsenal doesn't have mod support
Call a anonymous CBA event that has your function as a handler. Oh wait.. no CBA
CBA IS TEH DEVIL
Uhm, how would that help?
This is getting hot for some reason, just curious π
Can 1 use cba on monitized srv?
Hello from Egypt
I don't see why not, nigel.
I don't own anything CBA aside from what I wrote in a way I guess.
there's backdoors in CBA for commy to steal your life functions
Stop spreading rumors.
@peak plover I think you mistook CBA with RHS
Show the backdoors in the CBA source
CBA has a pfh that checks for vars in all namespaces and does a check if there's "life" in varname, then sends them to commy's inbox
π΅
I no show top CBA secrets
Adanthe, link?
LOL
too secret to show
NO SHOW ADANTEH, you traitor
CBA CIA
The uploader has not made this video available in your country.
Can't even get rickrolled in the brave new world.
@Adanteh#0761 Video is not available in my country
damn german spies
The absolute stateof Germoney
Haha
This is your country on Furries
and people coating themselves in cheese and putting on a diving suit then a plastic bag and standing in front of a heater
yuk
That'd be a lot of cheese.
@lone glade sitting. And you forgot the rain coat
not sure if best suicide ever or darwin award
Why you'd need the cheese for killing yourself?
smells good
Depends on the cheese. I like my cheese to not smell at all.
π₯
Why no one upvoot the upvoot hand?
Because you stink.
that is kinda cheesy
@meager heart ayy thanks mate I'll give that a try.
Sorry for get late delay, was asleep
Very late*
Is it possible to add a TFAR vehicle-radio to a vehicle without one, without doing addon config changes?
GIB 1.0 ALREEEDY
Daily reminder, alganthe?
prepare for getting knotted
Alright. I'll tell vehicle commanders to bring a LR.
Dedmen - Today at 11:21 PM
I'll knot your eyes together
Noo... The other knot π
Lool
i'm sure the odd curious one among us can use the search function too π
01/30/2018 11:21PM european time thingy
why are all your dates wrong
european time <--
next you'll tell me that i should use commas to denote decimal points
there is a fix, dedmen
go to language settings in discord
and pick "English, UK"
you will have the correct date format then
Decimal points are superfluous anyway. No one has to know numbers that accurately.
As INDEP calling TFAR_fnc_getDefaultRadioClasses, gives me "tf_bussole" as rifleman radio?
My bad. RF is third index. But shouldn't it give 155?
Nvm. I am stupid.
RHS overrides the "_api" config entry.
No one has to know numbers that accurately. β’
RHS uses _api stuff? That is on the "to remove" list for 1.0. Thought no one uses that...
getText (configFile >> "CfgFactionClasses" >> "rhs_faction_vdv" >> ("backpack" + "_tf_faction_radio_api"))) gives
"tf_bussole"
I was confused why it was not an-155. And when I added "tf_bussole" as my backpack an error popped up.
Why is that even a thing. So confusing.
how does one get say3d working while in camera?
i tried selectPlayer to units nearby to the AI speaking/sound source, but doesnt work
do i have to teleport the player itself nearby, or in camera is fucked up in general?
whats the best/performant way to check if an action anim has completed?
for example i have a unit drop weapon action:
_dummyAIunit action [ "DropWeapon", _container, _weapon ];
do i just loop a WAITUNTIL weapon is null? or is there a better way without using loops?
if i understand correctly... this works for me
0 spawn
{
private _cam = "camera" camCreate (player modelToWorld [0,5,1]);
_cam cameraEffect ["Internal", "Back"];
_cam camSetFov 0.5;
_cam camSetTarget player;
_cam camCommit 1;
sleep 5;
player say3D "Alarm";
};
@velvet merlin
default distance of say3d is 100m
however seems my problem is some other A3 fuck up
Sound: Error: File: F:\Workspace\A3Data\Users\test\missions\LIB_SOV_CAMP_intro.Panovo\any.wss not found !!!
oh lol
while its defined in cfgSounds as
sound[] = {@ww2\missions_s\campaigns\ForTheMotherland_s\EN\mission_intro\Rus_m1_##I.ogg,1,1,100}; \
appears BI implemented that @ external ref badly
What's with the ## there?
from a macro
Well, I believe it's wrong next to a _. Next to a _, you don't need ## glue.
@peak plover you mentioned mods that use the Transfer system what ones do i have not seen one that has yet but i have probably missed it
I can't remember but it's on workshop
why do all those men have a smoke cloud attached to their faces
I know you haven't left your house in 10 years, but think back when you were a kid. Breath in the cold.
Ouch.
bit rich coming from co "spend my life in arma scripting discord correcting people" mmy2
You're on my list and I just waited patiently for my opportunity. I can't remember why, but you deserved this answer.
throws stones at @rancid ruin
@still forum
http://www.armaholic.com/page.php?id=23615
Version: 0.9.13
Changelog:
v0.9.13
Updated Teamspeak Plugin to be Compatible with Teamspeak 3.1+
Added Arma 64Bit compatability.
Retards making up their own delusional changelogs
He wrote it himself I guess
yeah
That's so weird that they just decide to call it 0.9.13 even though that is not the version.
so annoying
BI introduces @ ref for sounds outside the mission
BI is sloppy and breaks it
i mean what TF is this
F:\Workspace\A3Data\Users\test\missions\LIB_SOV_CAMP_01b.Panovo\any.wss not found !!!
how can you even search there or write such crappy error message
even more fun it seems BI even realized its broken as its not used at all in A3 source (from what i can tell) and the instances they would had to use it (ie Eden) disabled the say3d calls and use now playSound instead
anyone knows if DayZ SA/Enfusion at this point uses the A3 sound engine as basis, or did they ditch that completely in favor for whatever
Didn't hear of new sound engine yet
Enfusion is supposed to get a improved version of the A3 sound engine
inb4 it was like... just splendidly perfect, but now it will be badass
progress..
- @ breaks the macro it seems => turns the path/string into "any" (thus above error)
- however with plain string definition, say/say2D/say3D garble the ogg file - with playSound it works
what macro?
#define SPEECH(I) \
class lib_m7_speech_##I \
{ \
name = "speech_##I";\
sound[] = {@ww2\missions_s\campaigns\ForTheMotherland_s\EN\mission_7\Rus_m7_##I.ogg,1,1,100}; \
titles[] = {0,$STR_LIB_missions_lib_campaign_missions_LIB_07_SA_CAMP_Staszow_LIB_m7_ph##I}; \
};
Uhm.. Shouldn't that sound path be a string?
yes it is.
Maybe you should pass a string if the wiki says you should
it will be turned into a string even without quotes
quotes disable the macro - you would need to use the "toString" parameter in the macro ontop
So you trust the magical weird behaviour of arma configs?
String also works for your name entry though
@ is a special config thing. So if you use that, you can expect it to do that special config thing
the above all works fine with kbTell or playSound3D
say[3D] doesnt like definitions outside the mission. hence you need the @ hack BI introduced in A3
I am still in doubt about _##. Glue macro right next to a under score.
your @ is probably interpreted as the config operator @
@empty harbor are you familiar with any special meaning of @ for macros/preprocessor commands?
@ has a special meaning in config. And yes he knows that. And #arma3_config
nothing listed here https://community.bistudio.com/wiki/PreProcessor_Commands
Do you even read what I write?
this is scripting related dude
Is it?
read above
How is a config macro scripting
Just use DOUBLES and QUOTE like normal people do. Β―_(γ)_/Β―