#arma3_scripting

1 messages Β· Page 479 of 1

lament grotto
#

switchMove?

fossil yew
#

it's a command that doesn't work with all anims

#

It's a command, not function. Basically, some work with playMove, some with switchMove and it would be nice if there is one that works for all. BIS_fnc_ambientAnim is useful in SP, but it is not MP compatible.

#

IMHO animation commands are unnecessary partitioned in 3. Most of the stuff people like to animate can be listed in 10-20 animation sequences...

still forum
#

@fringe yoke Yes if you have the optional cache disable pbo. Then [] call ACE_PREP_RECOMPILE should do it.

fringe yoke
#

Awesome thanks

waxen tide
#

@still forum please write an elaborate blog article about the fine art of sqf debugging with fancy secret tools you're hiding from me. kthxbai.

still forum
#

didn't someone else already ask me the same thing recently? πŸ˜„

waxen tide
#

Probably. See the interest is vast.

still forum
#

Ah no. That was about profiling

#

the fancy tools aren't publicly available yet. So not really useful trying to show something off that no one can use

waxen tide
#

See, 2nd genius idea for a blog article RIGHT THERE. You should become a famous sqf blogger. Just set up a patreon account and live off that.

#

You can make those tools available to your patreons. Ez.

#

I'm a problem solving MACHINE today.

still forum
#

Making explicitly non-commercially licensed tools available only when people pay me on patreon wouldn't work out.

waxen tide
#

😩

vernal mural
#

@digital jacinth hey ! Just downloaded your ragdolling work for ACE in order to give it a try. However the mod version in the ZIP file is not builded. It's not a matter of concern for me as I'm used to building mods, but is that an intended behaviour ?

still forum
#

if you downloaded the sources from github then they are indeed just that. The sources as a zip file

#

I guess the script version is intended to be put directly into missions instead of being run as an addon

#

the mod version is.. the mod.

vernal mural
still forum
#

Ah. I guess armaholic just scraped the github thing then and didn't know what they were really doing πŸ˜„

vernal mural
#

Maybe I should report this. It means that unexperienced users cannot use the hosted material, if they don't know how to set up the script or build theaddon

still forum
#

Also.. @digital jacinth Beginning with version 1.1 server only mode is available for the mod is avaiable wut? πŸ˜„

#

Yeah diwako knows now. I guess he can just tell armaholic.

#

But people are supposed to load the mod from steam workshop anyway

#

According to his BI forum thread steam workshop is the only official download source for the mod version

#

Armaholic isn't even listed there

peak plover
#

Public var the functions and re the eventhandlers

#

That's probably server only mode

still forum
fringe yoke
#

oh that's dedmen, really confused who this was all of a sudden and where they got their fancy tools from

still forum
#

You need to imprint my sexy fur fox avatar into your brain so that you can always recognize me

fringe yoke
#

I use the minified mode, I would have recognized that avatar

still forum
#

Oh ._.

#

🍌

meager heart
#

lol

digital jacinth
#

Oh hey. Yeah the mod is only available through the workshop. I am not used to github releases so far.

#

Also yeah my English gets weird when I post late at night blobneutral

#

Server only mode is weird some people requested it, dunno why

#

Server only mode is weird some people requested it, dunno why

#

Also by downloading the current head of the repo then it is currently the unreleased version 1.2.1

still forum
#

When you create a new release you can drag&drop files into it to add them. Add the mod pbo there

digital jacinth
#

Hmm, maybe for the next release. Right now I traveling and waiting for some pull requests reviews for the community I play in

scenic pollen
#

Yeah a release doesn't need to be tied to the latest commit. You can upload your own files (e.g. pbos) to the release, like Dedmen said

still forum
#

you can even upload many to the same release cough cough
You could for example make a beta-release and then upload 200 different builds to it coughs up blood

digital jacinth
#

Yeah I will probably just upload 2 zip files one for the mod version and one for the script version. It is good to know if they do not need to be tied to the tags I need to create.

late gull
#

guys

still forum
#

runs in circles panicking

late gull
#

differente between

clearItemCargo
and
clearItemCargoGlobal
#

it's locallity?

still forum
#

One applies it globally. The other doesn't

#

So yes. The wiki also tells you that btw

late gull
#

yeh, the icons :p

#

ty

#

lol, pretty new name

still forum
#

Always the same name just feels boring

late gull
#

but i'm not going to eat u

#

thx btw πŸ˜„

vernal mural
#

Does one's know how this is supposed to work ?

#

like, this is the single command mentionning such a "convoy" thing

#

no way to create a convoy, or declare a group as a convoy, or an array of vehicle

#

it does not look related to anything else...

still forum
#

a group of vehicles IS a convoy

vernal mural
#

automatically ? They are not behaving as one very often...

still forum
vernal mural
#

ah, thanks

meager heart
#

setConvoySeparation < tried that (probably in wrong way 🀷) and was no luck for me sad_face.paa

#

(on dedicated just no difference... with/without)

lucid junco
#

Civ5 move (civ5home buildingpos 1); waituntil {!alive player}; civ5 move [5,4,20]; this i have in sqf script, calling it from init.sqf. (tried exec even execvm) Getting generic error in expression. Pls Help? Waituntil doing It. Dont know why.

still forum
#

tried exec even execvm exec doesn't make sense as this is SQF not SQS

lucid junco
#

Tried also 5 sec sleep for sure

still forum
#

you are getting more than "Generic error in expression" please post the full error

scenic pollen
#

@lucid junco You can find the full error in your Arma log file (.rpt file)

#

Search the file for the error you're getting, then post that section of the file here

lucid junco
#

Will do, when Ill be Back home

scenic pollen
#

πŸ‘

tough abyss
#

[5,4,20] that position is probably on the edge of the map

meager heart
#

looks like 20 meters above the edge, probably good view there... πŸ˜ƒ

lucid junco
#

Just examples, im on phone And Dont remember position πŸ˜€

still forum
#

Ah so.. You probably have some typo in your code

#

and instead of showing it to us you just write up something that looks similar?

#

we won't find your problem with that

lucid junco
#

Lol

austere granite
#

Wait we can add reactions now?

queen cargo
#

there is no reason to get "upgraded" to veteran anymore 🀷

ruby breach
#

Other than blue being a better color than white

scenic pollen
#

I thought Veteran was just to indicate longtime members/contributors and not really about any extra powers

still forum
#

extra powers are image embeds and reactions

#

because you don't want people with these abilities that you don't trust ^^

scenic pollen
#

Fyi I can do reactions without being veteran

#

Like that

still forum
#

yeah recently added

hollow thistle
#

Don't get upgraded to me. I don't recommend. πŸ‘€

queen cargo
#

if it was about longtime members then other here would be marked as vets too

still forum
#

It's more "people that are attract positive attention regularly" rather than "longtime members"

ruby breach
#

Looks at Lou and his lack of blue

thorn pine
#

Immediately after initializing the unit, isPlayer returns false, but the next frame return true. In what other cases does it return false, pls help?

#

except check is player he

queen cargo
#

isPlayer returns false as long as a unit is not a player

thorn pine
#

Okay, I'm wondering when a unit is not a player. I know that after the initiation, one frame is not a player, even if the player connected. Are there any other nuances?

tough abyss
#

There are plenty of other quirks you just have to remember

#

And unit is created on the server then control is passed to client so this could explain delay

#

If you attach local EH to the unit you can watch the show in your logs

still forum
#

Optimization challenge. Replace every " character with a ' character
Like turn a
["val","val"] string into ['val','val']

Original function to make better

_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str _array;
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do {
    _sel = _array select _i;
    if (!(_i isEqualTo 0) && !(_i isEqualTo ((count _array)-1))) then {
        if (_sel isEqualTo 34) then {
            _array set[_i,96];
        };
    };
};

str(toString(_array));
queen cargo
#

why would anybody want to do that?

opaque topaz
#

Python?

queen cargo
#

oohh ... now ... not `

still forum
#

yes. Discord can't print. It's for database inserts

queen cargo
#

so it still ist for `?

#

why use the arma array format at all then?

still forum
#

input is array. It's supposed to be transferred to database. I don't know why they are doing it like that. Not the task right now ^^

queen cargo
#

🀷

#

gimme a minute

still forum
#

here is my idea

str toString ((toArray str _array) apply {[_x, 96] select (_x isEqualTo 34)})

Don't even know if that works.

queen cargo
#

should

#

you can test using sqf-vm

still forum
#

old; 3.3966ms
new: 1.1325ms

queen cargo
#

or you cant
right now ... because tostring seems to be broken in sqf-vm πŸ™ˆ

lean estuary
#

😦

opaque topaz
#

/rip

queen cargo
#

fixing it already 🀷

still forum
#

That's how good life framework is. a guy can just write a new script in like 20 seconds. and it'll be 3x faster and a one liner instead of the old 26 line script

queen cargo
#

hah

#

forget what i said πŸ™ˆ your code is not working πŸ˜„

still forum
#

I was missing parenthesis

queen cargo
#

and fucked up the select ... unless i fucked up the select πŸ€” wait a minute

halcyon crypt
#

wasn't there a command to increase moon brightness?

queen cargo
#

nope, was me who fucked up the select

#

"[``var1``, ``var2``]"
is the output ... which still does not looks correct .. ohh

#

i see why

#
_array = str ["var1", "var2"];
_str = str tostring ((toArray str _array) apply {[_x, 96] select (_x isEqualTo 34)});
diag_log _str```
#

correct for that code*

#

but you added some str in there

#

already

#
"[`var1`, `var2`]"```
#

if that is taken into account, it works perfectly

still forum
queen cargo
#

🀷
why you actually start wokring on that?

still forum
#

Because helping a life server getting rid of their constant like.. 2fps and desync

queen cargo
#

rewrite the whole thing

#

no other way

#

fuck sake ... maybe i rly should start creating my life framework

#

but i cannot even get myself to continue writing that XMedSys rewrite to completion i started in february ...

tough abyss
#

str array splitString '"' joinString "'" ?

queen cargo
#

hah

still forum
#

nice idea

queen cargo
#

that actually --could-- should be WAY faster

still forum
#

That is WAY faster

queen cargo
#

arma really lacks some "replaceString" method ...
something like:

"input" replaceString ["strToFind", "strToReplaceWith"]```
still forum
#

Original 3.4ms
Mine 1.2ms
yours 0.04ms

#

Genius man Thanks

queen cargo
#

anyone here bored and has c++ skills?

#

need somebody to do some fairly repetitive implementations ...

#

in sqf-vm

tough abyss
#

You have to be careful with those string commands if you have Unicode

ruby breach
#

Yeah, splitString/joinString can be screwy if the inputs aren't "normal" characters

still forum
#

Ah @tough abyss sadly doesn't work completly
Input ["","","",""] Original output """['','','','']"""
Your output """[',',',']"""
My output: """['','','','']"""

tough abyss
#

Lemmie check

#

Yep, broken for empty strings

#

I would solve this on database side

still forum
#

Going for the easiest solution right now

queen cargo
#

would not solve this at all on clientside ...

#

pass the str in callextension

#

youre done

#

thank me later

tough abyss
#

MySQL has the whole own language with bells and whistles, you are most likely be able to do parsing and conversion in it with added benefit of removing this load from sqf

still forum
#

that's all serverside code

winter rose
#

@queen cargo about the replace thing, isn't there a BIS_fnc something that does it?

queen cargo
#

maybe
but i mean a proper operator to do that

winter rose
tough abyss
#

@halcyon crypt no but you can pick up a night with full moon

halcyon crypt
#

yeah, I was mid mission and vaguely remembered something about a command being able to set moon intensity or something πŸ˜›

#

thanks though

winter rose
#

or use setAperture(New) ^^

tough abyss
#

Well, std::strtok has the same problem splitting string when same delimiter is immediately following the previous one, so it would make sense splitString fails in the same way.

queen cargo
#

Mhh.. Weird

halcyon crypt
#

[9:25 AM] Lou Montana: or use setAperture(New) ^^

#

yess

#

that's the one I think

tough abyss
#

setAperture would make every light source brighter, though you could make some really nice looking night scenes

#

Stars the size of a silver dollar!

halcyon crypt
#

it's more of a workaround for the gamma thing in the settings

#

it appears to be quite weird on the Linux client port

#

makes everything look like it's something from the 8-bit era

#

in terms of color πŸ˜›

#

IIRC it behaves differently on Windows

vernal mural
#

Anyone knows how to get wheel selections on a vehicle ? Like when using ACE and "dismounting" wheels (meaning full damaging and spawning a wheel object on the ground) ?

#

I can't get it through ACE's code...

#

(plus, I don't exactly know what to search for)

stuck mulch
still forum
#

I figured I would ask here as well; sorry for duplication Read #rules again

west grove
#

oi folks. questiontyme. anyone can tell me if the info panel function of the mine detector is hardcoded or in scripts?

#

i can't find shit about it

#

or sensors in general

inner swallow
#

@west grove hard coded in the sense that it's a config thing

#

Afaik

#

For sensors, Google "Arma 3 sensors config reference"

#

Or just "Arma 3 sensors wiki"

west grove
#

but what tells e.g. the mine detector to detect mines

#

or the sensors to detect missiles or vehicles

#

or where is it defined that having the mine detector in your inventory will make the mine detector info panel available

inner swallow
#

Class Config

vernal mural
#

Any idea of what is GETMVAR is some scripts ?

still forum
#

mission namespace variable

#

maybe with prefix

vernal mural
#

oh it's a macro... Sorry, I'm a bit tired --'

west grove
#

got another question.. i'm in a uav and want to force switch the vision mode... anyone has any hints?

#

i can check the current vision mode with currentVisionMode, but i have no idea how to set another vision mode

#

there is setCamUseTI, but as far as i can see, this is only for normal cameras

vernal mural
#

is there a way to play a sound in 3D and being able to interrupt it ? Like by deleting the sound source or so ?

west grove
#

if i remember right, i've used a game logic to play sound in 3d. after deleting the game logic, the sound stopped.

#

this is how i faked my early radio stuff

vernal mural
#

oh yes indeed, it is written in doc --' RTFM, as usual...

vernal mural
#

it looks like setHitPointDamage is not recognized... Not highlighted by the syntax coloration, and a "Generic error in expression" spawning at runtime. Any idea ?

tough abyss
#

There is no syntax coloration in Arma

still forum
#

There is a thing called a wiki. Maybe you should use it.

vernal mural
#

@tough abyss I was unclear, syntax coloration extension for VSCode. Usually pretty up to date, but some commands are sometimes missing.

@still forum I am using the wiki, of course ^^ The only limitation I see here is the fact that given vehicle has to be local, and in my case it is. So I wonder what is this Generic error thing. I know sometimes I ask a bit to fast, but this is not this type of situation.

ruby breach
#

Having the full error helps more than "i have an error"

still forum
#

Yes. Not everything is always constantly up to date

tough abyss
#

That is command from ToH, so I wouldn’t exactly call it up to date

still forum
#

Arma always says

Generic Error in Expression:
<Here is where it went wrong>
<in this file and this line>
<This is the exact error that happened>

So you are literally only giving us the only part of the error message that's completly useless

vernal mural
#

Because there is literrally no other info in the script error.

_target |#|setHitPointDamage [_hitpoint, 0.1];
Generic error in expression
File blahblah\fn_doUseAps.sqf [LM_fnc_doUseAps], line 24

That's it. _target is defined and local. _hitpoint is defined and valid. The rest of the file is letterally empty (nearly 30 lines but commented things for later). That's why I'm lost.

still forum
#

there should be more to that though

#

are you sure _target is defined?

queen cargo
#

Weird πŸ€”πŸ€”

still forum
#

What is the content of _target?

ruby breach
#

is target defined, is it an object, is hitpoint defined, is it a string of a valid hit point class?

queen cargo
#

Mhh... If sqf-vm would have more contributors, one could tun the code though it to get a proper Result

still forum
#

no you couldn't

#

That still wouldn't tell you what he's passing into _target

#

If we see that he's passing a string or smth then we already know what's going wrong. sqf-vm wouldn't help with that

polar folio
#

did he log/systemchat the used local vars yet?

still forum
#

Do you see any message since we asked for the contents?

polar folio
#

anyways. i got a weird issue. i'm trying to get valid (actually on surface) house positions. but this one house is acting weird and i'm sure there will be others.
classname: "Land_i_House_Big_01_b_blue_F"

code to test:

["bla", "oneachframe",
{
    params ["_arrow"];
    
    _inspos = [0,0,0];
    _ins = lineIntersectsSurfaces 
    [
        AGLToASL positionCameraToWorld [0,0,0], 
        AGLToASL positionCameraToWorld [0,0,5],
        _arrow,
        player,
        true,
        1,
        "VIEW",
        "NONE"
    ];
    if !(_ins isEqualTo []) then
    {
        _inspos = _ins select 0 select 0
    };
    _arrow setPosASL _inspos;
}, ["Sign_Arrow_F" createVehicle [0,0,0]]] call BIS_fnc_addstackedEventhandler 
#

i haven't tried all lod combinations yet but every lod i used with "NONE" gives me sunken in positions at the bottom floor. makes not sense

still forum
#

why not use building positions
and did you check if AGLToASL returns what you expect it should?

#

did you try using drawLine3D to check where the intersection is actually checked?

polar folio
#

the input positions are from KK's wiki example

#

you mean drawline3d between those two positions yea?

still forum
#

yeah

polar folio
#

k. one sec

vernal mural
#

Yep I systemChated both _target (which is an <OBJECT>, Badger IFV, properly passed to the function) and _hitpoint (which is a wheel hitpoint <STRING> depending on which wheel the action is performed. And it's the hitpoint name, not the selection name).

There is nothing more in the error message. If you guys have any further doubt about it I can post a screenshot somewhere and give you the link, but you'll not find anything else. Appart from the fact that it's in French such as my game is in this language. I simply translated it quickly.

still forum
#

If it returns <OBJECT> to you then it's wrong

#

The RPT log might print better error messages than the onscreen ones. Not sure

polar folio
#

yea the line goes straight for the target. it works great on most positions on most buildings. it's very odd.

vernal mural
#

Ah, good catch. The RPT is stating Error sethitpointdamage: Type Tableau, Objet attendu, which means _target is considered as an array instead of an object. That is strange. But at least we know what the problem is. However when I do systemChat str _target it is trully an object. Gonna dig around this. Thanks for the tip, I never think about RPT since usually on-screen errors are pretty self-explanatory.

still forum
#

it is trully an object is it?

#

is it object or [object] ?

#

you probably forgot to take it out of _this properly?

vernal mural
#

yeah, object. I'm totally dumb, it's official now... I doubled "arrayed" the parameter in the function call, which makes absolutely no sense. Apologies for the linked chatter this evening --'

tough abyss
#

What’s doubled arrayed?

still forum
#

the parameter in the function call <--

tough abyss
#

[[object]]?

ruby breach
#

He was trying to do the equivalent to this: ```sqf
[[player]] call {_this setPos [0,0,0];}; //Generic Error in Expression: Type Array expected Object

tough abyss
#

But he said systemchat showed object not [object] or [[object]]

still forum
#

Yes

#

That's just him thinking he knows what is important and what's not

meager heart
#

_this setPos [0,0,0] need check that place, lot of guys traveling there, probably some easter eggs, can't be just "good view"... πŸ˜ƒ

winter rose
#

aaand another mission in the missile tube… when will it end?

meager heart
#

Soon β„’

obsidian kiln
#

when you

#

switchplayer to another unit in multiplayer

#

and enableAI teamswitch to the last unit

#

do that AI become local to the player or the server?

#

can you remoteexec a setowner to make the last unit become local to the server?

#

like

#

if _man is the last unit from you where you switched from

#

onTeamSwitch {_man enableAI "TEAMSWITCH"; [_man,2] remoteExec ["setOwner",2]};

still forum
#

you you can change locality using setowner

#

but if that AI is not the teamleader it won't do anything

#

And I don't know if switchplayer transfers the unit. It should tho

obsidian kiln
#

im using a script that makes you switchplayer to other groups in am ultiplayer environment

#

thing is that after a while you have been switching through all group leaders so all AI become local to you and it becomes a little laggy in the fps side

#

i will try to test it in a dedicated server if setowner works with the eventhandler

meager heart
#

maybe you can try just create group on the server side and join them instead of setOwner πŸ€”

stuck mulch
#

Anyone have insight into the problem that I posted long ago here?

#

Trying to create a squad paradropping out of a helicopter but the AI manning the helicopter stops following waypoints upon ejection.

#

Seems as though it defeats the point of waypoints if I need to manually move the helicopter if I do something to the cargo of the vehicle midway through the route. Has anyone experienced this issue?

#

It seems like an AI bug to be honest, and I want someone's opinion on if this is a bug or if I am missing something. I've checked every property that I know of that could be linking the cargo (soldiers) that I'm ejecting and the vehicle, there doesn't seem to be any relation that would cause the AI heli crew to ignore waypoints (that exist, I checked). Even manually setting their waypoint to the next one does not relieve the issue.

exotic tinsel
#

im using custom chat commands. is it possible to capture who typed the command? to get their player object?

obsidian kiln
#

so i used this in the end

#

onTeamSwitch {_from enableAI "TEAMSWITCH"; _group = group _from; [_group,2] remoteExec ["setGroupOwner",2];};

#

it worked fine i think, i had a performance increase so i think it worked, couldn't test it deeply though, had too much fun while playing

leaden summit
#

I have a mission where I spawn a random number of weed plants that the players have to burn. At the location it can be 3, 6 or 8 plants.
Problem I'm having is that I'm using this at the end of the script to wait until all plants are destroyed and then succeed the mission

waitUntil {
            !alive plant1 && !alive plant2 && !alive plant3 && !alive plant4 && !alive plant5 && !alive plant6 && !alive plant7 && !alive plant8;
};

Problem is if only 3 spawn the script errors when it comes to plant4. I know I'm missing something simple but I thought !alive plant4 would be still fine if plant4 was never spawned?

waxen tide
#

can you show the rest of your script?

leaden summit
#

I can but it's a complete disaster. I can't code for shit so it's going to be all over the place and horribly inefficient

waxen tide
#

well i have an idea how to solve your issue but it depends a bit on you code above that because you basically want to tie into the amount of plants you spawn, and then you want to check if the plants you spawned still exist. You want to avoid to check plants that you never even spawned in the first place

leaden summit
waxen tide
#

DEAR GOD SHOW MERCY TO MY SOUL

#

(kidding) πŸ˜›

leaden summit
#

You were warned πŸ˜›

waxen tide
#

Well my first approach would have been to store the amount of plants i spawn, and then just check on those with a likely custom while loop with like a sleep 3 in it. You could also just replicate your switch structure from above and use a bunch of different waituntil loops.

#

You could also try some if (!isNil plant9001) then {}; madness.

leaden summit
#

I tried using another switch block but for some reason it still shit the bed.
I was even tempted to spawn 8 plants every time and then just delete excess for the smaller locations πŸ˜‚

waxen tide
#

first thing i would do, i would cut out all the duplicate code

#

use arrays

#

you can just push markers into an array, and then use foreach loop to cycle thru all of the markers and spawn a plant on it, add ace interaction, etc.

leaden summit
#

Yeah I'm super bad at that because of my limited knowledge,

waxen tide
#

then you can re-use that array and cycle thru it again to check if the plants are dead

leaden summit
#

Ok thanks, maybe starting from scratch with what I've already learned is the best course of action

#

While I've got you is there any "isInside" type command I'm missing. Another side mission i was working on has an HVT move into a random building location, however on the Aliabad map there's a ton of "buildings" that are just rubble and it doesn't make much sense to have them spawn there

leaden summit
#

Ok I've been using the following (again probably a disaster)

//Get all town locations on the map and pick a random one
_towns = nearestLocations [getPosATL player, ["NameVillage"], 25000];


_RandomTownPosition = position (_towns select (floor (random (count _towns))));

//optional also for more randomization:

_posX = (_RandomTownPosition select 0) + (random 200) - (random 200);
_posY = (_RandomTownPosition select 1) + (random 200) - (random 200);

_MoreRandomTownPosition = [_posX,_posY,0];

//Spawn HVT

_groupHVT = creategroup east;
"CFP_O_TBAN_Rifleman_AK_47_01" createUnit [_MoreRandomTownPosition,_groupHVT,"HVT = this;"];

//Move HVT into a random position in the nearest building 
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;

HVT setPosATL (_hvtPos);
#

For the most part it works perfectly, it's just when that random position happens to be near a destroyed building

waxen tide
#

seems much more reasonable to me than the last one πŸ˜›

#

oh you mean your AI is then standing inside a wrecked building?

leaden summit
#

Yeah

#

Like all the walls are down, it's just rubble and my guys standing there like an idiot

waxen tide
#

πŸ€” All destroyed buildings should have some "ruins" or something in the classname. You could detect that with some string magic, and then just skip that building.

leaden summit
#

I know you can use intersect to see if there's a roof over your head, but that's as far as I got

waxen tide
#

you're always just moving them into one building, right?

#

oh it seems it's just one guy?

leaden summit
#

Yeah it's an HVT and then I spawn a squad with a CBA defend command nearby

waxen tide
#
private _good_houses =[];
private _houses = HVT nearObjects ["House", 100];
{
  if ((((typeOf _x) find "ruins_F") == -1)) then
    {
      _good_houses pushBack _x
    }
} forEach _houses;

_allpositions = _good_houses selectRandom HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
HVT setPosATL (_hvtPos);
#

How about that

leaden summit
#

I found something on the forums that I was just testing

//Move HVT into a random position in the nearest building 
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom ((_allpositions) select {lineIntersects [AGLToASL _x, (AGLToASL _x) vectorAdd [0,0,10]]});
HVT setPosATL (_hvtPos);
waxen tide
#

yeah but you need more than just one position. You basically pick a building with nearestBuilding (which is always just 1, the nearest) and then you check it. What if it is bad? You need to make a list of buildings first, and then pick a good one from that list.

#

Oh and you probably want some contingency in case there is no building close.

leaden summit
#

Since I started testing that code I posted it seems to work fine, the only time he spawned in ruins he was actually under a tree so that would have counted as an intersect. Of course I get what you're saying and it could just be dumb luck so far

#

And the dumb luck ran out πŸ˜›

waxen tide
#

πŸ€” If i do not missunderstand anything (which is possible, still no morning β˜• yet) you're picking a building, and then checking, and you do not pick a different building after your check. The bit of code i posted generates a list of all buildings in 100m radius, then sorts out any ruins, and then picks a random one from that.

leaden summit
#

Yeah I'll try and incorporate your code with my disaster piece πŸ˜›

waxen tide
#

Eh most people need quite a while to get into scripting, lots of shit to learn.

leaden summit
#

is there a missing semi colon after

{
      _good_houses pushBack _x
    }```
waxen tide
#

nope

#

if you have just one line inside {} you don't need it

#
{
    systemchat "hello"
};
{
    systemchat "hello";
    systemchat "you too"
};
#

well, one statement.

leaden summit
#

somethings not working, hang on I need to check the rpt

waxen tide
#

i used "getpos player" in my testing instead of HVT. I've assumed HVT contains similar position

forest ore
#

not sure if scripting but:
in initServer.sqf I have [] execVM "create\aTrigger.sqf"; and in aTrigger.sqf I have

_trg setTriggerArea [10, 10, 0, false];
_trg setTriggerActivation ["WEST", "PRESENT", false];
_trg setTriggerStatements ["this", "hint 'Hello there'", ""];```
Now when I go and thest the hint isn't being output. Locality issue or uh what else if not?
waxen tide
#

The effect of this command is local, i.e. the hint will only show on the computer command was executed.

forest ore
#

so in this case server

waxen tide
#

indeed

high marsh
#

SP this will work fine.

forest ore
#

it indeed did

high marsh
#

MP needs local effects to be executed on all clients

#

see Jcd's link.

"Hello blaaaaah" remoteExec["hint",0];
#

be wary of your target

leaden summit
#

@waxen tide I must have screwed something up because it just spawns the HVT, doesn't move him or do anything else further in the script

forest ore
#

I was trying to aim at enabling simulation for another (editor placed) trigger but couldn't advance since I couldn't get past testing with hint. So taking this a bit further, why this doesn't work then:

_trg setTriggerArea [10, 10, 0, false];
_trg setTriggerActivation ["WEST", "PRESENT", false];
_trg setTriggerStatements ["this", "editorTrigger enableSimulation true", ""];```
(fyi *editorTrigger* is the name of the editor placed trigger)
high marsh
waxen tide
#
_hvtPos = selectRandom _allpositions;
systemchat format ["%1", _hvtPos];
#

what's the output of that?

#

(add the bottom line below the top line)

leaden summit
#

Just ran it from the console and it says any

waxen tide
#

well you need the rest of your script to run for that variable to contain anything useful

#

any means it's undefined.

leaden summit
#

I mean I ran the script and once the HVT spawned I ran the code you posted from the console

#

I'll add it into the script

waxen tide
#

whenever something doesn't work, i check the contents of all my variables. this takes care of 95% of all debugging, because you'll find a var that doesn't contain what you expected it contains.

leaden summit
forest ore
#

Midnight, ahh yes indeed. Hadn't even come to think that enableSimulation does also have locality "options". I went to check the Biki page you provided and found that there's also enableSimulationGlobal. Aand using that enables the editor placed trigger πŸ‘πŸ»

waxen tide
#

That's because i'm an idiot.

#

wrong

_good_houses selectRandom 

less wrong

selectRandom _good_houses
high marsh
#

Yep, global variants are nice. Forgot about it otherwise I would've linked that as well. Best of luck.

leaden summit
#

Still can't get it to work, I replaced

_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;

with

private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
  if ((((typeOf _x) find "ruins_F") == -1)) then
    {
      _good_houses pushBack _x
    }
} forEach _houses;

_allpositions =  selectRandom _good_houses HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;

And now instead of spawning the HVT moving him to a building pos and carrying on with the rest of the script I just get a single unit not even in a building and the next line in the script which changes his weapon isn't even happening

waxen tide
#

well add some debug and check your log

#
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
diag_log format ["_houses: %1", _houses];
{
  if ((((typeOf _x) find "ruins_F") == -1)) then
    {
      _good_houses pushBack _x
    }
} forEach _houses;
diag_log format ["_good_houses: %1", _good_houses];

_allpositions =  selectRandom _good_houses HVT buildingPos -1;
diag_log format ["_allpositions: %1", _allpositions];
_hvtPos = selectRandom _allpositions;
diag_log format ["_hvtPos: %1", _hvtPos];
peak plover
#

@leaden summit ```sqf
_allpositions = selectRandom _good_houses HVT buildingPos -1;

add parenthesis
waxen tide
#

weird, i had the same thought twice and didn't mention it.

#

goes to grab a β˜•

peak plover
#

I just took your thought

#

With my coffee powers

leaden summit
#

Where exactly?

high marsh
#

Will your life server include drinkable coffee Nigel?

peak plover
#

πŸ‘Ί

high marsh
#

πŸ˜‚

peak plover
#
_allpositions =  selectRandom _good_houses HVT buildingPos -1;
#

isn't this a downright error?

#

buildingPos takes an object not an array

high marsh
#

Yeah, missing parentheses

peak plover
#

Right?

#

also _good_houses HVT buildings

#

what

high marsh
#

buildingPos takes object iirc.

peak plover
#

yeah

#

HVT buildingPos -1;

high marsh
#

spits out an array

#

-1 indicates all positions, whereas any positive number indicates index.

peak plover
#

why would you get a MAN buildingPos

#

HVT i assume is a man

high marsh
#

I would imagine it still tries to index the positions as it's still an object

leaden summit
#

Yeah I originally had

_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
HVT setPosATL (_hvtPos);

and that worked fine, it just also places the HVT in rubble

#

The changes jcd proposed were to help make sure he only gets placed in an actual building

peak plover
#

What do you want to do?

high marsh
#

You mean one that is not damaged? I guess you could after setting the position loop to detect the intersecting areas and move up until you become safely above

peak plover
#

Put hvt in a random house?

leaden summit
waxen tide
#
_allpositions =  (selectRandom _good_houses) buildingPos -1;
high marsh
#

wat. HVT is not a building.

waxen tide
#

πŸ€” 😩

high marsh
#

Unless I am missing something here? Your left parameter is HVT to buildingPls

waxen tide
#
_allpositions =  (selectRandom _good_houses) buildingPos -1;
high marsh
#

πŸ‘Œ

leaden summit
#

Hey that works better πŸ˜›

waxen tide
#

I didn't have any HVT! So i couldn't test properly!

high marsh
#

oneliner

waxen tide
#

makes up elaborate excuses

high marsh
#

🐷

waxen tide
#

🐿

meager heart
#
private _buildings = (HVT nearObjects ["Building", 100]) apply {_x buildingPos -1} select {count _x > 0}; 
private _posList = selectRandom _buildings; //--- array with gud positions
```maybe this way ^ πŸ˜ƒ
high marsh
#

Wait a sec. Why not just evaluate _x buildingPos -1 in select?

#

Because you're essentially doing the same thing?

peak plover
#


// place a bunch of HVTs in 3den (ten_hvt_1 - ten_hvt_100)
private _allHVTs = [];
for '_i' from 1 to 100 do {
    private _unit = missionNamespace getVariable [('ten_hvt_'+ str _i),objNull];
    if (!isNull _unit) then {
        _allHVTs pushBack _unit;
    };
};

private _hvt = selectRandom _allHVTs;
missionNamespace setVariable ['ten_hvt',_hvt,true];

// 2nd way
// target for nearObjects(can be positon array)
private _target = ten_hvt;
private _unit = ten_hvt;

private _allPos = [];
private _nil = {
    private _house = _x;
    if (((toLower(typeOf _house)) find 'ruin') == -1) then {
        _allPos append (_house buildingPos -1);
    };
} count (_target nearObjects ['House',300]);

_unit setPosATL (selectRandom _allPos);
high marsh
#

not in the literal sense of my words

peak plover
#

You can just place a bunch of HVT options in 3den

#

and select a random one

#

That's what I usually do because random house pos can be too random

long hatch
#

just a question, can a case have multiple arguments like case ("x" || "y"): or case (_a and _b):?

peak plover
#

Because it wouldn't make sense to ahve a HVT on balcony

leaden summit
#

This guy's a warlord with a golden AK. He ain't hiding πŸ˜›

high marsh
#

If I was a HVT I would be enjoying the sun for sure

peak plover
#

haha

#

makes sense

meager heart
#

oh btw if that hvt thingy universal for any kind of locations, you maybe need filter bridges too... πŸ€”

peak plover
#

But still I'd manually place them unless this is a mission where the task is randomly generated (like invade and annex)

high marsh
#

@long hatch No, I do not think so. I believe you could make a second condition inside the case condition inside switch do control structure

tough abyss
#

@long hatch assuming _a and _b are Booleans, yes. The other one doesn’t make sense

leaden summit
#

Although I was going to use the same basic script for a prisoner HVT as well, so he might not want to be standing on the roof of a mudhut

peak plover
#

Yeah

waxen tide
peak plover
#

Just place like a bunch in 3den and select a random one and then delte the rest

leaden summit
#

Yeah these are side missions for an ALiVE mission I'm putting together

peak plover
#

oooh

#

i don't know what that means tho

high marsh
#

@meager heart Do bridges have buldingPos defintions though? Wouldn't it filter out on it's own?

peak plover
#

Yes

#

they mite

meager heart
#

@high marsh yes, they have positions, some of them

peak plover
#

If you want ai to walk on a object you generally need a buildingPos

high marsh
#

Why? It doesn't make any sense as to why you would need them

leaden summit
#

And after all that they're still spawning in the rubble 😦

waxen tide
#
nearObjects ["House", 200];
#

Typename should take care of it?

high marsh
#

I thought bridges were treated as roads for AI?

peak plover
#

hmm

waxen tide
#

If you give it "House" it won't find bridges. Or powerlines. Or whatever.

leaden summit
waxen tide
#

Oh and you could just do like a count on buildingPos to check if its a good building/house.

#

yeah well ofc that's why i proposed checking for the "ruin" string in the house classname.

leaden summit
#

They still spawn there though

waxen tide
#

vanilla ruins have ruins_F at the end of the string

#

well, with the diag_log commands i pasted all over the script, your *.rpt log should have a bunch of useful info to check on the classnames of those houses.

leaden summit
#

I'm guessing aliabad doesn't adhere to those rules

high marsh
#

"rules" ? No, this is probably just for naming convention purposes. I doubt though they used a different type for ruins. You could always check in the config viewer

high marsh
#

Hmm. Interesting.

meager heart
#

so... need filter for both ^

leaden summit
#

And this time the HVT spawned in the middle of nowhere

waxen tide
#

is this with the most recent fixed _allpositions = line?

leaden summit
#

Yup

waxen tide
#
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
  if ((((typeOf _x) find "ruins_F") == -1)) then
    {
      _good_houses pushBack _x
    }
} forEach _houses;

private _house = selectRandom _good_houses;
diag_log format ["_house: %1", _house];
private _allpositions =  (selectRandom _good_houses) buildingPos -1;
diag_log format ["_allpositions: %1", _allpositions];
_hvtPos = selectRandom _allpositions;
diag_log format ["_hvtPos: %1", _hvtPos];
#

I think i know already what the issue is. The selected house has no buildingPos.

#

but try this and check RPT

leaden summit
#

Worked the first time, but not the second. Also it gives me errors about the log after the first attempt

waxen tide
#

well look for _house:, _allpositions: _hvtPos: in the rpt

#

what do they contain?

leaden summit
#

Here's the abortion of a script (this should come with a trigger warning for those of you who actually know how to code)
https://pastebin.com/BzQUW8dc

waxen tide
#
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
  if ((((typeOf _x) find "ruins_F") == -1) && (count (_x buildingPos -1) > 0)) then
    {
      _good_houses pushBack _x
    }
} forEach _houses;
private _house = selectRandom _good_houses;
private _allpositions =  (selectRandom _good_houses) buildingPos -1;
_hvtPos = selectRandom _allpositions;
#

try that.

leaden summit
#

So far so good

waxen tide
#

isn't the ruins check still broken

leaden summit
#

I'm not getting any errors and so far no ruins (again could be dumb luck)

#

I think when I adjust this for a prisoner HVT I might just limit it to building position 2 because I think that's always going to be indoors

waxen tide
#

80% sure it's dumb luck.

leaden summit
#

It is when you're as dumb as I am πŸ€”

waxen tide
#

well i once wrote a quite ... extensive script to check if a position is actually properly indoors

leaden summit
#

I remember seeing something by Killzone Kid which used intersects etc but last time I thought about it I had even less of an idea what I was doing than I do now

leaden summit
#

😯

#

Right that seems to be working great, thank you for your time and help.
Now to go back and readdress my "burn the weed crop" script πŸ˜‚

waxen tide
#

I can send you that rubbish, it's old stuff i haven't touched in a while with some rough edges but it works and i had some help from here to optimise the performance a bit so it's plenty quick (especially if you just check one house)

leaden summit
#

I can tell you now I'd just be completely lost πŸ˜›

waxen tide
#

Eh whenever you want to come back to it, just poke me.

#

My idea was to set up ambushes with AI player can't see, i guess your idea is similar

leaden summit
#

Thanks, appreciate your help πŸ˜ƒ

sonic cradle
#

I want to get a VLS launcher to switch to Cluster missiles instantly so I can fire it. Best I can thinkof is use loadMagazine, which tells the VLS to load the cluster missiles, but only at the standard-long-as-all-hell reload speed. setWeaponReloadingTime doesn't affect it.

lusty canyon
#

@sonic cradle delete all weaps and mags from the object, then add the mags first then next the weapon. should be instantly loaded.

sonic cradle
#

@lusty canyon it loads, but not instantly. It's ready to fire after about 10 seconds.

peak plover
#

How do I change vehicle ammo for a gunner?

#

Anyone know from the top of their head?

meager heart
#

you mean load different ammo type ?

#

if yes, there was action "SwitchMagazine/SwitchWeapon" iirc

#

oh also loadMagazine πŸ€”

astral tendon
still forum
#

I don't know any reason why it would be local only

astral tendon
#

I have a felling that does not work if the attached object or the object that is reciving attachings is created from the server

still forum
#

how about you just try it out?

#

also fix your english.. It's a chore to always have to read your messages 3 times

astral tendon
#

english machine broke

astral tendon
still forum
#

it should work on simple objects created through vehicle config name if it has hidden selections

astral tendon
#

It was a offroad placed on editor with the" Simple Object" check mark selected

lusty canyon
#

is there a property that can identify if a weapon is pylon compatible? i want an array of weap classnames that can be placed ina pylon slot. (im assuming any weap can be placed in a pylon but there will be no model?)

#

nvm my AOA was wrong, gotta use getCompatiblePylonMagazines

unreal siren
#

So I've ran into this problem across two gamemodes, what would cause an interface button (Deploy, in both cases) to slowly develop crippling delays after 30m-3h playtime? It's clientside to my knowledge, and the client can work around this by simply backing out to lobby and back in, assuming JIP code is up to snuff. It's gotta be a scheduled/unscheduled menu problem. That, or some sort of underlying issue in code time.

#

Server and HC run 49-50FPS, and no other menu has the delay.

#

Maybe vars or something?

still forum
#

sounds like scheduled scripts

hollow thistle
#

Sounds like liberation, it's caused by permament unscheduledscheduled loops.

still forum
#

scheduled*

unreal siren
#

Tis liberation, in one hand.

#

How do you recommend I fix?

still forum
#

Become a SQF specialist and help with the liberation rewrite

unreal siren
#

πŸ˜‚

#

Liberation isn't the only scenario with this issue though. What I can't figure out, is it only seems to affect the deploy action.

#

You'd think the entire gamemode would slowly take a crap. (Which from what I hear, it does, but only after 3+ hours on the server, even though I've ran for a day+ with minimal issues)

#

I'm not proficient with SQF, but I don't see much outside of waitUntil being used for weird things, relating to deploy. I also don't know if it's the UI or the actual deploy action.

drowsy axle
#

Hello, Having an issue with localisation of hints.

This based around a trigger: (screenshot)
https://gyazo.com/7ae4c31b8cd48debf3ff468f799e6253

Trigger Setup: (screenshot)
https://gyazo.com/100ce935cd7396bb49c269180fbd7a73

Here's the code in allowed.sqf :

_thisListTrig = (_this select 0);
{
    uid = getPlayerUID _x;
} forEach _thisListTrig;

if (hasInterface) then {
    if !(uid in commandOpsAllowed) then {
        player setPos "commandOpsMarkerDoor";
        hint format["Unauthorised Access by: %1 - You do not have permission to enter the Command Ops",player];
    } else {
        hint format["Welcome to Command Ops %1",name player];
    };
};```
still forum
#

Okey and your question is?
And why is the trigger relevant?

drowsy axle
#

The result is a hint for everyone in the mission. The expected result is a hint for only the person inside the trigger.

#

I tried to use hasInterface without any success.

still forum
#

player setPos "commandOpsMarkerDoor"; what's that supposed to be?

#

setPos doesn't take a string. This doesn't make any sense

drowsy axle
#

The string is a marker.

still forum
#
params ["_thisListTrig"];

if !(player in _thisListTrig) exitWith {};

if !((getPlayerUID player) in commandOpsAllowed) then {
    player setPos (getMarkerPos "commandOpsMarkerDoor");
    hint format["Unauthorised Access by: %1 - You do not have permission to enter the Command Ops", name player];
} else {
    hint format["Welcome to Command Ops %1",name player];
};
drowsy axle
#

Ah

#

Sweet

#

Issue still persists.

#

I went into the area. And other players reported having the hint, without being in the area.

still forum
#

it only fires if player is inside the trigger

#

so dunno then

drowsy axle
#

Yes, I went inside.

#

How would I make the hint only for the person inside..?

still forum
#

I already did that

#

if !(player in _thisListTrig) exitWith {}; this exits the script if the player is not inside the trigger

drowsy axle
#

Right.

still forum
#

causing the hint to never be displayed

drowsy axle
#

Yeah, I get that. Let me check and come back

#

So. The script works only for a person inside the area. The hint doesn't show for people outside. The hint doesn't show, for the x person if someone is already inside, if someone enters, the hint is only shown on the first person who entered.

still forum
#

yeah the hint shows again if someone else enters.
Don't know what the rest is supposed to mean. The code atleast doesn't do anything else

drowsy axle
#

yeah the hint shows again if someone else enters. ... but only for the person who originally entered, NOT for the person who entered "second".

still forum
#

the code doesn't make any difference between first and second.. soooo.. dunno

polar folio
#

is there a single config parameter that identifies a backpack as not being a normal backpack but having dismantled weapons or a respawn tents or other shenanigans in it?

drowsy axle
still forum
#

I don't see anything from that gif

#

seems like everything is working like it's supposed to. The hint isn't showing for outsiders

nocturne basalt
#

hi guys. Im trying to get ammocount from autocannon_40mm_CTWS.

this script works for many other weapons, but for the autocannon_40mm_CTWS it gives me 0.

_weapon = _v currentWeaponTurret [0];
_ammoPos = _v ammo _weapon;

can someone explain why it works with some weapons only?

#

it works great with Gatling_30mm_Plane_CAS_01_F for example

#

I tried dumping the value from _v currentWeaponTurret [0]; and it is giving me the correct weapon name

drowsy axle
#

Yes, but notice that Troy the person who is being moved is allowed entrance when ViBro enters first.

still forum
#

Ahh

#

Yes

#

No.. Actually not. The script handles that correctly

#

as long as thisList is correct

west grove
#

oi. got a weird question again. i'm trying to spawn leaflets via script, but can't figure out how to do it. anyone got any clues?

nocturne basalt
#

maybe with drop?

still forum
#

There is a leaflet bomb.. But I don't know how you'd detonate that in air

high marsh
#

setDamage?

still forum
high marsh
#

Well why not?

_dudeDrone = "BlahDroneClassBlah" createVehicle blahPosition;
_dudeDrone addMagazine "1Rnd_Leaflets_Custom_01_F";
_dudeDrone addWeapon "Bomb_Leaflets";
_dudeDrone fire "Bomb_Leaflets";
west grove
#

but that's just spawning a new drone

#

i mean, yeah, it works, but i was wondering if you can skip that part

still forum
#

and firing leaflets

#

For me that wouldn't really be an option if I just want some leaflets. Don't know another way tho

west grove
#

i guess best way would be a custom particle effect, because at its core i just want some papers flying around

still forum
#

shouldn't even need custom. I guess Arma already has such a particle effect for the leaflets

west grove
#

once more a good example of why it would be good to have a filter function in the config browser. ugh.

still forum
#

or a pdrive ^^

west grove
#

searching through stuff on p takes ages

#

unless you know exactly in which sub folder you have to look

still forum
#

Not for me.. Looking through a list of files is quite fast on windows πŸ€”

#

bis_fnc_initLeaflet

        _leafletsParams = "Leaflets" call bis_fnc_getCloudletParams;
        if (count _leafletsParams > 0) then {

            //--- Assign script
            private _leafletClass = gettext (configfile >> "CfgMagazines" >> _magazine >> "leafletClass");
            private _leafletScript = gettext (configfile >> "CfgLeaflets" >> ("script" + _leafletClass));
            if (_leafletScript == "") exitwith {["Script not defined for leaflet %1",_leafletClass] call bis_fnc_error;};
            (_leafletsParams select 0) set [17,_leafletScript];

            //--- Use custom model
            private _cfg = [["CfgLeaflets",_leafletClass],configfile >> "CfgLeaflets" >> "Default"] call bis_fnc_loadClass;
            if (istext (_cfg >> "model")) then {(_leafletsParams select 0 select 0) set [0,gettext (_cfg >> "model")];};

            //--- Create particle source
            _leaflets = "#particlesource" createVehicleLocal position _obj;
            _leaflets setParticleParams (_leafletsParams select 0);
            _leaflets setParticleRandom (_leafletsParams select 1);
            _leaflets setDropInterval (_leafletsParams select 2);
            _leaflets attachto [_obj,[0,0,0],"leaflet_spawn"];
        };
#

there. Particles on the bottom. And on the top how you can get the params

west grove
#

_source = "#particlesource" createVehicleLocal (getPos player);
_source setParticleClass "Leaflets";

#

spawns a crapton of papers πŸ˜„

tough abyss
#

@polar folio try isKindOf "Weapon_Bag_Base"

still forum
#

@tough abyss already answered. It was just a dumb cross-post

polar folio
#

@tough abyss found the answer. but thx

isnull(configfile >> "CfgVehicles" >> _backpackclass >> "assembleInfo")

@still forum i answered it myself...you need to relax

still forum
tough abyss
#

Just checked config thread, naughty naughty

polar folio
#

the weapon_base thing doesn't apply to those respawn backpacks

tough abyss
#

Probably not but those could well have own subclass

polar folio
#

sure. just letting you know

minor lance
#

anyone knows why a code called with spawn inside a ButtonSetAction throws an error in a sleep and having the same code outside and being calles with [] spawn fnc_test is working?

still forum
#

how do you call it exactly?

#

"call" and "spawn" are two different things. so "called with spawn"...?

minor lance
#

no problem its working now thanks ❀

still forum
#

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

inner swallow
#

"called with spawn" probably just means "spawned" πŸ˜›

still forum
#

My thought was things like call {sleep 5; [] spawn {code}} Β―_(ツ)_/Β―

inner swallow
#

it's just a reflex from other programming languages, really πŸ˜„

#

i invariably end up saying "called the script with execVM" because the other option is saying "execVM-ed" which feels weird

#

but then i catch myself and correct it

knotty arrow
#

haha

still forum
#

"spawned a script"
"called a script"
but yeah execVM is weird. But spawn==spawn compile preProcessFileLineNumbers==execVM
And the difference is only important if script is not getting executed at all where it's probably a typo in the filepath

meager heart
#

execute/executed/executes script * πŸ€” x3

obsidian kiln
#

what would be more cpu intensive

#

to check every 20 seconds if there is a tank near through nearentities at 100 meters

#

or checking if in neartargets there is a tank

exotic tinsel
#

Im looking for an experienced Arma Developer to hire. Someone who has been coding in Arma since at least Arma 2.

This individual must be 18 or over.
This individual must live in the Eastern Standard Time Zone.
This individual must be a citizen of the United States. This is only for tax reasons.
This individual must have a PayPal account.
Please forward this to anyone you know that meets the criteria. Please PM me, my discord name is LifeSnatcher, or email me at lifesnatcher1@gmail.com

inner swallow
exotic tinsel
#

@inner swallow rgr that

inner swallow
#

thanks

peak plover
#

you're looking for someone who's been coding since Arma 2. To what benefit?

late gull
#

the benefit of wrinting old coded unefficient scripts? :p

peak plover
#

I guess

tough abyss
#

That recruitment ad, I wonder if they have healthcare plan

naive estuary
#

It's a job in the US, of course it doesn't have a healthplan.

rancid ruin
#

what'd be the fastest way to place loads of objects dynamically?

#

dynamically in the sense that they're not defined in the mission file

#

is there no better way than createVehicle or createSimpleObject?

opaque topaz
#

yes

#

place objects then use hideObjectsGlobal to unhide the objects?

simple rain
#

Hey you guys, I'm having an issue with one of my sqf scripts. I'm basically trying to assign a MissionNameSpace object name to a local Object variable:

//Get a whole-number for my 23 random objects
_introNumber = floor random(23);

#

//String for the object's in-editor name
_landingStr = (str (format["OpS%1", _introNumber]));

_landingZone = missionNamespace getVariable ("" + _landingStr);

#

It seems that using a variable-name doesn't seem to work. Say it selects "20" as the number and it gets "OpS20" as the string name, it doesn't find the object in the mission 😦

#

However, it does find it if I just put :

#

_landingZone = missionNamespace getVariable "OpS20";

#

Why Arma Y

#

_landingZone = missionNamespace getVariable _landingStr;

#

Also doesn't work

#

Fml you guys. It was "str" adding quotation marks around it so it became ""OpS20"" instead of "OpS20".

#

Just in-case anybody was on the edge of their seats there

still forum
#

@exotic tinsel there is also the cross-posting #rules btw

open vigil
#

come on now, no personal attacks

peak plover
#

sorry

#

Woke up on wrong leg and didn't evne notice it πŸ˜„

still forum
#

@peak plover I agree with you though. But sadly that applies to many people here and no one will ever be able to fix it

peak plover
#

It's almost like people are people

peak plover
#

I was lookin to find player head pos the other day

#

This is how you can do it if anyone else ever needs it

still forum
#

is that more exact than eyePos? do you know? I think TFAR has problems with eyePos lagging behind

stuck mulch
#

Little update on my script problem: You need to use moveOut instead of any other variation of making people leave a vehicle to not break the waypoint system!

#

Issue resolved...

peak plover
#

@still forum I do not know. But I've heard that modelToWorldVIsual is faster than some other ones

(player modelToWorldVisual (player selectionPosition ["head",'Memory']))
still forum
#

I'm gonna probably need modelToWorldVisualWorld πŸ€”

peak plover
#

yea

#

That might be faster than eyepos

meager heart
#

was using that for the icons position

A modelToWorldVisual [0, 0, ((A selectionPosition "head") select 2) + 0.5]
```A ^ there from macro
still forum
#

_target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .3)]) This is what ace uses.
Not sure why "pilot" πŸ€”
But ACE is not lagging. So me using eyePos for TFAR ist mooost likely the reason for my laggyness then

meager heart
#

eyePos it's just asl

#

(not rendered)

sullen willow
#

How would I make a script fire when any member of OPFOR is killed?

peak plover
#

cba?

inner swallow
#

There may be a better way but I can think of three:

  1. Add an event handler to each opfor unit
  2. Add a per frame EH that checks the number of opfor
  3. Same as #2 but with a loop instead, that sleeps for 2 or 5s after each check.
peak plover
#

add a cba killed event and do it there

#

probably fastest

round scroll
#

when doing an atttachTo with a camera, the resulting view wiggles and jiggles at times quite a bit. Is there any better solution than attachTo? Maybe continuously calling setPos? Any cam script that does produce a nice video stream that can be scripted?

buoyant steppe
#

This is much MUCH better than attachTo

round scroll
#

ok, thanks

#

another question, yesterday I tried to determine the position of a smoke grenade when it is stopped. I tried with a fired eventhandler and speed _projectile < 1, but this was not precise enough. Anyone aware of a solution to get the exact position when it has expended its velocity?

still forum
#

Wait till speed < 0.2?
or wait another one or two frames after speed got down

drowsy axle
#

Hey @still forum Would the script within the addAction only work for the UID in commandOpsAllowed: ```sqf
_objectsInside = list commandOpsTrig;
_list = [];

// Check what Objects (in commandOpsTrig) are a Player.
{
if (isPlayer _x) then {
_list set [count _list, _x]
};
} forEach _objectsInside;

// Exits Script if Player is outside of the Trigger.
if !(player in _list) exitWith {};

// Kicks Player Function - Moves the Player to Marker.
kickFromOps = {
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};

// If Player UID in commandOpsAllowed Array - Shows addAction on commandOps Object.
if ((getPlayerUID player) in commandOpsAllowed) then {

commandOps addAction [
    "<t color='#44bd32'>Mission: <t color='#fff'>Test<t color='#44bd32'>, By: <t color='#fff'>Capwell<t color='#44bd32'>.", {
    execVM "scripts\commandOps\m1.sqf"
}]; // Issue - The addAction would be see ANY player, that was able to bypass the kickFromOps Function. 
//(The ability to bypass the Trigger is to have two people enter the trigger, and then they are able to select the addAction.)

commandOps addAction [
    "<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.", {
    execVM "scripts\commandOps\m2.sqf"
}];

commandOps addAction [
    "<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno - Reinforcements<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.", {
    execVM "scripts\commandOps\m2-reinforcements.sqf"
}];

};

if !((getPlayerUID player) in commandOpsAllowed) then {
call kickFromOps;
};```

scenic pollen
#

@sullen willow You could also use addMissionEventHandler["EntityKilled", {<your code>}] which only requires you to create one EH instead of one for each Opfor unit.

round scroll
still forum
#

wtf. Why is my screen full of code all of the sudden (β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

#
{ 
    if (isPlayer _x) then {
        _list set [count _list, _x]
    };
} forEach _objectsInside;

wtf is this??

kickFromOps = [
    player setPos (getMarkerPos "commandOpsMarkerDoor");
    hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
];

That's not how that works at all.

Why do you write the same thing 4 times?

drowsy axle
#

Fixed the script ^

#

What do you mean 4 things? @still forum

scenic pollen
#

Be nice Dedmen, I assume he/she's not an experienced dev πŸ˜›

still forum
#

Your addaction code is almost complete duplicates everytime

#

@scenic pollen I know him

drowsy axle
#

Yup. I would try to do it "smarter" but I just want it work for now.

still forum
#

Answer to your question is "yes" I think. But I don't know what _this select 1 is.. I'd just use player there

#

Because player is exactly what it does. No need to write needlessly confusing code

drowsy axle
#

player would be global _this select 1 is specific to who is _caller for the addaction.

still forum
#

Only player can execute a action though

#

unless you have AI's in your group and tell them to active a action.

#

Which I'd assume you don't

#

And even then. That AI doesn't have a playerUID anyway. So that wouldn't work

drowsy axle
still forum
#

And the unit can only be player

#

so why write _this select 1 if you actually mean player

drowsy axle
#

oh right... yeah

still forum
#

Wouldn't it be better to just don't show the action at all? to people that are not allowed in command ops?

drowsy axle
#

Well how would I do that?

still forum
#

the addAction condition

#

Are you executing that code from the trigger?

#
private _objectsInside = list commandOpsTrig;
if !(player in _objectsInside) exitWith {};

private _actionCode = {
    (_this select 3) params ["_scriptFile"];
    hint format["Authorised Access by: %1 - You do have permission to access Missions. Missions will be loaded for you.", name player];
    execVM _scriptFile;
};

commandOps addAction [
    "<t color='#44bd32'>Mission: <t color='#fff'>Test<t color='#44bd32'>, By: <t color='#fff'>Capwell<t color='#44bd32'>.",
    _actionCode,
    ["scripts\commandOps\m1.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];

commandOps addAction [
        "<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.",
        _actionCode,
        ["scripts\commandOps\m2.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];

commandOps addAction [
        "<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno - Reinforcements<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.",
        _actionCode,
        ["scripts\commandOps\m2-reinforcements.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];

if !((getPlayerUID player) in commandOpsAllowed) then {
    player setPos (getMarkerPos "commandOpsMarkerDoor");
    hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};
#

If you execute that for the trigger you would add the actions everytime the player enters the command ops tent

#

After some time you'll have dozens of duplicates for each mission

drowsy axle
#

Updated Script Above with Comments. ^^

#

Does this script you have created, to allow for repeated info, account for the comments in the script?

still forum
#

Or because I like macros.

#define MISSION_ACTION(missionName, missionAuthor, missionScript) commandOps addAction [\
    format ["<t color='#44bd32'>Mission: <t color='#fff'>%1<t color='#44bd32'>, By: <t color='#fff'>%2<t color='#44bd32'>.",missionName, missionAuthor],\
    {\
        hint format["Authorised Access by: %1 - You do have permission to access Missions. Missions will be loaded for you.", name player];\
        execVM (_this select 3);\
    },\
    missionScript, 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"\
];

private _objectsInside = list commandOpsTrig;
if !(player in _objectsInside) exitWith {};

if !((getPlayerUID player) in commandOpsAllowed) exitWith {
    player setPos (getMarkerPos "commandOpsMarkerDoor");
    hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};

MISSION_ACTION("Test", "Capwell", "scripts\commandOps\m1.sqf")
MISSION_ACTION("Secure and Hold - Gvozdno", "ViBro", "scripts\commandOps\m2.sqf")
MISSION_ACTION("Secure and Hold - Gvozdno - Reinforcements", "ViBro", "scripts\commandOps\m2-reinforcements.sqf")
#

comments in what script?

#

why does one need to account for comments?

#

Ah you mean if I fixed these things?

#

"(getPlayerUID player) in commandOpsAllowed" That is the condition. Only people that satisfy that condition will see the action

drowsy axle
#

Right

#

Those marcos looks weird πŸ˜› But I can see the logic.

still forum
#

Hide all the complicated uglyness. And only show the easy to use stuff for the users

#

I expect you plan to add more missions.

drowsy axle
#

Yes. Loads

still forum
#

Copy-pasting the same uglyness that's very hard to read dozens of times might not be a good idea

drowsy axle
#

Yeah. πŸ˜ƒ

#

So, the marco "define" bit works, with the formatting?

still forum
#

what formatting?

drowsy axle
#

oh nvm

#

I just saw to 1% etc

#

That is soooo cool πŸ˜ƒ

#

I need to use / look at define more

#

What are the \'s for?

#

is that new line (replacement of ;)

austere granite
#

mutiline defines

drowsy axle
#

Okay sweet Thank you @still forum

#

and @austere granite πŸ˜›

austere granite
#

if you want the macro to continue on the next line, then you put that (except on the last line as you can see, because thats where you want it to end)

scenic pollen
#

Other than a nicer syntax when calling it, what's the benefit of a macro vs [] call myFnc?

still forum
#

performance... if you really want to

#

Same as just copy-pasting the content of myFnc everywhere where you use it

scenic pollen
#

Hmm so a macro call is more efficient than a function call?

#

That's good to know

austere granite
#

yes, functions also set some variables usually and extra scopes

scenic pollen
#

Why do we use functions at all then?

austere granite
#

because the performance impact isn't a lot and it makes code a lot more organized and readable

still forum
#

No

#

A macro isn't a call at all

#

it's literally copy-pasting the macro code into your script before compiling it

scenic pollen
#

I see, so every occurrence of MY_MACRO is replaced with the contents of that macro (when compiled)?

still forum
#

yes

scenic pollen
#

I see, thanks both

tough abyss
#

@peak plover eyePos will always be faster, it is just one command with a single argument

fringe yoke
#

I'm using everyContainer to get all the containers in a vehicle, and then I'm saving MagazineCargo, ItemCargo, and WeaponCargo for that container. How can I add it all back? I'm a little confused about how to create a new container in a vehicle and get that container I just created

still forum
#

container aka backpack?

#

add them with addBackpackCargo

#

and then use everyContainer to find it

#

and then you can addMagazineCargo to the one you found

fringe yoke
#

so if I have 3 vests of the same class, I just have to loop over every container until I find the empty one?

still forum
#

I think yeah

#

You should be able to set variables onto them if you need to give them a unique identifier

queen cargo
#

just randomly remembered i once created a promise system for SQF πŸ€”

#

in june actually Oo

fringe yoke
#

awesome, efficient πŸ‘

queen cargo
#

fuck ... i think i get alzheimer

still forum
#

Chemtrails

queen cargo
#

or have amnesia

still forum
#

I have the same problem.

#

I don't know where it comes from. But I'm thinking chemtrails

queen cargo
#

i think it is just the alcohol

#

way too much of it in the summer

fringe yoke
#

So I tried doing
_container addBackpackCargoGlobal [_class, 1];
where _container is a vehicle and _class is the class of a RHS backpack.

I get Bad vehicle type rhsusf_iotv_ocp_Medic

#

What I am trying to accomplish is saving the entire inventory of a vehicle or crate. Weapons, Items, Weapon Attachments, everything. This is a lot of code considering how much I was expecting this would be.

stuck mulch
#

Recursively loop through a combined list?

still forum
#

Yes?

queen cargo
#

what is a "combined list"?

tough abyss
#

Combo list? As in combo box?

fringe yoke
#

I got the vests and backpacks working, I'm now stuck on weapons. I can use https://community.bistudio.com/wiki/weaponsItemsCargo to get all the weapons and their attachments from the cargo. Once again I can not find a way in the wiki to add it all back into the vehicle cargo.

still forum
#

you cannot add weapons with attachments

#

unless you add them to a AI and let the AI drop them into the vehicle

fringe yoke
#

🀦 why

still forum
#

I wrote a SQF command for it but BI didn't want it

fringe yoke
#

Would you happen to still have it on gist or something?

still forum
#

yes. But it's of no use to you

#

Unless you secretly work at BI πŸ€”

fringe yoke
#

Oh, so it's not written in SQF?

still forum
#

no

#

SQF commands can't be written in SQF

fringe yoke
#

ok, I had thought you just meant a function

still forum
#

Nah. I'm kinda exact on my wording usually ^^

fringe yoke
#

It would be nice to just have a setUnitLoadout/getUnitLoadout equivalent for cargo. But a few hundred lines of sqf to get and store everything, and then transfer it via an AI unit is cool too.

tough abyss
#

Strip off weapon of all attachments when you put it into storage

fringe yoke
#

I'm just going to read the attachments when I save the cargo, and then add them into the root container when loading

tough abyss
#

This is going to be really complicated but you could also store weapon configuration in the database and when player takes it you can add all the attachments it had back. But tbh too much hassle not worth it

fringe yoke
#

Yeah, that's way to much work for the reward, especially since I won't need this code after the 31st

tough abyss
#

What’s after the 31st, the end of the world?

nocturne basalt
#

can I add userActions and eventhandlers for gear such as backpacks, helmest etc?

#

πŸ€”

still forum
#

backpacks yes.

#

because they are vehicles

nocturne basalt
#

oh thats nice to know. so making a sci-fi jumppack should be possible then yes

#

send it flying

austere granite
#

I'm noob with AI, what do I do if i want to have a civilian AI attack a given unit?

buoyant steppe
#

civilians will attack anyone if they have a weapon that is

meager heart
#
 _civilianAI setFriend [<given unit side>, 0];
```maybe
stuck mulch
#

Are markers objects?

austere granite
#

no, strings

stuck mulch
#

Thanks.

#

So if I pass a marker to a function it would be String data type.

austere granite
#

pretty much i just want a "civilian" to walk around casually, but if theres enemy soldiers nearby, move towards them, then once close pull a grenade out the dark spots and throw it

#

correct

tough abyss
#

Markers are (edited for clarification: technically) objects but you can only refer to them by their name which is string

meager heart
#
private _grenades = currentThrowable _unit;
_unit doWatch _target;
_unit forceWeaponFire [_grenades select 1, _grenades select 1];
```πŸ€”
#

need check distance probably, @austere granite

sleek token
#

fsm question: from a state i got multiple conditions; will all the conditions be tested if they are true or only the one with the highest priority?

still forum
#

@tough abyss No markers are not objects. They are no entities

tough abyss
#

Every entity is an object but not every object is an entity. Anyway I wasn’t referring to markers as entities or other ingame objects, but you cannot have a bunch of properties as marker has if it was a plain string. They are structs in the engine, and structs are objects in C++

still forum
#

Yes they are an array of structs.

#

But object ingame, which is what people usually talk about here are ALOT more than just a c++ struct

tough abyss
#

Of course

#

@sleek token this is why you have priority param, the highest one checked first and if true - off you go

sleek token
#

@tough abyss roger thanks a lot

meager heart
#

fsm priorities it's like lazy eval without lazy eval πŸ˜ƒ

austere granite
#

@meager heart merci, but would that nade properly or just throw it randomly? Dont think we have heatseeking grenades yet. Ill mess around a little but left out the forceWeaponFire because of that, maybe doFire would do it

winter rose
#

@austere granite do you want the grenade to be thrown *at* the soldiers or do you want more of a suicide bomber who would drop the nade at his feet?

austere granite
#

thrown at, i might do a suicide bomber too, but that would be just a scripted explosion. Could also be molotovs or other things πŸ˜„

fringe yoke
#

@tough abyss I'm running a persistent campaign until the 31st, that's why I need to save inventories and vehicle cargo

meager heart
#

it will be slightly random always with forceWeaponFire yes and with doFire that "target dude" must be an enemy to civilian...

austere granite
#

ima try just doing a rating of -2500

#

might work

meager heart
#

glhf πŸ˜„

sleek token
#

how would you convert a x,y position (e.g. provided from findSafePos) to a 3d x,y,z one?

winter rose
#

@sleek token

private _myPos = [50, 33];
_myPos set [2, 0]; // _myPos is now [50, 33, 0]
#

ATLtoASL if needed πŸ˜‰

sleek token
#

can i give me a facepalm, because i found in my own code?

#

πŸ˜„

#

thanks

winter rose
#

if I can help about the facepalm… 😏 πŸ˜„

civic oyster
#

Would this work or did I type this wrong. I want to make it so if you dont got that license you cant use

if (!= license_civ_builder) exitWith {};

winter rose
#

assumed license_civ_builder is a boolean,

if (not license_civ_builder) exitWith {};``` or ```sqf
if (!license_civ_builder) exitWith {};``` @civic oyster
civic oyster
#

Ok I will that, thank you

winter rose
#

πŸ‘

civic oyster
#

what about if I wanted !(license_civ_builder) or !(license_cop_builder) so if the player has one of them they can use but if they don't have either then exit. Can that even be done?
@winter rose

winter rose
#

yes, with the or operand

#
condition1 or condition2```
```sqf
condition1 || condition2```
#
if (!license_civ_builder && !license_cop_builder) exitWith { hint "thou shalt not pass"; };```

my bad, corrected
#

if both are negative, exit

#

@civic oyster

civic oyster
#

ok thank you, I have been trying to find a way to do that haha

queen cargo
meager heart
#

tried to add 🚳 for that hint, but discord said no... πŸ˜”

winter rose
#

@meager heart I saw it, then it was removed ^^

meager heart
#

:sad:

civic oyster
#

for this (!license_civ_builder && !license_cop_builder) I would want to use (!license_civ_builder or !license_cop_builder) cause I only need one of them to be true not both

winter rose
#

please define:
if you have both?
if you have one of them?
if you have none?

civic oyster
#

This (!license_civ_builder or !license_cop_builder) would be correct cause you cant be a civ and a cop at the same time.
license_civ_builder = civ license
license_cop_builder = cop license

winter rose
#

not correct

#

as if you are a cop, you won't have the civ builder
your code will exit if you don't have one of them

#

what you want

if (copLicense or civLicense) then { /* you can work */ };``` the negative (for `exitWith`) is
```sqf
if (not copLicense and not civLicense) exitWith { /*stop right here */ };```
#

or simpler maybe, you can do as such:

if (not (copLicense or civLicense)) exitWith { /* blah */ };```
#

@civic oyster

civic oyster
#

ok I now understand that but where would I define the license builder. Would that go after if (copLicense or civLicense) then { in another if statement?

winter rose
#

I don't get the "define the license builder" part?

civic oyster
#

So I want the player to have a license named builder, If they don't then I don't want them to use the menu. Its a placeables menu for placing traffic cones and things like that

winter rose
#

as for that, it's your own framework I'm afraid πŸ˜„

civic oyster
#

ok

polar folio
#

will setVariable always set the variable where the command is executed or literally only on the machine with the id used in the 3rd parameter. i know probably a dumb question. just want to be sure

peak plover
#

the variable is set only on the client of given owner (clientOwner) id, or if id is negative, the variable is set on every client except the given one

polar folio
#

yea i read that. wasn't sure about dedi and server in general because of wording. just unwarranted paranoia. just tested. works as intended. thx

peak plover
#

haha ohh yeah

#

The unknowingness of wiki πŸ˜„ I know the feel

kindred lichen
#

Anyone know if it's possible to change the time it takes for a PAK to be applied? In ace?

still forum
#

yes. Medic and non medic have different time

unborn ether
#

New arma on Enfusion Engine?

#

Why I feel bad about this?

tough abyss
#

Can’t wait for DayZ mod for Arma 4

digital jacinth
#

Is there a way to lock a backpack, similar to the way it worked with the acex and a2? I have not started to try some stuff out, but would it work similar to a3 ace vehicle inventory locking?

still forum
#

yes.

#

Just use InventoryOpened eventhandler

#

And close the inventory immediately if no access

digital jacinth
#

hmm, I think I am going to experiment around that. I also wonder why ace does not have it

still forum
#

Because no one made it yet. Β―_(ツ)_/Β―

digital jacinth
#

i still remember vividly the a2 times when playing as medic. First thing I did was lock my backpack and the look back while there are already 2 people trying to steal bandanges of me :V

still forum
#

I don't see any reason to not accept the pull request for that feature. Just needs someone to actually write the code

#

I also remember the need to lock it in A2 days.. But nowadays I atleast don't remember a case where I would've needed it

digital jacinth
#

yeah same kind of. I only want it because of my crazy snowflake mission ideas

#

the only reason I do not attempt to do PRs for ace is because I am too lazy to set up the dev environment for it

late gull
#

locking the backpack as militar it's like a crazy thing, "lookig for a key in the middle of the battle to open the backpack"

#

has no sense atleast for me

digital jacinth
#

I see it still as game and gameplay really. The stuff I do is not really meant for realism

late gull
#

well, that it's the point of ACE, the realism :p

still forum
#

to set up the dev environment for it Well you need mikeros tools installed and maybe a p-drive.
Mikeros tools you probably already have (And they won't be needed for much longer. Replaced by Armake)
And for a P-Drive you can use DokanPbo which can auto-generate the pdrive out of your Arma pbo's

digital jacinth
#

mikeros tools are no go for me as my AV just hates the thing to hell and back. I pack my ragdolling mod with mikeros on linux because of that

still forum
#

Just switch to Armake :D
I also did that for most of my projects.

#

lookig for a key in the middle of the battle to open the backpack That's not how that works.
Backpack locking is just a workaround. In Real life you'd say "Hey get your hands of my backpack" and turn away so they can't grapple around in it. But in Arma turning away doesn't do anything.

digital jacinth
#

tbh I do make a check function anyways it will include unconscious state in it, so it is just immediately unlocked if you are knocked out. besides ace medical just gobbles up your own medical supplies like that already

still forum
#

I never had a full dev-env setup like ACE explains it on their wiki. Never needed it

late gull
#

i do understand, but in my opinion it's not a necesary thing :p

#

dedmen do you mind on check an addon i made?

still forum
#

no I don't mind

digital jacinth
#

hold up, is it possible to overwrite ace functions in missions? that backpack locking stuff already works on my end and ti would fit just too well into the existing onOpenInventory function.

still forum
#

not really no

#

Why don't you just integrate it into it?

#

Just do it without dev-env and don't test it πŸ˜„

digital jacinth
#

sure I will first just get it feauture complete

still forum
#

I can create a build for you if you need it

digital jacinth
#

i mean if you drop the thing I want the lock to be turned of and all that, so every time you pick up a backpck you need to lock it again

#

expect like some github upload in the next our of the POC

waxen tide
#

@digital jacinth The entire AV industry is largely a scam. It's not possible to actually make working, effective AV software.

digital jacinth
still forum
#

are you waiting for inventory display to open?

#

I thought returning true would prevent that

digital jacinth
#

I took parts from the vehicle lock function, I returned true, but the wait and execute function still worked. So I believe the display has opened

#

the condition !isNull (findDisplay 602) returned true, that is why i think so

still forum
digital jacinth
#

dunno, i am using the cba xeh tho Extended_InventoryOpened_EventHandlers Maybe there is a difference?

still forum
#

Ah! Yes. I think only the last eventhandler takes effect

digital jacinth
#

reason for me choosing this is because the original backpack EH does use the same, so why not try to get as close as possible before integrating them

still forum
#

What do you mean by "this"?
If it's really only the return value of the last eventhandler taking effect you need to do the waitUntil and close anyway. Because otherwise any mod that adds more InventoryOpened handlers would break it

digital jacinth
#

hmm, looking in the vehiclelock EH again, there there is no true returned, it just does the waitUntil to kill the display (and open up the players inventory)

still forum
#

ah vehiclelock is what you base your stuff on?

digital jacinth
#

I do. I used the parts of vehiclelock as example to close the inventoy

still forum
#

It's a random text every time

peak plover
#

what

digital jacinth
#

ugh did their gitlab just exploited and someone is running their own stuff right now?

still forum
#

no they moved to github

digital jacinth
#

oh

still forum
#

FunFact. ACE_player action ["Gear", objNull] There is also a OpenBag action that does exactly the same as the Gear action.

digital jacinth
#

but yeah, obviously not returning anything and just waiting for the display has obviously the same effect

digital jacinth
digital jacinth
#

uuuh

#

good catch

#

also i forogot to include the script components

still forum
#

for locking/unlocking we'll probably want a icon in the inventory display. Like it was with ACE2

digital jacinth
#

Hm, I'll see what I can do. gotta find the old icon and recreate it then

still forum
#

Why are you setting the locked variable to false always?

#

Why not just keep it nil

digital jacinth
#

dunno really, any real difference?

still forum
#

Ah I see, you set it on the unit

digital jacinth
#

i first wanted to set it on the backpack

#

but then thought about the issues i could run into

#

then i was like "nah, unit is enough"

still forum
#

I don't know if that feature would be worth it.. Set the ownerID onto the backpack. So that you can leave backpacks on ground locked.
But I think that won't work anyway

#

Yeah forget it. That's fine ^^

digital jacinth
#

but yeah, should i set the variable to nil or leave it as false? I am curious about it, I mean i do nil check it anyways everwhere

#

also fixing idents from 2 spaces to 4

still forum
#

my thought was to not transmit it over network if not needed. But I overlooked that the function is only executed if locked==true, meaning it was already transmitted over network

digital jacinth
#

alright updated it with the missing comma, some more translations and the like

#

you sure the macros did not get replaced

still forum
#

"unbinarized"

#

it should do that when it loads it tho

#

can't pack binarized at work

digital jacinth
#

Ah okay will try it out.

still forum
digital jacinth
#

πŸ‘Œ

ruby turtle
#

hello, I have a short question. how is it possible to attach a weapon on a vehicle with enabled simulation so the gun is able to turn and to fire at enemys?

buoyant steppe
#

Well

#

You could attach a remote laser designator

#

Attach an actual gun to that

#

And play with this on the laser designator

still forum
#

He has a static gun. Which falls over when placed because it's not correctly made.
He wants to prevent it from falling over, and wants players to be able to get into it to shoot.

buoyant steppe
#

You know how to look up class names yes?

#

Oh

#

Use this in the editor then

#

Attach the gun to something with disabled simulation

unborn ether
#

Its really better to create own vehicle instead tbh

buoyant steppe
#

Not everyone knows how to model, make textures, animate and write configs 🀷

still forum
#

But it's always good to learn if you have enough free time

lusty canyon
#

why not take an existing static turret, hideselection the weapon, then attach ur own on top?

still forum
#

Do you mean creating a new turret that works. Making it invisible. And then just using the turret he actually wants as a dummy that's just there for the looks?

polar folio
#

sounds like the most amazingly hacky thing ever. i love it!

still forum
#

Well the problem report I got is that he can't turn the barrel of the gun...
This won't really fix it

polar folio
#

does anyone know what exactly makes hideSelection work? is there a hide animation needed inside model.cfg?

still forum
#

No. you need a hiddenSelection.

#

Then you can hide it

#

Guess it just set's it's texture to not render

polar folio
#

ah k

young current
#

hiddenSelections need sections on the model.cfg list

sharp pewter
winter rose
#
[myTerminal, 3] call BIS_fnc_DataTerminalAnimate;```
#

hahaha I redacted this example and it's exactly the one from the page πŸ˜„

digital jacinth
#

@still forum btw I dropped the idea of a PR for ace due to someone linking me this
https://github.com/acemod/ACE3/issues/1840#
Guess the current "shake and zip" sound is this already, thus I release the script just as is.

sharp pewter
#

Thanks Lou, I did see that post but not sure am I suppose to just paste that in init? Do I still need the script? Can I still change the screen Texture?

still forum
#

Don't see why that prevents you from doing a PR?

digital jacinth
#

It sounds like they do not want lockable backpacks to me

winter rose
#

@sharp pewter if you just want to change the texture, I think you can already do that in Eden editor
else, you can setTextureGlobal

sharp pewter
#

@winter rose Ok got the animation to work thanks. Still need to change screen texture to custom ogv . Can you please show example of what i should type in init?? Can't figure out how to do it without using the other script.

halcyon crypt
#

sooo, what was the "proper" way of checking if the player is actually in game?

still forum
#

!isNull player

#

atleast at that point his body is ingame....

#

What is your definition of "in game"

halcyon crypt
#

something about waitUntil { player == player } and some meme about it being the dumb way πŸ˜›

still forum
#

that's just a dumb isNull check yeah

#

but less command calls than !isNull player

halcyon crypt
#

πŸ‘

wary vine
#

I know you can do pip on ctrlSetText but is it possible to do it with structuredText ?

tough abyss
#

Does Anyone know of an AI gear script where I can just put down CSAT units and have the script give them the gear I want instead of manually editing in editor?

inner swallow
#

@tough abyss TMF and F3 mission making frameworks.

tough abyss
#

I can't get a new framework I have to work using the one I'm given

wary vine
knotty sun
#

hey guys, I can't find the error in the following line:

[_veh,["Open BIS Virtual Arsenal",{["Open", true] spawn BIS_fnc_arsenal},[],1,false,false,"","","5"]] remoteExec ["addAction",0,true];```
 for which the RPT log says 
```20:42:29 Error in expression <(_this select 0) addaction (_this select 1)>
20:42:29   Error position: <addaction (_this select 1)>
20:42:29   Error Type String, expected Number```
 isn't the 2nd parameter an array, not a number? πŸ€”
still forum
#

it's complaining about the first parameter

#

No wait!

#

(Didn't BI display a |#| at place of error before?)

#

It's complaining about some entry in the array

#

Why is your radius "5"

#

why would you ever wanna pass a radius as a string?

knotty sun
#

eh that's a good one, that wasn't supposed to be a string

#

unfortunately that's all the RPT has to say about the parameters

still forum
#

If only we had a debugger .......... πŸ‘€