#arma3_scripting

1 messages · Page 251 of 1

nocturne bluff
#

The perf hit isnt worth anyway, a decent made mission with the editor beats any zeus stuff.

little eagle
#

The first time I was in a zeus mission, I was killed by artillery. He defending using it, because we didn't move enough

lone glade
#

want to increase network traffic ? enable remoteExec whitelisting while blocking arsenal

#

enjoy the desync / crashes

nocturne bluff
#

Using anything made by BIS hue hue hue

little eagle
#

we are stuck with that I guess

lone glade
#

cough mars cough cough

nocturne bluff
#

cough tmf cough

little eagle
#

At least KK is doing a good job on fixing the function library. < imo

nocturne bluff
#

Da.

lone glade
#

yup

nocturne bluff
#

Still no fucking createNamespace

lone glade
#

there is head

nocturne bluff
#

and ragdoll mode command

lone glade
#

locations 😄

nocturne bluff
#

throws sand into @lone glade eyes

lone glade
#

not allowing people to carry RPGs + sniper rifles and ghillie suits isn't the wrong direction tbh

#

I never saw what he did

#

dunno, I made the limitations quite fair, he probably changed them

#

oh yeah I disabled people using MOS / SOS without being marksman

#

it stops people from camping on hills

little eagle
#

sounds reasonable tbh

nocturne bluff
#

dosent allow custom loadouts

#

is hitler

lone glade
#

you can use custom loadouts

#

just not VR suits with thermals

nocturne bluff
#

Pfft, i have full platoon loadouts with TMF

little eagle
#

restricting sniper scopes, ghillies and at + sniper doesn't sound bad

#

but you can easily go too far with restrictions

tough abyss
#

@tough abyss what zeus thing? not ares?

lone glade
#

those are the limitations I have

#

with a blacklist of opfor / civ stuff above

tough abyss
#

are you just talking about public zeus sessions he hosts?

nocturne bluff
#

¯_(ツ)_/¯

#

Player control is the utmost form of gameplay marsheling ;)

#

You let people take what they want, they take nice long range scopes and sit out 1 km from the object snipeing stupid AI that just go prone

#

until they wake up and end you with a perfect headshot

#

;)

lone glade
#

that is why I took them from most of them

#

and removed fucking thermals

#

you cannot believe how much teamkilling is going on with those

nocturne bluff
#

i do know..

tough abyss
#

@tough abyss what zeus thing? not ares?

nocturne bluff
#

¯_(ツ)_/¯

#

I don't like toys anyway, they mostly get in the way of good missions.

tough abyss
#

ok then. that answers it.

little eagle
#

I'd tell you opec, but I have no idea.

#

It's all greek to me, literally

tough abyss
#

starts a topic by referencing a "thing"

#

won't explain what thing is

lone glade
#

scroll back

#

we were speaking of a certain individual' sessions

nocturne bluff
#

lol

lone glade
#

why would i ever do that

#

could port ACE3 code easily

#

yes

#

not for scopes / nvgs

nocturne bluff
#

does ACE have me?

lone glade
#

go hide 😛

nocturne bluff
#

nah spent the weekend in bushes

#

not more hiding

lone glade
#

of course not

#

nah

#

because they can't see it in arsenal

#

I remove all the items then rebuild it without the blacklisted stuff

#

yep

#

there's a check when you exit arsenal to remove what you shouldn't have if you managed somehow to get a hold of it

#

slowest run speed

#

waiving your gun like a flag

little eagle
#

sounds like 14 year olds

indigo snow
#

It's a shame BIs new fatigue system doesnt punish this more

little eagle
#

true that

lone glade
#

it's more punishing than before

#

it's just that nobody uses it :/

indigo snow
#

adding zeus style points to arsenal items might be interesting

#

choose a loadout within n points

lone glade
#

Oh god no

little eagle
#

sounds gimicky

#

doesn't fit Arma imo

lone glade
#

there's already that one guy using a hunter filled with ammo raping AOs

indigo snow
#

players will find ways around it indeed

little eagle
#

yeah , make a server and let the players buy the biggest gun/backpack/thermals

#

there are people dumb enough to fall for this scheme

lone glade
#

isn't that illegal ?

little eagle
#

maybe

#

I'm not serious, I never looked into that, because I wouldn't do it

indigo snow
#

its not allowed under BIs monetization scheme

little eagle
#

but would buying additional points for the whole equippment be illeagl too?

indigo snow
#

ah i see

#

interesting indeed

lone glade
#

that's the wrong crowd playing arma 3

little eagle
#

1.5x movement speed does sound like it could be fun though

lone glade
#

would be weird, the anims would just be sped up

little eagle
#

now someone implement bunny hops

lone glade
#

they're already in

#

just map the action to the key

little eagle
#

alganthe, I'm fairly sure that jumping is a ACE thing

lone glade
#

gimme a sec going to check the action

little eagle
#

And that jumping is not what I mean with bunny hoping

lone glade
#

oooh

#

doom / quake style bunnyhop ?

little eagle
#

YES

#

can you imagine?

#

couple it with the clunky collisions

lone glade
#

would be hilariously PTSD inducing

little eagle
#

JumpOff is ejecting out of a moving vehicle

#

iirc

lone glade
#

oooh 😦

little eagle
#

_unit setPosASL getPosASL _unit ?

#

oh, how to get someone into that anim

#

yeah, it's hard coded

#

some loop internally does handle this

#

it also has bugs where you are stuck with it on the ground and can't die nor move

#

Make a animation that cannot transition into freefalling

lone glade
#

add an addAction for that

#

gimme a sec, got the code

#

nah

little eagle
#

not localized, 3/10

lone glade
#

You thought I would bother localizing ? what do you think I am ? A chinese dev ? :troll:

little eagle
#

I thought the French hated the English

lone glade
#

I hate the french as much as the english

#

living near paris might do that to people

#

I heard if you smile in the metro you get a ticket

#

Parisians are the most stuck up, unhappy people ever

#

seeing a smile is abnormal there

#

now back on subject: that action works at any height, you just go sploosh if you open too late

little eagle
#

well, or you are stuck

lone glade
#

oh, fuck trees

#

got so many prowler dropped getting stuck in those on tanoa

#

you don't, you pray that the players on the ground are good at shooting ropes

little eagle
#

does that actually work? no way

lone glade
#

if only

#

I dream at night of proper rope physX

little eagle
#

I dream of proper tank physx

lone glade
#

reminds me of the spaghetti monster me and baer created when testing ace fastroping

tough abyss
#

pls rate/no bully: bug_out = { sleep 0.5; player switchMove "HubStandingUB_idle1"; sleep 0.5; player switchMove ""; }; player addEventHandler [ "AnimChanged", { _alt_player_pos = getPosATL player; _alt_z = _alt_player_pos select 2; _alt_high_enough = _alt_z > 150; _anim = _this select 1; _is_anim = [ "HaloFreeFall", _anim, false ] call BIS_fnc_inString; if ( _alt_high_enough && { _is_anim } ) then { [] spawn bug_out; }; } ];

little eagle
#

no private and uses BIS functions 2/10

lone glade
#

^ same as commy

jade abyss
#

posted in Discord. 1.5/10

tough abyss
#

lol

lone glade
#
  • use of sleep and switchMove being local in MP
tough abyss
#

I know it works. used in a mission years ago.

lone glade
#

it's local

jade abyss
#

Oh, and using
blablabla {
instead of
blablabla
{
-1 Point

lone glade
#

BURN DSCHA

little eagle
#

here we go

tough abyss
#

pfft we all have formatting quirks

lone glade
#

triggered

jade abyss
#

😄 Opec

#

lmao

lone glade
#

it's not a quirk, it's the right way to do it

little eagle
#

wasn't "saving bytes" an argument pro tabs too?

#

"argument"

lone glade
#

like soft tabs haven't won already 😄

jade abyss
#

Rememeber: Delete every Space/Tab and make the Script a 1liner!!!111oneoneone

little eagle
#

WHICH DOES OBFUSCATE IT TOO

lone glade
#

OMG SUCH EFFICIENCY

little eagle
#

WIN WIN WIN

#

lol

lone glade
#

no, but more seriously it's more readable for a human

jade abyss
#

Having good laugh atm, thx guys o7

lone glade
#

and it folds properly on editors

tough abyss
#

tru. although the autism makes me more machine than man.

jade abyss
#

The downside of having the curly in the same line is just: Its not clear, where the "scope" starts. I just can't read that type of code.

lone glade
#

wat

#

it's the contrary

little eagle
#

for me the additional indentation is enough

lone glade
#

you should open some of BIS configs, and cry

#

it's folding hell.

#

not always

jade abyss
#

meh

if()then{
 if()then{
 };
};

good:

if()then
{
     if()then
     {
     };
};
#

triggering

little eagle
#
if () then {
    // stuff

    if () then {
        // stuff
    };
};
lone glade
#

it's all fine and dandy @jade abyss when it's only 3~4 scopes

#

for configs you have sometimes 10 of them and the indentation becomes scary

jade abyss
#

Yeah

little eagle
#

that is a different problem though. 3den configs are sub class hell

jade abyss
#

[{}] <- ?

little eagle
#

you need two curly in the array for it to work

#

if () then [{<then>},{<else>}]

jade abyss
#

omfg

little eagle
#

it is what the else command expands too

jade abyss
#

erm... meh

little eagle
#

yeah, don't use it

jade abyss
#

looks bad, feels bad, must be bad.

little eagle
#

just like for ARRAY

jade abyss
#

Wut?

lone glade
#

or any of the javascript commands

jade abyss
#

what kind of torturing is that?

little eagle
#

for [{_i=1},{_i<=10},{_i=_i+1}] do {};

jade abyss
#

Ah

#

no

lone glade
#

for forspec

jade abyss
#

Never used it (never had to)

lone glade
#

I love that privating is "recommended" on the for forspec wiki page but the command doesn't do it for for do

jade abyss
#

Its also trendy to smoke weed these days, doesn't mean anybody else have to do it.

tough abyss
#

never had a problem not using private

lone glade
#

trust me, you have to

little eagle
#

opec, the problems come when you make more complex stuff

#

it's a bad habbit to not use it

lone glade
#

I spent an afternoon learning why 😛

tough abyss
#

I make complex stuff

lone glade
#

after my var changed 6 scopes and 2 calls in

jade abyss
#

btw. anybody else got Warning Message: No entry 'bin\config.bin/CfgWeapons.'. when a player joins a game? (pure Vanilla)

lone glade
#

cough.... fish AI

#

nah

little eagle
#

fish AI and I think the feedback fsm does some spawns too

lone glade
#

sooo muuuuch

#

let's not forget fog values being jacked up by a ridiculous number on tanoa

#

0.03 fog on tanoa looks like 0.5 on altis

little eagle
#

unrelated alganthe. we now it triggers you

#

what's it called?

#

i know camera.sqs is still a thing

#

hmm

#

on mission start?

#

that would be init.sqs

#

same as init.sqf. runs after that one command

#

runInitScripts (?). Done in initFunctions.sqf

lone glade
#

no SQS scripts running for me

#

returns an empty array

tough abyss
#

have a mode to made a array with pos and name to a foreach for create map map markers? i want to create a script like wasteland gunstores

indigo snow
#

what does your array look like?

{createMarker _x} forEach [ ["name1",[0,0,0]] , ["name2",[1,1,1]] ];

tough abyss
#

thnks, i think work. 😃

lone glade
little eagle
#

yes

#

teamSwitch != selectPlayer

#

I think teamSwitch is broken. Or it isn't meant to work in MP

nocturne bluff
#

Might trigger in missions with group respawn

tough abyss
#

_markerName = _x select 0;
_markerPoss = _x select 1;
_marker = createMarkerLocal [_markerName, _markerPoss];

#

correct?

nocturne bluff
#

_x params ["_markerName","_markerPos"];

indigo snow
#

the array after createMarkerLocal is identical to _x

#

so you can just feed _x into createMarkerLocal

hearty shoal
indigo snow
#

Line 9 man

distant egret
#

@hearty shoal use your player id

hearty shoal
#

Yeah forgot to add that i took out my userid and all others thats allowed to use the menu

#

So on the server theres supposed to be more userIDs in there.

indigo snow
#

right so where are you executing this code?

tough abyss
#

@nocturne bluff nice, thanks.

hearty shoal
#

through a displayevent. The user press F2 and this function gets spawned

nocturne bluff
#

@indigo snow very true

indigo snow
#

@hearty shoal and how are you adding the displayEvent? essentially: are you sure your code runs on your client(s)?

hearty shoal
#

Im using this in initPlayerLocal: ```waituntil {!isnull (finddisplay 46)};
[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this spawn core_fnc_keysPressed"]; };

indigo snow
#

what i'd suggest is:

run a debug line (e.g. a hint or diag_log) to check if the code is actually running

if yes, the error will probably be in the if statement. Check if all the returns and values are what you expect them to be

hearty shoal
#

Actually i think i know the problem now :P. If i click one of the buttons i set the global var to true. And if another player press a button he change the var to false.

indigo snow
#

i dont see any stuff in there that broadcasts values to other clients

hearty shoal
#

No? So if i define myGlobalVar = false; in say init. And then change that value to true, would that only change for me and not all other players?

indigo snow
#

yes

#

only is you publicVariable it will broadcast

#

or use the global flag on setVariable

little eagle
#

Global variables are local. The whole naming scheme is bad.

hearty shoal
#

Ah so to set myGlobalVar global i have to declare that some how? so its really just myGlobalButLocalGlobalVar? xD

indigo snow
#

you need to expressly update variables on other clients, yes

hearty shoal
#

Okay then i have a better understanding on that point, thanks 😃

little eagle
#

Global variables are local. If you want to share them between different machines, you have to use missionNamespace setVariable <public> or publicVariable/Client/Server.
They are called public global variables in that case. They only take the value they had when they were shared though. Every time they are changed you have to share them again.

hearty shoal
#

Hehe i were reading exactly that wikipage @little eagle 😄

little eagle
#

iirc there was a better one. maybe I'm dreaming

hearty shoal
#

well the wiki is a total mess to navigate so im sure you are right 😛

tough abyss
jade abyss
#

...

tough abyss
#

hello fellas

#

i try make a script like a wasteland gun stores markers to exile. i make a code based from wasteland code, but the color markers not change the color when other guy is inside, maybe anyone can help me? the code is: http://pastebin.com/RmxijdeV

#

i call the file in init.sqf

if (hasInterface) then {
execVM "custom\NotSafeMarkers.sqf";
};

I think so the code run only in client right?

hearty shoal
#

I'm unsure about how the script is working but it's always a good idea to either hint or diag_log your events to see that they actually are working as intended. @tough abyss

tough abyss
#

ty. @hearty shoal

tender root
#

Hello guys, is ther any way to check whether the player is currently using the under barrel (UGL for example) weapon? thanks in advance 😄

hearty shoal
#

You would want to look into finding out what muzzle the current weapon have. @tender root

tender root
#

Yeah my best guess would be to compare the currentMuzzle with the currentWeapon but as far as I know the weapons "primary" muzzle and the wepaon do not have to have the same name or do they?

#

so that would be working in most cases but isn't a perfect solution

#

is there a command which returns the "primary" muzzle of a weapon

shut prairie
#

Hey @little eagle since you seem to know your stuff. Go to #arma3_questions and PM me the answer to it.

stone brook
#

is setpos still a good command to use to elevate object in the editor or is it better to just type a number into the z-axis of the object setting?

#

because i notice that if i set a number on the z-axis and if i move the object around the elevation differs and adjusts to the terrain level. i want to have multiple objects elevated at the same level regardless of terrain level

little eagle
#

Added: A new isSingleplayer script command

#

THANKS, NOW FIX TANK PHYSX

thin pine
#

i guess !isMultiplayer did not suffice?

little eagle
#

apparently

#

next up: isClient, isAI, isTurnedIn

thin pine
#

😄

#

If they're gonna add simple, seamingly useless commands, I wonder why not add a isInVehicle - granted that it can be done with vehicle player != player but still

little eagle
#

That actually would be an improvement

thin pine
#

ikr

meager granite
#

!isNull objectParent _unit

#

Can also do it like this

#

Still its 3 commands

nocturne bluff
#

haha

#

we dont need such things.

#

useful commands are not good.

dusk sage
#

isGreaterThanZero?

nocturne bluff
#

Added: IsArmaRunning

#

Added: IsPlayerPlayer

meager granite
#

Actually, an event handler that will be called when player is set and local could be useful

#

instead of waitUntil {player == player && local player};

nocturne bluff
#

beats me

meager granite
#

Right after client loads so you know moment when you can start manipulating with player unit

#

No its way past preinit and even init

nocturne bluff
#

Can take a while on server.

meager granite
#

You don't get your player unit right away, you have to wait for server to create you one (if no AI enabled) and then wait till locality changes because player might return your unit which is not yet local

nocturne bluff
#

Tho i never had issues with just doing in postinit, but most likely happens more in your usecase ;)

#

Shoulden't respawn get run?

meager granite
#

You can't assign respawn event handler on something you don't have yet

#

Even if you could I don't think it would run as unit is created by server and then transfered to client

nocturne bluff
#

Da but respawn templates get run on player creation

#

Pretty sure on that point, unless they fixed it

meager granite
#

"classname" addEntityCreatedEventHandler {};

nocturne bluff
#

Yes, pertty sure respawn templates get run with you jip in.

meager granite
#

I wonder how they run, never used or looked into them

#

Wouldn't be surprized if it does waitUntil thingie

nocturne bluff
#

No idea, really but i did work into a workaround for my spectator script respawn evethandler would trigger when people jipped and not get put into spectator like they should (because they were alive)

meager granite
#

I think display get created earlier than client gets their unit

teal coral
#

isn't initPlayerLocal.sqf exactly that? executed when player object is available

jade abyss
#

Yep, never had any Probs with it.

little eagle
#

postInit runs after the player is created. there is no point in having these waitUntil !isNull player loops

nocturne bluff
#

That's what i always figured. and used

velvet merlin
#

Added: Support for retexturing simple objects
this is a good step though

little eagle
#
            //--- Run mission scripts
            if !(isDedicated) then {
                [player,didJIP] execvm "initPlayerLocal.sqf";
                [[[player,didJIP],"initPlayerServer.sqf"],"bis_fnc_execvm",false,false] call bis_fnc_mp;
                "initPlayerLocal.sqf" call bis_fnc_logFormat;
                "initPlayerServer.sqf" call bis_fnc_logFormat;
            };
            0.90 call bis_fnc_progressloadingscreen;

            //--- Call postInit functions
#

initFunctions.sqf

#

initPlayerLocal and initPlayerServer pass the player

#

they are guarnteed to have it defined, even after JIP

#

and postInit runs after that

#

I think they do it by waiting for getClientState != "GAME LOADED"

#

and at that point the avatar is transfered to the client already

candid abyss
#

Added: Support for retexturing simple objects
Retexturing in the sense of hiddenSelections[]? Or can I retexture any object in-game?

little eagle
#

probably hiddenSelectionTexture

candid abyss
#

ah man. I wish I could rexture objects in-game which dont have a hidden selection

tidal void
#

hi. did anybody here have a fight with setObjectViewDistance ?

#

it appears that you can't set it above what player has set in his video options view distance, even if you raise the view distance itself

#

ie. if I have 1500 set as max, then I can setViewDistance to 3000, but I can't setObjectViewDistance above 1500 no matter what

#

is it a bug? a feature?

little eagle
#

sounds like a bug. never heard of this though

tidal void
#

I've been googling around, and it appears that it might have been introduced with apex

little eagle
#

setViewDistance 1E5; setObjectViewDistance 1E5; getObjectViewDistance

#

-> [2006.37,50]

#

can confirm

tidal void
#

(pssst! is it a moment I create a ticket for it, or are tickets still a place where bugs go to die?)

little eagle
#

create a ticket if one doesn't already exist

tidal void
#

Will search and create then. I also found another bug, but this one does not look like a feature at all

  • you can reset view distance with -1 parameter, but you can't do that with objects and shadows
#

and if you change view distance via script, it doesn't touch video settings slider, but it seems to change objects and shadows sliders

little eagle
#

put that all into the ticket

tidal void
#

there is a ticket, but marked as gui problem...

little eagle
#

create a proper one then. put as much information into the OP as possible, but avoid emotional sentences/chatter

#

And name it drastically: "setObjectViewDistance broken"

tidal void
#

😉

little eagle
#

no one cares about tickets named "setObjectViewDistance doesn't work sometimes maybe"

#

or even worse: non sensical stuff like: "object view distance doesn't work"

bitter magnet
#

whats the difference between "broken" and "doesn't work"? 😃

tidal void
#

broken stuff generates errors

#

"doesn't work" just doesn't work 😄

velvet merlin
#

objectviewdistance cannot be higher than viewdistance

#

however you should be able to up the viewdistance via sqf

#

maybe best test in MP as your local settings cannot change the one enforced via sqf

#

while when you test in SP/editor, the one from options may overwrite the sqf use again

#

once you enter the menu

#

(was like this in the past at least)

tidal void
#

it happens without going to options, and without dismissing debug console. this is what my ticket is about

velvet merlin
#

well i havent scripted much in the last 2-3 years, so very possible BI introduced new bugs since

#

just trying to give you some general context how it is supposed to work

tidal void
#

yeah. objectViewDistance <= viewDistance is a logical thing, unfortunately general view distance seems to constant when objectViewDistance is concerned, while it's not

hearty shoal
#

Guys when a vehicle explode you no longer get the option to view what was stored in the inventory. But is the inventory still stored after the vehicle have exploded?

little eagle
#

yes

hearty shoal
#

Nice!

little eagle
#

I use this to determine how many secondary explosions should happen after a tank blows up in ACE

hearty shoal
#

Well i could find atleast one way to get the cargo of a vehicle but as soon as i made the car explode that didnt work anymore

#

I used getItemCargo

#

@little eagle

little eagle
#

You are right, @hearty shoal
I was thinking about the vehicles weapons magazine inventory, not the cargo
Bad news. The cargo is deleted when the vehicle dies.

hearty shoal
#

Ah okay thats fine i guess. Would not make sence to have the inventory saved after an explosion after all

little eagle
#

also bad news, killed doesn't work either:

cursorTarget addEventHandler ["killed", {
    params ["_vehicle"];
    systemChat str [_vehicle, getItemCargo _vehicle];
}];

-> [<truck>,[[],[]]]

vagrant badge
#

where i can find manual for basics in language becose i wanna know how to modify "" if(vehicle player == player) then {" to check side can add && ?? to script ?? " if(vehicle player == player && side = Independent) then { ????

#

whoa, cool one line code block~

#

OK works

vagrant badge
#

if i add to if ...... && playerSide isEqualTo west work only for west ?

wheat shoal
#

Would questions about the mission init order go here or the missions channel?

vagrant badge
#

no no mision script for line but i wannna turn it only for medics on life server

#

"fn_advancedSlingLoadingInit"

hearty shoal
#

hmm ```20:29:29 Error position: <_this spawn core_fnc_keysPressed>
20:29:29 Error Type Script, expected Bool

waituntil {!isnull (finddisplay 46)};
[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this spawn core_fnc_keysPressed"]; };```

#

oh i see now that the code is wihin " "

little eagle
#

keyDown event handler expects a boolean as return value

#

false: don't overwrite, true: overwrite

#

spawn returns a script handler

#

Error Type Script, expected Bool

#

could change it to this:
"_this spawn core_fnc_keysPressed; false"

hearty shoal
little eagle
#

well, but that is the reason

#

why are you using:
[] spawn { < add key handler > }

#

seems pointless to me

hearty shoal
#

so myKeyDownEvent = (findDisplay 46) displayAddEventHandler["KeyDown","_this spawn core_fnc_keysPressed; false"]; instead ?

little eagle
#

yes

#

well scrap that myKeyDownEvent = part if you're not gonna use it

nocturne bluff
#

xd

little eagle
#

less text, cleaner script, easier to debug ¯_(ツ)_/¯

hearty shoal
#

True, but when one start to script isnt it better to be extra clear on everything you do?

dusk sage
#

Not seeing where the clarity comes from with that one though 😉

little eagle
#

While taking shortcuts can reduce readability of code, having superfluous stuff like saving return values in used variables, or using additional calls / spawns that only encase one command needlessly doesn't help clarity.

#

You should always ask yourself: "what does this do?" and if you don't need it OR don't understand it, remove it

#

I think that is a good tip for beginners. Maybe you disagree, but it helped me.

coral pasture
#

@little eagle I am having a strange problem with CBA. I have no idea what is causing it and how to fix it. code: http://pastebin.com/8qSrrjfN

elfin bronze
#

Hey, I use for from do to remove items from player but when the value is 1 (for remove 1 item), i have 2 items deleted :/

//I want to delete 1 itemGPS
_value = "1";
for "_i" from 0 to _value do {player removeItem "itemGPS"};

coral pasture
#

Change the 0 to a 1

#

so for "_i" from 1 to _value do

elfin bronze
#

OMG i'm so stupid -_-

#

thank 😄

coral pasture
#

😃

elfin bronze
#

How to use the code format on discord ?

coral pasture
#

the button left of the one three times at the biginning and end

#

`

elfin bronze
#

'try'

coral pasture
#

I can't unformat 😦

elfin bronze
#

Arf :/

hearty shoal
#

two "`" for a codeline code

#

three for a block

elfin bronze
#

Code

#

Ok thank ^^

little eagle
#

@coral pasture
So if I copy the code under =Relevant code= this error should appear?

coral pasture
#

well. no that is not the entire file. I guess that would help...

little eagle
#

Are you by chance the same guy as pultho on the github?

coral pasture
#

Nathan423

little eagle
#

ok. He was opening another issue an hour ago

#

I'll look into it

#

@coral pasture

Can you copy paste this variable from debug console?
cba_keybinding_handlers

coral pasture
little eagle
#

thank you

#

found it

#

you do this:

["United Operations", "Admin Console", ["player", [], -10, "_this call uo_fnc_selfInteractMenu", "main"], [DIK_APPS, [false, false, false]], false, "keydown"] call cba_fnc_addKeybind;
#

parameter 2 (starting from 0) is:
["player", [], -10, "_this call uo_fnc_selfInteractMenu", "main"]

coral pasture
#

I don't call that (very legacy)

little eagle
#

well the array appears in cba_keybinding_handlers

#

[["player",[],-10,"createDialog 'UOGM'","main"],"keydown","keydown"]

coral pasture
#

So can I just remove that entry from the array?

little eagle
#

nah, don't touch this array

#

are you sure you are not calling that code? because it's strange that it appears in that array

coral pasture
little eagle
#

Sucks that CBA_fnc_addKeybind has no input control

#

yeah, the one where it says "player"

#

that's the one

coral pasture
#

The last one is the only "active" keybind, the rest were completely removed from the code. They were used prior to the active code.

little eagle
#

ah snap, I know why you can't get rid of it

#

it's read from profile. because you executed this once your profile is "contaminated" so to speak

#

shitty code from CBA tbh

#

*read from profile

#

profileNamespace setVariable ["cba_keybinding_registryNew", nil]

#

that should fix it, but it means that you'll have to rebind them all ...

#

edited*

coral pasture
#

could I just do cba_keybinding_registryNew - [["player", [], -10, "_this call uo_fnc_selfInteractMenu", "main"]]?

#

Or is that not safe

little eagle
#

Nope. It's a weird multidimensional array

coral pasture
#

okay

little eagle
#

Sorry. I'll add input control to CBA_fnc_addKeybind right now so shit like that doesn't happen again.

wet pecan
#

Quick question, if I'm using BIS_fnc_setTastState to modify a create task module do I need to place the Variable Name or the Task ID into the params?

little eagle
#

you mean BIS_fnc_taskSetState ?

#

wiki says 0: STRING - Task name

wet pecan
#

yeah I figured it out Its looking for the TaskID not the variable name like I had tried previously

hearty shoal
#

BIS_fnc_setTastState i did read that as BIS_fnc_setTasteState haha 😄

little eagle
#

Yeah. I had to think about what he meant for a second too

coral pasture
#

Does anyone have good exprierence with remoteExecCall?

dusk sage
#

It would probably be best to just ask what you need to ask directly

coral pasture
#

{[_execUnit, _classname, _countNum] call FNC_addItemToPlayer;} remoteExecCall ["BIS_fnc_call", _execUnit, false]; is giving a Type any, expected [things]

#
        _execUnit = nil;
        {
            if (name _x == _execUnitname) then {_execUnit = _x};
        } forEach playableUnits;
        hint format ["Unit: %1\nClassname: %2\nCount: %3", _execUnit, _classname, _countNum];
        {[_execUnit, _classname, _countNum] call FNC_addItemToPlayer;} remoteExecCall ["BIS_fnc_call", _execUnit, false];
        hint "Player was given the items";``` and the variables are all defined...
little eagle
#

_execUnit, _classname and _countNum are undefined in that scope

#

you will have to pass them as arguments

coral pasture
little eagle
#

yup undefined

#

the scope is seperate from your script

coral pasture
#

how would I pass it?

little eagle
#

[[_execUnit, _classname, _countNum], {_this call FNC_addItemToPlayer;}] remoteExecCall ["BIS_fnc_call", _execUnit, false];

coral pasture
#

got it

#

Thanks for the second save

native hemlock
#

Why not do

[_execUnit, _classname, _countNum] remoteExecCall ["FNC_addItemToPlayer", _execUnit, false];
little eagle
#

yeah that makes more sense

coral pasture
#

Because debugging lead me to what I had, it was originally that

little eagle
#

"BIS_fnc_call" is really to be avoided when possible. Instead of the short and sweat function names you are transfering a function name AND the function

#

functions are strings so what you transfer can get huge -> desynch

coral pasture
#

Arma is moving to a differnt scripting language in the next game, right?

#

I can't spell

little eagle
#

idk, maybe

#

who knows. they talked about java and that didn't happen. we'll see

blazing zodiac
#

the documentation for enScript is already partially available in the standalone files

#

I remember looking through it a few months ago

little eagle
#

railgun tanks. that's all I say about this

blazing zodiac
#

Lol

little eagle
#

it was a thing at one point ¯_(ツ)_/¯

hearty shoal
#

The hound, that sounded intresting. but by standalone what do you refer to?

coral pasture
#

@little eagle @native hemlock That didn't work

blazing zodiac
#

Dayz Standalone's engine uses enScript, the engine is called enfusion, and they've stated many times that will be the arma engine moving forward

#

I beleive sqf will still be in there as well

#

But we'll have to wait and see

hearty shoal
#

Ah! sounds intresting 😃

native hemlock
#

@coral pasture What about it didn't work?

coral pasture
#

Same error

#

one sec

hearty shoal
#

Any special pbos you looked in to give me somewhere to start looking @blazing zodiac

native hemlock
#

Paste the updated line with remoteExecCall

coral pasture
#

[_execUnit, _classname, _countNum] remoteExecCall ["FNC_addItemToPlayer", _execUnit, false];

native hemlock
#

Could that function be blocked by your CfgRemoteExec values?

coral pasture
#

😶

native hemlock
#
myFunc = {
    params ["_one", "_two", "_three"];
    hint format ["one: %1, two: %2, three: %3", _one, _two, _three];
};

private _a = 75;
private _b = 9;
private _c = 312;
[_a, _b, _c] remoteExecCall ["myFunc"];

Just ran that in the editor and I had a hint pop up with the corresponding numbers

#

So that leads me to believe your function isn't getting executed

little eagle
#

shouldn't it write to RPT if the function was blocked?

native hemlock
#

Probably

coral pasture
#

This is the last thing before final testing

native hemlock
#

Where are you testing this?

coral pasture
#

SP for now

native hemlock
#

And the error is Type any, expected [things]?

dusk sage
#

You're in SP

coral pasture
#

19:30:00 Error in expression <um]; [_execUnit, _classname, _countNum] remoteExecCall ["FNC_addItemToPlayer", _> 19:30:00 Error position: <remoteExecCall ["FNC_addItemToPlayer", _> 19:30:00 Error Type Any, expected Number, Side, Object, Group, String 19:30:00 File z\uo\Addons\debugconsole\functions\fn_spawnItem.sqf, line 145

dusk sage
#

playableUnits doesnt return anything, does it?

coral pasture
#

It does because the list use it and they fill

dusk sage
#

fair enough

#

im thinking editor

coral pasture
#

yeah, in the editor

dusk sage
#

type playableUnits in a watch field

coral pasture
#

You right

dusk sage
#

allUnits instead to test

coral pasture
#

The error is referencing the "unit", wich is most likely undefined...

#

Let me test in MP

dusk sage
#

Yeh, as your execUnit is never defined

native hemlock
#

Also this is a bad idea

case "ALL": {
    {
        [_x, _classname, _countNum] remoteExecCall ["FNC_addItemToPlayer", -2, false];
    } forEach playableUnits;
    hint "Everyone was given the items";
};

You can use an array as the target

dusk sage
#

due to playableUnits returning nothing. At first glance of your code

#

haha 😄

coral pasture
#

It's been a long day

#

@native hemlock I ment to change it

#

that would be very baf

#

Works in MP 😃

lethal cave
#

let's say i create a mortar round with _mortar = createVehicle ["Bo_Mk82", _psn, [], 0, "NONE"];

#

how can i detonate it in the air?

#

_mortar setDamage 1 doesn't work

dusk sage
#

Try

#
_mortar = "Bo_Mk82" createVehicle [0,0,9999];
_mortar setPos (getPos player);
_mortar setVelocity [0,0,-100];
#

or w/e position

little eagle
#

^ that will explode on the ground, won't it?

dusk sage
#

yeh, nvm, didnt read

little eagle
#

only CfgAmmo that have: triggerWhenDestroyed = 1; explode when killed

#

(might also only work on ceratin simulations)

#

Yeah, I don't think you can do that.

lethal cave
#

hmm, is there ANY way to make explosion in the air?

little eagle
#

#particlesource, #soundsource, #lightsource etc. with createVehicleLocal I guess

#

If you can edit configs for your project, you could make a copy of your class with timeToLive = 0;

lethal cave
#

yeah i got it, not worth it, i'll try to look for any ammo that has trigger when destroyed option and if i don't find one i'll drop the idea, thanks anyway!

blazing zodiac
#

the demo_charge_c4_scripted does

#

Or whatever it's called

little eagle
#

Everything with triggerWhenDestroyed = 1; will work

blazing zodiac
#

The one demo block has scripted versions that triggerWhenDestroyed

lethal cave
#

yeah i remember that one, i'll try it

#

thanks guys

little eagle
#

yw

sly mortar
#

I've been using attachTo to attach a chemlight to units. I've noticed when units enter vehicles it loses the chemlight. Anyone had experience with this issue or know a solution?

little eagle
#

known by me at least

#

AGM / ACE just remove it while entering a vehicle and attach it later again

#

but that is a bitch to set up

#

the event handlers getIn etc are shit and dont trigger on certain script commands

#

and since zeus uses those they are out of the question, at least for us

sly mortar
#

I was thinking an event handler would be the way to solve it.

little eagle
#

you can use getInMan / getOutMan, just expect it to fail on the corner cases

lethal cave
#

damn great that someone made config dump of arma, will be really easy to find triggerWhenDestroyed ammo

little eagle
#

the chemligh isn't actually gone. it floats next to the vehicle. really annoying

sly mortar
#

I noticed the chemlights at the side of the vehicle. Forgot to check if they reattach when the unit leaves the vehicle.

little eagle
#

they do

#

they actually are attached "correctly"

#

it's just that the part of the memory LOD is dislocated in vehicles

sly mortar
little eagle
#

the soldier isn't attached to the vehicle in the same way

#

the problem is that attach to points to the entity, but the player becomes a proxy of the vehicle. The vehicle becomes the target entity for the attached item

#

the offset is no longer calculated to the solder, but to the vehicle. and the vehicle is usally bigger than a soldier, so the item ends up in a corner of the bounding box

#

afaik has this been in every Arma since attachTo exists

#

( I read the notes in the ACE 2 source )

sly mortar
#

So to get them to attach to units in vehicles, would need to find the right offset for each vehicle position and vehicle type.

little eagle
#

I guess that could work

#

oh, test first if the item moves with the vehicle

worthy spade
#

Is it possible to apply unit traits to the new CfgRespawnInventory classes? I'm trying to create combat life saver and engineer roles for Zeus.

#

Or embed scripts somehow so I can run player setUnitTrait ["Engineer",true];

tough abyss
#

how i can make a while in 1 in 1sec in all server uptime?

jade abyss
#

use Googletranslator again pls

tough abyss
#

lol

jade abyss
#

You wanna have while{true}do , that executes only every 1s?

tough abyss
#

yes

jade abyss
#

sleep 1;

tough abyss
#

sleep not work in console right?

jade abyss
#
while{true}do
{
sleep 1;
diag_log "Scripting is easy";
};```
dusk sage
#

Console is un-scheduled, so no

jade abyss
#
{
abc = true;
   while{abc}do
   {
     sleep 1;
      diag_log "Scripting is easy";
    };
};``` ServerExec
If you want to get rid of it
`abc = false;` serverExec
#

eeeezzzzziiiiiiiii

tough abyss
#

ty

#

but i want script run only in each client

#

is like a wasteland gun stores marker what i want to make

jade abyss
#

You said its on the server

#

gl with that, if you struggle with that =}

tough abyss
#

realy... sorry

jade abyss
#

sorry? Erm, okay. Not the answered i expected^^

#

Start with some Basic Scripting stuff. Learn how the basics work, rest comes after some time.

#

Its not "magic". Some logic thinking and knowing the commands -> pretty easy =}

tough abyss
#

so ty

tough abyss
#

i said sorry because i said server but is client actually. 😃

jade abyss
#

^^

dusk sage
jade abyss
#

Thx, i was searching for it

dusk sage
tough abyss
#

i know a little the code logic because i know PHP, and yes, i'm reading all time the wiki.

#

ty for all the help and tips

tough abyss
#

lol

dusk sage
#

Don't forget that lazy eval

#

Kappa

tough abyss
#

@tough abyss for run only in client?

dusk sage
#

oh god

jade abyss
#

&& hasInterface @tough abyss You forgot that

#

if (isSingleplayer && !isMultiplayer && hasInterface && (!isDedicated || isDedicated) && vehicle player == player) then {hint 'apex protocol babyyy!';}; take that

#

["LetsBreakIt","onEachFrame",{if (isSingleplayer && !isMultiplayer && hasInterface && (!isDedicated || isDedicated) && vehicle player == player) then {hint 'apex protocol babyyy!';};}] call bis_fnc_addStackedEventhandler;

lone glade
#

the sound trying to play itself will crash the game, use hintSilent

jade abyss
#

But i wanna crash it

tough abyss
#

I'm using some small balckListedAreas in BIS_fnc_findSafePos to exclude points on vehicles (the code ignore vehicles like cars and heli), but those small black listed areas are not working, the code still find points where there is vehicles. Small blacklistAreas are ignored by the function?

#

this is my blacklist [[[11319,11190],[11379,11130]],[[11334.8,11199],[11394.8,11139]]]

#

Ops... i found a error. Lets see. Thanks anyway.

#

solved.

quiet bluff
#

i want to to make "addaction" on every spcific class on map (that i put on editor)

#
_object  addAction ["Hack","openintel.sqf"]
};
#

dont work

blazing zodiac
#

Whats the variable _object represent?

quiet bluff
#

_object = "Land_Laptop_device_F";

#

just realized

#

checking now

blazing zodiac
#

Are the laptops placed via editor or sqf?

#

Or part of the map

quiet bluff
#

editor

blazing zodiac
#

How are you checking the placed objects?

#

allMissionObjects?

#

Or entities or something?

quiet bluff
#

none?

blazing zodiac
#

What do you mean?

quiet bluff
#

*none

blazing zodiac
#

So you aren't checking the objects placed?

#

If you don't wanna check the objects on the map you could always make a function and call it in the laptops init

#

And have that execute whatever you want on it

#

addAction and whatnot

quiet bluff
#

i didnt say i dont wanna

blazing zodiac
#

Ok, I have never used entities before but I imagine you can go down to the class.

#

So something like

#

Run this in your debug console quick and paste it here please

#

copyToClipboard str (entities "Land_Laptop_device_F");

#

Do that in mission where your laptops are placed

#

So we can see if it returns them

quiet bluff
#

[7eadd600# 4: laptop_unfolded_f.p3d]

blazing zodiac
#

Is there only one placed?

quiet bluff
#

for now

blazing zodiac
#

ok cool

#
{
  if ((typeOf _x)) ==  "Land_Laptop_device_F") then {
    _x addAction ["Hack","openintel.sqf"]
  };
} forEach _objects;```
#

Try that I think

#

or actually

#

You may be able to just do this _objects = entities "Land_Laptop_device_F"; { _x addAction ["Hack","openintel.sqf"] } forEach _objects;

#

Not 100% though, never tried this before

#

Try either and let me know

quiet bluff
#

iin the first it say "missing ;" line 3

blazing zodiac
#

Oh yea it is

#
{
  _x addAction ["Hack","openintel.sqf"];
} forEach _objects;```
#
{
  if ((typeOf _x)) ==  "Land_Laptop_device_F") then {
    _x addAction ["Hack","openintel.sqf"];
  };
} forEach _objects;```
#

Try the first one I just posted first though

#

The typeOf check I dont think is required

quiet bluff
#

still same error

blazing zodiac
#

the missing ; error?

quiet bluff
#

yes

blazing zodiac
#

In this one?

#
{
  _x addAction ["Hack","openintel.sqf"];
} forEach _objects;```
quiet bluff
#

no

#

other one

blazing zodiac
#

Try that one

#

The first one was missing the ;

quiet bluff
#

yes

blazing zodiac
#

Working?

quiet bluff
#

yes..

{
  _x addAction ["Hack","openintel.sqf"];
} forEach _objects; ```
#

thank you

blazing zodiac
#

Ok awesome

#

No problem

#

If you ever add a ton of objects

#

It may be faster to write a function for it

#

I'm not sure of the overhead of entities

#

And you would probably have to remoteExec this anyways if you are using it in multiplayer?

#

Again I'm not 100% sure

#

But with addAction being local it may be the case

little eagle
#

doesnt matter if the command is slow if you only use it once on mission start. they are not THAT slow.
allMissionObjects was the broken one that takes 2000 times as long as entities/allUnits etc.

blazing zodiac
#

Ah ok, I knew I remembered reading one of them was broken

#

But like you said I suppose it wouldn't matter in his case

little eagle
#

it really doesn't

hearty shoal
#

with lbSetData theres is a index number. control lbSetData [index, data] im unsure what that should be :S

thin pine
#

Index of the item that you want to setdata upon

#

E.g. the third item wud be index 2

jade abyss
#

nope

#

Same with removeMagazine or removeWeapon or any other Inventory related stuff. Just not possible to remove single Items from a Vehicle Inventry (wich is crap as hell)

hearty shoal
#

So in a loop that would be _x? @thin pine

thin pine
#

if the array you're cycling through is one of listbox item indexes, yes

thin pine
#

Does anyone know of a way to detect what someone writes in MP chat? Allowing for e.g. chat commands? Other than creating a keylogger using keyDown EH 😛

tough abyss
#

You could always take a look at scripts that kick for people using 'abusive' language.

thin pine
#

Yeah I guess but I found what I was looking for, (ctrlText (finddisplay 24 displayctrl 101)) - returns the text in the chat bar, I sometimes forget how open access arma is 😛

dusk sage
#

Could read the content of the chat logs

austere granite
#

Can't press those at all for some weird reason.

#

Nothing is overlapping it

#

Already try ctrlSetFocus through them to pull them forward too, still no luck

thin pine
#

@austere granite Any luck yet?

austere granite
#

Nope

thin pine
#

I was just working on sumn that involved a button on the map...I totally didn't test it and now I realized I added a button to a resource...so that won't work :/ If you can't add extra buttons to the main map then my plan is ruined too

austere granite
#
                ctrlSetFocus (_x controlsGroupCtrl 32);
                (_x controlsGroupCtrl 32) ctrlSetPosition (ctrlPosition (_x controlsGroupCtrl 32));
                (_x controlsGroupCtrl 32) ctrlCommit 0;
                nil;
            } count [ctrl(22), ctrl(23)];

tried this too, no luck still.

thin pine
#

if it absolutely doesn't work you can go over the top complicated and create your own hover & click events in combination with a resource that is shown on the map.

#

But I suspect for the buttons to work normally you'll need to create a dialog and inside the dialog you create a map instead of trying to modify the main map

austere granite
#

Yeah I can't figure this out at all. All the configs seem a-okay

#

Positioning all works fine too, but seems like something is drawn on top which prevents me from clicking

#

well @thin pine it does work, it's something in my config so gotta check waddap, but at least you can place buttons on map just fine

thin pine
#

alright great 😄

austere granite
#

Yeah listBox, it was just something on my end, not sure what I fucked up, still trying to work it out

#

Nah it's all good, just gotta unfuck my positioning somewhere. It's in the header bit, although the height is correc tthere, it still blocks it

#

So not related to arma being annoying

austere hawk
austere granite
#

nah

#

works for all

austere hawk
#

are those selection names case sensitive?

austere granite
#

Don't think so

elfin bronze
#

Hey, I have a missionConfigFile with :

class buisson { variable = "buisson"; className = "Land_Hedge_01_s_2m_F"; interval = 4; time = 5; };

In my script I want to find the class where the classname isEqualTo _SomeVar;
anyone have an idea how to process ?

dusk sage
#
"getText (_x >> 'className') isEqualTo _SomeVar" configClasses (configFile >> "CfgName");
native hemlock
elfin bronze
#

So if i do that _a = getText (_x >> 'className') isEqualTo "Land_Hedge_01_s_2m_F"" configClasses (configFile >> "CfgName"); it's return _a = "buisson" ?

#

ok it's work thank

austere hawk
#

if i write
if (condition1 AND condition2 AND etc)
does it check up those in the order i defined them? Say i have a couple of more computationally tasking checks, should i place them at the end?

native hemlock
#

It will check all of the conditions regardless if one of the previous ones was false, unless you less lazy evaluation or put the conditions inside of each other.

if (condition1 && {condition2} && {condition3}) then {};

For the above code it would only check condition2 if condition1 was true, and only check condition3 if condition2 was true

austere hawk
#

k good to know

dusk sage
#

Out of interest, is there a good argument as to why lazy eval* isn't by default?

native hemlock
#

I don't think you'll find a good argument to why it's not enabled by default, just reasoning behind why it happens in Arma.

dusk sage
#

I entirely understand lazy eval, it just gets tiresome using it on literally everything

fringe estuary
#

I have an Objective to "Disable Generator". The Generator is placed on the map and I'm running a lights script that allows an addaction to turn the lights off. I want to setup a "Fail" and "Succeed" task state but I'm unsure how to check for task fail and task succeed? Any ideas, suggestions? Note: the task fail will be at the end mission if the objective is not completed, but still do not know how to check for complete or not :(.

wet pecan
#

Is there a Ace3 scripting command to remove captives from an enemy (RHS) vehicle? I've tried both leaveVehicle and unassignVehicle and they seem to be blocked by Ace, if I run either of those commands through the debug console the door opens like the prisoner wants to get out but is blocked from moving.

#

I've looked over the Ace3 framework wiki and haven't found anything but not sure if its named something I'm not thinking about

jade abyss
wet pecan
#

Unfortunately that doesn't seem to work either, I can see that it is trying to get him out of the vehicle (he flashes out of the vehicle in the background) but then is moved right back into the vehicle.

jade abyss
#

Exec that command, where the Unit is local (e.g. Server)

#

nvm, its global

#

It should work oO

wet pecan
#

like through the trigger?

jade abyss
#

trigger? Hell no^^

#

Try Example1

#

{moveOut _x} forEach crew cursorTarget;

wet pecan
#

I just ran,
moveOut HRT;
I'll try that real quick

#

Yeah that removed everyone but the captive from the vehicle, the captive did the same thing as before, flashes on the screen for sec before getting back in the vehicle

jade abyss
#

oO

wet pecan
#

I don't know if it makes a difference but I did drop the unit into the vehicle from the editor

#

He was not loaded into the vehicle from a script or anything

#

I don't know if that makes a difference but I wouldn't think so.

jade abyss
#

No clue, haven't played around with AI alot.

wet pecan
#

kk np thx for your help, I hadn't seent that moveOut command so that'll help with something else I was trying to do.

jade abyss
#

o7

thin pine
#

@wet pecan with ace you need to unset the ace cargo index variable or itll force the captive back in. Easiest would be to just use [HRT] call ACE_captives_fnc_vehicleCaptiveMoveOut;

wet pecan
#

Hopefully someone can help me out with this because i'm lost at this point, last night I patched together this script that removes a captive from the vehicle and places him in a random building near by.

nearesthouses = getMarkerPos Cap_Building nearObjects ["Barracks",25]; 
 
houseList = []; 
{ 
 for "_i" from 0 to 20 do { 
  if ( [(_x buildingPos _i), [0,0,0]] call BIS_fnc_arrayCompare ) exitWith { 
   if (_i > 0) then { 
    houseList set [count houseList, [_x, _i]]; 
   }; 
  }; 
 };  
}forEach nearesthouses; 
 
randomHouse = houseList select (floor (random (count houseList)));

housePos = (randomHouse select 0) buildingPos (floor (random (randomHouse select 1))); 
HRT setPosATL housePos; ```
#

If I run that from the debug console it works perfectly fine

#

Last night I placed it in a trigger with the condition (HRT_Transport in thisList) and it worked for the most part, the hostage was moved from the vehicle but not placed in a building, since it was late I saved and figured i'd work on it more in the morning

#

This morning now the tirgger and script didn't get saved for what ever reason and now when I recreate the trigger with that same script nothing happens, but it still runs fine in the debug console

#

I added a hint line at the top to make sure that the trigger was activated and it pops up fine but the script never executes

#

I've also tried setting up a scripted waypoint for the HRT_Transport and it moves on from the waypoint as if the script was run but he hostage is not removed from the car or placed in a building

#

So if anyone has any ideas as to what Im doing wrong I would appreciate it because I have no clue at this point

vapid frigate
#

i gather you've named the guy HRT?

vapid frigate
#

btw there's _x buildingPos -1 now, will return all the building positions

#

so you could use houselist = nearestHouses apply { [_x, count (_x buildingPos -1)] } select { (_x select 1) > 0 };

#

instead of that loop

wet pecan
#

@vapid frigate Thanks man that seemed to fix my problems not sure what was wrong with the loop but once i replaced it with your line it worked fine

lethal cave
#

is it possible to extract one bullet from the mag in the inventory, or will i have too remove the mag and add a new one with less bullets?

jade abyss
thin pine
#

Beat me by a sec

#

Lol

jade abyss
#

😄

thin pine
#

The paste option was highlighted :D

jade abyss
#

huehue

lethal cave
#

setAmmo works only if the weapon is in hands, i need to change the ammo of a mag in the inventory

#

i guess i will have to remove mags and re-add them to make this work

jade abyss
#

Yeah, couldn't think of another way

#

Something different: Anybody played around with addMPEventHandler ["MPKilled", ?

lethal cave
#

i did

jade abyss
#

Demanding?

#

Or "reliable"

lethal cave
#

sometimes yeah, you set it up once server only and it will track the object even if it changes locality, unlike usual EH

jade abyss
#

What concerns me is: " EH code will trigger globally on every connected client and server "

#

hm,... if(!isServer)exitWith{}; ? hmm...

lethal cave
#

i'm not sure, but afaik it fires only where it was attached

#

or that to make sure yeah

blazing zodiac
#

It definitely does fire on all machines

#

the MPKilled EH

#

I use it for my xp gains per kill so each player gets the xp for anyone getting the kill

meager granite
#

Assigning MPKilled EH sends entire handler code to all clients and will execute everywhere regardless of locality

jade abyss
#

Yeah, was playing around with it. As long as its just a simple !isServer check -> Might be suitable for me.

meager granite
#

There is also EntityKilled now

#

Which is server-side only and locality-independent

jade abyss
#

Uh, nice.

#

Thx alot. Thats what i was look for.

meager granite
#

Runs on everything though, including client-side rabbits and snakes to map objects

jade abyss
#

Yeah, thought (hoped) so

meager granite
#

Do append or select commands have index local variable like count and forEach have _forEachIndex?

elfin bronze
#

I try to pushBack some object i create but my array is constantly whiped and get only the last created object :/

Example :

``
array = [];
_a = "B_quadbike_01_F" createVehicle position player;
array pushBack _a;

array = ["967c0100# 1781324: quadbike_01_f.p3d"];
``

if I retry : array = ["84f0ab00# 1781351: quadbike_01_f.p3d"]

meager granite
#

because you create new array each time?

#

array = [];

#

Try if(isNil "array") then {array = [];};

elfin bronze
#

OOOH i'm so stupid -_-

#

I forgot to remove the array = []; on the top of my script so yeah is whiped

meager granite
#

Oh, true, it doesn't.

sterile ravine
#

it try to bind an addaction to a object and want to place a condition on it. in this condition i try to evaluate if a player is in a specific animationstate (climbing a ladder). in the wiki it says i can access the player using the addaction with the variable _this. so i tried to build the following check:
'''!(([animationstate _this, 0, 5] call BIS_fnc_trimString) == 'ladder')
it seems _this is not replaced with the player object. if i replace _this with player and put it in a watch it evaluates correctly. anyone an idea what i'm doing wrong? or how i could debug this problem?

meager granite
#

To debug you can simply do: systemChat str [_this, player == _this];

#

to see what is _this and if its player

sterile ravine
#

also in a condition of an addaction? because i tried it with hint str _this and got no output

meager granite
#

Also you can do animation check much easier with find command:
toLower animationState player find "ladder" >= 0

#

Yes, right in the condition

sterile ravine
#

with your condition it works now. maybe the other evaluation took to much time - so it was never really evaluated. thanks!

meager granite
#

Or you had an error and it didn't execute

#

Make sure you start game with -showScriptErrors

sterile ravine
#

i always run the game with that - so i think it was no error. but thanks!

scarlet spoke
#

@sterile ravine I think that _this in the addAction condition is actually nil and that the condition check is done oin an unscheduled environment. Therefore any command that would be fed with the nil argument would just not get executed (in your case the hint)

velvet merlin
#

is it possible to setObjectTexture on weapons in some way?

#

like if they are in the weapon holder, that is the object - not the weapon(s)

#

getWeaponCargo doesnt give you the object either

#

the Weapon_XXX classes are also just containers and not the weapon itself (aka no object reference)

meager granite
#

Not possible

#

setObjectTexture operates with entities only

elfin bronze
#

It's possible to know if an object is in the radius of source's light ?

austere granite
#

Is it possible these days to create items that show up as "Place Whatever (2 left)" and then instead of a normal explosive placement run a function instead?

#

Basically wanna have action attached to a certain magazine type when in inventory

meager granite
#

Possible, you'll have to do everything manually though

austere granite
#

Yeah i was hoping for a way to just add it to the weapon / magazine config like some of the vanilla stuff, but I guess that's wishfull thinking.

tough abyss
#

it's not recomended to use Stringtable.csv for localization?

#

(csv)

steep matrix
#

b:STRING callextension ARRAY

#

anyone knows whats new in the arary version?

#

or why this was remove again?
b:OBJECT addmissile ARRAY

ivory nova
austere granite
ivory nova
#

@austere granite Thank you!

buoyant heath
#

Are ctrlEventHandlers removed along with the controls when the display closes or do they need to be removed manually?

native hemlock
#

@steep matrix Some information I dug up about the new version of callExtension

handle = "pipes" callExtension ["openPipe",[arg1, ..., argN]]
Execute an extension function with additional arguments
steep matrix
#

cheers

tough abyss
#

A magazine repack script?

#

You could look at how ACE does it.

#

Theirs is very intuitive.

#

You'd need to add it into a menu or an addaction rather than through the ACE Interact menu, though.

#

How do you plan on calling the script?

#

Are you making a GUI with other functionalities, or are you just doing an addaction?

#

Yeah, I'm certain you could implement it that way.

#

As far as I know ACE is open-source.

#

I'd much rather they fix their performance issues! :v

#

There's no reason I should be running at 50 FPS with a GTX 1070.

#

But that's for another chat.

#

Oh, I know. I was being liberal with 50FPS.

#

My networking knowledge is more profound than most, but I don't know why they'd use TCP over UDP.

#

Headless clients are a godsend.

#

AI calculations are.

#

Really?

#

I'll relay that to my group.

#

Do I stick 'enablesentences false' in their init field?

#

In my experience with my group, most people are not perceptive enough. 😛

#

I quite like ACE's interact menu.

#

Honestly, I half-wish it was integrated into base Arma

#

Which makes sense, they should.

#

The Arma interact menu has been a thing since... OFP, maybe? CWA at the latest.

#

You can never win

#

Just below the cursor works nicely, I've found.

#

"Yeah, this mission works fine on a local server."

#

And then a dedicated server just

#

fucks everything

buoyant heath
#

You should be able to find a couple mag repack scripts floating around already.

#

Even before ACE3 had one, there were a couple in other game modes.

meager granite
#

Design everything with MP in mind and you'll be fine

tough abyss
#

TADSST?

#

TADST*?

#

Is that like a mission environment to simulate a dedi?

meager granite
#

I always develop by hosting lan server through server browser

buoyant heath
#

Dedicated server control panel.

#

Makes booting up and changing mods/missions around a bit more convenient

meager granite
#

Not many cases where I really need client and server to be separate, everything is designed to run on both dedicated and listen server

jade abyss
#

\o/ having his own DevServer at home+online \o/

austere granite
#

overkill tbh imo

#

but yea if i need to test ez mode i just do self-host and then start up second copy of the game and connect like that

velvet merlin
#

is restart necessary?

jade abyss
#

Miss.altis -> Miss.tanoa

#

^^

austere granite
#

Is there a way to control in which order UI classes are added when adding one to an already existing config?

jade abyss
#

Add at the end -> Pops up as last Item -> On Top

austere granite
#

Yeah i want it to be at the bottom, but the classes that already exist within that dialog get drawn below it

#

I guess rather than deleting an existing unused entry I'll just reconfig one of those classes to be my background instead

velvet merlin
#

well just do idc=-1 and x/y=-10

#

now redo all classes as you please

slate vale
#

Guys I have a question fast, I have seen alot of scripting things where there is usually a code such as "_this select 0" What does this code mean? I know _this is a local variable and I know select 0 etc is for like arrays but what does _this select 0 usually do+

#

Just an example maybe of what I am meaning, I saw a code like _player = _this select 0

native hemlock
#

In that scenario _this is probably an array of arguments being passed to the function. For example

testFunc = {
    _message = _this select 0;
    hint _message;
};
["Hi"] call testFunc;
#

A command that makes my example faster and easier to read from is params, so you'd do

testFunc = {
    params ["_message"];
    hint _message;
};
slate vale
#

Yeah I know about that, but what does _this have for arrays? I never see like _this = "Hi" and then hint = [_this]; would've make more sense lol

austere granite
#

_this can be anything, but it's always an argument passed to code

slate vale
#

Oh okay

austere granite
#

if you do "hi" call { hint _this }; then it'll work

#

if you do ["hi"] call { hint (_this select 0) }; it'll do the same thing

#

The reason almost alway an array is used, because then you can add extra argumetns without adjusting all the other _this entries

#

the params ["_firstArgument", "_secondArgument"] command is super useful though

#

by default params will use _this to select from array

slate vale
#

Ah, I quite understand I'll try to try out stuff until I understand it 100%

#

Thanks anyways

buoyant heath
#

Personally, I'd go vest -> backpack -> uniform if I was setting up the script

#

That's my personal preference

#

and it drives me crazy reorganizing

#

The arma inventory commands fill uniform -> vest -> backpack

#

Nothing wrong with that, unless you habitually reorganize your inventory like I do.

meager granite
#

you repack smaller magazines into bigger one, place then where bigger ones were

austere granite
#

vest over uniform pls

meager granite
#

logically I mean

shrewd lance
#

@velvet merlin @native hemlock

void __stdcall RVExtensionArgs(char *output, int outputSize, const char *function, const char *args[], int argCount) {
    ZERO_OUTPUT();
         std::stringstream debugreturn;
         debugreturn << "<start> [Function: " << function << "]";
         for (int i = 0; i < argCount; i++) {
             debugreturn << "[arg" << i << ": " << args[i] << "] ";
         };
         debugreturn << "<end>";
      
        std::string returnValue = debugreturn.str();
        strncpy_s(output, outputSize, returnValue.c_str(), _TRUNCATE);
    EXTENSION_RETURN();
}

Example call: "myDll" callExtension ["tFnc", [123,456,player]]
Return: "<start> [Function: tFnc][arg0: 123] [arg1: 456] [arg2: B Alpha 1-1:1] <end>"

native hemlock
#

Does callExtension pass the argCount then?

shrewd lance
#

as far as I can tell, I just guessed the arguments when you said it went from @tough abyss to @20

native hemlock
#

Good to know, thanks. I was testing it with a C# extension, but that information is still helpful.

hearty shoal
#

Are there any documentation on how the custom controls work? Basically i want the user to be able to choose what keys to bind and that seems the best way to go

austere granite
#

@hearty shoal

#

In use with "User1", "User2" etc

#

then you basically check if _button (from keyDown EH) is in array for that actionKeys "User1" and tada

#

If you want ctrl/shift and so to work okay check the comments on actionKeys

dusk sage
#

Tweaked: The isSingleplayer command was renamed to isMultiplayerSolo

heh

jade abyss
#

Good for KotH (e.g.)

#

To get the "real" shooter, instead of Commander/Driver.

meager granite
#

FFV damage source is already unit itself, not vehicle they're in

#

It becomes a little bit more tricky to tell if damage from done by running over or it was FFV though but I think instigator is null with running over while its same as source in FFC case

#

Distance check is not a certain way to tell it

#

Will be very unreliable

#

Is collision damage check done on client or remote side?

#

epecontact is another thing

#

If its case of remote client deciding if you should get collision damage then its even more unreliable because by the time you get damage packets vehicle might be already far away

#

Anyway, distance check is unreliable solution here

#

I was talking about being run over, when vehicle runs you over its driver is sent as damage source, not the vehicle itself

#

I think instigator should be null in this case and not null if it was FFV since FFV also sends unit, not vehicle where unit is

#

I already told how, if damage source is unit that is in vehicle, instigator will be null if this was running over and not null if it was FFV

#

That's why I said tricky, its not explained

#
_ffv = vehicle _source != _source && _instigator == _source;
_runover = vehicle _source != _source && isNull _instigator;
#

no it will return driver

#

Actually not sure what it will return if you're on co-pilot, lemme check

#

Returns copilot properly just like driver

#

So running over always returns unit as source damage, not vehicle, regardless of being co-pilot

nocturne bluff
#

does running over return the vehicle as source?

meager granite
#

So running over always returns unit as source damage, not vehicle, regardless of being co-pilot

nocturne bluff
#

Sorry, too early

#

;D

meager granite
#

No, its driver

#

I just checked, it properly returns actual driver even if its co-pilot

#

No its unrelated to driver command

wise grove
#

I am trying to get a basic briefing on the line. It just does not execute when you switch from lobby to tactical map

#

Init.sqf:

#

execVM "briefing.sqf";

#

briefing.sqf:

#

waitUntil { !isNull player };
waitUntil { player == player };
switch (side player) do
{
case WEST:
{
player createDiaryRecord ["Diary",["Intel","Der Feind hat einen Kilometer langen Wall um die Südseite von Zargabad errichtet und umliegende Gebiete vermint. Die einzige Möglichkeit durchzubrechen ist direkt durch den Wall.
Der Wall hat mehrere Weakpoints, welche sich für einen Angriff eignen, doch diese sind stark bewacht.

Innerhalb des Walls befindet sich das FOB "Eagle's Nest", welches unser erstes Ziel sein wird:
<img image='Eagles Nest FOB Far.jpg'/>

Innerhalb des FOBs befinden sich mehrere Ziele, welche wir vernichten müssen, um zu gewährleisten, dass uns niemand auf dem Vormarsch in den Rücken fällt:
<img image='Eagles Nest FOB Close.jpg'/>"]];
player createDiaryRecord ["Diary",["Situation/Hintergrund","Zargabad, 29 Juni 2016, 0500

Der IS ist auf dem Vormarsch durch kurdisches Land. Zargabad ist eine gut befestigte Stadt des Feindes welche das taktische Ziel dieser Mission darstellt.
Wir sind in der Unterzahl doch müssen diese Ziele ausschalten um einen weiteren Vormarsch des IS zu unterbinden."]];
player createDiaryRecord ["Diary",["",""]];

};
case EAST:
{

};
case RESISTANCE:
{

};
case CIVILIAN:
{

};
};

#

Help would be much appreciated

meager granite
#

Try with test texts instead of final text, maybe you have misplaces quotes or errorous structured text

wise grove
#

I used a briefing tool

indigo snow
#

not a good one

#

det sich das FOB "Eagle's Nest", welches unser

#

breaks your string right there

wise grove
#

ill fix

jade abyss
#
Sa-Matra - Today at 11:28 AM
Is collision damage check done on client or remote side?``` Afaik Client
wise grove
#

the " " was the problem

#

it works now, even the pictures are shown

#

thanks for the help nick

indigo snow
#

np

wise grove
#

@indigo snow

indigo snow
#

do you use any text tool to write these?

#

notepad++ has arma syntax checking

#

should make errors like these really noticable

austere granite
#

Is there some extra thing i need to do before initDisplay scripts work by itself?
onLoad = "[""onLoad"",_this,""FRL_RscUnitInfo"",'FRL_IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
Checked initDisplay.sqf and the rest of the data is all saved, but for some reason uiNamespace getVariable "FRL_RscUnitInfo_script" isn't being compiled

#

running ```
_fncName = "FRL_RscUnitInfo" + "_script";
_fncFile = preprocessfilelinenumbers format [gettext (configfile >> "cfgScriptPaths" >> "FRL_IGUI") + "%1.sqf", "FRL_RscUnitInfo"];
fncFile = format ["scriptname '%1%2'; fnc_scriptName = '%1%2';", "FRL_RscUnitInfo", "onLoad"] + _fncFile;
uinamespace setvariable [
_fncName,
compileFinal _fncFile
];

which is just my params placed in what initDisplay.sqf runs itself works fine, but it means that my UI script only works after I run that msyelf and then restart mission.
meager granite
#

What would be quickest way to delete all null objects from array while retaining same array (no array - [objNull])?

#

Quickest execution time wise

jade abyss
#

What does the last one mean?

#

_Arr = [ObjNull,ObjNull]; <- ?

meager granite
#

I mean not using _array = _array - [objNull] since it creates new array instead of modifying the original

jade abyss
#
_arr = ["a","b","c",ObjNull];
{if(isNull _x)then{_arr deleteAt _ForEachIndex};}forEach _arr;

``` ?
meager granite
#

Wouldn't work, since indexes will change when you delete an element

jade abyss
#

Ah, right.

_Index = [];
_arr = ["a","b","c",ObjNull];
{if(isNull _x)then{_index pushback _ForEachIndex};}forEach _arr;
{_arr deleteAt _x}forEach _index;
``` 😄
meager granite
#
_array = [player, objNull, objNull, player, objNull, objNull, player];
{if(isNull _x)then{_array deleteAt _ForEachIndex};}forEach _array;

array will be [player, null, player, null, player]

#

same thing, after you'll do deleteAt, indexes will change and you'll delete wrong elements

jade abyss
#

switch Sort