#arma3_scripting
1 messages Β· Page 245 of 1
Well anyway, thanks, good to know that they are treated as objects
more invalid expectations or observations
I was really confused when it behaved like a reference
@tame portal nope, arrays and objects both are values
however, both just point to somewhere
means all is local @dusk sage
So it's somewhat of a spoof
@queen cargo Yeah I mean I assumed assigning an array to a different variable would not copy the pointer to the adress but rather make a copy as it does with all other types
Except objects
Nah you get what I mean
nope
it does not with other types
other types are kinda direct
kinda ...
no fucking clue how it handled internally
Yeah didnt know that tbh
but ... in general ... you can assume that SQF behaves mostly in regards of passing vars like a normal lang
_foo = _bar will copy whatever value _bar contains
and if _bar contains a ref ... then it will copy the ref value
It still doesn't explain why another client will notice the change aswell though
Like I said, this happens in MP
For anybody, the variable will have changed
From what I can see
From an issue that arised some time ago
I understand the logic behind what you said, 100%
I'm just lost at the broadcasting scenario
promise you ... it is not broadcasting ... would break with the entire SQF behaviour
as said: gimme some time
and i will prove that you just observe invalidly π
π
@queen cargo opens fine for me
weird ...
@dusk sage
//name object X_Object
//Put following lines into vehicle init
this setVariable ["test", [[1,1], [2,2]]];
X_Update = {
_array = X_Object getVariable "test";
_test = _array select 1;
_test set [0,5];
};
//execute this in your local client
[] remoteExec ["X_Update", 2, false];
[] spawn {
sleep 1;
hint str X_Object getVariable "test"
};```
@dusk sage behaves as expected now?
Can't test it just yet
check ... will head to bed
I cannot right this second, go to bed π
gn8
gn π€
copy array pointer:
_newArr = _arr;
copy array contents:
_newArr = + _arr;
Array pointers are a local concept, so they will never be broadcasted.
If you broadcast an array, it will create a new pointer on all remote machines.
well ... kinda
obj foo = "bar" createVehicle [0,0,0];
_i = 0;
while {true} do
{
foo set[str _i, _i];
_i = _i + 1;
};```
this for example would be damn stupid
π
but to get back to your question @tough abyss, why are you asking?
100%hdd i/o most likely is a broken HDD
unless you do permanent I/O operations ... you should not get any IO caused by SQF
Are they getting RPT spam?
also a way ... but still no 100% hdd IO
Also would be interesting to know if they have SSDs
I don't think it's anything you can control
Probably something in the engine with textures streaming from HDD
well ... i personally tend to crash away on I&A ...
so ...
you might found some weird bug in SQF by accident
I&A is written like ass, it's no secret
1 you mean
Yo, so I just read about this: https://feedback.bistudio.com/T116980
Are there any workarounds for this atm?
use the command locally
hahahahaa
uhm ... how is that possible Oo
FLOATs and their shitty implementation in SQF
they are four bytes afaik
float precission is 7, which is what you have in Arma
soonβ’ we will get 64bit support and with em doubles etc.
do we?
soon (been three years that it was announced)
@lone glade nah, still doesnt seem to work properly, all calls of setUnitLoadout are only executed by the player
are you using getUnitLoadout / setUnitLoadout or wrote your own array for it ?
which branch are you on ?
the main one
stable ?
ye
can you link to the code ? or gist it ?
what's the actual issue, you don't have all the equipment ?
yeah, serverside the containers are empty
only the visible items actually get saved
BIS probably need to fix it, still isn't fixed on dev branch
huh k, so I'm fucked for now?
eeeeeh kinda
ehhh shit
do you think you could work around it with the add[thing] commands?
do they let you define containers with content?=
nope
doesnt this like fuck up anything that's depending on persistent inventories?
should be fine if you use the command locally
well I did
I send the inventory string to the client via publicvariable
and there it gets locally applied
Does anyone know why this happens?
for "_i" from 0 to 1 step 0.1 do {
if (_i in [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9]) then {
array1 pushBack _i
}
};
systemchat str array1;
-> [0.1,0.2,0.3,0.4,0.5,0.6]```
Why don't the steps 0.7 0.8 and 0.9 match? The steps aren't literally 0.1 * n?
Not a problem for me, I'm just curious.
I'm a bit of a script nooby, can somebody help me with my config defined useraction? i want to execute a script via a useraction (due to additional conditions).
problem 1) I have no idea how i should properly execute the script... call or execVM etc. inside the statement string.
problem 2) the script code itself seems to have some general error - when used in the action-statemen (with "this" instead of "_this") http://pastebin.com/GdrktYVF
@split coral
There is nothing wrong with the loop, or using in, it just seems the if statement breaks it :/
I'm sure there is somebody here with the answer though
@austere hawk that script seems a bit strange, what should it exactly do?
@tough abyss i want to execute 2 animations - first close a vehicle ramp, then hide the interior (for better performance). But before i can hide the interior of the vehicle i need to make sure the ramp is closed.
there is also a large tophatch that can be open or not. So i need to make sure that one is closed as well.
@austere hawk untested and not sure if the 0.001 and 0.01 is intend in your paste but i used 0.001
but you would need to register your function in cfgFunctions
that i can do. doesn't waitUntil check every frame?
think so yea
waitUntil { _this animationPhase "anim_ramp" < 0.001; sleep 1 };
not 100% sure it works.. haven't scripted sqf in a while π
Error in expression <mp_AnimSrc",0,false];
waitUntil { _this animationPhase "anim_ramp" < 0.001 };
if>
Error position: <animationPhase "anim_ramp" < 0.001 };
if>
Error animationphase: Type Array, expected Object
File k40_v_chimera\Vehicles\Chimera\ChimeraAPC\Scripts\ChimAPC_close_ramp.sqf, line 4
(without the sleep)
ah sry forgot to replace _this with _vehicle
@split coral https://en.wikipedia.org/wiki/Floating_point there you go for your reason
hm no hiding and no systemchat message. ramp closes at least. No error message either though. Will have to investigate the issue later, i'm off for now. thank you anyway
@queen cargo Yeah. But the game doesn't do steps by 0.1 + 0.1 + 0.1... then?
check the page dude ...
Yeah. Now I did. π sorry
at least that is pretty much the reason why it is not working as you would intend
array1 = [];
for "_i" from 0 to 1 step 0.1 do {
array1 pushBack _i
};
Would work
There isn't a problem using in for numbers above 0.6
So why sticking it in an if, does it break? @queen cargo
Thanks, X39. That explains it nicely.
"step 0.1" looks very strange. Usually those steps in for-loops are integers afaik.
does anyone know the class name for fake explosive charges that are used to script explosions? i've stumbled upon an entry about that in the bis wiki but some time ago but now that i'd need it i wasn't able to find it
thank you
perfect, exactly what i was searching
Well, you can createVehicle every explosive with triggerWhenDestroyed = 1 and it will work
cool, good to know
but this one should come more like a surprise
so i'd need to hide them anyway
rather for looks than effect
that's a bit too big
i wanted a sequence of smaller explosions, i'll take the democharges
does anybody know how to use the onTimer ctrl eventhandler?
cant find anything in the wikis
anyone?
it is said by using setTimer command which is not listed in biki
probably it may use some engine hacks
yh does anybody know what this setTimer function is, or how to use it?
I've never seen onTimer used anywhere, it's probably broken
no, it is not listed by supportInfo command
so there is now way to make a ctrl/display eventhandler that fires after some time? π¦
sleep command?
i need a eventhandler
are you using CBA?
no vanialla arma 3 :/
good luck then : P
what are you trying to do @empty pagoda
Hello, does anyone have experince with lightbar scripts, and could possilby help me out?
_lightsource = "#lightpoint" createVehicleLocal _pos;
light lightAttachObject [object, position]
And everything that is listed under "See also" here:
https://community.bistudio.com/wiki/lightAttachObject
- always use createVehicleLocal
- you might want to try
attachToin case you want to attach it to moving objects - you cannot remove the delay when the object is moving
Oh and run it only every machine
@little eagle
"step 0.1" looks very strange. Usually those steps in for-loops are integers afaik.
True, but that was just an example. The point was that
0.1+0.1+0.1+0.1+0.1+0.1+0.1 == 0.7 -> false
I'll just have to keep this in mind in the future.
@little eagle https://forums.bistudio.com/topic/188984-sqf-feature-requests/?p=3058746 thought you might be interested
why do you want to createVehicleLocal for lightpoint?
Yo, got another tricky issue idk how to get around.
_wepname = rhsusf_weap_glock17g4;
trader addAction ["Buy Gun", {player addWeapon _wepname}]```
because it only work with createVehicle Local
so _wepname is retrieved from within a for loop, so idk what it is before
ah, ok
but inside the code I cannot use it like that
anyway I can pass the value to the code without referencing the local var?
the action handler does not inherit the scope where the action was added
I know
ahhhh
okay sorry, coulda prevented this one by reading the actual article
it's kinda late atm
is the new "press and hold" action already in the stable branch?
Anyone know how to disable the mouse cursor on createDisplay ?
createDisplay has mouseCursor oO
well ... always used createDialog anyway ... still kinda weird π
but wait ... ye ... remembering now ...
@elfin bronze what is your goal with your UI?
I want to show a dialog from player to another, butI want the player be able to move
Player A : sent variables : name & some shit
Player B : createDisplay and CtrlsetText with vars "name & some shit"
Like hint
RscTitles? :3
RscTitles would be what you want to go for then
alternativly, implement some sort of "notification" system
or use the already existing one
and use those to display the notifications
would be a cool functionality, i will impatiently wait then.
what would you want to do with such a command ... you would always end up in lobby first
could do an open world (life/dayz/whatever) spanning multiple maps
you would always end up in lobby first
it's a non existent feature.. they could add a solution to that too
@queen cargo skippLobby=1; in description.ext pushes player directly to game
@hallow spear I would suggest a mod with dll who integrates with launcher and restarts arma with needed params
say scripted event > signal to dll > dll contacts launcher > launcher shuts down arma > launcher restarts arma with new server params
kind of tricky, but that's the only way coming to mind
@pliant stream
Your method errors out for
[{A = canSuspend}, []] call fxy_fnc_sync
I think this is because you cannot set/pushBack/append a expression that ends with =
fxy_fnc_sync =
{
private "_result";
_result = [];
isNil { _result set [0, call {_this select 1 call (_this select 0); false}] };
_result select 0
};
I have to add this call, and return something else (here: false, doesn't matter what though)
oh, but then the return value doesn't work anymore. :/
I'm trying to make an animation mod, it's my first attempt, im using init.sqf file to set keypresses execute scripts - is init.sqf enough or does it have to be XEH_preinit?
if(isDedicated) exitWith {};
GCT_Brief = {
switch (_this) do {
//Key Y
case 44: {
nul = [_this] execVM "brief_talk.sqf";
};
//Key X
case 45: {
nul = [_this] execVM "brief_listen.sqf";
};
};
};
Oh sorry how do I do scripting box like commy2
?
If you want to use keys, then you have to use a keyDown event handler
that will be executed when a key is pressed and report which one
the state of shift, ctrl, alt etc.
Oh, I see, lemme rewrite the code
Are you using CBA or no mods?
CBA
'''if(isDedicated) exitWith {};
gct_brief = compile preprocessFile "brief.sqf";
_display = findDisplay 46;
_display displaySetEventHandler ["KeyDown","_this call gct_brief"];'''
Oh, wrong button
gct_brief = compile preprocessFile "brief.sqf";
_display = findDisplay 46;
_display displaySetEventHandler ["KeyDown","_this call gct_brief"];```
Thats for my init.sqf
//Key Y
case 44: {
nul = [_this] execVM "brief_talk.sqf";
};
//Key X
case 45: {
nul = [_this] execVM "brief_listen.sqf";
};
};```
And that's my brief.sqf
Looks reasonable?
the problem with adding these keyDown event handlers is
that they are added to a display
RscDisplayMission
or display #46
If you add the event handler on mission start
you might add it to the mission display that was already existing
which would cause two key handlers to be added - one carried over from the previous mission
this happens when you press "restart" in the editor for example
I think this is because you cannot set/pushBack/append a expression that ends with =
more because = will take the return value
yup
still it is the same like:
foo =;
@shrewd lichen
["keyDown", {
systemChat str _this;
}] call CBA_fnc_addDisplayHandler
try this
it handles all the weirdness with display 46 in save games, restarted games, or when you return to lobby as host in a local hosted MP game
But im wondering will it be carried over restarted games when it's used as a mod
Hm, yeah, problably it will
But im wondering will it be carried over restarted games when it's used as a mod
Yes. It doesn't matter
code is code. addon, mission - if it's executed then it's executed
Gotta try this, I never did a mod before
so im superconfused
Thank you very much for help, I appreciate it π
yup
still it is the same like:
foo =;
It's not
All it is the method the compiler uses to detect this construction:
var = (var2 = 1);
It could be interpreted as:
var = nil
But the compiler marks it as error. Unfortunately (as usual) the printed error message is garbage
so my init.sqf looks like this
gct_brief = compile preprocessFile "brief.sqf";
_display = findDisplay 46;
_display displaySetEventHandler ["keyDown", {
systemChat str _this;
}] call CBA_fnc_addDisplayHandler```
Or am I retarded? :D
it's wrong
if(isDedicated) exitWith {};
gct_brief = compile preprocessFile "brief.sqf";
["keyDown", {
systemChat str _this;
}] call CBA_fnc_addDisplayHandler
Also, you might want to replace that isDedicated with !hasInterface
That way potential headless clients exit there too
headless clients have no display just like dedicated servers, but are obviously not "isDedicated"
_var = call { dbg_var = canSuspend }errors out too, it's just SQF being shitty SQF
yep
same with my configClasses method
But thanks to this I now figured out why it errors some times, haha
all you have to do is add a ; nil
yeah
good enough for me
FNC = { dbg_var = canSuspend }; _var = call FNC;
this is really strange that this errors
seems totally valid to me
seems like this is a problem with SQF in general
i think in SQF assignment doesn't have a value
as in, all commands have a value like a null GameValue or a GameDataNothing, GameDataNil etc.. not quite sure what the difference is there..
but assignment i don't think has any value at all
Yeah, that's probably it
= should set the value to GameDataNothing or GameDataNil
whatever is more approriate (don't know the difference)
On one machine?
Hmm. Strange. It obviously triggers twice over all
owner as in the owner id number?
is this on the client or the server
seems useful, but it shouldn't report it as argument 0
yeah. Ill try to repro on local host
1.63 ???
I'll try anyway
It's probably a new feature going haywire
<IDENT> = <EXP> wont return a value as it is no expression
and as the = operation expects an expression (eg. nil), it will error out
Because hurr durr, let's put unfinished stuff in release branches
yeah x39 that's the conclusion we came to as well
X39, you are saying the same as Foxy, but with different words
though it should return either the expression used in the assignment, or nil
I agree
thats what i could have told you from the begining ...
and i just repeated myself
I think this is because you cannot set/pushBack/append a expression that ends with =
more because = will take the return value
hold on
it wasn't anything new to me, i used the array initializer atomicity trick a lot, and could never use assignments
getinman >> addeventhandler 'local' >> EH local fires with params = object/bool >> vehicle becomes local >> EH local fires again with params = number/object
can you write this in actual code?
that's why i used the missionNamespace setVariable ... in my ridiculous object init eh dispatcher
I have a theory
You are modifing the C++ array while iterating through it
the array with all the event handlers
Similar issue as the problem with removing a fired event handler from inside a fired event handler
different eventhandlers have their own arrays
don't ask me how i know this.. i think you're not allowed to discuss reverse engineering :<
Are you sure? Because someone reproduced it by remoing a different event handler
reverse engineering is totally legal. After all, all we do is make educated guesses about what we see ; )
it's prohibited by the EULA
Reverse Engineering, you said ? That is a huge offense to democracy and freedom. Better call in a SWAT Team then
i'm just saying, the forums at least have a rule against discussing it
And maybe this works in reverse too
adding eh inside one
instead of skipping one, it would execute another one
case closed
case sensitivity?
it sucks
@tough abyss toUpper _str1 in toUpper _str2
there is a command to itterate through all of them
i more hate that string == string is NOT case sensitive ...
STRING in ARRAY is what we are talking about
do not have the time to search for the apply command thingy now
apply {toLower _x}; ?
Yes
π
The worst thing about this is how BI doesn't care about consistent case in their configs
configs are internally lowercased all anyway
They could've made BIS_fnc_compatibleItems at least report everything in lower case
"apply" implies for me that the original array is modified
+1
yeah i think the reason they named it that was because they already used select for something else
but well ... apply is better then
withEachApplyCreateNew
Yeah
Unless you made a popular mission that used apply a global variable
: P
There are people who name units "commander"
and then make tickets on our github page
Yea made the same mistake once as I had different Uppercases than the actual command which gave the variable a whole new meaning.. then I was confused and searching why my mission stopped working xD
another common one is naming a supply box items
like in items player
This is why you should ALWAYS tag ALL of your global variables
But I think it's hopeless when I say that
https://community.bistudio.com/wiki/handShit π had a own wiki page... but now it's being redirected
By whom?
@tough abyss So be it then! @little eagle is right, all globals must be tagged!
How come there are at times so many BI Minions and then days later they are almost all gone
That already elevates your code into the top 10%
If I showed you my code I would boost it back to where it came from: -100%
better use multiple tags if one fails you still have another one π
TAG1_TAG2_myVariable
:facepalm:
@deft zealot
A tiny bit faster and no strange config needed
nice i hate this dummy config
It's your method, foxy
yea i know
but when i was first testing it, it wouldn't overwrite a variable in the outer scope
which is why i was using the array for the result
yeah i just tried it
I just used the array method for diag_codePerformance
must have done something wrong before then
cause that runs in a different scope
Maybe you used private _a = 1; isNil {private _a = 2}; _a
definitely not that since i tested in A2 :p
no clue what i did.. but it works fine now so doesn't really matter
just beware of crashes π
what does 0 spawn {private _a = 1; isNil {_a = 2}; hint str _a;}; output?
ok now do this:
0 spawn {private _a = 1; diag_log diag_frameNo; isNil {_a = 2; diag_log diag_frameNo;}; diag_log diag_frameNo; hint str _a;};
and check the frames
they will all report the same frame
depends what else is running xD
fxy_fnc_sync =
{
private "_result";
isNil { _result = _this select 1 call (_this select 0) };
_result
};
0 spawn
{
_func =
{
private "_frame";
_frame = diag_frameNo;
DELAY;
DELAY;
DELAY;
DELAY;
diag_frameNo - _frame
};
_control =
{
_this select 1 call (_this select 0)
};
systemChat format ["control: %1 frames", [_func, 0] call _control];
systemChat format ["sync: %1 frames", [_func, 0] call fxy_fnc_sync];
};```
here's a much better test case for you
@deft zealot
and in the code you posted they will not necessarily all show the same frame
got to update my dokuwiki plugin to highlight SQF - it has 2079 unique commands o_O
_Mission1 = [hint "You have recieved job 1"];
_Mission2 = [hint "You have recieved job 2"];
_Mission3 = [hint "You have recieved job 3"];
_Mission4 = [hint "You have recieved job 4"];
_missions = [_Mission1, _Mission2, _Mission3, _Mission4];
_mission = _missions select (floor (random (count _missions)));
Hello I'm trying to make an array that will choose one of the 4 options randomly with a probability percentage, can't find anything on the webs really... anyone mind helping me out?
There is no command for use with a given percentage that I am aware of, but you can create a function for it easily
oh and must i say it only outputs the last mission
Or use some transformation of the gaussian distribution: https://community.bistudio.com/wiki/random
See the alternative syntax
is there not like an yeasy way to set it up like how the loot spawns work on epoch and such
got something for that, gimme a sec
you pretty much create a new array with 0 to 10 of your elements, shuffle it and use randomSelect to pick one.
But that wouldn't be a probability percentage, unless you added some function for it
I'm a begginer so how exactly would that look?
Which wouldn't be hard at all
Well, they all have equal probabilities, unless you used random with alt. syntax
not really since some have less entries than others.
You didn't mention adding more than one, but that would work yeh
You could also abuse a switch fall through
π
not keen on that
Also for those that didn't knew init.sqf executes BEFORE remoteExec (JIP flag) has been passed
use initPlayerLocal and initServer instead
@lone glade what would i do with the if statements? i just want it set up so it chosses one of my elements and then executes a script
those if statements are not needed in your case, I use them to detect classes I want to.
got a similar system for my side missions https://github.com/alganthe/Co-ops/blob/master_tanoa/functions/core/fn_sideMissionSelection.sqf#L30
(no percentage there but it's the same principle)
You need to make it clear exactly what you want as an outcome @spring kindle
Selecting a random element is incredibly easy (one command, same concept as yours), but adding some varying probability will require more
I'm making a trucking mission system so you press get job then it picks a random jobv out of a list then executes the script paired with that job to "load" the truck
So you want purely a random choice, no varying probability?
I.e, one is near impossible to get
I want varying proabaility for higher paying jobs so they arent as common
combine both of my examples there then.
Well one option you have is like @lone glade said above, add multiple of the same choices to your array, then select one at random.
Or if you are not aiming for any exact probabilites, use the alternative syntax at https://community.bistudio.com/wiki/random
gimme a sec
no shuffle there
How much impact will it actually have?
so i can put just the script name in the yourtag_fnc_1 spot
yes.
thank you so much
What explanation would shuffling the elements have on the outcome?
I.e, what flaws has the command got, except not being properly randomized
I noticed selectRandom like to pick the extremes of an array, making the center less picked
Or are you just taking a measure to increase the randomness, say
yes it is π
makes more sense now lol
0: 968
1: 924
2: 903
3: 898
4: 890
5: 934
6: 843
7: 870
8: 915
9: 957
10: 899
:/ weeird.
100k iterations:
0 - 9.04591%
1 - 8.99591%
2 - 9.21891%
3 - 9.02591%
4 - 9.06191%
5 - 9.10091%
6 - 9.19991%
7 - 9.01791%
8 - 9.15491%
9 - 9.14591%
10 - 9.03191%
I must be going crazy then π
Seems alright π
yep seems good
Heres 1 million
before I delete this code
0 - 9.11689%
1 - 9.09769%
2 - 9.06049%
3 - 9.11469%
4 - 9.08899%
5 - 9.10989%
6 - 9.05869%
7 - 9.10909%
8 - 9.06389%
9 - 9.09019%
10 - 9.08949%
π
Don't want my game to crash on me
π©
not going to happen, unless you do:
_a = {call _a}; call _a;
you should've seen the broken anims extracted from TKOH, those were hilarious
Tonic's SpyGlass runs that, preProcesses a file, which causes a memory crash which gives the error : "Hi, it appears that your client crashed. Do not worry we will get back with you in six years."
π
It bothers me that you used 11 numbers instead of 10
haha
Yeah wasteland makes you include a non existent file which causes a crash
If you want to be sneaky in how you crash their game you have them create a string 9 million characters long and recursively add it to an array until their game runs out of memory
But then they would probably blame BI so maybe that's not the best idea
Cruelty π
cruelty is wiping someone profileNamespace
link the code, I already deleted the gist π
missing [] for the elements
private _mission = [
[fnc_TM1, 4],
[fnc_TM2, 6],
[fnc_TM3, 1]
];
which version of the game are you on ?
tanoa
If you are feeling super basic you can just have an array with the missions in it. Then you can manually add duplicates for however many times you want it in the array, and then you simply use selectRandom on it
i have to have a tag?....
you want weighted probabilities on your items?
you can add up all the weights, select a random number X in the range [0, total), then loop through the items adding up the weights until the sum is more than X, return current item
this is the low performance, low memory usage method
CfgFunctions goes into description.ext
or you can build a weighted array where each item is present more times for higher weights etc
this is the high performance high memory usage method
which is exactly what he does, and "high memory usage" isn't the case
if you knew how many elements arsenal arrays handled you would go crazy.
yea i'm not saying it's going to crash your game but you are using more memory than the first method
it's a tradeoff
no
AHHHHHHH YES THANK YOU
a theoretical tradeoff
it works now!
not a tradeoff at all
unless the array you want to manipulate happens to have 10K+ entries
(arrays have a 10 million limit)
ok if i give you this array [["item1", 1],["item2",99]] build me a weighted array that takes the same amount of memory
second element of each subarray is the weight
you don't need to care about memory on that scale
did you even read what i said
i never said it's even remotely close to mattering
but it's there
if you're decided to optimize byte by byte ok.
π
i'm not saying don't use the weighted array solution because it takes more memory
but it does take more memory than the first solution
that's just a fact
Maybe we should start using tabs instead of spaces to reduce file size too while we're at it
sigh that was not the point foxy wanted to make
low-performance-low-memory is a relative "term" ...
just like the high-performance-high-memory is ...
it pretty much just means one thing: doing this like this will cause that and have theese advantages
it is just the tradeoffs for the different solutions
as we do not really are limited in ArmA, the high-performance solution can be prefered
if we would run into memory problems we should prefer the low-memory solution
the actual consumption do not has to be that large compared to anything... just like the performance gain can be minimal ...
still you say "low performance" and "high memory"
as "with this solution you save XXXms but it will cause XXXbytes more RAM" would require testing (or calculating ... but that wont apply here)
Is it possible to control the animation source for the plates on the Land_Target_Dueling_01_F like it is possible for the animation source on aTargetP_Inf3_F pop-up target?
Yes
You should be able to see the animation names in the config browser, but I'll look for them now
I'm tryinging {<object> animate [_x, 1];} forEach ["Plate_4_source","Plate_5_source","Plate_6_source"];
Easy fix then, use animateSource
It's a somewhat new command https://community.bistudio.com/wiki/animateSource
If you were to use animate you would have to use "Plate_1_rot", "PLate_2_rot", etc...
You can get those using animationNames <object>
Right. animateSource was the ticket. Thanks.
For future reference if you want the available AnimationSources of an object the following should work
_animSources = "true" configClasses (configFile >> "CfgVehicles" >> typeOf <object> >> "AnimationSources");
{
_animSources set [_forEachIndex, configName _x]
} foreach _animSources;
copyToClipboard str _animSources;
Oh whoops that technically wouldn't catch inherited animations, this should do it
_animSources = configProperties [configFile >> "CfgVehicles" >> typeOf <object> >> "AnimationSources", "isClass _x", true];
{
_animSources set [_forEachIndex, configName _x]
} foreach _animSources;
copyToClipboard str _animSources;
Nice, thanks for that @native hemlock
Could someone help me make a jammer script that jams missiles to all blufor planes which are in the radius of a blufor plane capable of jamming? We've got it to jam missles from hitting a single plane but can't find a way to have it jam the missiles from every plane within the radius. Sorry if this sounds confusing. Just need some ideas
How are you making it jam missiles for a single plane?
It deletes the missiles 60% of the time
^that's what it does right now
But problem is, it deletes blufor missles too
I don't think missles have sides assigned
can't you get the source of the projectile and see what side they are on?
I was unaware that could be done, do you have anything I can look at to see?
I'll give it a go, Thx guys
So at some point last week I accidentally suggested using toString instead of str for converting an array to a string, but what I really meant was to use joinString instead of str.
For a 1000 element array:
Someone's suggested solution using str
_string = str myArray;
_string = _string select [1, count _string - 2];
//18.8 ms
Using joinString
_string = ('"' + (myArray joinString '","') + '"');
//0.43 ms
Both outputs will be the exact same but in this case joinString is a little over 40 times faster
anyone had the problem where remoteExecCall sometimes executes everything twice on the remote machine?
how would you detect that execution happened twice?
it may happen when you for example execute a command with a global effect on multiple machines
it's karma from using onEachFrame {}
what is the reason BI (and parts of the community) want scripted features (from BI) to merged into the engine?
the only benefit i can see is performance (which rarely matters for BI stuff) - the downside is no longer possible to be adjusted by the community, usually very unflexible system and usually bugged and not fixed often by BI in a short time frame
what do I miss?
What do mean exactly? I'm thinking of select CODE and apply and those commands are super usefull.
who the hell uses oneachframe? π
whats wrong with onEachFrame
Kappa much π
Hi guys, is there a way to output the result of a count operation in the chat? I have this in my script: leader _vehicle sideChat "the radar has located " + format[(count _testsideunits)] + " Blue side units"; but it only writes "the radar has located Blue side units" without the number
@fossil topaz You almost had it, give this a try
leader _vehicle sideChat format ["the radar has located %1 Blue side units", count _testsideunits];
@native hemlock ok thank you!
leader _vehicle sideChat ("the radar has located " + str count _testsideunits + " Blue side units");
You kind of mixed the two, the other option would have been to do
leader _vehicle sideChat "the radar has located " + str (count _testsideunits) + " Blue side units";
but you should use format
Oh, Foxy got it π
just saying it is possible via concatenation as well
You kind of mixed the two, the other option would have been to do
missing parenthesis
My code? I thought the same initially but it worked
maybe + operator has a higher priority than other binary commands? It looks extremely confusing though
Yeah it make sense to include them
_vehicle = vehicle player;
_testsideunits = [1, 2, 3, 4];
leader _vehicle sideChat "the radar has located " + str count _testsideunits + " Blue side units";
Outputs "the radar has located 4 Blue side units"
It's working, thank you all π
Well what's weird is
hint "this" + " " + "is" + " " + "weird";
results in only "this" being hinted
yes, because hint is a unary command and sideChat is a binary command
unary commands have higher priority than binary commands
+ being mainly a math command seems to be between unary and binary commands
maybe it's not because it's a math command, but because there is the alternative syntax of + being unary too. Who knows
Both should use parenthesis. So it's clear what is meant
supportInfo for +
"b:SCALAR,NaN + SCALAR,NaN"
don't trust support info.
there's multiple overloads of the + operator
+ <ARRAY> is the syntax to copy an array and it's unary
Oh yeah you are right
+ <NUMBER> is a command too in SQF. It just reports the same number ...
probably to complement - <NUMBER>
"b:SCALAR,NaN + SCALAR,NaN"
"b:STRING + STRING"
"b:ARRAY + ARRAY"
"u:+ SCALAR,NaN"
"u:+ ARRAY"
see
Thanks for the info
On a separate note, is anyone aware of a way to determine if a CfgPatches entry is from vanilla A3? Only guaranteed way I can figure out is to just have a list of all CfgPatches for vanilla on that game version, and check if a given CfgPatches entry is in there
_result = 1 ++++++++++ 2 for when you really gotta add them numbers together
I guess I could just check if it was "3DEN", "A3Data", or "Map_VR", or if it contained either "A3_" or "CuratorOnly_"
But that method isn't ideal
{
class A3_MyCheeckyModHehHehHeh
{
};
}```
Someone is bound to do that, so I think the first method of just having a list for that game version is probably best
I wish CfgMods had a list of CfgPatches or something
what do you even need it for
lol I don't really have a practical purpose for it
configSourceMod (configFile >> "CfgPatches")
will report "" for vanilla configs
but it will also report "" in case you move the addon directly into the \addons\ folder ...
Nah, I'll link the script in a minute
It's just part of a function that copies the loaded CfgPatches
I think commy's method will work beautifully
My previous solution was just to have a function that returned a static array that would have to be manually updated between game versions
And then I set the variable it was assigned to nil
It's only supposed to be used as part of debugging
smt_vanillaCfgPatches = [] call smt_fnc_getSavedVanillaCfgPatches;
_configs = "!(configName _x in smt_vanillaCfgPatches)" configClasses (configFile >> "CfgPatches") apply {configName _x};
smt_vanillaCfgPatches = nil;
configSourceMod should do the trick though
just use a local variable for smt_vanillaCfgPatches. no need to delete it then
But it's in a different scope when used with configClasses, and I couldn't get the format to work properl
no it isn't
all local variables carry over in the string of configClasses/Properties
You're right...
well except for _x, which is overwritten just like in forEach
I must have messed something else up initially
in is case sensitive
But I think smt_fnc_getSavedVanillaCfgPatches reports the "config case" anyway
isn't in case insensitive and isEqualTo case sensitive ?
no, both are case sensitive
I think == is the only case insensitive command for strings
:facepalm:
always use toLower. toUpper is slower because it has to change way more chars on average
I also assumed it was a different scope because it's passed as a string. How can you know whether it will be a different scope? For example aren't the code portions of https://community.bistudio.com/wiki/buttonSetAction and https://community.bistudio.com/wiki/setWaypointStatements in a different a scope?
animationState is all lower case
I guess those have delayed execution
does it?
"amovpercmstpsraswrfldnon"
all lower
in config it's mixed case, yes
well, use toLower
or apply {toLower _x}
I want a case insenstive in command too
in [_needle, _haystack]
case insentive for strings
made in 10 minutes
maybe an uppercase command
hahaha
Proably. Can't remember. I sometimes make suggestions like that.
Making it a unary version is the only way to get it done without changing the commands name.
A much prettier solution to my previous question using configSourceMod
_vanillaMods = ["", "curator", "dlcbundle", "expansion", "heli", "kart", "mark"];
_configs = "!(configSourceMod _x in _vanillaMods)" configClasses (configFile >> "CfgPatches") apply {configName _x};
Good job naming the addons "expansion" and "dlcbundle" :facepalm:
I wonder if you can also auto generate the _vanillaMods array with the same method using CfgMods
Depends on where CfgMods is located.
nope they are scattered it seems
Couldn't you do the opposite?
_nonVanillaMods = configSourceMod (configFile >> "CfgMods");
_configs = "(configSourceMod _x in _nonVanillaMods)" configClasses (configFile >> "CfgPatches") apply {configName _x};
CfgMods has Heli, Kart, Mark, DLCBundle etc.
Nevermind, it returns a string
I was only running CBA and configSourceMod (configFile >> "CfgMods"); was only returning @CBA_A3
Jeez it's not my day
I should have used configSourceModList
This method doesn't work for CfgMods itself
because multiple addons can edit that
And the "" is always overwritten, even by the List version
it's all half assed. it only works for CfgPatches, because you never reuse the sub classes there anywhere
'ello again, addAction is behaving weird for me. The following call works fine:
_trader addAction [format ["Buy %1 [%2$]", getText (configfile >> "CfgWeapons" >> _x select 0 >> "displayName"), _x select 1],{_this call buyItem}, [_wepname, _price], 1.5, false, false, "", "true"]
but this one doesn't:
_trader addAction [format ["Buy %1 [%2$]", getText (configfile >> "CfgWeapons" >> _x select 0 >> "displayName"), _x select 1],{_this call buyItem}, [_wepname, _price], 1.5, false, false, "", "true", 5]
"Error 9 elements provided, 3 expected"
According to the wiki all the arguments should be fine
_trader, _wepname and _price are coming from code above and are working fine
The radius parameter is not implemented yet
The game is trying to tell you, that you gave one argument you shouldn't. The error message is just garbage as usual
So I guess I have to work in the radius in the condition yea?
for now, yes
Since Arma 3 v1.63.136787, two new params are available: radius and unconscious.
Current stable is 1.60 and APEX will be 1.62
I think that'll be in 1.62 as well
So this will be first patch after APEX
As it's probably used by the new revive system
I think that'll be in 1.62 as well
No
The new revive system isn't in 1.62 either
Well parts are, but setUnconscious doesn't work fully
I thought they said they were doing it for the new co-op?
out of curiousity, wouldnt giving too many arguments not matter usually though?
Since the n-th field never will be called in a func?
or isit different with engine funcs?
It wouldn't, but Arma
It doesn't matter for SQF functions, but commands are anal about parameters
you can't even pass nil when you want to use the default value
which means you have the write down the default values for argument 4,5,6 and 7 if you want something different for 8
...
Yeah, it's really bad there
also is there a reason addAction wants the condition to be code passed as string?
as opposed to just code?
like in While, WaitUntil etc
nevermind, what I said
Not for the condition, alganthe
the reason is that it's an old command
I think it is because it was made during SQS times. There was no CODE type back then. The statement was eventually updated, but not the condition ...
yep
ahhh k
Apparently addAction is OFP 1.1 and execVM is A1.0
ahh damn, there is a distanceSqr, but no distance2DSqr
not that it matters too much, but would be handy to have anyway
wouldn't that just be x1 * x2 + y1 * y2
distance and distanceSqr are weird. I think they use AGL position and actually calculate the terrain heights
AGL = ATL?
The new version of addAction is on 1.62 RC
z is the same as in PositionASLW when over sea and is the same as in PositionATL when over land. Most commands either take or return PositionAGL.
ahhh k, the wiki didnt put much explanation to it
not that it matters too much for my purposes
what I end up doing is to ALWAYS convert to ASL via AGLToASL
and only convert back if the command needs it
Yeah, best to have one consistent system for most stuff
I think ATL is mostly relevant for airborne stuff
like landing choppers n stuff like that
innit?
idk, I always use ASL.
Is it a smart idea to attach actions to players for stuff like "send money" or should I do that one as a chat command instead?
I guess it would be evaluating alot of conditions etc
Me and a friend are working pretty much on a plug and use chat command thing
Where you simply type in for example /sendmoney name amount to execute it
I would like to avoid having to use that, but idk if adding around 3 action buttons would affect performance
it's just a radius check p much
I'll keep balance checks in the action code itself
I don't think it really matters
hmm k
You'll probably be able to upgrade it to using that distance parameter in 2 days anyway if that syntax really comes with 1.62
yeah
Hello, is someone could send a good script for allowing all units to wear civilian clothes without Arsenal. I mean player finds a civilian clothes on ground or a civilian corpse, he can grab the uniform (as he can with enemies ones!). Thanks
In vanilla Arma 3?
It could easily be done by configs, but if you are opposed to that it might take a hacky solution using forceAddUniform
there is no script to do that, only config
forceAddUniform cannot move the uniforms content into the players inventory and there are no inventory commands to handle for example attachments on weapons
Yes forceAdduniform on a typeOf cursortarget which will return "Item_U_C..." instead of "U_C..." class, + an addAction. It's just a little bit boring. Just because someone decided civilian clothes are not for other sided units.
If you are looking at the dummy weapon container you can get the class name for all the objects in that container from everyContainer https://community.bistudio.com/wiki/everyContainer
@tough abyss
Alternatively if you are desperate to get the class name from the "Item_U_C..." name you can do the following to get the respective uniform model
_itemName = ""; //for example Item_U_I_C_Soldier_Bandit_4_F
_uniformConfig = ("getText (_x >> 'displayName') == _itemName" configClasses (configFile >> "CfgVehicles")) select 0;
_uniform = (("true" configClasses (_uniformConfig >> "TransportItems")) apply {getText (_x >> "name")}) select 0;
A small example using that
myFunc = {
private _idc = ctrlIDC (_this select 0);
private _selectedIndex = param [1];
private _text = lbText [_idc, _selectedIndex];
_uniformConfig = ("getText (_x >> 'displayName') == _text" configClasses (configFile >> "CfgVehicles")) select 0;
_uniform = (("true" configClasses (_uniformConfig >> "TransportItems")) apply {getText (_x >> "name")}) select 0;
closeDialog 602;
[_uniform] spawn {
params ["_uniform"];
waitUntil{isNull (findDisplay 602)};
player forceAddUniform _uniform;
};
false;
};
player addEventHandler["InventoryOpened", {
params ["_unit", "_container"];
[] spawn {
waituntil {!(isNull (findDisplay 602))};
((findDisplay 602) displayCtrl 632) ctrlSetEventHandler ["LBDblClick", "_this call myFunc"];
};
}];
It's not fully complete, but I'll leave that to you. I only tested it with uniforms on the ground. When you double click the uniform in the inventory dialog it force adds that uniform to your player.
You would need to save and add the equipment that was in the uniform before switching uniforms and remove the picked up uniform from the ground
And a small note, calling forceAddUniform while the inventory dialog is open seems to crash your game
In hindsight that could be better optimized by looking at the selected index by the double click and then getting the corresponding classname for that index in the container that the inventory dialog is opened for.
Is there a good example of the custom difficulties around?
i imagine you could just have your custom difficulty affect stuff like number of AI, their skill, etc?
@native hemlock - Thanks a lot for your answer! i 'll try that. I like the idea of an EH when inventory is opened. On my side I scripted al little code, working in all cases but less smart than yours and probably more CPU demanding.
sleep 1;
call {
if (cursorTarget isKindOf "man" && {!alive cursorTarget} && {uniform cursorTarget != ""} && {isnil {cursortarget getVariable ["aUniform",nil]}}) exitWith {
cursorTarget addAction ["Wear civilian clothes", {
_unit = _this select 1;
_g = createVehicle ["weaponHolderSimulated", (_unit modelToWorld [0,-1,1] ), [], 0, "CAN_COLLIDE"];
_g addItemCargoGlobal [uniform _unit,1];
_unit forceAddUniform (uniform cursorTarget);
removeUniform cursorTarget}, 1, 1, true, true, "", "uniform cursorTarget != ''"];
cursorTarget setVariable ["aUniform",true]
};
if (!isnil {itemCargo cursorTarget} && {count itemCargo cursorTarget > 0} && {isnil {cursortarget getVariable ["aUniform",nil]}}) exitWith {
if (["U_C",(itemcargo cursortarget select 0)] call BIS_fnc_inString) then {
cursorTarget addAction ["Wear civilian clothes", {
_unit = _this select 1;
_g = createVehicle ["weaponHolderSimulated", (_unit modelToWorld [0,-1,1] ), [], 0, "CAN_COLLIDE"];
_g addItemCargoGlobal [uniform _unit,1];
_unit forceAddUniform (itemCargo cursorTarget select 0);
deleteVehicle cursorTarget;
}, 1, 1, true, true, "", ""];
cursorTarget setVariable ["aUniform",true]};
};
if ((getText (configfile >> "CfgVehicles" >> typeOf cursorTarget >> "vehicleClass") == "itemsUniforms") && {isnil {cursortarget getVariable ["aUniform",nil]}}) exitWith {
cursorTarget addAction ["Wear civilian clothes", {
_unit = _this select 1;
_unit forceAddUniform ((typeof cursorTarget) select [5]);
deleteVehicle cursorTarget;
}, 1, 1, true, true, "", ""];
cursorTarget setVariable ["aUniform",true]};
};
}
}
You can surround code blocks with ``` at the beginning and end to make it look a bit better
OK
Yes. Thanks. Is there some wrap code to pass the 2000 character limitation?
I don't think so, but that length it's probably better to pastebin it or put it on a similar site and link it
OK
has someone tried creating brdige objects from tanoa?
createVehicle returns "Cannot create Non-AI vehicle", createSimpleObjects states shape cannot be opened
They probably don't have configs, but I was able to create one with createSimpleObject
What path were you using for the bridge?
they do
I use path from config
"\a3\blablabla"
that worked for other models previously
class Land_BridgeSea_01_pillar_F: Infrastructure_base_F
{
author = "Bohemia Interactive";
mapSize = 11.05;
_generalMacro = "Land_BridgeSea_01_pillar_F";
scope = 1;
scopeCurator = 0;
displayName = "BridgeSea_01_pillar";
model = "\A3\Structures_F_Exp\Infrastructure\Bridges\BridgeSea_01_pillar_F.p3d";
DLC = "Expansion";
icon = "iconObject_3x1";
editorSubcategory = "EdSubcat_Transportation";
editorCategory = "EdCat_Structures_Tanoa";
};
Hey guys, how does one init a script on fire of weapon or throw of grenade?
And here is just a hint that displays that information for you
player addEventHandler ["Fired", {
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
hint formatText [
"%1%2%3%4%5%6%7",
parseText format ["<t align='left'>unit:</t><t align='right'>%1</t><br />", _unit],
parseText format ["<t align='left'>weapon:</t><t align='right'>%1</t><br />", _weapon],
parseText format ["<t align='left'>muzzle:</t><t align='right'>%1</t><br />", _muzzle],
parseText format ["<t align='left'>mode:</t><t align='right'>%1</t><br />", _mode],
parseText format ["<t align='left'>ammo:</t><t align='right'>%1</t><br />", _ammo],
parseText format ["<t align='left'>magazine:</t><t align='right'>%1</t><br />", _magazine],
parseText format ["<t align='left'>projectile:</t><t align='right'>%1</t><br />", _projectile]
];
}];
@vital onyx I was able to spawn that bridge with createVehicle with no issues. However, it appears you can't use the path "\A3\Structures_F_Exp\Infrastructure\Bridges\BridgeSea_01_pillar_F.p3d" for createSimpleObject, instead you need to remove the leading \ and then it would be "A3\Structures_F_Exp\Infrastructure\Bridges\BridgeSea_01_pillar_F.p3d"
createSimpleObject is one of those commands who have to not have the leading slash
Do you know of any configs or commands where a leading slash is required?
model
picture
commands: execVM, preprocessFile(LineNumbers)
^ if you don't use the leading slash with those commands, the files are taken from the mission folder
same with ctrlSetText for RscPicture
playSound3D on the other hand has to not have the leading slash either
my favourite example of this inconsistency is CfgSounds
NOTE: Since Arma 3 v1.49.131710 it is possible to define AddOn sounds in mission config. In order to make engine look for the sound in AddOn, the sound path must start with @ (instead of \) for example:
sound[] = {"@a3\Ui_F_Curator\Data\Sound\CfgSound\visionMode", 0.8, 1};
Is the leading slash really needed for models? I've never had an issue with not using it
@native hemlock @little eagle thanks for heads up about leading backslash
trying it now
Is there a limit of how many elements an array can hold?
Nice lol
Does anyone know of a simple way to add just radio static to a chat message? In arma 1 if you didnt specify a sound it just used the blank radio static while the text was displayed, any ideas on how to do that in A3?
@zealous solstice It's not 999,999, it's 9,999,999
they changed it in a update
@native hemlock is there an actual use case for having in array more than 100k elements?
nine millions nine hundred ninety nine thousand nine hundred ninety nine
only unitplay comes to mind
Well for the all in one config dump you run into something larger than that
No, not in day to day play
put entire configFile to array?
Yes, but it's not as simple as _allConfigs = configFile;
The original script just had each line in the config as another element in the array, and then at the end joined it into one giant string
However there was a limit to strings introduced in one of the recent updates so that no longer works
hmm, and that mission posted here previsouly which uses dll extension to dump it to file - is not it a better approach?
That is the new approach
And you might be referring to my post
Going to update them once 1.62 is actually out
Oh lord I just noticed the forums destroyed the line breaks on the script
@native hemlock the scriΓΌt you posted will never work
- in a script file it is just 1 line am all commented out
- the debug console dont allow Comments π
I fixed the formatting.
@zealous solstice
- Read my previous message...
- Of course not, but that's like me pulling a script from CBA github with comments and saying how it doesn't work
i more connected the points why its not work π
And arrays definitely can still be 9,999,999
array = [];
arrayHandle_ID = addMissionEventhandler ["EachFrame", {
while {!(count array isEqualTo 9999999)} do {
array pushBack 1;
};
hintSilent (count array call BIS_fnc_numberText);
if(count array isEqualTo 9999999) then {
removeMissionEventHandler ["EachFrame", arrayHandle_ID];
};
}];
Once it has reached 9,999,999 if you do array pushBack 1; you will get an error saying "Max array size would be reached. Current size: 9999999, wanted size: 10000000"
that seems stupid i wonder who came up with that limit
complain to the assholes that loved creating massive arrays to fuck up other people's game
what like PV spam massive arrays?
yep
Anyone tried out using https://community.bistudio.com/wiki/registerRemoteExecFunc
Documentation is abit blah :P
Do you need to run this anywere the function can be remotecalled on (i.e the target machine) ?
Why can it fail ? Is it like setOwner commands were you need to just keep retrying till it works?
type the func in debug console and check if supportInfo has anything on it
Scripting help shows exactly what is on the wiki
it still seems to me putting such a limit on array size is a poor solution, they might have added server options for limiting PV frequency and size instead
strange why one may need so big arrays, use databases instead
oh i'm not saying there exists a real need for arrays larger than 10e7-1 in SQF, just that the limit seems completely arbitrary and makes no sense whatsoever
fix'd
and 2^32-1 unsigned
2^24-1 might have made sense, it's the largest integer 32 bit float can represent
that's something like 16.6m
iirc
what is also hilarious is that somehow you STILL have to convert RGBA values manually
because apparently the engine can't divide by 256
(more like it's too late to change now)
what, having to give RGBA values in [0,1] range?
since we're dealing with floats to me that makes far more sense than [0,255]
it's a pita
only reason RGBA is usually represented by values in [0,255] is because that's the range of an 8 bit byte
I believe I'm fighting a locality issue here, but I have something of a target range with randomly spawning targets owned by the server, and I can't nullify damage by returning 0 on a handleDamage eventhandler local to the unit
Is damage applied by the damage dealer, or does the damage receiver acknowledge it's received damage and apply it to itself?
@shrewd lichen https://en.wikipedia.org/wiki/SUBST
@lean tiger use handleDamage on the client that owns the object, i.e. on the server
@shrewd lichen yes, you choose P:\ drive location in the tools options menu
preferences\Options\Path to your P drive
Register it to the settings, then mount it
im trying to override a modelOptics with blank. it used to work before APEX but not now, any clues?
modelOptics = "";
i have tried the "-" from ther wiki, but that doesnt seem to do the trick either.
Probably more of a #arma3_config kind of thing, but could you post the whole config
Also check and see in the config browser what the value is
My guess is that your config is loading before what it is overwriting
Any info on the new action menu magic used in the co-op campaign ?
(the spiny circle), it's probably the same tech from revive but in engine.
Check out a3\functions\holdactions\
There is a holdActionAdd and holdActionRemove
π
lol 15 possible parameters for holdActionAdd
oh nice they learned to use params, finally
works nice http://puu.sh/pYNRl/bc8289ac70.jpg
for those that wonder:
setUnconscious break units inside vehicles, you cannot eject the player from it.
Hi, I just need a real quick confirmation. Using a local variable won't work inside of a 'for loop' if it's defined outside of the loop scope right?
it will.
Okay thanks
is it possible to detect a key press in 3den? e.g when delete is pressed, call this function
use the keyDown EH
i'd need to find 3den's display idd right? how would i go about that?
no need to, pretty sure there's a command to check if you're in 3DEN
is3DEN or something like that
yea but you might be typing in your mission name for example
but don't EHs need the ctrl or display ID?
gimme a sec i'll try to find it
you da man
lol
i wonder how many arma modding man hours have been wasted on things BI could have documented in about 3 seconds
do you literally have to dig through vanilla configs to find display ids? there's no better way?
I see a class Display3DEN with the idd 313? Is that it?
I have the whole game extracted (or at least the relevant parts) + all readable files dumbed to a couple of big text files + windows search enabled for .sqf .cpp etc.
Makes searching through the vanilla stuff much easier.
@sacred fox you should use modelOptics = "\A3\Weapons_F\empty"; if you want blank modelOptics
has anyone got a chance to enable BIS revive after recent update?
@rancid ruin does the IDD show up from allDisplays?
why yes it does, good to know, thanks
Would using an eventhandler for when A's object is removed work? https://community.bistudio.com/wiki/Arma_3:_Event_Handlers:_Eden_Editor check out the last entry at the bottom
i already did what i was trying to do
_key = _this select 1;
if (_key == 211) then {
_pos = getMousePosition;
_wPos = screenToWorld _pos;
systemChat format["%1%2", str _this, str _wPos];
_nearObjs = nearestTerrainObjects [_wPos, [], 15];
if ((count _nearObjs) > 0) then {
(_nearObjs select 0) hideObjectGlobal true;
};
};
}];
Can anyone best explain the value limits in setVectorDirAndUp? I understand their values in relation to 3d space but what are max/min values? Is it in degrees - 0-360 or is it -1 to 1?
Since it is vectors, -1 to 1.
You can also use trig to convert from degrees to vector
Thanks, just found Killzone's blog post about it too.
Since it is vectors, -1 to 1.
invalid practically ...
they are vectors
their practical range is from (β, β)
Well π
anyone here know if disableSerialisation is not supported in functions?
afaik serialization doesn't apply to functions / unscheduled
disableSerialization;
myHintC = _myDisplay createDisplay "RscDisplayHintCEx";```
this code gives me this error...
`19:11:12 Warning Message: Variable 'myHintC' does not support serialization and should not be stored in the mission namespace.`
use spawn instead
will try, thanks
well its not executed in a mission but in buldozer so.. merkel would say thats "neuland" π
hmm spawn does not work
you can use uiNamespace instead then
same error...
myHintC is a global var
it's probably not allowed to disable serialization on those
just a guess though ^^
Yo dudes, I'm using F3, trying to get the gearscript to give different colour smokes to different players depending on squad
I'm trying to do this by if statements checking the group _unit
But I can't get it to work
Anyone got any tips?
show us your code so far