#arma3_scripting
1 messages Β· Page 437 of 1
im thinking of making a mini api for it.
You pass that from discord to Arma? @wary vine
How is that related to parseNumber though π
you can use setListBoxData stuff. To set the price as raw number
instead of parsing it from the text
yeah
I'm saying don't use ctrlText
There is no reason to parse the human readable variant.
just store the machine readable one. and use that
dw im a dumbass
buuuut ded, both are human readable π«
why dont i just take the price they have entered, and work out the tax from that -.-
Or just go with the variant that is human and machine readable
Like the departing plane emoticon
one last thing, what do you think I should change about the ui ?
both human and machine know that'll mean a million $
the orange is done with defines
so I can change it to what ever I want and all dialogs will change with it π
I wish the units wouldn't fidget around so much
disable movement xD
compact mode
oh I mean the player controlled units - I'm just trying to figure out some cutscenes but they always start waving around and standing on one leg
aggressively short idle times
Is there an easy way to change the side of an UAV like the Mk21 Centurion?
yes
spawn without crew
then, spawn a man of the appropriate side, drag it into the turret like you would into any other vehicle
Oh well, that was so easy that I didn't think about it. Thanks alot!
does anyone know of a way to disable the grid position & height that follows your cursor on the main map? There doesn't seem to be a description.ext, difficulty option or script command that controls it
awesome, found it
If anyone's interested:
((findDisplay 12) displayCtrl 1016) ctrlShow false;
hi i use the following command to make my support have only 1 HE round, but when i test in mission
I can call my round, the operator tells me that it's inbound, i can see the marker on my map, but the shot is never deliverd.... do you have an idea why?
ART1 removeMagazinesTurret ["RHS_mag_m1_he_12",[0]];
ART1 addMagazine ["RHS_mag_m1_he_12", 1];
Have you stood by the gun and actually see if it ever shot the projectile?
i will try now
Because if they don't shoot it, I imagine that's got something to do with why it doesn't land.
So then it means your round isn't landing or landing where you want.
that's strange because i have a clear sight on the marked area and it's surrounding
and the splash message is never to be delivered
...
WAIT.
What's the projectile lifetime?
(not that I think they'd overlook that)
But that's about the only thing I can think of, bar their own scripting.
I have a little bird helicopter attach to a platform but when i detatch the helicopter the helicopter starts boucing to end up blowing up. i already attached the helicopter like 2 feet above the platform and still bounce and blows up
Try setting velocity or something
@wide gulch https://community.bistudio.com/wiki/addMagazineTurret
also possible with arty you need this https://community.bistudio.com/wiki/reload
@meager heart i don't how, but it worked after i rebooted my pc, without changing anything...
anyway it wasn't the problem it worked perfectly from the number of specific ammunitions desired to the confirmation that the shot was fired... the only problem it's the round was lost between its point of departure and the final destination
there was not even a "splash out" msg, and i checked the shot was fired...
If adding a magazine to an empty artillery support with this command in ArmA 3, use https://community.bistudio.com/wiki/reload If you do not reload, Artillery calls will not fire rounds, because the AI won't reload automatically (tested with 82mm mortar)
```comments on `reload` page ^
but it works now
actually there is 1 single round in the arty
so maybe that's why
the idea is to give support to an assault, with 1 arty piece with 1 round of he and an other peice with full magazin of smoke.... and only 1 arty pieces because more would too powerfull for the scale and i can't use mortar
also RHS_mag_m1_he_12 < afaik that is 12 rounds in magazine
yes that's why i use
ART1 addMagazine ["RHS_mag_m1_he_12", 1];
1 mag with 1 round
i spent 2 hours to figure out how to have 1 round in an arty piece... maybe because i'm a beginner...
but it works
you need use this addMagazineTurret
_vehicle addMagazineTurret ["RHS_mag_m1_he_12",[0],1]; //--- 1 magazine for turret [0] with 1 round
also you can check it with
systemChat str (getArtilleryAmmo [arty_name]);
or hint or copyToClipboard ^
ok you're right i just tested, i was made it works... but i guess i changed something...
but that's still funny that AI makes the fire animation
thank you
still the same it doesn't land
and when i play the arty operator the round is loaded
try reload it maybe
ok i figured out
it was because the arty was out of the map, on a platform on the sea
i relocated it and it works
nice
π thank you for your help, and to make me check, because for me it was working
Can you have a href link on a button? Or do you need a structured text control
Structured Text Control, but you can always just make that transparent and put it over some other "button" like control.
Alright thanks, I think I might do that
@little eagle Is it possible to make the whole structured text clickable for the link, rather than just the actual text? If not, ill just put some large hidden text instead
Doubt it.
Alright all good
So I'm now trying to align an image in a structured text vertically in it's box (RscStructuredText with background) using the method on the wiki of adding a padding blank line, but for some reason the following code does nothung unless I increase the size of the padding however that just pushes it right down:
private _template = "<t size='0.5'> </t><t align='center' size='3'><a href='%1'><img image='content\icons\pauseMenu\%2'/></a></t>";
private _link = "www.google.com";
private _icon = "test.paa";
private _ctrlButton = _display ctrlCreate ["ctrlStructuredText", -1];
_ctrlButton ctrlSetStructuredText (parseText (format [_template, _link, _icon]));
_ctrlButton ctrlSetBackgroundColor [0, 0, 0, 0.8];
_ctrlButton ctrlCommit 0;
Different idea. Make the structured text control tiny (0,0) and activate it indirectly by an actual button using ctrlActivate.
So when the button is clicked, activate the structured text control?
Does anybody knows why insignias wont show in the objects virtual arsenal?
So when the button is clicked, activate the structured text control?
Yes.
Okay ill give that a go now
WORKS, does it show face and voice, but not the insignia or none of the 3?
it doesn't show face, voice and insignia
when you place a box in eden editor you have an arsenal option
Put
BIS_fnc_arsenal_fullArsenal = true;
into the init.sqf file.
but that will open full arsenal i need to restrict the virtual arsenal
only to show specific stuff
Have you tried it?
1 sec
possible to make a uav exclusive to only one specific player? (other players on same team dont see it in the terminal list or can cursor control it)
didn't work
Did it do anything?
nope
Open the debug console, enter BIS_fnc_arsenal_fullArsenal = true; and press LOCAL EXEC and try again.
Can you post the code of your mission that handles the arsenal please?
Which box?
and in the Object Equipment storage i choose arsenal
Ah.
Well, how do you limit it?
No, sounds like a pain.
it does
And there it doesn't give you the option to select insignia?
but no insignia, voice and face
yeah
wow this is crap
even if i put this code in the init box
[myBox,["arifle_MX_F","arifle_MX_SW_F","arifle_MXC_F"],true] call BIS_fnc_addVirtualWeaponCargo;
it opens the arsenal but still no face and no insignia or face
why BIS has to make everything so complicated ?
When arsenal is opened, BIS_fnc_arsenal_fullArsenal is set to whatever is passed to the function, so forcing that variable before wont do anything
You sure?
Yeah
missionnamespace setvariable ["BIS_fnc_arsenal_fullArsenal",[_this,0,false,[false]] call bis_fnc_param];
I see.
By the way, ctrlActivate doesn't seem to activate structured texts unfortunately π¦ Oh well, im sure ill figure out some other workaround
Weird. I swear some people used that before.
So i'm going to do a script for a custom arsenal?
This is part of the code for arsenal:
if (_fullVersion && !is3DEN) then {
inside there it adds insignias
So try running the mission outside 3den
Wiki say enableDynamicSimulation works "for given non AI object". What to use for AI then?
that code goes where?
And for reference _fullVersion = missionnamespace getvariable ["BIS_fnc_arsenal_fullArsenal",false];
bis_fnc_arsenal_data = nil; missionnamespace setvariable ["BIS_fnc_arsenal_fullArsenal",true];["Open",true] spawn BIS_fnc_arsenal; This is the code that I use
I guess clearning the arsenal_data is important
So try what commy2 and shadowranger suggested, and run it outside 3den.
yeah that opens a full arsenal
but not what i need
i need to have a custom arsenal
where i can choose weapons and guns
i don't need all the waepons
i don't need all the uniforms
get it?
Well, the insignia, face and voice button is behind a is3den, so...
Yeah..
Just use ACE Arsenal and be done with it FFS
I tried the white listing, but the button to toggle to go to the insignia is hidden anyway.
fun fact, vanilla arsenal whitelisting is bugged anyways
so even if you whitelist you'll still be able to easily bypass it or load loadouts that don't have whitelisted stuff
that sucks..
you have to check "allowed" items when exiting arsenal
Can't you disable the Load button?
no idea,
For personalization in MP, please use squad logo defined by squad.xml . Insignia is intended to be set by mission (i.e., by mission designer, by Group Management, or by any other system).
Karel MoΕickΓ½
want me to tell you something?
open the stupid arsenal
and keep pressing Shift
you'll get to the invisible insignia
voice and face
lol
Can't you disable the Load button?
/// Buttons ID's ///
// HIDE 44151 //
// RANDOM 44150 //
// SAVE 44146 //
// LOAD 44147 //
// EXPORT 44148 //
// IMPORT 44149 //
// TRY 44346 //
/////////////////////
[
missionNamespace, "arsenalOpened", {
params ["_display"];
_display displayAddEventHandler ["keydown", {_this select 3}];
{
(_display displayCtrl _x) ctrlEnable false;
(_display displayCtrl _x) ctrlShow false;
} forEach [44151, 44150, 44146, 44147, 44148, 44149, 44346];
}
] call BIS_fnc_addScriptedEventHandler;
Β―_(γ)_/Β―
So i place a metal locker and in its Object: Equipment storage i select item by item. then after that when i open the arsenal i keep pressing shift till i get the voice, face or insignia option haha
better use ace arsenal, BullsEyE|WORKS π
talking about ace mod?
you will have less troubles
@little eagle It turns out RscShortcutButton has a url field which can be defined in a class definition. Only downside is there's no scripting command to set it, but I can work with that.
nice.
Just showing the buttons doesn't fix it either, because this is how they're "disabled":
_ctrl ctrlsetposition [0,0,0,0];
_ctrl ctrlcommit 0;
So they aren't disabled, just made zero width and height.
Which is reasonable, but you also have to disable them, otherwise they can be reached by shortcut.
This is done for:
IDC_RSCDISPLAYARSENAL_TAB_FACE,
IDC_RSCDISPLAYARSENAL_TAB_VOICE,
IDC_RSCDISPLAYARSENAL_TAB_INSIGNIA
if
if (_fullVersion && !is3DEN) then {
is NOT true, so if either not in 3den OR the full version is enabled.
Use ctrlEnable false instead
I guess ace arsenal it is.
This code is extremely hard to read, because of the high number of indents and if's inside if's inside if's.
One cool thing is this function tho:
["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0,0.5]] call bis_fnc_textTiles;
Idk, I find it amazing.
don't forget their infatuation with uiNamespace
Well if it exists, you have to use it. Right???
what if that is... bad thing ? π€
hahahahahah
I made ACE Arsenal, do you know why I did?
because BIS wasn't fixing it and everybody thought it was too much work, so I made mine instead
That's called a good scripter, because mostly nothing of BIS can fit your purposes.
[missionNamespace, "ArsenalOpened", {
params ["_display"];
{
private _ctrlCompass = _display displayCtrl (13 + _x);
private _ctrlWatch = _display displayCtrl (14 + _x);
private _ctrlFace = _display displayCtrl (15 + _x);
private _ctrlVoice = _display displayCtrl (16 + _x);
private _ctrlInsignia = _display displayCtrl (17 + _x);
ctrlPosition _ctrlCompass params ["_left", "_top", "_width", "_height"];
ctrlPosition _ctrlWatch params ["", "_offset"];
_offset = _offset - _top;
_top = _top + 2 * _offset;
{
_x ctrlSetPosition [_left, _top + _offset * _forEachIndex, _width, _height];
_x ctrlCommit 0;
_x ctrlEnable true;
_x ctrlShow true;
} forEach [_ctrlFace, _ctrlVoice, _ctrlInsignia];
} forEach [930, 900, 830];
}] call BIS_fnc_addScriptedEventHandler;
This brings back the buttons, but they don't work when I click on them.
mm
But yeah, the arsenal is bad. That's nothing new.
ace arsenal standalone... expected/planned ? π€
Define "standalone".
You can delete the rest already.
You need main, common and the interaction menu I think though. The rest can be deleted.
roger
Guys said this https://gyazo.com/c9db82be251c75a76830ba3321cbb25c π
Traslation: "commy and guys (from ace team) are... nice"
there one word is... lets say impossible to translate lol
I recognize my name and towarisch, but the last one could still be a slur.
meaning is above and that word is swearing... π
I wonder whether that was meant positive, or was deserved.
I'm joking of couse. And I don't want to die of Polonium poisoning.
lol
is there a command to get AI to fly at set ASL height?
im having issues with my server profile. the hosting company says its set up properly but the effects are not being applied when we logon. is there something i need to do to the files in my pbo? some setting i have to set before i package my files up? i am trying to use a custom profile.
[player, [param, false]] remoteExec ["someCommand",-2, true];
if I execute this from a client would player be the client who remoteExec'd or the player its being executed on?
is there a way to make it the new machine?
Yes, remoteExec a function instead
i may have an odd question, but whats up with running code in uinamespace ?
any benefits?
it's where you store stuff
So I don't really know what you mean.
If you mean the with command. Then that just sets the default namespace
But you usually don't run scripts where every variable is in UI namespace
with is what i meant
Yeah. It just changes the default namespace
aka when you do globalVariable = true is equals currentNamespace setVariable ["globalVariable", true]
with just changes the currentNamespace
okay i was a bit confused by that after looking into the bis arsenal script
they just store functions in uiNamespace for the lulz
You're not the only one π
If you want to look at something to learn from it.. Stay away from BIS arsenal ^^
i already got that the bis arsenal is a bit... strange π i just wanted to know how they created the camera und the mouse controls <.<
the mouse controls?
You could also look at ACE Arsenal for that
you mean the floating icons?
Much easier to read. And has the same camera and mouse controls (aka mouse->camera movement)
ooooh
not UI controls, what dedmen said
actually that part is from BI, I just updated it a bit
looks like i have to look into the ace version ^^ (btw i so wish cba would stop messing with eden controls -.-)
thx dedmen
CBA messes with eden controls?
to be specific, the debug consol controls
i do like the bigger version, but i HATE the keybinding change -.-'
(and yeah just a part of eden/3den <.<" sorry for mixing it up)
hm.... I should remove that mention "lifted from BIS_arsenal" since then I rewrote most of it
If I were to add a stacked event handler for the event type "arsenalClosed" would I add the event handler to the arsenal object or the player? Is there a better solution besides checking if the display is open?
stacked EH????
BIS_fnc_addStackedEventHandler takes event type "arsenalClosed", I was curious
for vanilla it's a UI EH and for ACE it's a CBA one
missionNamespace afaik @subtle ore
Okay then.
well looks like the new cam pos is calculated every time the mouse moves and than updated... and thanks to a high "update rate" it looks rather smooth, or do i missed something?
yes^ but it's not smooth if the unit is moving
dedmen: yeah and that reattaching
alganthe: good to know ^^ but i belive it is designed for static/not moving objects π
As far as I'm aware, there's specific dialogue IDCs to correspond to different parts of an optic, for example where it says 'flir/bhot/whitehot', the rangefinder, the grid (in some cases), the FCS components, etc.
Is there a list of all these specific IDCs somewhere?
In the config.
Otherwise I have not seen such a list. Besides my IDD list https://gist.github.com/dedmen/bfa12ab3906ed0107d5e56396326c7d8
hello agian, was wondering if anyone knows of anything i could use to pull the class names of all items inside a vehicals cargo
how I can add my dll in battleye whitelist?
@marble basalt https://community.bistudio.com/wiki/getItemCargo
@safe forum Scroll down to Logistics, then first paragraph: https://dev.arma3.com/post/sitrep-00109
@hasty violet
I can't confirm this, but I was told that myvar = "something" is identical to missionNamespace setVariable ["myvar", "something"], so I'm not sure how different it really is.
Again, cannot confirm, but that's what I've been told.
Though I suppose you can't do my var = "something", while you can do missionNamespace setVariable ["my var", "something"];
I mean that works.
If you have to grab it from another client, I'd set it to public (third argument)
Well, you can do what I do-
Copious amounts of testing and file patching.
I mean, then you can absolutely just set it like...
unit setVariable ["earprotection", true, true]
then you can just... unit getVariable "earprotection"
Boom.
from what I remember, I had a problem with player variables resetting when they died and respawned
so I moved everything out into a namespace to avoid the entire issue
I don't remember exactly what broke - but it was enough to prompt the change
i'm stumped
I moved everything out into a namespace to avoid the entire issue
don't you see any issue with that sentence?
it was probably losing addActions, now that I think about it
it would probably crash or freeze the game (in the instance of that broken line of code being fixed and doing what he probably intended)
my experience, anyway. Maybe I just did it stupidly.
in scheduled
Yes, but if you run it as a function...
it's going to try and run 10000 cycles in one frame.
doesn't matter if it's in a func or not
Which makes your computer very sad.
only if it's in scheduled / unscheduled
hell, there's valid uses for while do loops in unscheduled
for while true loops tho?
Every time I've done it, it's bitten me in the ass so. Β―_(γ)_/Β―
just put a uiSleep in there to space out the processing and it's perfectly fine
But I think alganthe and I agree, try to avoid while true, if you can @hasty violet
yes^
Also, @lone glade, you've seen me in discord slack, me spouting nonsense is nothing new. :P
Er, ACE slack.
See what I mean?
π
but... just...
put a uiSleep in there to space out the processing and it's perfectly fine
A regular sleep command in scheduled space would work to keep the freezing to a larger minimum, but I'm not sure about uiSleep.
And even then, that only helps in scheduled.
if you want something to run every (possibly) 1 seconds yes
but you're not "spacing the processing"
That's fair.
space it out to once per second -_-
@hasty violet
Have you tried using a CBA PFH?
If you need to run something in such fashion like that, it's what I'd suggest.
So I don't think I know enough about my problem to google properly because I'm not having any luck.
When you create a module, how do you pass the direction it's facing to the function it calls?
@vapid drift
Can't you just use [getDir this] call <function>?
I don't think so
So I define the module in the config.cpp including the function = "functionName"
in the function it calls, I need to get the location and direction of the module that called it... does that make sense?
I don't see any reference of that in module frame work but I know it's possible
@vapid drift
Why not use a gamelogic?
Have that pass the information where the gamelogic is your position and direction.
So put the logic in the map and then the whole
[getDir this] call <function> business?
Yeah, so you'd have the logic named, e.g. 'GL'.
Then you get the arguments you need for your function, and pass with them getDir GL, getPos GL somewhere in the arguments.
Needless to say that the function being called needs to be written to handle those.
Kind of defeats the purpose of someone being able to just drop down a module though doesn't it?
Purpose of the module is defeated if it can't be used as intended, either.
Try and see if you can getPos/getDir somehow with the module itself.
Yeah, like I said though, it definitely can I'm just not sure how
The module itself is a config file
What module and what exactly are you trying to do?
nevermind, I figured it out
what was the solution?
you can access the logic itself from the called function on _this
_this select 0 specifically
_this returns arguments from a call.
So if it's fed [module, something, whatever], then yeah, _this select 0 is the first one in that array.
This was a custom created function
custom created module*
That's basically what I was trying to figure out... what exactly does it feed to the function it calls because I couldn't find that in the module framework
(sorry for jumping in), if you're unsure what a function returns, hint it's results via
hint str _this
@tardy ingot
I usually use hint format ["%1", _this], but yeah both do the same thing.
I find str to be amazinly helpfull
it will convert just about any type into a string instantly
aspect ratio doesnt effect safezone as far as I'm aware
my UI seems to stay the same regardless of any screen size (assuming I stay within the safezone)
My UI on something way lower https://steamuserimages-a.akamaihd.net/ugc/923674567849043925/C42AEEFDE6DC47DA766E4ADB617E19D153813A10/
Yes, but are those the same aspect ratio?
one is 16:9 one is 16:10
π€
the safe zone will keep everything basically centered
but you can override the safezone by just subtracting it
I'm considering having one edge of a control tied to absolute size and the other tied to the safe zone.
x = (safeZoneX+0.1) should give you 10% into the screen from the left of your screen
Well it really does depend on how complex your UI has to be
dealing with 'responsive' UI is a pain in the ass
It's a javelin.
well then in that case.... it might be best to useup all the actual UI, and just give the safezone a black ground
I dislike the way the ace lockon system works...
So in the case seen there, you have the window, and then the gate system targeting the window.
The problem is that inside the grey box, I don't want the aspect of that to stretch or contract, because that's supposed to represent a 1degree x 1degree FOV...
which if it's not square, then... it can't have a 1x1 aspect ratio as desired.
well if you use 0.5,0.5 as your x and y values you should get center screen regardless of safezone, it wont change size on other screens
or aspect ratios
I'm pretty sure it's basically a fixed size
The center I can find, that's not the issue.
The issue is if I go <x> to either side, but ALSO go <x> up and down...
if I use safe zones, will that still be square?
no
Hence.
So I'd have to go <x> to either side and <x * 4/3> up and down to keep it square?
Yeah you'd have to account for the current aspect ratio of the client
But from what that says, absolute coords are fixed to 4:3
Hmm.
As per refrence: https://community.bistudio.com/wikidata/images/a/ac/safezone.jpg
(I just noticed this was just posted my bad)
in that refrence the safe zones change depending on the aspect / resolution
Hence the problem.
yep you basically want to expand the safezone if I can gather?
size of the "safezone box" is the same on all screens and monitors, with the same aspect ratio 4:3, but the coordinates of the top left corner, of that box, is different for every screen zise / aspect ratio
ugh...
facedesk
I'll... probably be back to ask more questions once I think I /actually/ begin to understand what you guys have already shown. x.x
Ill sum it up
the things inside the safezone never change
ever
the values of everything outside the safezone change depending on resolutions or aspect ratios
the safezoneX and safezoneY variables will return the values from the screen borders to the start of the safearea
The safezone itself is centered, though, yes?
you can easily subtract the aspect ratio from these safezone values to create an artificial safezone for yourself, but this might have unexpected results across different resolutions as they breach the standards
yes
its fixed and centered
if you open the ingame GUI editor it's width and height is the safezone
Then why does the safezoneH and safezoneW extend beyond the monitor as in the image?
beacuse that value is the full width of the screen
it's just an example
if you subtract the safezone values it will be the full screen width
eliminate safezone X and Y to get the fullwidth of the screen space
So the safe zone values are constant, but the safezone width and height aren't?
correct
if you want to play with the full screen width and height
just base your default X and Y positions from safeZoneX and safeZoneY
safeZoneX + 0.1 will give you 10% from the left of the screen
right side of the screen
edge of the right side
safeZoneX - 0.1 will give you 10% from the right
So safezoneX + 1 is the right edge of that 4:3 box.
correct regardless of screen width or aspect
that's what I need.
Now...
does a rectangle with points at...
[safezoneX, safezone Y],
[safezoneX, safezoneY + 0.4],
[safezoneX + 0.3, safezoneY],
[safezoneX + 0.3, safezoneY + 0.4]
form a square?
Always?
if the aspect is 4:3
yes but safezoneX breaches the safezone
safezoneX is left of the screen
not the safezone
(yes its that confusing)
...
Arma theme plays
(OFP theme is better)
never4get
Ugh... mind if we go to PM and not clog the channel?
Sure
(I think my stupidity has done enough damage)
PURDGE THE LOGS!
@hasty violet two -- "true" condition can never be turned off. you'd have a hard time stopping that loop in some emergency
Incorrect in scheduled. terminate command.
@next lily it's going to try and run 10000 cycles in one frame. Only on unscheduled.
While true, I've found is a great way to tank FPS. Yeah well.. You either do nothing in scheduled. Or you freeze the game for a short time in unscheduled.
@tardy ingot I prefer systemChat str _this over hint str _this because hint always overwrites the last hint so if your function is called often... But I think systemChat might not work in SP?
it will convert just about any type into a string instantly "about any" == "any but Nil"
@still forum systemchat is quite hard to test with in SP so I tend to just unify my method and just "hint str" everything. However in recent months i've moved into testing within edens multiplayer environment to better avail of certen functionalities.
I may release a log like command that will draw multiline hints (stacked) for dule environment testing
Actually, while you're here @still forum, would you happen to know if a parsing function exsits for spotting syntax errors.. The default black error box is massively underwhelming I find.
yeah. There is a parsing function that shows you syntax errors. It's called compile π
Otherwise no. But there are external tools that let your IDE show you errors.
Google "SQF Lint"
Ty!
I use systemChat format ["mySuperCoolMessage | _variable: %1", _variable]; there I can quickly switch to systemChat/diag_log
I have a question regarding the 'in' command. Say for instance I have a variable set to a string (_var1 = "TestString1"), and have an array with 'TestString1' inside of one of the strings (_array1 = ["BlahBlah","TestString1 Blah Blah"]). If I was to use an if statement like this (if (_var1 in _array1) then {_result = true} else {_result = false}). Would _result return to true or false. So what I'm overall asking is does the in command check if the entire string is equal to the other entire string, or just checks if the keyword (TestString1) is inside of one of the arrays string.
false
because it doesn't contain the value TestString1
in just checks values
not contents of values in values
Strange, seeming I originally thought that to be true. But seem to be getting issues.
Wait nvm, ^ that's incorrect. My issue has to do with other functions calling my main one a long with my switch statement. My bad
Any ideas why sometimes when I call playSound on a couple of the Orange DLC sounds, I get "Warning Message: Sound Orange_vehicle_Alarm_Loop_01 not found", but other times it works?
a typo maybe? Or the exact same code?
Exact same code, its very weird.
weird indeed
any sure repro?
like, if I do that @home 50 times I will get at least one occurrence?
Like right now ive just reloaded my mission, and entered playSound "Orange_vehicle_Alarm_Loop_01"; in debug console and it gave me the error. It's hard to reproduce it working, because for me it seems random.
(also... no mods? not that it would really matter)
Yep, pure vanilla. Just tried in a plain mission (no scripts or anything), same thing. It doesnt seem to be with all Orange DLC sounds, just having problems with the alarm sound, but would need to go through them all to double check.
Might it be a bad download?
No wait, that's DLC, not a mod.
Heard of weirdness with downloads of content before though.
They can corrupt the same as mods.
But that wouldn't explain the "randomly not working". If it was corrupt it probably would never work
Fair point.
Might not hurt to verify integrity just in case, assuming it's steam.
Might catch some stuff you didn't know was going wonky on you.
After going through a few other sounds and returning to the bugged one, its now suddenly working again
Honestly don't know
I'm so stupid, just realised I was using the wrong sound name dont even know how I had it working sometimes and others not, actually was a typo surprised I didnt even realise because I specifically did check. Must be too tired lol
Hm.. a typo maybe? Or the exact same code?
@winter rose Had the right guess right at the first answer to your question then π
happens to everyone
Yeah he did, apologies
So I think I'm just missing something simple here...
When a player uses and action on an object, I realize it's executed locally
How can I have part of the code execute on the server? I'm not talking about globally... I mean specifically have the server execute a section of the code.
remoteExec
that will execute the code on each connected player correct? Or is that essentially the same thing?
No
Whatever you specify
https://community.bistudio.com/wiki/remoteExec
targets 0 is everyone. 2 is only server. -2 is everyone but server. And so on.
Thank you!
so i have been continuing my map and need to know a few scripts. 1 is how to make people lay-down on a military cot wounded.
How do I return the initbox stuff with a command?
2 is i need a town to be filled with citizens that wander.
@Ethramene consider ALiVE?
Can I use a command to return whatever is in the initbox in 3den ?
@peak plover you can't, there is set but no get
https://community.bistudio.com/wiki/setVehicleInit
also, disabled in A3
I'm not sure it is even related to init input
why would you need it though? it may be sign of a perfectible mission structure
you can read the sqm
Is there anything particular you need from it? Ie could you store it in a variable
Is there a known reason that I'm not aware of that would cause my functions to not fire properly until at least the second time that they're called?
Do I need to preprocess them or something?
Besides user error? no.
lol
Well, just a small example
ace_hearing_disableVolumeUpdate = true;
playMusic ["BackgroundTrack01_F_EPC", 24];
0 fadeMusic 0;
3 fadeMusic 1;
3 fadesound 0;
sleep 3;
The first time the function is called, the cutText, fadeMusic, and fadeSound all execute properly but the music doesn't play
the second time and beyond, the music plays
How much time between first and second call?
@vapid drift I had some issue with that. AFAIK if you try to input start seconds in some range (neagtive or over the music actual lenght) that might result in that next track can stop randomly.
@vapid drift Better use addMusicEventHandler to be consistent on your actions.
Ok, thanks
Is thre a https://community.bistudio.com/wiki/visibleMap visible Map command for GPS?
"Checks if client has GPS reciever enabled" is that for when its open tho i am confused
Will try indeed thanks
and I'll edit the wiki if you report back that's not the case π
@winter rose Well one things for sure, it's not lupus.
You can never be sure!
True, but. It's never been the case
Errr....you sure he didn't figure something out last moment? I'll have to rewatch it
Well that doset work. it allways turns out as true.
I checked it out too, confirmed. I think it is "is GPS enabled" (showGPS) and not a "is GPS visible on screen"
^ would make sense
Yeah
and this one -does- work with custom miniscreens!
@peak plover not sure, but maybe there's a #-like reference to an object kind. I don't even know where to find that list of kinds.
"EmptyDetector" @peak plover
@tough abyss If function is coming from addon - no, only addon.
rip thanks
Thx @cloud thunder I ended up going with typeOf and find
{
private _category = _x select 0;
private _sold = _x select 1;
private _title = _x select 2;
}forEach _arr;
{
_x params ["_category","_sold","_title"];
}forEach _arr;
pretty sure the second one should be ok to replace the first one right ? i remember using something like that before, but not sure.
o.O
The params one is the good one ^^
just trying to tidy up the code of my market...
because I have had to change it 40 milliontimes already xD
but so far its working well, so starting to finalize my backend π
{
_x params ["_category","","_listingTitle","_title","_items"];
_items params ["_itemClassname","_itemCategory"];
}forEach _arr;
``` so this should work right ?
if you're using an array of arrays yes
ty
well this is being pulled from the db ```
[""Houses"",""0"",""Listing Title"",""Listing Description"",[26,""house"",""Land_i_House_Big_02_V1_F"",[]],""""""76561198132926159"""""","""",""1231"",""1581""]]"*/
wow, that's string galore
Yeah, I have no idea what happened xD
it is diag_log'd
so extra "" anyway
Im just using it for reference.
{
_x params ["_itemCategory","","_listingTitle","_listingDesc","_items","","_price",""];
//just double checking _items is an array, not string.
if (_items isEqualType "") then {_items = call (compile _items)};
//Default Variables.
private _itemClassname = "";
//Get the Item classname.
if !((toLower _itemCategory) in ["vehicles","houses"]) then {
_itemClassname = (_items select 0) select 0;
} else {
_itemClassname = _items select 2;
};
//get the image.
private _displayImage = "";
if ((toLower _itemCategory) == "virtual items") then {
_displayImage = getText(missionconfigfile >> "virtualItems" >> _itemClassname >> "icon");
} else {
_displayImage = ([_itemClassname] call Life_fnc_fetchcfgdetails) select 2;
//Because meh..
if (_displayImage == "pictureStaticObject") then {_displayImage == ""};
};
//list the items.
_listbox lnbAddRow[_listingTitle,_itemCategory,_price];
_listbox lnbSetPicture[[_ForEachIndex,0],_displayImage];
}forEach _arr;
if ((lbSize _listbox <= 0)) then {
_listbox lnbAddRow["No Results Found","",""];
};
``` Look ok ?
No
I hate the inentation and the missing spaces before/after commands
also call compile... That's almost always dumb.
parseSimpleArray <--
your if/else for _itemClassname can be replaced by _itemClassname = if() then {_items select 0 select 0} else {_items select 2}
same for _displayImage
also you have a typo in the code of the Because meh... line
and it's _forEachIndex and not _ForEachIndex
your last if statement has one pair of parenthesis too many
and space after commands :3
Yeah.. ^ Like I said in my first comment.
The }forEach _arr triggers me the most. } forEach _arr FFS
Also if ((toLower _itemCategory) == "virtual items") then { No need for the toLower. because == is already case insensitive
keeps rambling on while walking to his bed and going to sleep
xD
it's just good to learn "early"
now if we could get a case insensitive variant of in that'd be nice (we have findIf but still)
also the wiki page for findIf:
https://community.bistudio.com/wiki/findIf
NOTE: Because command findIf terminates as soon as it finds an element that fulfills the condition, it is more efficient then count in scenarios where you need to check for presence / absence of at least one element that evaluates to true.
THATS WHAT IN IS FOOOOOR
with switch(case) aswell.
than*, btw
kek
{
_x params ["_itemCategory","","_listingTitle","_listingDesc","_items","","_price",""];
//just double checking _items is an array, not string.
if (_items isEqualType "") then {_items = parseSimpleArray str _items};
//Get the Item classname.
private _itemClassname = if !((toLower _itemCategory) in ["vehicles","houses"]) then {(_items select 0) select 0} else {_items select 2}
diag_log format ["%1", _itemClassname];
//get the image.
private _displayImage = if (_itemCategory == "virtual items") then {getText(missionconfigfile >> "virtualItems" >> _itemClassname >> "icon")} else {[_itemClassname] call Life_fnc_fetchcfgdetails) select 2};
//Because meh..
if (_displayImage == "pictureStaticObject") then {_displayImage == ""};
//list the items.
_listbox lnbAddRow[_listingTitle, _itemCategory, _price];
_listbox lnbSetPicture[[_forEachIndex, 0], _displayImage];
} forEach _arr;
``` any better π
do check if parseSimpleArray is actually faster with what you usually expect btw
like we ended up not switching because it was slower
also still lnbAddRow[_listingTitle
lnbAddRow [_listingTitle
xD
private _displayImage = if (_items select 0 isEqualType []) then {
if (((_items select 0) select 1) == "virtual items") then {getText(missionconfigfile >> "virtualItems" >> _itemClassname >> "icon")} else {([_itemClassname] call Life_fnc_fetchcfgdetails) select 2};
} else {
([_itemClassname] call Life_fnc_fetchcfgdetails) select 2;
};
``` had to change that part a bit xD
umm
https://gyazo.com/cbc1734452cb2cf566a83194ef152195
if (_displayImage == "pictureStaticObject") then {_displayImage == ""}; dafuq
["Land_i_House_Big_02_V1_F","House (Big, White)","pictureStaticObject",2,"Structures_Town",-1,"CfgVehicles",[],[],"",[],[],[],bin\config.bin/CfgVehicles/House_F,[]]
Anyone here good with ctrlcreate within controls groups ?
semi have it working...
the first button is a a config'd controls , this is just for base purposes
but the scrollbar isnt being created..
scrollbars only appear if the control group is smaller than its conents
https://gyazo.com/9e96bf194a22e520fc7068f1f018caed one problem fixed,
also make sure you're not using the noScrollbar types obviously
still missing the scrollbar
the scrollbar was there when I had premade controls.
but this is slightly more dynamic
make sure you try by just setting it to the height one of one button for example
nope xD
if (count _AllControls == 1) then {
_controlsGroupPos set [4,ctrlPosition (_buttonCtrlPos select 4)];
_controlsGroup ctrlSetPosition _controlsGroupPos;
_controlsGroup ctrlCommit 0;
};
4,c
:3
anyway that is how they work, confirm if you're actually them to the proper controls group
its not permanant.
etc etc
class Something
{
idd = 9991;
onLoad = "uiNamespace setVariable ['Something', _this select 0]";
onUnload = "uiNamespace setVariable ['Something', displayNull]";
duration = 99999999;
class controlBackground {};
class controls
{
class RscControlsGroup;
class RscText;
class RscStructuredText;
class ControlsGroup: Life_RscControlsGroup
{
idc = 9992;
x = 0.25 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.455 * safezoneW;
h = 0.55 * safezoneH;
class controlsBackground {
}
class Controls
{
};
};
};
};
_textCtrl = _display ctrlCreate ["Lega_ControlsGroupTextControl_Base", 9992];
_pictureCtrl = _display ctrlCreate ["Lega_ControlsGroupPictureControl_Base", 9992];
_backgroundCtrl = _display ctrlCreate ["Lega_ControlsGroupBackgroundControl_Base", 9992];
_buttonCtrl = _display ctrlCreate ["Lega_ControlsGroupButtonControl_Base", 9992];
its like there not actually being created in the group...
its working for the most part
_display ctrlCreate [_classToAdd, _idcOFCONTROLTOMAKE, _controlsGroup]
_display ctrlCreate ["Lega_ControlsGroupTextControl_Base", -1, _display displayCtrl 9992];
meh, UI coding can be tricky and there's not a lot who even bother
how do you add sound dialog to a character to make him say something
https://gyazo.com/d640387e86d9904fb19fed5f27ba3cc2 well this is fun... look at the first picture .
"sound dialog" π€
playSound3D ?
Trying to place a greyhawk drone but its an empty drone so i cannot control it?
yes, you need "crew", this will help https://community.bistudio.com/wiki/createVehicleCrew
@wary vine you should use mouseEnter and mouseExit on your controls to restore previous control attributes, to avoid blinking. Seems a bit sloppy when it blinks like that.
So I still can't figure out why this function isn't executing properly the first time. Once I fire it once, it does what it's supposed to but not until then:
The action that spawns it:
[[_pilot02, ["Test Me", {
["testMe"] spawn TFR_fnc_jumpHandler;
}]], "addAction", true, true] call BIS_fnc_MP;
And the section in the function that is spawned:
case "testMe": {
ace_hearing_disableVolumeUpdate = true;
playMusic ["BackgroundTrack01_F_EPC", 24];
sleep 5;
playMusic "";
ace_hearing_disableVolumeUpdate = false;
};
The first time I select the action, no music. The second and beyond, music for 5 seconds just like it's supposed to
is it possible to make a simple comboBox + btn dialogUI without defining classes in cfg/ext. just pure sqf?
bah so many magic numbers in dialogs >.< y no enums!
@lone glade inCI https://github.com/dedmen/Intercept_CBA/blob/master/src/SQFExtension/Utility.cpp#L149
@wary vine if (_displayImage == "pictureStaticObject") then {_displayImage == ""}; You don't see the typo in there?
Is it possible to get any sort of data about a #track (vehicle track) object? Im trying to determine what sound one is playing
with ctrlCreate you can create: https://community.bistudio.com/wiki/ctrlCreate/classnames
possible something is missed there ^ @lusty canyon
@meager heart so with those premade classes i can make UIs without cfg/hpp/cpp ?
yes
also check this https://community.bistudio.com/wiki/ctrlCreate
there is "NOTE"
man thats so complicated, i give up.
here's an easy question instead: how can you get the classname of a units equipped nvg?
great so i can do player unlinkItem (hmd player); and will also cover all nvg mods
next harder question: how can you build a continuous square wall enclosure based on a given 4 pos2d coords.
(positions based on player onmapclicks, not accurately aligned)
wut
ok so lets say i want to enclose a village on the map with hbar barricades.
player selects the desired "corners"
ClickOnMapEH = addMissionEventHandler ["MapSingleClick", {
_pos = (_this select 1);
}];
// player does that 4 times, saved in missionNS
so now how do you make a wall spanning those 4 corner points?
What happens to a vehicle created with createVehicleLocal if entered by a player in MP? Any issues might happen?
many, the vehicle is local only to the player so others wont see it
if the player disconnects, isn't the object transferred to the server btw?
@young current Mostly interested in netcode damage. Will it create some additional utilization?
that I do not know
why would you have only a local vehicle where player can enter?
The player will float in the air and drive a invisible vehicle
@young current Local events like SP quests in MP. Long story.
you may want to globally create, if I understand it properly another group may come to the other player's area
if they see a player interacting with nothing, they might freak out π
Well Im focused on that point that no one will see that events.. i hope :D. Like just a strange dude running in a field doing something you don't see.
Was actually interested in exactly local cars behaviour.
little secret stealth project with local vehicles π€
Or just other local stuff that gets attached to invisible vehicles like JSRS used to do way back when.
@meager heart pink panter music
π
soo, ran into an issue with ctrlCreate and buttons...
all the buttons are created fine... but apparently they all have the same btnSetaction, when I set it on the specific control, any idea's ?
i got it, had to format the function before hand.
Uhm... Wut? Please tell me you are not using buttonsetaction for that
Ctrladdeventhandler + buttonclick
does anybody knows where the map markers are located in the arma 3 root folder?
anyone?
I don't think so. Because if anyone who is here right now would know.. Why wouldn't he have told you yet?
\A3\ui_f\data\map\markers\nato\b_unknown.paa
ui_f_data pbo
yeah i need them to place them in a custom image
to display in a monitor
thanks dude
Quick way would've been to get a AIO config. And just CTRL+F for Marker
also a quick way to check what's in pbo's is "pbo manager" https://gyazo.com/b7841b0e5c75f0a56fb250be91cee722
Could someone check over this: I keep getting an error that "_u is not defined."
params [_u,_p];
_l = getUnitLoadout _this select 0;
_this select 1 setUnitLoadout _l;```
This file is called via a unit: sqf this addAction ["Get Loadout", {[_this,_this select 1] call CP_fnc_shareLoadout;}];
is everyone sleep? π¦
wrong syntax for params, also check wiki for theaddAction
Parameters array passed to the script upon activation in _this variable is: [target, caller, ID, arguments]
param - single element
params - array of elements
param [index, defaultValue, expectedDataTypes, expectedArrayCount];
params [
[index, defaultValue, expectedDataTypes, expectedArrayCount],
[index, defaultValue, expectedDataTypes, expectedArrayCount],
[index, defaultValue, expectedDataTypes, expectedArrayCount]
];
ah okay
Is there a way to check if a player has read a leaflet? I've used the BIS_fnc_initLeaflet function to make a map on the wall readable which is how the players get intel for their mission. Is there a way to check once it's read so I can then assign a task?
If i have an AI saying something with say3D ""; how can i make him stop saying it ?
@drowsy axle youβre also missing strings in params
too late, again π
Anyone had experience with CfgDisabledCommands ?
Trying to disable allMapMarkers and markerText commands:
class CfgDisabledCommands {
class ALLMAPMARKERS {
class SYNTAX1 {
targets[] = {0,0,0};
args[] = {{},{}};
};
};
class MARKERTEXT {
class SYNTAX1 {
targets[] = {0,0,0};
args[] = {{},{"STRING"}};
};
};
};
markerText is disabled, allMapMarkers still works. Any ideas?
well it has 0 args. So maybe leave args array empty?
instead of array of two empty arrays
Gonna give it a try.
Simply open debug console and type utils 1 then click on LOCAL EXEC (available since Arma 3 v1.67) it will generate all possible args structure. You just gonna need to change specifics
Nope, didn't help. Also tried removing args completely before, didn't work.
Thats exactly how I got this config originally @unborn ether
class ALLMAPMARKERS {
targets[] = {0,0,0};
};
worked
Mark that on Wiki if config generator is doing that wrong
from the wiki
If a command doesn't have left arguments, or right arguments the correct syntax is:
class CfgDisabledCommands
{
class ALLPLAYERS
{
targets[] = {1,1,1};
};
};
nothing wrong there π€·
thanks @cedar kindle
Is it possible to make the pilot of an helicopter "movable" like the driver of a tank if i am the commander?
no bren, you can't swap seats in helos
at least not from single seat compartments like pilot and copilot seats
yeah i am aware of that. But the commander is ordering the driver by commands. I thought maybe there is a way for the gunner to do the same with the pilot.
yeah but i see how i put it wrong in my first sentence.
I meant steering the helicopter as gunner by giving the pilot move commands (like the tank commander gives orders to AI driver)
Nope
π
Does anyone know how to get started with EXTDB(3) for database connections?
I'm looking to make a persistent mission.
Read their docs. Simple as that. @drowsy axle
Where do I find them? @rotund cypress
It only has a few pointers on their bitbucket
Am I looking at the wrong area, because none of the link under the wiki or anywhere else, actually explain anything.
@drowsy axle https://bitbucket.org/torndeco/extdb3/wiki/Contents there you go
Thanks @hidden field
does anybody here knows about how the TAOR Markers work for Alive?
Could someone proof-read this for me? ```sqf
private _nearbyLocations = nearestLocations [player, ["NameCity","NameCityCapital","NameMarine","NameVillage","NameLocal"], 100];
private _weaponArray = [
"srifle_DMR_05_blk_F",
"arifle_Katiba_F",
"srifle_DMR_06_olive_F",
"arifle_Mk20_F",
"arifle_MX_SW_F",
"hgun_PDW2000_F",
"LMG_Zafir_F"
];
private _itemBoxArray = [];
private _houseArray = _nearbyLocations nearObjects ["house", 100 ];
{
private _buildingPositions = [_x] call BIS_fnc_buildingPositions;
{
private _weapon = selectRandom _weaponArray;
private _itemBox = "WeaponHolderSimulated" createVehicle [0,0,0];
_itemBox setPos _x;
_itemBox addWeaponCargoGlobal [_weapon, 1];
private _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
private _mag = _magazines select (floor (random (count _magazines)));
_itemBox addMagazineCargoGlobal [_mag, 5];
_itemBoxArray = _itemBoxArray + [_itemBox];
private _markerDebugCreate = createMarker ["WeaponDebugMarker", _x];
private _markerDebugType = "WeaponDebugMarker" setMarkerType "Dot";
private _markerDebugColor = "WeaponDebugMarker" setMarkerColor "RED";
} forEach _buildingPositions;
} forEach _houseArray;
sleep 120;
{
deleteVehicle _x;
hint "Items (at a distance greater than 250m) have been deleted, successfully!";
} forEach _itemBoxArray;``` Called as a function ([] call CP_fnc_markerLoot;). Keeps saying that "sleep 120;" has an "Error: Generic error in expression".
private _houseArray = private _nearbyLocations nearObjects ["house", 100 ];
sounds wrong
private _houseArray = _nearbyLocations nearObjects ["house", 100 ];
@drowsy axle Spaces in classnames in _weaponsArray
I saw them @still forum Changed.
private _weapon = _weaponArray select (floor (random (count _weaponArray))); -> private _weapon = selectRandom _weaponArray;
Changed. Thank you.
Anything else?
Would changing "house" to "house_f" change anything/be wrong?
Β―_(γ)_/Β―
Yes. Changing something will change something.
If that will be wrong I don't know
Okay π
Does: private _nearbyLocations = nearestLocations [player, ["NameCity","NameCityCapital","NameMarine","NameVillage","NameLocal"], 100]; return as an array or a position?
Changed to: ```sqf
private _nearbyLocations = nearestLocations [player, ["NameCity","NameCityCapital","NameMarine","NameVillage","NameLocal"], 100];
private _weaponArray = [
"srifle_DMR_05_blk_F",
"arifle_Katiba_F",
"srifle_DMR_06_olive_F",
"arifle_Mk20_F",
"arifle_MX_SW_F",
"hgun_PDW2000_F",
"LMG_Zafir_F"
];
private _itemBoxArray = [];
//private _houseArray = _nearbyLocations nearObjects ["house", 100];
{
private _houseArray = _x nearObjects ["house", 100];
{
private _buildingPositions = [_x] call BIS_fnc_buildingPositions;
{
private _weapon = selectRandom _weaponArray;
private _itemBox = "WeaponHolderSimulated" createVehicle [0,0,0];
_itemBox setPos _x;
_itemBox addWeaponCargoGlobal [_weapon, 1];
private _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
private _mag = _magazines select (floor (random (count _magazines)));
_itemBox addMagazineCargoGlobal [_mag, 5];
_itemBoxArray = _itemBoxArray + [_itemBox];
private _markerDebugCreate = createMarker ["WeaponDebugMarker", _x];
private _markerDebugType = "WeaponDebugMarker" setMarkerType "Dot";
private _markerDebugColor = "WeaponDebugMarker" setMarkerColor "RED";
} forEach _buildingPositions;
} forEach _houseArray;
} forEach _nearbyLocations;
sleep 120;
{
deleteVehicle _x;
hint "Items (at a distance greater than 250m) have been deleted, successfully!";
} forEach _itemBoxArray;```
A position is an array.. So...
Yes. π I know.
Is having a foreach for the _nearbyLoc going to make the _x be the position of each location, that is 100m around the player?
hey guys i have a little problem i use a painting script for exile and i wanna change the permission for it to specific UIDs i tried it with this:
but it doesnt work for me can someone help me pls `?
yes
If you click on the "location" link on the wiki page you'll get more info about it. And at the bottom of the page you'll see related script commands. One of them being how to get the position of the location
What does "doesnt work" mean? @pseudo cypress
You are sending a variable either to everyone or no one
@still forum everyone can use the painting
sry im very very new in scripting so if i change all the true to false it should work? or just the last one on the end ?
If you set it to false then no-one will be able to use that. Besides who executes that script.
hmm so how can i change it that just the UIDs can use it ? -
Sure
missionNamespace setVariable[_function, compileFinal preprocessFileLineNumbers format["%1\%2.sqf",_path,_function], _client];
->
missionNamespace setVariable[_function, compileFinal format ["if !((getPlayerUID player) in %1) exitWith {}; %2",admins,preprocessFileLineNumbers format["%1\%2.sqf",_path,_function]], true];
sry if im asking so much dumb question but where should it put it in ?
ah oh crap didnt saw your first message :/ sryyy
I could not find anything related to BIS_Disabled_Door in the wiki, I wanna find more about commands related to doors, were i can find it?
until the namespace is cleared
so mission restart for missionNamespace, game restart for UI and profileNamespace
.... just why the fuck are you not using CfgFunctions
the whole idea is wrong
again, use CfgFunctions, be it a "script" or an addon, use it.
because you don't have to compile them yourself? because it's easier to maintain? because it's straight up better?
DAC is seriously outdated
and bugged
...
it wasn't tho
K
just do your thing.
seriously ... CfgFunctions is way easier then this
"include in file XYZ"
instead of include this "functions_mygenericscriptaddon.hpp" file into your description.exts function section
the fuck am I reading
so you fucked up your script
cool
no, that is something different completly
there is only one reason to not use cfgfunctions right now and that is for self-implemented headers/footers
as that is not implementable using cfgfunctions as of right now
or if you don't want clients to compile those funcs because whatever
they have to use them at some point @lone glade
always
both are questionable too.
so to come back to the point: telling the user "just do what you need to always do, #include "functionsfileformyscript.hpp" in the description.exts cfgFunctions section
and done
and in your pre/post-init script you then do whatever is needed
eg. use spawn to start a script scheduler instance
[] execVM "wh\earplugs\wh_earplugInit.sqf"; this is wrong
lemme repeat @hasty violet
you did not understood either how SQF works or how cfgfunctions works
that's not how CfgFunctions works
at all
did I link the wrong section?
oh shit I did
see what X39 linked^
no, it is THE way how to do that
execVM etc. are all not to be used for scripters
add either a preinit or a postinit and spawn the script in there
done
oh, shit no I found what his actual issue is X39
not consider, learn it
I am trying to make my missions DLC free so is there i way i can remove DLCs to make sure of that?
quick one, do you think I could do a sorta dupe protection, by using the "take" handler, and checking if the client can see the server (for the pull ethernet dupe bug) ?
tag_client_fnc = {
_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_container = [_this,1,objNull,[objNull]] call BIS_fnc_param;
_item = [_this,2,"",[""]] call BIS_fnc_param;
isConnectedtoServer = false;
_startTime = diag_tickTime;
[_unit] remoteExec ["tag_fnc_isClientconnected",2];
waitUntil{isConnectedtoServer || (diag_tickTime >= (_startTime + 2))};
if !(isConnectedtoServer) exitWith {
hint "something about connection issues";
delete the items.
}
};
tag_server_fnc = {
_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_owner = owner _unit;
isConnectedtoServer = true;
_owner publicVariableClient "isConnectedtoServer";
};
``` as example
@wary vine The key is ping-like function. remoteExec to the server function with some unique key back from it. If that unique key doesn't change in some period of time - something is wrong with client connection. Just don't forget about sensitivity, so you will not flood the server with that shit or get all clients fucked because of small interval.
this would be on take event handler, so if isConnectedtoServer is still false after x seconds in the above statement it is 2, it will delete the weapon from their inventory
BIS_fnc_param - "This function is obsolete since the introduction of param and params."
@wary vine Well, besides that, your players might encounter a random item deletion because of some small lag.
I could play around with the time for that though
i think 2 seconds should be more then enough,
@wary vine No its mostly about that arma is living on UDP protocol. So for the whole timeline of 2000ms you might have a segment where this remoteExec will not reach the server. So once that happens, your 2 seconds safeguard is already failure:
100ms // failed to remoteExec
// anything below doesn't really have a reason anymore
250ms // fine
500ms // fine
1000ms // fine
...
@wary vine and yeah, instead of _owner = owner _unit you can simply use remoteExecutedOwner
So what would be the best idea for the duping issue then xD
@wary vine You should create a query of pings. Once per N-ms (depends on how accurate you want this to be), for example each 200ms for whole 2000ms timeline = 10 checks in 2 seconds.
@wary vine Just think about when and where that should be done, and once its fine utilize remoteExec ping chain to stop sending all 10 packets. In case packets will fail to reach the server, they will be utilized anyways.
Yeah, ill take a look π ty
Wait, ur measuring ping with RE?
How big is it with RE?
ohh okay
so I read into it
very interesting
Cool idea
How big is it with RE?
like this (γ)_/Β―
.<
^ publicVariableServer
@hasty violet and he would have to start the script in init.sqf / initPlayerLocal.sqf with an execVM. No. CfgFunctions postInit.
I do not want him to have two steps Yeah... You only have one step.
I would prefer for him to just have one step Uh.. That is one step...
@queen cargo did not understand*
@astral tendon I am trying to make my missions DLC free so is there i way i can remove DLCs to make sure of that? Yeah. Don't build on Tanoa. And don't place vehicles that have a DLC icon.
@unborn ether No its mostly about that arma is living on UDP protocol. Arma still makes sure that packets get through though...
@still forum Well that means arma does query them internally, since thats a behaviour of TCP packet, not UDP. AFAIK all of my remoteExec's being discarded while connection is lost. Anyways I was checking that in range of ~3-10s with no connection, might encounter timeouts.
If that's true, that gives me a reason of why laggy clients are such a pain to arma servers. It sometimes simply chokes of all that client flood.
Yes. Exactly.
Position updates are non-guaranteed. But stuff like script stuff are guaranteed
afaik even scripts because of laggs could be rejected/not executed, is that correct ?
about RE only ^
no. Guaranteed is guaranteed
rgr
If you completly loose connection then they are ofcause not executed.
Aka when the server shows you as disconnected.
Just thought about that to be 10 seconds. Its just made me paranoid a bit.
disconnectTimeout = 10; // Server wait time before disconnecting client, default 90 seconds, range 5 to 90 seconds. (since Arma 3 1.56+)
10 seconds = you have nothing to do here with all your packets query.
nah
This piece of code tries to recreate vehicles in the base previously loaded from server's profileNamespace. But weirdly, there are explosions occurring despite vehicles not being very close to each other.
// create empty vehicles
{
_x params ["_vehicleType", "_vehiclePosition"];
_vehicleType createVehicle _vehiclePosition;
sleep 0.5;
} forEach _vehicles;
Is there a smarter way to do the same?
vehicles are saved with
_vehicles = (getMarkerPos _markerName) nearEntities [["Car_F", "Tank_F", "Helicopter_Base_F"], _range];
...
_vehicles apply {
[typeOf _x, getPos _x]
} // create array of vehicles
@fossil yew Short allowDamage or BIS_fnc_findSafePos