#arma3_scripting

1 messages · Page 59 of 1

little raptor
#

well first ask if you're allowed to use their logistics/building system scripts in SOG Discord or #sog_prairie_fire

daring zinc
#

but @queen cargo, why not just write SQF directly? Surely that's much better than using an abstraction layer like OOS?

pliant stream
#

@queen cargo damn i actually had no idea lol

little raptor
#

oh ok I thought you were asking about playerRespawnTime. well save the mission unbinarized then open the .sqm file with a text editor

unborn zinc
little raptor
#

you should see the attribute in it

#

@shut reef or just open the config viewer and navigate to missionConfigFile

sullen sigil
#

amazing, however the hemtt is vertical upon being spawned in meowsweats

shut reef
#

Seems to only hold values if you have a description.ext

pliant stream
#

i would have called it SQF++ though

tough abyss
#

GVAR prevents you from debuging. Dummest thing I've heard today. Sry.

little raptor
#

oh right meowsweats

#

well just open the .sqm file then

#

or try this one:

shut reef
#

That is how I created a nice bug in my mod that disables the delay cause it resets it to the missionConfigfile value that defaults to 0 xD

little raptor
#

it should list all properties and values

shut reef
#

lemme see

sullen sigil
#

i presume just setVectorDirAndUp after spawning in should rectify it being pointed up? meowsweats

queen cargo
#

feel free to argue @tough abyss

little raptor
#

the ones you set on the CBA object

sullen sigil
#

the cba object is pointed up and this just gets attached

tough abyss
#

@tough abyss Will do, once I'm off work

sullen sigil
#

_shipObject attachTo [_shipHelperObject];
_shipObject = hemtt
_shipHelperObject = cba target vehicle, doesnt have any different rotation to default

shut reef
little raptor
little raptor
sullen sigil
#

just rotating the cba object resolves it (however does make it go in a massive curve in the other direction 😅)

shut reef
#

respawn delay is in ScenarioData, tho

little raptor
#

just open it with with a text editor like I said before

queen cargo
sullen sigil
shut reef
#

yeah but how does that allow me to access it during runtime!?

daring zinc
#

after all, and i quote: "you just do it differently
instead of writing the var by yourself aligned to some convention
you let the macro do that for you
which either shows youre not capable of doing that
or you just wanted to use macros because "they are cool""

little raptor
#

just open it now and I'll tell you once you find what you're looking for...oof meowsweats

tough abyss
#

Well it doesn't. What is there to argue? You never explain how and why.

shut reef
#
class ScenarioData
{
    respawn=3;
    respawnDelay=10;
    respawnVehicleDelay=10;
    class Header
    {
        gameType="Coop";
        minPlayers=1;
        maxPlayers=12;
    };
    wreckRemovalMaxTime=3600;
};
little raptor
#

getNumber (loadConfig "mission.sqm" >> "ScenarioData" >> "respawnDelay")

shut reef
#

Comes up empty

sullen sigil
#

legendary, thank you so much 🙂

shut reef
#

Like the entry does not exist, when I test it with isNumer

little raptor
#

not empty

shut reef
#

Well it does show 0

sullen sigil
#

now just time to solve my velocity function being so inaccurate -- getPosWorld instead of getPosASL? causing jittering with the dir (to be expected)

daring zinc
#

that seems to apply to OOS pretty well, don't you think?

queen cargo
#

read the post

shut reef
#

but it's not because there is a value 0 to read

queen cargo
#

read the backlog

tough abyss
#

Macro usage is simple. If your projects requirements matches with the benefits of macros, use them. If not; don't. There is no single good way to it.

shut reef
#

Seems it doesn't really load much from it,
"true" configClasses (loadConfig "mission.sqm") returns [,,,,,,]

shut flower
#

but @queen cargo, why not just write SQF directly? Surely that's much better than using an abstraction layer like OOS?

quite simple: sqf is shit. oos is written for the "normal" geek that is not infected by sqf virus

shut reef
#

loadConfig "mission.sqm does point to the right file tho

little raptor
#

ah I see why

#

it's a bug meowsweats

#

the game unloads the config if you store it in a temp value while you access its children meowsweats (tho I doubt it's fixable but it should be noted on the wiki).
So this fails: getNumber (loadConfig "mission.sqm" >> "ScenarioData" >> "respawnDelay")

shut reef
#

🥳 second arma bug I find

little raptor
#

@still forum ^

little raptor
shut reef
#

oh nice, that works!

tough abyss
#

There is nothing in there. It just claims that you have to resolve the macros every time when debuging which is simply false.

shut reef
#

Thank you very much!

#

That should work in all situations, SP, MP, local MP, dedicated, etc?

tough abyss
#

Whatever or not you see those benefits does not matter; simply don't use them if you dont see them.

little raptor
#

yes

sullen sigil
queen cargo
#

@daring zinc its something completly different to use a HighLevel lang for another lang
hell i could write another HighLevel lang for C++ if i would like to

shut reef
split nebula
#

in this channel, someone arguing someone else is doing something wrong because they did it differently, more at 10

nocturne bluff
#

I enjoy it.

little raptor
nocturne bluff
#

its like 2 year olds fighting

tough abyss
#

We should make another channel for SQF h8ers

pliant stream
#

@shut flower personally i'd do it for the same reason i don't write everything in assembly or C

sullen sigil
little raptor
#

I mean where is the code? meowsweats

round scroll
#

hey Glowbal, nice yo see your around

sullen sigil
#

i sqfbinned it a short bit back but its this:

addMissionEventHandler ["EachFrame", {
    {
        private _shipLastPos = _x getVariable ["KJW_CapitalShips_LastPos", [0,0,0]];
        private _shipPos = getPosASL _x;
        private _shipVel = (_shipPos vectorDiff _shipLastPos) vectorMultiply (1/diag_deltaTime);
        _x setVariable ["KJW_CapitalShips_LastPos", _shipPos];
        _x setVariable ["KJW_CapitalShips_Velocity",_shipVel];
    } forEach KJW_CapitalShips_Ships;
}];```
daring zinc
#

so where are all these people using OOS?

tough abyss
#

Hey @round scroll

little raptor
#

why do you add so many EachFrame loops? meowsweats

sullen sigil
#

I don't, that's inside the eachframe 😅

tough abyss
#

Been a while.

nocturne bluff
#

Nowhere, and thats why X39 is satly as fuck

little raptor
#

wasn't ship attached?

sullen sigil
#

yes
but this is getting it for the logic object that its attached to

pliant stream
#

:D

nocturne bluff
#

THE END

little raptor
#

well you can use the ship to get the velocity

sullen sigil
#

literally only thing i do to the ship while its attached is the setfeaturetype + setvdirup, rest of it is all done to the object its attached to

round scroll
#

yeah, I kind of stopped armaing for a year ;)

little raptor
#

iirc this works:

velocity _attachedObject
sullen sigil
little raptor
#

CBA thing is a house?

#

wasn't it a tank?

sullen sigil
#

no, the ship is equal to a house
the cba thing is an airplane target that has no physics

#

ship -> the thing thats attached
helper -> the thing that its attached to

#

i've been working on this function for nearly 2 weeks it's confusing me too

little raptor
#

I don't know why you're attaching so many things and do so many weird things just to make a curve meowsweats

sullen sigil
#

the attached things are either just cosmetic or turrets 😅
the velocity is used for getting the direction, inaccuracy means it looks like its wiggling back and forth a bit

nocturne bluff
little raptor
#

I mean just make a normal curve meowsweats

#

did you try bezierinterpolation?

nocturne bluff
#

This will solve everything.

sullen sigil
#

yeah i use that to get the distance 😅
and then svt two objects for some reason

little raptor
#

I have no idea what you're doing anymore blobdoggoshruggoogly

shut flower
#

Seems like everybody here loves sqf so much that he got dumb

sullen sigil
#

join the club

#

bezierinterpolation -> approximate distance to be moved
logic object -> moved to destination
ship helper object -> moved to logic object at the same time
attached objects -> just come along for the ride

nocturne bluff
#

Everyones worries will wash away and scripting will be a place of peace

sullen sigil
#

anyways,
offset for attaching is just worldToModel and the vectorDirAndUp is just BIS_fnc_vectorDirAndUpRelative right?

#

just as well i didnt configure the ship in its entirety just yet seeing as i need to redo all the parts 😅

still forum
little raptor
#

I know 😅

#

I just added a note on wiki instead

daring zinc
#

it's beautiful...

#

also, do i spot a "bwa3 options"?

round scroll
#

nice video

daring zinc
#

good man.

still forum
#

also same relevant for your destructor idea (was it yours? I think it was) cuz that'd work the same

little raptor
nocturne bluff
#

pewpew.

tough abyss
#

You should update. BW now uses CBA keybinding, which are probably evil and prevent you from debuging

nocturne bluff
#

It's like.. a few months old

queen cargo
#

@daring zinc i hope nowhere
its still in ALPHA
even thought it is usable but no project should rely on it

i know a few people testing it over and over again

nocturne bluff
#

And i'm out of funny videos.

sullen sigil
#

had the profilenamespace clearing bug right before i was about to save all my scripts from adt into the mod notlikemeowcry

daring zinc
#

i have some

tough abyss
#

Thanks Putin

nocturne bluff
#

No worries, i'l always stand up for the weak minoritys.

daring zinc
split nebula
#

you should really look into expanding your collection :) 2 vids isn't a lot haha

nocturne bluff
#

Well the rest of ones are funny to me.

#

Not you anyone else.

sullen sigil
#

apologies for the massive time waste on that front notlikemeowcry

little raptor
sullen sigil
#

it should be all good now.
think i'll give banking a miss for a while given this function has taken over 2 weeks 😅

nocturne bluff
#

Grenade rain?

daring zinc
nocturne bluff
#

Shitty video tho

tough abyss
#

My flash plugin crashed when the first grenade exploded

nocturne bluff
#

xD

queen cargo
#

@daring zinc good you show us videos where your own incapability of scripting leads to fail uploads where you have to write into the description of the vid. "ignore the script error"

daring zinc
#

o no wat do

#

x39 is such stronk

tough abyss
#

X39, how do macros prevent you from debuging? I couldn't find anything in the blog

nocturne bluff
#

HE DA MAN

daring zinc
#

@nocturne bluff where were you when @queen cargo was did?

shut flower
#

God, @daring zinc dunno how stupid you are

daring zinc
#

well i don't either

tough abyss
#

Let's measure it with the stupid-o-meter

#

Who is @queen cargo ?

daring zinc
#

do you remember xeno?

#

he's like that, but with a blog!

nocturne bluff
#

HAHAH

#

I love flummi

#

That video

tough abyss
#

shots fired

nocturne bluff
#

That's going into my personall archives.

jade abyss
tough abyss
#

He's very passionate. And salty

warm hedge
#

Gah true. I misread it seems

solid star
daring zinc
#

holy shit i just read that line in the blogpost

#

apparently we're SJWs

#

top fucking kek

sullen sigil
#
private _shipVel = _ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]];
private _vdirandup = [getPosASL _ship, (getPosASL _ship) vectorAdd (_shipVel set [2, 0])] call BIS_fnc_findLookAt;``` should be allowed, right? ADT is complaining of syntax issue after the `vectorAdd` ![thonk](https://cdn.discordapp.com/emojis/700311400152825906.webp?size=128 "thonk")
#

Says No syntax matches these arguments: ARRAY vectorADD NOTHING,BOOL was in the wrong place for my specific use

shut flower
#

@jade abyss was a good choice made by BI to disable comments as this is fuckin stolen

sullen sigil
#

Though that's not accomplishing what I'm trying to here -- trying to stop the vectordirandup calc have an increase in height so it remains flat

#

private _vdirandup = [getPosASL _ship, ((getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]])) set [2, 0]] call BIS_fnc_findLookAt; is now what I'm doing but clearly it's not the correct way to go about it as ship now does not orient

little raptor
sullen sigil
#

Do I need to assign it to a variable prior then? meowsweats

little raptor
#

yes

sullen sigil
#

ah gotchu

#
private _tempVar = ((getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]));
_tempVar set [2,0];
    
private _vdirandup = [getPosASL _ship, _tempVar] call BIS_fnc_findLookAt;``` is making it point downwards 😅
little raptor
#

ofc it is meowsweats

#

you're setting the ASL height to 0

jade abyss
#

"stolen"

little raptor
#

it's even below ground in VR (terrian ASL height in VR is 5) meowsweats

sullen sigil
#

Yeah would that not eliminate any vectorUp? notlikemeowcry

#

wait thats not the right word

#

I'm trying to make it be completely flat as it goes up and down rather than point up and down 😅

#

I think my brain is frazzled after working on this for so long

south swan
#

You want to set velocity Z to 0, not total?

jade abyss
#

Reallife? wtf?

sullen sigil
#

..oh ive realised my mistake

#

ship pos would need to have the last coord set to 0

little raptor
#

just letting you know that arrays work by ref and if you do that you end up modifying that KJW_CapitalShips_Velocity array forever

sullen sigil
#

I'm confused

jade abyss
#

oO

little raptor
sullen sigil
#

oh

#

I've figured out my problem regardless

#
private _shipPos = getPosASL _ship;
private _tempVar = (_shipPos vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]));
_tempVar set [2,0];
_shipPos set [2,0];
    
private _vdirandup = [_shipPos, _tempVar] call BIS_fnc_findLookAt;``` was what i needed
#

(It's just to keep it flat as it goes up 😅)

shut flower
#

yeah, reallife, course, guess what: I'm out. too much idiots around here

daring zinc
#

it's too many idiots

tough abyss
#

rekt

jade abyss
#

wow, making fun of something like that? Really?

lethal cave
#

can't tell if you're guys serious or just kidding

daring zinc
#

macros are serious business

kindred zephyr
#

do sounds need to have an specific format?

I have a sample sound that I'm trying to pack within my mod but when doing so, the sound doesn't play at all using playSound or any other command but does show in the cfgSound config files, however when trying the same sound in a mission context, the sound is able to play using playSound3D using the path in the mission folder.

Im assuming that either I have a pathing issue in my mod, or sounds defined in cfgSounds need an specific file type and format.

tough abyss
#

bloody serious

shut flower
#

Grammar nazi inbound. Is it a nice feeling to correct a non native speaker?

south swan
daring zinc
#

someone could die if the preprocessor gets overloaded

#

think of the children!

tough abyss
#

The irony was to strong

split nebula
#

too late Whale, this has been going on for quite some time already, might as well grab the popcorn

unborn zinc
sudden yacht
#

I was looking at the sector control AI spawn module. The example expression executed on the group is. [<GROUP>,<MODULE>,<GROUPDATA>]

daring zinc
#

@shut flower i'm not a native speaker either :P

sudden yacht
#

im trying to have the units in the groups loadout change...

#

{_x setUnitLoadout [getUnitLoadout BADGUY, true]; } forEach units group _this select 0; Help...

high vigil
#

trying to figure out best way of placing player next to vehicle sets say 5m offset in ASL format along with following vehicles vector (meaning if vehicles is on slope dont place him 20m in air)

shut flower
#

Basically: @daring zinc I hope you will die because of stupidity (and because of your dumb scripting guideline).

And I don't really care about what you are

BTW: *I (has to be written upper case)

sudden yacht
high vigil
#

**in ASL format **

sudden yacht
#

um... model to world?

nocturne bluff
#

Lol.

high vigil
#

ya thats fine, biggest question is the offset point

nocturne bluff
#

Lets

daring zinc
sudden yacht
#
_aboveAndBehindPlayer = player modelToWorld [0,-1,3];```
#
_worldPos = _relObj modelToWorld _offset;
_obj setPos _worldPos;```
high vigil
#

not good

#

spawns your ass in 5 min in air

#
_offset = [5,5,0]; 
_worldPos = cursorObject modelToWorld _offset; 
player setPos _worldPos;
daring zinc
#

i feel rather threatened by that post, i better go call the UN

high vigil
#

and if the vehicle on steep hill you end up at 0,0,0 laland

tough abyss
#

Now that is a personal attack

high vigil
#

dont comment if you dont know, keep this chat clean of bs

tough abyss
#

WTB a mod....

queen cargo
#

shit ...

#

anybody can gimme my text back?

#

i accidently deleted that posts content ...

little raptor
lone glade
#

You subconsciously did the right thing

queen cargo
#

pff

tranquil monolith
#

@tough abyss I'm in on that request

kindred zephyr
daring zinc
#

o no

tough abyss
daring zinc
#

blog is kill

queen cargo
#

ty @tough abyss <3

tough abyss
#

@tranquil monolith Good to hear

dreamy kestrel
#

Q: timing wise, when are 'mission objects' loaded in relative to pre/post initialization phase EH?
I have a use case where apparently some FOB objects are deserializing (correctly) during the post init phase.
But not seeing what I think should already be there in terms of actual mission 'grass cutter' objects.
Thanks...

low zodiac
#

Good evening,
small question regarding the intro and outro phases. I added two videos for my mission and was able to execute one of them with the initIntro.sqf. But I am now stuck with the outro video and I have no real idea on how to execute it directly and wanted to ask if something like initOutro.sqf exsits or at least something else? (And can I trigger the outro with a "silent" ending instead of the usual you have completed the mission thing?)
Thanks in advance!

daring zinc
#

now that this shitposting extravaganza is concluded, let's talk about something less controversial, like tabs vs. spaces.

lone glade
#

4 spaces when pressing tab > all

#

no discussion here.

tough abyss
#

tabs must die

split nebula
#

never!

cold mantle
#

i don't see whats wrong with tabs ¯(°_o)/¯

dreamy kestrel
split nebula
#

there were some valid reasons, but i just prefer tabs

lone glade
#

What's worng ? fucking indentation issues

tough abyss
#

The length varies.

pliant stream
#

indentation using tabs, adjusting with spaces

#

with tabs everyone can just set their preferred width in their IDE

somber folio
#

@celest agate

round scroll
#

anything but 2 spaces is plain wrong (... looking for cover)

pliant stream
#

how about a compromise.. say 3 spaces? :D

lone glade
#

4 provides better readability for SQF

tough abyss
#

I take 3 spaces over tabs any day

daring zinc
#

let's take it up a notch: vim vs. emacs vs. atom vs. sublime vs. ed

#

go!

still forum
#

Notepad++

lone glade
#

VIM and atom, done

split nebula
#

sublime ftw

tough abyss
#

ST 3. It's the first one I had and it's in my nature as East German to despise change.

daring zinc
#

clearly the correct answer is vim

#

next

#

"jif" vs. "gif"

#

go!

tough abyss
#

gif

still forum
#

gif

lone glade
#

gif.

tough abyss
#

because it's written as gif

lone glade
#

consensus reached next.

jade abyss
#

Graphic -> gif

daring zinc
#

no it's jif

#

you heathens

lone glade
#

NO FLUMMI NO

cold mantle
#

gif

pliant stream
#

gif

#

definitely gif

split nebula
#

haha delete function ftw

daring zinc
#

fine, next one

#

oohh

still forum
#

42!

tough abyss
#

I do.

#

Why? It's scripting related

pliant stream
#

pls rename channel to #circle_jerk

lone glade
#

welcome to any online community ever, get your ticket and get in the file

daring zinc
#

fine, let's stay with sqf to appease @hasty violet: manually preprocess vs CfgFunctions

#

go

tough abyss
#

Hmm. Depends on how big the project is.

pliant stream
#

no cfgfunctions in arma 2 :<

daring zinc
#

arma 2? what's that

tough abyss
#

A2 dead.

pliant stream
#

yea but it's not buried yet so we get to have our little fun

still forum
#

Wasnt Arma 2 a Mod of DayZ?

daring zinc
#

i think so, yes

#

i think it's built on the "epoch" engine.

lone glade
#

like Arma3 is a mod of Altis life, (• ε •)

tough abyss
#

!dice 2

#

commy2 rolled 2 dices. Result: 5, 1

lone glade
#

the shit

tough abyss
#

What did they add?

queen cargo
#

just to quickly end the topic macros in my head:
all you had as "argument" was bullshit you negated yourself later or never actually prooven
and all you did thus was flaming
great job
thats what i expect from our ACE3/ex-AGM devs
thx for prooving my point

daring zinc
#

and all you did thus was flaming

#

you're projecting so hard you could show off powerpoint presentations

tough abyss
#

lol

#

X39, how do macros prevent you from debugging? Can't find that info in the blog.

queen cargo
#

there is an example @tough abyss check it ..

tough abyss
#

Point me to the line. I can't find it.

queen cargo
#

QGVAR(colorTextMax)
you got two seconds to tell me without context which variable this is, where it belongs to etc.

tough abyss
#

It's a maximum threshold for a text color.

#

It belongs to the pbo/folder you are editing

still forum
#

It is

diag_log QGVAR(colorTextMax)

when you want to debug

meager granite
#

What was the way to return current camera zoom level?

warm hedge
#

Camera as in camCreate'd or your player character's?

meager granite
#

Thanks

queen cargo
#

great idea @still forum! Will try that ingame in a few seconds

meager granite
warm hedge
#

Are you trying to get a remote player's zoom level? I guess it is not MP friendly or requires some workaround

meager granite
#

No, just my own camera zoom, whatever player is seeing

warm hedge
#

Ah that makes sense. Guess feasible enough

meager granite
#

I've been using KK's distance2D worldToScreen positionCameraToWorld hack, wondering if this can be done better nowadays

warm hedge
#

It ain't that bad solution though

meager granite
#

It works well, just a bit imprecise

lone glade
daring zinc
queen cargo
#

@lone glade no fucking clue what you want to point me at with your link
and to 3 and 4 pff! till now, i did understood every shitcode i had to read and there was NO case where i did not understood it

lone glade
#

Are you unaware of the glorious git blame function ?

queen cargo
#

think you did not got the point of my 1. point

#

as said below

#

there are no real arguments in that post yet

#

so just take the headlines

#

((easier for people like you anyway))

lone glade
#

Well, here's the issue if you understood it you wouldn't be supplying the mediterranean sea with salt.

queen cargo
#

dont worry @lone glade, updated 1. for you with extra text to explain to people like you too

tough abyss
#

Stupid people using it, more stupid people developing for it

T_T

nocturne bluff
#

I really wish you could write less like a 12 year old.

queen cargo
#

well ... some things never will happen @nocturne bluff

lone glade
#

:D

nocturne bluff
#

Yeah, figured.

lone glade
#

my sides are now in orbit

nocturne bluff
#

Can i blast up there too?

queen cargo
#

only if you do rocket science MrPutin

nocturne bluff
queen cargo
#

outdated stuff like usual russia ...

nocturne bluff
#

Not even russian xD

#

Well i've shotposted enough in here for today i think

meager granite
#

Speaking of gut feelings, altering select to accept negative indexes could've broken some things as well, because now if you select by result of find or findIf, selecting -1 will return last value instead of erroring out.

#

I guess its the same case with set, a theoretical issue somewhere VS massive usefulness gain

grizzled cliff
#

exporting?

#

the 148 has a little speaker on it

#

that you can turn on

#

so other people can hear your radio

little raptor
#

What Dedmen says is that set will now return something in a place where it shouldn't (and the user trusted that it doesn't)

meager granite
#

Who knows maybe some function somewhere now will return -1 (last) element from array instead of erroring out

#

Its same in a sense that its kind of hypothetical issue somewhere

#

Sure nobody built their code to error out, but now instead of an error, it will select some array values

chrome hinge
#

Any idea how i can detect when a vehicle is repaired with the repair kit?

sacred breach
#

'🍤

quiet gazelle
#

would there be any peformance impact (outside of when i'm assigning them or deleting the objects) if i were to add "deleted" eventhandlers to hundreds of objects?

hallow mortar
low zodiac
meager granite
#

You can instantly end the mission with endMission command

quiet gazelle
#

Is there a way to preload models without having them spawned in?

#

They don't have a config either, it's just plain .p3ds

warm hedge
#

createSimpleObject?

grizzled cliff
#

oh. you could kinda rig one up using the radio system

low zodiac
# meager granite Just do `execVM` with your script when you need it

Already using execVM for the outro Phase, but that has a slightly delay unlike the initIntro.sqf version for the Intro Phase.
endMission works with a charm for both the intro and the outro. But for the scenario itself it has the "Mission Completed" screen which I would like to have skipped so it goes directly to the outro phase.

grizzled cliff
#

make a radio with a loudspeaker, its very simple, it is just a radio that can only do exernal audio

#

and then make another radio that can only communicate to it

#

its not built into ACRE right now, but it could easily be added

tiny flower
#

I can't get it to work. How can I teleport to the marker kavala after pressing the "tp" button when I have selected Kavala, for example? I have already tried to check lbText and with lbcursel, but that didn't work either.

createdialog "tpselecter";
waitUntil {!isNull (findDisplay 9001)};
_display = findDisplay 9001;
_listbox = _display displayCtrl 1500;
_listbox lbAdd "Kavala";_listbox lbAdd "Sofia";_listbox lbAdd "Pyrgos";_listbox lbAdd "Airfield";_listbox lbAdd "AAC Airfield";_listbox lbAdd "Molos Airfield";_listbox lbAdd "Almyra";

winter rose
#

setPosATL getMarkerPos listbox value

meager granite
winter rose
meager granite
quiet gazelle
#

I could also be mistaken about where the lag comes from, but at the moment it seems like spawning in a bunch of different objects (unscheduled) causes some lag

#

That's more of a gut feeling than anything proven tho

sullen sigil
#

Ignore this message I'm hoisting this as I need to find it later (profile corrupted and I lost all my ADT scripts without backing them up notlikemeowcry)

#

serves me right i suppose

quiet gazelle
#

What does ADT stand for?

sullen sigil
#

advanced developer tools

warm hedge
quiet gazelle
#

i'll try that if it gets bad enough that i need it

#

thanks

modern meteor
#

How can I pause a script until a helicopter has landed on the ground?

little raptor
#

or was it a game bug?

sullen sigil
chrome hinge
hallow mortar
sullen sigil
#

I presume you save everything to profilenamespace so nothing you can do about it 🤷

little raptor
sullen sigil
#

Wonder if it's due to the profile becoming too large though 🤔

little raptor
#

could be blobdoggoshruggoogly

sullen sigil
#

It's not a big deal, need to redo the function for integrating with this anyway as multiple moving areas need to be checked notlikemeowcry

hallow mortar
little raptor
little raptor
hallow mortar
#

It's actually heartwarming to know that there's a way for me to be wrong literally no matter what

little raptor
#

well you weren't wrong. just in some cases...meowsweats

#

if the heli was landing on the ground you would be correct 😅

modern meteor
quiet gazelle
hallow mortar
#

Notes:

  • small sleep for performance
  • not checking exact zero because helicopters can be imprecise
modern meteor
#

Oh I see. The 0 might have been the issue before. Testing...

#

One more question regarding disabling the AI of a helicopter. Do I have to use disableAI "all" on the object helicopter or the crew of the helicopter?

hallow mortar
#

disableAI only works on units. Not groups, not vehicles, just units.

sullen sigil
#

is anyone aware of any way of making an attached object be targeted by radar? or does it follow the same properties as the object it's attached to? notlikemeowcry

tough abyss
#

so i take it this just doesnt work at all if it doesnt work on dedicated servers or does it work on local host?

little raptor
tough abyss
little raptor
sullen sigil
#

think it's probably inheriting cba target vehicles lack of ability to be radar targeted

quiet gazelle
little raptor
#

well unbinarized models are slow to load

#

and I don't know what you need all those models for

tough abyss
#

i think he wants to stress test the game with modules

spiral sundial
#

Is there a way to use the slat armor of the Rhino MGS on other vehicles? Maybe to somehow remove the turret and hull (make them invis) and keep only the add-on slat armor

quiet gazelle
#

i need them to make a collider for vehicles with animated triangles.
vehicle collision doesn't follow single vertex animation

#

at the moment i'm testing if i can make do with 890 models, but i'm unsure if that'll be too inaccurate at larger scales

#

binarizing apparently is faster than copying the files to the temp folder

hallow mortar
sullen sigil
#

i can target but cannot seem to missile lock thonk

#

though wondering if thats a config problem

#

yeah just doesn't lock on even when its on the ground 🤷

#

seems its a me issue

modern meteor
#

I am having the issue that a helicopter which has landed for extraction takes off and lands again as soon as I gave the AI to board the helicopter (engine on). I thought disabling the helicopter's crew AI would solve the problem but it does not. Did anyone else experience the same issue before and knows a solution?

winter rose
still forum
modern meteor
chrome hinge
#

Any other ideas on how to detect usage of toolkit? Im trying to make toolkits consumed when used so vehicles cannot be repaired infinitely

meager granite
chrome hinge
#

got to try that out

#

a bit odd that it doesnt have eventhandler when stuff like "scuba breathing sound" has one😂

meager granite
#

Means BI didn't need it for their campaigns

hallow mortar
#

You can always try putting in a ticket if there really isn't a way of detecting it

chrome hinge
#

I also consider making a whole new repair trough addaction

meager granite
chrome hinge
#

Yeah, also allows making the repair last longer. Vanilla repair is op af

quiet gazelle
#

help

warm hedge
#

Post the code itself too

quiet gazelle
#

i can sqfbin the entire function

warm hedge
#

You should to

quiet gazelle
warm hedge
#

surfaceTexture _posAVG there returns what?

quiet gazelle
#

oh

#

i forgot that i got rid of posavg

#

thanks for the help

warm hedge
#

Not sure that is the solution

hallow mortar
#

...isn't SQFbin supposed to have, you know, SQF syntax highlighting?

quiet gazelle
#

it had it when i pasted it

quiet gazelle
#

still i'm confused about "Error Type String, expected String"

hallow mortar
swift mountain
#

lol

#

you can, and its implemented if you drop the radio

#

you know Nou its an ACRE Dev? XD

sullen sigil
little raptor
#

I think it gets broken when you add #

grizzled cliff
#

Whats a radio?

#

:P i mean you could do it with the 148/152 now, though the speaker is kinda weak (actually it should be weaker, you can hear it from like 10 meters away clearly)

prisma glen
#

the distinction between speaker and headset is quite noticable, considering the sound needs to come through your ears either way

sudden yacht
#

Help. See my previous post.

little raptor
chrome hinge
#

What the "arguments" part of addaction is used for? i tried reading it but cant understand.

little raptor
#

params ["_target", "_caller", "_id", "_args"]

chrome hinge
#

Does it make those variables usable in action script?

little raptor
#

what variables?

#

it'll be passed in the _args (_this#3)

chrome hinge
#

What can be done with it? I still donttget it

little raptor
#

you pass a variable from outside the action script (where addAction is running) to inside the action script

little raptor
chrome hinge
#

Oh so regular variables dont work in it unless moved with that?

little raptor
#

local variables won't be seen no

#
_somevar = 0;
_obj addAction ["bla", {
  params ["_obj", "_caller", "_id", "_someVar"];
  hint str _someVar ;// no error
}, _someVar]
chrome hinge
#

Okay so it is used to put local variables inside action scripts?

little raptor
#

that's one way to think of it yes

chrome hinge
#

alrighty, thanks for your help!

drowsy geyser
#

hey, im trying to add a progress bar to a generator object and it works fine,
but the progressSetPosition is not broadcasted to other players globally, how can i achive that?
https://sqfbin.com/ozaxikemipovimoguley

dreamy kestrel
drowsy geyser
#

okay, but is there a way to broadcast progressSetPosition of that progressbar to others?

#

i tried something like this too but no success:
progressPos = progressPosition (uiNamespace getVariable "progressBar"); publicVariable "progressPos";

little raptor
#

not just broadcast that variable

#

and even if you did broadcast that variable it would be pointless

#

you just read it back from the progressBar again

drowsy geyser
little raptor
#

I didn't say broadcast the whole code

drowsy geyser
#

i understand, i mean every player can "repair" the generator but the progressPosition is not updated for everyone

little raptor
#
my_fnc_updateProgress = {
    params ["_progressPos"];
    (uiNamespace getVariable "progressBarBkGd") ctrlShow true;    
    (uiNamespace getVariable "progressBar") ctrlShow true;
    (uiNamespace getVariable "progressBar_text") ctrlShow true;
        
    
    if (_progressPos <= 1) then
    {
        (uiNamespace getVariable "progressBar") progressSetPosition _progressPos;
        (uiNamespace getVariable "progressBar_text") ctrlSetStructuredText parseText format["%1%2", round(100*_progressPos), "%"];
    };
    if (_progressPos >= 1) then
    {    
        ctrlDelete (uiNamespace getVariable "progressBarBkGd");      
        ctrlDelete (uiNamespace getVariable "progressBar");      
        ctrlDelete (uiNamespace getVariable "progressBar_text"); 

        uiNamespace setVariable ["progressBar", nil];    
        uiNamespace setVariable ["progressBarBkGd", nil];   
        uiNamespace setVariable ["progressBar_text", nil];

        (findDisplay 46) displayRemoveEventHandler ["KeyDown", progressBarKeyDown];  
        (findDisplay 46) displayRemoveEventHandler ["KeyUp", progressBarKeyUp];
    };
};
drowsy geyser
#

ah okay so you mean only a function only for the progressPosition?
[_progressPos] remoteExec ["PARADOX_fnc_progressPosition", 0, true];

little raptor
#

a function for all the UI stuff

drowsy geyser
#

okay thank you very much !

round scroll
#

hi, for the Unsung CAS module I use cursorObject to get whom the player is looking at. This does not seem to work very well for enemy units from a distance. Is there any other function that tells me if there are enemies at the center of the view of the player?

little raptor
#

(it's much slower than cursorObject tho)

still forum
wind hedge
#

This sqf squadUI_VAR_FncDone = false; _squadUI_Functions = [] execVM "scripts\UI\squadUI\squadFnc.sqf"; waitUntil {(scriptDone _squadUI_Functions || squadUI_VAR_FncDone)}; used to work for me but now it gives me an error that the squadUI_VAR_FncDone part makes the WaitUntil return nil

#

Any way to regain that functionality?

little raptor
wind hedge
#

At the end of "scripts\UI\squadUI\squadFnc.sqf" sqf squadUI_VAR_FncDone = true;

little raptor
#

then there's no need for waitUntil at all

#

just do:

#
call compile preprocessFileLineNumbers "scripts\UI\squadUI\squadFnc.sqf"
little raptor
wind hedge
little raptor
#

no

#

it will do exactly what you want except it's faster

#

(no useless waitUntil eating poor scheduler's time)

little raptor
#

and another thing: _handle = [] spawn...; waitUntil {scriptDone _handle} is always wrong

quiet gazelle
still forum
#

If you pass nil to a command, the command never executes, and just returns a new nil.
And if a command only returns a specific type, the nil will be that subtype

sullen sigil
#

how are you supposed to turn a config path string into a config path? thonk

#

currently using _configPathTo = [_hi, "", true] call BIS_fnc_configPath; but it returns everything double quoted within a string ;-;

sullen sigil
#

_configPath = [_configPath, [], true] call BIS_fnc_configPath; also returns a string around configFile notlikemeowcry

wind hedge
little raptor
wind hedge
#
call compile preprocessFileLineNumbers "scripts\UI\squadUI\squadFnc.sqf";
0 = [] spawn VAL_fn_squadUIloadStats;
0 = [] spawn VAL_fn_squadUiID;
#

"undefined variable in expresion VAL_fn_squadUIloadStats"

little raptor
#

that does work tho

#

are you sure you don't have it backwards?

#

if you do execVM those vars won't be defined when you do the spawn

#

if you do call they will

wind hedge
#
[] execVM "scripts\UI\squadUI\squadFnc.sqf";
sleep 2;
0 = [] spawn VAL_fn_squadUIloadStats;
0 = [] spawn VAL_fn_squadUiID;``` <----- This works for example...
little raptor
#

unless you have another spawn or execVM in it

wind hedge
little raptor
indigo snow
#

Yes XEH is a good fit for that

little raptor
sullen sigil
wind hedge
# little raptor this should work

Ok, managed to make it work by adding a single 2 secs sleep after the call compile and before the 0 = [] spawn xxx. Hate to use sleep inside init and that is why the waituntil was working before but suddenly it was not anymore

little raptor
#

You're doing something wrong

tough abyss
#

could use CAManBase, so the game doesn't have to compile every time a rabbit spawns

#

Instead of Man

#

Wait

#

It won't. But your classes are wrong

#

class Extended_Init_EventHandlers {
    class BWA3_Tiger_Base {
        class randomizeSerialNumber {
            init = "_this call BWA3_fnc_randomizeSerialNumber; _this call compile loadFile '\bwa3_tiger\data\bwa3_tiger_decals.paa';";
        };
    };
};
#

It is missing a class

#

It won't

#

Well you can name it whatever you want

wind hedge
#

Thanks!

tough abyss
#

It has to be your Tag basically. Otherwise all addons would overwrite each other

#

Yep

#

I'd not compile it every time a soldier is spawned though

#

_this call Whale_fnc_vFix

lone glade
#

compile it when the player joins (initPLayerLocal) or put it in CfgFunctions

ivory locust
#

Is there a way to force units to flee

#

Without just setting waypoints manually

tough abyss
#

Whale_fnc_vFix = compile preprocessFileLineNumber etc. on pre init

#

Yeah. Or CfgFunctions

#

Haha

winter rose
#

yes, see allowFleeing

ivory locust
#

Saw somebody say that didn't work, I'll give it a shot

tough abyss
#

The advantage is that the function is read from memory and not from hard drive every time

#

You also don't have to compile it for each soldier placed in that mission.

ivory locust
#

Doesn't have the "instant flee" behavior I'm looking for, I think I'll just use doMove

tough abyss
#

Is ths for a mission?

winter rose
#

move*

tough abyss
#

class CfgFunctions {
    class BWA3 {
        class BWA3 {
            class start {
                file = "bwa3_common\start.sqf";
            };
        };
    };
};
#

Would be BWA3_fnc_start

#

Goes into description.ext

#

One of the class BWA3 is the category in the functions viewer, the other one is the tag (BWA3_fnc_...)

#

I never can remember which is which, so I always use the same for both, haha

#

CfgFunctions is native and works without CBA

#

XEH requires CBA

#

But you can't assign init eventhandlers in vanilla

lone glade
#

I prefer to write everything on one line for the last class ```
class CfgFunctions {
class YOURTAG {
class derp {file = "pathToYourFile";};
};
};

tough abyss
#

No, BWA3 is the Bundeswehr mod

#

Which I'm a dev of, so I copy stuff from there.

#

CfgFunctions does compile ahead of time

#

Thats the point of it

lone glade
#

wrong path for your file

#

it should be something like "functions\vfix.sqf"

#

if your file is in functions \

stable dune
warm hedge
#

What do you mean by path?

indigo snow
#

Did you name your file according to the conventions?

#

fn_function.sqf

lone glade
#

no need to if you use file =

warm hedge
#

It is apparently customizable through ingame options

indigo snow
#

i see

stable dune
warm hedge
#

Just like you change your keybind, you can access to the customized keybind there

lone glade
#

why do you compile your function twice ?

#

remove the init code, add the extension in the cfgFunction and change the call in init = to _this call VF_fnc_vfix

stable dune
lone glade
#

yes

#

oh and also, for the love of god don't use BIS_fnc_MP

#

use remoteExec

#

["Hello World","hint",true,true] call BIS_fnc_MP; becomes "Hello World" remoteExec ["hint",0,true];

orchid yew
#

Hi All,

I'm New scripting i'm well out of my depth but i'm learning slowly.

i'm sure this has been asked before sorry if it has.

I'm having some issues with my script.

I want to set up multiple markers that when a player that is alive is within a radius is near this marker it spawns units from a list of possible units. I want all the values the units the spawn radius and etc to be customisabled.

I'd love to know how to get them to spawn in buildings as well as on different floors.

These spawn points would be through the map in towns and other locations.

At the moment i only have it set to 1 marker and 1 unit type but the units don't spawn and i'm a bit lost as to what i should do i can't seem to figure it out.

I'd rather create something my self than use already existing scripts (i'm being difficult i know sorry)

My script is below I'm not sure if ive pasted it in correctly let me know.

line 24 keeps throwing a error of missing ;

Thanks all.

_opforMarker = "Opfor_1";
_spawnRadius = 100;
_opforUnits = ["O_Soldier_F"];


_markerPos = getMarkerPos _opforMarker;


_newGroup = createGroup east;


_triggerPos = _markerPos;
_triggerRadius = 50;


_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 0, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];


{
    _unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
    _unitType = selectRandom _opforUnits;
    _unit = createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
    _unit setGroupId [_newGroup];
};

#

please just reply to this so i get taged if anyone has and answers

lone glade
#

you tried calling the function yourself via the debug console if it worked ?

#

hints are local, always

#

I don't remember the arguments used in BIS_fnc_MP so give me a sec

#

yeah that hint should be global

warm hedge
#
  1. I would like to suggest not to make the post too long, aka remove empty lines.
  2. So the question, (as far as I check the script) it does seem to have mostly no errors, except createUnit lacks the group parameter.
  3. In order to let them spawn into a house if there is... is rather complicated to make it happen. I can write a mockup.
  4. Also, please follow this so you have the proper highlight:
#

!sqf

#

...Hey! @wicked roost

#

!sqf

#

smh I recalled wrongly

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#

☝️ @orchid yew

orchid yew
#

thanks for that ill give it a test in a bit

warm hedge
#
private _opforMarker = "Opfor_1";    // use private to make those local variables never alive outside of the script whatsoever
private _spawnRadius = 100;
private _opforUnits = ["O_Soldier_F"];

private _markerPos = getMarkerPos _opforMarker;

private _newGroup = createGroup east;

private _triggerPos = _markerPos;    // not necessary it seems?
private _triggerRadius = 50;

private _opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 0, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];

{    // oh? what's this?
    private _unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
    private _unitType = selectRandom _opforUnits;
    private _unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
};```My quick edit. Not sure what the last part should be (not tested)
little raptor
#

that part won't even execute...

warm hedge
#

So I'll just let it leave

little raptor
#

it's wrapped in a code that never gets called meowsweats

warm hedge
#

But besides that overall idea is not that bad it seems

little raptor
warm hedge
#

Yeah notlikemeow

little raptor
#

that {} block should be a trigger statement I think?

warm hedge
#

@orchid yew How it should be?

tough abyss
#

Sounds like you lost control

#

is it defined?

#

Is VF_fnc_vfix defined? Copy paste it in the show part of the debug console to find out

orchid yew
#

players walk to within radius of the marker trigger activates and spawns the units

#

the current iteration is the below.

_opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around
_spawnRadius = 100; // Radius around the marker where units can spawn
_opforUnits = ["O_Soldier_F"]; // Types of units that can spawn

// Get the position of the marker
_markerPos = getMarkerPos _opforMarker;

// Create a new group for the spawned units
_newGroup = createGroup east;

// Define the trigger area
_triggerPos = _markerPos;
_triggerRadius = 50;

// Create the trigger
_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 10, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
_opforTrigger setTriggerStatements ["True", "hint 'trigger on'", "hint 'trigger off'"];

// Spawn units around the marker
    _unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
    _unitType = selectRandom _opforUnits;
    _unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
tough abyss
#

If the function is stored in the variable

#

Just copy
VF_fnc_vfix
in one of the four lines of the debug console

orchid yew
#

@warm hedge @little raptor sorry for ping

tough abyss
#

If you see your function, the function is successfully compiled

little raptor
# orchid yew the current iteration is the below. ``` _opforMarker = "Opfor_1"; // Name of th...
_opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around

// Get the position of the marker
_markerPos = getMarkerPos _opforMarker;

// Define the trigger area
_triggerPos = _markerPos;
_triggerRadius = 50;

// Create the trigger
_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 10, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
_opforTrigger setTriggerStatements ["True", 
toString {
    hint 'trigger on';
    // Spawn units around the marker
    _opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around
    _spawnRadius = 100; // Radius around the marker where units can spawn
    _opforUnits = ["O_Soldier_F"]; // Types of units that can spawn

    // Get the position of the marker
    _markerPos = getMarkerPos _opforMarker;

    // Create a new group for the spawned units
    _newGroup = createGroup east;

    // Define the trigger area
    _triggerPos = _markerPos;
    _triggerRadius = 50;
    _unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
    _unitType = selectRandom _opforUnits;
    _unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
}, "hint 'trigger off'"];
warm hedge
#

From @round scroll

hi, I found attachTo is quite stuttering with a boat attached to a davit on a house. I've used setPosASL within a perFrame mission eventhandler and it looks much better. Question is, how costly is it really? I guess there's usually only one carrier on map, and only one rescue boat in question. Video is at https://www.youtube.com/watch?v=xVxLLzU0N0g and code at https://sqfbin.com/icaketavohiqodovigay

What's better, the old attachTo method that is stuttering or the per frame event handler that's probably more expensive?

SQF code available here for the event handler test:
https://sqfbin.com/icaketavohiqodovigay

▶ Play video
little raptor
#

@round scroll not much, but it's better to use setVelocityTransformation to prevent lag in multiplayer

#

also to prevent stuttering with attachTo, always attach the object to one with high simulation rate

warm hedge
#

Like logic

round scroll
#

ah, I guess I can just use the mempoint of the animation as toPosASL and apply that every frame, and interval being 1?

#

this work, thanks for the help! sqf _boat setVelocityTransformation [ getPosASL _boat, _pos, [0, 0, 0], [0, 0, 0], vectorDir _boat, vectorDir _boat, [0, 0, 1], [0, 0, 1], 1 ];

warm hedge
#

Hmm there was such usecase for this?

round scroll
warm hedge
#

I mean, I haven't figured how I would use setVelocityTransformation for a reason that only the command can solve

round scroll
#

I used it on an AI mission for Nimitz, for taxiing the plane in a sane manner and not looking to jerky

#

isn't it the base for some recorded path of a vehicle as well?

little raptor
#

it's the velocity that prevents the lag

round scroll
#

so little I know ... is the velocity vector best derived from getPosASL _boat and _pos, e.g. the vector between the two?

little raptor
#

well you want the boat to move at a certain speed no?

#

if speed is constant velocity would be vectorDir _boat vectorMultiply _speed

round scroll
#

yes, I need to check the animation of the Davit then, how much meters/second it travels I guess

wheat mica
#

Hello. Can someone give me a hint on why is this not working for me in SP/MP (tried first in InitPlayerLocal.sqf, not in init.sqf in all combinations):

#

inGameUISetEventHandler ["Action", "hint 'Lights, Camera, Action!'; true"];

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
wheat mica
#
inGameUISetEventHandler ["Action", "hint 'Lights, Camera, Action!'; true"];
#

Want to play around with intercepting 0-8 radio calls...just a copy from Biki example. Tried with HintC, SystemChat. If I just put as expression return simply "true", no action is blocked - and I understand it should be.

warm hedge
#

What exactly you expected? When do you think the hint is issued?

tough abyss
#

Again the question. Is this for a mission or an addon?

#

okay. One thing

#

Don't remoteExec the hint

wheat mica
#

That is the event handler that is activated when you activate mouse wheel action. What I understand from Wiki and forums is that it should be activated also when you for example have support and go to call for it through 0-8.

warm hedge
#

First part, true, last part, false

wheat mica
#

?

tough abyss
#

This code will be executed on every machine

wheat mica
#

So.. just for AddAction?

warm hedge
#

That is the event handler that is activated when you activate mouse wheel action.
Correct
What I understand from Wiki and forums is that it should be activated also when you for example have support and go to call for it through 0-8.
Incorrect

#

So yes

#

Not sure how you're going to add 0-8 menu though

tough abyss
#

You would send hints from every machine to each other machines

wheat mica
#

Ok man, many thanks. saved me a lot of time experimenting. I am almost sure that this handler workes some months ago when I added also custom submenu through description. ext. So I assumed it would intercept built-in 0-8. Will try later again with custom. Thanks. My goal is to have resource-based (player money) arty/CAS request quick and dirty... so.. no money - > support requester rejected.

lone glade
#

For every unit present, you can use a diag_log for that

#

(debugging I mean)

tough abyss
#

meaning you will have 5 hints on one machines if 4 machines are conected to the server

#

Just use hint

#

Well if you would use it.

#

Then don't remoteExec it here.

#

It isn't?

orchid yew
tough abyss
#

What units have you placed?

#

Well, you have to run CBA for XEH

#

And it still does nothing?

#

won't work either

#

cursorTarget getVariable "VCOM_NoPathingwhatever"

stable dune
tough abyss
#

what does this say?

#

If you look at one of these AIs

lone glade
#

(don't forget to put it in one of the watch fields)

tough abyss
#

unchanged as in?

#

Maybe VCOM uses it's own eventhandler that is executed later and overwrites it.

#

replace the remoteExec hint with a simple
diag_log text str _this;
And check the rpt

#

also load the mission again after changing the description.ext

#

Also check
isClass (missionConfigFile >> "Extended_Init_Eventhandlers")
with the debug console

meager granite
#

(scratched my yet another excessive idea)

pulsar bluff
#

a feature creeper

#

my last truly failed system was about a year ago ... wanted procedural helicopter landings (without AI)

#

theres only a few ways to make a heli fly without the AI

winter rose
#

crashing, and not

pulsar bluff
#

for multiplayer i settled on "addForce" + "addTorque"

#

so i had complex propulsion with addforce, but there was no way to "clearForce" so it became super hard for me to control the flight

#

in nvidia physx there is "clearforce" but not in arma

#

it looked nice and natural but the longer the flight the more unstable it got 😄

winter rose
#

I assume "just" applying opposite forces don't cut it?

pulsar bluff
#

yea

#

i think it would have been possible with a "clearforce" command, since there's also no getter

winter rose
#

ah, yes

sullen sigil
#

wonder if you could use addforce to simulate 0 gravity instead of halving velocity on each frame 🤔

pulsar bluff
#

Only one idea came from attempting that helicopter flight system w "addForce" ... discovered actually looks very nice to use "addForce" + "addTorque" to carry a crate, instead of attachTo or a setpos loop

#

you can effectively use addForce and addTorque to keep a small box in a certain position (like in front of the player), and it has nice elasticity, and also retains physx, so it will bump into a surface rather than warping into it

#

but i never developed it, just bookmarked and moved on to other things

#

so if anyone wants an interesting weekend project, work on controlling an ammo crate with addforce+addtorque, its probably got a future in a carry script somewhere

#

since it failed with procedural helicopter landings

#

and if the @still forum gods gave us a "clearForce" and "clearTorque" command it would be legendary, we could actually simulate flight

quiet gazelle
#

how much potential to launch vehicles into orbit would a physics based carrying script have?

sullen sigil
#

arma 3 space program

pulsar bluff
sullen sigil
#

the sound of all of your bones breaking in ace medical

tough abyss
#

What does
cba_xeh_fnc_init_once
say?

open hollow
#

Wait add force is permanent?

warm hedge
#

In what sense?

open hollow
#

You don’t need to apply it with oneachframe to keep it “floating” ?

warm hedge
#

Nope. In that sense addForce is a temporary

open hollow
#

Damn, I have some fun ideas with it lol

little raptor
tough abyss
#

hold shift and press end

lone glade
#

copyToClipboard (cba_xeh_fnc_init_once)

tough abyss
#

It's
copyToClipboard str cba_xeh_fnc_init_once

lone glade
#

oh yeah forgot the str

#

pastebin it

tough abyss
#

Nah. Was just testing if CBA is running

#

Okay. Test passed.

#

Well I have no idea why it doesn't work

lone glade
#

oh wait commy, I think I know why......

tough abyss
#

Say

lone glade
#

remember when I was trying to use XEH last time.....

tough abyss
#

holding breath

lone glade
#

mission syntax might be different than mod's one

tough abyss
#

Hmm. Wait.

#

class Extended_InitPost_Eventhandlers {
    // vehicles
    class BWA3_Puma_base {
        initMission = QUOTE(_this call DFUNC(initPuma));
    };
};
hasty gate
#

After I use:

west setFriend [west, 0];

All west ai units leave their vehicles if they see enemy, things like below doesnt help to prevent them from leaving vehicles:

allUnits apply {
    _x disableAI "all";

    _x setVariable["NER_unitAssignedVeh",vehicle _x];
    (group _x) addVehicle (vehicle _x);

    _x addEventHandler ["GetInMan", {
        params ["_unit", "_role", "_vehicle", "_turret"];
        _vehicle allowCrewInImmobile true;
        _vehicle setUnloadInCombat [false, false];
    }];

    _x addEventHandler ["GetOutMan", {
        params ["_unit", "_role", "_vehicle", "_turret"];
        private _assignedVeh = _unit getVariable["NER_unitAssignedVeh",objNull];
        if(_vehicle isEqualTo _assignedVeh && alive _assignedVeh) then {
            systemChat format["Moving %1 in veh %2",_unit, typeOf _vehicle];
            _unit moveInAny _assignedVeh;
        };

    }];

};
tough abyss
#

I have this in one mission and it definitely works

quiet gazelle
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
quiet gazelle
#

use that to format the code

tough abyss
#

It's a InitPost instead of init, but that doesn't change anything here

quiet gazelle
#

also i'd use a foreach loop instead of apply

lone glade
#

In that case it's XEH fucking up I would say

hasty gate
quiet gazelle
#

are members of the same squad still friendly with each other with west being hostile to west?

tough abyss
#

Solves all these issues. Then XEH can finally rip

hasty gate
tough abyss
#

looks fine

#

Now the description.ext

#

Nope. Use what I posted

#

That works for sure.

quiet gazelle
#

not killing each other

hasty gate
winter rose
#

they most likely cannot stay in the same vehicle as… an enemy's

hasty gate
hallow mortar
#

Since they are themselves west, it could be that they detect the vehicle as being west (and therefore enemy) and decide they can't be in it

quiet gazelle
hallow mortar
#

I'm really not surprised that setting a side enemy to itself has unexpected results

hasty gate
tough abyss
#

Try this. Note the edited eventhandler

#

Yes

granite sky
quiet gazelle
#

so i messed around with it a bit and it seems that hostile units can work together as a crew of one vehicle

granite sky
#

Ran into that issue with dive bombing, default physics was trying to raise the nose faster than I was pushing it over.

#

Makes sense. We use separate driver/gunner groups to force careless driving without hanging out of the turret.

#

I wonder if they use the vehicle side or their own side when making decisions...

quiet gazelle
#

@hasty gate if i force a hostile into the drivers seat of my tank, he will get out after half a second, however, if i (as the tanks commander) command him to drive the tank, he will not get out and drive the tank instead.

granite sky
#

Like driver might be trying to avoid redfor tanks, while gunner is trying to shoot blufor tanks :P

quiet gazelle
#

i suggest you experiment with that a bit

hasty gate
quiet gazelle
#

of course, i was thinking about something like seeing if you can force them into their vehicle and immediately give them an order via sqf to make them compliant with being in that vehicle

quiet gazelle
winter rose
#

@hasty gate I would say - "what is your original idea" first

because if you want only one group of BLUFOR to be attacking others, you can mimick that as OPFOR
what is your end goal?

hasty gate
# winter rose <@260177046796238859> I would say - "what is your original idea" first because ...

Original idea is that in Exile Mod, all players + AI are in the same side, and on top of that there is custom 'clan' system which something like scripted side in side. I want to able for AI units attack enemy 'clan' units while they are in the same side, with all the native AI behaviour work fine, like doTarget should also make an AI attack enemy target. So far workaround was to issue commands like _unit doTarget _enemyPlayer; _unit doFire _enemyPlayer; which works but I think they wont take cover etc.

quiet gazelle
hasty gate
quiet gazelle
#

and they're all supposed to be fighting each other at the same time?

hasty gate
#

yes

quiet gazelle
#

but two members of the same clan are not supposed to fight?

hasty gate
#

yes

winter rose
#

not exactly sure Arma can handle that

#

well, Reforger can

hasty gate
#

ye hard stuff, but everything would be ok if they just don't leave their vehicles, this is our last puzzle

quiet gazelle
#

the only other way i can think of to make it maybe work is trying to work with the 3-6 sides that you can use and whenever one group of ai spots another go and dynamically switch them around

#

also if units of the same squad still fight each other, how would you make units of the same clan not fight each other?

hasty gate
#

or it could be that we are just missing something with doTarget doFire method, for example, what is actual command/waypoint whatever used if an AI get into contact with hostile AI?

quiet gazelle
hasty gate
quiet gazelle
#

does the leaving vehicle thing still happen if you assign them all to sideEnemy?

tough abyss
#

did you remember to load the mission again after editing the description.ext?

#

upload the rpt to pastebin

hasty gate
quiet gazelle
#

what happens if you declare blufor hostile to blufor and give the vehicles a sideFriendly commander?

hasty gate
#

I guess if there is a gun in the commander role, he wont use it against WEST?

#

setting effectiveCommander might help tho?

quiet gazelle
#

i have no clue

tough abyss
#

"C:\Users\admin\AppData\Local\Arma 3"

lone glade
#

RPTs are always logged

#

unless you're using -noLogs

tough abyss
#

Don't -.-

#

I hate how this channels descripton is
IF (script == true) etc.

#

Error generic error in expression

lone glade
#

If (script == typename true) or (script)

tough abyss
#

oh please

dreamy kestrel
#

Q: maybe I am barking up the wrong tree here, but, are there any EH approaches (i.e. solutions) for object variable changing/changed event notifications? I see for instance addPublicVariableEventHandler sort of gets there, is deprecated 'today', but was also focused on missionNamespace, whereas I am looking for something focused on anything that can be the subject of setVariable.

I see remoteExec functions mentioned as the migration path, but am not clear what migration path that is; or is the focus there simply the remote invocation of whatever functions might be called in response to the thing that just happened (whatever that was, setVariable, for instance).

Thinking it through, the issue I think that is more the case is the client/server variable sync, because a variable was set public global (i.e. true) does not necessarily mean the sync has happened yet when the EH occurs. Could be missing something there, but I think that is the challenge.

Of course then there is the whole CBA EH approach, local, server, target, etc, but that's beyond the scope here, I think, for the core question.
https://community.bistudio.com/wiki/addPublicVariableEventHandler
https://community.bistudio.com/wiki/setVariable
https://community.bistudio.com/wiki/remoteExec
Thoughts? 🧠

open hollow
proven charm
#

it would show "hello world" in the debug console, i think

little raptor
#

nothing useful. -1

proven charm
tough abyss
#

if (call compile str if (true))

little raptor
#

uhm nvm I remembered wrong

#

Return Value:
String - data sent back from extension; If the extensiion was not found an empty String will be returned

lone glade
#

oh god

little raptor
runic heart
#

Anyone have any direction to point me on make an object holdable?

proven charm
#

the extension/dll cant trigger hint it can only return string

#

yep

little raptor
#

the extension already returns a string

tough abyss
#

Could be the case, whale

little raptor
#
hint ("mytestdll" callExtension "Hello World")
runic heart
#

Wow making

tough abyss
#

In that case you could try:

_this spawn {
    waitUntil {isNil {_this getVariable "whatever"}}
    _this setVariable ["whatever", false];
};
lone glade
#

What do you mean by making ? only weapons can be handheld

proven charm
#

just remember with hint that it wont show anything if the string is empty. good to keep in mind when testing

tough abyss
#

Yeah whatever. Also needs a ;

manic kettle
#

how do i convert UID to the player object?

granite sky
#

allPlayers select (allPlayers findIf { getPlayerUID _x == _uid })

runic heart
#

So I guess I need to know what I need to do to make an object a weapon then like a wrench or a bat

granite sky
#

Will break (select -1) if not found. Should be checked if it matters.

manic kettle
#

hmm was hoping there would be a command i couldnt find but yeah that works haha. Thanks 😄

granite sky
#

Maybe there is. Not like I know all the commands :P

manic kettle
#

john you know everything though

dreamy kestrel
tough abyss
#

You'd have to write a weapons config for them and probably make a .rtm animation

granite sky
#

Fun question. I don't think you can get a scheduler break in the middle of a findIf.

runic heart
#

Trying to help my model guy make this guitar a weapon I suppose

dreamy kestrel
little raptor
#

you can

little raptor
#

because it runs thru all players

little raptor
little raptor
manic kettle
#

hmm, ok thanks!

manic kettle
#

One other question... How can i tell my code to wait for a player to respawn? Or will JIP code wait to run when they select their spawn location?

granite sky
#

JIP runs really early, IIRC

#

Like before initPlayerLocal.

cyan loom
#

Hi guys, i am trying to use relative positions and model to world to replicate buildings, specifically the ghost hotel and the composite buildings it kind of works but it isnt precise or the code i have isnt quite right http://pastebin.com/GMkiahXM gets the relative positions of objects i want to place/replicate. http://pastebin.com/P3NQHKJN this places the objects using player to modeltoworld.

winter rose
#

BIS_fnc_getUnitByUID?

granite sky
#

(it's much slower)

#

checks allUnits + allDeadMen for some reason.

tough abyss
#

looks good.

dreamy kestrel
#

but it does not truly iterate all, exitWith at the first match. O(n) either way, I think.

#

not like there is a hashmap of UID, that would be something...

winter rose
granite sky
#

What's the mechanic there? units owned by dead-waiting-for-respawn players still have a playerUID but aren't in allPlayers?

#

playableUnits specifies that it doesn't include dead players waiting for respawn, but allPlayers doesn't.

tough abyss
#

Uhm, Brun. What exactly is the issue?

winter rose
cyan loom
#

i can replicate the objects but they do not line up exactly

tough abyss
#

ah. ok.

cyan loom
#

for the composite buildings is important

granite sky
#

On a quick check, doesn't seem to be true? lifeState DEAD_RESPAWN units are still in allPlayers.

manic kettle
#

hmm, then would a waitUntil !(lifeState DEAD_RESPAWN) work for detecting unit spawn?

winter rose
manic kettle
#

ooooh yes EH right

#

MPRespawn should do it?

winter rose
#

perhaps 🐮

tough abyss
#

you are using the old syntax of createVehicle

winter rose
tough abyss
#

You have to use createVehicle ARRAY to define the exact position

dreamy kestrel
#

could I mention for headless clients also?

lone glade
#

Your code needs an update overall

tough abyss
#

Or you adjust the position with setPosASL and setVectorDirAndUp after createVehicle

cyan loom
#

the first part isnt my code second part is, ill adjust the createvehicle and see how i go

tough abyss
#

Yeah. Dunno what the variable is supposed to be.

#

Nope

#

So the XEH stuff is working now, but VCOM doesn't do what you expect?

#

post the rpt

#

I know if CBA works then

#

(unless you removed the diag_log)

hasty gate
tough abyss
#

Thats fucked up.

#

CBA + BWA3 1.3 is 54 kB

#

Well if it's full of script errors then you can't expect any code to work

winter rose
#

what the page says

tough abyss
#

Are you sure it's not you entering stuff in the debug console? They log that every frame too

#

Nah. getVariable syntax is either string or array

hasty gate
tough abyss
#

single quotes do the same as normal ones

hallow mortar
#

FSM/engine stuff, presumably

#

AI don't give themselves new waypoints

tough abyss
#

oh fuck

#

I know what you did

#

hahaha

#

here is the thing

#

in your fix script

#

the _this variable

#

is
[_unit]

#

yup

#

Do this:
params ["_unit"];

#

And use _unit instead of _this

crystal jetty
#

lol, always the simplest thing :0

tough abyss
#

Haha. And thats why you don't disable the log

#

params ["_unit"];

#

join the revolution

hasty gate
#

I'm trying to create a waypoint of type DESTROY, when I do that via editor it works as expected, units move to kill target unit attached to waypoint. When I do that via SQF script it they don't, they just stand there doing nothing, does anybody know whats the issue?

(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [player, 0];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint _wp;

Player is EAST side, group u1 are just 4 units of side WEST (default Fire Team NATO->Infantry in editor)

runic heart
#

Hey commy that link you gave me on weapon cfgs doesn't go anywhere

tough abyss
#

params ["_unit"];
in the first line of the script

#

and in the first line inside the spawn

#

then replace all _this with _unit

#

inside that script that is

#

How so? Andino

winter rose
#

just add+setType should do

tough abyss
#

yes - whatever pupil is in nippon

#

padawan

winter rose
#

note that the waypoint won't follow the target as such, you need to waypoint attach it

tough abyss
#

Don't listen. You did good.

hasty gate
hallow mortar
tough abyss
#

lol

#

This is something personal now

hasty gate
# winter rose just add+setType should do

anyway, its weird, they do nothing if I do that by scripting, current code:

(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [player, 0];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint _wp;
_wp waypointAttachVehicle player;
#

nevermind, I see editor actually creates 2 waypoints, probably thats the reason, 1 is waypoint MOVE, and second is DESTROY

tough abyss
#

lol

hasty gate
#
(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [getpos u1, -1];
_wp setWaypointType "MOVE";
_wp = (group u1) addWaypoint [player, -1];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint [group u1, 0];
_wp waypointAttachVehicle player;

doesnt work 🤦🏻‍♂️ , I have added exactly the same waypoints which are present when I do that via editor

tough abyss
#

Haha

#

Yep.

#

That's how I always enter buildings. By glitching through the door

lone glade
#

I just got used to climb through windows :D

tough abyss
#

I was once pushed through a 50 cm thick wall thanks to collision + rotation axis

lone glade
#

same here

#

I took large crushing wounds everywhere

#

A2 buildings are scary

tough abyss
#

It was with basic medical, so only my torso was wounded

#

But it was one of these maps with huge compounds

#

I had to walk 2 mins through enemy territotry alone

winter rose
#
group u1 addWaypoint [player]; // already is a "MOVE"
private _wp = group u1 addWaypoint [player];
_wp setWaypointType "DESTROY";
_wp waypointAttachVehicle player;
#

you'll try without mods, too

tough abyss
#

And everyone laughed at me.

lone glade
#

my bounding box was kind of fused with the building, when someone tried to drag me I got teleported :D

tough abyss
#

lol

#

Mine too.

#

Even better is making whole vehicles.

lone glade
#

Mine too, but I always forget to either enable file patching or remove my debug messages

frozen seal
#

Is there a way to complete a task without assigning it to the player first? At one point I'm creating a task:

[true, taskStealth, ["(Optional) Get to the APCs without getting spotted.", "(Optional) Stay undetected", "marker_apc_workshop"], objNull, "CREATED", 2, false] call BIS_fnc_taskCreate;

then at some point I want this task to be completed along with a different task once the player reaches a trigger:

    [taskReachApc,"SUCCEEDED"] call BIS_fnc_taskSetState;
    [taskStealth,"SUCCEEDED"] call BIS_fnc_taskSetState;

my expected result is that I would see, in order:

  • A notification that task taskReachApc is completed
  • A notification that task taskStealth is completed

but what actually happens is:

  • A notification that task taskStealth is completed
  • A notification that task taskReachApc is completed
    - A notification that task taskStealth is assigned to the player

the last one is extremely weird, considering that when I open the tasks menu they are all marked as completed and none are assigned 🤔
How do I get rid of the last notification?

lone glade
#

:D

winter rose
#

you might have task auto-assign on?

#

as in "on complete task, select the next one"

frozen seal
#

Could be, is there a way to disable this for a mission? I'd like to have full control over tasks via scripts

tough abyss
#

So. Now that we have a Spanish Tiger (FFAA), and a German Tiger (BWA3 soonTM), when do we get a French one, alganthe?

lone glade
#

I'm not into model making

winter rose
#

hmm, can't find it right now
I think it was disableable at least in A2, but there was a task rework since so I don't know

I would recommend to close the not current one first then the current one

granite sky
#

Read it, can't tell what you're trying to do or why.

#

addPublicVariableEventHandler still works but I think it used to be used as a hacky way to do remote execution, and that's obsoleted by remoteExec.