#arma3_scripting

1 messages ยท Page 391 of 1

warm gorge
#

Yeah but you'd need to edit the script so that it uses multiple cameras rather than just the 1 like here

#

This script works around 1 camera. It can be moved to different locations but it will be the same on whatever laptops this is run on

#

@ionic anchor

ionic anchor
#

cheers @warm gorge i will have to look into how to edit it for multiple cameras ๐Ÿ˜„

unreal skiff
#

I need some help. I am trying to create a custom ask query using extdb3. Anybody know how?

still forum
#

@xAndreei#7190 Probably yes. Copy the code and modify it.

limpid pewter
#

hey, im just finishing up my loadout selection scripts/menus and realised a major flaw. I am trying to allow the player to select the base gun they want, then add attachments using the menu. The menu works great for all attachments except for underbarrel grenade launchers. Using the "arifle_MX_F" as a base weapon, does anyone know how to return an array of compatible grenade launcher and how to attach them to the weapon?

little eagle
#

["LMG_Mk200_F", "bipod"] call CBA_fnc_compatibleItems;

#

Or vanilla...

#

searching...

#

["LMG_Mk200_F", 302] call BIS_fnc_compatibleItems;
I believe.

limpid pewter
#

Ok, so that function should return an array of compatible underbarrel grendae launchers for guns that support them?

little eagle
#

Well idk. The base game has no underbarrel grenade launchers, but it has bipods.

limpid pewter
#

? the MX3GL has a nade launcher. Or do you mean that you cannot 'attach' such a launcher under the gun

still forum
#

There are no grenade launcher attachments

#

yeah you can't

little eagle
#

^ that is what I meant.

limpid pewter
#

bugger haha, that's what i feared : (

still forum
#

You have to choose a different base weapon

limpid pewter
#

bummer. Well thanks anyway. Helpful as usual

winter dune
#

@still forum where can I take a look at the source code of that BIS function?

still forum
#

Functions viewer

#

There is a button in the Debug console

winter dune
#

ok, thanks

astral tendon
#

[testguy2_1, "carriedStill"] remoteExec ["switchAction", 0, false];

#

is there a way to stuck dead unit in this action?

#

if i put that on a dead unit its plays the animation of being droped

simple solstice
#

you don't need false at the end btw

astral tendon
#

That was a copy/paste, any idea how to make this keeping working to dead units?

still forum
#

playMove/switchMove maybe if body is dead?

astral tendon
#

the body just jerk on the ground

#

and also, i cant use attachTo on a a dead unit

meager heart
astral tendon
#

thats not really what i want

#

this is just a scripted section of the mission were a medic carrys a wounded soldier to a black hawk, so its made by a AI.

meager heart
#

createAgent and then try what Dedmen suggest?

astral tendon
#

agents have a bad reputation

meager heart
#

๐Ÿ˜€

candid jay
#

is there an arma extension that allows to make http calls? not only get but post, and for 64 bit?

still forum
#

yes!

jade abyss
#

Or just use the search function

#

Start with: in:ChannelNamesWillPopUp http

tidal aurora
#

Could someone recommend me a mission with well written scripts., for inspiration/reference purposes?

still forum
#

Yeah! Uhm no.. wait.. Eh Maybe.. no... Eh.... Hm... This is harder than I expected... Does a mission without any scripts count too?

tidal aurora
#

umm you mean like something just hacked together with the editor?

#

doesn't have to be a masterpiece but i'd like to see some neat .sqf u know

still forum
#

All Missions or Mission Frameworks I know are good examples of 5 year old crappy ducttaped together code.

#

So looking for missions might not be the best Idea

#

I'd recommend ACE or CBA. But their code is hard to read unless you understand how Macros work

noble pond
#

i've got some code you could use as reference

#

its far from a masterpeice of SQF work but is simple enough to understand

still forum
#

He didn't ask for code. He asked for well written code

noble pond
#

lol snappy today?

tidal aurora
#

:D

#

Well I'll surely take a look at ACE / CBA source then

austere granite
#

this seems fine enough i think?

#

i haven't looked through it

austere granite
#

you should make Intercept replace 'comment'

#

and make it uninstall the game

still forum
#

:3

austere granite
#

yeah i guess no privates

#

lotsof nested ifs

still forum
#

Oh.. That too. Didn't even notice

austere granite
#

i didn't look through it ๐Ÿ˜„

still forum
#

Definetly not something for a beginner to look at while searching for how good code looks

austere granite
#

i'd send you might stuff, but then dedmen will bully me and well... it's as much a macro-fest as CBA so might as well look at CBA then

#

there's CLIB.... also macro-fest

#

there's a correlation here

still forum
#

The only really good code I know is ACE/CBA. The only bad thing is understanding the macros but that doesn't take that long.
Not even the code I write myself would be good enough to show a beginner

austere granite
still forum
#

A lot of that is just copy/rewrite from CBA tho

austere granite
#

i find it a little bit cleaner than CBA. CBA does have a habit in some sections to make crazy functions

#

i mean the places where that happens is 100% understandable and probably even neccesary

still forum
#

๐Ÿ˜„ correct

austere granite
#

but for someone 'new' it might make it harder to look at

little eagle
#

If you copy paste everything 10 times, it looks more impressive afterwards.

still forum
#

And knowing how CLib started... Just no.

little eagle
#

Just coincidence.

candid jay
#

@still forum if youโ€™re referring to ArmA3URLFetch that doesnโ€™t look like it dies post requests

still forum
#

It does.

#

Read the wiki on their github

#

The huge indentation pushes the code so far to the right that it goes offscreen.. so readability == 0 Because you can't actually see the code ๐Ÿ˜„

candid jay
#

I did but I donโ€™t see how to set a body in a post request.

still forum
#

I guess you could ask the author then

candid jay
#

will do

#

thanks

little eagle
#

Secret code after 30 tabs hoping no one finds it.

still forum
#

Around line 160 it goes offscreen when viewed on github

still forum
#

Commy why do you link to a few empty lines?

little eagle
#

^^

austere granite
#

show tab as 1 space ๐Ÿ˜‚

#

on a more serious note

still forum
#

I just don't understand why you need to nest half a dozen if statements and then just have

                                                                };
                                                            };
                                                        };
                                                    };
                                                };
                                            };
                                        };

at the end.. Instead of just putting everything into a single if statement

austere granite
#

Is there a way to select text through scripting command. when someone clicks a ctrlText box i want it to automagically select all the text

#

maybe i'm retarded (well probably tbh) but i dont see it

still forum
#

set selection in a ctrlText box?

austere granite
#

yep

still forum
#

I'd say no. But I'll look

little eagle
#

Ctrl a

still forum
#

I looked. no.

austere granite
#

lemme do _control ctrlSetTextSelect [0, 10] to select

#

INTERCEPT-MAN TO THE RESCUEEEEEEEEEEE

still forum
#

No. Intercept won't help you there

little eagle
#

Are you talking about the editboxes?

#

E.g. init box, exec box in debug console etc.?

austere granite
#
        class Value: ctrlEdit {
            idc = 100;
            tooltip = "";
            text = "0";
            font = __MONO;
            x = __GUI_SETTING_TEXT_W + __GUI_SETTING_SPACING_X;
            w = __GUI_GRIDX(5);
            h = __GUI_GRIDY(1.25);
        };
#

ctrlEdit

#

all

little eagle
#

Oh. I still don't know what these ctrl Variants do differently.

austere granite
#

uh, they're the same thing as normal ones

#

same typename

#

so yes, init, exec, whatever

peak plover
#

Ohh God that indenyation

little eagle
#

I don't think you can move the cursor with script.

austere granite
little eagle
#

Not even a clever work around from me. Except moving it to place 0 by deleting all text and resetting it a frame later.

austere granite
#

that doesn't select the text though does it

peak plover
#

And would be useful in many of those ifs

little eagle
#

True.

austere granite
#

so we come to a problem

#

time to delete repo

little eagle
#

What would you even need that for?

austere granite
#

so i select the box and you get all the text selected.... ๐Ÿ‘Œ๐Ÿป

peak plover
#

But why

#

Can't you copytocluoboard

austere granite
#

no

peak plover
#

Is it for the

Is it for the or

Is it for ts address or sth

austere granite
#

nah setting angles

peak plover
#

Ohh haw about

#

If clicked, delete it, if not changed or clicked elsewhere, restore old

#

I guess it's different

little eagle
#

Not possible afaik, too advanced for Arma.

austere granite
#

sad

still forum
#

easilly possible if you were a dev

#

an hour tops

little eagle
#

๐Ÿ˜ฆ

austere granite
#

does moricky still work at bis?

#

i gotta expand my PM list of "PLEASE ADD THIS UI COMMAND"

still forum
#

One day tops for me with Intercept and no battleye.

little eagle
#

Arma 1*

#

Name of A3 successor following EA logic.

jade abyss
#

EA-Logic?

#

lol

cosmic kettle
#

One*

still forum
#

That's why you should read messages from bottom up.. You read from top down and then the last message get's deleted before you can read

unreal skiff
#

I need some help. I am trying to create a custom ask query using extdb3. Anybody know how?

#

Custom query*

still forum
#

Ask the extdb3 guy

jade abyss
little eagle
#

I know how to create tanks and how to create missiles blowing up tanks, but wtf is a "query"?

jade abyss
#

There are soooooooooooo many entrys regarding that topic. It's easier if you take a look at those examples.

tough abyss
still forum
#

More OO stuff! Nice!.....

jade abyss
#

Driver for ExtDB? What does it do?

austere granite
#

"I drive"

still forum
#

It calls script functions for you if you call it's script function and tell it what script function it should call for you

jade abyss
#

*confuzl0rd*

still forum
#

Or in short Encapsulate totaly EXTDB3 commands through an object

jade abyss
#

that means what?

little eagle
#

2 smart 4 me

jade abyss
#

I rly have 0 idea what means, what you wrote up there Dedgirl

tough abyss
#

Its really just sqf functions for extDB3, since people get confused by the API trying to code it from scratch

jade abyss
#

Ah, pre-made functions to call extDB?

little eagle
#

Always good to make your frameworks as easy to use as possible.

jade abyss
#

Yeah. I had my own list of functions/files, that i reused everytime i tried something out

tough abyss
#

As for the OO part look at the examples, for the variable _extdb3 that is returned

austere granite
#

so is it psuedo-namespaces?

little eagle
#

Usage seems more like a universal do-it-all function.

#

Dscha, you'll like it.

unreal skiff
#

I'm still a little confused but I can probably figure it out ๐Ÿ˜‚.

jade abyss
#

Oh yeah, i love it

candid jay
little eagle
#

What's wrong with that one?

candid jay
#

nothinโ€™

little eagle
#

I vaguely recall A2 having one, so maybe there's one in CUP.

candid jay
#

iโ€™m looking into licenses

#

iโ€™m building a terrain and want to ask authorโ€™s permission to include it directly, not as a dependency.

#

he states that it belongs to BI so that makes it more complicated.

little eagle
#

This one apparently is the one from A2, so you could just get it from there.

#

If CUP can release A2 terrains, so can you.

candid jay
#

iโ€™ll see if itโ€™s in the a2 model pack

little eagle
#

As long as it's for Arma I guess.

candid jay
#

of course

winter dune
#

is there a way to set a specific event handler on a picture, like onButtonClick?

little eagle
#

Make a transparent button on top of it with the same dimensions and position.

winter dune
#

only that way?

little eagle
#

I think so, what's wrong with tha?

winter dune
#

meh, i have to write 2 controls instead of 1

tame portal
#

Does onMouseButtonClick not work in RscPicture?

little eagle
#

It may do, but not sure. I assume they tried and it didn't.

tame portal
#

@winter dune Did you try?

winter dune
#

no, testing right now

tame portal
#

Lul

little eagle
#

ยฏ_(ใƒ„)_/ยฏ

winter dune
#

didn't know that xD

tame portal
#

_ctrl ctrlAddEventHandler ["MouseButtonClick", { diag_log _this; }];

#

hm I assume it wont work

#

just saw that it passes "the pressed button" as a parameter

winter dune
#

I need something like onButtonClick inside the .hpp dialog file

#

not in a sqf

tame portal
#
onMouseButtonClick = "whateverfloatsyourgoat";
winter dune
#

nope

tame portal
#

I think the button overlay thing would still be the best idea

austere granite
#

doesn't do

#

need the button overlay

#

activeText supports it theoretically, but has other issues that i can't remember of the top of my head

peak plover
#

Sqf wud work

winter dune
#

there are no EH for pictures

little eagle
#

I recall seeing OMBC on a RscText, but I might misremember.

winter dune
#

ombc works on ListBox, ComboBox, TextBox, Button, ActiveText

little eagle
#

tf is TextBox?

peak plover
#

Debug console?

little eagle
#

EditBox is the name.

#

Because, you know, editable.

austere granite
#

TextBox implies... ctrlText which doedsn't work ๐Ÿ˜„

queen cargo
#

@winter dune there are ehs for pictures
You have to re-enable rscimage though as they are disabled by default and thus not raising events

austere granite
#

i mean here's another option.... use ctrlPictureButton?

#
        class ButtonAdd : SVAR(ctrlButtonPictureKeepAspect) {
            idc = __IDC_BUTTON_1;
            x = __GUI_PANE_W - (5 * GRID_W);
            y = __GUI_SETTING_LINE_H + (1.5 * GRID_H);
            h = (5 * GRID_H);
            w = (5 * GRID_W);
            text = ICON(content,add);
            tooltip = "Add selected entry to list";
        };
#

need more macros btw

little eagle
#

I approve.

winter dune
#

@queen cargo I'll go with invisible button lol

queen cargo
#

Enabling the picture and using left mouse button eh is enough @winter dune

little eagle
#

ctrlEnable?

queen cargo
#

But do as you like

little eagle
#
onLoad = "(_this select 0) ctrlEnable true";

Would this enable it?

#

And make the ombc fire?

queen cargo
#

Yup

little eagle
#

Do that then. It's exactly one line.

queen cargo
#

Took me some time to figure out

little eagle
#

That's super hidden, but convenient.

queen cargo
#

Kinda

austere granite
#

n1, didn't know that either

queen cargo
#

Images are disabled simply by default so that no accident happen

little eagle
#

Explains a lot.

queen cargo
#

As images in background then get moved to foreground etc

austere granite
#

X39 you happen to know a way to select all text of a ctrlText control on setFocus? ๐Ÿ˜„

queen cargo
#

Thus one have to be kinda careful

#

Though, there is also a Config switch to enable the image

#

Uhm... Gimme few minutes
Currently mobile and need to check some docs

tame portal
#

Why is it not enable = 1;

little eagle
#

ยฏ_(ใƒ„)_/ยฏ

tame portal
#

I always wondered why it isnt named like that, is there a reason?

little eagle
#

Probably a flag in style =

queen cargo
#

Right now too much to research on mobile

#

Search a command that allows you to set the selected text

#

If there is none, ask bi kindly

austere granite
#

was hoping for some magical hdiden trick. nothing in here

little eagle
#

Or, just do the ctrlEnable thing.

tame portal
#

Best is you use Intercept to enable the RscImage

tough abyss
#

How do I check if a weapon on the ground?

subtle ore
#

@tough abyss What do you mean? They're in weapon holders, so just check if it's not a part of the player's holder

plucky willow
#

I want to find all nearby buildings with interiors from a given location, is there a way to accomplish that?

little eagle
#
nearestTerrainObjects [player, ["House"], 200];
subtle ore
#

@plucky willow Buildings do have defined memory points for things like entrances, and i believe a few scattered positions. But other than that it'll be manuL

plucky willow
#

thats perfect @little eagle

#

thanks

subtle ore
#

Yeah what commy posted will return all your house terrain objects. (Which sometimes returns undesired objects remember that)

#

So in filtering the returned array you may need to disclude other object types like lamps

plucky willow
#

so what im planning on doing is checking for a minimum amount of building positions

subtle ore
#

Minimum amount? What do you mean?

plucky willow
#

like if theres only 3 building positions and i want to fit a squad of 5 inside the building

#

there will be overlap

#

so i would like to avoid that

subtle ore
#

the buildingPos command will return all positions it you use -1 as your tight param

plucky willow
#

yeah i already have something written i just couldnt figure out how to gather all available buildings

subtle ore
#

No, not necessarily. They can't all exist on the same position. They huddle around

#

I believe the max defined positions was like 9 iirc

little eagle
#

I thought there were buildings with like 50 positions. That hotel on Altis.

subtle ore
#

Ghost hotel? Wasn't that split into different assets though?

little eagle
#

Good point. I swear someone talked about buildings with many positions.

subtle ore
#

Not sure.

#

Which ones?

#

Purple? Have a screenshot handy?

#

Err...sort of. Moving onto cache sites and freeing prisoners

#

Ooh...really? Why does that have so many positions?

#

They're identical to the size of the adjoined houses on altis.

#

Lol

tame portal
#

i would have made the numbers with shadow = 2 style or 0

#

all around the numbers, i personally think 1 looks a bit weird ๐Ÿ˜›

subtle ore
#

Still doesn't make sense as to why there would be over 9 positions

#

Yeah the numbers stand out over the icon

tame portal
#

but like the "top is almost solid to almost gone background" fade effect

#

is that a texture?

#

oh okay so its a texture

#

looks good

#

but still the text could have needed a <t shadow='0'></t> or 2 imo :P
looks very good though nevertheless

#

yeah defintely blends in

plucky willow
#

maybe it was an intern who wanted to do more

subtle ore
#

Lol

#

Hmmm...interesting.

#

Heheheheh

plucky willow
#

if i create a variable without assigning it a value does it default to null?

little eagle
#

How would you even do that?

plucky willow
#

private _myvariable;

little eagle
#

That just fails silently if _myVar is undefined.

#

private command expects a string.

#

In scheduled, it would error.

plucky willow
#

so if I want it to be null, should i just set it to null?

little eagle
#

private "_myVar";

#

or

#

private _myVar = nil;

plucky willow
#

why nil

subtle ore
#

don't do the former

little eagle
#

Nil is for undefining a variable.

#

Or for having an empty array element.

#

Such stuff.

plucky willow
#

if its nil can i use the variable again? the wiki uses very strong words like destroy

little eagle
#

Yes you can use it again. And by using private, you set it's home scope.

#

And that is not destroyed.

plucky willow
#

okay, thank you

#

and just for my curiousity, where does null fall into all of this?

little eagle
#

There is not one null. There is one for almost every type.

#

It's just the empty "thing" of that type.

#

E.g. objNull is the empty vehicle/object.

plucky willow
#

i see, thanks again

little eagle
#

Sometimes the debug console prints <null>, but that is really just nil.

#

Inconsistencies.

subtle ore
#

๐Ÿ˜‘

little eagle
#

<any>, <null>, undefined

#

All just nil.

blissful depot
#

Hey guys, if I add a weapon to a vehicle using AddWeapon, is t here any way to control where specifically on the vehicle it will be shooting from?

#

(I'm making motorcycles that shoot gatling guns)

austere granite
#

UI fun part #2007. CtrlEdit does detect a mouseEnter event one time, after that it doesn't detect it anymore and obviously mouseExit even doesn't work.

#

Anyone know a workaround? ๐Ÿ˜„

blissful depot
#

ok how about this question, does anyone know how the engine determines the position of the "driver turret", I.E. if I use addweaponturret ["weapon_name",[-1]]; where will it be shooting from? And is there anyway for the driver to adjust the aim of this?

#

it seems like it's the model origin but I'm not really sure

little eagle
meager granite
#

And you can't do anything with it through scripting, its all in configs and model

hushed minnow
#

Hey #arma3_scripting , Just wanted to ask if there is a way to find out what a unit spawned as? Like 'AA specialist' or 'Light Rifleman'

tough abyss
#

hmm like the typeOf

#

?

#

thats just their class name

#

im sure there is a displayname in their config somewhere

hushed minnow
#

I understand you can use typeOf like if (typeOf vehicle player == "B_Soldier_lite_F") But i guess im looking for the classname itself

tough abyss
#

well if you can find a config of a soldier then you can find their name for the variable and refrence it in your script

hushed minnow
#

Oh im stupid, typeOf returns the classname.....

#

Nevermind, problem solved

subtle ore
#

@UltraNoob#5524 you can find the display name of a unit with this:

private _displayName = getText(configFile >> "cfgVehicles" >> typeOf player >> "displayName");
#

Which will return the display name like; "Rifleman"

#

or "Autorifleman"

astral tendon
#

How can i put icons in the actions? like the ones in the vanila campaing

blissful depot
#

thanks for the info @meager granite I'll check it out

astral tendon
#

but how about the icons?

astral tendon
#

if you play one of the laws of war showcases the actions have a icon

#

here

#

thanks

drowsy axle
#

Hey guys, I'm looking to see how I can have a foreach loop for a variable, which checks any sqf varName_x (_x is 1,2,3,4,5,6,7,8,9,etc...)

#

Hey guys, i'm looking for a way to have these objects that are created through a foreach loop. Here's the source and foreach at the bottom. How can I add the sqf allowDamage false? https://hastebin.com/nevixopuke.php

blissful wind
#

@drowsy axle {_x allowDamage false} forEach _myGroup;

tough abyss
#

hey guys, just a quick question, i am putting together a AI spawn script that currently spawns a group of AI and a loot box with 1 building randomly across my map but want to change it so it spawns a composition of buildings instead .... anyone got a hint on how i can do this

i am currently just using this:
_cargo = "Land_Cargo_Tower_V2_F" createVehicle _randomPos;

but want to change it so it spawns more buildings to make it look more like small camps

limpid pewter
#

@tough abyss
Put more lines like sqf _cargo = "Land_Cargo_Tower_V2_F" createVehicle _randomPos; one for each new building you want, then have the _randomPos variable change between them like this ```sqf
_randomPos = [(random [min,mid,max]),(random [min,mid,max],(random [min,mid,max]]; // First time
_cargo = "Land_Cargo_Tower_V2_F" createVehicle _randomPos;
_randomPos = [(random [min,mid,max]),(random [min,mid,max],(random [min,mid,max]]; //Second time at a new random position
_cargo = "Land_Cargo_Tower_V2_F" createVehicle _randomPos;
_randomPos = [(random [min,mid,max]),(random [min,mid,max],(random [min,mid,max]]; // Third time and so on

That's what i would do, but it is hard to help you directly without the rest of the code.
limpid pewter
#

I was wondering if anyone else here has ever attempted to or been successful in creating a system using scripting only to allow players to re-bind hard coded key bindings that use DIK-codes; like this ```sqf
menuOpenEH = (findDisplay 46) displayAddEventHandler ["KeyDown", {// Open Menu here}];

With only one or two hard coded bindings it is ok to work around them, but now that my mission has around 10 and more will be needed in the future to activate certain features, i am looking for a way to allow the player to actually change their these bindings with an ingame menu.  Searching the Wiki  showed that VBS has a simple answer to this, a file called dikCodes.hpp in the bin directory that basically cross-references all the DIK-Codes with their characters, but for Arma 3 this doesn't exist. 

Anyone know anything about this?
still forum
#

It does exist for Arma 3.

#

And the DIK codes (Direct Input key codes) are always the same everywhere

#

#include "\a3\ui_f\hpp\defineDIKCodes.inc" There

limpid pewter
#

Whhaaaaaaat, coool

meager heart
#

@limpid pewter This way ?

[] spawn 
{
    waitUntil 
    {
        (inputAction "Throw" > 0)
    };  
    hint "Throw Keys Pressed";
};
limpid pewter
#

@meager heart
Yeah but isn't this only for bulit-in actions within arma 3? I meant that i want to be able to let players edit the DIK-codes that i have set using the code ```sqf
menuOpenEH = (findDisplay 46) displayAddEventHandler ["KeyDown", {
if (_this select 1 == 45) then {
//Open Menu here
};
}];

still forum
#

Do you want to add your own keybinds. Or change the Arma ones?

limpid pewter
#

So i have already added my own keybindings, they work great. But there are around 10 of them now, and everyone who has tested my mission has different opinions about whether they like the bindings i have set and so i want them to be able to change them.

meager heart
limpid pewter
#

Btw, these keybindings are for activati ng functions such as miniMap zoom, menu opening, jumping, etc...

#

Yeah, that looks like a useful command, but not what i need.

i thought this was going to be hard , i was right haha. Thanks for the help anyway

#

I will have to manually create an array that relates the DIK codes to the characters.

meager heart
#

Yes but

#

What if player have custom keybinds or some sort of macros ?

limpid pewter
#

yeah, that's the problem haha.

#

Most people are fine with the END key as a cancel button, but one person uses it for opening doors, so i need to allow them to change it

still forum
#

CBA has their keybinding system. Which seems like that's exactly what you are trying to do

limpid pewter
#

yeah allright, i will check that out thanks

distant egret
#

Hey guys,
if I for example use "foo" remoteExecCall ["hint", 0 , "jip_test"]; and then at a later time use "bar" remoteExecCall ["hint", 0 , "jip_test"]; will this overwrite the JIP version of my hint? Or can the stringed JIP thing only be used for removal from the JIP queue?

meager heart
#

@distant egret From bis wiki: If a non-empty string is given, it is treated a custom ID of the message and the message itself is added to the JIP queue overriding any remoteExecCall message with the same ID.https://community.bistudio.com/wiki/remoteExecCall

distant egret
#

Shit lol, I even read that...

peak plover
#

Does cba keybinds work mission based as well? Without other mods?

tidal aurora
#

is it retarded to do "variableToDestroy = nil;" at the end of function? Is there not some sort of garbage colletion going on?

still forum
#

If you have CBA then yes @peak plover

#

@tidal aurora There is no garbage collection no. So it does make some sense to do that

#

But just use local variables then

peak plover
#

You should not need to delete variables if they are named ok

#

If a few kb of variables shouldn't cause issues

still forum
#

Yeah. Your one variable won't cause problems. Unless it's an array with over 9000 strings inside it

peak plover
#

I think at around over 20 mil variables crashed my game back in 32 bit

tidal aurora
#

hmm alright

#

so if i do call {_var = 420}; 50mil times will it crash my game? :D

#

call {_var = 420;}; i mean

still forum
#

no

#

_var goes out of scope and get's deleted

tidal aurora
#

ok now i get it

tough abyss
#

How would you disable peripheral dots?

still forum
#

You mean the dots at the screen border that can be disabled in the difficulty settings?

tough abyss
#

Yea, I disabled group indicators but I still see some dots on people in vehicles

still forum
#

visionAid maybe?

tough abyss
#

Gonna try that now

#

that works, thanks ๐Ÿ˜ƒ

peak plover
#

@tidal aurora I used variables with a bunch of random numbers in arrays. The game ran out of memory, everything turned into blocks looked like ofp, then eventually crashed

rotund cypress
#

Is it possible to use gradient in a controls background?

peak plover
#

You can use an image of a gradient

rotund cypress
#

Of course I can, but I am still wondering if I can use a colour for a gradient.

austere granite
#

no you can not

compact maple
#

Hello everyone, what is the most optimized way to trigger a script 5 hours (for exemple) after the server started ?

still forum
#

how exact does it need to be?

#

is +- 20 seconds acceptable?

compact maple
#

Yes its acceptable

still forum
#

A server-side only trigger with the time as condition

#

time > 60*60*5 for 5 hours. Also add up the numbers manually and write the result into there. Don't let SQF multiply the numbers like I wrote it. I'm just too lazy to calculate that now

compact maple
#

Ok thanks you !

#

but how doyou create a server-side trigger only ?

still forum
#

I think when you place a trigger you can set a checkbox for server only

compact maple
#

i mean i know how to create a basic trigger, but not a server-side

#

Okay, will check it, thanks you, again lol

little oxide
#

If you don't have check box, use createtrigger command at serverside, and you can put false parameter, that create only local to the server.

still forum
#

๐Ÿ‘

compact maple
#

true (Default) - trigger is global Effects of this scripting command are broadcasted over the network and happen on every computer in the network
false - trigger is local Effects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on

little oxide
#

yeah forget, it was only in my mind lol

compact maple
#

its ok thx :p

#

and, there is a way to launch a script 5hrs after server started, without a trigger ?

still forum
#

yeah

#

but you asked about the most optimal way ^^ Trigger is the most optimal for performance

#
[] spawn {
sleep 60*60*5;
<code>
}

in initServer.sqf

#

That again is serverside only. So you then have to remoteExec to the client if you want code on clients

compact maple
#

Thanks you for theses 2 methods ๐Ÿ˜ƒ

jade abyss
#

@still forum What about checking diag_TickTime?

still forum
#

that is from server start and not mission start

#

Also rechecking is more expensive than sleep

jade abyss
#
_EndTime = diag_TickTime + (5*60*60);
waitUntil{sleep 5; (diag_TickTime > _EndTime};```
still forum
#

yeah. But.. again rechecking everytime. And you don't get any more precision using that

jade abyss
#

or using it in sleep, doesn't mater

still forum
#

and it's more code

jade abyss
#

sleep can delay, when it's under heavy load, remember that ๐Ÿ˜›

#

oh boy

#

uisleep then

#

damn furry

still forum
#

no uiSleep and sleep don't make a difference on server

#

and waitUntil delays the same

jade abyss
#

Oo

#

Of course

still forum
#

any scheduled script can delay under load

#

uiSleep continues running when the game is paused. where sleep doesn't.
But you can't pause a server. So no difference

jade abyss
#

Is also not affected by slow F/CPS

#

but ordinary sleep is

little eagle
#

B-but every scheduled script is.

still forum
#

Depends on what precision you want.. And being a minute off on 5 hours.. well.. I wouldn't care..

jade abyss
#

yep

little eagle
#

If it's like time then it would be over one hour for 5 hours.

jade abyss
#

but could also be > 5min

still forum
#

Okey okey okey..
The most optimal way with 0 performance overhead and nanosecond precision: Intercept. Solved.

jade abyss
#

i remember the A2-Epoch times, when sleep fkd up everything and "events" started with a delay of 10-20minutes

#

lol Ded

compact maple
#

delay of 1 min is okay

#

nope

#

it could have been

still forum
#
    registerFunction("execAfter"sv, "Executes code after x seconds"sv, 
    [](uintptr_t, game_value_parameter left, game_value_parameter right) -> game_value {
        float sleepTime = right;
        game_value code = left;
        std::thread([sleepTime,code]() {
            std::this_thread::sleep_for(std::chrono::duration<float>(sleepTime));
            client::invoker_lock lock;
            sqf::call(code);
        }).detach();
        return {};
    }, GameDataType::NOTHING , GameDataType::CODE, GameDataType::SCALAR);

and SQF:

{<code>} execAfter 60*60*5;

Tadaaa

compact maple
#

lol

still forum
#

Though.. That will still execute the code after the mission ended ๐Ÿ˜„
But I'm too lazy to write the code so that doesn't happen

austere granite
#

i remember the A2-Epoch times, when sleep fkd up everything and "events" started with a delay of 10-20minutes

#

this tbh

#

spawn / sleep scares me

jade abyss
#

but no other way possible (inb4: yeah Ded, intercept can do it, damn furry)

austere granite
#

Furry territory

#

Sorry Dscha, you're a furry too

#

so am I ๐Ÿ˜ฆ

jade abyss
#

๐Ÿ–• never

still forum
#

Awooooo

jade abyss
#

๐Ÿ˜‚

shut flower
#

is Init evh also executed when a object is placed in 3den?

still forum
#

yeah

#

If you mean XEH or object class

#

atleast should be

shut flower
#

yep I mean XEH

#

thanks

little eagle
#

Init is, InitPost isn't.

shut flower
#

there is an initpost evh for objects?

little eagle
#

Yes.

#

chris579 -
In XEH there is.

shut flower
#

ok thanks

astral tendon
#

i cant use that killer == EAST

little eagle
#

So this is a well that can be blown up?!

#

side group killer == east

rotund cypress
#

RemoteExec without call, will that create a thread on targets computer or self?

little eagle
#

True

#

SimZor only for functions, for commands (setFuel, call) both remoteExec and reCall are the same.

rotund cypress
#

Yes, obviously, however, will it create a thread on target computer or my own computer?

little eagle
#

Doesn't matter which machine is the target.

#

Read that comment. Says it all.

rotund cypress
#

Did not answer my question, will it create a thread for my own computer on or the target computer?

#

I.e. if I disconnect, will the thread persist on targets computer?

little eagle
#

You can't have threads on your machine for other machines. That doesn't work.

#

I did?

#

Implicitly?

rotund cypress
#

Okay, thanks @little eagle

little eagle
#

yw

rotund cypress
#

You never know what bohemia comes up with...

#

Would not be surprised if it reated a thread on my computer and which executes on other computer

little eagle
#

That idea stumped me, so I couldn't get it at first.

astral tendon
#

so, how i set the killer then?

#

Thanks

shut flower
#

so I applied the xeh init evh to my objects which works fine when placing a object in 3den howevery when starting the scenario in 3den and aborting back to the editor it doesn't work

little eagle
#

What are you doing?

shut flower
#

basicially I'm dynamicially retexturing objects on init

#

at least this is what I want to

little eagle
#

Current script?

shut flower
#

what do u mean?

little eagle
#

Paste the current script, so I can try myself or smth.

shut flower
#

gimme one sec

rotund cypress
#

Guys, does remoteExecutedOwner work over the network? Like if I check locally (owner _foreignObject)

#

I remembered something about it always returning 0 or something...

restive matrix
#

anyone know how to fix the bug with arma 3's respawn template screen "MenuInventory" where sometimes it wont spawn you with the selected loadout? selecting it twice seems to fix it sometimes

shut flower
#

@little eagle this is the script called upon init

little eagle
#

Does the Dragged3DEN work?

shut flower
#

yes

little eagle
#

Does setObjectTextre complain about undefined variable in array?

shut flower
#

don't think so, no

little eagle
#

The error is, that it does show the default textre when returning from a preview in 3den, right?

shut flower
#

yeah, since it doesn't has a default texture it's transparent

#

(should adjust this)

little eagle
#
[_object, _texture] spawn {
    (_this select 0) setObjectTexture [0, _this select 1];
};

Try this for the second setOT.

shut flower
#

you mean the one at line 23/24?

little eagle
#

24

#

I think you also have to do this for the third / setOTGlobal, because commands that do network synching, like setVariable public or setObjectTextureGlobal, fail to synch to clients when executed from an init eventhandler.

shut flower
#

is cba waitandexecute also fine? like with 0.1 secs delay?

little eagle
#

Nah, this spawn is ok. Just need to push it to next frame.

#

execNextFrame and waitUntilAndExecute don't work in 3den, because time doesn't progress.

shut flower
#

the third one will be removed anyway

#

and the spawn thingie doesn't work

little eagle
#

I don't know then. Check if _texture is defined. Add some diag_log and see if the eventhandler fires.

shut flower
#

kk

cosmic kettle
#

@little eagle The fact that OTG fails to sync isn't noted in the wiki? Is this an 3den thing or are you referring to:

Do not put global commands such this one into init field in editor and expect it to work in Multiplayer. See Talk:setObjectTextureGlobal for the explanation.
shut flower
#

3den isn't syncing

little eagle
#

No, in general, all commands that do synching don't work in MP when executed from the init event. They do from init box however.

shut flower
#

so the init evh fires but it seems that the 3den check is false

#

I think I'll wrap the whole init into a spawn maybe this works

cosmic kettle
#

Stupid question probably but had to ask; what is the difference, if any, between:

params ["_var"];

and

params ['_var'];
little eagle
#

Oh, yes

shut flower
#

there is no difference

little eagle
#

is3den reports false for the first few frames when returning from a preview.

#

That is a known bug. Known to me at least.

cosmic kettle
#

It's what I suspected... Thanks Chris

shut flower
#

ok, is there a workaround? so is letting it running scheduled enough or do I have to sleep it for 0.1 secs?

little eagle
#
if (is3den || !isNull findDisplay 313) then {
#

Try this condition.

#

313 is the idd of Display3DEN

#

The display persists throughout the preview.

#

But not the first time you open it. So you need both.

#

I believe.

#

ยฏ_(ใƒ„)_/ยฏ

graceful pewter
#

Does anyone know how to get the current position of a player?

#

assume its just getpos player?

shut flower
#

jep

jade abyss
#

getPosWorld/ASL/ATL ?

shut flower
#

beside all the other position formats like ASL and so on

little eagle
#

getPosAGL

graceful pewter
#

so would _obj = "B_UGV_01_rcws_F" createVehicle getPos player; work?

little eagle
#

Would be nice if it existed.

graceful pewter
#

creating the obj at their current position?

jade abyss
#

Directly ON the player

#

Center of Veh -> Center of player

shut flower
#

createVehicle is normally checking for a empty position

jade abyss
#

@little eagle no clue what you are talking about

little eagle
#

The other syntax does.

#

getPosAGL doesn't exist.

jade abyss
#

Who wrote that?

little eagle
#

You edited it. #

jade abyss
#

Me? never!

subtle ore
#

ATL2 / ASL2

jade abyss
#
getPos
getPosASL
getPosASLVisual
getPosASLW
getPosATL
getPosATLVisual
getPosVisual
getPosWorld```
#

to be precise

subtle ore
#

Heh

#

Appears, to be broken

cosmic kettle
#
Tested on 21-08-2013.
#

Did anyone test after that date?

little eagle
#
private _dir = [0,0,0] getRelDir player;
private _dist = [0,0,0] distance player;
private _pos = [sin _dir * _dist, -cos _dir * _dist];
_pos
#

semi colon -_-

shut flower
#

commy display check didn't work

little eagle
#

Paste it again.

shut flower
#
if (is3DEN || !isNull findDisplay 313) exitWith {
    _object addEventHandler ["Dragged3DEN", {
        params["_object"];
        private _texture = [_object] call FUNC(getSurfaceTexturePath);
        _object setObjectTexture [0, _texture];
    }];

    private _texture = [_object] call FUNC(getSurfaceTexturePath);
    _object setObjectTexture [0, _texture];
};

if (local _object) then {
    // Has to be spawned to ensure MP compatibility
    _object spawn {
        private _texture = [_this] call FUNC(getSurfaceTexturePath);
        _this setObjectTextureGlobal [0, _texture];
    };
};
jade abyss
#

Whats that for, Commy?

little eagle
#

Returning your positon.

subtle ore
#

What's with the || ?

jade abyss
#

|| = or

little eagle
#

It's an OR

subtle ore
#

Yeah

#

but why

jade abyss
#

because

little eagle
#

is3den reports false the first frame after you return from a preview.

subtle ore
#

๐Ÿคฆ

little eagle
#

What did you expect?

subtle ore
#

I was asking why the difference of: OR and ||

#

Is there a performance difference?

little eagle
#

|| is what I do. There is no diff.

subtle ore
#

I mean

shut flower
#

OR is just horrible to read imo

still forum
#

@subtle ore yeah. || is twice the same character. Thus faster to write. Thus better performance

cosmic kettle
#

I always use ||

subtle ore
#

By how much Dedmen?

#

0.0000000003 ms? ๐Ÿ˜›

still forum
#

depends on how fast you type

cosmic kettle
#

^

shut flower
#

you could expect this answer ๐Ÿ˜›

little eagle
#

Save the trees. Save power by writing fast scripts.

subtle ore
#

OR is easier to type than || on an american keyboard

still forum
#

Pfff.. Get a german keyboard then

subtle ore
#

ENGLISH

jade abyss
#

Then buy a European one

shut flower
#

change your keyboard layout

jade abyss
#

Yeah, Germany Keyboard ftw

subtle ore
#

Psshhh.....German keyboards are overrated.

jade abyss
#

รครถรผ <- you will have those

still forum
#

Have two keyboards. One with german layout one with murican

subtle ore
#

Lol

little eagle
#

Have one keyboard with just the | key.

cosmic kettle
#

|| is 3 keystrokes here, of which all three are located left hand side, OR also takes three, located on the right side. nevertheless || is faster because of the repetition.

still forum
#

Or one with macro keys. And make a || macro button

shut flower
#

every time I have to write something to a console that is just supporting english keyboard layouts it's like testing which button means which special character ^^

jade abyss
#

So is OR (with shift) @cosmic kettle ๐Ÿคฆ

subtle ore
#

Why would I commit an entire key to |

little eagle
#

Pretty sure it's with a modifier.

subtle ore
#

Well yeah, if I press shift and \ then I get |

cosmic kettle
#

Dscha, I said both were lol... never edited ^^

shut flower
#

on german ones you have to press alt gr and <

jade abyss
#

i need more cofeve

shut flower
#

so it's quite easier on english keyboards I think

subtle ore
#

Ewww, two modifier keys?

#

yeah no thanks

graceful pewter
#

also, side note.

{
if(name _x == "playername")then{
_x moveInAny _obj;
};

jade abyss
#

No?

little eagle
#

Don't care if you use || or OR, but if you use && together with OR, you should be shot.

graceful pewter
#

any idea of a better way of finding a player?

jade abyss
#

```sqf
CODE

#

getPlayerUID ?

#

Cortez is doing his first steps in SQF? ๐Ÿ˜„

subtle ore
#
if(cool && swaggy OR cool && stylish) then
{
    //fight me commy
};
graceful pewter
#

maybe ;P

cosmic kettle
#

shivers

jade abyss
#

*shiversToo*

graceful pewter
#

whats so bad about that?

jade abyss
#

Nah, about Midnights post

subtle ore
#

the word operators

graceful pewter
#

oh

jade abyss
#

Using OR instead of ||

subtle ore
#

sort of like not

graceful pewter
#

right

jade abyss
#

Anyway: getPlayerUID might do the trick

#

(if you know it)

graceful pewter
#

cool

subtle ore
#
if(not _cool) then 
{
    //not cool
}:
graceful pewter
#

if we dont get || dont try him on things like

#

x += y

jade abyss
#

(wich doesn't work in SQF)

graceful pewter
#

pfft

jade abyss
#

Yep

#

++

subtle ore
#

๐Ÿค”

graceful pewter
#

so we actually have to do x = x + y?

subtle ore
#
x >= y

?

jade abyss
#

Yep Cort

subtle ore
#

Oh, yeah

graceful pewter
#

rip

jade abyss
#
_A = 1;    //1
_B = _A + 1;    //2
_A = _A + _B;    //3
subtle ore
#

glances at dedmen, change it you must

cosmic kettle
#

couldn' a macro do this, or can't we use those chars in them?

subtle ore
#

I would think so, not sure though.

tame portal
#

@jade abyss That's horrible code!

jade abyss
#

iirc you can't use numbers

cosmic kettle
#

Pretty sure i've seen SUBTR(_A,_B); but yeah

subtle ore
#

What? You can pass params but not use numbers?

#

wtF?

jade abyss
#

just a visualization of how returteld it is, without +=

#

wut?

graceful pewter
#

what have i started ๐Ÿ˜›

subtle ore
#

wat

jade abyss
#

not using numbers = was related to macros. iirc they can't start with numbers or signs

cosmic kettle
#

70% of questions end up in this. I like ๐Ÿ‘Œ

jade abyss
#

so += etc

#

@still forum
+=

tough abyss
#

Lol

still forum
#

Not possible

jade abyss
#

i don't care

#

do it

tame portal
#

@jade abyss ```sqf
private _A = 1;
private _B = call compile format ["%1 + %2", _A, "1"];
private _C = call compileFinal format ["call compileFinal '%1 + %2'", _A, _B];

#

Superior coding

jade abyss
#

Could you do something usefull, Optix?

#

Like dying or so?

tame portal
#

Uhm

tough abyss
#

Rip

cosmic kettle
#

you forgot OR and && @tame portal

still forum
#

Okey.... Theoretically maybe possible....

tame portal
#

Give me a shotgun and a buckshot and I'll do it

jade abyss
#

Okey.... Theoretically maybe possible....
Thats what i wanna hear!

#

If I give it to YOU, i will end up dead Optox

cosmic kettle
#

He's caving @jade abyss

tame portal
#

@jade abyss you gave up to many other things before no shame doing it again

#

( อกยฐ อœส– อกยฐ)

#

ok ill stop

jade abyss
#

,,,,, <-- There, get them for freee

little eagle
#

๐ŸŒ

jade abyss
#

๐Ÿ‘‚

tame portal
#

๐Ÿ

jade abyss
#

angeber

cosmic kettle
#

waitwut

jade abyss
#

!tanking

#

damn, wrong discord

shut flower
#

all those germans

tame portal
little eagle
tame portal
#

hahahhaha

#

where did you get that one from

little eagle
#

Made it myself.

tame portal
#

youre a legend mate

cosmic kettle
#

Clearly you have some ps skills.

little eagle
#

Gimp.

#

Stallmann was right.

tame portal
#

you know commy you made me like the smiley so much its actually my avatar in rainbow six siege

#

now ill use the winter version

#

@jade abyss please stop posting poop all over my messages

#

๐Ÿ‡จ ๐Ÿ‡บ ๐Ÿ‡ณ ๐Ÿ‡น

#

๐Ÿ˜„

jade abyss
#

Okay, enough spamming.
@still forum Is it even possible to add commands, that have +-= etc in it?

still forum
#

sure

#

every alphanumeric character

cosmic kettle
#

Last time I heard he said it's not impossible. He'll do it!

tame portal
#

By 2019 Intercept will have replaced the RV engine entirely

jade abyss
#

hm, i am wondering then, why Numbers can't be used as Vars then

tough abyss
#

Meanwhile Iโ€™m dying in clr hell

cosmic kettle
#

lmao optix

still forum
#

they can @jade abyss

jade abyss
#

Uhm, what?

#

With setVar maybe

still forum
#

setVariable ["123", value]

#

yeah

little eagle
#

Dedmen's number namespace

jade abyss
#

I knew it

#

Ah wait, right. We tested that all together here before

still forum
#

In C world variables can't start with numbers. BI just carried that over

jade abyss
#

kk

little eagle
#
127 = "banana";
missionNamespace getVariable str 127 // "banana"
still forum
#

^ ๐Ÿ‘

#

in engine everything is stored as UTF-8 string. Just the compiler is limited. But you can get around that using get/setVar. Emoji variables and stuff

jade abyss
#

So you can basicly store a function in a number? ^^

little eagle
#

Yes.

still forum
#

in a string that only contains a number

tough abyss
#

Wait

cosmic kettle
#

Gotta love that

tough abyss
#

This is good

jade abyss
#

thats... pretty much.... bad

little eagle
#

You can store numbers inside numbers!

tough abyss
#

Yes

subtle ore
#

....

cosmic kettle
#

1 = 2 = true

subtle ore
#

1 = 2 ?

tough abyss
#

This is perfect for messing with others reading my code

still forum
#

@cosmic kettle syntax error. Can't assign nothing to variable

jade abyss
#
missionNameSpace setVariable ["0",1];
missionNameSpace setVariable ["1",0];```
^^
tame portal
#

oh my god

#

are you serious?

little eagle
#

#define true (random 2 > 1)

cosmic kettle
#

hahaha

jade abyss
#

Nope

subtle ore
#

๐Ÿ˜‘

tough abyss
#

Lol

jade abyss
#

true/false is protected

#

We tried that, you remember? ๐Ÿ˜„

cosmic kettle
#

Will it work? you never know.

shut flower
#

#define _TRUE false

tough abyss
#

Not the same

#

Especially the caps lock

#

We need immersion

shut flower
#

I thought everybody is just pasting any code that comes to their mind

cosmic kettle
#

What if I tell you, dere is eh app on teh market, for storing text in eh numbers.

still forum
#

true/false are commands. All commands are protected

tough abyss
#

I wish sqf was Kia or python

little eagle
#

The preprocessor doesn't care.

tough abyss
#

Override protection

shut flower
#

I wish sqf was C#

subtle ore
#

๐Ÿ™„

tough abyss
#

Iโ€™m working on that

#

Lol

subtle ore
#

here we go again

shut flower
#

C# wrapper for sqf?

tough abyss
#

From intercept

jade abyss
#

i wish the scripting engine wouldn't be such a bitch, then i could live with sqf easily

subtle ore
#

"I wish SQF was X:"

shut flower
#

haha have fun with that

#

c# wrapper for intercept is a freaking hell

tough abyss
#

Itโ€™s not hard Iโ€™m just in a predicament where clr isnโ€™t wanting to host with version 4 and only 2 which leads me to believe arma issue

shut flower
#

well you have to wrap every command

#

cast c++ types to managed strings

tough abyss
#

Not hard at all lol

#

Not strings

shut flower
#

but most other types

#
  • all functions have to be stored in classes
tough abyss
#

Yes

#

Iโ€™ve done it before for other games but arma wonโ€™t comprehend

#

@still forum do you know if arma blocks createthread

still forum
#

doesn't

shut flower
#

I also started an intercept c# wrapper but it's definitely too much work

still forum
#

But remember you can't create threads in dllmain

tough abyss
#

Really?

still forum
#

yep

tough abyss
#

Is that just arma? Iโ€™m able to do it in some of my other projects

still forum
#

nope that's windows

tough abyss
#

Wtf

tame portal
#

@shut flower C# please ๐Ÿ˜„

still forum
#

Might not be a problem if you load C# from C#

#

But C# from C++ might be different

shut flower
#

@tame portal how are you doing? ๐Ÿ˜›

tough abyss
#

Well ct then call the clr host to start

#

Is how Iโ€™ve tried but maybe itโ€™s dllmain thatโ€™s the issue

shut flower
#

there is no dllmain equivalent in c# so you won't see such problems there

tough abyss
#

Itโ€™s c++

shut flower
#

I know

#

This was an answer to Might not be a problem if you load C# from C#

#

ok @little eagle tried do spawn the whole script hoping this would be enough but it still doesn't work

#

my last solution is to catch OnMissionPreviewEnd and iterate threw all objects

little eagle
#

That might be necessary, yes.

astral tendon
#
waitUntil {
 if ((damage team_1)> 0.50) exitWith {
Team_1 say3D selectRandom ["Team_Hit","Team_Hit2","Team_Hit3","Team_Hit4","Team_Hit5"];
 true};
  }; 
};
#

im using this to play a sound when that unit is wounded but it only works one time, there is a way to i repeat that script once it executed once?

subtle ore
#
0 spawn 
{
    while{true} do
    {
        if(damage team_1 > 0.50) then
        {
            Team_1 say3D selectRandom["Team_Hit","Team_Hit2","Team_Hit3","Team_Hit4","Team_Hit5"];
        };
    }:
};
#

but yeah, Torndeco has a better solution there

#

you should really look into event handlers and loops

#

because loops don't always have to exit if it can repeat multiple times. But in this situation, an event handler is a better solution

astral tendon
#

I used the hit event handle, but i think will do the same problem, he will say it every time he is hit

subtle ore
#

Damaged -> Write a condition for a certain amount of damage -> Execute say3D

#

Same thing applies to hit, only it'd be more useful to grab damage of limbs with hit -> Write a condition for a certain amount of damage -> Execute say3D

astral tendon
#

That damage is the amout of damage received by the shooter or the total amout of damage that the unit have?

meager heart
#

Better "Hit" there you have Level of damage caused by the hit

rotund cypress
#

Hey guys, quick question, on each frame handlers does not "halt" when you are outside of the game right? Like tabbed out.

astral tendon
#

but i think that still going to be trigered multiple times if the unit is hit like 2 times

meager heart
#

Yep every hit will fire

astral tendon
#

so the player will have a nice ear rape with 2 sounds at same time

meager heart
#

Play sound once

#

Or if (random 1 > 0.3) then {true} else {false};

astral tendon
#

but that will run only once? just like that waituntil i have?

meager heart
#

Something like this

0 spawn 
{
    while{true} do
    {
        if(damage team_1 > 0.50) then
        {
            if (random 1 > 0.5) then //--- 50%
            {
                Team_1 say3D selectRandom["Team_Hit","Team_Hit2","Team_Hit3","Team_Hit4","Team_Hit5"];
            };
        };
    }:
};
simple solstice
#

don't need a second if

#

just use &&

meager heart
#

Yes, you can use even ||

#

or

simple solstice
#

well that would change the way the script fires

meager heart
#

Well that just an example there a lot of ways how to do it

astral tendon
#

that one give me error

meager heart
#

0 = [] spawn there

tough abyss
#

my brain hurts stop with the spawn loops

meager heart
#

๐Ÿ˜€

tough abyss
#

just use eventhandler to fire the code. add some conditions if you only want it to fire when unit is over x amount of damage / random chance etc

#

Also everyone of those loops has a major implentation issue, that no-one seems to have noticed yet

meager heart
#

They just wrong

astral tendon
#

what is wrong?

#

because i have about 36 spawns in one file

#

how bad this is?

tough abyss
#

You will notice when you test it out

queen cargo
#

@still forum c# from c++ is actually impossible
c++(CLR) --> c# is what you ment ๐Ÿ˜‰
and not that difficult actually
but requires extra work to be done

astral tendon
#

i actually did not noticed anything

#

but, there is a limit on how many spawns i can use?

still forum
#

Yes. A couple thousand

astral tendon
#

before its starts to hit perfomace or is like the amout i can make?

still forum
#

Before the game crashes

astral tendon
#

Ok...

meager heart
#

@astral tendon ```sqf
{
_x addEventHandler ["Hit",
{
private _unit = _this select 0;
private _damage = _this select 2;
private _shoter = _this select 3;

    if ((_shoter call bis_fnc_objectSide) isEqualTo SIDE) then //--- Set "SIDE" to right one
    {
        if ((_damage > 0.5) then 
        {
            _unit  say3D selectRandom ["Team_Hit","Team_Hit2","Team_Hit3","Team_Hit4","Team_Hit5"];
        };
        _unit removeEventHandler ["Hit",_thisEventHadler]; //--- Remove this if you need it fires every hit
    };
}];

}
forEach units Team_1;

#

No ?

astral tendon
#

btw Team_1 is actually one unit

meager heart
#

LOL

astral tendon
#

yeah, i put like that because is that how they are called in the DF:BHD game

#

and is easy to i remember

meager heart
#
Team_1 addEventHandler ["Hit",
    {
        private _unit   = _this select 0;
        private _damage = _this select 2;
        private _shoter = _this select 3;

        if ((_shoter call bis_fnc_objectSide) isEqualTo SIDE) then //--- Set "SIDE" to right one
        {
            if ((_damage > 0.5) then 
            {
                _unit say3D selectRandom ["Team_Hit","Team_Hit2","Team_Hit3","Team_Hit4","Team_Hit5"];
            };
            _unit removeEventHandler ["Hit",_thisEventHadler]; //--- Remove this if you need it fires every hit
        };
    }];
#

DF:BHD ?

astral tendon
#

Delta Force Black Hawk Down

meager heart
#

k

cloud thunder
#

With CfgFunctions, is there a way to localize loading of the function to machines ie: server, client and hc?

austere granite
#

no

tame portal
#

@meager heart

instead of

if (random 1 > 0.3) then {true} else {false};

id just do (random 1 > 0.3) ๐Ÿ˜„

cloud thunder
#

so lame, no way to reduce memory footprint besides legacy function loading methods..

austere granite
#

i mean if you really care, you could make the bit yourself by just setting everything to nil

#

basically make a postInit function yourself thta goes through cfgFunctions classes checking a certain value, for example getNumber (_someClass >> "serverOnly") > 0 then just set the variables referring to that function in every namespace to nil

meager heart
#

@tame portal ๐Ÿ‘

cloud thunder
#

@Adanteh#0761 ok, thats something to work with. So the function would get loaded then wiped by overwriting it will nil? i've done something like that before for 1 time use functions..

still forum
#

@cloud thunder use CBA and XEH_PREP stuff ๐Ÿ˜„

meager heart
#

Which is the fastest way of return list of playable units including not yet spawned or dead ?

cloud thunder
#

maybe playableUnits ?

meager heart
#

Not include dead

#

AllPlayers slow at mission start

cloud thunder
#

wiki says : This does not include dead players awaiting for respawn

meager heart
#

yes playableUnits not return dead

cloud thunder
#

so you want it to return dead?

meager heart
#

AllPlayers Returns all players including dead players but it will be reliable at some time after mission start

#

@cloud thunder yes and not yet spawned

river meteor
#

what is the best method to handle catching a player disconnect to save their info into a database. Been looking at several: addMPEventHandler, BIS_fnc_addStackedEventHandler, onPlayerDisconnected, and HandleDisconnect event. This is a multiplayer setting and not sure what the best method to catch the player disconnecting is

meager heart
#

@river meteor addMissionEventHandler ['HandleDisconnect',{}]; ?

cloud thunder
#

@meager heart if you name the playable unit then that name will be nil until it has a player.

meager heart
#

No i don't name them

cloud thunder
#

no saying you do. just a suggestion as a way.

meager heart
#

@cloud thunder ```sqf
//-------------------------
Result:
0.006 ms
_allPlayers = [];
{
_name = name _x;
_allPlayers pushBackUnique _name;
}
forEach allPlayers - entities "HeadlessClient_F";
systemChat str _allPlayers;
//-------------------------
Result:
0.0131 ms
Code:
systemChat str ([] call bis_fnc_listPlayers);
//--------------------------

little eagle
#

Needs parenthesis.

meager heart
#

In forEach ?

little eagle
#

(allPlayers - entities "HeadlessClient_F")

#

Technically it doesn't since + and - have higher priority than other binary commands.

#

But this just hurts to look at.

meager heart
#

Ok ))

tough abyss
#

Anybody knows why increasing knowsAbout of a unit doesn't make them fire at the target they know about at a long range?

meager heart
#
//-------------------------
Result:
0.0061 ms
Code:
_allPlayers = [];    
{    
 _name = name _x;    
 _allPlayers pushBackUnique _name;  
}     
forEach (allPlayers - entities "HeadlessClient_F");  //--- With ()
systemChat str _allPlayers;
//-------------------------
Result:
0.0131 ms
Code:
systemChat str ([] call bis_fnc_listPlayers);
//--------------------------
#

0.0001 slower ๐Ÿ˜€

#

@little eagle >Technically it doesn't since + and - have higher priority than other binary commands. Thanks didn't know that

simple solstice
#

@meager heart any reason for unique?

meager heart
#

Got disconnected rejoin? Swaped slot ?

simple solstice
#

the var is private

meager heart
#

@simple solstice it runs in cycle

simple solstice
#

then it makes sense

old glade
#

I'm having the weirdest bug right now

#

My server starts, loads the mission then decides to load the mission again before launching

#

I'm running exile, but I've seen it happen to our alive servers sometimes as well

#

there is a config error that appears in the log, but its for an animation

#

I'm super confused >.>

graceful pewter
#

would anyone know how to return every players uid in a nice list on a server?

austere granite
#

as in a UI or just array?

#

private _uids = allPlayers apply { getPlayerUID _x };

graceful pewter
#

an array

#

something i can see in the debug menu

#

to copy it out of the game

halcyon crypt
#

RCon -> players ๐Ÿ˜

graceful pewter
#

๐Ÿ˜›

#

if only i had rcon to another players server

austere granite
#

well, what i said will do

graceful pewter
#

yea

#

allPlayers apply {getPlayerUID _x}

meager heart
#

what is debug menu ?

graceful pewter
#

was all i needed

#

so ty

meager heart
#

it seems like i missed The Right Bundle... no debug menu for me ๐Ÿ˜„

rotund cypress
#

Is there any documentation on the setPlateNumber yet?

still forum
#

no. It's also not on release branch as people say

rotund cypress
#

Is it not on dev branch?

still forum
#

it is

rotund cypress
#

Do you know what the parameters etc is?

still forum
#

nope

#

I'd get vehicle setPlateNumber STRING

rotund cypress
#

I guess

still forum
#

type it in debug console and press F1

cosmic kettle
#

@old glade Same here, players have reported a second 'darker' loading screen.

limpid pewter
#

Ok so i have a function that takes two variables like this sqf ["_objPos","_Dir"] // Variables are like this [Object Name/ID , Object Direction] The function has a while loop that, for demonstrational purposes just hints the vars parse into the function like this ```sqf
systemChat format ["_obj = %1 and _objPos = %2",_obj,_objPos];


So to sum up, my problem is that on the first while loop run, the code works well, then on the second run it doesn't parse in the correct  vars, but for some reason _this select 0 now parses the player object. Does anyway have a clue as to why this happens?
lone glade
#

wild guess, not privatized vars?

#

link us to a gist with both funcs, it's easier to help if we can see the code

still forum
#

show full function ๐Ÿ˜„

limpid pewter
#

kk

#
params ["_objPos","_Dir"];

mld_fnc_ammoMain = {

};

_count = count ammoPackArray;
if (_count > 14) then {
deleteVehicle (ammoPackArray select 0);
 ammoPackArray deleteAt 0;
};

_obj = "Land_MetalCase_01_small_F" createVehicle [0,0,0];
_obj setPosASL _objPos;
_obj setDir (_Dir - 90);
ammoPackArray pushBack _obj;


while {!isNull _obj}  do {
    _units = nearestObjects [_obj,["man"],3];
    {
systemChat format ["_obj = %1 and _objPos = %2",_obj,_objPos];
        [_x] call mld_fnc_ammoMain;
    } forEach _units;
    sleep 0.5;
};
#

Half-finished by, hence the empy function var

#

Essentially, the function is executed on the server by the clients, it then uses the placed object as a physical marker to automatically rearm the soldiers around the placed object.

still forum
#

I don't see the systemChat you mentioned

limpid pewter
#

ok, 1 sec

lone glade
#

also, if those are functions why the hell is there a sleep in there?

limpid pewter
#

It is edited now

lone glade
#

you're not using unscheduled are you?

limpid pewter
#

no, remoteExec spawns the function afaik

lone glade
#

hm, can't remember if it's 100% going to run scheduled, lemme check

limpid pewter
#

yeah, but if it weren'y unscheduled, then wouldn't i get an error saying generic sleep expression?

still forum
#

yes. If it was unscheduled it would error

limpid pewter
#

So not the issue then, k

still forum
#

I don't see anything wrong in that code...

limpid pewter
#

ok, can i be possible that arma is buggin out?

lone glade
#

nope

still forum
#

Is that really your full code that you are currently using?
The fact that you edited in the systemChat afterwards tells me you didn't CTRL+A CTRL+C CTRL+V it

#

Saying that an object was given but expected was an array
Please post the complete error message

limpid pewter
#

For that function yes. But this is how the function is spawned within a switch do statement```sqf
case "ammopk": { // ammoPack
[_objSpwnPos,_mrkDir] remoteExec ["mld_fnc_ammoMain",2];
};

#

ok, will do

still forum
#

wait. you are remoteExec'ing mld_fnc_ammoMain but inside mld_fnc_ammoMain you set mld_fnc_ammoMain to a empty function??

limpid pewter
#

Systemchat output: _obj = 13727d42b00# 17811767: metalcase_01_small_t.p3d and _objPos = [13772,12455.25,23.405] _obj = 13727d42b00# 17811767: metalcase_01_small_t.p3d and _objPos = B Alpha 1-1:1 (Moldisocks) The error message: ```
_obj |#| setPosASL _objPos;
_obj setDir (_dir - p...'
Error setposasl: Type Object, Expected Array

#

Really need to setup a way to copy error msgs to clipboard haha

still forum
#

_objPos is wrong. The error is not inside the while loop.
Your _objSpwnPos is wrong

limpid pewter
#

typo

lone glade
#

for the love of sqf, PASTE THINGS

still forum
#

you can copy the error message from RPT.

lone glade
#

unless he uses atom, then he can't open them ๐Ÿ˜„

limpid pewter
#

alganthe, as i mention, not sure how to copy/paste error messages : (

#

ok

lone glade
#

do you know what an RPT log is?