#arma3_scripting

1 messages ยท Page 272 of 1

tough abyss
#

1st is javascript, 2nd is python.

#

What are you specifying ?

loud python
#
for _,v in pairs {"hello", "world"} do
    print(v)
end
proven crystal
#
hint "now?"
#
hint "alright, it just doesnt really seem to work if i try to edit previous posts"
halcyon crypt
#

seems like we need a sandbox channel lol ๐Ÿ˜›

proven crystal
#

sorry for the spam ^^

#

hm damn i can switch to 3rd person

jade abyss
#
  1. code above has a "{" missing
loud python
#

indeed it has

#

and the game probably told you about that

proven crystal
#

that bracket i had found before but seem to have added a typo somewhere else too

jade abyss
#

tried to simplify it? (e.g. removing "&& {isNull objectParent player}")

proven crystal
#

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...

true barn
#

@jade abyss your still doing Arma coding, figured you would of stop after Altis Life.

jade abyss
#

There is a difference between: Helping others and coding myself.

  • Life is far far far away in the past. Everyone has his dark past ๐Ÿ˜‰
true barn
#

Lol

#

I agree

#

Anyways hope all is well

jade abyss
#

yepyep

tough abyss
#

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

jade abyss
#

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.

cerulean whale
#
hint "stuff" //code
final gale
#

@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

jade abyss
#

@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

halcyon crypt
#

you'll get the name of a bad scripter ๐Ÿ˜›

jade abyss
#

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"

halcyon crypt
#

tbh, most MP missions/servers behave that way anyway ๐Ÿ˜„

jade abyss
#

true words ๐Ÿ˜„

little eagle
#

```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

dusk sage
#

@little eagle It uses the same thing

#

Or atleast did at one point

#

Nvm uses highlight.js, which does support SQF

little eagle
#
private _weapon = currentWeapon _unit;
#

doesn't work then

dusk sage
#

Well it does

#

It's not that fancy

#

But it's there

little eagle
#

fixing spelling does help

dusk sage
#

๐Ÿ˜›

#

The lib classes most of the commands together

#

So everything is red

#

Unless someone makes a nice PR ๐Ÿคท

little eagle
#

the keyword definition is ... lacking a few

dusk sage
#

Someone added the 1.66 ones

#

Surprised tbh

#

It was way outdated before that

tough abyss
#

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

native hemlock
tough abyss
#

Ah, damn, overlooked them. Thanks Penny.

tough abyss
#

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{

vapid frigate
#

@tough abyss you restarted the game? it'll cache textures by filename

tough abyss
#

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.

vapid frigate
#

yeh renaming a file isn't the same as changing its type ๐Ÿ˜ƒ

tough abyss
#

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.

#

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.

noble juniper
#

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

rotund cypress
#

Is there any good optimised way to completely disable fog on servers?

#

Right now I do 0 setFog 0 on eachFrame

jade abyss
#

on each frame??? wtf?

rotund cypress
#

Yes

rancid ruin
#

maybe a good first pass at optimisation would be to not do it every frame

rotund cypress
#

While loop with a sleep would be better

#

But its not good enough

tough abyss
#

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...

rotund cypress
#

Just make a script on an eventhandler to remove all guns when used that you dont allow @tough abyss

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.

vital onyx
#

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

dusk sage
#

One command, no accuracy needed ๐Ÿ˜›

little eagle
#

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 ยฏ_(ใƒ„)_/ยฏ

vital onyx
#

@little eagle a single trigger instead of multiple loops + unified interface for one-time and recurring jobs

#

so, not so bad as an option ;)

little eagle
#

You could achive the same with a loop

vital onyx
#

maybe, but trigger is a bit more flexible

dusk sage
#

He just needed to run one command every so often

#

๐Ÿ˜›

little eagle
#

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

dusk sage
#

I've never played with fog, but I've noted people in the past fiddled with the attributes and still had fog

little eagle
#

yeah, if you up the rain too high

sharp jay
#

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.

jade abyss
#

Keywords:
Eventhandler, InventoryOpened, false

sharp jay
#

will look into that.

cerulean whale
#

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?

vital onyx
#

there are multiple ways

#

first you may just reopen it once it is closed

#

:)

#

second - disable user's input

little eagle
#

add a keyhandler and block DIK_ESC

cerulean whale
#

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

west lantern
#

is it possible to damage the legs of a player or NPC so that it cant move/walk in a3?

halcyon crypt
#

probably?

#

not sure if you'd be able to prevent moving/walking entirely with that though

jade abyss
#

no

loud python
#

well, for the NPC, you can just this disableAI "MOVE"

jade abyss
#

For players: The only option is to interfere with the Keyinput (e.g.: using a Keyhandler that negates the movement input, when Var1 = true)

loud python
#

Can somebody look at my code in #arma3_scenario and tell me if there's something obvious wrong with it?

little eagle
#

@tough abyss Good ruse, but the pause menu cannot be rebound.

final gale
#

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";

west lantern
#

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
loud python
#

why not condense that to

{_unit setHitPointDamage [_x, 0.2];} forEach ["HitBody", "HitArms"]

?

little eagle
#

forEach ["HitLegs"];

loud python
#

That's kinda useless; might at least directly _unit setHitPointDamage ["HitLegs", 1];

little eagle
#

also isKindOf "CaManBase"

#

before it bugs out on sheep and rabbits

loud python
#

wait what?

#

sheep and rabbits are men?

little eagle
#

class Animal: Man

loud python
#

...

#

#justarma3things

little eagle
#

class Woman: Man ยฏ_(ใƒ„)_/ยฏ

loud python
#

class inheritance: works when used right

little eagle
#

At least they fixed Campfire_light_F inheriting from Ship

west lantern
#

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

loud python
#

wait, does that mean god is a vehicle?

west lantern
#

kek it is what you want it to be

jade abyss
#

God is dead. End of Convo.

loud python
#

there's a way to find out

#
if (alive god) then {hint "he's alive"} else {hint "nietzsche was right"}
little eagle
#

isAlive

jade abyss
#

"isAlive"

loud python
#

you're right, it's alive

#

*fixed it*

#

I've had to think about GML stuff today

#

GML has function names like that

west lantern
#

That's kinda useless
making sure that when I set HitLegs to 1, that Arms and Body is lighly damaged aswell, hence the setup

little eagle
#
    class AllVehicles: All {
    class Land: AllVehicles {
    class Man: Land {
    class Animal: Man {
    class Animal_Base_F: Animal {
    class Snake_random_F: Animal_Base_F {
loud python
#

why do a forEach with only one element though?

little eagle
#

A snake is a Man and an AllVehicles

west lantern
#

ah the script is more complex thats just example, sorry for the confusion

little eagle
#

The forEach is so both legs are affected

#

duh

west lantern
#

it handles vehicles too

rotund cypress
#

Hey does anyone know how I can attach a say HMG for the prowler onto a quadbike? Not using attachTo command

loud python
#

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

river blade
#

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)"

loud python
#

@rotund cypress as far as I know that doesn't work like that

little eagle
#

Not every vehicle is mountable

jade abyss
#

Just like in real-life

rotund cypress
#

I've seen it done

#

ok

#

But

#

Is there any HMG that is mountable onto say a quadbike or any other vehicle?

river blade
#

cant u just attach a static one?

loud python
#

weapons in arma 3 are pretty much part of the vehicle itself

#

they aren't just "mounted" on it

rotund cypress
#

I know, but I saw some HMG or Machine Gun mounted on top of a truck.

loud python
#

you'd have to mod your own vehicle

rotund cypress
#

That does not belong there by default

#

And it wasnt modded

#

I tried addWeaponsTurret and commands like that but didnt work

little eagle
loud python
#
  1. there are cars with mounted machine guns, make sure it wasn't one of those 2) attachTo
rotund cypress
#

I know there is attachTo command, but is there no other way?

little eagle
#

No

jade abyss
#

no

loud python
#

yes

little eagle
#

fuuu

loud python
#

mod your own vehicle in

jade abyss
edgy aspen
#

Thank you.

west lantern
#

oh wait, text? Does BIS_fnc_3dcredits works still?

little eagle
#

You have to hang out with the cool kids to get a bluename

jade abyss
#

yep yep yep

river blade
#

i tried them but I need a way to make them only apears to the player near them (<5m)

jade abyss
#

(scroll up, if you don't believe me ๐Ÿ˜„ )

river blade
#

appears*

little eagle
#

you have to add distance checks and fade outs then

jade abyss
#

+resizing of the image size

little eagle
#

yeah. you can do basically anything

#

but it will be more than 5 lines

loud python
#

everything under 2000 lines is a small project

west lantern
#

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

little eagle
west lantern
#

def more than 5 lines ๐Ÿ˜‰

little eagle
#

If you need 2k lines for 3d icons you are doing it wrong though

river blade
#

yeah lol

little eagle
#

they're not that complex

west lantern
#

well its not 5

#

10 maybe ๐Ÿ˜›

loud python
#

I'm not saying you'd need more than 2k lines for this xD

little eagle
#

_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);
๐Ÿคฆ

loud python
#

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

river blade
#

@little eagle so how do I check the distance and make it fade?

little eagle
#

how to fade
alpha value below 1 in drawIconWhatever

#

how to distance check
player distance _target

#

add some math

#

SQF magic

#

done

loud python
#

SQF magic

#

that's what everybody wants to read in a comment

#

//magic

river blade
#

ok, make it invisible + "sqf magic"
ty

loud python
#

followed by //TODO: write comments to explain what this does

little eagle
#

I'm not gonna write it for you, Oscar

river blade
#

i know

#

lol

tough abyss
#

Is using the stringtable.xml good for convience?

#

I'm using it as part of our framework.

little eagle
#

it's good for using translations

west lantern
#
{
    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
tough abyss
#

For lump all string values into 1 box

little eagle
#

concerned about magic numbers?

#

stringtable is really only usefull for translations

loud python
#

magic numbers are cool

little eagle
#

Hope we get enums with Enfusion or whatever it's called

jade abyss
#

no boobies, boring link

little eagle
#

Can't link boobies here, Dscha

#

/ /( . Y . )\ \

#

best I have

jade abyss
#

niccccceeee

#

๐Ÿ˜„

little eagle
#

how to get bluename:

#
  1. post boobies
jade abyss
#
  1. tell @open vigil that you posted them. He will add you to a special group.
little eagle
#
  1. Claim it's actually just a regexp
loud python
#

you need to format it as code if you want to claim it's a regex

#
( . )( . )
-- Captures tho characters surrounded by spaces
tough abyss
#

How do I get ArmA 3 tools to register Posideon tools?

west lantern
#

legit ways to knock the player out of hit feet?

#

as in vanila ways w/o spawning shit to hit it

west lantern
#

[_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...

west lantern
#

getting generic error in expression when using uiSleep 2; weird

tough abyss
#

Scheduled or unscheduled?

west lantern
#

EH so unscheduled

tough abyss
#

sleeping isn't allowed in unscheduled

#

uiSleep 2; suspends everything

#

and is not allowed in unscheduled

west lantern
#

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

tough abyss
#

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

west lantern
#

someone that does scripting a lot might

#

not me though, TIL

tough abyss
#

There is not a getPosAGL?

native hemlock
#

Well test2 isn't defined

#

Don't think so, but you can always do ASLToAGL getPosASL

tough abyss
#

@native hemlock thanks.

meager granite
#

getPos supposed to be getPosAGL but there are some BUTs

thin pine
#

Watery butts

little eagle
#

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

half monolith
#

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

cerulean whale
#

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

half monolith
#

i dunno this may be above my paygrade lol

thin pine
#

Could someone politely discharge that man from this discord server please?

tame portal
#

@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

open vigil
#

@MrSanchez#5319 Done

thin pine
#

I thank thy dearly

#

Though his links are still here unfortunately

#

From which he could profit

open vigil
#

are you on mobile?

#

either way, close the app and reopen it, they should disappear.

thin pine
#

Ah

#

Cheers.

#

Did not appear to work but i assume it will for others

open vigil
#

Ive just restarted all of my devices (mobile and Desktop) and its gone.

thin pine
#

Restarting whole device != restart app but it's fine ;)

open vigil
#

๐Ÿ˜‰ but it also worked when I restarted the app (But also poor initial choice of words on my part)

little eagle
#

@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

nocturne iron
#

@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

little eagle
#

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 ?

opaque topaz
rotund cypress
#

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

cerulean whale
#

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];
};

tough abyss
#

lock: something setVariable ['bis_disabled_Door_1',1,true]; unlock: something setVariable ['bis_disabled_Door_1',0,true];

carmine sonnet
#

@rotund cypress I think its the command "action" off the top of my head. Cant look right now to check though.

polar folio
#

how do you get the position now and what is wrong with it?

halcyon crypt
#

do EHs set with ctrlAddEventHandler persist when the display it's setting them on is closed and opened again?

polar folio
#

i don't think so but should be easy to debug.

halcyon crypt
#

it is, but testing the easy way first ๐Ÿ˜›

polar folio
#

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

halcyon crypt
#

see, easy ๐Ÿ˜„

#

trigger some curious minds and the work will be done ^^ lol

polar folio
#

the fine art of making others work for you

halcyon crypt
#

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

polar folio
#

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

halcyon crypt
#

I'll give it a shot ๐Ÿ˜ƒ

polar folio
#

remember you also have to press a key since it's a key down EH

halcyon crypt
#

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

polar folio
#

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?

jade abyss
#

@halcyon crypt e.g. InventoryOpened EH is NOT permanent and needs to be added again, when its closed (iirc ๐Ÿ˜„ )

cerulean whale
#

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

polar folio
#

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.

marsh storm
#

Is there a way to check if a player has a specific addaction?

#

Not finding anything anywhere on it :/

dusk sage
#
_distance = selectMin (object_array apply {_x distance player});

@tough abyss

marsh storm
#

@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

cerulean whale
#

Volc... when you set the action do An_Action = addAction.. then maybe if !isNil An_Action

#

something like that?

marsh storm
#

@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

cerulean whale
#

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

marsh storm
#

I hadn't thought to check if the variable was nil, that's a clever way to do it

dusk sage
#

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

polar folio
#

this

#

plus this

#

i think

dusk sage
#

Overcomplicating it

#

Just set a flag on the player when they have this addAction

polar folio
#

true

dusk sage
#

If you only want to know if they possess it

#

No need to go into the nitty gritty

polar folio
#

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?

dusk sage
#

faster than the loop I'd imagine

#

It will work ๐Ÿ˜›

polar folio
#

how do you output the object though?

dusk sage
#

Unless there is a syntax issue

polar folio
#

isn't that the point?

#

to get hte object not the distance i mean

dusk sage
#

I just saw Quik's code

#

And posted a neater way

polar folio
#

hm

dusk sage
#

but

polar folio
#

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

dusk sage
#
_distances = object_array apply {_x distance player};
_object = object_array select (_distances find (selectMin _distances));
#

Hard on phone

polar folio
#

was just gonna say. clone array to get the index yea?

dusk sage
#

You need a reference array for the index

polar folio
#

cool. neat

dusk sage
#

@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

vapid frigate
#

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

marsh storm
#

Hey @tough abyss @dusk sage @cerulean whale thanks for the advice, got that working

cerulean whale
#

np

marsh storm
#

Appreciate that fellas, all the best

dusk sage
#

๐Ÿ‘

polar folio
#

i made them race. BoGuu slightly faster. this is fun. someone bring up anotehr problem for those two to solve ๐Ÿ˜„

nocturne iron
#

Any of you guys good with dialogs?

#

Having a perplexing issue

polar folio
#

i think everyone hates dialogs in arma. just describe

nocturne iron
#
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

dusk sage
#

waitUntil {!isNull (uiNameSpace getVariable "ui_master")};

#

Is that null to begin with?

nocturne iron
#

It's a trick to wait until the display has been loaded

dusk sage
#
waitUntil {!isNull (uiNameSpace getVariable ["ui_master", displayNull])};
nocturne iron
#

Picture controls in the display display perfectly

dusk sage
#

I'm just questioning whether your waitUntil is doing anything

nocturne iron
#

Probably isn't tbh, just following a tutorial

dusk sage
#

use the default above

rotund cypress
#

Is there a way to intentionally log things to remoteExec log?

dusk sage
#

So it will always returned null if nil

rotund cypress
#

By remoteExecing

dusk sage
#

Sure

#

Set it to log things, then remoteExec

#

๐Ÿ˜›

nocturne iron
#

Thanks bo

rotund cypress
#

It logs some things

dusk sage
#

@nocturne iron try use

rotund cypress
#

But I dont actually know where I define what it should log?

dusk sage
#

ctrlSetText [idc, text]

#

@rotund cypress remoteexec.txt

#

Can pick and choose what to log

#

Normal BE filter things

nocturne iron
#

That's the dialog format though, I'll give it a go

rotund cypress
#

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?

dusk sage
#

You're correct, my bad @nocturne iron

#

Where are your controls defined?

nocturne iron
#

in a #include'd file called dialogs.hpp

dusk sage
#

Nvm, I'm blind

#

Not my day

nocturne iron
#
{
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;
        };
    };
};```
dusk sage
#

As a tip

#
onLoad = "with uiNameSpace do { ui_master = _this select 0 }";
#

Can just be

nocturne iron
#

I'm happy as for tips

#

only just dipping my toes into dialogs now

dusk sage
#
onLoad = "uiNameSpace setVariable["ui_master", _this select 0]";
nocturne iron
#

thanks

dusk sage
#

Not seeing the issue with those

#

Try set the text via debug

nocturne iron
#

Alright

dusk sage
#

And change the waitUntil

nocturne iron
#

Okay

dusk sage
#

Maybe stick a hint after it, so you know when to expect them to appear

nocturne iron
#

Yeah put all that in

#

It's just bizzare, all the images and boxes work fine

dusk sage
#

Does the initial text work?

nocturne iron
#

nope

dusk sage
#

as in from the config

nocturne iron
#

Yeah doesn't work

#

I'll quickly retest it though

dusk sage
#

I'd start by removing the font and font size properties

#

And you're sure its location is visible?

nocturne iron
#

Yeah

polar folio
#

yea sounds like your config is faulty

nocturne iron
#

Okay

polar folio
#

of those control types

nocturne iron
#

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;

};```
polar folio
#

that worked?

nocturne iron
#

it has previously

#

and there wasn't an error in the GUI editor or anything if that means anything

polar folio
#

not sure about your sizeEx in the current one (not the last posted one)

nocturne iron
#

does it have to be between 0 and 1?

polar folio
#

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

nocturne iron
#

Ah shit I think I might have mixed safeZone and GUI_GRID Coord spaces

#

I'll try fixing that

rotund cypress
#

@dusk sage would 1 logwhendetected in remoteExec.txt work?

#

Then when i call logwhendetected

#

it will log?

polar folio
#

i'm just guessing until someone fluent and competent shows up ;D

nocturne iron
#

aha

dusk sage
#

@rotund cypress Try it ๐Ÿ˜‰

#

Don't have to restart A3 to reload the filters

polar folio
#

is GUI_GRID_H a constant like safezoneH?

nocturne iron
#

@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

rotund cypress
#

txt is not sqf

dusk sage
#

Well, not really

#

BE filters are dodgy as hell

nocturne iron
#

Oh I'm an asshole

dusk sage
#

Compared to SQF

nocturne iron
#

nvm

dusk sage
#

It's a ๐Ÿคท on will it work

nocturne iron
#

having a look for you now @polar folio

dusk sage
#

You'll need to define GUI_GRID_H yeh

polar folio
#

so doing * 1.6 would mean you get letters 1.6X the size of your screen

nocturne iron
#

Yeah

dusk sage
#

lol

nocturne iron
#

I think that's it

#

:p

rotund cypress
#

That did not work @dusk sage

dusk sage
#

Did you try w/o the two fields like I suggested?

polar folio
#

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

nocturne iron
#

Trying it now, last time I launched A3 just had one of those moments

#

That makes sense

dusk sage
#

Try log everything and catch what it logs as @rotund cypress

rotund cypress
#

@dusk sage I'm supposed to put a folder with my mission name in the same folder as the remoteExec.log right?

polar folio
#

just remove sizeEX for now so it inherits it so we can rule it out

rotund cypress
#

And then stick remoteExec.txt in that folder?

dusk sage
#

Nope

nocturne iron
#

Thanks

dusk sage
#

you have a battleye folder

nocturne iron
#

Testing it now

dusk sage
#

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)

nocturne iron
#

Okay the rest of the UI isn't even appearing now

dusk sage
#

lol

rotund cypress
#

"-profiles=D:\ArmaInstallation\config"

#

That is what I have

#

What you mean?

nocturne iron
#

Is C++ like SQF in that you need to use ' ' to isolate strings within " " strings?

polar folio
#

yea

#

' ' or double quotes

#

oh wait

#

in sqf. no idea about C++

nocturne iron
#

Yeah

polar folio
#

if by C++ you mean arma configs then yes ๐Ÿ˜„

nocturne iron
#

I think the new method of checking load is screwing init

#

Yeah :p

#

It's technically C++ :p

rotund cypress
#

@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

dusk sage
#

just 1 be folder

#

@nocturne iron

string = "'hello'";
string = " ""hello"" ";
string = " "" """ hello """ "" ";
nocturne iron
#

Thanks

#

Also it's not even showing up now

#

any of the display :p

dusk sage
#

๐Ÿ˜ฎ

polar folio
#

after what change?

rotund cypress
#

Doesnt work @dusk sage

nocturne iron
#

Not sure

polar folio
#

lol

dusk sage
#

@rotund cypress Doesn't work? is anything logging?

nocturne iron
#

since I did some of the changes and renabled the dialog

dusk sage
#

Or filters not loaded?

rotund cypress
#

How do I make it so everything logs? @dusk sage

polar folio
#

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

nocturne iron
#

Yeah

#

I think it's in the actual calling of the ui though since the photos aren't showing now

dusk sage
#

1 "" @rotund cypress

rotund cypress
#

thanks

#

ill try

nocturne iron
#

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

polar folio
#

so what was it? mistake before you even came here?

nocturne iron
#

I think it was the SizeEx * GUI_GRID_H

#

Since that wasn't working beforehand anyways

polar folio
#

ye would make sense

nocturne iron
#

Yeah

#

changed from ui_init.sqf to init_ui.sqf, it's the dumb things that get you

polar folio
#

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

nocturne iron
#

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

polar folio
#

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

nocturne iron
#

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

polar folio
#

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

nocturne iron
#

Yeah

#

Trying to get a neat team-coded unit light up 'thingo' so people can do night ops with zeus without NVG

polar folio
#

just some ambient light around the unit? or some more elaborate scripted flashlight?

nocturne iron
#

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

polar folio
#

are you doing all mission side stuff or addon code?

nocturne iron
#

mission side

#

this but seeing if the GM can see it from like 1km away

polar folio
#

i can barely see it on this pic lol

#

is the main purpose for the GM to see it?

nocturne iron
#

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

tough abyss
#

Can i use hideObject in a rope? ๐Ÿ˜„

dusk sage
#

Have you tried using hideObject on a rope ๐Ÿ˜ƒ ?

tough abyss
#

Quick noob question (dont use them, never have) what is the point of battle eye filters?

nocturne iron
#

lel

tough abyss
#

Thanks

cerulean whale
#

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

dusk sage
#

Depends what you want to do with it

#

In the engine it will use an exponential

#

You just have to accept that

cerulean whale
#

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

dusk sage
#

Then just use the string UID

cerulean whale
#

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

dusk sage
#

You will be absolutely fine, I'd suggest using something like a varchar for your UID DB side though

cerulean whale
#

I am using one xD

dusk sage
#

Then it's fine

#

Use the string in the query

cerulean whale
#

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

dusk sage
#

Well, it's not an integer ๐Ÿ˜„

cerulean whale
#

Well, whatever xD I don't do goddamn SQL haha

vague hull
#

I am turning stupid I guess.. is there any command like: "removeMagazine(s)" for a container?

meager granite
#

no

vague hull
#

so I will need to replace the whole inventory to remove a mag right?

cerulean whale
#

@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

vague hull
#

I wanted to remove the mags of a certain type

cerulean whale
#

gimme 2mins

vague hull
#

I allready got that code

#

Just wanted to know if there was any smarter way than clearing the whole inventory

cerulean whale
#

Oh, well not rlly

#

just push it into an array using MagazineCargo and then delete from there, then readd

vague hull
#

welp... after 6 year I would apprechiate such commands more than 64 bit tbh

cerulean whale
#

xD

#

64 bit is sexy tho

vague hull
#

havent said anything against that

#

just well.. you get the point I guess^^

meager granite
#

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

cerulean whale
#

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?
vapid frigate
#

array select 1 should be ["B_Kitbag_mcamo","B_Kitbag_mcamo"]

cerulean whale
#

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

cerulean whale
#

What setPos / getPos allows for building surfaces?

little eagle
#

ATL ?

cerulean whale
#

Nvm. I've done it a different way

vagrant canopy
#

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?

jade abyss
#

@vague hull

welp... after 6 year I would apprechiate such commands more than 64 bit tbh```
This command is needed since > 15 Years!
vague hull
#

Actually its needed ever since. That simple ๐Ÿ˜…

#

I mean, even just removing all of one type would be a huge boost

meager granite
#

@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

jade abyss
#

iirc there was a max amount of e.g. Bulletholes, sooo

jade abyss
#

e.g. = example given = "not every case explained, just giving the idea of what was meant"

rancid ruin
#

e.g is latin bro

#

exempli grati or something

dusk sage
#

for the sake of example

west lantern
#

IE

#

in example

#

exempli gratia

#

e.g.

vague hull
#

is there any way to prevent a weaponholder from despawning instantly after clearing its inventory?

vital onyx
#

why do you need this?

vague hull
#

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

vital onyx
#

just create a new ground weapon holder

#

and fill it

jade abyss
#

โ˜

rotund cypress
#

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;
    };
}];
meager granite
#

Looks like a good solution

vague hull
#

@vital onyx tryed that, didnt help ..

meager granite
#

weapon holder despawns on next simulation frame if empty

loud python
#

hey guys, any idea about how one could use the virtual arsenal as a store for something like wasteland or altis life?

meager granite
#

you'll need to go unscheduled and do everything in one frame

rotund cypress
#

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;

    };
}];
polar folio
#

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?

vague hull
#

@meager granite Will try that now

polar folio
#

thx!

#

it's addon side so i never thought about description.ext. gonna see if i can make it work in a config

vague hull
#

@meager granite didnt help aswell

loud python
#

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

polar folio
#

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

loud python
#

I've seen that

#

but it returns an array of arrays of the form [group, waypoint_index]

#

no name to be found

polar folio
#

then your initial method of starting with the name is bad

#

can you explain more about the context?

loud python
#

I want to remove a waypoint

#

which I gave a name in the editor

polar folio
#

under what condition?

#

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

loud python
#

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

polar folio
#

still works...in theory since you still use the name to perfectly identify

#

let me whip out some pseudo code

#

sec

loud python
#

how am I using the name?

polar folio
#

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

loud python
#

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

polar folio
#

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

nocturne iron
#

@tough abyss poseidon is great until you run into sublime text's $70 pricetag ๐Ÿ˜„

vital onyx
#

@rotund cypress you may better like smth player action ["NVG",player] instead of linkItem hmd

rotund cypress
#

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

rotund cypress
#

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

tough abyss
#

@nocturne iron Sublime text in Poseidon is free

opaque topaz
#

Atom with language-arma-atom package is awesome too

dusk sage
#

^ ๐Ÿ‘Œ

nocturne iron
#

@tough abyss is it? Prevented me from saving and such

tough abyss
#

Didn't have that problem on my end?

#

Nope worked for me

#

using the self-contained zip version?

#

Or the executable installer based one?

cerulean whale
#

@nocturne iron it comes ipt when you save but can just exit

nocturne iron
#

Thanks

nocturne iron
#

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

meager granite
#

why do you remoteExec cutRsc?

vague hull
#

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

meager granite
#

No it would be worse

#

UI is client-side business

vague hull
#

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

nocturne iron
#

Ah

#

Thanks

#

I see where I'm going wrong

#

Was trying to send it to clients but I've missed the obvious

nocturne iron
#

the ctrlSetText command still doesn't work

vital onyx
#

It does

#

probably you are using it in a wrong context?

nocturne iron
#

Potentially

vital onyx
#

it has a different syntax for dialogs and displays

nocturne iron
#

    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

vital onyx
#

add line disableSerialization; after while {true} do {

nocturne iron
#

I added it before the loop?

vital onyx
#

try inside the loop

nocturne iron
#

Giving it a go

#

No bueno

vital onyx
#

then log the variables ui_text_ind and ui_text_pop to see what's happening with them

nocturne iron
#

They've been defined as controls

vital onyx
#

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

nocturne iron
#

Sure

meager granite
#

Why do you create display each 10 seconds?

#

Why not have cutRsc outside of loop

vital onyx
#

was going to ask same question :)

nocturne iron
#

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

meager granite
#

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

nocturne iron
#

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
meager granite
#

what exactly doesn't work?

#

you don't define vblue_unitpop anywhere

#

you had it in earlier code

nocturne iron
#

They're defined elsewhere

meager granite
#

So what doesn't work then?

nocturne iron
#

Switching the values of the control doesn't work

meager granite
#

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

nocturne iron
#

Thanks

#

giving that a go

#

hmm

#

it never gets to the systemChat

tough abyss
#

is there any known LOD for a model that has to be present in order to get addAction to work?

meager granite
#

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

little eagle
#

VIEWGEO should be enough.

tough abyss
#

tested it with viewgeo but it might not help that it is a mine which is basically a projectile (cfgAmmo)

little eagle
#

Omg

#

You cannot addAction on CfgAmmo

tough abyss
#

damn ๐Ÿ˜ฆ

little eagle
#

just like how you can't use set/getVariable on them

tough abyss
#

fml mines are a real pita

meager granite
#

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

little eagle
#

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

tough abyss
#

did that for now (attachTo works) but its kinda ugly..

little eagle
#

oh. don't use "Logic" as logic

#

but "Building"

#

no AI overhead

meager granite
#

removing mines done just like I described it, action is on player himself, it checks if mines are nearby to become active

tough abyss
#

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

little eagle
#

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

tough abyss
#

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

little eagle
#

doubt it. CfgAmmo has no eventhandlers

#

the butterflies (CfgNonAiVehicle) do ๐Ÿ˜›

tough abyss
#

do you happen to know how ace deals with editor placed mines?

little eagle
#

they probably don't work tbqh ยฏ_(ใƒ„)_/ยฏ

#

or iterate through allMines in postInit. Would still mean that spawned ones mid mission don't work though

vague hull
#

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)

little eagle
#

You can't. It's a bug

vague hull
#

fml

little eagle
#

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

vague hull
#

that doesnt do it for me sadly

little eagle
#

why?

vague hull
#

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

little eagle
#

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

vague hull
#

It is for what its designed for.. but welp, might aswell just change that now

little eagle
#

but you have to juggle around a bit depending on what the end results are for different item sets
this should work either way

vague hull
#

yep, will try that now

little eagle
#

same thing for all possibilites

vague hull
#

btw, if a player drops an item, is the weaponholder created a GroundWeaponHolder or WeaponHolderSimulated?

little eagle
#

No idea. Try typeOf cursorTarget

vague hull
#

ok but thanks first of all

little eagle
#

deleted my suggestion. it doesn't work, but I'm sure you'll figure it out

vital onyx
#

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

vague hull
#

๐Ÿ‘ thx

jovial nebula
#

Is the setvariable command working with map-placed objects?

#

Such garbage containers

little eagle
#

no

#

variables should disappear on the local client if the cameras moves away far enough

jovial nebula
#

This sucks

#

Any workarounds?

halcyon crypt
#

keep them in a global var or a CBA namespace?

#

or a CBA hash

vital onyx
#

where CBA namespace is an array inside mission namespace?

halcyon crypt
#

๐Ÿค”

lilac halo
#

are they going to fix CBA soon i cant run my server with my mods without CBA ๐Ÿ˜ฆ

vague hull
#

@little eagle actually worked now thx for the help

cold linden
#

its possible to get the addonname by classname?

#

*is it

vague hull
#

if the addonmaker was nice to you, there yshould be an entry in cfgPatches about it

#

yet that doenst need to be there

lilac halo
#

am i wrong that i need CBA for NIarms mods? or can my server run without them, oh nvm its a supid requirment ugh

vague hull
#

CBA is needed for NiArms?

lilac halo
#

yep

vague hull
#

thats new to me

cold linden
#

which mod you mean?

lilac halo
#

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

vague hull
#

@cold linden ?? this could be the case in any mod

cold linden
#

sry, i mean Estron with my last message

vague hull
#

uhmm, NiArms actually works with an older version

#

I dont know why its a dependency anyways

lilac halo
#

oh?

#

bah steams down :/

vague hull
#

if needed just ask about it in the forums

#

or on twitter

lilac halo
#

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.

polar folio
#

it probably uses CBA for scripted features like bolt action animations or similar

indigo snow
#

Actually the rails

lilac halo
#

so im forced to wait till cba is up to date till i can even run my server?

polar folio
#

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

lilac halo
#

um, but i dont want to remove the whole point of me owning a server, it was for my custom mod :/

polar folio
#

just pointing out the difference between "forced to" and "want to". not trying to be a dick here

lilac halo
#

ur fine, im not mad

polar folio
#

thank god ;D

lilac halo
#

:b

polar folio
#

so joint rails is in CBA now and that is the issue, right?

lilac halo
#

maybe havent dug that deep into it but most likley is

polar folio
#

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

lilac halo
#

oh, so run the server without CBA but still use NIarms stuff?

open vigil
#

Or download the up to date CBA from somewhere else

polar folio
#

oh so only steam is outdated/broken? i had CBA keep me from joinign a friend the other day too.

lilac halo
#

wait, thier is a up to date version?

#

why is it not on steam?

polar folio
#

don't listen to me. i'm not informed on the details

open vigil
#

I'm not saying it is or isnt broken, but my group and many others have had no issues with CBA lately.

lilac halo
#

are you using armaholic or steam version?

open vigil
#

PWS

lilac halo
#

hurm 3rd party auto updater i guess i could try it

rancid ruin
#

play with six is painful, don't subject yourself to it

lilac halo
#

ya reading up on it the whole idea is kinda stupid to me i mean isent that what steam workshop is for?

indigo snow
#

whats wrong with the version on the WS?

lilac halo
#

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

indigo snow
#

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?

lilac halo
#

think out of date steam version is 3.1.2.

#

if not out of date then no idea

open vigil
#

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.

lilac halo
#

@open vigil i might have to switch anyway if CBA is not working on steam

polar folio
#

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

rancid ruin
#

it has one of the worst user interfaces i've seen in a piece of software

polar folio
#

no need to hate. i don't use it myself and stuff but let's keep up the x-mas spirit ;D

leaden knoll
#

It does, but its far more easier to organise collections etc than SW.

open vigil
#

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)

lilac halo
#

@open vigil what you think the issue is?

little eagle
#

@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!

jade abyss
#

@Estron#5275 test

little eagle
#

this is not true. who knows what you broke on your end