#arma3_scripting

1 messages ยท Page 424 of 1

little eagle
#

Yeah, fuck that Dedmen.

velvet merlin
#

the context is cfgSounds definitions for sounds outside the mission to be called by scripting commands

still forum
#

Ah...

#

And why does that mean config related stuff is irrelevant

#

while you are writing a config?

#

You asked for help. I told you two things that could be wrong with that. You don't care.

#

So what do you want if you don't want help?

velvet merlin
#

i already shared the differnet problems in here and solutions for ppl who care

little eagle
#

I blame the newline { and the macro ending with ;

still forum
#

As I said @ is a special operator. So it will also function as such. You need to quote the string if you want a string. Like all the examples on biki do it.
It's not a macro thing it's a #arma3_config thing

shadow sapphire
#

How the heck are you supposed to disable radio channels these days? It was super simple back in the day.

disablechannels [0,1,4];

DONE!

Then it was:

disablechannels[] = {
    {0, false, false},
    {1, false, false},
    {4, false, false}
};
#

Now what is it?

subtle ore
#

Same thing

little eagle
#

You need 0 not false.

#

And the first thing never worked.

subtle ore
#

0 not false? ๐Ÿค”

little eagle
#

Yes, in config there are no booleans, so you write 0.

still forum
#

boolean constants don't exist in arma

little eagle
#

Only bad tools automatically convert it, because they're written by people that think they're smarter than you and therefore cause problems because it turns out... oh well.

shadow sapphire
#

Eh... maybe I got some syntax wrong, but the disablechannels the first way certainly worked in the past.

The second way worked more recently, too. Like definitively.

But, I believe you that it doesn't work right now.

subtle ore
#

Sure. But that is not a config?

shadow sapphire
#

@little eagle, swapped for zeroes, still isn't working.

subtle ore
#

What do you mean 'it's still not working'

shadow sapphire
#

The channels are not disabled.

subtle ore
#

if you are the server then it won't be disabled for you

subtle ore
#

same goes if you are logged as admin on dedicated

shadow sapphire
#

I'll upload to another server and give it another shot.

little eagle
#

Got this as result:

name = "speech_##I";
sound[] = {"@ww2\missions_s\campaigns\ForTheMotherland_s\EN\mission_7\Rus_m7_1.ogg",1,1,100};
titles[] = {0,""};

with this properly written macro config:

#define QUOTE(var) #var
#define DOUBLES(var1,var2) var1##_##var2

#define SPEECH(I) \
class lib_m7_speech_##I { \
    name = "speech_##I";\
    sound[] = {QUOTE(DOUBLES(@ww2\missions_s\campaigns\ForTheMotherland_s\EN\mission_7\Rus_m7,I.ogg)),1,1,100};\
    titles[] = {0,$STR_LIB_missions_lib_campaign_missions_LIB_07_SA_CAMP_Staszow_LIB_m7_ph##I};\
}

SPEECH(1);
SPEECH(2);

Ofc. the other entries are still wrong, but the sound path is now working correctly.

still forum
#

The name thing is still broken. Because of incorrect stringification

little eagle
#

Yep, don't care.

shadow sapphire
#

@subtle ore, uploaded to dedicated. channels still not disabled, even using @little eagle's syntax.

little eagle
#

Been saying how to deal with this for years, yet every other month the same dumb questions come up. I'm getting tired of it.

#

You'd think people would learn eventually, but no.

#

They're too pridefull.

subtle ore
#

Are you logged in as admjn DEL-J...?

shadow sapphire
#

You're a hero fighting an endless fight, @little eagle.

#

@subtle ore, I'm not.

subtle ore
#

So you still have access to all the channels?

shadow sapphire
#

Indeed.

little eagle
#

DEL-J have you tried abandoning the config method in favor of the SQF command? It seems people have more luck with that method.

subtle ore
#

is the rest of your info from description.ext loading?

shadow sapphire
#

I have not. How do I do that?

little eagle
shadow sapphire
#

Sweet! Will try it immediately. It might fix a barely related problem.

lone glade
#

thonking harder

subtle ore
#

Say, how did you rid of your blue name commy?

little eagle
#

Bad and unfunny trolling.

still forum
#

@little eagle ๐Ÿ’ฉ

subtle ore
#

Heh.

shadow sapphire
#

I can't just stick that in the init, right? I have to do like, onplayer join or some crazy shit, yeah?

little eagle
#

init.sqf

#

It's delayed enough.

meager heart
#

๐Ÿ˜„

little eagle
#

That looks kinda good.

subtle ore
#

Heh

shadow sapphire
#

That's fine.

little eagle
#

It's also all greyscale. Just how I like my world.

still forum
#

Oh now

#

now I can't identifyicate you anymore

little eagle
#

Iden-what?

meager heart
#

tifyicate

little eagle
#

Just use your nose and smell the ๐Ÿ’ฉ.

ruby breach
#

@shadow sapphire If you're trying to disable radio channels your false's need to be true's

shadow sapphire
#

For the description.ext?

ruby breach
#
disableChannels[]={ // {channelID<number>, disableChat<bool>, disableVoice<bool>}
    {0,false,true}, //Global - Allows chat, disallows voice
};
#

Yes

#

Also worth noting you need the following in your client init files somewhere

#
/*
    https://feedback.bistudio.com/T117205 - disableChannels settings cease to work when leaving/rejoining mission
    Universal workaround for usage in a preInit function. - AgentRev
    Remove if Bohemia actually fixes the issue.
*/
{
    _x params [["_chan",-1,[0]], ["_noText","false",[""]], ["_noVoice","false",[""]]];

    _noText = [false,true] select ((["false","true"] find toLower _noText) max 0);
    _noVoice = [false,true] select ((["false","true"] find toLower _noVoice) max 0);

    _chan enableChannel [!_noText, !_noVoice];

} forEach getArray (missionConfigFile >> "disableChannels");
shadow sapphire
#

Holy shit. Dammit, that's a bizarre thing that we ALL missed. I guess they just assumed I wasn't that stupid.

#

So should I throw what you posted into the onplayerjoin or playerinit? What's that called?

ruby breach
#

Would be player init (clientside). I assume it's still a thing as the bug report is still open anyway. It doesn't hurt even if it is fixed

subtle ore
#

Err...

shadow sapphire
#

initplayerlocal.sqf. found it.

#

@subtle ore, insight?

astral tendon
#

onPlayerKilled.sqf and the killed event handle do about the same?

subtle ore
#

@shadow sapphire Insight on?

shadow sapphire
#

Anything, whatever you were saying "Err..." about.

subtle ore
#

should've known to disable 1 and to enable 0 (true, false)

shadow sapphire
#

RIGHT??

#

We were all staring at it like a bunch of assholes.

subtle ore
#

W H A T?

still forum
#

Well the wiki kinda said that. I also overlooked it. But I wasn't the one who had the problem soo... ยฏ_(ใƒ„)_/ยฏ

#

The guy having the problem should be the one doing the most research

shadow sapphire
#

Of course.

#

There is an epidemic learned helplessness on here and I suffer from it the most.

subtle ore
#

Cool

shadow sapphire
#

@ruby breach, switching everything to true worked with no other input.

ruby breach
#

Right; that second bit was suggested due to a bug that may have been fixed by now. (i.e, if you return to the lobby and then return to the mission without fully disconnecting, the disableChannel[] settings are ignored)

#

I haven't tested that in an environment without that init code running to know if it's fixed or not

shadow sapphire
#

Oh! I see. Interesting.

velvet merlin
#

@little eagle thanks for the macro
still for sounds defined outside missions you have to use @path + playSound as say[3D] is bugged

real osprey
#

Im trying to create an addaction that runs a script on a server. I have the addaction portion down, but the script isn't running on the server. putting the script into the execute box runs the script however. I'm having trouble understanding the "guides" on the wiki. Can y'all point me in the right direction?

little eagle
#

Post the code.

real osprey
#

this addaction ["Detonate","detonate.sqf"]
nul = [nuke_me,200,true,true,true,true] execvm "AlNuke\alias_nuke.sqf"

#

line 1 is on the item

#

line 2 is "detonate.sqf"

lone glade
#

misspelled null on top of using it for no reasons.

little eagle
#

Oh, so the problem is that the script is executed on the client, but has to run on the server?

real osprey
#

Yes

little eagle
#

sec

#
//detonate.sqf
{
    [nuke_me, 200, true, true, true, true] execVM "AlNuke\alias_nuke.sqf";
} remoteExec ["call", 2];
#

Change detonate.sqf to this.

#

It sends the code inside the curly brackets to the server and executes it there.

#

The misspelled "nul" is pointless, so might as well delete it.

real osprey
#

alright

#

now... since its sending this to the server to execute, the results will happen across all clients right?

little eagle
#

Well, depends on what alias_nuke does.

real osprey
#

it sets off a nuke effect

#

the goal is for 1 person to press detonate, and then everyone sees the nuke go off

little eagle
#

Yeah, but does it create the nuke effect in a way that is MP compatible?

#

Can't tell without knowing what the script does.

real osprey
#

it works when run via the execute tab

#

while on the server

little eagle
#

SERVER EXEC?

real osprey
#

Yes

little eagle
#

SERVER EXEC does essentially do what I posted.

#

{...} remoteExec ["call", 2]

#

Transfering some CODE to the server to execute it there.

#

Therefore I'd say it should work.

real osprey
#

alright! i appreciate it!

ruby breach
#

The only potential issue you may have is if execVM isn't allowed in cfgRemoteExec

little eagle
#

You mean "call".

ruby breach
#

Yeah, that. (what I get for not really reading past execVM)

little eagle
#

First line of that script is:

if (!isServer) exitWith {};

Therefore I think it was scripted with MP in mind and does indeed require remoteExec if executed from the action menu.

queen cargo
#

could somebody check what will happen when executing theese:

if true then [1, 2];
if true then ["3", "4"];
if true then ["5", {6}];
if true then [{7}, "8"];
if true then [{9}, 10];
if true then [{11}];
if false then [{12}];
#

also, what is returned when

if false then {}```
#

also, what happens when doing

1 else 2;```
compact galleon
#

@queen cargo Exactly what you'd expect

#

Number, expected Code, 1 element, expected 2, etc.

#

if false then {} would return Nothing

#

1 else 1 Generic error in expression

exotic tinsel
queen cargo
#

does not answers my question for specific errors for each line

compact galleon
#

I just told you

#

Any argument that has the right number of elements but wrong type, will report wrong type. The ones that has incorrect number of elements will report wrong number of elements. 1 else 1 would report Generic error in expression

#

if true then ["5", {6}]; Error Type String, expected Code

queen cargo
#

kk

exotic tinsel
#

could someone point me in the direction of how to go about allowing specific player to access specific UAV.

queen cargo
#
str for "_i"
#

output?

#

also, what about:

for "_i" isEqualTo (for "_i" from 0)
...```
#

also ... because it just comes up: what happens when doing this:

for "_i" from 0 to 10 do { _i = nil; };```
exotic tinsel
#

does anyone know of an event handler i can use that fires when connected to a uav?

compact galleon
#

@queen cargo "ForType <invisible>"
false
Infinite loop

queen cargo
#

what about for "_i" isEqualTo for "_i"

compact galleon
#

@queen cargo false

queen cargo
#

so basically always false

#

kk

compact galleon
#

@queen cargo I don't think it can compare them

#

_a = for "_i"; _a isEqualTo _a; is also false

queen cargo
#

check

#

always false

queen cargo
#

is for "_i" from 0 to 0 do {...} really getting executed once?
and what about for "_i" from 1 to 1 do {...} if it is?

compact galleon
#

@queen cargo Of course

queen cargo
#
[1] select true;
[1] select false;
[] select false;```
#

return values?

#

errors?

compact galleon
#

Weird

#

[1] select 1 returns nothing, and doesn't error [1] select 2errors

#

Seems one index too far will return nil without erroring

queen cargo
#

thats known behaviour

#

question howerver is what happens with the true false stuff

#

also:

"test" select [0, 10]```
#

will this evaluate to "test" or error out

compact galleon
#

true false is treated the same as 1 0

queen cargo
#

kk

compact galleon
#

"test" select [0, 10] returns "test"

#

"test" select [2, 10] returns "st"

queen cargo
#

what about out of index for start?

#

[10, 10] eg

compact galleon
#

""

queen cargo
#

and what if [-1, 10]

compact galleon
#

Both return ""

queen cargo
#

and i guess no error outputted?

compact galleon
#

No

queen cargo
#

negative length?

compact galleon
#

Nothing outputs any errors

queen cargo
#

negative length will output ""?

compact galleon
#

Yes

queen cargo
#

kk

#

i guess the same applies to <ARRAY> select <ARRAY>

compact galleon
#

yes

exotic tinsel
#

how do i find out via script what squad name player is in?

compact galleon
#

eh. squad name player is in?

queen cargo
#

groupId group player

exotic tinsel
#

awesome, thanks mate

queen cargo
#

<ARRAY> select <CODE> and <CONFIG> select <SCALAR> are now missing
and the config thing is lacking an essential datatype right now
soooo .... just the array code variant is missing

#

ty @compact galleon

exotic tinsel
little eagle
#
5 remoteExec ["setCurrentChannel", _unit];

Obviously.

exotic tinsel
#

doesnt work, but found the solution else where

subtle ore
#

Yes it does, you can't just use "_unit" withought defining it as it's not a command like player is

exotic tinsel
#

ok, how do i define it, all thats being passed to the function is player. total noob here

#

i tried this from with in the function, i am passing player to function

5 remoteExec ["setCurrentChannel", _player]; 
little eagle
exotic tinsel
#

i have read that. im doing this at the top of function

params ["_player"];
little eagle
#

Yes, I should've known.

exotic tinsel
#

ok nvm ill find help else where tonight. thx

little eagle
#

Thanks.

subtle ore
#

How are your programmer muscles hanging out Commy? ๐Ÿ’ช

little eagle
#

insert witty response

subtle ore
#

heh

#

@LifeSnatcher#6222

params[["_unit",objNull,[objNull],1]];
if(currentChannel == 0) then
{
  5 remoteExec["setCurrentChannel",_unit];
};
#

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

edgy dune
#

wats remoteExec do?

little eagle
#

There's a wiki explaining it.

edgy dune
#

so its like running a script locally?

subtle ore
#

Asks server to execute given scripted function or script command on given target PC. The environment chosen for the execution is as follows:

little eagle
#

It's the opposite of running a script locally.

limpid pewter
#

Hey everyone, does anyone know why this ```sqf
[jetno,jets,player,_checked] remoteExec ["mld_fnc_jetNotification",0];


Also i do have a CfgRemoteExec whitelist file like this ```sqf
class CfgRemoteExec
{
       class Functions
       {
               mode = 1;
               // Ability to send jip messages: 0-disabled, 1-enabled (default)
               jip = 1;
               /*your functions here*/
               class jetSpawnInit
               {
                      allowedTargets=0; // can target anyone (default)
                      jip = 0; // sending jip messages is disabled for this function (overrides settings in the Functions class)
               };
               class jetNotification
               {
                  allowedTargets = 0;
                  jip = 0;
               };
       };
};

Thanks.

unborn ether
#

@Moldisocks#2334 I can't read it from smartphone properly, but I think you've missed the functions tags in CfgRemoteExec

#

@Moldisocks#2334 And yes, server doesn't respect these rules

limpid pewter
#

@Demellion Dismal#4736 What so like this ```sqf

class mld_fnc_jetSpawnInit {

};

//Or this

class fnc_jetSpawnInit {

};

little eagle
#

First one.

limpid pewter
#

ok thanks. it's weird though, i have a similar cfg in another mission with the same syntax as my original post and it worked fine.

little eagle
#

No, it didn't. You made a mistake.

limpid pewter
#

ok ๐Ÿ˜…

mild pumice
#

Hello guys, do you know how i can hint someting at the end of an animation ? I use playmove like this

player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
#

maybe a

waitUntil {(animationState player != "AinvPknlMstpsnonWnonDnon_medic_1")};
``` ?
ruby breach
#

That'd work, but just remember that it'll also delay the execution of anything else in that function until after the animation completes

mild pumice
#

it doesn't work, when i diag_log animationState player in the loop i only get this : "amovpercmstpsraswpstdnon"

ruby breach
#

Ahh, right, also worth mentioning that animationState is forced lowercase in A3

subtle wigeon
#

I have seen setskill and used values of 0,1,2. Does going any higher have any effect? The wiki is not very clear. For example, 3-10. Moslty interested in pilots and drivers at this time.

meager heart
#

From wiki: Value of skill may vary from 0 to 1.

subtle wigeon
#

I know, however I have seen AI Skill scitps use other values.

meager heart
#

me too, but they was all in between 0 and 1

tough abyss
#

I have only ever used 0-1 values. IIRC correctly when I tested it that attempts to set above 1.0 resulted in getSkill producing 1.0 so was clamped to the range, but it was nearly 2 years ago I am far from 100% on it. I don't recall it crashing.

lone glade
#

values are from 0 to 1

#

0 being minimum 1 maximum

unborn ether
#

@Joker#2362 use AnimDone EVH

little oxide
#

I was thinking if it's more optimized to use animate instead publicvariable, I have a customObject and i want to know if someone already using action on it, so thinking if i create an animation on it, and put this animation to 1, will be more optimized instead set a publicvariable on it ?

lusty canyon
#

is there a command that gives uavs ability to turn on nvg in third person?

lone glade
#

.... press N or whatever your nvg button is....

lusty canyon
#

doesnt work ofc why else would i ask

lone glade
#

oooh, uavs

#

no

subtle ore
#

what's the point?

lone glade
#

:/ go figure

lusty canyon
#

what nobody wants to use uavs at night?

lone glade
#

....

#

yes we do

#

we give them waypoints

lusty canyon
#

im talking about players controlling them

subtle ore
#

You don't have to thave third person nvg to play at night

#

that's idiotic

lusty canyon
#

first person doesnt get nvg either

lone glade
#

because they don't have NVs

subtle ore
#

the greyhawk might

lone glade
#

eeeeeeeh you may be right

subtle ore
#

yeah it has bhot whot and nvg

#

same with the setinel

lusty canyon
#

only when in optic view

lone glade
#

ofc

lusty canyon
#

let me change the question then, can you force the players view to turn nvg on while he is in control of a uav?

#

or any vehicle for that matter

lone glade
#

that's not how cameras work

#

it's possible but it's a lot more work than a single command

young current
#

one could try giving the UAV driving/piloting AI entity NV/TI goggels

lusty canyon
#

u mean the B_UAV_AI things?

#

in the cfgs?

#

ive already checked the items they have nvggoggles already

young current
#

no in game

#

ok

meager heart
#

maybe setCamUseTi

lusty canyon
#

ok ill add that to the vehicles useractions see if it works thanks

meager heart
#

Need some tweaks here and probably film grain... @lusty canyon

//--- Night vision 

0 spawn {
    private _color = ppEffectCreate ["ColorCorrections", 1999];  
    _color ppEffectEnable true;  
    _color ppEffectAdjust [1, 1, 0, [0.4, 1, 0.4, 0], [0.4, 1, 0.4, 0.0], [0.4, 1, 0.4, 1.0]];  
    _color ppEffectCommit 0;

    private _blur = ppEffectCreate ["dynamicBlur", 505];
    _blur ppEffectEnable true;  
    _blur ppEffectAdjust [.2];
    _blur ppEffectCommit 0;

    setAperture 0.1; //--- brightness
};
long gazelle
#

So I'm currently having a problem with "hitpart" EH that colors the part hit.. In singleplayer it works fine but in multiplayer it has one particulary annoying problem..

//[this] execVM "target.sqf";

params [
    ["_target", objNull, [objNull]]
];

private _EH = (_target addEventHandler ["HitPart", {
    private _colorBlack = "#(argb,8,8,3)color(0,0,0,0,CO)";
    private _colorWhite = "#(argb,8,8,3)color(1,1,1,1,CO)";
    private _target = ((_this select 0) select 0);
    private _selHits = _target getVariable "selHits";
    private _selectionNames = (selectionNames _target);
    private _selectionArr = ((_this select 0) select 5);
    private _selection = if ((count _selectionArr) < 1) then {
        (_selectionArr select 0);
    }else{
        private _segment = "";
        {
            if (_x in _selectionNames) exitWith {_segment = _x};
        } forEach _selectionArr;
        _segment
    };
    if (_selection isEqualTo "") exitWith {};
    private _selectionIndex = (_selectionNames find _selection) + 1;
    private _color = if ((_selHits select _selectionIndex) isEqualTo 0) then {
        _selHits set [_selectionIndex, 1];
        _colorBlack
    }else{
        _selHits set [_selectionIndex, 0];
        _colorWhite
    };
    _target setVariable ["selHits", _selHits];
    _target setObjectTextureGlobal [_selectionIndex, _color];
    
    if (_selectionIndex == 17) then {
        _target hideObject true;
        format ["Kill confirmed.\nTarget: %1", _target] remoteExec ["hint", 0];
        for "_x" from 0 to 17 do {
            _target setObjectTextureGlobal [_x, _colorWhite];
        };
        _target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    }else{
        format ["Target still up.\nTarget: %1\nImpact zone: %2", _target, _selection] remoteExec ["hint", 0];
    };
}]);
_target setVariable ["myEH", _EH];
_target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
#

The selHits variable seems to be individual on each player and I need it to be shared..
Bacause I need it to change color depending on what color it was last time, not by which player shot it to which color last time.

#

Any advice?

little eagle
#

setVariable public. It's documented on the wiki. You add the third arg on the right side array true. Look under "alternative syntax".

#

Also wrap the last line in if isServer, then it all should work.

long gazelle
#

You mean like : if isServer then { _target setVariable ["myEH", _EH]; _target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]; }

little eagle
#

I said the last line. Not the last two.

#

And selHits there should also use the public flag.

#

selHits should always use the public flag.

long gazelle
#

Sorry, didn't read properly..

#

So what is flag? The wiki doesn't explain as much as I would like it to..

little eagle
#

It means that the changed variable will be broadcast to all connected machines, including those that JIP later.

#

Which should pretty much solve your desynchronization issue, aside from edge cases where two people hit the same target at about the same time, but who cares.

long gazelle
#

Can you give me an example how to do that with the code above?

meager heart
#

๐Ÿ˜”

cold pebble
#

...

little eagle
#
//[this] execVM "target.sqf";

params [
    ["_target", objNull, [objNull]]
];

private _EH = (_target addEventHandler ["HitPart", {
    private _colorBlack = "#(argb,8,8,3)color(0,0,0,0,CO)";
    private _colorWhite = "#(argb,8,8,3)color(1,1,1,1,CO)";
    private _target = ((_this select 0) select 0);
    private _selHits = _target getVariable "selHits";
    private _selectionNames = (selectionNames _target);
    private _selectionArr = ((_this select 0) select 5);
    private _selection = if ((count _selectionArr) < 1) then {
        (_selectionArr select 0);
    }else{
        private _segment = "";
        {
            if (_x in _selectionNames) exitWith {_segment = _x};
        } forEach _selectionArr;
        _segment
    };
    if (_selection isEqualTo "") exitWith {};
    private _selectionIndex = (_selectionNames find _selection) + 1;
    private _color = if ((_selHits select _selectionIndex) isEqualTo 0) then {
        _selHits set [_selectionIndex, 1];
        _colorBlack
    }else{
        _selHits set [_selectionIndex, 0];
        _colorWhite
    };
    _target setVariable ["selHits", _selHits, true];
    _target setObjectTextureGlobal [_selectionIndex, _color];
    
    if (_selectionIndex == 17) then {
        _target hideObject true;
        format ["Kill confirmed.\nTarget: %1", _target] remoteExec ["hint", 0];
        for "_x" from 0 to 17 do {
            _target setObjectTextureGlobal [_x, _colorWhite];
        };
        _target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], true];
    }else{
        format ["Target still up.\nTarget: %1\nImpact zone: %2", _target, _selection] remoteExec ["hint", 0];
    };
}]);
_target setVariable ["myEH", _EH];
if (isServer) then {
    _target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], true];
};
cold pebble
#
_target setVariable ["selHits", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],true];
#

Or what commy put

long gazelle
#

I meant the flag, those changes I already did.

cold pebble
#

The flag is the added true

little eagle
#

"Chances" ? ๐Ÿค”

cold pebble
#

Changes I think

long gazelle
#

Commy2: Wrong word, sorry..

little eagle
#

Well, those changes are all you have to do.

#

As far as I can tell. For what it's worth.

long gazelle
#

So when you were talking about "flag" you didn't mean "setFlagTexture" or other "flag" stuff on the wiki?

cold pebble
#

Not at all ๐Ÿ˜›

long gazelle
#

That explains why I was running around in circle all confused... My mistake.

little eagle
#

Nah, flag as in argument you flip from default false to true,

long gazelle
#

Ok, thanks for your help, now I just need to test it..

queen cargo
#

in case someone with basic c/c++ knowledge has too much spare time and searches for new headache: sqf-vm still is in need of developers ๐Ÿ˜ƒ

rancid pecan
#

hello
how to disable or enable Animals (fish,rabbit vs.) how many ways do you have

young current
#

@strong canopy dafuq man?

strong canopy
#

My bad mate Im in the wrong channel lol

#

Bit drunk lol

young current
#

dont drink and discord ๐Ÿ˜›

strong canopy
#

Yeah... Im sorry lol

still forum
#

@strong canopy You can delete messages

#

@rancid pecan enableEnvironment script command

#

@queen cargo Please don't spam.

rancid pecan
#

@still forum yes

#

i did but don't work

#

enableEnvironment true;

#

or enableEnvironment [true,true]; vs..

#

there are still no fish

lone glade
#

if the map doesn't support them they won't be there

drowsy axle
#

Anyone used Patrol Ops 4 (scripting wise) before?

lone glade
#

it was released ?

peak plover
#

Beta or sth

drowsy axle
lone glade
#

3 was a goddamn mess

peak plover
#

4 seems like it too

tough abyss
#

so Im trying the static animations

#

I have the Direone mod installed

#

than I do

#

variablename switchMove animationname;

#

than I do spectate in sp

#

and nothing

#

am I doing something wrong

meager heart
#

unit switchmove animationname;

tough abyss
#

yes

#

is switchmove lowercase?

lone glade
#

case doesn't matter for commands

tough abyss
#

ah

lone glade
#

it's very likely the AI just goes back to idle anim after it's done

tough abyss
#

so is there a way to set duration?

#

or make it indefinate

lone glade
#

disable anims after using switchmove

#

using disableAI

#

and now bedtime for realsies

tough abyss
#

alright

half relic
#

nighty night.

tough abyss
#

gnight

#

so I name my unit s1

#

than I use this command

#

s1 switchMove "combat_9"; s1 disableAI "anim";

#

and nothing?

meager heart
#

you can try add this in unit init

this switchMove "combat_9";
this playMove "combat_9";
tough abyss
#

both?

meager heart
#

yep

tough abyss
#

alright

meager heart
#

and do not disableAI

tough abyss
#

do I play it in spectate or play scenerio than go splendid cam

#

will the 2nd way disable the static pose?

meager heart
#

you can press prewiev in editor or play it (if debug console enabled, no idea how it looks in sp)

tough abyss
#

thanks

meager heart
#

yw

tough abyss
#

doesnt really go over static animations :/

#

sometimes does nothing sometimes he put his weapons behind his backk

exotic tinsel
#

ive searched the nets for something straightforward to show me how to connect a specific uav gunner feed to a monitor. Not looking for a mod just wanted to know how to do it via script. I saw examples that it could be done but no info was provided. Does anyone know how to do this without using a mod, just script?

young current
#

keyword would be render to texture

exotic tinsel
#

found this, think im set now. also thanks @young current , that got me started and im going to use that for the rest.

young current
#

๐Ÿ‘Œ

warm gorge
#

How could I find out the sound a fuel truck plays when you refuel a vehicle with it? Ive tried checking all the config values, and its not in there, so kinda stuck.

little eagle
#

It may hard coded. Not everything is configurable.

subtle ore
#

Check the gas station vehicle class, there may be some user actions t hat play the sound when refeuling

tough abyss
#

Hello

#

can I ask for help here?

still forum
#

Don't ask to ask. just ask. If it's a #arma3_scripting question then this is the correct place

tough abyss
#

@still forum I am not English but French sorry, I ask my questions then

#

I would like to create a name tag with icons on the players' heads but how would I proceed?

still forum
#

You would use drawIcon3D. Assuming you already have lots of knowledge about scripting. Otherwise that might not be the best project to start learn scripting.
Also there are mods that already do that

tough abyss
#

yes I looked on the bohemia wiki my examples provided does not work

peak plover
#

whadd

#

post code by typing
```sqf
<my code here>
```

it will end up looking like

<my code here>
// comment
baba = (player getVariable ['blabla',true]);
#

@tough abyss

little eagle
#

There are literally hundreds of examples of this on the internet. They're easily found on Google. I think the best tip you can get is to use www.google.com/ncr from now on, so you're not stuck with priority to crappy French search results. "NCR" is for "no country redirection" or something like that.

peak plover
#

OHhh i didn't know that

#

That's good to know

#

Thanks popoo man

peak plover
#

Idea: What's the unit with least amount of gear for each faction? Is it basic rifleman?

#

How can I spawn a unit with the least amount of gears

#

Can I spawn in VR men and give them groups and have them fight for a faction (ai)?

exotic tinsel
#

whats the prefered site here for uploading and sharing an image via link?

fossil yew
#

What is the low level command that makes AI go to cover?

peak plover
#

@exotic tinsel imgur. I think it doesn't have ads

#

What do you mean go to cover? Like the group function "take cover" ?

exotic tinsel
#

im applying texture with this

_displayterminal setObjectTexture [0, "#(argb,8,8,3)r2t(_camera,2.67)"];
#

tweaked it to this but its still got noise

_displayterminal setObjectTexture [0, "#(argb,512,512,1)r2t(_camera,1.33)"];
unborn ether
#

@TomAutobahn#3977 there is no low level command, BIS had one, but didn't implement it. You can achieve something like this by playing with 'enableAI' using "COVER" part

tough abyss
unborn ether
#

@tough abyss eh, createVehicleLocal

tough abyss
#

@unborn ether I have no knowledge of how to code for Arma 3

unborn ether
#

@tough abyss well, not the best way to start, but you can try reverse-engineering something existing, to get how to at least create it.

meager heart
#
0 spawn 
{
    private _laptop = "Land_Laptop_unfolded_F" createVehicle (player modelToWorld [0.5,2,0]);
    _laptop setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
    
    private _uav = createVehicle ["B_UAV_01_F", _laptop modelToWorld [0,50,20], [], 0, "FLY"];
    createVehicleCrew _uav;

    private _wp = group _uav addWaypoint [position _laptop, 0];
    _wp setWaypointType "LOITER";
    _wp setWaypointLoiterType "CIRCLE_L";
    _wp setWaypointLoiterRadius 100;
    
    _uav lockCameraTo [player, [0]];

    private _cam = "camera" camCreate (player modelToWorld [0,5,1]);
    _cam cameraEffect ["Internal", "Back", "uavrtt"];
    _cam camSetFov 0.75;
    _cam camCommit 1;
    _cam attachTo [_uav, [0,0,0], "PiP0_pos"];

     "uavrtt" setPiPEffect [0]; // Normal - [0], Night Vision - [1] Thermal - [2]... check wiki for more

    while {!isNull _uav} do 
    {
        private _dir = (_uav selectionPosition "PiP0_pos") vectorFromTo (_uav selectionPosition "PiP0_dir");
        _cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [_dir select 1, _dir select 0, 0]];
    };
};

@exotic tinsel

exotic tinsel
#

holy crap, ill have to spend the next four hours getting in to that. thanks mate

meager heart
#

๐Ÿ˜„

tough abyss
#

@unborn ether I have general coding experience, but not for games

exotic tinsel
#

ive currently got this roughly working, however the view is not the gunner cam. ill post pic in sec

params ["_displayterminal", "_uav","_camera"];

/* create render surface */
_displayterminal setObjectTexture [0, "#(argb,512,512,1)r2t(" + _camera + ",1.33)"];

if (_camera == "mbow_cam_1") then
{
    _uav lockCameraTo [MB_Commander, [0]];
};


/* create camera and stream to render surface */
_cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["Internal", "Back", _camera ];

/* attach _cam to gunner _cam position */
_cam attachTo [_uav, [0,0,0], "laserstart"];

/* make it zoom in a little */
//_cam camSetFov 0.1;

/* switch _cam to thermal */
//_camera setPiPEffect [1];

/* adjust cam orientation */
_camtrg = "Sign_Sphere10cm_F" createVehicleLocal position _cam;
hideObject _camtrg;
_camtrg attachTo [_uav, [0,0,0], "commanderview"];
_cam camSetTarget _camtrg;
_cam camCommit 1;

meager heart
#

almost there ๐Ÿ˜„

exotic tinsel
#

time to digest ur code

#

trying to use this with greyhawks, pip pos and dir dont seem to be right. im using laserstart for pippos and commanderview for dir. anythoughts?

#

better yet, where do i find these pip and dir for vehicles?

meager heart
#

afaik they all the same for all uavs...

#

its just position and direction for the .... camera

exotic tinsel
#

well.... i adapted ur code to mine and ill post what im getting on a greyhawk

params ["_displayterminal", "_uav","_camera"];

/* create render surface */
_displayterminal setObjectTexture [0, "#(argb,512,512,1)r2t(" + _camera + ",1.33)"];

if (_camera == "mbow_cam_1") then
{
    _uav lockCameraTo [MB_Commander, [0]];
};


/* create camera and stream to render surface */
_cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["Internal", "Back", _camera ];

/* attach _cam to gunner _cam position */
_cam attachTo [_uav, [0,0,0], "PiP0_pos"];

/* make it zoom in a little */
//_cam camSetFov 0.1;

/* switch _cam to thermal */
//_camera setPiPEffect [1];

while {!isNull _uav} do 
{
    private _dir = (_uav selectionPosition "PiP0_pos") vectorFromTo (_uav selectionPosition "PiP0_dir");
    _cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [_dir select 1, _dir select 0, 0]];
};
#

the gunner is actually pointing at the commander in base

#

but the view is fixed on the nose

#

gonna pull my hair out

exotic tinsel
#

hang on may have sorted it

meager heart
#
uavCameraDriverPos = "PiP0_pos";
uavCameraDriverDir = "PiP0_dir";
uavCameraGunnerPos = "laserstart";
uavCameraGunnerDir = "commanderview";
#

from the config ^ (B_UAV_02_F)

exotic tinsel
#

im still debuggin

#
0 spawn 
{
    private _laptop = "Land_Laptop_unfolded_F" createVehicle (player modelToWorld [0.5,2,0]);
    _laptop setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
    
    private _uav = createVehicle ["B_UAV_02_F", _laptop modelToWorld [0,50,20], [], 0, "FLY"];
    createVehicleCrew _uav;

    private _wp = group _uav addWaypoint [position _laptop, 0];
    _wp setWaypointType "LOITER";
    _wp setWaypointLoiterType "CIRCLE_L";
    _wp setWaypointLoiterRadius 100;
    
    _uav lockCameraTo [player, [0]];

    private _cam = "camera" camCreate (player modelToWorld [0,5,1]);
    _cam cameraEffect ["Internal", "Back", "uavrtt"];
    _cam camSetFov 0.75;
    _cam camCommit 1;
    _cam attachTo [_uav, [0,0,0], "lasertarget"];

     "uavrtt" setPiPEffect [0]; // Normal - [0], Night Vision - [1] Thermal - [2]... check wiki for more

    while {!isNull _uav} do 
    {
        private _dir = (_uav selectionPosition "lasertarget") vectorFromTo (_uav selectionPosition "commanderview");
        _cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [_dir select 1, _dir select 0, 0]];
    };
};
#

crap, see issue with laser

meager heart
#

lasertarget ^

exotic tinsel
#

running it now with fix

#

well crap it works your way lol

#

ive tried to convert what you sent to work in a function for dynamic use. but its not working. are you willing to trouble shoot?

meager heart
#

๐Ÿ˜„

exotic tinsel
#

yeah no one wants to hear "will you help me fix the code i butchered that you wrote"

meager heart
#

afaik that how it works: you make something, fail, you try it again.. and so on... until it works

exotic tinsel
#

here is my call from the init of the monitor

[this, MB_OW_uav_1, "mbow_cam_1"] call TLS_fnc_uavFeed;

here is ur code butchered

params ["_displayterminal", "_uav","_displaytexture"];
    
_displayterminal setObjectTexture [0, "#(argb,512,512,1)r2t(_displaytexture,1)"];

_uav lockCameraTo [MB_Commander, [0]];

private _cam = "camera" camCreate (_displayterminal modelToWorld [0,5,1]);
_cam cameraEffect ["Internal", "Back", _displaytexture];
_cam camSetFov 0.75;
_cam camCommit 1;
_cam attachTo [_uav, [0,0,0], "laserstart"];

_displaytexture setPiPEffect [0]; // Normal - [0], Night Vision - [1] Thermal - [2]... check wiki for more

while {!isNull _uav} do 
{
private _dir = (_uav selectionPosition "laserstart") vectorFromTo (_uav selectionPosition "commanderview");
_cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [_dir select 1, _dir select 0, 0]];
};
little eagle
#

The while loop has no suspension.

exotic tinsel
#

crap, duh. my bad. back to the drawing board

meager heart
#

yep will be less wasted cpu power, but camera focus will be jumpy a bit...

little eagle
#

Atm the code is unscheduled, so it will just quit in frame 1 after 10k iterations. And even if you use the scheduler, this would execute ~1200 times a frame, eat all the scheduler time from other scripts and be "jumpy" anyway, because it will be put on the bottom of the stack no matter what.

exotic tinsel
#

well... i got this to work but in its current state @little eagle will it still be an issue in the way you described?

this is in the init.sqf

[MB_displayer_lg_ow, MB_OW_uav_1, "mbow_cam_1"] spawn TLS_fnc_uavFeed;

This is the function

params ["_displayterminal", "_uav","_displaytexture"];

/* create render surface */
_displayterminal setObjectTexture [0, "#(argb,512,512,1)r2t(" + _displaytexture + ",1.33)"];

if (_displaytexture == "mbow_cam_1") then
{
    _uav lockCameraTo [MB_Commander, [0]];
};


/* create camera and stream to render surface */
private _cam = "camera" camCreate (_displayterminal modelToWorld [0,5,1]);
_cam cameraEffect ["Internal", "Back", _displaytexture ];

/* attach _cam to gunner _cam position */
_cam attachTo [_uav, [0,0,0], "laserstart"];

/* make it zoom in a little */
//_cam camSetFov 0.1;

/* switch _cam to thermal */
//_displaytexture setPiPEffect [1];

/* adjust cam orientation */
while {!isNull _uav} do 
{
    private _dir = (_uav selectionPosition "laserstart") vectorFromTo (_uav selectionPosition "commanderview");
    _cam setVectorDirAndUp [_dir, _dir vectorCrossProduct [_dir select 1, _dir select 0, 0]];
};
little eagle
#

Yes, you have to put a sleep there or use waitUntil.

meager heart
#

LifeSnatcher, is it for some intro or ?

exotic tinsel
#

no its so sqaudleads can review the mission area while the uav pilot surveys.

#

spectating really from base

#

if its too big of a lag on the server then i dont need it.

little eagle
#

Just use waitUntil and it will be executed once a frame at max. Really not that difficult.

exotic tinsel
#

thanks @meager heart for the code, got it working!

meager heart
#

nice

exotic tinsel
meager heart
#

When that happens ?

exotic tinsel
#

uav feed on the rugged large screen at night. uav set to thermal

meager heart
#

set to thermal with setPiPEffect ?

exotic tinsel
#

yup, on any other monitor its fine.

meager heart
#

you can try use setObjectTextureGlobal for that monitor

exotic tinsel
#

ill give it a try thanks mate

#

na, also i misspoke before it also does it on the tv screen too.

#

looks ok though on billboard

meager heart
#

maybe in monitor init already r2t texture and you set one more on top... idk

exotic tinsel
#

this is in the texture field on the monitor properties. #(argb,8,8,3)color(0,0,0,0.0,co)

meager heart
#

just checked with the same monitor, it works

exotic tinsel
#

hmm

#

yeah laptop is good, billboard is good, tv not good, other monitors not good. wtf

#

yeah i just used ur org script and spawned in that monitor "Land_TripodScreen_01_large_F", still has the lines for me. no clue

meager heart
#

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

exotic tinsel
#

u didnt get lines on your test? same monitor?

meager heart
#

no

exotic tinsel
meager heart
#

your video settings maybe ๐Ÿ˜€

exotic tinsel
#

i guess. screw it. its survivable for now.

#

thanks though for all the help to get it working.

meager heart
#

have fun, dude

exotic tinsel
#

you too mate

torn juniper
#

Has anyone gotten boats to work properly with dynamic simulation? Made a spawn script but they seem to float up and down from 2m +/- above and below water when someone gets close to simulate them

tough abyss
#

@torn juniper have you attempted to change the distances?

stable wave
#

Is it possible to enable crosshairs for the pawnee without changing server difficulty ?

torn juniper
#

@tough abyss I have not, set at default 250m

#

However they never settle even after spawning, unless a player gets in the driver seat

unborn ether
#

@torn juniper I've made a note there

#

@torn juniper Basically what happens is that your boat is simulated too late and it start floating like it should

torn juniper
#

So they would need a fairly high distance then

unborn ether
#

Well the distance from which you can really spot it, that's why I mentioned a fog coefficient

torn juniper
#

Think Ill try messing with the numbers based on view distance then, thanks ๐Ÿ˜ƒ

#

Think global distance is only 3k-4k but I will check out your notes

#

Thanks much!

peak plover
#

Nice share Demellion

tough abyss
#

Why is this having different effects?

Method 1:

myPos = getPos player;
myPad = "Land_HelipadSquare_F" createVehicle [myPos select 0, myPos select 1];
myPad setDir 0;
theWalls = [];

private _walls = [[[-15, 0, 1], 90], ....];
{
    _x params ["_vec", "_dir"];
    private _wall = "Land_CncWall4_F" createVehicle (position myPad);
    _wall attachTo [myPad, [_vec select 0, _vec select 1, 1] .....;
    _wall setDir _dir;
    private _objPos = getPosATL _wall; 
    private _objDir = getDir _wall; 
    detach _wall; 
    _wall setDir _objDir; 
    _wall setPosATL _objPos; 
} forEach _walls;

https://gyazo.com/e473cfc80f2602e9cabafae028ca102a

#

Method 2:

myPos = getPos player;
myPad = "Land_HelipadSquare_F" createVehicle [myPos select 0, myPos select 1];
myPad setDir 0;
theWalls = [];

private _walls = [[[-15, 0, 1], 90], ......];
{
    _x params ["_vec", "_dir"];
    private _wall = "Land_CncWall4_F" createVehicle (position myPad);
    _wall attachTo [myPad, [_vec select 0, _vec select 1, 1] ........;
    _wall setDir _dir;
    theWalls pushBack _wall;
} forEach _walls;

Then run this seperately after:

{ 
    private _objPos = getPosATL _x; 
    private _objDir = getDir _x; 
    detach _x; 
    _x setDir _objDir; 
    _x setPosATL _objPos; 
} forEach theWalls;

https://gyazo.com/4b5ebff77dfd964e27ff97b626729cfd

quasi thicket
#

@little eagle - The loadscript you provided still left players on the ground :(


if (isServer) then {
    skipTime ((23 - daytime) % 24);

    private _plane1Cargo = units alpha + units bravo;
    private _plane2Cargo = units charlie + units delta;

    {
        [_x, [plane1, _forEachIndex]] remoteExec ["moveInCargo"];
    } forEach _plane1Cargo;

    {
        [_x, [plane2, _forEachIndex]] remoteExec ["moveInCargo"];
    } forEach _plane2Cargo;
};

exotic tinsel
#

is there an experienced coder willing to look over my 14 functions and point me in the direction of what i need to do to get them to work for multiplayer on a server. not trying to ask someone to fix them or write code just advise me on how to get each one to work with the best methodes. the issue is i have only been arma scripting for a couple months and i just dont know what is what anymore lol.

#

PM me if your willing to lend a hand.

little eagle
#

Maybe something is wrong with your groups, NyteMyre.

limpid rapids
#

I was wondering if anyone had any pointers on what is the best starting point / place to look for overriding the default revive respawn system? I would like the player to die normally, but then have the option to wait to be revived, or choose to respawn immediately. I would also like the ability to modify the camera when they die. I was thinking of using a 'killed' event handler but I wasn't sure how to respawn them if I have respawn turned off, plus if its turned on it triggers the default method. I basically want to handle death similiar to how it is handled in the KOTH maps I have played.

nocturne basalt
#

hi guys. Is it possible to spawn particleeffects using a script?

#

I would like to add smoke under certain conditions

young current
nocturne basalt
#

awesome ty ^^

young current
#

๐Ÿ‘Œ

peak plover
#

How do I setup dev. for mission?

#

Like edit scripts live when mission running?

#

I dno what it's called so I am unable to google

meager heart
#

Recompile you mean ?

peak plover
#

Hmm, yes?

#

Is there a way to be able to edit functions when the mission is running in the editor?

#

I know I heard about it

#

can't remember

meager heart
peak plover
#

Ohh, thanks I'll try it

meager heart
#

i heard there is some way to do it with cfg... but no clue

lone glade
#

live reload configs?

meager heart
#

yep

lone glade
#

only in the diag exe

#

diag_mergeConfigFile

meager heart
#

is it dev only ?

lone glade
#

dev branch only.

meager heart
#

thanks man

peak plover
#

I did
allowFunctionsRecompile = 1;

#

But it does not seem to work :\

#

Anyway

#

What's the best way to find a habitable position

#

for a unit?

lone glade
#

"habitable" wat

peak plover
#

Not a rock

#

Not a house

#

a position where a unit can stand

#

isFlatEmpty has issues with powerlines

#

Having a bunch of trouble

#

getting past powerlines

knotty mantle
meager heart
#

"House", "Building" with nearestObjects ?

knotty mantle
#

^maybe?

rancid ruin
#

findsafepos is shite

#

better to write your own solution imo

#

i wrote one but my c drive died the other day and i lost all my recent arma stuff

peak plover
#

Hmm

lone glade
#

you're going to have that issue where you get positions inside of rocks, because they're not part of the terrain, there's still flat ground" "inside of them"

meager heart
#
What's the best way to find a habitable position for a unit?
Not a rock
Not a house
Having a bunch of trouble getting past powerlines

๐Ÿค”

#

you need then isHabitable /s

peak plover
#

yeah

#

Well

#

It's fine as I increased check and range

#

But I kinda wouldn't mind alt.

#

Hmm

#

Got recompile to work, but only in single player

meager heart
#

only one editor where i am doing something, on local host... and was no troubles with recompile

peak plover
#

hm

#

maybe it needed restart

#

I'll try again later

lone glade
#

TIL:
Bad conversion: bool
is a thing

earnest willow
#

if anyone is able to help me that'd be great, I'm trying to add an action to the Device object, which when triggered will cause an earthquake. I have a tiny amount of experience coding

molten yacht
#

Okay, I'm trying to figure out this guy's laptop script.

He says

You can check if the download on a laptop/object was finished and/or if someone uses the object by checking the following variables saved to the object: _laptopInUse = _myLaptop getVariable [ "T8L_pvar_inUse", false ]; _downloadComplete = _myLaptop getVariable [ "T8L_pvar_dataDownloaded", false ];

So do I put _myLaptop down in the Trigger Condition?

#

Or what....

rancid ruin
#

what trigger condition?@

#

we can't read your mind bro you need to explain what you're on about

molten yacht
#

Sorry. So the laptops have a script all to themselves. When it's done, it flips that flag aforementioned to true. I'm trying to figure out how to activate a trigger when that flag goes to true. Or even just signal a task to go to completed.

#

So the _downloadComplete on laptop01 would set the task "Secure Laptop #01" to Complete.

#

But I'm not sure how to have a trigger check to see if it's true or not.

rancid ruin
#

i can tell you this much

#

i hate triggers

little eagle
#

Why the trigger, why not set the task to completed directly?

#

Task module?

molten yacht
#

That's just as good. But I still don't know how to check the "finished" variable

rancid ruin
#

_myLaptop is referring to the laptop object

#

but it's a local variable (denoted by the fact it starts with _) so you can't access _myLaptop in every script - just the one where it's defined

#

the easiest way would be to just name your laptop myLaptop in the editor

little eagle
#

That's just as good. But I still don't know how to check the "finished" variable

Well:

_downloadComplete = _myLaptop getVariable [ "T8L_pvar_dataDownloaded", false ];

Or do you not know how to access the laptop object?

molten yacht
#

I think I found how it should work. one Second

#

Condition == laptop02 getVariable [ "T8L_pvar_dataDownloaded", false ]

#

I think this should work. I'll report back if it does.

rancid ruin
#

if it returns a bool (true/false) then it'll work

#

hard to say because we haven't seen this guy's script

little eagle
#

Name implies boolean and so does the default value.

rancid ruin
#

you can't take anything for granted in arma or sqf

little eagle
#

Bad scripting has nothing to do with Arma or SQF.

#

At least the globals are tagged. This brings this script into the top 10 percent already.

rancid ruin
#

there's spelling mistakes in the sqf api, this is the perfect place for bad scripts

#

it's no wonder people write shitty stuff when the whole game is built on shitty stuff

little eagle
#

Do you really think the quality of community made scripts would improve if they change the spelling of the dammaged event handler?

molten yacht
#

Okay, so I've verified with a trigger that that's the right variable. So I put the same thing in a task state module, and synced it to the create-task module. But it doesn't complete the task. Any ideas?

rancid ruin
#

would general script quality go up if the script api itself were better maintained/developed? yes

#

@molten yacht paste all the relevant code you've written

molten yacht
#

Okay. Given that (X!) is = true, and the trigger's "Condition" field will respond correctly

peak plover
#

It would go up if we got weekly guides by Jay Crowe commy2 on how to save precious ms when writing scripts

molten yacht
#

I guess the real question is: How do I link a "set task state" module to the target task.

peak plover
#

module

#

no clue

molten yacht
#

hmm

#

maybe I'll just use the trigger and.... _tsk1011 setTaskState "Succeeded"; ?

#

task id = 1011

#

Hmm. That doesn't work.

#

Neither does _tsklap1, the variable name. Maybe just _lap1?

rancid ruin
#

these are local variables

#

none of them will do shit unless you've defined them as something

molten yacht
#

Okay, so the task id is 13 and the task module's name is "lap1"

little eagle
#

The module name is not the same as the laptop's name.

molten yacht
#

Okay, so what's the task's name?

#

shouldn't it be 13 or tsk13?

#

That's the ID it was given.

rancid ruin
#

....you're the one who created it, you tell us

#

you made the task via sqf or editor?

molten yacht
#

In the task creation module, the unique ID is 13.

#

The parent task ID being 10001.

#

(So all three laptops are grouped up under a master task)

#

I'll just say SQF is fucking awful compared to C#.... holy shit. There's like zero good documentation...

rancid ruin
#

one was made by microsoft. the other was made by eastern europeans on a budget.

molten yacht
#

Yep.

#

It shows.

rancid ruin
#

(and documented by a community of gamers)

#

there's also a culture of just keeping things to yourself once you figure them out, among some people

#

not many people contribute to the wiki, or are even able to afaik

#

think it's locked down to a few people effectively

little eagle
#

As if those had anything to contribute.

lone glade
#

there's also a culture of just keeping things to yourself once you figure them out, among some people
they won't contribute anything anyways

molten yacht
#

But yeah. Task ID = 13. So I don't know how to tell SetTaskState that that's the one I want.

#

Unless it's literally just 13 SetTaskState Succeeded.

rancid ruin
#

well nah, like KK (although he was generally good) would straight up ignore 15 questions "how did you do X?"

little eagle
#

Doubt you can activate task modules using the SQF command.

rancid ruin
#

like dude just fucking paste the script lol

molten yacht
#

There's no script. This is the "On Act" part of a trigger.

rancid ruin
#

sorry not you, Killzone Kid

molten yacht
#

Okay.

rancid ruin
#

have you sync'd everything correctly? modules love syncing shit

little eagle
#

The module tasks' state are changed using the Set task state module.

molten yacht
#

Yes.

little eagle
#

8.Now the last part. Create the module "Set task state" set it to succeeded and synchronize it with "Create Task", "Set Task Destination" and the trigger you've placed.

#

So where's the problem?

#

Btw, imo this would be way easier without the modules.

#

Clunky af.

molten yacht
#

Okay, so the trigger's activation will automatically twig the module. Got it.

#

I was trying to use the module's condition as if it were the trigger's condition.

little eagle
#

This was the first result I found with google. Never used Trigger modules myself. Decided long ago that they didn't offer anything useful that wasn't available otherwise.

rancid ruin
#

i was experimenting with controlling the civilian presence module via script, before my c drive died

#

the module cancer is probably what killed the drive tbh

little eagle
#

Surely.

molten yacht
#

Okay. So since briefing.html is out, and I hate the task modules, how can I call a briefing SQF? Just put createDiaryRecord; in init.sqf?

#

Or maybe []execVM "briefing.sqf" ?

#

Because the Diary Records are ASS.

#

like holy shit they're so bad if you use the module. Randomly ordered.

edgy dune
#

question

#

so i got this little piece of code

#
 _this addMPEventHandler ["MPKilled", {
    _victimName = name (_this select 0);
    _killerName = name (_this select 1);
    _weaponName = getText (configFile >> "cfgWeapons" >> currentWeapon (_this select 1) >> "displayname");
       hintSilent format ["%1 was killed by %2 with a %3", _victimName, _killerName, _weaponName];
   }];

#

problem is that

#

say I put it on a nato ai,named bob right.

#

it hints out saying

#

bob was killed by bob with bobs own weapon

#

even if a opfor unit kills it

#

any ideas why?

molten yacht
#

I mean, it's getting the weapon of bob instead of bob's murderer

#

but there's already a script designed for a killfeed on armaholic, y'know

edgy dune
#

how would I get the name of bobs murders then? and I guess their weapon too?

molten yacht
#

It's beyond me, man.

edgy dune
#

rip

molten yacht
#

like I said, tho

#

go on armaholic

#

someone's already done it

edgy dune
#

oh really? wats it called

#

killfeed correct?

molten yacht
#

prolly

#

it's on like page 4 or something

edgy dune
#

cool

#

foun dit

molten yacht
#

Okay, so description.ext lets you set tasks but not diary entries

#

Thanks arma

#

(fuck you, arma)

edgy dune
#

๐Ÿ˜›

#

oooooofff that mod is a bit too fancy for wat I need

molten yacht
#

You can probably cut bits out of it

edgy dune
#

I wanted a lowkey way to say wat killed a player XD

#

ohhh well

molten yacht
#

at the very least, it'll show you how to get the weapon name

#

and the enemy user

edgy dune
#

yea i think thats wat I need the most

#

damn

#

I still get it where it hints the same name,aka the unit that dies

#
    _this addEventHandler["Killed",{
            
            hint format["killed : %1  -------- killer : %2",(_this select 0),(_this select 1)];
            }];
#

omg

#

paraenthesis help

#

lol

#
    _this addEventHandler["Killed",{
            
            hint format["killed : %1============killer : %2",(name((_this) select 0)),(name((_this) select 1))];
            }];

``` tihs works lol
#

this*

molten yacht
#

Okay, so, there needs to be a SetTaskParent thing...

#
 _lp3 setSimpleTaskDescription ["Find the third stolen laptop and secure it.", "Secure Laptop", ""];
 _lp3 setTaskState "Created";

 _lp2 = player createSimpleTask ["Laptop # 2"];
 _lp1 setSimpleTaskDescription ["Find the second stolen laptop and secure it.", "Secure Laptop", ""];
 _lp2 setTaskState "Created";

 _lp1 = player createSimpleTask ["Laptop # 1"];
 _lp1 setSimpleTaskDescription ["Find the first stolen laptop and secure it.", "Secure Laptop", ""];
 _lp1 setTaskState "Created";
 
 _lpm = player createSimpleTask ["Stolen Data"];
 _lpm setSimpleTaskDescription ["Laptops were stolen, filled with classified data. Retrieve them.", "Get them back.", ""];
 _lpm setTaskState "Created";```
edgy dune
#

oh what the hell,the killed eh doesnt work for nonvinilla units

#

or could be becuase of ace ๐Ÿ˜ฆ

molten yacht
#

It's always ace

molten yacht
#

God fucking damnit.

still forum
#

Who wanted to participate on that sqf blog again? I just got the arma3 github organization for us. So we have arma3.github.io now

unborn ether
#

@still forum sqf blog? What about it?

still forum
#

The thing we talked about here a week or two ago

#

Like KK's blog. But written by multiple people and anyone can contribute via pull request or similar

little eagle
#

Link?

still forum
#

doesn't exist yet

peak plover
#

๐Ÿ‘Œ๐Ÿผ

quasi rover
#

Is it a big load to the Server that if I set allDamage false to all Map buildings?

still forum
#

not really

#

Ofcause way more load than if you just set the buildings that you actually need

quasi rover
#

Thanks.

little eagle
#

So what, contributions are markdown?

still forum
#

Yeah

#

Like ACE wiki

delicate totem
#

@Namenai#3053 I'm using the killed EH on CUP units with ACE right now, no issues.

still forum
little eagle
#

Heh.

#

But what to write about? You'd get an audience by writing (and explaining) code snippets of stuff people want and can copy paste.

still forum
#

Dunno ^^
I know I'll write stuff about SQF internals that I keep repeating in here

little eagle
#

E.g. one article about code precedence.

#

Like the ultimate article explaining everything you can just copy paste the link to every time some asks about it.

still forum
#

yeah

#

Though packing EVERYTHING into one article might not be the bestest idea

little eagle
#

Well, you don't have to mention elseType that doesn't exist in the article, but just list else as 5.

#

It's not that complex.

#

But do you really think people care about that? They'd rather copy paste a nametag script.

still forum
#

Some probably do ยฏ_(ใƒ„)_/ยฏ

#

Not everyone always copy pastes someone elses crap

#

Most do. But not all ๐Ÿ˜„

little eagle
#

Let's be realistic.

meager heart
#

But what to write about?
Good examples, bad examples, some sort of tricks, some solutions, anything sqf related will be nice to have... atm we have 0 sqf blogs

little eagle
#

Thesis: KK wrote about everything already.

meager heart
#

afaik its dead

peak plover
#

That is why he quit cuz he had already right written about everything

little eagle
#

Yes, but the page is still there.

meager heart
#

sqf drama maybe... "Once i tried to align weapon on a weapon holder" ๐Ÿ˜„

peak plover
#

Or why not to use distance and use inArea

still forum
#

Also KK already stopped 2 years ago. params, private keyword, remoteExec, all Eden stuff.
Kinda weird reading his posts about variables... _var is a private variable private "_var"; is a private variable that is exclusive to this scope (Which is not completly correct)
Then there are private special variables which are... Just normal local variables(_x). He also calls them reserved variables although they are not reserved.
And also Public local variables

var1 = 1;
var2 = 2;
for "_i" from 1 to 2 do {
    private "_myvar"; //notice how _myvar needs to be predefined
    call compile format ["_myvar = var%1;", _i];
    diag_log _myvar;
};

๐Ÿคฆ

Then there are Public local special variables such as true false time enemy friendly sideLogic sideUnknown sideFriendly sideEnemy playerSide east west civilian resistance independent opfor blufor nil objNull grpNull netObjNull locationNull taskNull controlNull displayNull teamMemberNull player
Uhuh... Yeah... These are totally variables...

Then there are Public global variables which actually don't exist and are just normal missionNamespace variables that you publicVariabled once or just thought about maybe publicVariabling them at some point somewhere.

After he joined BI and really learned how things work he already stopped writing basic tutorials. So even if he wrote about lots of stuff... Most of it wouldn't hurt to be rewritten properly.

little eagle
#

Wiki calls them "magic variables". They're not really reserved, although you have to watch out for them to not be overwritten by accident I guess, e.g. when nesting two forEach.

#

Public global variables is fine. There is no difference between a global and a public global technically, but in usage there is. And describing a descriptive model of SQF is more important than the boring internals imo.

#

I guess one difference is, that a public global variables value is synronized from the server for JIP clients. So they are different in a way.

#

public globals can also belong to an object namespace, and probably also group, but I'm not sure those are synched properly for JIP.

still forum
#

yeah they are synced properly

little eagle
#

Don't think there're any reserved variables aside from commands. And no command begins with under score.

still forum
#

You could call every compileFinal'ed script variable a "reserved" variable as you can't write to them

little eagle
#

True. Dunno how useful it is to separate functions and variables though.

#

On the one hand, it makes it easier to categorize different parts you encounter when working on the code, on the other it discourages usage of local functions.

still forum
#

IMO it doesn't make sense. Variables are variables no matter what's inside them.
Same as commands are commands and not variables. Just have to keep in mind that Public local special variables is just another word for commands

little eagle
#

You don't think it's benefitial to think of variables and functions as different things, even with the disclaimer that functions are CODE type variables?

#

Because I do think it's good practice to keep them separate.

#

Whether or not you want to use Hungarian notation for that is up to debate, but no one should support e.g. redifing functions mid mission.

quaint turtle
#

Hey, does anyone know what could be causing this to spam in my RPTs? 10:42:29 Overflow 10:42:29 Overflow 10:42:30 Overflow I know it's a big vague, but that's near enough all i'm getting besides loading addons & general errors

unborn ether
#

@little eagle well Dedmen is right at some point, some new things should be explained since KK quit and his web will also go down eventually. Comes up with community needs a stable blog

still forum
#

Biggest problem with KK's blog is that it's done by one guy. He once wrote down and told people about how he thought things work.
Since then he learned how they actually work and things have changed, but the old entries are left there for noobs to find and get hung up on.

unborn ether
#

@still forum You wanna make it alike a huge FAQ?

still forum
#

Dunno yet. Most stuff on there won#t be frequently asked ^^

lone glade
#

explaining the basics of sqf is a start i'd say

still forum
#

I'll write stuff about the internals of the SQF engine. As to why things are like they are when people think "WTF is dis".
I think other guys planned making a SQF tutorial like many people want. In written form and properly.
Properly aka not written by one Life scripter sitting in his dark conor and imagining how things work instead of actually informing himself.
Good thing is also that through the open-source and PR nature many people look over the entries. Instead of one guy just writing down what he thinks.

lone glade
#

or youtube videos....

unborn ether
#

Nice idea, because there's no resource like this yet, besides KK blog which is not going to be the similar

still forum
#

I need a title for my internals posts. Something cool...
Inside the Engine or behind the sences sounds boring.

worldly locust
#

You do realise that this is the scripting channel? Not the talk about blog channel? However, rather than showing off your e-peen about semantics, you'd be far better off teaching basics that would get more people off the ground.

still forum
#

What?

#

A blog about scripting is not scripting?

#

You do realise that this is the scripting channel and not the "rant about something without real reason" channel?

#

As I already said other people want to make stuff to teach people basics. And no I wouldn't be better of trying to teach people basics, as I don't have the skills to write stuff so that 5 year olds can understand it.

#

Why don't you do it? It's open-source and everyone is free to contribute.

cosmic kettle
#

@still forum I for one think it's a good alternative, even though I'm quite sure KK's site will remain up for quite a while. The only issue I see would be that you'll still have to curate entries.

still forum
#

KK already said it will stay up

#

Entries will be curated. As someone has to approve the pull request. Granted. Could be done without reading it...

lone glade
#

You can't "not" curate using github unless you merge pull requests without checking what you're merging

cosmic kettle
#

leading me to my next point; The everyone in "everyone can contribute" specifically means; those that qualify?

lone glade
#

No, anyone that has enough of a brain to create an account on github and send a PR

#

then it's all basesd on the PR content

still forum
#

Ofcause people can still say "we don't want that" or "It doesn't fit the blog".
But they usually just say "Fix this" while pointing to a typo

lone glade
#

example:
literally 80% of my PRs for ACE3 ๐Ÿ˜„

still forum
#

Like. Personally I would want to keep the script snippet spam low.
We don't need someone posting "Hey look at this life car shop script I made"

cosmic kettle
#

Thanks for clarifying. I for one would be interested to participate.

lone glade
#

as long as it's an example for another "chapter" or topic i'm fine with it tbh

still forum
#

Repo is at https://github.com/arma3/arma3.github.io
We don't have any structure in it yet. But if you want you can already prepare something. As I wrote above it's basically just markdown, you can look at ACE thing I linked above for example.
We can move it into the correct place and stuff later when that correct place exists

compact galleon
#

@still forum _var is a local variable, not private variable. private _var forces declaration in the current scope, regardless of whether one exists up the call chain

still forum
#

I know how things work ^^

#

What I posted above was what KK wrote

compact galleon
#

alright

#

___switch is one of those "magic" vars

still forum
#

For that I have to agree. That's kinda magic.
But _x and similar are just normal variables that are set by the engine instead of a user.

compact galleon
#

They all are

#

They're not protected either

#

This prints "LOL"

switch 0 do
{
    ___switch = switch 20;
    case 20:
    {
        hint "LOL";
    }
};```
still forum
#

I'd call the switch one magic because it is not documented anywhere and the datatype is special.
It's nothing the user should see. It's purely for implementation

compact galleon
#

Sure. But it works no different from _x

meager heart
#

long time ago in dev build spotrep was fixed: CTD when ___switch is nil... i know people who tried to find anything about it...

#

and was no sqf blogs back then ๐Ÿ˜„

#

but now... maybe...

peak plover
#

So

#

I can disable shooting

#

via

#
player addAction ["", {
    player sideChat ([
        "Nope", "Forget it", "BANG, I guess..."
    ] select floor random 3);
}, "", 0, false, true, "DefaultAction"];
// KillzoneKid
#

What's a way to disable throwing?

#

I saw a PFH option for inputAction and creating and closign a dialog

lone glade
#

ohgod

peak plover
#

Any other way?

lone glade
#

just delete the nade after firedMan

peak plover
#

But in a way similar to KK's example

#

so nothing is done

lone glade
#

you can't

peak plover
#

Alright

lone glade
#

unless you refuse the input via a keydown EH

peak plover
#

If throw key is pressed setdamage 1

lone glade
#

but even then if the dude has shift + G as a shortcut you're fucked

peak plover
#

๐Ÿคท๐Ÿผ

meager heart
#
0 spawn
{
    disableSerialization;
    waitUntil {!isNull (findDisplay 46)};
    var_ehBlockNades = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys 'Throw') then {true} else {false};"];
};
#

ez

lone glade
#

then true else false

#

GG

#

also actionKeys is unreliable because the DIK code for shift + G would be higher than 7 digits

compact galleon
#

@meager heart Interesting. That event handler persists when you restart missions, unless you quit out of them altogether then start the mission again.

lone glade
#

because it's a UI EH

#

unless the display is deleted it'll stay

meager heart
#

well you can remove it....

lone glade
#

duh

meager heart
#

and true/false is correct there, alganthe

lone glade
#

....

#

dude

#

read what you just wrote

#

@still forum

still forum
#

where what

lone glade
#

read that if statement VERY carefully

meager heart
#

what

still forum
#

last message here was half an hour ago

#

Oh wait

#

his message

#

lol

lone glade
#

what is inside that condition sldt1ck

compact galleon
#

@lone glade I know. But you'd think "Restart" and restarting the mission were intended to do the same thing.

cedar kindle
#

the if statement is already a boolean

lone glade
#

SHHH

#

DONT SPOIL IT

cedar kindle
#

sorry ๐Ÿ˜ฆ

meager heart
#

๐Ÿ˜„

lone glade
#

๐Ÿ—ž

compact galleon
#

๐Ÿ“ฐ

peak plover
#
if ((inputAction "DefaultAction") > 0 || (inputAction "Throw") > 0) then {
``` does not work with shift g
#

I'll try the @meager heart

meager heart
#

yes pls lol

lone glade
#

it won't, ever

#

modifier keys + other key DIK code are 7+ digits

#

meaning arma chokes on em'

meager heart
#

and for remove it

if (!isNil {var_ehBlockNades}) then {
    (findDisplay 46) displayRemoveEventHandler ["KeyDown", var_ehBlockNades];
};
#

๐Ÿ˜ฌ

lone glade
#

@peak plover , got it working yet ? ๐Ÿ˜›

meager heart
#

can you actualy make it fail and show how you did it ? ๐Ÿ˜€

#

will be good lesson for me

unborn ether
#

Eh? You can disable throwing with keydown

peak plover
#

@lone glade so no way.. ?

lone glade
#

you can't

#

like I said maybe 30 minutes ago is still valid

#

shift + G DIK code is too high, people who rebind their keys or other "high" key combos would end up breaking it

meager heart
#

ic

#

but so far was no troubles

unborn ether
#

Use input keys command

lone glade
#

..... you don't seem to understand what the issue is demellion

still forum
#

floating point precision is the problemoh

unborn ether
#

Maybe, you mean like 2/3 keys combo DIKs?

lone glade
#

any modifier key + another pretty much

unborn ether
#

Hmm, I'm in 2 days away from my workstation, gonna try peek it remotely

meager heart
#

how much keys i need setup to brake it ?

#

will test it lol

lone glade
#

just two

meager heart
#

nope... works

#

shift + g - works

still forum
#

what is the key code for SHIFT+G

unborn ether
#

2 works for sure

#

Never tried more

lone glade
#

hm... good point ded, lemme check

still forum
#

But again. Some people might have 3. Or joystick keys (Which are also very high)

meager heart
#

shift+g+ one more maybe ?

still forum
#

So in the end you're only ever gonna be able to make it work for most people but not for all

lone glade
#

0x2A + 0x22 for shift + G

unborn ether
#

If that really breaks it, I should reconsider some of my keydown EVH ๐Ÿ˜

lone glade
#

hm... lemme check something

#

nah keydown isn't affected by this afaik

#

only actionKeys

unborn ether
#

Well I use actionKeys in it for same reason like default actions, not exactly a buttons

lone glade
#

2xG: 290
Shift + G: 7.05888e+008

still forum
#

You can accurately represent from -16777215 to 16777215(0xFFFFFF)
Considering that we only go to positive. Eh.. Thta.

lone glade
#

so yeah, actionKeys is still borked

still forum
#

0x2A + 0x22 I didn't mean the seperate dik keys. I meant the combined one.. Which.. you can't read out anyway because.. you can't ๐Ÿ˜„

lone glade
#

yeah, you can't ๐Ÿ˜„

unborn ether
#

F*uck

lone glade
#

shift + A or shift + F would evaluate the same as shift + G in this case

#

so you're shit out of luck

still forum
#

That is about 705888000. Which is much bigger than the max 16777215

#

You might get lucky and it might get rounded to what you expect though

lone glade
#

lol

#

good luck with that

unborn ether
#

Like good luck with it

still forum
#

But like.. If you try SHIFT+H instead of SHIFT+G that lucky rounding already won't work anymore

#

At that point the closest float numbers next to each other are actually 64 integer away.

cosmic kettle
#

Dare I say, intercept?

still forum
#

Intercept also has to go through the script commands and do the float conversion for that

#

So nope

#

You could guesstimate though. Like if the value is close enough to what you expect, still trigger

unborn ether
#

Precision is the key lol

little eagle
#

I have throwing grenades on shift + g, and you definitely can't block that with a keyDown eventhandler, because the double reported as DIK code from actionKeys loses precission and comparing in SQF fails.

compact galleon
#

16777216 actually

still forum
#

But again that would probably trigger for SHIFT+G same as SHIFT+H

cosmic kettle
#

great pun there @unborn ether

still forum
#

I copied my values from Intercept. I knew I took something off just to be extra sure but didn't remember how much ๐Ÿ˜„

little eagle
#

Also, I used to have throwing grenades on Mouse 5 and that can't be blocked either with keyDown.

compact galleon
#

-16777216 to 16777216. Then 16777217 can't be represented. And 16777218 can

still forum
#

I guess Intercept could Intercept the keypress before the engine get's to see it.. But.. Nah.. Too much work for too little result

unborn ether
#

What if to try add action to throw same as to DefaultAction?

little eagle
#

That used to work, but no longer blocks the input since a few years.

cosmic kettle
#

so, long story short is to just delete the nade after throwing?

unborn ether
#

Well delete the projectile

compact galleon
#

Or remove the player's grenades from their inventory

lone glade
#

as I said about 40 minutes ago

#

just delete the nade after throw

little eagle
#

Make a loop that resets the throw muzzles reloading time every frame.

lone glade
#

or that, but perf wise.... urgh

#

wait

little eagle
#

It's really not noticable, especially in a safezone outside of firefights.

cosmic kettle
#

So yeah @peak plover I would say the problem has been deconstructed ๐Ÿ‘†๐Ÿฟ there lol

little eagle
#

There I made this a long time ago.

#

Also works for mines and bombs.

still forum
#

Oh.. That's a neat and tricky way to get the PFH in there

little eagle
#

15 lines of code and a map marker.

#

Yeah, SQF is fun if you know what you're doing. ๐Ÿ˜›

cosmic kettle
#

Even if you don't, less for users though ๐Ÿ˜„

little eagle
#

I guess this one could be an article on that new blog.

cosmic kettle
#

but yeah as always whatever the topic, Commy has 10 lines stashed somewhere already doing this ...

compact galleon
#

Talking about floating point limits now makes me wonder why the game shows integer numbers that can be accurately represented, in scientific notation

still forum
#

That's that kind of small script snippet posting I wanted to avoid. But if you include why all the other ways don't work ๐Ÿ‘

unborn ether
#

Lol

cosmic kettle
#

I guess this one could be an article on that new blog.
yes please!

little eagle
#

Of course I'd have to asplain how it works.

unborn ether
#

Weapon reload time affects throw ?

peak plover
#

nice thanks @little eagle

little eagle
#

Basically the same in repeat as pseudo code / speech.

compact galleon
#

Grenades have reload times

little eagle
#

Yes.

unborn ether
#

Never seen this before nice

still forum
#

@compact galleon default length for stringified numbers isn't that long. See toFixed
On comma numbers it just rounds to meet the length. I guess on too big integers it uses scientific notation to get length down

little eagle
#

Grenades are magazines and each magazine has a reloadTime (1 divided by the rate of fire) and a magazineReloadTime (changing clips).

compact galleon
#

@still forum Good to know. tofixed 0; hint str 16777216 for useful conversion

unborn ether
#

Well that should be obvious as Throw is the same weapon muzzle like a Cannon, but never tried that

still forum
#

I think toFixed also changes precision of scopes above your function. So be careful if you do that in a API function somewhere

unborn ether
#

Any weapon is the same isn't it ?

little eagle
#

Throw is a weapon, not a muzzle. The Throw weapon has lots of muzzles. One for each greande type.

#

Except stuff like different colored chemlights. Those share a muzzle I guess.

#

But all the smoke grenades with their colors each have their own muzzle.

compact galleon
#

@still forum Description says "to end of current scope"

unborn ether
#

I want try seeing a bus throwing a nade

little eagle
#

It's basically a grenade launcher.

#

Nothing special or new.

still forum
#

@compact galleon No. It says until the end of script.

lone glade
#

it's a grenade launcher inside your arm with an associated anim

little eagle
#

toFixed only helps for representing floats. You still don't get double accuracy.

compact galleon
#

@still forum I'm looking at the in-game description, not the wiki

little eagle
#

So string conversion.

compact galleon
#

Uses fixed-point notation in all number to string conversions until the end of the current scope

#

But it's wrong

little eagle
#

Someone test it.

still forum
#

So who is correct now. Description or wiki ๐Ÿ˜„

lone glade
#

it's nice for cutting decimals too or avoiding engine bugs

compact galleon
#

@still forum Evidently the wiki

#

This prints 16777216 twice.

call { tofixed 0; systemChat str 16777216; };
systemChat str 16777216;```
little eagle
#
private _num = 11111111;
call {
    toFixed 8;
};
hint str _num;
still forum
#

Afaik that command was made by KK. So the ingame description was also written by him. The wiki page though was also written by him.
๐Ÿ˜„

compact galleon
#

tofixed -1 returns it to default

call { tofixed 0; systemChat str 16777216; };
tofixed -1;
systemChat str 16777216;```
unborn ether
#

How much human lives being spent fighting an arma precision?

little eagle
#

Does KK even know how we use scope vs script?

lone glade
#

english died on this day

still forum
#

Ohh.. Actualy very nice to know. I have a couple dummy variables in Intercept's VMContext.
toFixed state is saved in there if it's global over a script. So that probably is one of them

meager heart
#

english died on this day
njet

unborn ether
#

Da

still forum
#

Lol. end of work in 2 minutes. Almost forgot about it and missed it

compact galleon
#

"End of work in 2 minutes". Pretty sure you ended work hours ago

lone glade
#

lies

little eagle
#

End of pay in 2 minutes*

still forum
#

Actually My work ended one hour ago. But I'm making some extra hours for the pesky clock thingy

meager heart
#

btw got that keydown fail... right ctrl + left ctrl did the job lol

unborn ether
#

Kill me

little eagle
#

It's not keyDown that fails, it's actionKeys.

lone glade
#

more precisely actionKeys returning key combos

meager heart
#

*yep ^ corrections

little eagle
#

actionKeys is essentially unusable and every script that uses it can be abused.

unborn ether
#

Any workarounds

#

?

lone glade
#

None

little eagle
#

Been like that for years. Hard to get through to people though. They have a hard time accepting the truth.

#

No workarounds.

cosmic kettle
#

Not using them seems the best workaround it seems.

little eagle
#

Yep.

lone glade
#

I seriously feel like I had that exact same conversation a few years ago

little eagle
#

I had this conversation at least 20 times.

cosmic kettle
meager heart
#

sank u

lone glade
#

you can use "hard coded" key combos that you know work in keydown EHs

#

since keyDown returns the state of the modifier key instead of the DIK code of the combo

little eagle
#

Imo resetting the weaponReloadTime of the Throw and Put muzzles every frame is the best solution.

unborn ether
#

Does MB5 trigger some EH at all?

lone glade
#

mouse button?

little eagle
#

MouseButtonDown, but that cannot be blocked like KeyDown.

lone glade
#

don't think extra MB keys are handled by it, lemme check