#arma3_scripting
1 messages ยท Page 272 of 1
for _,v in pairs {"hello", "world"} do
print(v)
end
hint "now?"
hint "alright, it just doesnt really seem to work if i try to edit previous posts"
seems like we need a sandbox channel lol ๐
- code above has a "{" missing
that bracket i had found before but seem to have added a typo somewhere else too
tried to simplify it? (e.g. removing "&& {isNull objectParent player}")
But i want the 3rd party view in vehicles
Also if i dont have that part it will also unallow to use scopes and sights of rifles
Works now, but unfortunately im again missing some alive placements. Cant be connected
Its usually a sign of it getting to late when i mess up my map again...
@jade abyss your still doing Arma coding, figured you would of stop after Altis Life.
There is a difference between: Helping others and coding myself.
- Life is far far far away in the past. Everyone has his dark past ๐
yepyep
I think I just found arma 3's SQF script limit
Out of memory (Requested 16830KB)
footprint (2425430015KB)
pages (458752KB)
Active SQF Handles: 339979
๐คท Whoops
Nah, there is more possible
I once made a script that added eachFrame a new script that adds on eachFrame a new script that adds on eachFrame a new script that adds on eachFrame a new script that adds... etc
Way more is possible.
Best "AntiTheft" Method.
if servername != "blabla" -> Execute that thing after X minutes
Let them wonder why the Server crashes all the time
Hide that thing in somewhere in the files -> profit.
hint "stuff" //code
@tough abyss My favorite was a glitch I found with Arma 2, if you add a script that modified the velocity of whatever vehicle you where in and you got in a boat, after going about ~1500km/h the server would crash
@tough abyss Not crashing the Server, just lagg him out/drop the FPS below 1
On CLientside everything feels fine, the Server... yeah... running on 1-2 Fps, nothing possible to do serverside.
That drives ppl more crazy then crashing
you'll get the name of a bad scripter ๐
Imagine: Server runs fine for 5min, then turns into a shithole :D
And you keep wondering: "On the other Servers, it runs fineeee, why not on mine"
tbh, most MP missions/servers behave that way anyway ๐
true words ๐
```sqf
only works on github, because certain good people made it work
not very likely discord will support that
Active SQF Handles: 339979
339979 dead puppies
@little eagle It uses the same thing
Or atleast did at one point
Nvm uses highlight.js, which does support SQF
fixing spelling does help
๐
The lib classes most of the commands together
So everything is red
Unless someone makes a nice PR ๐คท
the keyword definition is ... lacking a few
does anyone know why my sound might not be playing? i've looked at literally every variable and it's just not playing. here's my description.ext entry:
class CfgSounds
{
sounds[] = {};
class firing
{
// how the sound is referred to in the editor (e.g. trigger effects)
name = "firing";
// filename, volume, pitch, distance
sound[] = {"sounds\Untitled.ogg", 1, 1, 5000};
// subtitle delay in seconds, subtitle text
titles[] = {1, " "};
};
};```
and the filepath is correct
i would like to have it work with playSound3D, but even playSound isn't returning anything
i've run "playSound firing" and a bunch of variants of that through my debug console, i've listened to the file with VLC to make sure it works
i'm just confused as hell
Have you read the notes on the wiki? https://community.bistudio.com/wiki/playSound3D
Ah, damn, overlooked them. Thanks Penny.
Now I feel like something is wrong with my description.ext. I had an original intro.jpg, but I changed it to a different file and kept the filename, but it's still showing the original picture.
i've been doing this for so long why does arma do this to me
and another question: you show or operators with pipes like so, correct? while {alive gun1 || alive gun2 || alive gun3 || alive gun4 || alive gun5} do{
@tough abyss you restarted the game? it'll cache textures by filename
i got it working. as it turns out my description.ext was getting angry at me because i had changed my loading screen .png to a .jpg by just changing the filetype in my explorer.
and it was just crashing my game when i tried to load it. but everything is working now, and i'm going to take a well-deserved nap.
yeh renaming a file isn't the same as changing its type ๐
no, i mean, i changed its filetype fine, but arma didn't like that
i had to re-export it
You have to explicitly change a file type
I did.
ArmA 3
Also doesn't like disproportionate image sizes
2:1 ratios and 1:1 ratios are all it likes
@tough abyss
Description.ext in particular
@tough abyss Have you seen this file type before?
ext_auto_file
?
@dusk sage
Anyone know if I should use the description.ext? or use EDEN from now on?
I know, Geeky. My image is the exact recommended size.
http://puu.sh/sU9dQ/b4b1273793.png This is the one I made.
Yeah just thought you should know.
ArmA 3 is also picky when you do things like paa -> png -> jpeg
It still works fine even without that aspect ratio, anyways.
Lol, just for gigles:
Recursive array
[13:12:10][Step 7/8] 13:12:10 Error in expression <_test_cache",["empty",1,[],{}]];
[13:12:10][Step 7/8] _tests pushBack _tests;
[13:12:10][Step 7/8] missionNamespace setVar>
[13:12:10][Step 7/8] 13:12:10 Error position: <pushBack _tests;
[13:12:10][Step 7/8] missionNamespace setVar>
[13:12:10][Step 7/8] 13:12:10 Error -5902040 elements provided, 144298519 expected
[13:12:10][Step 7/8] 13:12:10 File sunit\fn_addTest.sqf, line 12
_tests pushBack _test <- s god damnit!
i find this funny because i never did that mistake till now lol
and i kind of like the error message
Is there any good optimised way to completely disable fog on servers?
Right now I do 0 setFog 0 on eachFrame
on each frame??? wtf?
Yes
maybe a good first pass at optimisation would be to not do it every frame
How come even when you limit what is accessable in the arsenal people can still load whatever the hell they want now?
Pretty much defeats the purpose of preloading the arsenal...
Just make a script on an eventhandler to remove all guns when used that you dont allow @tough abyss
I could, but the system is clearly not supposed to work as it is now. It even shows the loadouts under the load section greyed out, yet you can still load them.
Found some code that could completely disable the save/load buttons, but it would be nice to keep them.
While loop with a sleep would be better
If you want delays higher than 1 second for your loops, try the cron script
no while/waituntil loops
One command, no accuracy needed ๐
But that script is even worse than a while loop
RWT_var_cronInstance = createTrigger ["EmptyDetector",[0,0,0],false];
RWT_var_cronInstance setTriggerActivation ["NONE","PRESENT",true];
RWT_var_cronInstance setTriggerStatements ["[] call RWT_fnc_cronJobRun", "", ""];
trigger runs every 0.5 seconds, while you have options with a SQF loop by adjusting the sleep. And the trigger has even more overhead
And whatever cronJobRun does, it doing a huge SQF sin
[] call compile format ["RWT_var_cronJobsAt_%1 = nil",_earliest];
multiple of those.
I guess the clients won't notice it, because it only runs on the server ยฏ_(ใ)_/ยฏ
@little eagle a single trigger instead of multiple loops + unified interface for one-time and recurring jobs
so, not so bad as an option ;)
You could achive the same with a loop
maybe, but trigger is a bit more flexible
I don't get what the point here is anyway
Can't you just set the weather in the mission like everyone else?
There is a forecast and a start value
both to 0
???
done
I've never played with fog, but I've noted people in the past fiddled with the attributes and still had fog
yeah, if you up the rain too high
Is there a way to open up an inventory, like opening a dead soldiers inventory, that will let you load and save that inventory to profileNamespace?
I can use BIS_fnc_loadInventory /saveInventory, but how can i do this without spawning a box or something. I do not want other people to be able to open your personal storage.
Keywords:
Eventhandler, InventoryOpened, false
will look into that.
Hey quick question, I have never needed this before now but I do now... how do I make it so someone can't press esc and click out of a dialog?
there are multiple ways
first you may just reopen it once it is closed
:)
second - disable user's input
add a keyhandler and block DIK_ESC
I made a loop to reopen it when someone closes it... the issue is that it only runs once....
I'll just muck around with it lol
is it possible to damage the legs of a player or NPC so that it cant move/walk in a3?
probably?
not sure if you'd be able to prevent moving/walking entirely with that though
no
well, for the NPC, you can just this disableAI "MOVE"
For players: The only option is to interfere with the Keyinput (e.g.: using a Keyhandler that negates the movement input, when Var1 = true)
Can somebody look at my code in #arma3_scenario and tell me if there's something obvious wrong with it?
@tough abyss Good ruse, but the pause menu cannot be rebound.
I'm currently having a strange issue, Im trying to use a listbox and if I understand the command properly lbAdd should add a item with some text in it but when ever I try ```
_index = lbAdd [1500, "Test"];
or
_control lbAdd "Test";
Thanks guys, but no Ill just then set the damageEH for HitLegs to 1, I wont fiddle with AI and in depth key interception as this goes to the mod config, its not for a mission. Doing that in a mod will make people angry and cause incompats.
{
_unit setHitPointDamage [_x, 1];
} forEach ["HitLegs"];
_unit setHitPointDamage ["HitBody", 0.2];
_unit setHitPointDamage ["HitArms", 0.2]
};``` ^ that
why not condense that to
{_unit setHitPointDamage [_x, 0.2];} forEach ["HitBody", "HitArms"]
?
forEach ["HitLegs"];
That's kinda useless; might at least directly _unit setHitPointDamage ["HitLegs", 1];
class Animal: Man
class Woman: Man ยฏ_(ใ)_/ยฏ
class inheritance: works when used right
At least they fixed Campfire_light_F inheriting from Ship
and the god created Man
๐
but lets not quote the Bible here... I hope the snake doesnt inherit from Man, if it does fu BI
wait, does that mean god is a vehicle?
kek it is what you want it to be
God is dead. End of Convo.
there's a way to find out
if (alive god) then {hint "he's alive"} else {hint "nietzsche was right"}
isAlive
"isAlive"
you're right, it's alive
*fixed it*
I've had to think about GML stuff today
GML has function names like that
That's kinda useless
making sure that when I set HitLegs to 1, that Arms and Body is lighly damaged aswell, hence the setup
class AllVehicles: All {
class Land: AllVehicles {
class Man: Land {
class Animal: Man {
class Animal_Base_F: Animal {
class Snake_random_F: Animal_Base_F {
why do a forEach with only one element though?
A snake is a Man and an AllVehicles
ah the script is more complex thats just example, sorry for the confusion
it handles vehicles too
Hey does anyone know how I can attach a say HMG for the prowler onto a quadbike? Not using attachTo command
if I have to use createVehicle to spawn a can of soda, I take that as a hint from arma 3 that you can actually get in and drive around in a can of soda if you try really hard
i guess its more scripting than mission making, so
"How can I make a 3D text in a position in a mission
like a 3d text floating in the air (but it disappears when I move away more than 5 meters)"
@rotund cypress as far as I know that doesn't work like that
Not every vehicle is mountable
Just like in real-life
I've seen it done
ok
But
Is there any HMG that is mountable onto say a quadbike or any other vehicle?
cant u just attach a static one?
weapons in arma 3 are pretty much part of the vehicle itself
they aren't just "mounted" on it
I know, but I saw some HMG or Machine Gun mounted on top of a truck.
you'd have to mod your own vehicle
That does not belong there by default
And it wasnt modded
I tried addWeaponsTurret and commands like that but didnt work
- there are cars with mounted machine guns, make sure it wasn't one of those 2)
attachTo
I know there is attachTo command, but is there no other way?
No
no
yes
fuuu
mod your own vehicle in
Thank you.
RE floating 3d text
https://community.bistudio.com/wiki/drawIcon3D
oh wait, text? Does BIS_fnc_3dcredits works still?
You have to hang out with the cool kids to get a bluename
i tried them but I need a way to make them only apears to the player near them (<5m)
(scroll up, if you don't believe me ๐ )
appears*
you have to add distance checks and fade outs then
+resizing of the image size
everything under 2000 lines is a small project
I had that in a mission for injured 3d icons, it worked for me for up to 75m but screw me if I got that now around, who knows where I burried that
iirc commy was helping me around it
def more than 5 lines ๐
If you need 2k lines for 3d icons you are doing it wrong though
yeah lol
they're not that complex
I'm not saying you'd need more than 2k lines for this xD
_color = [[1, 1, 1, _alpha], [1, 0, 0, _alpha], [0, 1, 0, _alpha], [0, 0, 1, _alpha], [1, 1, 0, _alpha]] select ((["MAIN", "RED", "GREEN", "BLUE", "YELLOW"] find ([assignedTeam _target] param [0, "MAIN"])) max 0);
๐คฆ
Just saying that less than that isn't "a lot"
@little eagle I can only guess what that code might do, but I couldn't tell you how it does that
@little eagle so how do I check the distance and make it fade?
how to fade
alpha value below 1 in drawIconWhatever
how to distance check
player distance _target
add some math
SQF magic
done
ok, make it invisible + "sqf magic"
ty
followed by //TODO: write comments to explain what this does
I'm not gonna write it for you, Oscar
Is using the stringtable.xml good for convience?
I'm using it as part of our framework.
it's good for using translations
{
if (getText (configfile >> "CfgVehicles" >> typeOf _x >> "textSingular") == "pilot") then {
DEADPILOTS pushBack _x;
};
} forEach allDeadMen;
addMissionEventHandler ["Draw3D", {
if (
{
player distance _x <= 15
} count DEADPILOTS > 0
) then {
{
_corpsePos = getPos _x;
if (player distance _corpsePos <= 15) then {
_line1_start = _corpsePos;
_line1_end = [(_line1_start select 0), (_line1_start select 1), 0.5];
_line2_start = [(_line1_end select 0), (_line1_end select 1) + 0.5, (_line1_end select 2)];
drawLine3D [_line1_start, _line1_end, [0,0,0,0.5]];
drawLine3D [_line1_end, _line2_start, [0,0,0,0.5]];
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\BasicLook_ca.paa", [0,0,0,0.5], _line2_start, 0.75, 0.75, 0];
};
} forEach DEADPILOTS;
};
}];``` that worked for me for icons, I dont know about text...
see https://community.bistudio.com/wiki/drawIcon3D for examples
For lump all string values into 1 box
magic numbers are cool
no boobies, boring link
- tell @open vigil that you posted them. He will add you to a special group.
- Claim it's actually just a regexp
you need to format it as code if you want to claim it's a regex
( . )( . )
-- Captures tho characters surrounded by spaces
How do I get ArmA 3 tools to register Posideon tools?
legit ways to knock the player out of hit feet?
as in vanila ways w/o spawning shit to hit it
[_unit, "PRONE_INJURED", "FULL"] call BIS_fnc_ambientAnim; well that puts it down and locks in the injured animation, I can quit that, but doesnt knock out, just instantly shows on the ground...
getting generic error in expression when using uiSleep 2; weird
Scheduled or unscheduled?
EH so unscheduled
sleeping isn't allowed in unscheduled
uiSleep 2; suspends everything
and is not allowed in unscheduled
shit... its a function so I can postinit it to make it work
or not... maybe I dont need sleep/uiSleep at all.. will see
Thought everyone knew that?
WaitUntil, uiSleep, sleep is not allowed in the unscheduled environment
It even says in your RPT.
Suspending not allowed in this context
There is not a getPosAGL?
Well test2 isn't defined
Don't think so, but you can always do ASLToAGL getPosASL
@native hemlock thanks.
getPos supposed to be getPosAGL but there are some BUTs
Watery butts
setPos uses AGL
getPos does not. It uses the highest pathway lod if present
So yeah, ASLToAGL getPosASL is how you get a AGL position
Watery butts
If you meant that it's somehow inconsistent over water then you're wrong
AGL over water is using the waves
which is true for getPos too
I have a question about using the virtual arsenal and making a blacklist of items we dont want in our server, I have been able to makea black list, but i want to expand on that and make one for Blufor Opfor so people on opposing teams cant grab uniforms that they shouldnt
make a loop and if they are wearing that uniform while arsenal is open then ```SQF
removeUniform player
and you can adapt that for any item / clothing item
i dunno this may be above my paygrade lol
Could someone politely discharge that man from this discord server please?
@little eagle I'll buy myself a hammer to hit myself with it to fully understand what went through the bohemian ducttape employees to make setpos and gepos not use the same relative height to the actual floor
@MrSanchez#5319 Done
I thank thy dearly
Though his links are still here unfortunately
From which he could profit
Ive just restarted all of my devices (mobile and Desktop) and its gone.
Restarting whole device != restart app but it's fine ;)
๐ but it also worked when I restarted the app (But also poor initial choice of words on my part)
@tame portal It's all for backwards compatibility. You don't want to break old missions. But I've been saying for years now that basically everything should be done in ASL, and only converted to AGL immediately before a command is used that takes that, or to ASL immediately after a command is used that reports something else.
there are always exceptions
@tough abyss can't spawn in a local placeholder entity like an invisible helipad, getpos and delete?
I'd also try looking at the Wiki page on co-ordinate name spaces
any ideas how to derive world position without spawning the entity
I guess you can make a debug mission where you spawn all available entities and store their average road contact to model center distance
otherwise I don't see how. Make extension that opens the models in real time : P ?
Is there any command for switching nightvision goggles mode? For example switch from thermals to normal when using the new apex nvgs? I searched for a command but didnt find any. Only thing i found was to found out in what mode they were in (currentVisionMode)
I also tried player disableTIEquipment to disable the thermals on the nvgs but didnt work
Hey, I've been using this: ```SQF
for "_i" from 1 to _doors do {
ct animate[format["door%1_rot",_i],0];
ct setVariable[format["bis_disabled_Door%1",_i],1,true];
};
lock: something setVariable ['bis_disabled_Door_1',1,true]; unlock: something setVariable ['bis_disabled_Door_1',0,true];
is what I've gleaned from https://forums.bistudio.com/topic/152949-lockunlock-doors-on-a-builing/
@rotund cypress I think its the command "action" off the top of my head. Cant look right now to check though.
how do you get the position now and what is wrong with it?
do EHs set with ctrlAddEventHandler persist when the display it's setting them on is closed and opened again?
i don't think so but should be easy to debug.
it is, but testing the easy way first ๐
hehe. it would make sense but i'll shut up since i'm not sure. i'll go check myself actually. now i'm curious
the fine art of making others work for you
the BIKI isn't saying anything like "you have to re-set the EH after closing" so my guess would be that they do persist
i ran this from the debug console:
((findDisplay 49) displayctrl 1) ctrlAddEventHandler ["KeyDown", {playmusic "leadtrack06b_F_EPC"}]
idd 49 is the pause menu
after closing and reopening the pause menu the track doesn't restart
you have to close it to hear music at all though in SP since simulation stops there i think
not the most elegant way but knowing the track it seems it's not starting over unless you readd the EH
I'll give it a shot ๐
remember you also have to press a key since it's a key down EH
didn't hear any music playing but adding a diag_log does show that it fires only once
interesting
oh fail.. music volume was turned down ๐
thanks though ๐
and it does make sense I guess
i'm a bit out of the loop on these new commands tbh so i don't get half of it. but i'm guessing you are describing the phenomenon that a simple object is underground when you spawn it at your own position for example?
@halcyon crypt e.g. InventoryOpened EH is NOT permanent and needs to be added again, when its closed (iirc ๐ )
Hey, how would I find the nearestObject in an array. e.g. testArray pushBack cursorObject Do that for two objects... how would I find which object is closer using nearestObject (I want my array to go higher than just two values and I don't want to use an Algorithm because I know there is an easier solution)
That's searching for IF the nearest object is in the testarray... I want to find the CLOSER one
damn, I was hoping I wouldn't have too haha
@tough abyss I've already written something for it haha
there's also a neat BIS fnc called sortby that accepts any condition and can sort de and ascending. not sure what the status is on how optimizsed it is though.
Is there a way to check if a player has a specific addaction?
Not finding anything anywhere on it :/
_distance = selectMin (object_array apply {_x distance player});
@tough abyss
@tough abyss that's my question really, I don't know how to, and obviously if the player doesn't have the addaction when the script executes (it removes the addaction) then it will throw an error
Volc... when you set the action do An_Action = addAction.. then maybe if !isNil An_Action
something like that?
@tough abyss - it is defined as ben mentioned above as An_action = addaction... so what @cerulean whale suggests actually seems like it might be the solution i'm after
I'm not sure if that works, I haven't been near addActions in a long time...I use a custom interaction system now.... but from what I can recall it does
I hadn't thought to check if the variable was nil, that's a clever way to do it
Store the ID returned by addaction into a variable, check for its presence on each client @marsh storm
Or setVariable on the player, and broadcast
true
situation wasn't specified though. might be interaction between different addons/scripts. but go easy if possible for sure
btw
"_distance = selectMin (object_array apply {_x distance player});" the fuck is this?
looks sexy. is it fast too?
how do you output the object though?
Unless there is a syntax issue
hm
but
man. they are adding so much good shit. like as much as they used to add in several years back when. hard to not lose track
_distances = object_array apply {_x distance player};
_object = object_array select (_distances find (selectMin _distances));
Hard on phone
was just gonna say. clone array to get the index yea?
You need a reference array for the index
cool. neat
@tough abyss Returns min value not index ๐ฆ
๐
logical I guess
With the name selectMin
Bit annoying though
still no
๐
object_array doesn't have distances
99% sure it's not possible w/o another var
_distances = object_array apply {_x distance player};
_object = object_array select (_distances find (selectMin _distances));
works fine
Obviously could do it by explicitly writing object_array apply {_x distance player} twice though
But not efficient
i think (_x distance player) would have to be first for the sort to work?
and select 1 at the end ๐
not sure if it'd be very efficient sorting rather than finding the smallest manually though
Hey @tough abyss @dusk sage @cerulean whale thanks for the advice, got that working
np
Appreciate that fellas, all the best
๐
i made them race. BoGuu slightly faster. this is fun. someone bring up anotehr problem for those two to solve ๐
i think everyone hates dialogs in arma. just describe
50 cutRsc ["ui_master","PLAIN"];
waitUntil {!isNull (uiNameSpace getVariable "ui_master")};
_display_master = findDisplay 2110;
_ui_text_ind = _display_master displayCtrl 1012;
_ui_text_pop = _display_master displayCtrl 1022;
_ui_text_ind ctrlSetText "50/min";
_ui_text_pop ctrlSetText "200/200"; ```
I know right, that's why I've stayed away from them for so long
Anyways, I have two RscText controls with idc 1012 and 1022 that are in the ui_master control idd 2110
and they just don't appear with the text defined in the controls or using ctrlSetText
waitUntil {!isNull (uiNameSpace getVariable "ui_master")};
Is that null to begin with?
It's a trick to wait until the display has been loaded
waitUntil {!isNull (uiNameSpace getVariable ["ui_master", displayNull])};
Picture controls in the display display perfectly
I'm just questioning whether your waitUntil is doing anything
Probably isn't tbh, just following a tutorial
use the default above
Is there a way to intentionally log things to remoteExec log?
So it will always returned null if nil
By remoteExecing
Thanks bo
It logs some things
@nocturne iron try use
But I dont actually know where I define what it should log?
ctrlSetText [idc, text]
@rotund cypress remoteexec.txt
Can pick and choose what to log
Normal BE filter things
That's the dialog format though, I'll give it a go
Oh so lets say I want it to log when function name_fnc_fncname is executed?
I just do that in remoteExec.txt
BattleEye filter?
in a #include'd file called dialogs.hpp
{
idd = 2110;
movingenable = true;
duration = 90;
enableSimulation = true;
enableDisplay = true;
onLoad = "with uiNameSpace do { ui_master = _this select 0 }";
class Controls
{
class ui_u_indicon: RscPicture
{
idc = 1011;
style = 48;
text = "img\ui\industry.paa";
x = 0.00499997 * safezoneW + safezoneX;
y = 0.786 * safezoneH + safezoneY;
w = 0.055 * safezoneW;
h = 0.055 * safezoneH;
};
class ui_u_popicon: RscPicture
{
idc = 1021;
style = 48;
text = "img\ui\population.paa";
colorBackground[] = {0,0,0,0};
x = 0.00499997 * safezoneW + safezoneX;
y = 0.665 * safezoneH + safezoneY;
w = 0.055 * safezoneW;
h = 0.055 * safezoneH;
};
class ui_u_poptext: RscText
{
idc = 1022;
text = "200/200"; //--- ToDo: Localize;
x = -0.000156274 * safezoneW + safezoneX;
y = 0.709 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.055 * safezoneH;
font = "EtelkaNarrowMediumPro";
sizeEx = 1.6 * GUI_GRID_H;
};
class ui_u_indtext: RscText
{
idc = 1012;
text = "150 p/t"; //--- ToDo: Localize;
x = -0.000156274 * safezoneW + safezoneX;
y = 0.83 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.055 * safezoneH;
font = "EtelkaNarrowMediumPro";
sizeEx = 1.6 * GUI_GRID_H;
};
};
};```
onLoad = "uiNameSpace setVariable["ui_master", _this select 0]";
thanks
Alright
And change the waitUntil
Okay
Maybe stick a hint after it, so you know when to expect them to appear
Does the initial text work?
nope
as in from the config
I'd start by removing the font and font size properties
And you're sure its location is visible?
Yeah
yea sounds like your config is faulty
Okay
of those control types
I'll give you guys what I had for my rscText default
{
access = 0;
idc = -1;
type = CT_STATIC;
style = ST_MULTI;
linespacing = 1;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,.5};
text = "";
shadow = 2;
font = "Bitstream";
SizeEx = 0.02300;
fixedWidth = 0;
x = 0;
y = 0;
h = 0;
w = 0;
};```
that worked?
it has previously
and there wasn't an error in the GUI editor or anything if that means anything
not sure about your sizeEx in the current one (not the last posted one)
does it have to be between 0 and 1?
not sure and i'm also pretty rusty but if GUI_GRID_H works anything like safeZoneH then * 1.6 sounds bad
try fixed numbers like in the original
Ah shit I think I might have mixed safeZone and GUI_GRID Coord spaces
I'll try fixing that
@dusk sage would 1 logwhendetected in remoteExec.txt work?
Then when i call logwhendetected
it will log?
i'm just guessing until someone fluent and competent shows up ;D
aha
is GUI_GRID_H a constant like safezoneH?
@rotund cypress it's SQF, you're not really sure if it's going to work if you haven't tried it repeatedly under duress
txt is not sqf
Oh I'm an asshole
Compared to SQF
nvm
It's a ๐คท on will it work
having a look for you now @polar folio
You'll need to define GUI_GRID_H yeh
so doing * 1.6 would mean you get letters 1.6X the size of your screen
Yeah
lol
That did not work @dusk sage
Did you try w/o the two fields like I suggested?
so if you consider the space inbetween the start of the control and the actually rendered letter you would see nothing inside a small control
Trying it now, last time I launched A3 just had one of those moments
That makes sense
Try log everything and catch what it logs as @rotund cypress
@dusk sage I'm supposed to put a folder with my mission name in the same folder as the remoteExec.log right?
just remove sizeEX for now so it inherits it so we can rule it out
And then stick remoteExec.txt in that folder?
Nope
Thanks
you have a battleye folder
Testing it now
in that you need the be dll & config
You should specify this folder path on startup params
Or, put it in your profile (and you don't need to)
Okay the rest of the UI isn't even appearing now
lol
Is C++ like SQF in that you need to use ' ' to isolate strings within " " strings?
Yeah
if by C++ you mean arma configs then yes ๐
I think the new method of checking load is screwing init
Yeah :p
It's technically C++ :p
@dusk sage I have ArmaInstall/config/BattlEye/battleye
config/battleye i have the dll and the beserver_active_whatever
and then another folder battleye
which also has a dll in it
just 1 be folder
@nocturne iron
string = "'hello'";
string = " ""hello"" ";
string = " "" """ hello """ "" ";
๐ฎ
after what change?
Doesnt work @dusk sage
Not sure
lol
@rotund cypress Doesn't work? is anything logging?
since I did some of the changes and renabled the dialog
Or filters not loaded?
How do I make it so everything logs? @dusk sage
do one by one from what you had initially. if removing sizeEX and thus inheriting doesn't work somehow then just copy paste it from yoru parent class
Yeah
I think it's in the actual calling of the ui though since the photos aren't showing now
1 "" @rotund cypress
nvm guys
I may have reorganised my functions and forgot to change the directory of the script calling the display
Also it's working now
thanks for all the help
really appreciated
so what was it? mistake before you even came here?
I think it was the SizeEx * GUI_GRID_H
Since that wasn't working beforehand anyways
ye would make sense
yea that bitter sweet moment when you realise it was just you being sloppy all along. degree of bitterness determined by how many hours you wasted. sweetness is the realisation that the solution is very simple ๐
been there too many times
I know right
Once I put a script in the wrong mission directory
because for some reason they have almost identical directories right next to each other
spent two hours trying to figure out why something dumb as fuck wasn't working
put it in UserSaved\Missions instead of \Missions
it can be good though. i have optimised code in the past trying to find an issue like this that i would've never touched again otherwise because lazy
yeah
On another note, is there a way to force the viewable distance of a lightpoint
not it's brightness or spread, but how far you can see it
quick search only shows this one being relevant https://community.bistudio.com/wiki/setLightFlareMaxDistance
which is the sprite thingy. the rest is handled by the engine i think. question would be by which criteria. so maybe intensity also increases render priority. who knows. my experience is that scripted light points are pretty limited
Yeah
Trying to get a neat team-coded unit light up 'thingo' so people can do night ops with zeus without NVG
just some ambient light around the unit? or some more elaborate scripted flashlight?
Yeah
I think it's an engine issue
the problem is that it doesn't really load in for a while
and by the time it loads in it's really blinding and ruins the contrast
are you doing all mission side stuff or addon code?
Yeah
It's pretty unnoticable, the general light up effect is visible when you look at the lack of it in the second screenshot though
Can i use hideObject in a rope? ๐
Have you tried using hideObject on a rope ๐ ?
Quick noob question (dont use them, never have) what is the point of battle eye filters?
lel
Thanks
Hey guys.. if I have a string like this (uid ) "76561198099644981" and I want to get it out of the string how would I do so? because if I do parseNumber or call compile it ends up like this: ```
7.65612e+016
Depends what you want to do with it
In the engine it will use an exponential
You just have to accept that
I need it for an SQL Query... I could convert my SQL to a string but that would be a pain
because they I would have to rewrite everythign else
Then just use the string UID
Once again, all my other queries are setup differently to use without the string...
Unless I put it on a separate table and store it separately. hmm
You will be absolutely fine, I'd suggest using something like a varchar for your UID DB side though
I am using one xD
Sigh, Thanks @dusk sage I didn't know you could pass a string into a varchar and it could still read an integer... Good to know though, thanks
Well, it's not an integer ๐
Well, whatever xD I don't do goddamn SQL haha
I am turning stupid I guess.. is there any command like: "removeMagazine(s)" for a container?
no
so I will need to replace the whole inventory to remove a mag right?
@vague hull
Let me just write it
Wait, do you want to remove 1 magazine or all of them
?
clearMagazineCargo removed all of the mags
what u could do is put all the current mags into an array, bar the one u want to remove
clear the crate with clearMagazineCArgo
and then add them all back with addMagazineCargoGlobal
I wanted to remove the mags of a certain type
gimme 2mins
I allready got that code
Just wanted to know if there was any smarter way than clearing the whole inventory
Oh, well not rlly
just push it into an array using MagazineCargo and then delete from there, then readd
welp... after 6 year I would apprechiate such commands more than 64 bit tbh
There used to be a way to have invisible AI unit outside of the map to "TakeMagazine" out of your container but I think this action is still broken
And its not instantaneous
xD, I am having the most illogical problem ever now haha, ArmA is so broke
_x select 0; works fine, _x select 1; LITTERALLY THE SAME THING is broken
haha
xD
[["Container","B_supplyCrate_F","[16795.2,12625.5,-0.0249023]"],["B_Kitbag_mcamo","B_Kitbag_mcamo"],[],[],[]]
``` Anyone know why I can select the array with container at the start but not the one with kitBag?
array select 1 should be ["B_Kitbag_mcamo","B_Kitbag_mcamo"]
That's what it is
xD
I've fixed it now
It was already like that
but anyway
I fixed the problem... idk why it was broke but it works now haha
What setPos / getPos allows for building surfaces?
ATL ?
Nvm. I've done it a different way
This is driving me mad...
Does anyone have any idea, why a function I wrote will work in the debug watch and show the correct results, but when run in a script the exact same way, doesn't show the same results?
@vague hull
welp... after 6 year I would apprechiate such commands more than 64 bit tbh```
This command is needed since > 15 Years!
Actually its needed ever since. That simple ๐
I mean, even just removing all of one type would be a huge boost
@vagrant canopy post code on pastebin
Probably hardcoded
Why do you need it anyway? You can't create them through scripting.
animator, smokesource, explosion, crater, crateronvehicle, slop, lightpoint, smoke, camera, camconstruct, camcurator, dynamicsound, objectdestructed, destructioneffects, alwaysshow, alwayshide, scud, epeparticlesource
from arma3.exe
probably many of these are never used and deprecated
iirc there was a max amount of e.g. Bulletholes, sooo
e.g. = example given = "not every case explained, just giving the idea of what was meant"
for the sake of example
is there any way to prevent a weaponholder from despawning instantly after clearing its inventory?
why do you need this?
basically just a pickup script, that takes everything into your inventory that fits
butz since you cant remove single items.. I need to clear the whole thing and readd everything -> makes it despawn before I can readd the stuff
โ
I just made a script for disabling thermals on the new NVGs in Apex. Is there any better optimised way of doing this?
addMissionEventHandler [ "EachFrame", {
if ( currentVisionMode player isEqualTo 2 ) then {
player linkItem hmd player;
};
}];
Looks like a good solution
@vital onyx tryed that, didnt help ..
weapon holder despawns on next simulation frame if empty
hey guys, any idea about how one could use the virtual arsenal as a store for something like wasteland or altis life?
you'll need to go unscheduled and do everything in one frame
Changed it a bit @meager granite to only apply for NVGs that has thermals
addMissionEventHandler [ "EachFrame", {
if ( currentVisionMode player isEqualTo 2 && { hmd player in ["NVGogglesB_grn_F", "NVGogglesB_blk_F" ] } ) then {
player linkItem hmd player;
};
}];
quick question. i used to overwrite my cfgfunctions stuff ingame to try new changes so i don't have to constantly repack. now somehow it doesn't seem to work. did somethign change in that regard? any way to reenable that behaviour or is it something on my side maybe?
@meager granite Will try that now
thx!
it's addon side so i never thought about description.ext. gonna see if i can make it work in a config
@meager granite didnt help aswell
guys I'm looking for a function that does the exact oposite of waypointName
in other words, I have a waypoint name and need a value (array) that I can pass to deleteWaypoint
first you need to retrieve the waypoints of the group
as you can see it will return an array of arrays. each of them being a waypoint with the array consisting of name and waypoint index
actually i'm not sure about the last. wiki exampel looks weird
the idea though would be to then cycle through them and see if your info matches one and if so proceed to delete it
I've seen that
but it returns an array of arrays of the form [group, waypoint_index]
no name to be found
then your initial method of starting with the name is bad
can you explain more about the context?
under what condition?
linked from https://community.bistudio.com/wiki/waypointName
get the groups waypoints like i said
according to that page a waypoint is an array of the group it belongs to and the index. so you should have all you got
the index may change though
for example if I were to add a new waypoint in between in the mission editor
that's why I want to use the name
the name of waypoint n won't change if I add a waypoint m+1 < n
still works...in theory since you still use the name to perfectly identify
let me whip out some pseudo code
sec
how am I using the name?
haven't tested this. i literally never use waypoints. but this makes sense to me from what the wiki says. just so you see what i mean
got curious. tested ingame. works
seems like a terribly convoluted way to do something very simple
but hey, that's how arma usually is
any way, thanks for the help
oh if this looks dirty to you then you haven't seen nothing yet ;D
the waypointName command looks relatively recent too so that would explain why the waypoint data itself doesn't contain the name. probably way older than the waypointName one
@tough abyss poseidon is great until you run into sublime text's $70 pricetag ๐
@rotund cypress you may better like smth player action ["NVG",player] instead of linkItem hmd
That didnt work @vital onyx
I dont see any problems with linkItem because it will just turn them off
Which I see as a good thing
Is there any eventhandler for side chat? Like to add custom names to side chat messages
I think I found what I'm looking for
setGroupID
@nocturne iron Sublime text in Poseidon is free
Atom with language-arma-atom package is awesome too
^ ๐
@tough abyss is it? Prevented me from saving and such
Didn't have that problem on my end?
Nope worked for me
using the self-contained zip version?
Or the executable installer based one?
@nocturne iron it comes ipt when you save but can just exit
Thanks
Hi I'm having some problems with ctrlSetText
This is the code I'm using
waitUntil {!isNull (uiNameSpace getVariable ['ui_master', displayNull])};
display_master = findDisplay 2110;
ui_text_ind = display_master displayCtrl 1012;
ui_text_pop = display_master displayCtrl 1022;
vblue_unitpop = {((alive _x) && (side _x == west)) && (_x isKindOf "Man")} count (allUnits - [officerWest_1]);
vred_unitpop = {((alive _x) && (side _x == east)) && (_x isKindOf "Man")} count (allUnits - [officerEast_1]);
vblue_popcap = (count vblue_m_ownedpoparea) * vuni_popx;
vred_popcap = (count vred_m_ownedpoparea) * vuni_popx;
vblue_popstring = (str vblue_unitpop) + "/" + (str vblue_popcap);
vred_popstring = (str vred_unitpop) + "/" + (str vred_popcap);
vblue_indstring = (str vblue_i) + " p/t";
vred_indstring = (str vred_i) + " p/t";
_handle = {ui_text_ind ctrlSetText vblue_indstring;ui_text_pop ctrlSetText vblue_popstring;} remoteExec ["bis_fnc_call", west];
_handle = {ui_text_ind ctrlSetText vred_indstring;ui_text_pop ctrlSetText vred_popstring;} remoteExec ["bis_fnc_call", east];```
it's on a 10 second loop
why do you remoteExec cutRsc?
probably a popup message
but yeah.. kinda pointless
It would be better to do the calculations before and send the cutRsc together with the ctrlSetText
I mean, its just about are these commands/variables only available for the server, if so then it would be better
if not and everyone has that info, then it would be better to make a fnc for it and call it by remoteExec (if not possible to be done in a different way)
on the other hand side this looks like its not executed on a server anyways, so yeah
Ah
Thanks
I see where I'm going wrong
Was trying to send it to clients but I've missed the obvious
the ctrlSetText command still doesn't work
Potentially
it has a different syntax for dialogs and displays
while {true} do {
_handle = 50 cutRsc ["ui_master","PLAIN"];
waitUntil {!isNull (uiNameSpace getVariable ['ui_master', displayNull])};
display_master = findDisplay 2110;
ui_text_ind = display_master displayCtrl 1012;
ui_text_pop = display_master displayCtrl 1022;
vblue_popstring = (str vblue_unitpop) + "/" + (str vblue_popcap);
vblue_indstring = (str vblue_i) + " p/t";
ui_text_ind ctrlSetText vblue_indstring;
ui_text_pop ctrlSetText vblue_popstring;
sleep 10;
};
};```
Using the display context
add line disableSerialization; after while {true} do {
I added it before the loop?
try inside the loop
then log the variables ui_text_ind and ui_text_pop to see what's happening with them
They've been defined as controls
just try to run the code from the loop's body in debug console
not sure why to keep them in variables
ui_text_ind ctrlSetText vblue_indstring; can be replaced with
((findDisplay 2110) displayCtrl 1012) ctrlSetText vblue_indstring;
that guarantees that it is definitely not an issue with deserialized variable
Sure
was going to ask same question :)
Going to do that in a bit :p
had a different script originally, just hacking it together to see what works first. This is my first run with displays
Also if you save your display in uiNamespace, why not use it instead of findDisplay 2110 ?
No problem with findDisplay, just see no point in saving display to ui namespace if you're not using it
might as well do waitUntil {!isNull findDisplay 2110} if you want findDisplay
Okay
disableSerialization;
_handle = 50 cutRsc ["ui_master","PLAIN"];
waitUntil {!isNull findDisplay 2110};
while {true} do {
vblue_popstring = (str vblue_unitpop) + "/" + (str vblue_popcap);
vblue_indstring = (str vblue_i) + " p/t";
((findDisplay 2110) displayCtrl 1012) ctrlSetText vblue_indstring;
((findDisplay 2110) displayCtrl 1022) ctrlSetText vblue_popstring;
sleep 10;
};
};``` tried this code, still not working
what exactly doesn't work?
you don't define vblue_unitpop anywhere
you had it in earlier code
They're defined elsewhere
So what doesn't work then?
Switching the values of the control doesn't work
Try with test data?
some static string
also add debug outputs to see if you retrieve controls right
systemChat format ["((findDisplay 2110) displayCtrl 1012) = %1", ((findDisplay 2110) displayCtrl 1012)];
something like this
is there any known LOD for a model that has to be present in order to get addAction to work?
Are you sure your display's idd is 2110 @nocturne iron
Add debug checks if you even get display
@tough abyss Isn't it the same LOD that defines if your cursor is on target? (cursorTarget)
I think you need FIRE and VIEW lods for actions to appear
VIEWGEO should be enough.
tested it with viewgeo but it might not help that it is a mine which is basically a projectile (cfgAmmo)
damn ๐ฆ
just like how you can't use set/getVariable on them
fml mines are a real pita
CfgAmmo are much simplier entities and they don't support lot of stuff normal entity do
Your best bet would be adding mines to some list and action to player and check distance to mines in the list
or through some near* command
ACE spawns a logic CfgVehicles and adds the actions to it. Dunno if attachTo is also involved. Might not work with CfgAmmo either
for mines that is
did that for now (attachTo works) but its kinda ugly..
removing mines done just like I described it, action is on player himself, it checks if mines are nearby to become active
i would like to avoid such system
i used a fired EH on the mine muzzle to add the actions to the fake action object attached to the mine
just use the dummy object
that should be fine
dunno what happens when you place you mines via editor. you'll probably have to think about a way to handle that too
maybe a overall question as i'm not sure, is it better to add the action to the player as se-matra suggested or risk that you could have 20 mines with each a few actions on them? (in terms of performance and managability)
yea :/ have to try if the init EH works on cfgAmmo
do you happen to know how ace deals with editor placed mines?
they probably don't work tbqh ยฏ_(ใ)_/ยฏ
or iterate through allMines in postInit. Would still mean that spawned ones mid mission don't work though
So one more try one my question regarding cleaned up weaponholders:
how can I avoid them from being deleted after their inventory was clear for a tiny moment
they are getting cleaned up even tho I add some items directly after clearing the cargo
I can even read them at this point (getItemCargo and so on)
yet the weaponholder gets deleted not even a second later
13:40:51 [[["30Rnd_9x21_Yellow_Mag",17]],[["SMG_02_F","","","",[],""]],[],[]] //reding the invetory for the first time
13:40:51 7cc47900# 1780139: dummyweapon.p3d REMOTE logging the weaponholder before readding stuff
13:40:51 [[["30Rnd_9x21_Yellow_Mag",17]],[["SMG_02_F","","","",[],""]],[],[]] reading the inventory after readding stuff
a second later logging (isNull _weaponholder) return true
everything from an unsheduled envoirnment (except the logging afterwards ofc)
You can't. It's a bug
fml
you can try using two different types of dummy items that are removed later
e.g. a weapon and a magazine
but you have to juggle around a bit depending on what the end results are for different item sets
because you can't remove single items
honestly, the easiest way is to just create a new weapon holder and to delete the old one
that doesnt do it for me sadly
why?
I have got an external cleanup going on the server, it does pretty well, but it needs to save all the weapon holders that were created, which too works fine, but if I create a new weaponholder on the client, it would never get cleaned up by this system
create it on the server then?
I don't see the problem
if you script can't handle createVehicle'd weapon holders
it frankly is not good enough
It is for what its designed for.. but welp, might aswell just change that now
but you have to juggle around a bit depending on what the end results are for different item sets
this should work either way
yep, will try that now
same thing for all possibilites
btw, if a player drops an item, is the weaponholder created a GroundWeaponHolder or WeaponHolderSimulated?
No idea. Try typeOf cursorTarget
ok but thanks first of all
deleted my suggestion. it doesn't work, but I'm sure you'll figure it out
or assign InvetoryClosed EH - it should give the object
WeaponHolderSimulated is spawned when killing a Unit to simulate falling rifle, when you drop items on ground - GroundWeaponHolder is used
๐ thx
Is the setvariable command working with map-placed objects?
Such garbage containers
no
variables should disappear on the local client if the cameras moves away far enough
where CBA namespace is an array inside mission namespace?
๐ค
are they going to fix CBA soon i cant run my server with my mods without CBA ๐ฆ
@little eagle actually worked now thx for the help
if the addonmaker was nice to you, there yshould be an entry in cfgPatches about it
yet that doenst need to be there
am i wrong that i need CBA for NIarms mods? or can my server run without them, oh nvm its a supid requirment ugh
CBA is needed for NiArms?
yep
thats new to me
which mod you mean?
well the steam version its saying its a requirment for NIarms core
but cba on steam is out of date or broken so im in a pickle where im paying for a server i cant even use
@cold linden ?? this could be the case in any mod
sry, i mean Estron with my last message
uhmm, NiArms actually works with an older version
I dont know why its a dependency anyways
well my whole issue is that im trying to start up a small CTI server using my custom mod and custom gametype for CTI so i can use my mod factions units etc, but NIarms AR15 Rifles and NIarms core are required and to use those 2 mods for my custom mod i need CBA to work.
it probably uses CBA for scripted features like bolt action animations or similar
Actually the rails
so im forced to wait till cba is up to date till i can even run my server?
ah right
no you aren't, you could just remove the mod temporarily
unless you run something persistent that will make people lose their loot, if it's from NIArms
um, but i dont want to remove the whole point of me owning a server, it was for my custom mod :/
just pointing out the difference between "forced to" and "want to". not trying to be a dick here
ur fine, im not mad
thank god ;D
:b
so joint rails is in CBA now and that is the issue, right?
maybe havent dug that deep into it but most likley is
what i'm gettign at is, you should try if it works with joint rails. although CfgPatches being set up to look for CBA might cause issues. best case scenario would be jsut an error pop up
oh, so run the server without CBA but still use NIarms stuff?
Or download the up to date CBA from somewhere else
oh so only steam is outdated/broken? i had CBA keep me from joinign a friend the other day too.
don't listen to me. i'm not informed on the details
I'm not saying it is or isnt broken, but my group and many others have had no issues with CBA lately.
are you using armaholic or steam version?
PWS
hurm 3rd party auto updater i guess i could try it
play with six is painful, don't subject yourself to it
ya reading up on it the whole idea is kinda stupid to me i mean isent that what steam workshop is for?
whats wrong with the version on the WS?
has the CBA team fully switched to PWS? because before steam went down, everyone was having a problem with steam CBA as far back as Dec. 1st
Afaik CBA doesnt really have an "official" release place outside the BI forums and the WS
but what was the problem with it? a bug, corrupted file, out of date?
I've been using PWS for years because it's convenient. Many veteran players swear by it and many well known servers keep their repos there.
@open vigil i might have to switch anyway if CBA is not working on steam
the point of PWS is the same as WS. it's all about the chronology. PWS has existed way before arma going to steam afaik. so nothing stupid about it
it has one of the worst user interfaces i've seen in a piece of software
no need to hate. i don't use it myself and stuff but let's keep up the x-mas spirit ;D
It does, but its far more easier to organise collections etc than SW.
Tools don't need to be pretty, they just need to work.
But, we digress (again) , this is scripting (and I'm not sure CBA is his issue)
@open vigil what you think the issue is?
@Estron CBA on Steam is up to date and works
@Estron#5275
fucking discord
Estron Vor 8 Stunden
CBA is 100% broken updated it already!
@Estron#5275 test
this is not true. who knows what you broke on your end