#arma3_scripting

1 messages ยท Page 297 of 1

dry egret
#

good new and bad news

#

good news is the extracion works

#

bad news is i cant find the vehicle name lol

#

@plush cargo is that by chance a boat push back script?

plush cargo
dry egret
#

oh wow

plush cargo
#

to find what side of the dock you're on and which direction to turn/push you

dry egret
#

that looks good

plush cargo
#

and so all the diff ships wind up the same distance from the dock

#

ty

dry egret
#

would never have dreamed of pirate ships in arma

#

life servers are going to go nuts

plush cargo
#

didnt do the models or anything just helping out with the coding

dry egret
#

need a bit of help pulling out the name i need to finish this script

#
_Raider_1 = [];
_extractChopper_1 = [];

if (isServer) then {
    _Raider_1 = createGroup WEST;
    _extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;


//Extraction Waypoints

    _wp = _Raider_1 addWaypoint [wp_POS, 0];
    _wp setWaypointType 'MOVE';
    _wp setWaypointSpeed "FULL";

    _wp1 = _Raider_1 addWaypoint [position ab1, 1];
    [_Raider_1, 2] waypointAttachVehicle vehicle ab1;
    _wp1 setWaypointType 'MOVE';
    _wp1 setWaypointSpeed "FULL";


};

later on in the script im using

_car = _extractChopper_1 select 0;
#

but its returing undefined

#

only returing undefined when its on the dedicated though

compact galleon
#

@dry egret You assign it in an if (isServer) block, so it's only defined on the script running on the server. if you try to access it on a client, it'll be undefined. Make sure to use an if (isServer) check when you read it too

dry egret
#

how do i pull out the name so that i can access it on client then

compact galleon
#

If you need to access it from any machine, assign it to a global variable instead, then broadcast it to clients

#
if (isServer) then
{
    // Assign global variable a value on the server.
    GlobalVariable = 1337;

    // Broadcast "GlobalVariable"'s current value to all other machines.
    publicVariable "GlobalVariable";
}```
#

publicVariable will send the value to all other machines, and have them assign it to a global variable on their end also named GlobalVariable. You need to call that every time you change its value. It also handles joining players, so if you call publicVariable, and someone joins after that, they'll get the most recent broadcast value

dry egret
#
_Raider_1 = [];
_extractChopper_1 = [];

if (isServer) then {
    _Raider_1 = createGroup WEST;
    _extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;

    extractChopperGlobal = _extractChopper_1 select 0;
    publicVariable "extractChopperGlobal";

//Extraction Waypoints

    _wp = _Raider_1 addWaypoint [wp_POS, 0];
    _wp setWaypointType 'MOVE';
    _wp setWaypointSpeed "FULL";

    _wp1 = _Raider_1 addWaypoint [position ab1, 1];
    [_Raider_1, 2] waypointAttachVehicle vehicle ab1;
    _wp1 setWaypointType 'MOVE';
    _wp1 setWaypointSpeed "FULL";


};
_car = extractChopperGlobal;

like this

compact galleon
#

yes. not sure what BIS_fnc_spawnVehicle returns, since I've never used it. But if it's an array with the first element being the chopper, then yes

dry egret
#

yep thats what it does

#

the mission is does not support JIP < not a badass at arma scriping

#

lol

#

single mission no respawn 3 revives

compact galleon
#

@dry egret Here's an example where the server decides when enemies will arrive, and then informs all clients about it.
init.sqf (executed on all machines when the mission starts):

if (isServer) then
{
    // Decide a random time enemies will arrive at.
    TimeEnemiesWillArrive = 60 + random 300;
    
    // Tell clients which time was chosen.
    publicVariable "TimeEnemiesWillArrive";
}
else
{
    // Wait for the server to tell us at which time enemies will arrive.
    while { isNil "TimeEnemiesWillArrive" } do
    {
        sleep 0.1;
    };
};

// Executed on both server and clients.
hint format ["Warning! Enemies will arrive in %1 seconds!", TimeEnemiesWillArrive];
subtle ore
#

hello, I had a quick question. I'm trying to pull an array of just rifles from the CfgWeapons. I've tried using CfgClasses in combo with InheritsFrom . But it always returns a blank array. Any ideas?

plush cargo
#

(configFile >> "CfgWeapons" >> weaponClassname >> type)

#

primaries are 1

#

if (!isClass (_weap >> "LinkedItems")) then
{
if (count(getarray (_weap >> "magazines")) !=0 ) then
{

#

if no linked weapons is a base weapon(no attachments) no magazines will stop vehicle weapons from showing

subtle ore
#

What about looking for a rifle base specifically?

#

what's weaponClassName pointing to exactly?

plush cargo
#

thats the config location you need to get the weapons class name in there some how

subtle ore
#

Jeez man, I don't know. I was hoping to streamline it a bit. I want to be able to find every config entry that is a rifle.

plush cargo
#

figured that, was just giving you what to filter for when doing it

subtle ore
#

You should be able to do that with configClasses . I'm just not sure as to why not. But I guess that works.

plush cargo
#

you can give me a minute

#
 _baseRifles = "((configName (_x)) isKindof ['Rifle', configFile >> 'cfgWeapons']) &&  // is rifle
                (!isClass (_x >> 'LinkedItems')) && // does not have attached items
                (getnumber (_x>> 'scope') == 2)"  // is accessible
                configClasses (configFile >> "cfgWeapons"); 
 _weapNames = [];
 {
    _name = (getText( _x >> "displayName"));
    _weapNames pushBack _name;
 }forEach _baseRifles;
 hint format ["%1",_weapNames];
subtle ore
#

I thought isKindOf only applied to vehicles, and such?

plush cargo
#

anything with a parent cfg i guess

subtle ore
#

I appreciate the guidance, I'm starting to get on track now. Thanks.

#

Ah yes, now every damn rifle is there. Sweet! ๐Ÿ˜„

plush cargo
#

np

compact galleon
#

I fucking hate how they removed the delay from AI commanding

subtle ore
#

huh?

compact galleon
#

It was so awesome in previous arma games to yell "FIRE!" to your AI gunner, and then see him fire a missile

#

Now, he fires at the same time you start yelling FIRE, so it sounds like you're dictating what he's doing instead of commanding him

#

Especially with AT or AA units, you give them a target, and then when you yell FIRE, they fire before you barely start saying it, and the boom from the missiles firing are so loud you can barely even hear you say it

#

It's just so dissatisfying

subtle ore
#

I would imagine so.

compact galleon
#

It'll still delay if you select everyone, though.

nocturne iron
#

does anyone know how to find the gear up/down anims in config?

#

trying to force gear down for vehicles respawning on a carrier

dry egret
#

Yay, bug free now lol

nocturne iron
#
_class = typeOf _veh;
_pos = getPos _veh;
_dir = getDir _veh;
_veh setVariable ["RespawnInformation",[_class,_pos,_dir],true];

_veh addEventHandler ["Killed", {

    _veh = _this select 0;
    _array = _veh getVariable "RespawnInformation";
    _class = _array select 0;
    _pos = _array select 1;
    _dir = _array select 2;
    
    _newVeh = _class createVehicle _pos;
    _newVeh setDir _dir;
    hint "New vehicle deployed";
    
    _delay = [_veh] spawn {
        
        _veh = _this select 0;
        
        waitUntil {((getPos _veh) select 2) < 5};
        
        sleep 5;
        
        deleteVehicle _veh;
    
    };
    
    _recall = [_newVeh] call fnc_respawn_veh;

}];``` any insights as to why this isn't working?
nocturne iron
#

seems the variable isn't being set

nocturne iron
#

tested the createVehicle section, and for some reason it's not working with the CUP harrier

little eagle
#

killed eventhandler only runs on the machine, where the killed vehicle is local.

nocturne iron
#

it's being called serverside

meager granite
#

Why is Draw3D sets _this to "nothing" and since when it has been happening? ๐Ÿค”

little eagle
#

No parameters to pass in that eventhandler

#

Same for onEachFrame

#

Probably since draw3D exists.

meager granite
#

Indeed, it does it even in Alpha 0.50

#

Never noticed it before

thin pine
#

You never noticed that draw3d has no parameters?

meager granite
#

it does

#

Its "nothing"

jade abyss
#

Don't mix draw3D with drawIcon3D ๐Ÿ˜„

meager granite
#

Literally string "nothing" gets passed as _this

snow raft
#

setTriggerActivation takes only one string?

nocturne iron
#

That's some troll level shit from draw3D

little eagle
#

Literally string "nothing" gets passed as _this

#

Oh, wow

#

So not
_this = nil
but
_this = "nothing"
?

#

Hey, what should Draw3D pass as arguments?

#

Nothing.

#

Alright.

meager granite
#

yes, string of "nothing"

#

Oh wait, its not string, its nothing datatype

#

typeName _this => "NOTHING"
str _this => "nothing"

#

I wonder if this is the only place where you can get this data type

#

You can't compare it with ==

#

isEqualTo returns false

#

against itself, same variable even

jade abyss
#

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

little eagle
#

I think that's the nil with data type pointing to void.

#

instead of GameValueNil

meager granite
#

looks to be separate data type

#

anyway, very interesting oddity

little eagle
#

isNil "_this"
should report true

little eagle
#

Good.

meager granite
#

nope, isNil returns false

little eagle
#

Another value that was previously config only that can now be set by script:

        class UserActions {
            class Rope_show {
                displayName = "$STR_BWA3_Rope_show";
                onlyforplayer = 1;
                position = "rope_control";
                radius = 2;
                showWindow = 0;
                condition = "this animationPhase ""hide_rope"" > 0.5 and player == cameraOn";
                statement = "this animate [""hide_rope"", 0]; playSound3D [""A3\sounds_f\characters\stances\lift_handgun.wss"", objNull, false, AGLToASL (this modelToWorld (this selectionPosition ""rope_control"")), 0.50118721, 1, 20];";
            };
#

position =

#

What about:
isNil {_this select 0};

#

?

#

CfgVehicles

#

Inside the vehicles

meager granite
#

Its not array, _this is nothing

little eagle
#

transferred to the server and become visible to everyone

#

does not apply to #lighpoint and stuff like that

nocturne iron
#

There's an eh for disconnect right?

plucky beacon
#

Are 3rd persom camera positions config based?

little eagle
#

No, it's the "camera" selection in the soldier model

#

it's somewhere above the head

#

memory LOD

meager granite
#

transferred to the server and become visible to everyone
what?

#

Can't be

jade abyss
#

Erm, yeah. Its local, so no data on the Server. So it doesn't "appear" out of nowhere

meager granite
#

Are 3rd persom camera positions config based?
Config array of extCameraPosition

#

Center might be defined in model though

#

@plucky beacon

plucky beacon
#

Dang, i wamted to see about getting a fixed 3rd person camera on jets

late gull
#

hi there, any one can help me to understand why the dam AI is not jumping(parachuting) out from vehicle?

waitUntil { _veh distance _position < 400 };
private _count = 1;
{
    unassignVehicle _x;
    _x action ["Eject", (vehicle _x)];
    [_x] allowGetIn false;
    hint str _count;
    _count = _count + 1;
    sleep 1;
} forEach units _grp;
#

instead of parachuting the choper/plane is landing

plucky beacon
#

does it work without the waituntil?

late gull
#

it worsk good, it show me how many times is executed with the _count

plucky beacon
#

I know arma's AI like to request leaving a vehicle which is probably why it's landing

#

They don't like to be forced out of anything without being on the ground

late gull
#

if i do the same with crew they jump, why not happening with cargo?

plucky beacon
#

Any answer I have to that won't be helpful

late gull
#

;p

#

is making me crazy

#

umm, maybe they dont like jump without parachute, will try :p

#

YES! they jump out with parachute xD

little eagle
#

lol, did you try to kill them?

late gull
#

jaja, i guess they get parachute :p

plucky beacon
#

I still think it's weird they wouldn't follow commands to eject

late gull
#

they do, they ask pilot for land xD

plucky beacon
#

technically i guess

tough abyss
#

(To the CBA folks) I'm trying to add an addAction in XEH_postInit.sqf, it's not working. What am I doing wrong? ```SQF
#include "script_component.hpp"

player addAction ["<t color='#228B25'>Debug Menu</t>", QFUNC(openDebugMenu)];

plucky beacon
#

Is postinit local? I never knew

little eagle
#

every machine

#

@tough abyss
Add

diag_log [player, QFUNC(openDebugMenu)];

And check RPT what it writes.

tough abyss
#

Is this what you were asking for, @little eagle? ```SQF
19:13:48 [0,40.931,0,"XEH: PreStart started."]
19:13:49 [0,41.361,0,"XEH: PreStart finished."]
19:13:52 SimulWeather - Cloud Renderer - noise texture file is not specified!
19:13:56 SimulWeather - Cloud Renderer - noise texture file is not specified!
19:14:03 Loading movesType CfgGesturesMale
19:14:03 Creating action map cache
19:14:03 MovesType CfgGesturesMale load time 540 ms
19:14:03 Loading movesType CfgMovesMaleSdr
19:14:04 Creating action map cache
19:14:19 MovesType CfgMovesMaleSdr load time 15695 ms
19:14:49 Starting mission:
19:14:49 Mission file:
19:14:49 Mission world: VR
19:14:49 Mission directory:
19:14:53 Attempt to override final function - bis_functions_list
19:14:53 Attempt to override final function - bis_functions_listpreinit
19:14:53 Attempt to override final function - bis_functions_listpostinit
19:14:53 Attempt to override final function - bis_functions_listrecompile
19:14:54 Attempt to override final function - bis_fnc_missiontaskslocal
19:14:54 Attempt to override final function - bis_fnc_missionconversationslocal
19:14:54 Attempt to override final function - bis_fnc_missionflow
19:14:54 [2438,106.509,0,"XEH: PreInit started. v3.2.1.170227"]
19:14:54 [2438,107.109,0,"XEH: PreInit finished."]
19:14:56 [2440,108.63,0,"XEH: PostInit started. MISSIONINIT: missionName=, missionVersion=12, worldName=VR, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
19:14:56 [2440,108.677,0,"CBA_VERSIONING: cba=3.2.1.170227, "]
19:14:56 [2440,108.684,0,"XEH: PostInit finished."]

little eagle
#

Doesn't look like your script was executed at all. Did you add it to the config?

tough abyss
#

Config: ```hpp
#include "script_component.hpp"

class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
author = "Neviothr";
requiredAddons[] = {"3den"};
};
};

#include "CfgNotifications.hpp"
#include "BaseDefines.hpp"
#include "DebugMenu.hpp"

little eagle
#
class Extended_PostInit_EventHandlers {
    class ADDON {
        init = QUOTE(call COMPILE_FILE(XEH_postInit));
    };
};
tough abyss
#

Crap, I forgot to #include CfgEventHandlers.hpp.

#

Thanks.

little eagle
#

lol

#

btw., if you already set up all the #includes, you should probably switch to TRACE_N / WARNING / ERROR / LOG etc. for debugging instead of diag_log

tough abyss
#

I'm just converting an existing addon of mine into, I guess, "CBA standards". So everything works, it's just a matter of moving stuff correctly. ๐Ÿ˜›

little eagle
#

It's a pain to set up, but a bliss to work with.

tough abyss
#

I sure as hell hopes so ๐Ÿ˜„

#

Needs a convert.py.

plucky beacon
#

isn't there a script that you can press a thing to ragdol

#

it does something with setvelocity

nocturne bluff
#

In mine I gave them dead animation and disable input or something

little eagle
#

Display with mouse which also blacks out the screen since I removed the black overlay from vanilla while unconscious (ugly)

#

Just need to remember to block the ESC with a keyhandler... I bring up a copy of the pause menu.

plucky beacon
#

Does anyone remember when Apex came out and Ace unconcious made characters ragdoll instaed of awkwardly flops into a static pose on the ground?

#

but way less interesting, immersive, or fun

#

best performance is vanilla

#

for the short time the bug was present I remember one guy getting knocked unconcious and falling off a balcony breaking his neck

#

it was fuckign incredible

#

inefficient code?

#

I know, basically I'm saying I want it back

#

#ragdollsMatter

#

It's also incredibly immersive to breach a building and get knocked on your back by a bullet

#

I wish it did that in vanilla

#

high enough caliber and Ace will do that too, I think if you adjust the damage coefficients

little eagle
#

@tough abyss It's not a matter of efficiency. There was no other way before setUnconscious.

#

And it still is like this, because the ACE Medical rewrite isn't finished.

plucky beacon
#

oh it's being rewritten?

little eagle
#

You forget that we make an addon and no mission. The mission can have respawn timers of any value.

plucky beacon
#

So I'm guessing the rewrite will include this new feature or as an option?

little eagle
#

It's being rewritten for over a year now.

#

No, it will always use the ragdoll effect. No option.

plucky beacon
#

it's that unpredictable?

little eagle
#

?

plucky beacon
#

oh read that wrong

little eagle
#

It works pretty nice.

plucky beacon
#

okay I understand now

#

I would say I would help but I don't know what I'm doing xD

little eagle
#

I don't even know what's missing at this point.

#

I did a whole lot of the low level internals, but that has been months.

#

I was pretty ... busy during last fall.

#

But not much happening since last summer anyway.

#

It's open source. It's just that there were that many scripters in milsim and now Arma 3 is old.

#

And Im still working on that CBA settings system.

plucky beacon
#

Do you need some larger scale testing of the new ace medical?

little eagle
#

It's weird. I wanted that to be simple and easy to use, but many people want all kinds of features and now the ui looks bloated to me.

plucky beacon
#

The hardest part is to stop making features xD

little eagle
#

Don't ask me, I'm not in the loop.

#

The hardest part is working yourself through the spaghetti code.

plucky beacon
#

I'm trying to do better at commenting my work myself

#

so other people could potentially use it

little eagle
#

I wish I owned fraps so I could make jpg's.

plucky beacon
#

I can convert it for you

#

lol

#

or using paint

little eagle
plucky beacon
#

there we go

little eagle
#

Is it just me or does this look bloated?

plucky beacon
#

the checkbox ruins the balance

#

put that at the bottom

#

it's actually a good question, what is the test checkbox for?

little eagle
#

It's not a matter of order. I can add these settings dynamically

plucky beacon
#

I think if you put enough spacing in between settings you could make it pretty long

little eagle
#
#ifdef DEBUG_MODE_FULL
["Test_Setting_1", "CHECKBOX", ["-test checkbox-", "-tooltip-"], "My Category", true] call cba_settings_fnc_init;
["Test_Setting_2", "LIST",     ["-test list-",     "-tooltip-"], "My Category", [[1,0], ["enabled","disabled"], 1]] call cba_settings_fnc_init;
["Test_Setting_3", "SLIDER",   ["-test slider-",   "-tooltip-"], "My Category", [0, 10, 5, 0]] call cba_settings_fnc_init;
["Test_Setting_4", "COLOR",    ["-test color-",    "-tooltip-"], "My Category", [1,1,0], false, {diag_log text format ["Color Setting Changed: %1", _this];}] call cba_settings_fnc_init;
#endif
plucky beacon
#

and subtitles

#

or what's it called

#

headers

little eagle
#

I wonder if I could get rid of the checkmark / cross by colorising the "medium" or "high" in green or red.

#

Can you change the color of listboxes?

#

The color of the text I mean.

#

let's try I guess.

plucky beacon
#

if you can change it in buttons you can probably change it in listboxes

little eagle
plucky beacon
#

look at you

#

nailed it

little eagle
#

hmm, I need to dynamically change this. What a pain in the ass.

vital onyx
#

Question:
I can modify dialogs defined in dscription.ext using ctrlCreate, but if a dialog is defined in config class - it does not work (even if dialog from description.ext is 100% equal to the one from config)
Is there a property which should be defined in config for dialog class to create new controls for it?

plucky beacon
#

I always use defines.hpp

#

and include it in description.ext

vital onyx
#

yes, I do as well, but I want dynamic dialog and create controls with the script

plucky beacon
#

dynamic diolags how so? you mean using ctrlsettext and stuff?

vital onyx
#

no, using ctrlCreate

#

you make and empty dialog and fill it with control dynamically

plucky beacon
#

oh I see

#

never mess with that so good luck

vital onyx
#

ready figured it out, I need to wait till display inits, I was getting displayNull

plucky beacon
#

ahh putting a good old waituntil

vital onyx
#

no

#

I do not like waituntils :)

plucky beacon
#

well what dafuqdidudo

vital onyx
#

waitUntil may behave weirdly in unscheduled environment

plucky beacon
#

oooh it's unscheduled

#

weirdly? I'm pretty sure it just fails

little eagle
#

It errors out

plucky beacon
#

Whenever I put a waituntil in a function it...

#

that

#

I guess that's the terminology

#

you can't suspend commands in a unscheduled?

#

That's what I thought

#

maybe I didn't use parenthesis

little eagle
#
isNil {
    waitUntil {true};
    systemChat str 1;
};
#

this works apparently

#

isNil is to ensure unscheduled environment

#

That is not unscheduled environment necessarily

#
0 spawn {
    call {
        systemChat str canSuspend;
    };
};
#

true

#
0 spawn {
    isNil {
        systemChat str canSuspend;
    };
};
#

false

#

I guess waitUntil can be used in unscheduled without error as long as it reports true the first try.

#

Which means it does nothing in that case.

#

The script that runs from addAction is scheduled.

#

Maybe you're thinking of that

plucky beacon
#

lol

little eagle
#
isNil {
    waitUntil {random 2 < 1};
    systemChat str 1;
};

50% error

#

QS, the condition runs unscheduled and the action runs scheduled

#

just to fuck with ya

#

literally

#

KK uses isNil to enforce unscheduled environment in his new Utilities stuff.

#

So I guess it's official API now.

#
    isNil // visual bug workaround
    {
        _checkbox = [_functionDisplay, "RscCheckBox", ["","",0], [0.27,_nextItemY,_chkX,0.03], [1,1,1,1], [1,1,1,1], str _date, true, _ctrlGroup] call _fnc_addControl;
        _checkbox setVariable ["_date", _date];
        _checkbox ctrlSetEventHandler ["CheckedChanged", "
vital onyx
#

Nice info @little eagle

#

instead of waitUntil {!(isNull _display)} I ended with storing display id in uiNamespace from onLoad event, and then call the required controls creation from the same onLoad EH attached to dialog or display

little eagle
#

That is definitely the way to go since that works better with savegames and all that.

plucky beacon
#

Oh that reminds me I figured out my problem with the mission failing even after resetting the mission.

#

When the timer was over it remotely executed to -2 (allplayers) to run the mission failure sequence. I looked at my other mission failure scripts and saw they all remotely executed to all machines (0) so basically the missions was repeatedly ending because the server itself didn't end the mission

#

silly me

vital onyx
#

Another question, setting a "KeyDown" EH to a control, everything working fine besides one thing: I cannot override the KeyDown event, regardless wether EH code returns true or false - keyDown is not overridden as expetced

#

is not it supported for controls?

little eagle
#

only display can have keyDown

vital onyx
#

controls have to, and it works

#

dialog controls I mean

little eagle
#

same thing

#

maybe overwrite only works for display

vital onyx
#

seems so

little eagle
#

kinda like how the return value of the config version of handleDamage is ignored

vital onyx
#

weird, I am trying to limit the number of symbols user can enter to the editbox

#

any ideas?

little eagle
#

just use ctrlSetText on the edit box and remove the last char if it was illegal

plucky beacon
#

illegal

#

I think you mean deport

vital onyx
#

not very beautiful of course, but seems no other options

little eagle
#

It's very beautiful

vital onyx
#

overriding keyDown event would be more neat but ok, gentlemen do not argue about personal preferences ;)

plucky beacon
#

_

|==My joke ==>


^everyone's head

little eagle
#
// keyDown
params ["_control"];

private _string = ctrlText _control;

if ((_string select [count _string - 1]) in ILLEGAL_CHARS) then {
    _control ctrlSetText (_string select [0, count _string - 2]);
};
#

beautiful and simple

vital onyx
#
if ((count ctrlText _editbox) > 100) then
    {
            ...
        _editbox ctrlSetText (_text select [0,100]);
    }
#

yes, looks ok, thanks @little eagle

little eagle
#

You can probably abuse ctrl + v though. Not sure.

vital onyx
#

let me try

#

@little eagle o protect from ctrl + V just add keyUp event with same cleanup routine

#

works like a charm

#

just tested

little eagle
#
// keyDown
params ["_control"];

_control ctrlSetText (ctrlText _control splitString "@/ยง%" joinString "");
vital onyx
#

I do not need a filter

little eagle
#

@/ยง% being the illegal chars in one string

vital onyx
#

It is a feedback ingame form, user can put anything but limited to number of symbols

little eagle
#

Oh, like only 100 characters

vital onyx
#

it was just a test

#

300-400 should be enough

#

100 was for test

little eagle
#

ctrlSetText on the edit box is the solution

vital onyx
#

I guess for mission it is much better, that user suggests something ingame rather than go to forum, register login, find the right thread etc

#

@little eagle I ended up with it, thanks again

#

there is on one problem with it

#

count "Test" (english letters) returns 4
count "ะขะตัั‚" - russian letters, returns 8

#

so we should count not string directly, but do count toArray _string, then it works ok

little eagle
#

kyrillic

vital onyx
#

yeah

little eagle
#

It's because of UTF8 or something

vital onyx
#

toArray makes the trick

little eagle
#

count "รค"
2

#

count "รŸ"
3

vital onyx
#

"ั‚ะตัั‚" select [0,2]
returns only first letter

#

crap

#

more work todo

plucky beacon
#

For the first time since I started I can say that there are no current bugs in my projects. At least until I do testing with a larger group.

subtle ore
#

keeps throwing me a error "undefined variable _listing"

#

or it just wont work at all, it's random.

plucky beacon
#

you in game right now?

#

if you are go to function viewer and find that function, find out what _listing is trying to get

subtle ore
#

Yes, okay. Will do.

#

if !(uiNamespace getVariable ["BIS_RscRespawnControlsSpectate_shown", false]) then { switch true do { case (_list == BIS_RscRespawnControlsMap_ctrlLocList): {_array = BIS_RscRespawnControls_positionDisabled}; case (_list == BIS_RscRespawnControlsMap_ctrlRoleList): {_array = BIS_RscRespawnControls_roleDisabled}; case (_list == BIS_RscRespawnControlsMap_ctrlComboLoadout): {_array = BIS_RscRespawnControls_loadoutDisabled}; };

#

looks like this is the culperate

#

the uiControl is defined, (uiNamespace getVariable "BIS_RscRespawnControlsMap_CtrlRoleList" in the params

plucky beacon
#

yessssssss

plush cargo
#

not sure if this is intentional or not but using flagtexture
set it setFlagTexture '\ART\ART_Flags\Data\Flag_red_CO.paa';
but when retrieving with flagTexture the name comes back with no cap (art\art_flags\data\flag_red_co.paa)
the flags are in game magazines as well , sharing the same texture so when removing a flag from a pole I want to get the flags texture and use configclasses to find the right flag item and add to inventory
any ideas?

#

commands find and in are case sensitive

stray kindle
plucky beacon
#

Aaye case sensitive

plush cargo
#

ty

plush cargo
#

How can I turn this

_flag addAction ["<img image = '\ART\ART_Flags\Data\Flag_red_CO.paa'/>",

into this

_flag addAction ["<img image = _texture/>",
thick oar
#

use either format or string addition.

#

_flag addAction [format ["<img image = '%1'/>", _texture],

plush cargo
#

thanks ๐Ÿ˜ƒ

#

thought i tried that dont think i had the quotes here '%1' was messing with it forever

thick oar
#

Yep, Its easy to forget about these when formatting strings within strings using format

little eagle
#

I just do:

_flag addAction [format ["<img image = %1/>", str _texture],

Usually

vital onyx
#

afair setFlagTexture works only on server, not sure it will work via addAction

little eagle
#

Since the code block of addAction is executed on the client that used the action and the flag as neutral map object is most likely local to the server, I'd say you need to use remoteExec if you want to get it to work in MP.

nocturne iron
#

Oof getCursorObjectParams looks damn powerful

plush cargo
vague hull
#

is there a way to trigger HandleDamage or handleHit by setDamage/setHit (or any other damage changing command)?

little eagle
#

No.

polar folio
#

anyone ever used BIS_fnc_lerp? i want to lerp 1 to -1 over a course of 10 seconds. i would i do that?

plucky beacon
#

the heck is lerp

polar folio
#

change one value to another over time. got it working. was jsut a brain fart on my side

plucky beacon
#

function not in wiki, rip

plush cargo
#
/*
    Author: Nelson Duarte

    Description:
    Linear floating point interpolation

    Parameters:
    _this: ARRAY
        0: Value A
        1: Value B
        2: Interpolation speed
        3: Delta time
    Returns:
    NUMBER
*/
params [["_a", 0.0, [0.0]], ["_b", 0.0, [0.0]], ["_speed", 1.0, [0.0]], ["_deltaTime", 0.0, [0.0]]];

private "_result";
_result = 0.0;

if (_a != _b) then
{
    _result = (_a * (1.0 - _deltaTime * _speed)) + (_b * _deltaTime * _speed);
};

_result;
#

bis_fnc_lerp

meager granite
#

linearConversion [0, 10, _time, -1, 1]

little eagle
#

I think you have to switch around -1 and 1.

meager granite
#

oh yeah

#

still you can do that with one command very easily

polar folio
#

can you explain eahc parameter. i have a nice function that uses it but i don't fully understand how to set speed and stuff

#

mainly last two params

meager granite
polar folio
#

oh

meager granite
#

when _time is 0, result will be -1, when time is 10, result will be 1

#

in my example

polar folio
#

might aswell use that

queen cargo
barren magnet
#

lovely @queen cargo

tough abyss
#

@queen cargo amazing work

plucky beacon
#

I saw a video of this a couple days ago doing something on Tanoa

#

Is there scripts out there for TFAR radio jammers?

still forum
#

I'm sure there is a script for TFAR radio jammers somewhere ๐Ÿ˜„ But I don't know where. Could ask in TFAR discord.

plucky beacon
#

I wanna be all dramatic in a mission where everything goes kkkkk kshhhhhhh

#

watching your goofy video of driving cars off ramps

still forum
#

you can set the receiving distance down.. That would make most stuff go kkkkk ksshhhhhh Unless you are that far away that you don't receive anything anymore

plucky beacon
#

same effect is fine

tough abyss
#

Damn, @queen cargo. That's nice.

plucky beacon
#

You know what a useful tool would be, some way of seeing players client fps to know who's suffering

#

because most people are usually fine but one guy gets the short straw and can't handle particles or something

thin pine
#

Ya could run a script on each client broadcasting diag_fps to the server periodically. Then have the server send that data to the server admin/zeus that requires it.

plucky beacon
#

that's what I was thinking

#
[] spawn {
   while {true} do
    {
        uiSleep 5;
        _fps = diag_fps;
        _fpsString = str _fps;
        [_fpsString] *remote exec something something to zeus that displays 3d text over the players head*
    }
}
little eagle
#

just setVariable public the fps on the player object

#

Draw3D eventhandler on the zeus machine that iterates over allPlayers and reads the fps with getVariable

#

uiSleep is pointless in MP btw.

#

You cannot suspend the mission anyway

#

or slow down / speed up

#

for obvious reasons

plucky beacon
#

rip slow motion missions

#

If someone is having framerate stuttering though would their simulation be running slower?

little eagle
#

Yeah, but uiSleep would still be the same

#

uiSleep is exactly the same as sleep, but not affected by pausing the game

plucky beacon
#

oh

#

hm

little eagle
#

Since you cannot pause the game in MP (pressing esc let's it still run), it makes no difference.

#

The only thing you do by using uiSleep is confuse others and yourself and maybe imply things that aren't true.

plucky beacon
#

should it set variable public before the loop?

#

or is it like "publicVariable"

little eagle
#

makes no difference, except for the first 5 seconds of the mission I guess.

#

I just think that there is no reason to "remoteExec" anything.

#

It's 2 scripts supplying each other with information via setVar and getVar

#

One script to constantly update the fps and synch it with everyone else

plucky beacon
#

just working with what I know, never used setvariable

little eagle
#

And one to draw the values each render frame with whatever magic you choose.

plucky beacon
#

I know I at least to do it in missionnamespace

#

can you set local variables public?

jade abyss
#

_Var = No

#

but:
var = _Var;

#

๐Ÿ˜„

little eagle
#
[] spawn {
   while {true} do {
        sleep 5;
        player setVariable ["my_fps", floor diag_fps, true];
    };
};
plucky beacon
#

pfft

jade abyss
#

unless you wanna do it with setVariable

#
player setVariable ["Var", _var, true];```
plucky beacon
#

lol

#

just a second too late bud

little eagle
#

Then on the zeus machine;

{
    _x getVariable "my_fps";
} forEach allPlayers;
jade abyss
#

yerp

tough abyss
#

What's the differance between remoteExec and remoteExecCall?

plucky beacon
#

Call is for functions

#

bis_fnc_blahblah

tough abyss
#

Hmm, alright. Thank you.

indigo snow
#

It's more that remoteExec spawns in the scheduled environment, and remoteExecCall in the unscheduled.

#

So for executing a function like spawn where sleep etc is needed youd use remoteExec, and remoteExecCall for the other ones

little eagle
#

remoteExecCall is pointless for commands and only really useful for functions.

plucky beacon
#

I'm not at a computer that can run Arma right now so just sorta writing this on a whim

{
  ["uniqueID", "Draw3D", 
  {
    if (my_fps<20) then {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
            [1,1,1,0.5],
            getPos _x,
            1,
            1,
            0,
            parseText format["<t size='1.25' font='PuristaLight' color='#ff0000'>FPS: %1</t>", my_fps]
        ];
    }
    else
    {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
            [1,1,1,0.5],
            getPos _x,
            1,
            1,
            0,
            parseText format["<t size='1.25' font='PuristaLight' color='#0004ff'>FPS: %1</t>", my_fps]
        ];
    };
   }] call BIS_fnc_addStackedEventHandler;
}forEach allPlayers;
#

That's my guess at least

little eagle
#

draw3d and not eachframe to remove the stuttering

#

also, use one eachframe handler and that iterates over allPlayers

plucky beacon
#

uhmm

#

okay

#

wouldn't that just be over the whole thing?

#
onEachFrame {
      ...all the stuff in here
};

?

plucky beacon
#

it just says eachframe is a stackable version of oneachFrame

little eagle
#

Yea and that you ruin everything by using onEachFrame command

plucky beacon
#

oh, that's what I originally had

#

it was a stacked handler

little eagle
#
addMissionEventHandler ["EachFrame", {

}];
#

so much nicer

plucky beacon
#

oh

little eagle
#

Not EachFrame

plucky beacon
#

I think I follow now

#
{
addMissionEventHandler ["Draw3D", {
    if (my_fps<20) then {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
            [1,1,1,0.5],
            getPos player,
            1,
            1,
            0,
            parseText format["<t font='PuristaLight' color='#ff0000'>FPS: %1</t>", my_fps]
        ];
    }
    else
    {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
            [1,1,1,0.5],
            getPos player,
            1,
            1,
            0,
            parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", my_fps]
        ];
    };
}];
} forEach allPlayers;
#

I know it's missing the allPlayers, I'm reading back what you said

#

there

little eagle
#

nah

#

the amount of allPlayers changes all the time in a MP session.

#

So just have one draw3d handler that iterates over the allPlayers

jade abyss
#

btw. wasn't draw3D the better solution, instead of onEachFrame?

little eagle
#

Sure, that's what we're using now.

plucky beacon
#

ye

little eagle
#

yee

still forum
#

this would print (count allPlayers) times for only the local player (getPos player) . and my_fps is undefined (diag_fps)

little eagle
#

WIP

jade abyss
#

kk, missed then.

plucky beacon
#

I guess I'm just unaware of how drawIcon3d works

#

I got mixed up between the each frame and draw3d so I was still thinking "wouldn't want to check allplayers on eahc frame, that'd be awful"

jade abyss
#

btw. that might be easier to handle: (no stackedEH needed)

MyTag_MyName = addMissionEventHandler
["Draw3D",
    {
        hintsilent format["TickTime:\n%1",diag_TickTime];
    }
];```

To remove:
```sqf
removeMissionEventHandler ["Draw3D", MyTag_MyName];```
#

Don't mix draw3D and DrawIcon3D! They are not the same ๐Ÿ˜„

plucky beacon
#

I thought that's what was going on dscha?

still forum
#
addMissionEventHandler ["Draw3D", {
{
    _playerFPS = _x getVariable ["playerFPS",50];
    if (_playerFPS  <20) then {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
            [1,1,1,0.5],
            getPos _x,
            1,
            1,
            0,
            parseText format["<t font='PuristaLight' color='#ff0000'>FPS: %1</t>", _playerFPS]
        ];
    }
    else
    {
        drawIcon3D
        [
            "\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
            [1,1,1,0.5],
            getPos _x,
            1,
            1,
            0,
            parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", _playerFPS]
        ];
    };
} forEach allPlayers;
}];

that plus a script that runs on every player that sets (player setVariable ["playerFPS",diag_fps]) every few seconds

plucky beacon
#

what's that 50 do?

jade abyss
#

StandardValue

plucky beacon
#

oh

jade abyss
#

If no Var set -> use that (50 in this case)

plucky beacon
#

well wouldn't I want 0 if it can't find it?

#

just a thought

jade abyss
#

You can dooo what you want

still forum
#

That would always show that the player has bad FPS. which I'd call unusual. but whatever

plucky beacon
#

I can do anything Dscha?

jade abyss
#

I haven't said that.

plucky beacon
#

damn

#

worht a shot

#

Thanks dedmen

#

So why would it always show bad fps?

little eagle
#

-1

#

or "?"

plucky beacon
#

so this would be on players

[] spawn {
   while {true} do {
        sleep 5;
        player setVariable ["playerFPS", floor diag_fps, true];
    };
};
#

proably initlocal

little eagle
#

Use tags for global variables like this

jade abyss
#

initPlayerLocal.sqf yeah

little eagle
#

I can see BI eventually adding a command named playerFPS and then your stuff errors out, because you didn't do good work.

#

global variable -> tag

jade abyss
#

like: DNI_PlayerFPS

plucky beacon
#

Watch me just start replacing all my variables with DNI_...

#

which I probably should if they're not local

#

Allcurators says it returns a list of curators, but does it return the curator module owners or the modules.

still forum
#

the modules

#

BIS_fnc_listCuratorPlayers returns the players

plucky beacon
#

So

if (player in (bis_fnc_listcuratorplayers) then {stuff?}
still forum
#

uhh yeah

#

But that only works after curators are initialized

#
waitUntil {
    private _hasCurators = (count allcurators) > 0;
    private _hasInitializedCurators = (count (call BIS_fnc_listCuratorPlayers)) > 0;
    private _curatorsInitialized = !_hasCurators || _hasInitializedCurators;
    ((time > 2) || _curatorsInitialized)
    }
plucky beacon
#

Rip

plucky beacon
#

Never heard of doing so

queen cargo
#

@tough abyss isnt the sun just skybox?

#

because if it was, just take the vector and lengthen it by smthng like 20000000000

plucky beacon
#
16:25:48   Error Type Text, expected String
16:25:48 Error in expression <S: %1</t>", str _playerFPS]
];
}
else
{
drawIcon3D
[
"",
[1,1,1,0.5],
getPos _x,>
16:25:48   Error position: <drawIcon3D
[
"",
[1,1,1,0.5],
getPos _x,>

wow that's a lot of shit broken

queen cargo
#

gives you a pretty decent position of it

#

as said: lengthen the vector

#

0 is your current player

#

ohh ... ye.

#

did not slept much ๐Ÿ™ˆ but think it was possible either via command or via config

plucky beacon
#

what the heck is Type Text, expected string. I thought string was text.

#

ye

#

parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", str _playerFPS]

still forum
#

parsetext returns Text. Text is formatted text like you use in diary entries and stuff

#

Text != string

plucky beacon
#

so do i need to str?

indigo snow
plucky beacon
#

str did it, thanks dedmen

indigo snow
#

I suspect it would be accurate enough for a shadow guess

plucky beacon
#

is there a way to make 3dtext dissapear when you're far enough away?

#

or should I say, how difficult is that

still forum
#

the icons? Add a player distance _x check

plucky beacon
#

ya the icons

#

does that work with zeus cameras?

still forum
#

Don't think so

plucky beacon
#

damn

#

that's what I neeed

still forum
#

if (!isNull (findDisplay 312)) then (curatorCamera distance _x) else (player distance _x)

plucky beacon
#

why parenthesis?

#

don't you use squiggly biggly brackets?

still forum
#

cuz pseudosqf ๐Ÿ˜„

plucky beacon
#

lol okay just checking

compact galleon
#

Just because I'm bored. This gotta confuse people just starting out at scripting:

_if = [if call { alive player }];
_codes = { "alive" } else { "dead" };
hint ("You're " + (_if select 0 then (call ({} else {_codes} select 1))) + "!");```
plucky beacon
#

lol what's his?

#

just says if you're alive or dead

slim apex
#

But a very complex way of doing it ๐Ÿ˜›

plucky beacon
#

damn right about that

#
if(alive player) then {
hint "you're alive";
} else {
hint "you're dead";
};
dusk sage
#

another way of showing how you can abuse SQF

slim apex
#

In a very aids way xD

little eagle
#
hint (["you're dead", "you're alive"] select alive player);
plucky beacon
#

I knew commy would come and make better code xD

dusk sage
#

Better is subjective

#

๐Ÿ˜›

little eagle
#

It's probably harder to comprehend for a beginner.

slim apex
#

Better = make me ashamed to call myself a "Developer", and making me re-learn the code from scratch xD

plucky beacon
#

Subjective objective

dusk sage
#

You shouldn't be writing convoluted code

#

Don't think you need to relearn to be able to write it

#

๐Ÿ˜›

plucky beacon
#

Developers developers developers developers

little eagle
#

There are objective reasons for either, but which of these reasons convince you for either method in the end is subjective.

plucky beacon
#

** developers developers***

#

I like mine because legibility

plucky beacon
#

This FPS debugger is great, now I can tell what players are having a difficult time playing

#

can I use exitwith in an event handler?

plucky beacon
#

I need to do some math

#

how do I calculate tangent in sqf

compact galleon
#

@plucky beacon tan

plucky beacon
#

waaaat

#

it is a command

#

๐Ÿ‘Œ thanks

#

dangit I need to inverse the log

#

time to brush off the calculus

#

get my ti-84

tough abyss
#

@plucky beacon what are you trying to do?

plucky beacon
#

my arma mathed too hard

#

hand on I'll show ya

#

max X is 60 max Y is 1

#

the closer the X is to 1 the closer Y is to 1

#

but it's a curve because I don't want it to really ramp up until it's below 20

#

trying to simplify the math though

plucky beacon
#

_calc = (((_playerFPS^(-0.6))*5)-0.4);

#

so far this formula is working pretty well

#

turns the letters red when it starts fropping from 20-12, then it stays fully red

#

does the same for opacity too

nocturne iron
#

ah so you're just trying to find a polynomial that makes a nice colour relative curve?

plucky beacon
#

ya

#

brushing up on my calc to get this together

nocturne iron
#

does SQF support domain restriction?

plucky beacon
#

domain restriction?

nocturne iron
#

I suppose it would using if statements

#

y = 2x+2, while x:1 < x < 5

#

makes a line from coordinate (1,4) to (5,12)

#

might be what you're looking for

plucky beacon
#

oh I see what you mean

#

it's alright I already got it figured out

nocturne iron
#

ah sweet

compact galleon
#

Brace auto completion is the devil's work ๐Ÿ˜ก

plucky beacon
#

lol

#

not if you're fast at typing I guess

nocturne iron
#

true

#

@plucky beacon I had a similar headache to the one you had the other day

#

was using trig to make an attack script that would flank

plucky beacon
#

LOL

#

ya that's a doozy

#

luckily all mine is doing is outputting the number itself not having to translate it in the game space

compact galleon
#

@knotty rune not if you're fast at typing?

nocturne iron
#

sucks that 2D coodinate spaces suck for that sort of thing

compact galleon
#

@plucky beacon I type up to 850 characters per minute. I hate brace auto completion

nocturne iron
#

convertng from polar > 2D is painful

plucky beacon
#

I guess you're right, if you don't type fast

#

anything that isn't predictable is a problem

nocturne iron
#

Notepad ++ master race here

plucky beacon
#

Visual Studio code isn't an issue fo rme

nocturne iron
#

the arrow keys and hit enter for autocomplete is perfect for typing fast

plucky beacon
#

poor drifter is going to have a mention and be confused

nocturne iron
#

rip

#

Hmm

#

does using 'deleteWaypoint' stop the AI or do you have to issue a stop command to them too?

plucky beacon
#

it should make them stop and look around confused

#

like they all have amnesia

nocturne iron
#

hmm

compact galleon
#

@nocturne iron They'll still move to it

nocturne iron
#

okay

#

Thx

#

any reason why ```sqf
/*
'fnc_wp_pause' by shifty_ginosaji

Caches waypoints for input group in a variable assigned ot the group

0 = Group(TYPE = GROUP)

USAGE:

_handle = [(group this)] call fnc_wp_pause;
*/

_grp = _this select 0;
sg_wp_info = [];

{

_wp = _x;
_index = (_x select 1);
_pos = waypointPosition _wp;
_behaviour = waypointBehaviour _wp;
_combatMode = waypointCombatMode _wp;
_completionRadius = waypointCompletionRadius _wp;
_description = waypointDescription _wp;
_formation = waypointFormation _wp;
_speed = waypointSpeed _wp;
_statements = waypointStatements _wp;
_timeout = waypointTimeout _wp;
_type = waypointType _wp;

sg_wp_info = sg_wp_info + [[_index,_pos,_behaviour,_combatMode,_completionRadius,_description,_formation,_speed,_statements,_timeout,_type]];

hint str _x;

deleteWaypoint _x;

} forEach waypoints _grp;

_grp setVariable ["sg_wp_info",sg_wp_info,true];

sg_wp_info = [];``` is cracking it every time I try to call it?

compact galleon
#

cracking?

nocturne iron
#

sorry, Australianism

#

giving out a generic error

compact galleon
#

could you color code that?

nocturne iron
#

how do I do that? sorry

compact galleon
#

edit it. put sqf as the first line

plucky beacon
#

yay colors

nocturne iron
#

looks nice

compact galleon
#

@nocturne iron Any additional info?

nocturne iron
#

calling it in the debug menu as stipulated by the directions in the header

compact galleon
#

I mean, is there any more info in the error?

nocturne iron
#

Nope

compact galleon
#

does it not mention script?

nocturne iron
#

The error is apparently here though _handle #= [(group this)] call fnc_wp_pause;

#

Generic error in expression

compact galleon
#

I see

#

you're not returning anything

#

last statement is an assignment, which does not return a value

#

last statement in the function, that is

nocturne iron
#

Yeah

compact galleon
#

sg_wp_info = [];

nocturne iron
#

Thanks

compact galleon
#

I wish Eden had live edit like the old 3D editor

nocturne iron
#

Yeah

#

Eden really is a dream

plucky beacon
#

live edit

#

like a way to enable the simulation

compact galleon
#

@plucky beacon The old 3D editor allowed you to preview, and then open the editor interface to spawn things, etc. then you could exit to reset and go back to the original mission

plucky beacon
#

was this lik early eden editor?

compact galleon
#

no

#

the one that's been in the arma games since the dawn of time

nocturne iron
#

the sketch one

compact galleon
#

in ARMA 2 it could be accessed by Alt+E from the menu, but that was removed in ARMA 3

nocturne iron
#

I personally didn't use it much

#

Too much of a hassle except when you're making fine-detail templates

compact galleon
#

well, what do you know.. it still works. and it's still there. and it's been improved since my tutorial ๐Ÿ˜›

#

actually, it's not been improved. quite the contrary. it doesn't work at all now, since spawning a center is broken

#

I guess they started working on it again, and then scrapped it altogether to create Eden

#

It had some nice things. Like instant preview, without having to wait for a loading screen

#

and god, the ability to switch between rotating and moving entities without having to let go of the mouse button first -.-'

#

I miss that so much from the 2D editor

#

๐Ÿ˜ฎ

plucky beacon
#

well would ya look at that

compact galleon
#

Its interface was much better

#

and a lot of the functionality too

#

Much less clunky than Eden

#

Despite it having its faults

#

The exit to editor button is broken now, though, so after each preview you have to restart the game

#

๐Ÿ˜ฆ

#

oh, nevermind. killing yourself allows you to return

#

Like VR

nocturne iron
#

Aw

#

I wish they could emulate the 2D editor in the eden 2D

#

would just complete everything

compact galleon
#

@nocturne iron Well, you can switch to 2D by pressing M

#

but the functionality is the same as in 3D mode

plucky beacon
#

The real change was in how sqm files are made

#

It was a rewrite of how it's compiled

tough abyss
#

How do I execute code only on a certain client in MP?

#

Global & server are pretty self explanatory, but not local.

nocturne iron
#

@compact galleon that's what I'm talking about, if the functionality was like 2D

tough abyss
#

target would be something like a vehicle/player's name? @tough abyss.

#

Ok, thank you.

compact galleon
#

@tough abyss You mean from the console?

tough abyss
#

No, from a script.

jade abyss
#

Was there a more precise time than diag_tickTime? (tickTime = 1.23 || 1.23456 would be nice to have)

meager granite
#

I've been asking for diag_deltaTime for quite a while

jade abyss
#

I just noticed, that diag_TickTime goes back to 0.123456, so should be enough, tbh.

#

(when compared to eachother)

little eagle
#

than*, Dscha. than*

jade abyss
#

i don't know what you mean

#

*whistle*

little eagle
#

๐Ÿ˜‰

tough abyss
#

Is there a way to test locality stuff in MP with only 1 person?

jade abyss
#

Start Arma 2x

#

+disable all SecurityStuff on your local Server (iirc also BE)

#

I gave up on this and bought me a Latop that can start Arma ๐Ÿ˜„

tough abyss
#

Would steam even let you do that?

jade abyss
#

Start the Exe directly

tough abyss
#

Hm, alright. Thanks.

jade abyss
#

E:\Steam\steamapps\common\Arma 3\arma3.exe =}

#

(not the BE one)

little eagle
#

You can join your own local hosted MP game via the LAN tab if you start two instances of Arma 3.

thorny monolith
#

Or even launch a dedicated server instance and have 2+ clients connect

celest wren
#

Does anyone know if allDead returns curator logic entities (for dedicated zeus slots)?

little eagle
#

Probably not

thin pine
celest wren
#

allCurators returns the curator modules though.

#

I'm trying to pinpoint the cause of a bug I've experienced in the past regarding BIS_fnc_createTask (so I can make a proper bug report) where dedicated curator units wouldn't get the task if the owner was set to "true"

#

And right now as far as I can tell, when the owner is set to true, it grabs a list as allUnits + allDead

#

Which seems to exclude the curator logic entities

little eagle
#

Same thing

#

curator module = curator logic

#

same thing

celest wren
#

Talking about "VirtualCurator_F", not "ModuleCurator_F"

#

with ModuleCurator_F being the curator module that allows any unit to enter the zeus interface (assuming that unit is assigned to a module)

#

VirtualCurator_F is the logic unit placed down when you intend to have a unit only access the zeus interface

#

which is then usually linked to a ModuleCurator_F

little eagle
#
entities "VirtualCurator_F"

?

celest wren
#

Yeah so that should work. Making the bug report now.

#

As it stands right now BIS_fnc_taskCreate doesn't include "VirtualCurator_F" in the list of playable units when using "true" as the owner

jade abyss
#

bug report? oO

celest wren
#

So when creating a task with "true" as the owner, units that are dedicated zeus slots will be skipped

#

Because it doesn't iterate through logic entities

#

Right now it just does this to check for player units

(allUnits + allDead) select {isPlayer _x}
little eagle
#

So you basically can't assign tasks to dedicated zeus players via BIS_fnc_taskCreate.

celest wren
#

Unless you explicitly tell it to use that object

#

So

true

doesn't work

#

But this does:

[true, zeus_unit]

Assuming the playable logic is named zeus_unit

#

Which runs into it's own issues if there's no zeus

little eagle
#

The true option of BIS_fnc_taskCreate skips dedicated zeus players.

celest wren
#

Correct

#

I'm not sure if that's intended behaviour or not

jade abyss
#

Wich is okay, tbh.

little eagle
#

No one ever thought about it, so there is no intention to be found.

jade abyss
#

Not always is the Zeus stuff needed in allDead/AllDead.

celest wren
#

RIght

jade abyss
#

"probably" intended (i would say yeah)

celest wren
#

Ideally the fix would be to update the function to iterate through "VirtualCurator_F" (along with it's side-specific subclasses) when using "true" as the parameter

#

I've made the bug report anyways with what i've figured out about it so far.

tough abyss
#

64 bit dropped !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ๐Ÿ™Œ

plucky beacon
#

wat

#

now?

#

are you sure?

tough abyss
#

Yep

#

restart steam

plucky beacon
#

deep breath AHHHHHH

tough abyss
tough abyss
#

im going to assume it's server side command

tough abyss
#

alright thank you

plush cargo
#

sooo does dynamic simulation make unit caching systems obsolete?

jade abyss
#

strange

plush cargo
#

Characters Infantry units (default: 500m). Set to a reasonable distance, player should not see disabled infantry units.

digital hollow
#

Sounds like best for units in builldings or behind terrain.

plush cargo
#

yeah

#

Infantry in the open is a problem. If it is disabled, player will see them from a distance frozen, not playing any ambient animations. Try to avoid it, especially if player has optics

#

you can set what wakes things up from disables simulation as well

#

very cool

little eagle
#

setDynamicSimulationDistanceCoef

polar folio
#

so the main thing is having evaluating what unit to cache all done engine side with that grid resolution stuff, right? the effect would still be the same as enableSimulation and hideObject?

velvet merlin
#

Sets the path to follow for AI driver
myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]

little eagle
#

Probably not hideObject, although ideally this would be coupled with some eventhandlers to customize it... Probably not the case.

plush cargo
#

object and terrain view distance at 2k , ultra settings and 60fps and no stuttering on zoom ๐Ÿ˜ƒ

agile yew
#

@plush cargo NICE!!

plush cargo
#

~40 on a roof in georgetown with same settings but no stuttering on zoom, i am a happy boy

raven hollow
#

anyone who working BIS_fnc_traceBullets? im not working now

#

nah it was kinda mistake

split coral
plucky beacon
#

OH MY GOD

#

It's like unitcapture but better!

jade abyss
#

kewl

plucky beacon
#

what happens when you do it to air vehicles

#

if you set the driveonpath to a vehicle will it chase it?

#

so many questions

still forum
#

Air vehicles ๐Ÿ˜ฎ Attaching colored smoke particle emitters to the wings and letting AI make stunts ๐Ÿ˜ฎ

plucky beacon
#

OOOH

#

but does it work on air vehicles?

#

because it does say "drive"

little eagle
#

You found the fatal flaw in the system, Nitro.

plucky beacon
#

shut it down

#

game over

#

64 bit cancelled

#

in fact we're going to 16bit

little eagle
#

16 bit was a better time, tho

mortal shoal
#

any asm alternative?

dusk sage
#

Free alternatives? mARMA is one

little eagle
#

Way to report all controls of a controls group?

#
        private _ctrlSettingGroupControls = configProperties [configFile >> configName _ctrlSettingGroup >> "controls"] apply {
            _ctrlSettingGroup controlsGroupCtrl getNumber (_x >> "idc")
        };
#

this is ugly

plucky beacon
#

BluforPlayers = allUnits select {(side group _x == west) && (typeOf _x != "B_UAV_01_F")}; this should return all units that are west and not a darter right?

dusk sage
#

yep

little eagle
#

I guess this works too:

allControls ctrlParent _ctrlSettingGroup select {ctrlParentControlsGroup _x == _ctrlSettingGroup};
digital pulsar
#

what would you do without us commy

little eagle
#

I want all sub controls of a controls group

#

To disable them with ctrlEnable false

#

Because apparently disabling the controls group has no effect on the sub controls.

#

... which was not part of my plan.

loud python
#

Can I enable players to enter spectator mode without having to log out? (similarly to how you enter zeus mode)

plucky beacon
#

sure

#

use the egspectator

#
["Initialize", 
[player, //unit being initialized
[West], //sides that can be spectated
false, //can AI be viewed
false, //can free camera be used
false, //can 3rd person be used
false, //show focus info widgets
false, //show camera button widgets or not
true, //Show controls helper widget
true, //whether to show header widget
true //Whether to show entities/locations lists
]] call BIS_fnc_EGSpectator;
plush cargo
#

@little eagle I number put all my ctrls in groups of idcs like one group is idc 220-230 and next is 240-250 and then use this

_fnc_TabHidenShow =
{
    params ["_hideCtrls","_showCtrls"];
    _display = findDisplay 850000;
    _cntHide = count _hideCtrls;
    if (_cntHide == 0) then         // want to close all apps
    {
        _allCtrls = allControls _display;
        _allCtrls deleteRange [0,9]; // don't delete background ctrls
        {
            if (ctrlShown _x) then
            {
                _x ctrlShow false;
            };
        }forEach _allCtrls;
    } else
    {
        for "_i" from (_hideCtrls select 0) to (_hideCtrls select 1) do
        {
            ctrlShow [_i, false];
        };
    };
    _cntShow = count _showCtrls;
    if (_cntShow > 0) then
    {
        for "_i" from (_showCtrls select 0) to (_showCtrls select 1) do
        {
            ctrlShow [_i, true];
        };
    };
};
plucky beacon
#

you can tie this to an addaction or something and have them exit when pressing escape key using
["Terminate"] call BIS_fnc_EGSpectator;

#

@loud python did ya get that before the text block Soolie put up xD

plush cargo
#

sry ๐Ÿ˜ƒ

plucky beacon
#

still think discord should have code in a scrollable box

plush cargo
#

agreed

loud python
#

@plucky beacon Thanks ๐Ÿ˜ƒ

little eagle
#

@plush cargo You're not using controlGroup controls.

#

My controlGroups consist of a whole bunch of controls, but I ctrlCreate multiple of these controlGroups.

#

All sub controls obviously share idc's with their counterparts from other controlGroups of the same type.

plucky beacon
#
(findDisplay 46) displayAddEventHandler ["keyDown", 
{
    _key = _this select 1;
    if(_key = 0x01) then 
    {
        ["Terminate"] call BIS_fnc_EGSpectator;
    };
}];

is this how you do keydowns?

#

also how is that an integer
_DikCode= _this select 1; // integer

little eagle
#

It's just the typical Arma SQF FLOAT, but always a whole number.

#

natural number

plucky beacon
#

so that should work though

little eagle
#

You probably have to add the keyhandler to the spectator display.

plucky beacon
#

oooh

little eagle
#

Not the mission dsplay

plush cargo
#

yea you do

#

and cant be added until opened

#

will return displaynull before

plucky beacon
#

so a waitUntil{!isnull (findDisplay whateveritisforspectator)}

plush cargo
#

guess so

plucky beacon
#

Just gotta find out what display the egspectator uses

little eagle
#
class Extended_DisplayLoad_EventHandlers {
    class RscSpectator {
        Nitro = "_this call compile preprocessFileLineNumbers 'initSpectatorDisplay.sqf'";
    };
};
//initSpectatorDisplay.sqf
params ["_display"];
diag_log [_display];

_display displayAddEventHandler [...
#

Needs CBA, but this way you don't need to ask every frame if the spectator thing is opened.

#

I hope RscSpectator is the correct one. It's idd 3000

plucky beacon
#

I wish I had arma installed on this comp to see the functino viewer

little eagle
#

Good Idea. I'll look it up.

#

RscDisplayEGSpectator

plucky beacon
#

so where does the extended handlers and stuff go

little eagle
#

description.ext:

class Extended_DisplayLoad_EventHandlers {
    class RscDisplayEGSpectator {
        Nitro = "_this call compile preprocessFileLineNumbers 'initSpectatorDisplay.sqf'";
    };
};
#

The other SQF thing is just a file you point to with this ^ config

plucky beacon
#
params ["_display"];
diag_log [_display];

_exitHandler = (_display) displayAddEventHandler ["keyDown", 
{
    _key = _this select 1;
    if(_key = 0x01) then 
    {
        ["Terminate"] call BIS_fnc_EGSpectator;
        (_display) displayRemoveEventHandler ["KeyDown", _exitHandler];
    };
}];
#

that's what I had

#

How does Params work anyway?

little eagle
#

There is no need for the waituntil {!isnull (_display)};, because it's guaranteed to exist.

dusk sage
#

IIRC using hex numbers will be slower than decimal

#

need those extra nanoseconds

#

๐Ÿ™ƒ

plucky beacon
#

but how do I convert it to a decimal

plush cargo
#

0x01 = 1

dusk sage
#

lol

plush cargo
little eagle
#

you enter it into the debug console watch lines is what I do, lol

plush cargo
#

bottom of page it has reg nums

plucky beacon
#

oooh it's at the bottom

little eagle
#

The actual way to use these is:

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

if (_key == DIK_ESC) then {...
plucky beacon
#

but it only says german keyboard xD

#

what's that even mean

plush cargo
#

i dunno but it works

plucky beacon
#
params ["_display"];
diag_log [_display];

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

_exitHandler = (_display) displayAddEventHandler ["keyDown", 
{
    _key = _this select 1;
    if(_key == DIK_ESC) then 
    {
        ["Terminate"] call BIS_fnc_EGSpectator;
        (_display) displayRemoveEventHandler ["KeyDown", _exitHandler];
    };
}];
#

couldn't you also include in int he description.ext once?

#

or does that not work that way

little eagle
#

No.

#

_display is undefined in the eventhandler script

#

luckily you can retrieve it from the passed arguments:
_display = _this select 0

plush cargo
#
(findDisplay 46) displayAddEventHandler ["KeyDown","  hintSilent str (_this select 1)"];
#

for key code

plucky beacon
#

that's what _key is for

plush cargo
#

i meant just to test what key is what num

little eagle
plucky beacon
#

oooh

little eagle
#

They are self explanatory most of the time

#

F-key = DIK_F

#

Tab key = DIK_TAB

#

etc,

plucky beacon
#

Gotta love DIK keys

plush cargo
#

๐Ÿ†

plucky beacon
#

EG spectator display is findDisplay 60492

little eagle
#
    private _hasMissionSQM = call {
        private _control = (findDisplay 0) ctrlCreate ["RscHTML", -1];
        _control htmlLoad "mission.sqm";
        private _return = ctrlHTMLLoaded _control;
        ctrlDelete _control;
        _return
    };

Anyone know a less shitty way to do this?

dusk sage
#

that's a thing?

tough abyss
#

quick question: does anyone know why "set face" dont work with all faces? for example when i use: set face "williams" i just get the default face when loading the mission.......

#

i mean i use : this setface "williams"

dusk sage
#

Would a simple loadFile work? @little eagle

little eagle
#

loadFile does make an error pop up

plucky beacon
#

is there a command to make a hint dissapear immediately

jade abyss
#

hint "";

dusk sage
#

^

plucky beacon
#

huh I thought it would just bring up a box

jade abyss
#

nope

little eagle
#

@tough abyss Is it safe to use loadFile on machines without interface? Cant use dialogs / controls there, but pop ups don't exist either.

jade abyss
#

I mean, if you want a box: hint str("");

plucky beacon
#

aaah

#

I see

vital onyx
nocturne iron
#

quick q, does anyone know the number of the map control?

little eagle
#

If the file does not exist, does it crash or something?

nocturne iron
#

thx

tough abyss
#

i tried this setface "williams"; ..... still default face?

plucky beacon
#

I wonder what mods got upgraded yet

plush cargo
#

I thought the map was display 12?

#
_map = findDisplay 12;
_map ctrlCreate ["RscTree", 2103];
_tree = ((findDisplay 12) displayCtrl (2103));
_lbposX = 0.765 * safezoneW + safezoneX;
_lbposY = 0.725 * safezoneH + safezoneY;
_lbwidth = 0.2015 * safezoneW;
_lbheight = 0.2125 * safezoneH;
little eagle
#

@tough abyss setFace does not work from the init box directly. Try:

0 = this spawn {
    _this setFace "williams";
};
tough abyss
#

weird it worked with Zee's female heads.

#

but thx i will try it

plucky beacon
#

I like how egspectator is 60492

#

You can tell it's more recent invention

plucky beacon
#

Lol

#

Like 60490 was taken

vapid frigate
#

any known scripting changes that would cause a crash with this (since 1.68)?:

#

Exception code: C0000094 INT_DIVIDE_BY_ZERO at 026FC05C

plucky beacon
#

sounds like something divided by zero

vapid frigate
#

thanks ๐Ÿ˜›

#

1/0 doesn't crash arma usually

#

just gives a script error (same in 1.68)

plucky beacon
#

Try it without dividing by 0

vapid frigate
#

i don't know what is dividing by 0 is my issue

tough abyss
#

@vapid frigate when does it happen? is it MP? as soon as you connect?

vapid frigate
#

nah, it's in a custom script.. but it's a big one

#

so was hoping it was a known issue before i start eliminating stuff

tough abyss
#

well

#

hint "hey this didnt error out" ๐Ÿ˜‰

#

create break points within the script

vapid frigate
#

yeh i know how to debug it, was just hoping i didn't have to

#

will report back when i work out what command's been broken

#

unless there's actually break points i don't know about?

chilly wigeon
#

Heh, I wish

plucky beacon
#

Maybe soon

#

Debugger

#

Hint

vapid frigate
#

narrowed it down to something to do with deleting ui controls

#

seems like this line crashing ctrlDelete ((findDisplay %1) displayCtrl 1261);

vital onyx
#

Hi all,

is there a way to uniqly identify objects in player inventory, say some commands output weapon and magazine id

#

for example

currentMagazineDetail player
//"6.5 mm 30Rnd STANAG Mag(30/30)[id/cr:10000061/0]"
// pressing R to reload magazine, now output is
//"6.5 mm 30Rnd STANAG Mag(30/30)[id/cr:10000062/0]"
little eagle
#

Weapons don't have id's. At least there is no way for us to read them.

vital onyx
#
Syntax:
container weaponAccessoriesCargo [weaponId, creatorId]
Parameters:
container: Object - cargo container
[weaponId, creatorId]: Array
weaponId: Number
creatorId: Number
Return Value:
Array - [silencer, laserpointer/flashlight, optics, bipod]

https://community.bistudio.com/wiki/weaponAccessoriesCargo

#

I seen somewhere in one's command output, but could not find it

little eagle
#

Weapons don't have id's. At least there is no way for us to read them.

vital onyx
#

pity

#

I am afraid no way to script kind of unique items, maybe just like ot is done for radios in TFAR

#

tf_fadak_1 ... tf_fadak_1000

vapid frigate
#

found the crash.. you can't delete a control from inside it's mousebuttondown(at least) event handler

plucky beacon
#

Good job detective

#

Ya found the murderer

vapid frigate
#

repro (worked in 1.66):

disableSerialization;
sleep 2; 
createDialog "RscDisplayCommon";
_dialog = findDisplay 999;  
_control = _dialog ctrlCreate ["RscButton", 420];
_control ctrlSetPosition [0,0,1,1];
_control ctrlSetText "CRASH";
_control ctrlCommit 0;
_control ctrlAddEventHandler ["MouseButtonDown", "ctrlDelete ((findDisplay 999) displayCtrl 420)"];
};```
little eagle
#

Why would you do that?

vapid frigate
#

close something when you click on it?

little eagle
#

If you wan to close it, then close the display.

vapid frigate
#

i don't want to close the display

#

just delete the control

little eagle
#

Controls shouldn't be deleted when the display is still shown.

vapid frigate
#

worked fine before 1.68 and in a lot of other circumstances where i'm doing it

#

just not in that event

little eagle
#

Try with 32 bit exe, but I don't think it was good design to begin with.

vapid frigate
#

it's basically working around the fact that you can't stack dialogs

#

so it creates/deletes controls on the 1 dialog instead

#

_control ctrlAddEventHandler ["MouseButtonDown", "[] spawn {ctrlDelete ((findDisplay 999) displayCtrl 420)}"];
is a workaround

#

if you shouldn't delete controls, there shouldn't be ctrlDelete ๐Ÿ˜ƒ

little eagle
#

The right way would be to create all your controls when you open the display

#

And then to ctrlShow false what should be hidden

#

And ctrlShow true what should be shown

#

ctrlEnable too etc.

vapid frigate
#

that would be bad design in my case because i don't know how many controls there are till it's running

#

and it changes dynamically

#

ctrlCreate and ctrlDelete sort of changed the possibilities

little eagle
#

that would be bad design in my case
Objectively wrong.

#

My ui didn't break with an update. ๐Ÿ˜ƒ

vapid frigate
#

touche

little eagle
#

What you're doing the the equivalent of changing the size of an array while iterating through it.

#

Maybe that even is exactly why it crashes, who knows.

vapid frigate
#

it only crashes 64 bit

#

just tested

#

it's a common thing in other languages (winforms, xaml, etc) to delete/create controls.. i don't see why it's bad design in arma

#

well other than the INT_DIVIDE_BY_ZERO

little eagle
#

create them when the menu is opened (onLoad etc.) and then ctrlShow or ctrlEnable them.

vapid frigate
#

would need hundreds of controls in my case that never get used

little eagle
#

.png loading ๐Ÿ’ค

#

Doesn't look like hundreds.

compact galleon
#

I hate how this server removes all the features that makes Discord better than IRC

vapid frigate
#

it has custom dropdowns too

#

so 1 for each allowed item.. 10+ for each category where you can have multiple things

#

i did try the 'old' way before.. using built in combo boxes and such.. was too slow

little eagle
#

All I'm saying is, that deleting a control from inside one of it's eventhandlers is bound to break at some point.

vapid frigate
#

yep, that point is 64 bit ๐Ÿ˜ƒ

little eagle
#

Changing a lot of things and some of it very low level like 64 bit will expose a lot of these things.

#

oh wow. 7:30 am

#

Shows.

meager granite
#

@vapid frigate How do you display logo and grey interlacing behind the character?

#

Object with texture behind I suppose?

vapid frigate
#

yeh the background is about 10 of those flat plane objects (to make it big enough

meager granite
#

Looking at that white border on bottom of the logo

vapid frigate
#

logo is 1 in the center

#

it's 50-100m away

meager granite
#

Yeah, I thought so

#

I did that in OA for character selection, had to spawn grid of warfare flag signs behind the character lol

#

And paint them white

#

Also, setPlate, getPlate commands for vehicles when?

#

The functionality was there since Arma 2 or maybe earlier