#arma3_scripting

1 messages Β· Page 406 of 1

zinc forum
#

So I could have this script in the init and not have modules and make certain units have access to zeus

#

Bc I found a chat command plugin and I want to try something

little eagle
#

No. You can't copy paste this into the init box in the editor if that was the question.

zinc forum
#

Can i post links in this chat?

little eagle
#

... depends on the content behind the link.

jade abyss
#

πŸ€”

zinc forum
#

It's the plugin I found

#

it's on the bistudeo forums

jade abyss
#

then post it Β―_(ツ)_/Β―

little eagle
#

I can no longer drag and drop the thonk 😦

zinc forum
#

I looked into it, and besically it lets you type in commands by going !

jade abyss
#

thonk?

little eagle
#

πŸ€” , but improved.

#

The Thonk.

jade abyss
#

ah

#

*gg*

little eagle
#

At least links no longer auto expand.

jade abyss
#

<link>

#

Β―_(ツ)_/Β―

#

&

little eagle
#

Ye, but it's annoying to put <>.

#

Would prefer if you had to put them to make it auto expand.

jade abyss
#

buhuhu? πŸ˜„

little eagle
#

Like... Markdown.

zinc forum
#

Would this work?

jade abyss
#

by god

#

download the sqf-language for n++

zinc forum
#

.>

#

sorry, new to this

jade abyss
#

Just a friendly advice

little eagle
#

I can already tell that it wouldn't by just looking at the brackets/ parenthesis.

jade abyss
#

google it, install it, have more fun

zinc forum
#

I fixed the brackets

#

I saw the bracket mistakes

#

If someone typed the command in, they would get the curator thing attached to them

little eagle
#

Well not like that it wouldn't.

zinc forum
#

What do you think would make it work?

little eagle
#

Proper brackets.

zinc forum
little eagle
#

And I also think you'd have to remote exec the code to the server, because assignCurator only works on the server machine. And define that commy_zeusGroup variable.

zinc forum
#

The other code is still in the init file

little eagle
#

Now it's missing a comma, and there're still rogue brackets at the end of the file.

zinc forum
#

Missing a comma where and that bracket was there from the beginning, I didn't add it

tough abyss
#

i was just active sqf scripts, is there a reason that diag_activeSQFScripts returns a bunch of these "[""<spawn>"","""",true,523]"

little eagle
#

Well, doesn't matter who made the file. If it the syntax is wrong, it will not work. Programming is very in indiscriminate that way.

#

What else do you want, Cloud?

tough abyss
#

well i want to know what is being spawned :/

#

i use very very few spawn's

little eagle
#
[] spawn {
    hint str diag_activeSQFScripts; //[["<spawn>","",true,1]]
};

[] spawn {
    scriptName "myScript"; 
    hint str diag_activeSQFScripts; //[["myScript","",true,1]]
};
#

That should help I guess.

tough abyss
#

danke will mess with this

little eagle
#

I copied this straight from the wiki btw, lol.

tough abyss
#

rip

#

i missed it in the wiki πŸ’’

little eagle
#

I've never used this in my life myself. lol

astral tendon
#

Is there i way to make the AI drivers not follow gunner orders and move to their waypoints?

zinc forum
#

Commy, I got the command plugin working

#

What would you suggest the code be to add curator to a player who says the command?

little eagle
#
[player, {
    if (!isServer) exitWith {};

    if (isNull (missionNamespace getVariable ["commy_ZeusGroup", grpNull])) then {
        commy_ZeusGroup = createGroup sideLogic;
    };

    params ["_unit"];
    private _logic = commy_ZeusGroup createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"];
    _unit assignCurator _logic;
}] remoteExec ["call", 2];

Something like this maybe?

zinc forum
#

hm

#

give me one sec

#

this is what I was trying

#

I had modules ingame named curator 1 and curator 2

#

The commands are working, I just error out

queen cargo
#

anybody ever checked if two configs get checked via isEqualTo?
given following scenario:

class A
{
    class sub
    {
        val = 1;
    };
};
class B
{
    class sub
    {
        val = 1;
    };
};```
would `isEqualTo` return true or false?
little eagle
#

_this is probably not the player. And why do I even bother posting stuff if I get ignored? The commands have to be executed on the server machine, therefore remoteExec is required.

#

I posted that like 3 times...

zinc forum
#

I'm sorry, I don't understand

little eagle
#

Everything that isn't nil can be checked with isEqualTo, X39.

#

Which part, Matthew?

queen cargo
#

@little eagle that is out of question
however, i got my doubts with how well it works using config

little eagle
#

Works just fine with config. Even == works with config.

zinc forum
#

the remote exec part, the player sends a command to be executed server side, the plugin gets inititated out of the init.sqf and so I assume it's server side, so what I'm trying to do is make the player who do the command become owner of the gamemaster module

queen cargo
#

but does it only checks if two config classes are the same or does it check like it does with arrays

little eagle
#

Was that screenshot taken while connected to a dedicated server, Matthew?

zinc forum
#

No, its conntected to my home computer

#

I'm not playing with a dedicated as of right now

#

though the file will be uploaded to a dedicated

#

I don't have direct access to it, me and the guy doing it are both working on seperate parts of this project

little eagle
#

How do you know the code is sent to a dedicated server?

#

init.sqf is not server side.

#

It's global.

#

And I'm very sure the chat command code is executed on the client that typed the stuff.

zinc forum
#

I can get acccess to the dedicated

little eagle
#

Because one example uses player.

#

And player is null on a dedicated server.

zinc forum
#

hm

#

I'm going to copy and paste into it, tell me if it looks correct

little eagle
#

If it works, it works. You don't have to convince anyone here in the chat, just the game.

zinc forum
#

Alright, i'll try it

#

IT WORKED!

#

Dude thank you so much!

little eagle
#

With the remoteExec, or without?

zinc forum
#

with

#

this is the code I have

little eagle
#

Ok, then I'm sure it'll still work in action connected to as server, in MP.

zinc forum
#

Thanks!

queen cargo
#

str (configFile >> "cfgvehicles") diag_log (configFile >> "cfgvehicles")
what do theese output?

lone glade
#

config path

queen cargo
#

so it would print "configFile/cfgvehicles"?

lone glade
#

can't remember the format but yes

queen cargo
#

format is important here

lone glade
#

wait 5s

#

"bin\config.bin/CfgVehicles"

queen cargo
#

kk ty

subtle ore
worn igloo
#

I'm here to report my function works now

still forum
#

@zinc forum CBA got that chat commands stuff a couple months ago

warm gorge
#

common.hpp

// Pixel grid
#define pixelScale    0.50
#define GRID_W (pixelW * pixelGrid * pixelScale)
#define GRID_H (pixelH * pixelGrid * pixelScale)

dialogFile.hpp

class testDialog
{
    idd = 12345;
    name = "testDialog";
    enableSimulation = true;
    movingEnable = false;

    class ControlsBackground
    {
        class Title: ctrlStaticTitle
        {
            idc=104;
            x="safezoneX";
            y="safezoneY";
            w="safezoneW";
            h="(5 + (5 + 2)) * GRID_H";
            text="Test Menu";
        };
    };
};

Any ideas why these macros aren't working for me?

lone glade
#

included ?

warm gorge
#

Yep

#

When I remove the macro GRID_H for the h coordinate in my dialog, and have it entered manually, it works fine

lone glade
#

what's the issue?

warm gorge
#

When I use the macro, I cant see the control at all

lone glade
#

that doesn't make any sense

#

oh, I think I know why

#

remove the quotes

warm gorge
#

Which ones?

lone glade
#

after the h =

warm gorge
#

Thereee we go, that worked. Thank you! πŸ˜ƒ

restive matrix
#

has anyone gotten the scripted event curatorObjectRemoteControlled to fire?

#

i tried the scripted event and the public variable handler and haven't seen either go off, it seems like BIS_fnc_moduleRemoteControl is no longer used

lone glade
#

doesn't exist, must have made a typo

#

nope, doesn't exist.

restive matrix
#

i grabbed it from modules_f_curator/Misc/Functions/fn_moduleRemoteControl.sqf , its still on the wiki as well under scripted event handlers

lone glade
#

curatorObjectRemoteControlled

#

is indeed called

restive matrix
#

im trying to listen for remoteControl events, any idea where I should start poking around in bis addons?

lone glade
#

wait one

rancid ruin
#

how fast is saving data to profileNamespace?

lone glade
#

instant

#

the file is written whenever something change in the namespace

rancid ruin
#

loads faster than inidb or some mysql db?

#

say i have like 5000 vars to store

lone glade
#

couldn't find an easy way to do so @restive matrix

#

I wouldn't be able to tell without some perf testing

restive matrix
#

here was my test code based on the fn file

[missionNamespace, "curatorObjectRemoteControlled", {
    params ["_curator", "_player", "_unit", "_controlled"];

    private _text = if (_controlled) then {
        _text = format["%1 is now remotely controlling %2", name _player, str _unit];
    } else {
        _text = format["%1 is no longer being remote controlled", str _unit];
    };

    systemChat _text;
}] call BIS_fnc_addScriptedEventHandler;

"bis_fnc_moduleRemoteControl_owner" addPublicVariableEventHandler {
    private _player = _this select 1;
    private _unit = _this select 2;

    private _text = if (isNull _player) then {
        _text = format["%1 is no longer being remote controlled", str _unit];
    } else {
        _text = format["%1 is now remotely controlling %2", name _player, str _unit];
    };

    systemChat _text;
};
still forum
#

@rancid ruin Faster than going through callExtension. But it get's problematic when it's too big and can corrupt

#

wut?

lone glade
#

wut

#

why is it an array?

still forum
#

I can't imagine that PVEH working

lone glade
#

oh, thanks discord, didn't see that scripted EH

rancid ruin
#

basically i'm dicking around with a little fog of war system. i black the map out with big black markers at mission start, then place markers as the player moves around and "explores" the world

lone glade
#

and that isn't a pubvar tho

#

oh shit it actually is broadcasted O.o

rancid ruin
#

need to keep track of the what the player has already explored, e.g what map markers have been created, so they can be loaded later, as the mission will be persistent

restive matrix
#

i messed up the PVEH a bit but i was attempting to catch

_unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true];
still forum
#

Ah

#

that is a variable on the unit

#

PVEH only works on missionNamespace

restive matrix
#

ah okay

still forum
#

And from where did you get that magic

    private _player = _this select 1;
    private _unit = _this select 2;

Array?

#

If it's passing in player

restive matrix
#

yeah forgot to convert that into an array

#

still not sure why the scripted eh never fires, here is it being called in the fn file

[_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler;
#

is it called on the module only?

lone glade
#

curator namespace

#

so yes

restive matrix
#

alright i know how to fix it then, thanks

lone glade
#

in this case:
getassignedcuratorlogic player

rancid ruin
#

is there any built in way to determine if two locations are on the same land mass?

#

i.e if you can walk from position 1 to position 2 without crossing water

still forum
#

Don't know any... no

rancid ruin
#

think of a better way than using inPolygon?

still forum
#

no. Actually that's better than the idea I had

rancid ruin
#

i've already made polygons of each land mass on tanoa, it took a while

#

i'm not sure if you could use a dummy AI, give it a waypoint, then check if it can complete it somehow

#

because the AI obviously has access to pathfinding

lone glade
#

AHAHAHAHHA

#

AHAHHAHAHAHAHAHA

#

good luck with that

rancid ruin
#

yeah

#

sometimes it's OK, sometimes it's completely fucked

lone glade
#

raycasting each meter would be more efficient

rancid ruin
#

i found an implementation of djikstra's somewhere, maybe could try that

still forum
#

Oh you found magic OO gibberish that still uses private ARRAY and _this select ....

lone glade
#

BI has OO funcs

#

and it's not pretty

still forum
#

And it uses sleep 0.000001 in the code to make sure it get's scheduled

#

So I'd say... Have fun with that too

#

Also that thing uses Roads

#

So if the landmass is connected without a Road over that connection it wouldn't find the path

rancid ruin
#

i was thinking to create tiles each X meter across the map and add them as nodes to the pathfinding grid

#

i don't really script for performance or release...just fun

still forum
#

inPolygon would definetly be bescht

rancid ruin
#

excellent, i use that a ton already

#

one of the most useful new scripting commands in a while

#

what'd be a quick way to get each position on a 100 meter grid within 1km of a location?

still forum
#

"each position"

#

each one a femtometer apart?

rancid ruin
#

a grid of positions spaced 100 meters apart, centered on the player

#

with each one no more than 1km away from the center

still forum
#

two for loops

#

from -500 to +500 in 100 step

#

one for x one for y

#

getPos player vectorAdd [x,y,0]

rancid ruin
#

i should cache those positions rather than computing them each time as well right

#

say i'm running it every frame

still forum
#

Every frame would be terrible

rancid ruin
#

or rather cache the offsets at least

still forum
#

You can compute the offsets once and just hardcode them

rancid ruin
#

exactly

#

thanks

still forum
#

At that point it would be almost fast enough to run each frame I guess

#

That could benefit greatly from my script optimizer πŸ˜„

rancid ruin
#

it's a bitch cos you do need to run stuff each frame sometimes

still forum
#

make sure to store getPos player in a variable instead of calling getPos player multiple times

rancid ruin
#

and with sqf that leads to pain

#

i dick around with game engines mostly cos they're much faster, but it's fun to come back to arma

still forum
#

I also play around with Arma to make it much faster

rancid ruin
#

even if sqf were 100x faster it'd still be horrible making new game modes and mods cos of the UI system

still forum
#

What if I give you the ability to have a new UI system?

rancid ruin
#

sign me up

still forum
#

Let's say it works XML based like in Enfusion

rancid ruin
#

i've not seen their system but i'm very used to web design so yeah

still forum
#

It's on my todo list. So check back in a year or two

rancid ruin
#

tried some of the WYSIWYG solutions for arma 3, still a nightmare

#

WYSIWYG doesn't really fix anything

still forum
#

I hope that I can get it going sooner but... Todo list big

rancid ruin
#

would it be like a middle man system for translating XML in to configs, or a new system for drawing UI entirely?

still forum
#

new system

rancid ruin
#

interesting

#

cos performance wise the existing one doesn't seem bad

still forum
#

Intercept based and basically drawing a overlay over the existing game

rancid ruin
#

it's just the workflow for making it do shit

still forum
#

Ohhhhh.. I should really look into how the UI draw stuff works in engine. If it works like I imagine that will be so easy and cool :3 It's most likely not how I imagine it tho

rancid ruin
#

if you can hook up chromium embedded webkit and draw that on top of the game window, listen for mouse events and javascript, etc

#

that would be so sick

#

game UI systems have always been a nightmare though, nobody has solved it

still forum
#

Do you know how huge webkit is? πŸ˜„

rancid ruin
#

yeah i know, it's not entirely practical

#

it's been done with some games though

#

for UI heavy stuff sometimes HTML/CSS is the best way

still forum
#

I could do Intercept-Javascript scripting. So that you can use SQF commands via javascript

#

and then give you a HTML+CSS+Javascript based UI

#

Maaaaan that would be awesome and would get me busy for atleast a couple years full time

rancid ruin
#

sqf <-> node/javascript would be sick

#

you'd probably see a ton of people pick that up

lone glade
#

ohgod

#

please no

still forum
#

I don't like JS tho

lone glade
#

it's used for literally everything

rancid ruin
#

me neither but there's tons of game devs in js

#

tons of everything in js, good and bad

lone glade
#

which is fucking retarded

rancid ruin
#

well it runs in the browser so yeah

still forum
#

I like Lua so I make the Lua wrapper. Somebody else likes python so he makes the python wrapper.
We have no one on the Team that likes JS enough to make a wrapper for it

rancid ruin
#

sqf is also retarded but it runs in arma so here we are

lone glade
#

because it would require knowledge outside of webdev ded

#

sqf can be exscused tho

#

it stems from bad code from 10 years ago when BI was a small company

#

look at TKOM enscript

#

much better

rancid ruin
#

javascript stems from before that when the internet wasn't fully formed

#

javascript just got way the fuck out of hand

#

similar to arma's needs tbh

lone glade
#

in itself it's fine

#

it's just that people use it for EVERYTHING

still forum
#

Wow

#

Javascript Intercept would fit the whole Arma thingymabob.
Because.. The Javascript engine for C++ that I just found is calld "Duktape"

#

It fits so goood

lone glade
#

hahahahahahahahahahah

rancid ruin
#

duktape's been used in a few game engines i believe, saw that name come up the other day when i was reading

#

a perfect name indeed

still forum
#

are there namespaces in javascript?

rancid ruin
#

i think there is in new javascript

#

es6 or whatever it's called

still forum
#

I would just do sqf.getPos(sqf.player())

#

n such

#

just like Interschept

lone glade
#

honestly I can't wait for enscript (please be similar to TKOM and not some javascript abortion)

rancid ruin
#

please make it happen dedmen that would be cool

#

i agree JS isn't fun, but it is the de-facto middle man language right now

#

cos you could do something like that easily with a JS <-.> sqf bridge

still forum
#
sqf_allUnits().forEach(function(unit) {
stuff
});
#

JS highlighting is bad

rancid ruin
#

JS looks crazy as fuck too, a perfect fit for sqf

#

a match made in heaven

#

you could be the one that opens the pandora's box of arma 3 scripting at the end of its lifespan

still forum
#

I already did that though...

rancid ruin
#

with intercept?

lone glade
#

already did a year ago

still forum
#

Yeah...

rancid ruin
#

but nobody uses it

lone glade
#

no?

still forum
#

you sure?

#

I also don't think that many people would use JS scripting

rancid ruin
#

are people doing crazy shit with it?

still forum
#

Yes

rancid ruin
#

i stand corrected then

#

any links to the crazy shit?

#

i thought intercept development stopped after the initial proof of concept

still forum
lone glade
#

absolutely not

still forum
#

It did.

#

But then I joined

rancid ruin
#

i'm getting conflicted reports here

lone glade
#

^ and thus it didn't ded

still forum
#

It was abandoned for a couple months. Until I revived it

#

so the development did stop. But not forever

lone glade
#

meanwhile:
NO UPDATE FOR TFAR IN 2017, DEAD MOD

#

ACRE BEST MOD

rancid ruin
#

i don't know what the things in these links are doing

#

where are the kool screenshots and stuff

#

and the kool benchmarks

still forum
#

I added a BIF link for the profiler

lone glade
#

script profiler is a fucking godsent

rancid ruin
#

oh ok yeah this looks sick

still forum
#

Intercept_CBA add's misc stuff like new math script commands or a surfaceTexture function or a real Hashmap.
SQF-Assembly allows you to write assembly level SQF and also has a assembly level optimizer that will probably increase all scripts performance by atleast 20%

rancid ruin
#

this is the kinda shit i'm talking about

lone glade
#

how I learned that lbSetPicture was either bugged or stupidly intensive

rancid ruin
#

surfaceTexture function?

still forum
#

Yeah

#

gives you the texture under your feet

lone glade
#

didn't see the camo magik?

still forum
#

Used for ACE Trenches in the future

rancid ruin
#

there's no way to store an image in arma is there?

#

like render to texture, only not live, but a snapshot

still forum
#

If you enable filePatching you can store it externally and load it from there as a normal texture

rancid ruin
#

hmm

#

no non-dev mode solution?

#

cos you can't really ask people to add launch params to play your mission

still forum
#

not yet. I could potentially have memory only PBO's and be able to live edit files in them.. but meh

rancid ruin
#

that sucks

#

you'd think it should be fairly simple

#

just want a little bit of memory that i can store textures in

#

rather than running PIP every frame

still forum
#

Kinda simple I guess. But where would you get the textures from?

rancid ruin
#

a camera

still forum
#

So like a PiP but only screenshots instead of video

#

I guess that wouldn't be too hard for BI to implement

rancid ruin
#

yeah say i want to have pictures of buildings

#

so you can click a building on the map and it shows you a picture of it in the world

#

shit like that

#

kinda like the editor preview images, only real world, as they are

still forum
#

Create a temp camera and display it fullscreen

rancid ruin
#

indeed, it's not ideal though

#

if it's night time you're fucked for example

#

i just realised that surfaceTexture could make my fog of war thing way cooler

#

i just use the terrain type at the moment

still forum
#

It can only get it where surfaceType can get it too

#

Oh surfaceType takes a position

rancid ruin
#

yeah surfacetype

still forum
#

So I guess it works everywhere then

#

But it wouldn't make forrests display as green or such

rancid ruin
#

yeah i'm not sure how to tackle forests yet

#

could just make markers where there are many trees i guess

still forum
#

It really just gives you the texture on that position. It can be different a few cm away from that.

rancid ruin
#

how does it function around roads?

#

you get the texture under the road?

still forum
#

yes

still forum
#

Refering to the UI stuff. It works EXACTLY like I imagined

lone glade
#

terribly

still forum
#

I can just make a custom RscFrame kinda thing. And when that's Drawn a Draw function in Intercept is called

#

and you can do whatever DirectX can do

#

And draw inside that Area of that Existing Frame

#

so you still need to define the drawing area in normal UI Config but the rest is however you like

rancid ruin
#

this sounds exciting

still forum
#

OUHH It get's even better

#

Well. For me. Not for you because less possibilities

#

You get DrawText that automatically adds newlines if it doesn't fit. Text that doesn't clip. Vertical Text. Any orientation of text I guess.
Draw a Frame filled/not filled though.... I have to look into that. Might not work completly. We'll see.
DrawLines, Polygones(3D)

#

Holy crap more virtual functions.
Might even be possible to let you draw textures

#

Yeah. I could load textures from path and let you draw them as background.

#

That will be sooo awesome. Let's push it onto my Todo list and let it rot for a year

#

Oh you need a font to draw text... How do you get a Font...

#

OMFG.

#

pushes it further back on his TODO list

young ledge
#

Thahaha

still forum
#

What other commands return constants?
true/false/nil... and?

lone glade
#

null and all it's variants ?

still forum
#

πŸ‘

#

I now optimize CODE else CODE to [CODE,CODE] whether you want or not πŸ˜„

#

OI I can process configFile >> "CfgWeapons" at compiletime :U Dis is getting crazy now

#

Or check isClass (configFile >> "CfgPatches" >> "acre_main") once at compile time. Meaning no runtime overhead for that! Imagine!

#

"Do I have that addon" checks completly free! ish.. Ofcause you still have to compile your script

little eagle
#

Now you make some free debug commands. You can start by porting WARNIING_n, ERROR_n, LOG_n.

still forum
#

They can't be free because they have to do something at runtime

#

I can only freeify stuff that is known at compile-time. So if you pass variables into WARNING/ERROR/LOG then I can't optimize. And I'd bet it goes to CBA_fnc_log right? and that's a variable

#
    bmap[">>"] = [](game_value left, game_value right) -> std::optional<game_value> {
        if (left.type_enum() != types::GameDataType::CONFIG || right.type_enum() != types::GameDataType::STRING) return {};
        return game_value(sqf::config_entry(left) >> right); //#TODO test
    };

Small piece of magic and now every configFile >> "stuff" >> "stuff" >> .. is completly evaluated at compileTime as far as you have constants.
So if you did configFile >> "CfgWeapons" >> _var before it will be optimized down to _constant >> _var :3

#

and getNumber/getText/isClass/isText are also constants now :U I looove this. @queen cargo bootstrapped a truly awesome thing

dim owl
#

Is there a way to make a rvmat that reflects light to the surrounding area? linke just a little bit?

still forum
#

I'll just evaluate diag_tickTime at compiletime. That will make every script 100% faster

lone glade
#

don't compile them, ∞ times faster

little eagle
#

If you can make diag_tickTime free, you can make the log macros free.

still forum
#

Well.. Yeah.. I can just make them.. not log

little eagle
#

That's the point. Make them not log unless you enabled debug mode to half or full.

still forum
#

But that will only work if you know the debug mode at compile time

#

You could use a command line parameter to enable debug mode then

little eagle
#

Well, DEBUG_MODE_NORMAL and DEBUG_MODE_FULL are the macros.

calm sparrow
#

Google has sort of failed me; is getting ai to cross bridges (on foot or vehicle) as part of their normal pathfinding a lost cause?

still forum
#

Possibilities to manually set macros when a script is compiled might be added later

#

@calm sparrow Quite sure yes.

little eagle
#

Yes, Val.

still forum
#

Being able to set global defines for every compiled script via command line parameter or SQF command should be enough for what you need right?

#

Pls no #define true false tho

#

I wonder what actually would happen if you did that

little eagle
#

Could also use sqf syntax. Kinda like disableSerialization.

lone glade
#

depend what kind of bridge it is

little eagle
#

setDebugMode 0;
setDebugMode 1;
setDebugMode 2;
idk

still forum
#

I could make
"DEBUG_MODE_FULL" setPreprocessorDefine <value>
if you use nil or.. dunno some placeholder it undefines it.
Every script you preprocess after that will have that define set

#

Till you unset it or restart the game

little eagle
#

Don't think you can make a command use nil.

still forum
#

πŸ˜‰

#

We'll see

#

Actually. I'll check

little eagle
#

It's backwards to have a command set macro defines.

still forum
#

Ugh.. Okey you can't pass nil. Then I'll just use empty array or smth. All defines have to be string anyway. So if you pass non-string I remove it.

#

The command is intended so you can use it in the debug console or smth

#

You won't use that in non-dev environments anyway

#

Now I can make stats on which SQF commands are used how often. I can even see which file uses which command how often

#

private ARRAY in ACE: 1
private ARRAY in Life: 166738

little eagle
#

Wait, really?

#

Please let if be the most commonly used command.

still forum
#

I can still only dev at work though. And I can't test stuff here :/

little eagle
#

Does Life, whichever derivative of it, really use 170k private ARRAY, or are you kidding?

still forum
#

kidding

little eagle
#

Don't do this to me.

still forum
#

Do I look like I would run any life script?

little eagle
#

Well, you do have a furry avatar.

still forum
#

I wonder if there are furry life servers

#

where everyone wears a furry costume

little eagle
#

Urg...

jade abyss
#

*puke*

still forum
#

Wow.. I just optimized selectRandom and made it select the value at compile time...

little eagle
#

Wouldn't that mean the function picks the same value every time?

still forum
#

yeah

little eagle
#

Well...

still forum
#

But atleast it's faster now

little eagle
#

πŸ˜‚ πŸ”¨

inner swallow
#

lol

little eagle
#

We were talking about realism yesterday. Would you make a Benford's law compatible random command?

still forum
#

need to google that first

little eagle
#

It's awesome. Do it, think about it.

#

Reject it, and then try it out yourself, and realize we live in the matrix.

still forum
#

Is that nonsense or would it make sense to have that in arma

little eagle
#

Better than breaking selectRandom.

still forum
#

I'm looking through all ACE scripts and trying to find constant stuff

#

But It's cached anyway

little eagle
#

Something something, preprocess at build time.

still forum
#

Ewwww I just stepped into a fleximenu πŸ’©

little eagle
#

xD

#

If I ever get bored.

still forum
#

I saw a wild typeName and immediately evacuated

little eagle
#

Well, you can't blame them for that.

#

That's what they had to use.

#

Things I don't understand is making long as if statements about _shift, _control, _alt.

#
[_shift, _control, _alt] in [[true,false,false]]
#

^ Because I'm pretty sure this worked even in A2.

still forum
#

atleast that doesn't actually call true/false anymore with the optimizer :3

little eagle
#

Yeah, I'm sure people will like 84 -> 85 FPS.

#

You know what they'd like more? 40s faster game boot time.

still forum
#

Nah

#

People don't care about start time

little eagle
#

I guess? They do seem like the launcher.

still forum
#

Did you test how fast Arma starts if you uncomment the preproc/compile of CBA_fnc_compileFunc

little eagle
#

Well 70s -> 0s

#

There is some tiny scripts for caching in preStart ACE, but the bulk is preprocessFile.

#

Can you imagine if it still did this at the first mission start?

still forum
#

Stats on preproc and compile times for stuff. Neato.

#

So much stuff on TODO list. But actually cannot even work on it

edgy halo
#

Reposting here if anyone can run this code in debug console:

lone glade
#

🀦

still forum
#

I already tried SQF-VM. But it was too dumb

#

It said if and 1 are unknown commands

edgy halo
#

Its about the noise it makes

still forum
#

what noise?

lone glade
#

the hint noise?

#

NO SHIT

#

who's the fucking genius who thought of that

still forum
#

Obviously it does. Because the hint runs like every frame

#

You just moved up the sleep though

edgy halo
#

wait thats wrong copy pasta

still forum
#

now it runs every 2 seconds roughly. The code you had before had the sleep wrong and would run every frame

lone glade
#

fun fact: this used to crash the game

edgy halo
#

sorry updated code

#

check it out

lone glade
#

the game couldn't handle trying to produce that many sounds so fast and just crashed πŸ˜„

still forum
#

Yeah. You call hint every frame. Which obviously causes the hint sound every frame

#

and a sound that plays 60 times a second.. Could be called a "noise"

lone glade
#

"earrape"

still forum
#

"ea" "rrape" ?
EA Rappe? What's a rappe?

lone glade
#

"eardrumstroyer"

edgy halo
#

nvm still morning for me

little eagle
#

What's going on?

kindred bane
#

how do i change the ordre of gui controls? Cause it seems my picture is infront of all my buttons

lone glade
#

the ones below are in front, the ones above and behind

#

the ones on top are behind, the ones below are in front

#

ah, the message went through this time

kindred bane
#

aight thanks πŸ˜ƒ I will try and see if it works now

#

@lone glade well the text i added is infront of the picture but it seems the buttons are still behind it hm
i have pmed u the code

lone glade
#

oh, didn't realize it was for life stuff, sorry.

kindred bane
#

lol its a menu

#

and u wont help cause its for life? lmao

lone glade
#

Yes, exactly.

kindred bane
#

lol

jade abyss
#

@meager heart wrong chan + #rules

still forum
#

Don't post contextless shit.

#

Delete the message

#

And don't do again

queen cargo
#

configFile >> "notexisting"
what is this returning?

#

ty

still forum
#

liar

#

configNull

queen cargo
#

meh ...

#

kinda expected that

grizzled spindle
#

Sorry my bad was just looking for where I had done it

queen cargo
#

str configNull?

grizzled spindle
#

if (isNull (missionConfigFile >> "VirtualItems" >> (_x select 0) >> "processedItem")) then {

little eagle
#

blank, X39

#

just "".

#

Which is infuriating when debugging it with the console

#

Also, >> errors when used on a non-class token on the lhs.

#

btw.:

inheritsFrom configFile == configNull // true
queen cargo
#

configFile is not inheriting so that was to be expected

little eagle
#

Yeah, but the == reporting true for a null thing is.

still forum
#

well null and null are clearly equal aren't they?

#

Both start with N.. Like.. Not False

little eagle
#

Then explain the twenty other null things that make == report false.

still forum
#

Well...

#

Magic

little eagle
#

:magic:

queen cargo
#

old method, new dev

#

there is your magic

still forum
#

(βˆ©ο½€-Β΄)βŠƒβ”β˜†οΎŸ.*ο½₯q゚ Null

little eagle
#

kirbyNull

#

Add it to intercept.

still forum
#

One sec

#
static auto kirbyType = host::registerType("KIRBY"sv, "kirby"sv, "Dis is a Kirby. It does things."sv, "Kirby"sv, createGameDataKirby);
static auto _kirbynull = host::registerFunction("kirbyNull", "Creates a non kirby thing", userFunctionWrapper<createKirbyNull>, kirbyType.first);
queen cargo
#

getArray (configFile >> "cfgVehicles")
what is this returning?

little eagle
#

[] and I think RPT error, and once on screen error.

lone glade
#

an empty array

#

getNumber is -1 and getText ""

queen cargo
#

error or non-stoping error @little eagle ?

still forum
#

non-stopping

little eagle
#

Pop up.

#

Alganthe, getNumber is 0 by default.

lone glade
#

you sure about that?

#

yep, it is indeed 0

queen cargo
#

does CONFIG select NUMBER with index == childcount also return nil?

little eagle
#

Good question, no idea.

#

select's kinda shit. Thankfully we have configProperties/Classes now.

queen cargo
#

wut?

little eagle
#

What I wrote.

still forum
#

select and configProperties do different things

meager heart
#

Description for getObjectMaterials: Gets all custom materials associated with the object... Is it working only if on object was applied texture with setObjectMaterial ? - fixed*

queen cargo
#

configProperties horrible command to implement ...

still forum
#

setObjectMaterial

#

Material != Texture

little eagle
#

It too needs hiddenSelection's if that is what you're asking.

meager heart
#

getObjectTextures return patch for hiden selections textures, but getObjectMaterials return ["",""]; So i'am asking is it works only if on object was aplied material ?

#

with setObjectMaterial

#

or its broken ?

little eagle
#

Maybe it has no material?

#

Soldiers probably don't use them, because hidden materials break damage / wound marerials. So no bloody uniforms.

meager heart
#

Is it possible ?

#

no rvmat ?

little eagle
#

Well, not one you can change. Idk, give an example.

meager heart
#
copyToClipboard str ({getObjectTextures _x} forEach (allMissionObjects "LandVehicle")); // ["a3\soft_f_beta\truck_01\data\truck_01_ext_01_co.paa","a3\soft_f_beta\truck_01\data\truck_01_ext_02_co.paa","a3\soft_f_gamma\truck_01\data\truck_01_mprimer_co.paa"]

copyToClipboard str ({getObjectMaterials _x} forEach (allMissionObjects "LandVehicle")); // ["","",""]
little eagle
#

The truck probably doesn't use hidden materials.

meager heart
#

hmm

little eagle
#

You have to set them up in config:

hiddenSelections[] = {"camo1","camo2","camo3"};
hiddenSelectionsTextures[] = {"1","2","3"};
hiddenSelectionsMaterials[] = {};
#

That's probably what it looks like.

#

So no hidden materials on these selections.

meager heart
#

so yes, there was no hidenSelectionMaterials and command works...

open vigil
rancid ruin
#

how can I make X number of buttons, spaced out evenly horizontally across the width of the screen?

#

i'm rusty as hell on UI

little eagle
#
        #define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W))
        #define WIDTH_GAP (WIDTH_TOTAL / 100)
        #define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5)
#
        class menuBar: RscControlsGroupNoScrollbars {
            idc = IDC_menuBar;
            x = QUOTE(0.5 - WIDTH_TOTAL / 2);
            y = QUOTE(safezoneH + safezoneY - 9 * GRID_H);
            w = QUOTE(WIDTH_TOTAL);
            h = QUOTE(7 * GRID_H);
            class controls {
                class buttonHide: ctrlButton {
                    idc = -1;
                    colorBackground[] = {0,0,0,0.8};
                    x = QUOTE(1 * WIDTH_GAP + 0 * WIDTH_SINGLE);
                    y = QUOTE(0);
                    w = QUOTE(WIDTH_SINGLE);
                    h = QUOTE(7 * GRID_H);
                    text = CSTRING(buttonHideText);
                    sizeEx = QUOTE(5 * GRID_H);
                    shortcuts[] = {"0x0E"};
                    tooltip = CSTRING(buttonHideTooltip);
                    onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonHide));
                };
                class buttonLoadouts: buttonHide {
                    idc = -1;
                    x = QUOTE(2 * WIDTH_GAP + 1 * WIDTH_SINGLE);
                    text = CSTRING(buttonLoadoutsText);
                    onButtonClick = QUOTE(createDialog QQGVAR(loadoutsDisplay));
                };

You use macros and math.

rancid ruin
#

macros? i don't like the sound of that

little eagle
#

If you want to make life harder for yourself, then you can avoid them.

#

Some people want a challenge, I don't judge.

worn igloo
#

I've encountered a weird issue. Everytime I use sqf ["Open",true] spawn BIS_fnc_arsenal; in the debug menu, systemChat no longer works.

#

Seems to working fine in the editor.

subtle ore
#

how would switch camera work with the player's camera set if I were to use a custom one in replacement?
IE:
Custom one is created -> How do I use this one instead of the external or internal camera for the player?

meager heart
#

if i understand what you asking...```sqf
0 spawn
{
private _camera = "camera" camCreate eyePos player;
_camera cameraEffect ["internal", "back"];
_camera setPosASL eyePos player;
_camera setDir getDirVisual player;

    sleep 5; 
 
    private _camera_2 = "camera" camCreate (player modelToWorld [0,5,1]); 
    _camera_2 cameraEffect ["fixed", "front"]; 
    _camera_2 camSetFov 0.5; 
    _camera_2 camSetTarget player; 
    _camera_2 camSetRelPos [0,0.5,1.5]; 
    _camera_2 camSetFocus [5,0]; 
    _camera_2 camCommit 1; 

    waitUntil {camCommitted _camera_2};
    camDestroy _camera;

    sleep 5;

    _camera_2 cameraEffect ["terminate","back"];
    camDestroy _camera_2;
};
subtle ore
#

@meager heart Not exactly, I want to adjust the position of the player's external camera.
switching to the camera using:

player switchCamera _camera;
#

doesn't seem to do anything, as i think the default camera set is taking control

meager heart
#

Is that _camera target or new camera ?

subtle ore
#

new camerate created via camCreate

meager heart
#

Then i think its wrong wait...

#

target switchCamera mode or switchCamera target

#

That dont work for switching to new or "some camera"

subtle ore
#

Right, my bad meant just:

switchCamera _camera;

^ Local to player

meager heart
#

yes and that variable _camera shoud be target or mode and not new camera

subtle ore
#

oh...so:

_camera switchCamera "EXTERNAL";

?

meager heart
#

or player switchCamera "External";

subtle ore
#

hmmm, I'll try this out. Thanks for the feedback

meager heart
#

yw

tulip cloud
#

Why can't I do getDir to an emptyTrigger and return the direction it is facing?

tough abyss
#

a triggers direction? πŸ€”

open vigil
#

I was.

still forum
#

@worn igloo known bug. Not sure if a fix is/was on the way or will be or.. whatever

vocal knot
#

anyone know how to make something trigger when you close the arsenal?

#

trying to make it save loadouts for respawn when people change things

tough abyss
#

@vocal knot Well idk how arsenal is closed, but if its by button then yes just when the code executes you can excute a save command. If it can be closed by escape then save onKeyUp

vocal knot
#

@tough abyss can be closed by a few methods, was wondering if there was a more concrete method, ive seen it done before

#

something I can do to the addaction command when i call the arsenal?

open vigil
#

Youve had your warnings, goodbye.

tough abyss
#

wrong channel much

#

@vocal knot not really possible through addAction

vocal knot
#

arguing with mods always ends well

open vigil
#

Especially when he was warned and told to stop.

#

...and this is why we screenshot everything.

vocal knot
#

heh

#

best of luck to you, moderating is a pain

#

@tough abyss hm ive seen it done maybe i need to find the guy that did it

edgy dune
#

say

#

u know how some jets have like afterburner enegine effects

#

is there a way to put those effects on other jets

#

like take a f-22 afterburner engine glow and put it on ohhhh say a helicopter

#

could it be done someone with scrpts/config editing or something?

still forum
#

@vocal knot There is a eventhandler for Arsenal close I think.. Should be. There 100% is if you have CBA

#

look at BIS_fnc_addScriptedEventhandler

vocal knot
#

yeah ill check it out

velvet merlin
#

is there a way to get a less crappy map view in the BI observer mode, or just ditch it altogether and make something custom?

#

like this is horrible, isnt it

lone glade
#

the fuck is happening there O.o

#

is it a really small window?

#

because that looks like a scaling issue

velvet merlin
#

the watched unit is off map, but its not alliged properly, the borders dont fit (why are they any in the first place) and not full screen

vocal knot
#

i cant figure out this ace arsenal default loadout thing....

#

not sure how im meant to open it in the editor

lone glade
#

W.I.K.I

vocal knot
#

I read it, and the framework

#

still confused

#

might just go to sleep lol

still forum
#

Well.. Then you didn't read it

lone glade
#

click on a unit and press edit loadout
edit said loadout
click on loadouts in the menu bar
go to default loadouts
type a name
save

still forum
#

because it clearly says what to do

#

β›±

vocal knot
#

where does it say to do what alganthe just said

#

if i missed it my bad

#

thank you

lone glade
#

well, considering there's only one way to access ACE Arsenal there and that the default loadouts save button is not disabled I'd say it's pretty obvious

still forum
#

wut

vocal knot
#

and im telling you its not obvious lol

lone glade
#

but then again I made it.

still forum
#

It doesn't work like that tho. You can't scream at people that something is in the wiki when it isn't

lone glade
#

So i'm kinda biased.

vocal knot
#

if it was obvious i wouldnt ask πŸ˜ƒ

lone glade
#

While in 3DEN you have the ability to save default loadouts in ACE Arsenal

vocal knot
#

i didnt even know you could edit loadouts in 3den

#

when did they add that

still forum
lone glade
#

at release

still forum
#

When they Added Eden

vocal knot
#

i never knew that

#

they added a ton of stuff to this that i probably dont know about... havent been playing all that much since it came out tbh

#

is this important

still forum
#

no

austere granite
#

ENUM BOIS

lone glade
#

ERRYWERE

#

ABUSE OF POWAH COMMEH

scarlet spoke
#

May a String definition in SQF span over multiple lines?

#
"Here I start
And here I end"
#

Somthing like this?

little eagle
#

Yes.

scarlet spoke
#

Alright thanks

little eagle
#

You can also use endl.

scarlet spoke
#

Huh?

little eagle
#

"Here I start" + endl + "And here I end"

scarlet spoke
#

Ah okay... No I was just asking because I need to know whether my lexer may match a String over several lines ^^

#

But the NL character would be included and respected in the String if I use above definition? Interesting...

little eagle
#

Dunno. May depend on where it's used. \n is usually for hint, tooltips, multiline text controls etc.

scarlet spoke
#

Oh and while we're at it: Can a String enclosed in single quotes also use a "double-singlequote" as an escape sequence for getting a single quote in the String?

#
'This is ''MyString'' '
#

Like this

little eagle
#

I have no idea. : (

still forum
#

Same here. Never tried. I'll ask SQF-VM

little eagle
#

Should ask the game instead.

scarlet spoke
#

I'm speechless... The SQF-gurus having no clue. What a time to be alive πŸ˜…

still forum
#

I can't aa...... I'll ask the game...

scarlet spoke
#

πŸ˜ƒ

still forum
#

But that will probably take longer than how long you take to start Arma and test

scarlet spoke
#

Alright I'm gonna check it and report back... Just let me switch PCs...

still forum
#

Let's see who's faster

jade abyss
#

' "" ' ?

scarlet spoke
#

The race is on then

#

@jade abyss what do you want to say with that?

jade abyss
#
Oh and while we're at it: Can a String enclosed in single quotes also use a "double-singlequote" as an escape sequence for  getting a single quote in the String?
'This is ''MyString'' '```
#

'This is "MyString" text'

#

Otherwise it will just fail

scarlet spoke
#

So no double-singlequote escaping?

jade abyss
#

Why should it?

scarlet spoke
#

Because it works with double quotes

jade abyss
#

'' != "

scarlet spoke
#

I know... But it could have been that the Devs implemented it for both

jade abyss
#

For what?

scarlet spoke
#

As Strings can be defined with both

#

For what is it needed with double quotes?

jade abyss
#

No clue what you want

scarlet spoke
#

And I just checked in-game. It does work!

still forum
#

NOOOOOOO I was soo close

scarlet spoke
#

πŸ˜„

#

So we conclude that 'This is a ''Test'' right here' wil translate into the following String: "This is a 'Test' right here"

still forum
#

Whohhh that is clever

#

They don't have a hardcoded " or '
They search for either of them and then just use whatever character is at the current position

#

Instead of filtering hardcoded for " or '
It even works with {}

scarlet spoke
#

Whutt?

still forum
#

You can have preproc thingies inside multiline strings btw

scarlet spoke
#

I can define Strings with {}?

still forum
#
"I am a 
#define me is string
string"
#

stuff inside {} is a string yeah

#

kinda

#

somewhat

scarlet spoke
#

Now I am confused xD

still forum
#

yes

little eagle
#

It's a string, but not STRING type in SQF.

scarlet spoke
#

Does the preprocessor stuff has to be at line start or can it be anywhere inside the String (consuming the rest of the line of course)?

little eagle
#

Pretty sure # has to be the first char, minus whitespace

#
    # define BLAH

Like this would work iirc.

still forum
#

yeah first char quite sure

#

Well...

little eagle
#

But there can be whitespace.

still forum
#

ah yeah

#

whitespace is always skipped internally

little eagle
#

The preprocessor also trims left whitespace.

#

Not sure on the space between # and define tho.

lone glade
#

you mean the space between #define and it's content ?

still forum
#

for #line that's a no

little eagle
#

No, because I said something else, alganthe.

#

I think I was pretty clear.

still forum
#

for #define it..... doesn't

little eagle
#

Doesn't what?

still forum
#

So no # define not allowed

little eagle
#

OK.

#

May have remembered this from C/C++.

jade abyss
#

So no # define not allowed πŸ˜‚

still forum
#

yes

jade abyss
#

So it's allowed

still forum
#

no

jade abyss
#

2x no = yes

still forum
#

yes

little eagle
#

So no, (komma) # define is not allowed.

jade abyss
#

πŸ‘

still forum
#

no no

jade abyss
#

No yes

#

No wait

little eagle
#

Yes?

jade abyss
#

yes, no

little eagle
#

Maybe.

#

I don't know

jade abyss
#

aye

#

Understandable

lone glade
#

basic human communication is hard

jade abyss
#

At least, i am not a french

lone glade
#

the proof?
the conversation above

little eagle
#

At least, i am not a french
πŸ”₯

still forum
#

I made a screenshot!

jade abyss
#

?

#

Β―_(ツ)_/Β―

tranquil nymph
#

So close to becoming malcom in the middle theme

little eagle
#

That was what I was going for, but no one remembers it here.

still forum
#

I remembered yes no maybe

#

but didn't know from where

chrome mason
#

Yo, what do i have to put in the onButtonClick field to make this: ```hpp
class LastPos : Life_RscButtonMenu
{
idc = 1001;
type = 1;
style = "0x02";
colorBackground[] = {0,1,0,0.5};
text = "Discord";
onButtonClick = ????????????????;
x = 0.247344 * safezoneW + safezoneX;
y = 0.665 * safezoneH + safezoneY;
w = 0.12375 * safezoneW;
h = 0.033 * safezoneH;
colorBackgroundActive[] = {0,1,0,0.7};
colorBackgroundDisabled[] = {0.95,0.95,0.95,0};
offsetX = 0.003;
offsetY = 0.003;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
colorShadow[] = {0,0,0,1};
colorBorder[] = {0,0,0,0};
borderSize = 0.008;
};

take you to a website??
dusk sage
#

hrefs?

still forum
#

Make button text use <a href...

dusk sage
#

On text, not button

still forum
#

Yeah... RscText?

dusk sage
#

Yeah

chrome mason
#

Ofcourse... That's what i thought! Thanks booboo πŸ˜›

tame portal
#

Or use URL= on a button

#

Should work aswell

plucky willow
#
{
    _x moveincargo [(vehicle (leader _driver1)),(_foreachindex + 1)];
    _x assignascargo (vehicle (leader _driver1));
}foreach units _sq1;
#

im having an issue where all my units disembark the vehicle

#

prematurely

#

as in right when it spawns

mild pumice
#

guys

#

i used pushback a lot but i discovered something wtf

#
_tab = [2,2,2];
_final = _tab pushBack [];
hint str _final;
#

the hint display : 3 (the array's size)

cold pebble
#

Actually, it returns the index of inserted element

#

πŸ˜›

mild pumice
#

ok xD thanks

cold pebble
#

πŸ˜ƒ

mild pumice
#

actually i was trying to add en empty array at the end, using the + operator like this

_final = _tab + [];

but it didn't do anything so i tried with pushback but i forgot that it modifies _tab instead of returning the array in _final
By the way the solution with + was this :

_final = _tab + [[]];
rotund cypress
#

Hey guys, if you use a command that is in CfgDisabledCommands, will an error get thrown or even a RPT message?

#

Also IIRC href must be in structured text, i.e.: RscStructuredText or RscShortcutButton @dusk sage @chrome mason

quasi thicket
#

Is there a script that can disable the "marker" that follows you when you are in a parachute

tough abyss
#

@rotund cypress there is just an rpt message saying the command was blocked/disabled. It won't give you any more info

rotund cypress
#

ok cheers

lunar mountain
#

Hello there,

I'm pretty desparate about one specific issue. You may have also experienced it.
it's the "error: no unit" bug. Basically name _player returns "Error: no unit", getplayeruid _player returns "", isplayer returns false, player body doesn't dissappear after disconnect, there's no disconnect event triggered, and who knows what other things. Also, public variables on the player (setvariable with public flag) doesn't propagate to the new player object. Basically it ruins some pretty serious stuff.

So... does anybody know what may be causing this issue and how to avoid it? My best bet is that it is respawn related somehow.
We've been getting this bug a lot lately on our servers. Before it was a bit more rare, but now it is happening pretty often. Last time I checked, 5 out of 60 players had this issue.
Oh and it is totally different on each client/server.

rotund cypress
#

The name and player id will always work on client side, but player is null server side.

#

However, name player when dead will return error no unit

#

Regardless of unit being null or not.

#

Object variables always carry over if someone dies.

#

And bodies not deleting when someone disconnect is something wrong with your mission and not an arma bug, just use ondisconnect eventhandler and delete the object.

#

@lunar mountain

lunar mountain
#

These are pretty much alive :D
"Object variables always carry over if someone dies." - It should, yes. we have a failsafe variable set on players when they join (profilename basically) and every script checks for that variable as name (and falls back to name _player if it's not available). Lot of " error: no units " on map, UI, nametags, etc. So I'm pretty sure it does not propagate over.
My problem is that getplayerUID also returns empty string, which f-up our position logging, same with no disconnect event.

may be something with how respawn or some eventhandlers set up, but either way, it is not expected to have issues like this. I hoped someone had this issue and figured it out.

#

So right now to have the names and playeruid working, players should reset those custom variables every time they respawn. Which is not a problem, it is just not a real solution :/ Also, I cannot fix not having a disconnect event with this. I use handledisconnect, although now that I looked up, I'm adding this EH 3 times (logging, cleanup and for HC handling)

#

although the bug happens before the player disconnects, having no DC EH is just a mere symptom as I see it

plucky willow
#

I want to use assignAsCargo to get units I've spawned via script to be able to disembark a vehicle when theyve received a waypoint to do so. I'm having a problem in that after i use assignAsCargo, all the units will immediately disembark. If I use moveInCargo without using assignAsCargo, the units will remain in the vehicle, but they will not disembark it. Is there something I could do to have the units be able to disembark via waypoint as normal?

winter dune
#

is there an EV that triggers when I'm in a vehicle and press left click for the horn?

#

I thought about Fired, but don't know if that should actually work

peak plover
#

Fired should still fire

plucky willow
#

worked around it by assigning the unit as cargo only when theyve arrived at the location

queen cargo
night void
#

Guys, looking for coder for finish new version of MOCAP Melee mod, add ACE wounds compability, PM me please

subtle ore
night void
#

@subtle ore is no one response in this channel...

subtle ore
#

@night void Doesn't matter, that is where it belongs. Don't expect someone to reply to you immediately. You should not expect that anywhere.

jade abyss
#

not him again

#

As Midnight said: Post your stuff in 1 Channel, not 2, not 3, not 4, just 1

#

(Oh and, you can delete one of them)

tulip cloud
#
_n = 2;
private _return = switch(_n)  do {
  case 1: {"one"};
  case 2: {"two"};
  case 3: {"three"};
};

"number " + _return;

How do I rewrite this to properly return the value from case to _return?

#

the way I have it written the results is number true

elfin palm
#

try this in your case statements "case 1: {_return = "one"} ;"

tulip cloud
#

trying to avoid having _return = in each case. I think there is another way.

elfin palm
#

fair enough. not sure πŸ˜ƒ

#

usually it returns true if there's no default. so it doesn't seem to be reaching any of your cases.

#

if you set a default and _return becomes the value of the default you can know for sure that it hasn't hit a case.

subtle ore
#

Yeah it should return whatever is inside of {}

tulip cloud
#

ok, I'll look into it

elfin palm
#

I just executed that code block in the debug menu and it correctly returned "number two"

tulip cloud
#

yeah I'll debug why it isn't going through any of the cases.

elfin palm
#

have fun πŸ˜ƒ

edgy dune
#

question

#

is there a command that allows u to set the thrust of a vtol

#

lik say for example

#

power of 75 makes the vtol when the thrusters are at full 90 so taht it doesnt move up or down, the thing is thatits kinda hard do to that cause u use shift and z to increase/decrease thrust so u can easilty jump between 76 and 74 percent thrust

#

nbm

#

nvm

#

I found it

#
_this setAirplaneThrottle  .5;
``` incase if anyone wants to know
stable wave
#

is there a command that is similar to modelToWorld but uses a position as the argument?

still forum
#

It is like.. 100% similear and uses a position as argument

little eagle
#
_n = 2;
private _return = ["null","one","two","three"] select _n;

"number " + _return
#

trying to avoid having _return = in each case. I think there is another way.
Seems irrational. You should avoid _return = switch ... and _return = if ... instead, for they are ugly. @tulip cloud

#

@still forum Β―_(ツ)_/Β―

tulip cloud
#

@little eagle If it was actually that simple of a problem, I would have indexed it like you did. But I'm taking some params and they are being processed depending on the case. then the results are sent to another function for further processing.

little eagle
#

Well, that is not what your example shows.

#

But yeah, switch reports true if no case is sound, and no default block was defined.

errant jasper
#

Anyway to get extended event handlers to run for built in map object with Land_ prefix?

#

Nvm, I see you can't set variables on them either

cedar kindle
#

i think it’s a performance trade off

tough abyss
#

Setvariables on buildings on map? You can do that

errant jasper
#

Not the one I tried. It has no typeOf

elfin palm
#

what building is it?

velvet merlin
#

how to spawn a vehicle in a random radius without having it getting created inside an object and explode?

#

_vehicle = createVehicle [_vehicleClass,_spawnPosition,[],_spawnRadius,"NONE"];

little eagle
#

Delete everything in that radius.

velvet merlin
#

is the safePos function from BI any good?

little eagle
#

Not really, no.

night void
#

Guys
how to check if ACE mod enabled and what Medical module using currently?
how get current ACE bodypart damage statement?
how to check if target is ACE Uncon now?

tough abyss
#

Spawn it elsewhere disable damage, setvectors and setpos to new location, enable damage etc (been awhile since i looked at that stuff though)
Really annoying you cant supply direction/vector when using createVehicle etc

errant jasper
#

@elfin palm "Land_WoodenCounter_01_F"

velvet merlin
#

@tough abyss interesting idea

peak plover
#

I use the safepos command works ok

#

And a loop

lone glade
#

selectBestPlaces is better

night void
#

@little eagle answer me please in PM about ACE, thank you

little eagle
#

how to check if ACE mod enabled and what Medical module using currently?
!isNil "ace_medical", and I don't know

how get current ACE bodypart damage statement?
There is no such thing.

how to check if target is ACE Uncon now?
_unit getVariable ["ace_unconscious", false]
iirc

#

May be "ace_medical_unconscious" or "ace_isUnconscious". It's somewhere in the doc.

night void
#

where to find ace docs? google bitching me with it

little eagle
night void
#

❀

still forum
night void
#

y but here no info about medical framework!

jade abyss
#

Then: It's your problem. =}

still forum
#

Well ACE is open source and each script function is documented there. Just look there

jade abyss
#

We got a problem there

#

He needs to know, how to code.

still forum
#

Well makes no sense to ask these questions if you don't know how to code.

night void
#

im looking for funcs and use examples πŸ˜‰

jade abyss
#

I guess, then it's time for you do some work on your own (at least this time)

restive matrix
#

anyone have an example of a customChat / radio channel working on a dedicated server mission? having alot of trouble using it and the docs are lacking

night void
#

@little eagle did u find how to kill target with assigned killer? we already tryed it with SetShotParrents

scarlet spoke
#

Does the case of the letters in a hexadecimal number in SQF make a difference? Or is the hex-spec case-sensitive?

elfin palm
#

@errant jasper can you not use set/getVariable on it?

errant jasper
#

@elfin palm I did not try that exact combo. But I did a setVariable on it in the debug console, and then used allVariables to read and it always returned [], even after using setVariable.

elfin palm
#

Not used allVariables before, but you should be able to retrieve anything done with setVariable through a getVariable on the same object.

still forum
#

@scarlet spoke insensitive

scarlet spoke
#

Does that also apply to the 0x prefix? So can I use $ 0x and 0X as a prefix for a hex-number?

#

@still forum

still forum
#

unsure

#

It should

scarlet spoke
#

Alright then I will consider it case-insensitive until proven otherwise ^^
Thanks

errant jasper
#

@elfin palm Just tried set and then getVariable, and no it does not work.

elfin palm
#

post code block

lone glade
#

you can't muzzleflash

elfin palm
#

also how do you do code formatting on this?

lone glade
#

`

mycode

`

elfin palm
#

ty

#
_building = createVehicle ["Land_WoodenCounter_01_F", getPosATL player, [], 0, "CAN_COLLIDE"];
_building setVariable["foo","bar"]; 
_var = _building getVariable "foo";
hint (_building getVariable "foo");
lone glade
#

AAAAH

elfin palm
#

that works for me @errant jasper

lone glade
#

yeah, building

#

not land

elfin palm
#

he said that he was trying to use that building

#

I may have misunderstood

errant jasper
#

I am attempting to use structures already on the map.

elfin palm
#

Okay, and you have not been able to setVariable on the individual objects?

#

I just did a quick one again on utes, used nearestTerrainObjects to get the building and then assigned it using set/getvariable and that worked for me.

lone glade
#

buildings != land objects

elfin palm
#

I did it with a fence

#

please excuse my terminology

#

if it works with a fence should be fine with your wooden counter

#

Nope, I'm wrong, looks like it was a false positive earlier, good luck anyway πŸ˜ƒ

edgy dune
#

anyone know any jumppack scripts? not a jetpack where u can hover but more so well.....a jump pack

#

i made one and im not sure if its all that well

#

here I guess ill show it

#

removeAllActions _this;
_this  addAction ["<t color='#A668C2'>jump</t>",
{

directionPerson=direction (_this select 0);
horizontalSpeed=6;
verticalSpeed=15;
(_this select 0) setVelocity [((velocity (_this select 0)) select 0)+(sin direction (_this select 0)*horizontalSpeed),
((velocity (_this select 0)) select 1)+(cos direction (_this select 0)*horizontalSpeed),
 verticalSpeed];
(_this select 0) allowDamage false;



(_this select 0)  setvariable ["jumping",true,true];
sleep ((verticalSpeed/9)+(verticalSpeed/9)*.2);

while {((_this select 0) getVariable "jumping")} do
{

[west, "HQ"] sideChat Format["t %1",time];
if((((speed (_this select 0)))==0)) then
{
(_this select 0)  setvariable ["jumping",false,true];
}


};

(_this select 0) allowDamage true;
},[1],0,false,true,"User15"," driver  _target == _this"];
hint format["done %1",time];


#

but I was wondering if there was better I guess logic to making a jumppack

elfin palm
#

well that was fun to piss about with in the editor lol.

#

would be good to not allow consecutive jumps while in the air

scarlet spoke
#

Simply add a condition for the action so that it will only reappear n seconds after being invoked the first time. That should do it for most cases

worn igloo
#

How can I execute a script over a timed interval?

#

Say 5 minutes

queen cargo
#

[] spawn { while{true} do { <CODE>; sleep 300; }; };

candid jay
#

All, I am trying to integrate ALiVE and UCM (https://forums.bistudio.com/forums/topic/210728-ucm-utilities-construction-mod/). I need to force the spawning of ALiVE virtual units when they are around the AI workers so that they attack them and, to do so, I have an idea.

ALiVE relies on allPlayers to decide whether to spawn / despawn units: if there are any players close to "virtualized" ALiVE units, they will be spawned. The interesting thing about that is that allPlayers returns not only players but also all connected Headless Clients. I am hoping to manage somewhat to create a HeadlessClient_F in the construction area that arma thinks is connected which, in turn, would make ALiVE spawn units.

So the question is: does anyone know the internals of HeadlessClient_F to make arma return a logical unit in the list of allPlayers?

little eagle
#

@night void No.

night void
#

no what?

edgy dune
#

is there a command that allows u to make the y axis inverted for say the gunner on a vtol?

little eagle
#

did u find how to kill target with assigned killer? we already tryed it with SetShotParrents
No, I didn't.

#

@edgy dune No.

edgy dune
#

awww shit,cause theres this vtol where the gunners seat gun is inverted in the y axis

night void
#

@little eagle 😦

night void
#

guys, any way to stimulate player to throw own spawned grenade and assign player as thrower?

kindred bane
#

is there any wiki for making tables

austere granite
#

Woodworking books probably

kindred bane
#

well i guess, but i actually meant liike in lua you can do
table = {};
table.whatever= {
image = "imagepath/blabla.paa",
name = "whatever";
};
table.whatever2= {
image = "imagepath/whatever.paa",
name = "whatever 2";
};

#

is there a way to do something kinda like that maybe with array

astral tendon
#

none of ther comands are making the car move

vehicle player sendSimpleCommand "foward"
meager heart
candid jay
#

OK I am looking into headless clients and that got me wandering. Let’s say there’s a mission with 100 AI, and 5 human players. Is there a significant fps improvement if each client spawns 20 AI that therefore have locality on different machines vs the server spawning all of 100?

still forum
#

@Ale x#3804 not really

#

atleast not in vanilla arma

kindred bane
#

okay thanks πŸ˜ƒ

candid jay
#

Did i reach that point where i am asking questions that are out of this dicord’s knowledge? I that even remotely possible? 🀣🀣

#

well then

#

will try experiments and report back!!

#

πŸ˜ƒ

still forum
#

@candid jay probably not

#

Also that's not #arma3_scripting so no wonder you don't get a answer about that here

candid jay
#

oh

#

where would this question be best? i’ll move it there

lone glade
#

not only that but the answer vary depending on the hardware used

tough abyss
#

Its also pretty subjective i.e what is server fps / number of objects/vehicle etc
Also Is the AI near each other or spread out etc, due to HC beening basically a client

Easier to just test it out if you got spare hardware/resources for HC & test it yourself

candid jay
#

what i am saying is: if hc can seriously help fps (there are videos of 800 ai on 1 server and 3 hc), why not use the players’ clients

#

will try some experiments

#

and basically just curious πŸ˜ƒ

#

so indeed i will try it out

indigo snow
#

Thatll have issues if players disconnect

#

HC is reliable, clients are not

lone glade
#

^ pretty much

#

HC is using the unused cores / threads on your server to your advantage

candid jay
#

understood

tough abyss
#

You can add eventhandlers for locality changes to handle transfering ai /disconnects etc. It is doable, done it for clientside zombies etc.
Arma pretty stable, no big changes coming . So i would just use HC if you got resources for it, just remember to have HC near AI if possible
Instead of a client who might already have poor fps due to hardware etc

candid jay
#

thank you

indigo snow
#

iirc normal AI (zombies may differ!) have issues when they transfer locality after theyve started combat, due to the danger.FSM not properly migrating over.

meager heart
#

@candid jay Don't expect magic from HC, yes it works, but nothing really major will happens...
And about this video you posted "with 800 AI" Check this https://gyazo.com/a989a8867043394e3f151181c0e45334 no HC and 600 + AI and all of them with waypoints in cycle, server fps at bottom left

austere granite
#

That's obviously only because the server doesn't need to simulate their helmet straps coming loose

meager heart
#

πŸ˜€

lone glade
#

or because they're not engaged

#

place down an "enemy" unit or make them fight and watch the framerate crumble

meager heart
#

On server not really

still forum
#

I'm gonna eat all your kittens

austere granite
#

That's a nice name Dedmen, very readable.

meager heart
#

Snakes also not bad

candid jay
#

^^_

edgy dune
#

Can u hint only to a specific person?

still forum
#

You can only hint to.. yourself basically

#

hint is local so where you execute it there you hint

#

you can execute anything on a specific person.

edgy dune
#

oh lol ive been hinting globally

still forum
#

So yeah you can also do that with hint

#

see remoteExec

subtle ore
#

πŸ€” "Hinting globally" ?

lone glade
#

remoteExec with -2 as target

subtle ore
#

it'd just be local to the server if you were to hint on the server

still forum
#

hints @subtle ore the exit globally

subtle ore
#

Hm

ripe imp
#

so i want to randomly select (and display on the map) one from a number of pre-selected map markers in various locations

i was going to do this by making a bunch of hidden map markers, and then iterating through them picking one at random. before i go down that rabbit hole, i wanted to check here and see if theres a simple solution or if i'm even spinning in the right direction

#

for starters i don't even know how to make a map marker hidden

lone glade
#

yeah, get an array of possible positions, the types of markers and just create them on the fly