#arma3_scripting

1 messages ยท Page 501 of 1

still forum
#

class RscText it's there

#

if you have the defines before your gui class that uses it. Then it'll work

frigid raven
#

meh sry forgot something

#

ur putting me under pressure u know

#

ok works now. Is this the proper way to do this?

#

Or shouldn't just put the declarations on top of my gui.hpp

#

for those classes I am in need there

astral tendon
still forum
#

you can split things into include files all you want

frigid raven
#

yea just was curious if this is a best practise

#

nvm it works now I gonna commit push n sleep now

#

what a day

still forum
#

Wanna remove a specific backpack from a cargo container? Sure!
_veh removeBackpackCargoGlobal (firstBackpack _veh)
\(O_O)/

tough abyss
#

No but I want nametags on backpacks damn it!!

#

I didn't remember how much I missed this feature until now.

still forum
#

๐Ÿค”
I wonder if you can put license plates on backpacks

#

backpacks are vehicles that you wear on your back. And vehicles can have license plates ๐Ÿค”

tough abyss
#

What is this, a work camp? We can't just have numbers smh

still forum
#

license plates are letters and numbers

tough abyss
#

Yeah I realised that halfway through writing my comment. Still though I honestly wouldn't mind having license plates glued to backpacks, as long as it means I can find my own. The feature is most needed in vehicles however, when there's 3 a-bags in the hmmwv and you don't know which one in yours :/

still forum
#

Oah.. Good idea

#

Never actually used license plates yet.. I really should

tough abyss
#

I name VBIEDS creative shit so the players have some way of spotting them.

astral tendon
#

@still forum

oldclass = " 
"; 
{ 
newclass = format ["  
class %1   
 {  
 name = '%1';  
 sound[] = {'dub\%1.ogg', 1, 1};  
 titles[] = {};  
 };  
",  _x]; 
oldclass = newclass + oldclass; 
} forEach [ 
"CmdR535", 
"Play035", 
"CmdR536", 
"Play227A", 
"PLay037", 
"RngA534", 
"Play752", 
"CmdR539", 
"Play753", 
"PakL011", 
"Play846", 
"Play847", 
"Play759", 
"RanB025C", 
"RngA081B", 
"RngA078B", 
"CmdR560", 
"PakL015", 
"CMDR550", 
"PakS020", 
"PakS022", 
"PakS021", 
"RngB528", 
"RngC511", 
"CMDR540", 
"CMDR541", 
"CMDR542", 
"PakL014", 
"CMDR546", 
"CMDR545", 
"Play849", 
"Play848", 
"PakL006", 
"RanB038b", 
"RngA535", 
"RngA533", 
"cmdr538", 
"play859", 
"cmdr549", 
"cmdr548", 
"Play867", 
"PakL506", 
"CmdR547", 
"Play761", 
"Play236C", 
"PakL008", 
"CMDR544", 
"PakL503", 
"Play218A", 
"PakL502", 
"RngC512", 
"Play760", 
"RngA532", 
"RngB530", 
"Rngc513", 
"RngB529", 
"RngC514", 
"RngB531", 
"10mt024F", 
"CmdR565", 
"RngA114D", 
"CmdR531", 
"CmdR564" 
];

Your command did not worked but that did lol, that is the level of my laziness, just have to change the quotes with another app.

still forum
#

that is not a config. And my thing was not a command. And yeah I forgot the dub\ subfolder and the .ogg at the end
Please don't paste so excessively large things. You can cut down the array to 1/3rd of the size to still get your point across without spamming the channel

astral tendon
#

Can I set as a spoiler?

still forum
#

And no. You shouldn't need to change the quotes. Config can take single or double quote

#

no discord doesn't have spoilers

tough abyss
#

you can use stuff like pastebin, codeshare, or github and link code if you want to send > 50 lines.

astral dawn
#

I was tired of typing private all the time so I invented this :D
#define pr private

still forum
#

XD

eager prawn
#

Man invented fire < Sparker finds #define

still forum
#

why not something C# or C++ like var/auto

#

to show that it's a variable declaration

eager prawn
#

Now I need that meme with the various brain sizes

astral dawn
#

Hahaha yes

#

well it saves me 5 keystrokes every time I declare a variable

astral dawn
#

hmm what if... #define s select ๐Ÿค”

still forum
#

if you have a bunch of selects you are doing it wrong anyway cuz params

astral dawn
#

yeah params is great

frigid raven
#

Does anybody know how to access the object synced to a module within a module function?

#

or at least a reference to a better guide/tutorial

twin steppe
#

I'm trying to create a invisible wall for a structure that is missing collision. I'm using a VR block but I don't know which texture to turn it invisible so it's not seen clipping through the structure thats missing collision. Does anybody know how I can turn the VR block invisible?

winter rose
#

@frigid raven try looking for synchronizedObjects or something of the sort (sorry, not on my PC right now)

frigid raven
#

Yea you are right - I thought it is something special with modules at first

still forum
#

@twin steppe you can turn it invisible, but it will still have collision.
I can make you a collision-only invisible wall 3D model if you need. Tell me the measurements

twin steppe
#

Thanks for the quick reply. I only need to turn the VR block invisible, the collision needs to stay for it to work. I'm using the VR block so I can walk on the structure that is missng collision. I can't use any mods or custom user made textures.

west venture
#

HideObject - there's a button for it in the object attributes. Special states.

twin steppe
#

Doesn't seem to work on the VR Block. Maybe the VR block is the issue. One moment.

#

My bad. I was doing it wrong.

#

Thank you @west venture

#

Ah sorry no, I just realised that HideObject removes the collision as well for the VR block.

west venture
#

Well, I'm pretty sure there's an actual invisible wall block. (yes there is)

twin steppe
#

Sure

#

but that object is fairly small, and it'd take hundreds of them to cover the structure.

#

If only it was an actual texture so I could make the VR block invisible.

still forum
#

you can turn it invisible, but it will still have collision. Duh. Brainlag. I meant to say "but it will also disable collision"

twin steppe
#

well shit

still forum
#

As I said. I can make you a simple box model as invisible wall. You can place it in mission via simpleObject.. somehow

keen bough
#

When i have the variable "variable = 1" exacly as it is, within init.sqf, is it aviable on all machines and server? Or only on the server only? Currently i used one publicVariable addition to make a variable available on all machines and 1 publicVariableServer to make one available only on the server (cause its only needed there)

Question stand:
Is a variable set in init.sqf (example: myVariable = 1;) global and available or not? Thanks in advance :3

still forum
#

init.sqf is executed everywhere

#

if you set the variable everywhere. It's gonna be set eveywhere

keen bough
#

Alright, thank you @still forum I was a bit unsure about it. I want to have all debug-triggers and the autosave-mechanism within the init because for me its the first place to go to check on things.

#

Another Question in Advance because i am stepping towards function writing.

I have written a function that, if executed, gives me a list of cities within a variable, a random city within a variable and the nearest city within a variable.

Are those variables saved within an array automatically and can be extracted with "_this"? Or do i have to extract the informations from the function, and if so, how do i do it correctly, please?

#

Currently i think i would do it like this
"variablename = runFunction"
array 1 = variablename select 0;
array2 = variablename select 1;
array3 = variablename select 2;

Would this be correct?

still forum
#

that would be correct yeah

#

you can use params to make it easier and better to read

keen bough
#

I dont understand "params" fully yet. I re-read it again and do i have to use them within the function or outside when i call the function?

And another Question: Should i write a single function that does everything city related (neares, furthest, random select, list of all) or should i do them in seperate function? Whould there be any benefit if i do it all in the same function or in seperate functions?

short trout
#

Params command can be used in 2 situations:
A) to parse _this into private local scope variables with or without default value
B) to parse any given array to private local scope variables

#
  1. BI often uses modular all-in-one function, so i guess it depends mostly on what you like to maintain - bunch of easily readable functions or single piece large stack of code
still forum
#

seperate functions are easier to read and maintain

#

a "function" should do one specific thing. Not a dozen

short trout
#

But sometimes you may need some sort of similar wraps and it's easier to get all-in-one wrapper function that call specific functions with some specific parameters but you will use single function to access all wraps by changing input parameters

keen bough
#

thanks guys and very interesting. I currently write on the basic server-side functions for my mission-templates. One small step after another :)

The most intense part will be the predefined positions so no strange placement should happen. And for every possibility. That will be loads of work.

dusky pier
#

is possible to simulate mouse button click?

still forum
#

no

twin steppe
#

@still forum You said you needed the measurements to create this invisible 3D wall? I'll be spawning this bunker in on a server with other clients, so it'd have to work on multiplayer. The measurements for the VR Block I'm using is "10.5x10.5x9" the name of the block is "Land_VR_Block_04_F"

cosmic root
still forum
#

Well it's nice that you can give me the measurements of the VR block.
But I asked what size you need. And if you need a wall, I don't think you need a cube with same side lengths

twin steppe
#

@still forum The structure that needs collision is "Land_GH_Pool_F" on the sides. I don't know how I would measure it exactly so I just gave you the VR Cube measurements I've been using as collision, which works fine, it's just that its white and not invisible.

#

So one side of the cube measure wall I suppose

keen bough
#

I seem to cant find it somehow or i may use the wrong search-syntax. How can i tell a virtual arsenal (BI-Arsenal) that there should be a limited amount of an item? Like "You can have 10 magazines of ammo and 1 weapon of that kind as well as 3 grenades."?

All i can find states that it can be only added or removed but not told the amount. Or do i have to write an own arsenal?

#

Found: There is no vanilla way. I have to come up with my own solution.

pure blade
#

yeah, but can edit the vanilla arsenal, you don't have to create a completely new one

keen bough
#

Good to know, probably one of the last things. I want to make a temporary solution. Any way i can increase the inventory space of an item without modding a completely new item somehow?

pure blade
#

i don't think so

astral dawn
#

Well you can take the arsenal from Antistasi. It's a modified virtual arsenal which supports fixed amount of items. @keen bough

keen bough
#

I highly dislike the antistasi-arsenal. All honor to the one who made it, with its functions and all... But its really not what i want, actually ^^ Also, i dont wanna use the complete work of others in my scenario(s). Except help from people ๐Ÿ˜ƒ

astral dawn
#

Wow why don't you like it? O_O

#

Well by the amount of code in the repo you can judge how much it would take to redo it yourself... because you will also need to maintain the multiplayer synchronization of items, you know

#

I think it's about 3k lines of code total, or more

#

I talked to the author... he's fine if the code is used by someone else if it bothers you ๐Ÿ˜ƒ

keen bough
#

Na, i just want to create everything by myself, the way i want it - as much i would like to use others work. That would have a ... hm, hard to explain. It would feel just not good to sit there and say

"This is such an awesome scenario and all. Yeah i write ever.... well i wrote most of it all by myself. Except for the arsenal, there i was kind of lazy and copy pasta" kind of :3

astral dawn
#

๐Ÿคท honestly I feel like the feature to limit the amount of items in the arsenal should be in the original game itself

#

as well as other things related to inventory

keen bough
#

Yep. Or the possibility to change a huge box to "Fit everything in there what you want."

#

But i sit here... We came up with a Truck full of Weapons, Items and more. We unloaded it into a big box and it was full so fast, we were stuck and still had a lot of stuff that was still on the truck

#

god, i write so bad O_O

astral dawn
#

probably you would have to create an addon, where you would have to inherit from the box you want but change its capacity

#

but i never did addons so i might be wrong

#

but if you move an item into the cargo of your box through script, i think it will ignore the free space of the box

keen bough
#

yep.

#

<DING> idea ^^

#

<dong> bummer...

wary vine
#
[
    ["custom category 1", [],
        []
    ],
    ["custom category 2", [],
        []
    ],
    ["item", [
        ["map", [],
            ["itemMap"]
        ]
    ]],
    ["helicopter", [
        ["B_Heli_Attack_01_F"]
    ]],
    ["car", [
        ["C_Hatchback_01_F"],
        ["C_Offroad_01_F"]
    ]]
]
``` quick question, if I wanted to create a tree based on an array like this, best way of auto generating the tree without a huge file for hardcoded entries
peak plover
#

yea

#

There is a way

#

Where there's a will, there must always be a way

pure blade
#

lol?

astral dawn
#

@wary vine What exactly do you want? You have to specify the content anyway, as well as relations of nodes of your tree, somewhere in some file anyway.

pure blade
#

i don't understand you, do you mean how to add items in these array or what?

wary vine
#

i want to generate a tree list based on an array like this,

#

that will generate new subcategories as added

astral dawn
#

Well you can probably check any C implementation of a tree

#

So your every node is a structure like this: [ID(text or number or whatever), data(anything), subnodes(array with other nodes)]

#

then you can abuse the fact that all arrays in SQF are actually used by reference, not by value

#

if you need to modify data of some node

wary vine
#
[
    Category 
    [Either SubTree or ItemList] // trying to make this expandable 
]
restive leaf
#

Use classes?

astral dawn
#

if the depth of your tree is fixed (like category and subcategory) then it can be even simpler

wary vine
#

I have pulled them from a class already to sort them

#

its not fixed, thats what im trying to get past

restive leaf
#

E.g. from vanilla Epoch's loot table definition: hpp class Generic { items[] = { { { "ItemDocument", "magazine" }, 5 }, { { "ItemMixOil", "magazine" }, 4 }, { { "ItemCoolerE", "magazine" }, 6 }, { { "CircuitParts", "magazine" }, 8 }, { { "Repairs", "CfgLootTable" }, 7 }, { { "Towelette", "magazine" }, 14 }, { { "HotColdPacks", "CfgLootTable" }, 9 }, { { "PaintCans", "CfgLootTable" }, 9 }, { { "Sodas", "CfgLootTable" }, 8 }, { { "CanFood", "CfgLootTable" }, 8 }, { { "Primitive", "CfgLootTable" }, 21 }, { { "lighter_epoch", "magazine" }, 1 }, { { "Seeds", "CfgLootTable" }, 1 }, { { "ItemAluminumBar", "magazine" }, 2 }, { { "ItemCopperBar", "magazine" }, 2 }, { { "ItemTinBar", "magazine" }, 1 }, { { "ItemCanteen_Dirty", "magazine" }, 5 }, { { "ItemCanteen_Clean", "magazine" }, 1 }, { { "ItemBottlePlastic_Dirty", "magazine" }, 5 }, { { "ItemBottlePlastic_Clean", "magazine" }, 1 }, { { "ItemFireExtinguisher", "magazine" }, 1 } }; };You then need the code to interpret

#

Entries with "CfgLootTable" are your Subtree

wary vine
#

its already pulled from the config

restive leaf
#

Then I still don't exactly understand what you are looking for...

peak plover
#

@wary vine I can't find it, but I had a script for exporting configs like that

wary vine
#
            items[] = {
                {"SUBCATEGORY", {"Items"}};
                {"SUBCATEGORY", {"SUBCATEGORY", {"Items"}}};
                {"SUBCATEGORY", {"SUBCATEGORY", {"SUBCATEGORY", {"Items"}}}};
            }
peak plover
#

Just use line breaks etc and you can use sqf to copyToClipboard or write into rpt

wary vine
#

this is then turned into a sorted array.

restive leaf
#

The Epoch example above is converted into a weighted array...

peak plover
#

I don't see why you would need classes

restive leaf
#

Manipulation in general

peak plover
#

Is it something you can't do with a normal array / variables?

restive leaf
#

It's sort of like the difference between arrays and hashes in RL programming tbh

peak plover
#

unrelated

Result:
0.001 ms

Cycles:
10000/10000

Code:
call {
systemChat (selectRandom ten_arr);
};
Result:
0.0067 ms

Cycles:
10000/10000

Code:
call {
systemChat (selectRandom ['test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test']);
};
still forum
#

yes. creating arrays is expensive

#

creating array is essentially
push value
push value
push value
make array of last 3 elements

peak plover
#

I've been doing it wrong the entire time, especially for recursive and fast events

still forum
#

If you had my SQF optimizer that would optimize it down to
push finished array.
Done.

#

You can compare it to player being slower than storing it in _player and reusing the variable
Well not really.. But..

peak plover
#
Result:
0.0009 ms

Cycles:
10000/10000

Code:
systemChat str ten_player
Result:
0.0011 ms

Cycles:
10000/10000

Code:
systemChat str player
#

It makes sense

#

Although it's micro

still forum
#

and with global variables the effect isn't as noticeable as with locals that are in a very close scope

dusky pier
#

is possibe to move listbox sider? or is just part of listbox ctrl?

elder karma
#

So total newb question but: how would one script a set-up in the scroll wheel for an arsenal box to give a pre-made kit?

#

Like say for instance I wanted it so a player could come up to a limited arsenal and instead of referencing a long list of required things they could see something that was like, "Warrior IFV Crewman"

#

And clicking on that would give them a certain uniform, helmet, some extra bits like eye-wear stowed in a bag maybe, etc.

astral dawn
#

Adding an action to an object is done by addAction command

#

The rest is done with commands like addMagazine, addHeadgear, etc

delicate lotus
#

Hey, I was looking around in the offical missions and saw that they use a missionFlow.fsm which is never executed anywhere in scripts. Is the file "missionFlow.fsm" automatically executed upon mission start by the game?

elder karma
#

@astral dawn so would it be something like addAction "AR, T-Shirt" and then just indent from there with Remove etc, etc, etc?

#

I'm fairly new to how to program and script things in ARMA.

astral dawn
#

Well did you ever program anything else?

#

Because there are different things to know, 1. programming in general 2. arma-specific things

dusky pier
#

is possible to change unit name (defined in mission.sqm)?

elder karma
#

I once played with C++

#

My main focus is just, in this case, ARMA

#

And its nothing too fancy. Just loadouts.

#

I just want it set up so they might get a list like:

Clear Loadout
Rifleman (Rolled)
Rifleman (Sleeves)
Rifleman (Tee)
Arsenal
etc.

Where Clear Loadout puts them in an unarmed and fairly standard outfit with some things like map tools and the like in a uniform and the other options lead to pre-sets. And of course Arsenal leads to a limited arsenal so if they want something like more ammunition or whatever they can get that.

astral dawn
#

well... you can do it in two steps:
prepare the files to set the specific loadouts you want
then make a code that adds the action to the box with addAction

#

also note that addAction must be done globally with JIP flag, you can do it with remoteExec

short trout
dusky pier
#

@short trout thank you!

dim owl
#

hey guys, do you know where the eventhandler for the multiplayer join buttton is set?

astral dawn
#

What do you want to achieve? Do you want to see people in the lobby?

dim owl
#

no, i just wan't to know how arma handles the connection and i want to restyle the display a little bit

astral dawn
#

AFAIK the lobby is not part of the scenario and you can't change it much

#

which display?

#

do you mean the display in arma's UI terminology like control, display, etc?

dim owl
#

i mean the multiplayer display. like adding a button which says directly connect to our server

astral dawn
#

SO I install your addon, launch the game and I see a button which says 'connect to server XYZ' right in the main menu of the game or somewhere around it?

dim owl
#

yeah

#

and for this i wanted to know how arma handles the connect thing

astral dawn
#

I'm not really sure but I guess it's so deep in the engine that you can't alter it at all OR you can't alter it without serious work with addons.

dim owl
#

I found where the eventhandler for the tab menu on the top in the multiplayer is set. But i cannot find the eventhandler for the listbox or the button

delicate lotus
#

Hey, how can I print subtitles, like the ones in the tac-ops campaigns, on the screen?
Example Picture of such subtitles: https://prnt.sc/lmrhin

still forum
#

That might be the engine side subtitles. That belong to the voice lines

delicate lotus
#

huh. Well I also played the Jet Showcase again today which uses kbTell and the Conversation stuff and it did not have such subtitles

short trout
delicate lotus
#

but I guess my best bet is to just dePBO some tac-ops missions and see how they did it..
But before that I check out Dusins link

#

well... that is animated...

#

the subtitles are static nvmd... I saw that you can change it to be static

still forum
#

kbtell's text should be doing that.Maybe jet showcase doesn't have text for the lines

short trout
#

the subtitles are static
and someone forces you to use optional parameter?

delicate lotus
#

yeah I didnt saw that oof

#

Hmm... maybe the tac-ops campaigns are using BIS_fnc_kbTell?

keen bough
#

The code's only missing the inidbi to read something. Thats no problem. But is the code correct otherwise?

weaponBox addWeaponCargoGlobal [_weaponName,_weaponAmount];
            _readLimitedWeapons =
            _limitedWeaponNames = _readLimitedWeapons select 0;
            _limitedWeaponAmount = _readLimitedWeapons select 1;
            _newLimitedWeaponNames = _limitedWeaponNames pushBack _weaponName;
            _newLimitedWeaponAmount = _limitedWeaponAmount pushBack _weaponAmount;
            _newLimitedWeapons = [[_newLimitedWeaponNames], [_newLimitedWeaponAmount]];
still forum
#

@keen bough no. Line 2 is syntax error

keen bough
#

line 2 is just missing the code to read from the inidbi, i have to create it. That can be ignored ^^

delicate lotus
#

hmm could be Dedmen...

#

gonna check it out later

still forum
#

pushBack returns nil

#

So you'll have an array with two arrays that each contain one nil at the end

keen bough
#

really? even if the _variables have something in it?

still forum
#

Okey no. it returns a number

#

The index of the inserted element

#

But your code doesn't sound like you want a number there

delicate lotus
#

This might be a dumb question but I can not use kbTell to just display text, so without audio, right?

keen bough
#

this is the full script here:
https://pastebin.com/7i1qQh4k
@still forum

So maybe there was just a misunderstanding ^^ I want to create again the array to save it like it was [weapons],[amount]

still forum
#

pushBack modifies the existing array

#

it doesn't return a new one. It seems like you expect it to return a new one

keen bough
#

oh, do i have to use "+" instead?

still forum
#

If you want a copy then yes

#

I have no idea what you are trying to do

#

you are defining that variable and then you throw it away. Your code does nothing

#

why are you using a for loop? Your code looks like you are trying to use a forEach instead?

keen bough
#

when i use getStuffCargo i get an array like [stuff1, 2, 3, 4],[amount1,2,3,4] and i save it that way in the database. to add something to it, i split it up into two seperate arrays and want to have a new one exactly as the first one, except the new stuff added.

still forum
#

how about just appending to _readLimitedWeapons instead of trying to copy it?

keen bough
#

i dont understand appending, could you explain it to me please?

still forum
#

remove the last line. And the assignments of the pushBack return values.

#

pushBack is modifying the existing array

#

you are appending your stuff into _readLimitedWeapons variable

delicate lotus
#

I just noticed that the tacops missions are in an .ebo file...

#

well... guess no learning today then

keen bough
#

i still seem not to understand it @still forum Could you show it to me eventually so i could learn, please?

still forum
#
_readLimitedWeapons = [[1,2], [1,2]];
_limitedWeaponNames = _readLimitedWeapons select 0;
_limitedWeaponAmount = _readLimitedWeapons select 1;
_limitedWeaponNames pushBack 3;
_limitedWeaponAmount pushBack 4;
//_readLimitedWeapons is now [[1,2,3], [1,2,4]]
keen bough
#

Ah, so i cant use variable = this pushBack that?

still forum
#

sure you can

#

but variable will be a number then

#

not the array

delicate lotus
#

pushBack just adds Array A to Array B

still forum
#

no it doesn't

#

Value A to Array B

delicate lotus
#

oh

still forum
#

what you said is append

keen bough
#

OOOH

#

i have to use 'append', right? So then it would work?

delicate lotus
#

well, let me rephrase it: It adds value a to array b. The value returned is the index it was added. The old array is modified. No array is returned

still forum
#

append is different than pushBack

#

I have no idea what you need

#

but from your code. pushBack seems to make sense

#

you have an element that you want to append
Not an array.

keen bough
#

I extract the data from my database, which comes out:
_oldstuff = [["stuff1", "stuff2"], ["amount1", "amount2"]];
And i have in the loop a new stuff-name and a new stuff-amount.

still forum
#

yes. I can see your loop

keen bough
#

and at the end, i want to have a new array like _oldstuff but with the new items in it so i can write it again in the database.

still forum
#

yeah. But I don't see why you'd have to copy it

#

modifying the existing one. And then writing it back seems fine to me

keen bough
#

can i do that? Without splitting the array up? I am very unsure about that topic because i am still learning :3

still forum
#

I just showed you how

#

last code snippet

keen bough
#

i look again into it.

#

Okay, but dont get angry with me. I dont understand why it behaves like so. I dont understand how the final result comes to that. Could you, if you still have the time, explain it to me further what each step does, please?

still forum
#

well.. pushBack appends to the array.

#

That's... Literally it.

#

And because it appends to the existing array... That's how the final result comes to be

#

_limitedWeaponNames points to the first array in _readLimitedWeapons

keen bough
#

OOOOOH! Now i get it!

#

You tell it "you are array 0" and the other one "you are array 1" and then you can use pushback to modify the existing array, so i would save up a couple of lines of code

#

and instead of _limitedweaponnames pushBack 3, i could use _weaponname from the weaponBox, right?

delicate lotus
still forum
#

ye

keen bough
#

thank you for so much patience with me @still forum :3 If we ever meet somehow, first and last drink is on me ^^

dim owl
#

@still forum Do you maybe also know an answer for my problem?

still forum
#

no

#

If I did. I'd have answered

dim owl
#

hehe yeah okay

delicate lotus
#

I just tested BIS_fnc_showSubtitle and it is exactly what the tacops campaigns are using

#

nice

#

and it even accepts color coding

still forum
#

@twin steppe
_cube setObjectTextureGlobal [0,"#(rgb,8,8,3)color(0,0,0,0)"] should be invisible with collision

keen bough
#

[merc_arsenal_box, [_weaponName]] call ace_arsenal_fnc_addVirtualItems;

I want to put it into a remoteExec. I thought of this:
[[merc_arsenal_box,[_weaponName]] remoteExec ["ace_arsenal_fnc_addVirtualItems", -2, true];

Would that be correct?

still forum
#

Why do you want to put that into a remoteExec though?

keen bough
#

because if only executes on the server or on one client, nobody else gets the ace arsenal update(s). Testet it, it needs to be run on every client but not on the server actually.

still forum
#

Why not just use the global parameter then

#

it does exactly that

#

And yeah. not on server makes sense. The server cannot open a arsenal. He doesn't have neither UI nor consciousness

keen bough
#

<whispers> sometimes i think the server can hear me and kills me on purpose on over 1,5 kilometres away while in thick bushes.

#

how to i write in the boolean of adding it globally? Like so:
[merc_arsenal_box, true,[_weaponName]] call ace_arsenal_fnc_addVirtualItems;

Or so:
[merc_arsenal_box, [_weaponName], true] call ace_arsenal_fnc_addVirtualItems;
?

#

i thought of second, because the boolean of global is third in place

still forum
#

Click the link I sent

#

yes.

keen bough
#

yeah, i am looking at it.

still forum
#

third argument. Usually has to be put into third place to work

#

third argument in second place doesn't make sense

keen bough
#

thought so, i just want to be very sure. Because i learned a bad habit already that i put down again.

#

i put everywhere like "isServer" stuff and wondering why dont stuff gets executed on clients... -.-

#

Thanks for so much help @still forum I hope you're appreciated by many peeps you help out. How long did it take to earn so much knowledge about scripting/programming?

still forum
#

I really only started with Arma stuff early 2016.
Programming I started when I was 12

keen bough
#

huge background i think. Good choice :3 World gets more technological with every day. Programmers will always be needed. Thanks again for your help and advice. I make sure you get the right appreciation from me in my mission ^^

devout stag
#

Quick question about notifications, how does this line in a notification color[] = {1,1,1,1}; change the color of an icon?

#

And can you change the icon picture on a per-side basis?

void ivy
#

I believe thatโ€™s rgba (red-green-blue-alpha) format

#

alpha controls opacity

#

everything I believe is scaled 0-1

young current
#

0 == 0 and 1 == 255

cunning crown
#

Hey, I've a question: I'm trying to make an anti-teleport, it's working great for detecting but I've one problem; I want a global message sent to all player with the name of the hacker but it doesn't work or it juste put the client name eg:

  • Imacker is teleporting --> He's detected
    But when it comes to the message, each client will have a different message with their own name instead of the hacker name (or 'any' in that version of my script).
    Here is the code: https://pastebin.com/HS2m2VHv
    Not asking for the solution but is there any links where I can find some info?
still forum
#

for one. Don't use global variables there

#

you should alwasy be getting "any" but you don't because you do that global var stuff with target

#

make it a local one _target.
And then send it as parameter to BIS_fnc_spawn

#

also use remoteExec instead of the BIS function

#

(format ["Player %1 has been banned!", name player]) remeoteExec ["systemChat"]

pure blade
#

Don't use bis_fnc_spawn or bis_fnc_mp, use the engines based script commands remoteExec and spawn

still forum
#

you first build the string. And THEN send over the finished string

#

instead of building the string on the receiver side

#

the spawn is also nonsense here. Useless. You want to systemChat. So just systemChat directly. No need for a spawn inbetween

#

also you should maybe check if the player is currently in a vehicle

#

and also grab the current velocity of the vehicle

#

If he is in a plane, you'll kick him and wrongly accuse him of hacking

cunning crown
#

Okey, I'll try! Thanks for the advice ๐Ÿ˜ƒ

pure blade
#

hm can a jet travel faster than 180m per second? ๐Ÿ˜„

still forum
#

@pure blade 650km/h is 180m/s

pure blade
#

hm okay its possible ๐Ÿ˜„

still forum
#

speed in m/s is easier.
You can just do
_speed = vectorMagnitude velocity vehicle player
And as you slept for 1 second. The distance travelled should be close to _speed. Because speed is the distance moved per second.

#

Btw also... Scheduled script sleep is unreliable AF

#

A sleep 1 may take anywhere between 1 second to several minutes

cunning crown
#

so I should use uiSleep instead?

still forum
#

no. Exactly the same

#

and kicking someone for moving 180m in a couple minutes is not good ๐Ÿ˜„

pure blade
#

so don't fly to fast, or you will be kicked

still forum
#

Just measure the time

#

grab the time using diag_tickTime before and after the sleep.
Then you can do _expectedDistance = _speed * _elapsedTime;

#

And then just check if actual distance is like.. within 100m of expected

peak plover
#

speed doesn't work when drifting, going sideways etc.

still forum
#

Well.. You won't be going sideways for several hundred meters

#

neither drifting

cunning crown
#

Okey so everything is working great so far but when testing different ways of "speed hacking", if we use setAnimSpeedCoef (even if this is not really teleporting), it bypasse the system (Here is my code: https://pastebin.com/DTpjhB4Z ). Also how do I use remoteExec to execute code since I'm not using any functions? The only example where I see code is using BIS_fnc_call...

pure blade
#

if you don't use setAnimSpeedCoef on your own you can disable this command in CfgDisabledCommand

still forum
#

you can remoteExec call or spawn to execute code

#

remoteExec can execute commands.

cunning crown
#

So something like that: remoteExec ["spawn {myCode}"];?

#

Or [{myCode}] remoteExec ["spawn", ...]?

pure blade
#

โœ…

still forum
#

you can refer to the remoteExec wiki page

void ivy
#

@still forum guess youโ€™ve never seen my flying then.

#

I fly sideways all the time.

#

Not as uncommon as you might think

keen bough
#

can i do a pushback on dual-arrays? Like i have
_var1 = [["1"],["1"]];
_var2 = [["2"],["2"]];
_var1 pushBack _var2
And get the result on the new _var1 like
_var1 = [["1","2"],["1","2"]];
?

keen bough
#

Forgot i can test thing directly in arma 3 ^^ No it wont work.

runic surge
#

Would it be possible to get a list of all models in an addon or addons so I can copy them to the clipboard?

#

I see how it could be done with models that have actual config classes but for ones without them?

young current
#

probably configless models cant be looked up in game

#

if they are not on the map already

runic surge
#

I suppose I could just try to create a .p3d file list in windows

keen bough
#

Ooof. I am done with the check-stuff for arsenal script XD It was what? Nearly 2 weeks? But i am proud. Everything looks very rough and has freaking sharp edges but everything works like a charm. No error, fully documented.

Tested it dozen times and more and there arent any possibilities that something could screw up.

civic pine
#

any idea what causes a player to not be able to access their scroll menu after using an addaction for a player attachto?

short trout
#

after using an addaction for a player attachto?
give us some details (code) plz

civic pine
#

mount.sqf

boat1 = boat1 +1;
private _coords = [];
switch boat1 do {
case 1 : {_coords = [-2, 4, -2.6]; };
case 2 : {_coords = [-0.4, 4, -2.6]; };
case 3 : {_coords = [1, 4, -2.6]; };
};

player attachto [b1, _coords];```

init of the vehicle (variable b1)
```b1 addAction ["<t color='#04ff00'>Mount Up</t>", "mount.sqf", nil, 1];```
#

once the player is attached to the vehicle, they no longer can access their scroll menu

slow elbow
#

Hey hopefully a quick question. How do i determine whether or not an attachment is attachable on a given weapon, based on the weapon classname?

Example of how i want it to work:

_some_Function = {
 _classname = _this select 0;
_attachment = _this select 1;

//Test if _attachment fits on weapon _classname
If (_attachment isAttachable _classname) then exitWith {true};
};

if ( Call ["weapon","attachment"] call _some_function) then {
    AttachToWeapon 
};

Obviously very loose syntax XD

cosmic lichen
#

If (_attachment in (_weapon call BIS_fnc_compatibleItems)) then {...}

slow elbow
#

Awesome, thanks mate.

#

See this is what i mean, i could have been looking for hours, trying to find this. But you bunch of genius saved me that time! ๐Ÿ˜

keen bough
#

<rattles the donation mug> ๐Ÿ˜„

cosmic lichen
#

@slow elbow I knew there was a function or that but didn't remember its name. Had to do some quick research myself ๐Ÿ˜ƒ

slow elbow
#

@keen bough Sure ๐Ÿ˜ƒ

keen bough
#

i make sure my next donation to a good cause will be in name of all the arma community ^^ winter games done quick. Cant spent much but hey, i think thats a neat thank you.

short trout
#

Awesome, thanks mate.

Arma Scripting 1โƒฃ0โƒฃ1โƒฃ :

  1. Get an idea/meet a problem
  2. Go to https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
  3. Ctrl + F , search related keywords (e.g. weapon, gun, fire) , check command description
    ???) If not helped -- go to https://community.bistudio.com/wiki/Category:Arma_3:_Functions and do (3) again
    ???) If not helped -- go to https://{my favourite search enging} and search for "Arma 3 how to " + related keywords
  4. PROFIT!!!

"Wow, it's really works!" (c) scriptoKiddy99
"Awesome effect, my init.sqf became three times bigger just in 2 days!" (c)
๐Ÿ˜‹

digital jacinth
#

don't forget to call everything with execvm, even stuff that is called multiple times, best add execvm to the fired eventhanlder and remoteexe that ro all machines.

still forum
#

@void ivy your discord avatar is enough proof that what you are saying is true. Thanks for informing me sir ๐Ÿ™‡

mental dawn
#

I could use some help of you guys knowing ACE functions.
Here's an ACE action I add to a tv object. That works fine so far.

_action = ["ScreenInfo", "Play", "", {some_unimportant_code_here}, {true},{},[],[0.0, 0.0, 0.5]] call ace_interact_menu_fnc_createAction;
[itm_screen_large, 0, [], _action] call ace_interact_menu_fnc_addActionToObject;

But when I try to remove that action again with

[itm_screen_large,0,["ScreenInfo", "Play"]] call ace_interact_menu_fnc_removeActionFromObject;

nothing happens. The action is still there.

What am I doing wrong?

halcyon crypt
#

it seems like your addAction is missing the "path"

#
["VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[cursorTarget,0,["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToObject;
[cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromObject;
#
[itm_screen_large, 0, [], _action] call ace_interact_menu_fnc_addActionToObject;

should be

[itm_screen_large, 0, ["ScreenInfo", "Play"], _action] call ace_interact_menu_fnc_addActionToObject;

I guess

mental dawn
#

The action is supposed to be added at the topmost node which is "[]" in this case. This already works.
The removal is my problem. There the path should be ["ScreenInfo", "Play"] as far as I see it. But that doesn't work.

short trout
#

I feel something wrong with ["ScreenInfo", "Play"]

#

Arguments are:

 * Arguments:
 * 0: Object the action is assigned to <OBJECT>
 * 1: Type of action, 0 for actions, 1 for self-actions <NUMBER>
 * 2: Full path of the action to remove <ARRAY>
#

Maybe "Play" is not needed, cuz your node is [] -> "ScreenInfo"

mental dawn
#

@short trout That did the trick! Thanks man. I was too stupid to see that...

tough abyss
#

Can someone hold my hand? I'm trying to load an external file from the game root folder (with the admin pass inside). I've done:

//adminpass.txt
"password"

//restart.sqf
_pass call compile preProcessFile "\adminpass.txt";
_pass serverCommand "#restart";

//Server config
allowedFilePatching  = 1;
allowedPreprocessFileExtensions[] = {"txt"}; //Lots more in here just didn't want to spam discord with it

//Commandline on server.exe
-filePatching

When I run restart.sqf it finds the "adminpass.txt" because the game prevents me from editing/deleting it in the main directory. It just doesn't work. _pass doesn't get defined.

high marsh
#

@tough abyss tried loadFile ?

tough abyss
#

Yep, doesn't work, neither.. :/

#

It all works in multiplayer but when put on dedicated it doesn't.

wet heath
#

Does anybody know how to Close the Inventory? Normally if it's a dialogue you can just use: closeDialouge 0;

high marsh
wet heath
#

Thanks

copper raven
#

closeDialog 602;

high marsh
#
if !(isNull findDisplay 602) then
{
    closeDialog 602;
};
wet heath
#

Okey, thanks guys ! Will try it now ๐Ÿ˜‰

wet heath
#

I'm trying to fix the dupe-exploit with the inventory when 2 people are near eachother they can dupe. So i'm trying to close the inventory when this happens. I did 3 different tests, not a single time it close the inventory.

#

Can this have something to do with Altis Life that I'm running (v5.0) ?

sturdy cape
#

Ive got a problem in a script.i want something to damage a vehicle when driven over and i added this line to an "if" that's checking for nearentities car ship man etc ///////////////////////////////////////////// if !(isNull objectParent player) then {vehicle player setdammage 0.7}; /////////////////////////////////////////////

#

But it doesnt damage my vehicle

short trout
#

@sturdy cape Try to use (a) debug and (b) not to use OFP commands:

private _veh = vehicle player;
if (player != _veh ) then {
     hint str(typeof _veh ); // Show vehicle type to ensure that script entered if-then scope
     _veh setDamage 0.7; // single _m_
};

(if still no effect - try setHitPointDamage command)

sturdy cape
#

@short trout thanks, will try this

cedar heart
#

how can i loop command on units at trigger? i tried simple way
on activation trigger:{[_x] execVM "mine_field.sqf"} forEach thisList
sqf:


while {alive _d} do {
sleep 1;
mine ="LIB_PMD6_ammo" createvehicle position _d; 
mine setDamage 1
};``` 
but it is not deactivate then units more than one
silent bough
#

Maybe you could use the list of player as argument.

#

Then use your "forEach" inside the sqf.

cedar heart
#

hmm true i will try

still forum
#

@tough abyss what is the content of "adminpass.txt"? of course like.. change the password before showing it.
Why don't you just use loadFile?

cedar heart
#

nvm

quasi rover
#

//cfgFunctions

class CfgFunctions {
    class myTag {
        class myCategory {
            class myFunction { postInit = 1; };
....

// fn_myFunction.sqf

params [ "_mode" ];
switch (_mode) do {
    case "aaa" : {
            .....
    };
    case "bbb" : {
            .....
    };
    case "postInit" : {
            .....
    };

If Fuctions Libraray has postInit attribute, only case "postInit": switch mode(from fn_myFunction.sqf) is excuted on initializing order?

still forum
#

afaik. none

#

postInit shouldn't pass parameters

quasi rover
#

but from BIKI, Passed arguments are ["postInit", didJIP]

still forum
#

yeah

#

So yes. _mode should be postInit then.. Generally. Unless someone modified initFunctions

quasi rover
#

thx Dedmen.

short trout
#

You can put diag_log in the function and try to log _mode variable to .rpt to be sure. (if i understood correctly)

quasi rover
#

Okay, thx.

tough abyss
#

I need help I did a script

still forum
#

๐Ÿ‘

pure blade
#

i did a script too

digital hollow
#

Timmy had a problem with an Arma mission. Timmy decided to use scripts. Now Timmy had two problems with his Arma mission.

void ivy
#

Is there a function to trigger the opening of the inventory of a particular object (e.g. crate) through SQF?

pure blade
#

player action ["Gear", object];

distant egret
#

The '#' (single hash) operator does that add quotes even if they are already present? eg. "foo" -> ""foo"". or does it stay single quoted?

still forum
#

the # operator add's nothing at all

#

It just selects the element from the array

#

it doesn't manipulate the element

distant egret
#

The preprocessor I'm talking about, just tough I should probably ask in config though...

still forum
#

a operator is a function taking two arguments

#

the # in preproc takes just one argument

#

The # does add quotes yes

#

See the CBA QUOTE macro for example

#

it also takes care of double quoting things

distant egret
#

So it can create double quotes?

still forum
#

yeah

distant egret
#

k cool

still forum
#

Atleast I think it does ๐Ÿ˜„

#

Better test before believing me ๐Ÿค”

distant egret
#

k, will do then

still forum
#

I think ace is also using things like QQGVAR in there. Which is a double quoted variable name ๐Ÿค”

distant egret
#

CBA has that just seen, so if they do it it should be possible.

velvet merlin
#

looking for advice on best approach for smooth daytime acceleration - is it via onFrame + skipTime 0.0*1?

digital jacinth
velvet merlin
#

thanks. does this only change daytime (and thus lighting) - nothing else?

digital jacinth
#

well it makes the time go faster, scripts that use uisleep or sleep are not affected

velvet merlin
#

ok cheers! will see how it goes

tough abyss
#

@still forum
Adminpass.txt is just a string with the password. that's the context. I don't want to put the adminpass in the missionfile so I tried making it external and somewhat inaccessible to players.

still forum
#

if it's just the password it surely doesn't work

#

if you want to call it you have to put it in quotes

#

you should really just use loadFile instead

tough abyss
#

I've tried loadfile. It's "password", in quotation marks.. password is the password lol

#

So I edited the file on my server. It worked.
I did```sqf
_file = loadfile "reset.txt";
systemChat format ["%1", _file];

it said couldn't find script, but now I can't eidt the file on my server anymore. Gives me error 500 failed to delete. So it's clearly finding the file and trying to use it but can't. The contents of the file is "test" (without anything else).
still forum
#

so it worked but it didn't?

tough abyss
#

I'm clueless. It's clearly finding the file but it won't work.. :/ It's like it gets stuck loading the file?

#

If someone's able to hold my hand and post a working example I'd appreciate that.

still forum
#

allowed file extensions in server.cfg correct?

#

try \reset.txt

tough abyss
#

I've tried \reset.txt and reset.txt

#

allowed file extensions in my server.cfg looks like this ```
// FILE EXTENSIONS
allowedLoadFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"};
allowedPreprocessFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"};
allowedHTMLLoadExtensions[] = {"htm","html","php","xml","txt"};

I even used a template from the wiki haha
still forum
#

๐Ÿค”

#

Well for me.. I need a pbo file containing the same file on same path.
But other people told me that's not needed so dunno

tough abyss
#

You mean I need to put an empty reset.txt in my mission pbo, or a random pbo in my main directory?

still forum
#

don't know if mission pbo works

#

could

tough abyss
#

So.. what would I name this .pbo?

#

reset.pbo?

#

I'm lost, as you can tell haha

still forum
#

if you wanna try a mod

#

you need a pboprefix

#

put it into a @mod folder just like a normal mod and load it

#

and put your reset.txt into a directory matching the pboprefix

tough abyss
#

Yeah, I was thinking of making a servermod with the adminpass. Just wish it'd work like it should :/

#
_restart = loadFile "@\restartMod\reset.txt";

Just so I don't have to do this a million times again. I do that? Then pboprefix containing restartMod?

still forum
#

the @ woiรถd be wrong

#

remove the @ then fine

#

don't know if mod needs config.cpp with cfgpatches

tough abyss
#

doubt it. I'll try it out.

tough abyss
#

Ok.. so I can't try it out right now becuase I can't change the commandline :/ I'll come back with results later.

high marsh
warm sentinel
#

Will do my apologies, Iโ€™ll delete and move now @high marsh

exotic tapir
#

Hi all, I am a noob at sqf, trying to make a heli land on the carrier with engines off, thing is it takes off again and just hovers? does it not see the carrier as ground or a surface?

young current
#

give it a command to stop and set engines off

exotic tapir
#

would I tell the pilot to engines off or the comand to the airframe?

lunar plume
#

Good evening I work on this http://www.armaholic.com/page.php?id=33051 and I try to donate every 10 minutes of 1200 pieces and make a system to give money between players and to make a cash machine to put away money is it possible

high marsh
#
_pilot = driver (vehicle player);
_pilot action["engineOff",vehicle _pilot]
#

@exotic tapir

#

@lunar plume Please have a read of #rules. You are spamming now.

exotic tapir
#

ty Midnight, may I pm you?

high marsh
#

Sure.

lunar plume
#

I was told to ask my question here

#

Sorry

high marsh
#

If you need help be specific

lunar plume
#

I try to make a system associated with a script that allows you to give money every 10 minutes and place your money as an exile or life in an ATM.

#

Script it is Hals

#

Contact me for Private Message it is facility for me

neon snow
#

The diag_mergeConfigFile command, if the Config.cpp has includes , will they be used?

carmine abyss
#

Is there command to disable VoIP during a mission?

peak plover
#

alt syntax

carmine abyss
#

Ty

wispy kestrel
#

Why does a Killed EH added to a "Balloon_01_water_F" not return the unit that destroyed the balloon as _this select 1 or _this select 2?

_newObject addEventHandler ["Killed", {
          params ["_unit", "_killer", "_instigator"];
          _details = [];
          _type = typeOf _unit;
          _pos = getPosATLVisual _unit;
          {_details pushBack _x;} forEach [_type, _pos];
          targets_ln_1 pushBack _details;
          
          diag_log "======================================";
          diag_log format ["%1 -- %2", _type, _killer];
          diag_log "======================================";
        }];
13:54:49 "======================================"
13:54:49 "Land_Balloon_01_water_F -- 1cb10064100# 164008: balloon_01_water_f.p3d"
13:54:49 "======================================"
peak plover
#

๐Ÿคท๐Ÿป

#

@wispy kestrel You can however add a hit/hitpart on the balloon and save the last damager

#

Or handledamage perhaps

neon snow
#

So , I am changing the config ingame with diag_mergeConfigFile however there are no changes ingame(but ingame Config viewer shows the changes have been made)

peak plover
#

Does anyone use the panels?

#

Like the new gps and stuff

#

I mean custom panels

#

Anyone ever do sth like tht?

still forum
#

@neon snow it will be preprocessed before being loaded. so yes

#

@neon snow "however there are no changes ingame" explain what you expect

lament grotto
#

Anyone know where I can find an example on how to make a ctf gamemode, as in a player runs up picks up a flag which attachs to them then delivers it to a trigger which adds a point.

#

trying to make classic halo ctf, on optre

neon snow
#

@still forum I am trying to tweak particle effects in CfgCloudlets, I change some drastic thin like color, merge it , restart mission and Inge there is no effect until I restart the game and pack the PBO(however the ingame Config viewer shows that changes had been made)

still forum
#

Configs are cached so they don't need to be looked up in configs

#

for example when you create a vehicle the first time, the values are loaded from config into a cache, and the cache is then reused for future vehicles

#

you need to remove that cache somehow. Usually mission restart does it for vehicles and weapons

nova shuttle
#

Hey brainstrust. Quick question with a (I assume) simple enough solution - but one I just can't find. I have a custom animation that runs via a TFAR event handler BUT if that EH fires while I am reloading, it cancels the reload. How can I block reload while the animation is happening? (or not run the animation if the player is reloading?)

astral dawn
#

playMove instead of switchMove?

nova shuttle
#

@lament grotto you might be best to browse for an existing mission like that and reverse engineer - if you're comfortable enough to do so

neon snow
#

Yeah it works great with for example CfgWeapons , make change, save , merge. However that CfgCloudlets for me don't want to do anything. I know it loads becouse game freezes for a second and as said, effects wont change. Is there any other way to clear that cache ?

nova shuttle
#

@astral dawn it is already playMove

still forum
#

I have a custom animation that runs via a TFAR event handler BUT if that EH fires while I am reloading, it cancels the reload
๐Ÿค”
@ornate quail ?

nova shuttle
#

I looked into adding another EH to deal with it too, but there's only an event for Reloaded (past tense)

ornate quail
#

custom animation

still forum
#

Somehow that situation sounds oddly familiar...

ornate quail
#

Yep, sounds pretty much like my code @nova shuttle

nova shuttle
#

@ornate quail whatcha mean?

ornate quail
#

What's the tag in front of the pbo?

#

I'd guess it's neither your custom anim nor is it your code?

nova shuttle
#

@ornate quail I'm on my phone on the couch atm so I don't know off the top of my head - I didn't intend to claim it as my own I really just meant "it's not a default BI Anim". Sorry if that came off wrong. Simply trying to expand my arma scripting knowledge set & digging through stuff is how I like to learn.

ornate quail
#

I have fixed this issue already, it will be out once I have some free time.
Read the licenses of the files you use/edit before doing so.
I personally allow unpacking most of my stuff for educational purposes, but nothing more

nova shuttle
#

Okay understood. Sorry again no ill-will intended @ornate quail. Are you able to explain a little about how you fixed it so I know? I know almost nothing about anims and keen to learn. Happy to move to DM if you want to save clogging the channel.

ornate quail
#

I'll DM you once im home, or we can also continue this here, as some may also be interested

nova shuttle
#

I don't mind either way. Just trying to understand this crazy black magic.

lament grotto
#

so I am trying to add it so when opfor or blufor player respawn they get given a certain loadout. [west, "WEST1"] call BIS_fnc_addRespawnInventory; Using the above how do I get that or CfgRespawnInventory to work or this?

#

or could I do something in the onPlayerResoawn.sqf

keen bough
#

I have "landvehicle" for 'isKindOf' - But i dont seem to finde something for airvehicles and it seems not that it is 'airvehicle'

still forum
#

"air" or "helicopter" or "Plane"

#

you can just look in config viewer

keen bough
#

thanksies, where is the config viewer please?

#

_nearestMercVehicle = nearestObjects [merc_arsenal_box, ["landvehicle"], 25];

can i say ("landvehicle" or "air") to have it both?

still forum
keen bough
#

-.- my eyes, why is everything so small XD

#

okay, got it, thanks ๐Ÿ˜„

still forum
#

you need visual accelerator glasses

#

wait

#

wrong word

#

incrementor glasses

#

no.. wrong again

#

upsizer glasses!

keen bough
#

can i hit you with something? ๐Ÿ˜„

still forum
#

I take cookies

keen bough
#

<hits you with cookies>

ruby breach
#

๐Ÿช

pure blade
#

@lament grotto do you use the respawn menu from bi?

lament grotto
#

not if I can help it

torpid pewter
#

Is it possible to use the debug menu to spawn a crate full of a specific set of gear? I know how to spawn individual objects, but I can't seem to figure out if it's possible to do what I want.

pure blade
#

you can add weapons to a crate with addWeaponCargoGlobal for example

#

@lament grotto i don't understand, do you use or not, because the command you use is only for the respawnmenu from bi

lament grotto
#

I do use it with the respawnmenu but if theres a way to just apply the one loadout for opfor and the one for blufor then I would rather that

pure blade
#

the first parameter is for the reciver (your side) so:

[WEST, inventory] call BIS_fnc_addRespawnInventory; //BLUEFOR
[EAST, inventory] call BIS_fnc_addRespawnInventory; //OPFOR
lone lion
#

How can I apply addAction to a weapon?

#

this addAction [...] doesnt seem to work

pure blade
#

what is "this"?

#

you need the groundweaponholder

peak plover
#

You can't add action to a weapon @lone lion

#

If by weapon you mean ex. mx, katiba etc.

still forum
#

what do you mean by "weapon"

lone lion
#

a rifle i'm making

peak plover
#

You can add an action to the player, which will only be available when the weapon is on the player

lone lion
#

that would mean I'd have to add that action to all players...?

pure blade
#

ahh i thought you mean a weapon on the ground

#

yeah, you can do in the init and you need to fill out the condition parameter on addaction and check if the currentweapon = your weapon

lone lion
#

that would be the init of a unit though?

#

not the weapon

pure blade
#

yeah if you fill out condition parameter

young current
#

@lone lion what do you want the action to do?

lone lion
#

switch between two optics

#

since I cant for the sake of me get the optics class of a weapon to work

young current
#

you pretty much have to

lone lion
#

get it to work?

young current
#

yes

#

hacky method via action is not the way to go here

pure blade
#

yeah then this is the wrong way

lone lion
#

okay

young current
#

what seems to be the problem with your optics?

#

they dont switch or what?

lone lion
#

_o_/ i dont know how to switch between two memorypoints, nor does it even add an action to the menu as the manual suggests

young current
#

there are no optics actions

#

you switch between them with the optics key and ctrl+optics key

lone lion
#

oh "ingame control" means button(s)?

young current
#

yes

#

have you played the game xP

lone lion
#

not really no

#

I've played like twenty minutes of arma3

young current
#

๐Ÿ™ˆ

pure blade
#

lol

young current
#

you should play a bit more

#

helps to understand how stuff works

lone lion
#

no time

#

working twelve hour shifts every day lol

#

and rest of day dont have access to pc so

#

Am I able to access API from the config file? I'd need to load a different a different texture for the scope lens when scoping in

young current
#

optics view can has its own overlay texture

#

that is configured in the weapons config

lone lion
#

I cant use a "2d" texture like a sniper scope

young current
#

yes thats what I meant above

#

or was that a statement not a question?

lone lion
#

a statement

young current
#

a

#

well some scopes in Arma have the scope/ ironsight modes for example

#

that do not have the overlay If I remember right

lone lion
#

this is essentially what im going for

young current
#

yes exactly

lone lion
#

but I will have to overwrite the textures of the scope

#

because normally they have to appear orange whilst in scoped in mode they have to be transparent

young current
#

you may not be able to do that

lone lion
#

no hackish way of achieving this either?

young current
#

well something silly like swapping the weapon in hand along the scope action

#

but thats not realiable in any way

lone lion
#

unreliable as in how?

#

inconvenient is fine

young current
#

you really want to spend a few weeks making a system like that?

#

just to get scope lens color change?

lone lion
#

why would that take long

young current
#

because you have to start from 0 with it

lone lion
#

i've already made another model that's just the scope, with the correct textures applied that would be viewed when scoping

young current
#

it takes so long/longer because you have to ask basically.

lone lion
#

ask what o.O

#

or who

young current
#

you have to ask why it takes so long

#

indicates you dont know what it means to build such a system

lone lion
#

I mean i'm still confused by what you mean by "system"

#

sounds super vague

#

like im not interested in any fancy animations

young current
#

system that saves your weapon state somewhere, swaps the weapon when you use optics and keeps ammocount and such the same, swaps the weapon back and alters the ammo count if necessary

#

stuff like that

#

all tied to the use of optics if that particular weapon is used

#

it is vague because its not anything normal

lone lion
#

alright

#

thanks for your honesty

young current
#

and thats just my theory on how it could work

lone lion
#

I see

#

I'm surprised there's no easy way just to switch the actual model only

#

for a given weapon entity

young current
#

they are 100% tied together

#

the model and the entity

#

another model == another entity

lone lion
#

๐Ÿ˜ฉ

young current
#

dont know any game that would allow swapping of a model of an entity without making a new entity

#

Arma does have swap-able textures but those do not work with weapons

lone lion
#

hmm maybe I havent played around enough with game engines that arent mine

young current
#

possibly

lone lion
#

I was just going to ask "setObjectTextures"? ๐Ÿ˜„ but I guess you answered that already

young current
#

yes unfortunately how the weapon is "attached" to the character (via proxy) we cant access that weapon object via scripts

#

were we able to do so what you want would be trivial

lone lion
#

๐Ÿ˜ญ

tawdry harness
#

Hey, Is at all possible to have a script that checks for for a certain command like !Move but in server Addon?

still forum
#

what is a "certain command"

#

and what is "!Move" ?

slim verge
#

Hi quick question, when returning vehicles and I only have 6 on ther map atm, it returns a count of 235 and includes in the array EXAMPLE.......... [1cfc26b9600# 1780349: grinder_f.p3d,1cfd0ca3580# 1780350: drillaku_f.p3d,1cfd0ca2080# 1780351: extensioncord_f.p3d,1cfd0ca1600# 1780352: hammer_f.p3d,1cfd0ca2b00# 1780353: multimeter_f.p3d,1cfd0ca0b80# 1780354: pliers_f.p3d,1ce478e8b80# 1780355: screwdriver_v2_f.p3d,1ce478e8100# 1780356: screwdriver_v1_f.p3d,1ce478ea080# 1780357: wrench_f.p3d,1cef5cf5600# 1780373: pressurewasher_01_f.p3d,1cdb22f6b00# 1780691: barrelwater_f.p3d,1cdb22f6080# 1780692: watertank_f.p3d,1cf2fe7f580# 1781229: supplydrop.p3d,1cfc47f0b80# 1781263: supplydrop.p3d,1cfc47f6b00# 1781266: supplydrop.p3d,1cfc47f4b80# 1781269: supplydrop.p3d,1cea5952b00# 1781331: land_briefingroomscreen_01_f.p3d,1cea5952080# 1781332: satelliteantenna_01_f.p3d,W_MORTAR_V1,W_MORTAR_V2,1cfbe856040# 1781358: afv_wheeled_01_up_cannon_f.p3d,1cfbe854080# 1781359: afv_wheeled_01_up_cannon_f.p3d,W_HAWK_V2,1cdb2244080# 1780285: heli_transport_01_f.p3d,1cec1d8cb80# 1780957: grinder_f.p3d,1cec1d8c100# 1780958: drillaku_f.p3d,1cfd1c1f580# 178

#

according to the wiki this is incorrect

#

so only odd thing is i have set a lot of these objects as disablesimulation

still forum
#

placed objects are vehicles

pure blade
#

vehicles are not only vehicles, vehicle are objects too

still forum
#

humans are vehicles. Walls are vehicles. Streetlights are vehicles (can be)

slim verge
#

so how do i shorten the array to just cover actual bloody vehicles and not silly objects like a screwdriver

pure blade
#

you must filter your array with isKindOf for example

still forum
#

use allVehicles ?

slim verge
#

isnt listed in the wiki, its about 5 years since i last did any scripting so steep relearn atm

#

is allvehicles still a relevant command its not listed in the wiki

#

/comref

#

seems a bit ridiculous to basically filter from every object on the map or thereabouts to return a list of actual vehicles

still forum
#

oh right

#

I always mess that one up

pure blade
#
(vehicles select {_x isKindOf "AllVehicles"})
slim verge
#

and there isnt a command to return actual vehicles i have to filter all that

pure blade
#

yes i think so, you can use the code above

slim verge
#

ah ok thx so allvehicles returns actual vehicles not static objects (with exception of turrets etc)

#

thanks a lot, it didnt used to be like that bloody BI cheers and thanks very much

#

the code might run a lot faster now ๐Ÿ˜ƒ

pure blade
#

๐Ÿ˜ƒ

slim verge
#

sorted thx

hollow thistle
#

Are curator coefs bugged? I'm doing:

{
    _curator setCuratorCoef [_x, -1e10];
} forEach ["place", "edit", "delete", "destroy"];

I cant edit and place objects but when i try to delete or destroy there is a hint that this action is disallowed but the action happens anyway.

still forum
#

maybe -1e10 is not the best choice?

hollow thistle
#

Tried with smaller negative numbers. I don't think it is an issue as it correctly blocks place and edit.

#

It also shows the onscreen warning that I cant delete an object. But it deletes it anyway ยฏ_(ใƒ„)_/ยฏ

carmine abyss
#

Is there a way to createMarker that doesnt scale when zoomed in?

meager granite
#

No, you'll need to do drawIcon in Draw map event and scale it with map zoom

proven crystal
#

my object is sychronized to a trigger, the command synchronizedObjects returns me [] though

#

is there a special way to get to the trgger?

#

synchronizedTriggers seems to be for waypoints only...

carmine abyss
#

hmm okay i'll look at that ty.

meager granite
#

@carmine abyss Divide width and height of the icon in drawIcon by number returned with ctrlMapScale command and you're all set

carmine abyss
#

wow ty @meager granite

carmine abyss
#

@meager granite which control do I use? Do I need to make an image and put it in dialogs.hpp?

meager granite
sturdy cape
#

hey folks!is there any way to have kind of an init on a "throw" object after it touches the ground?we created a throwable item that needs to be picked up again and i thought about something like a createvehicle line based on the pos the item goes to when throwed.its a class handgrenade item so i think something in arma is executing the actual explosion?

carmine abyss
#

Ty looking now

#

The area I want to put a large black circle will be connected to the location of a moving drone. I'm assuming your way is for static purposes and can only be enabled or disabled?

meager granite
#

If its a circle, just use circle marker or drawEllipse?

#

If you need it as icon, check docs for drawIcon and it all will be clear to you

carmine abyss
#

Ok ty. I'll try to figure it out. Thank you.

peak plover
#

Are there any custom huds for infantry / weapons

#

Anyone know where the code for vanilla hud is?

lone lion
#

@young current I'm trying to approach the problem from the config. Currently I just have two different viewOptics_base classes where it hops between two eye memory points

#

but doesnt seem to do anything when I press the Cycle Optics key

proven crystal
#

hmm shouldnt simpleobject make things kind of impenetrable? i thought things become somewhat decorative then

#

well crap... just found this hint here too: Use with caution as this technique is not very clean - should not be used for many objects and definitely not in MP games.

#

BIS_fnc_replaceWithSimpleObject

pure blade
#

why replace? create a simpleobject

proven crystal
#

editor placed objects

#

there is no tick anymore for simpleobject in them so i used that replacefunction

#

does the job as far as i can see, but the dubious warning there tells me i should reconsider

pure blade
#

you can make a script that fetch and convert all objects in 3den to an array and on serverstart you can read the array and spawn all objects

#

that's how i do it

proven crystal
#

same effect isnt it?

#

i would guess that that function does pretty much the same thing

wary vine
#

anyone off the top of their head know how to compress arrays ?

high marsh
#

"compress" ?

pure blade
#

maybe but i don't know, but then i don't know why they writing this warning

wary vine
#

i.e ["test", "test", "test", "test2"] into [["test", 3], ["test2", 1]]

still forum
#

Are you asking whether anyone has a compression algorithm in the top of their head? ^^

#

do a arrayIntersect to find the unique values. And then iterate through the unique's and do a count on the original array for each of them

#
private _uniq = _orig arrayIntersect _orig;
private _comp = _uniq apply {
    private _fookinMookinVarNamesBeinTooShortHoooooopdalooopa  = _x;
    private _fookinMookinVarNamesBeinTooShortHooooopdalooopa = {_x == _fookinMookinVarNamesBeinTooShortHoooooopdalooopa  } count _uniq;
    [_fookinMookinVarNamesBeinTooShortHoooooopdalooopa  , _fookinMookinVarNamesBeinTooShortHooooopdalooopa]
} ;
wary vine
#

ty

pure blade
#

@proven crystal


params
[
["_template",objNull,[objNull]],
["_forceSuperSimple",false,[true]]
];

if (isNull _template || {count crew _template > 0}) exitWith {["[x] Template object (%1) must not be NULL and must not contain any crew!",_template] call bis_fnc_error;};

if (isSimpleObject _template) exitWith {["[x] Function was executed on simple object!"] call bis_fnc_error;};

private _class = typeOf _template;

if (_class == "") exitWith {["[x] Cannot retrieve classname!"] call bis_fnc_error;};


private _data = [_template] call BIS_fnc_simpleObjectData;



private _pos = getPosWorld _template;
private _dir = getDir _template;
private _vectorUp = vectorUp _template;


deleteVehicle _template;


private _object = [_data,_pos,_dir,false,_forceSuperSimple] call BIS_fnc_createSimpleObject;


_object setPosWorld _pos;


_object setVectorUp _vectorUp;


_object}

that's the code of BIS_fnc_replaceWithSimpleObject function

#

it is not quite the same, because i spawn the simpleobjects directly

proven crystal
#

you mean createSimpleObject instead of that function there?

pure blade
#

yes

#

but actually i think, that the is harmless to multiplayer performance, but if you wan't to replace a lot of objects then do this on mission start and not on progress

proven crystal
#

yea i suppose thats the main point

#

hmm looks like i could just set a parameter there for supersimple too. that option isnt documented on the wiki

#

but none of them seem to help me to make stupid plywood walls for a killhouse impenetrable

#

i dont like the concrete much

wary vine
#

is there an alternative to lbSetTextRight for Trees ?

viscid glen
#

trying to add 1000 items into container in MP.
using container addItemCargoGlobal ["class_name", 1000]
why this command is spamming network traffic for each of item, and other players see items counting in container inventory from 1 to 1000 for a 5-6 seconds?
why this command isnt executing once per client as is should ?

pure blade
#

hm that's strange, if you don't find a solution for this, you can code your own addItemCargo Global command, simply remoteExec your own function with addItemCargo local on every client, perhaps it has better network performance

viscid glen
#

and what about jip then ?

pure blade
#

jip must be activated

#

you can check in the same function if your container is destroy or not available and kill jip then

#

ahh but with jip its a bit complicated because you must check if other player take weapon out of the container

viscid glen
#

im working on my own inventory manage system. so remoteExec with jip cant be a problem, as there will be too much calls for each container.

#

localy addItemCargo takes less than second to add even more than 100k items. cant get it why its not working well in MP

#

i think it should run once per client and then do local and very fast item add

pure blade
#

yes, how i wrote this above

viscid glen
#

maybe someone know better alternative for removing x items from container than:
1. clear all items 2. add old_amount-x items
?

high marsh
#

@viscid glen What do you mean? Specific items?

viscid glen
#

@high marsh items with item subclass, for example 'ItemMap' or 'ItemGPS', or any resources item on roleplay server

#

as i know its usual way for meny years already. if container has 100 map items and we need to remove 10 of them. we clear all items. and addItemCargo 90.

high marsh
#
_items = count (itemCargo _container) select {(typeOf _x) in ["ItemMap","ItemGPS"]};
still forum
#

I do indeed know a better alternative. But you cannot use that ๐Ÿ˜„

#

There is none currently

high marsh
#

๐Ÿค” . Dish me Dedfur.

still forum
#

Well next to the addWeaponWithAttachmentsCargo I also already know how to make commands to remove items from cargo.

#

Also made a removeBackpackFromCargo command that removes a specific backpack

high marsh
#

A specific backpack or a specific type of backpack?

viscid glen
#

its ok with specific items. problem is with removing some amount of items of the same classname

still forum
#

a specific backpack. One that everyBackpack returns

viscid glen
#

@still forum do u know why addItemCargoGlobal ["ItemMap",1000] spams netowrk with traffic for 5-6 seconds? and not just sending one call to every client ?

still forum
#

Yes.. I do

#

And you can figure that out by yourself

#

it sends one call per item

#

You might be able to remove the Global and just remoteExec it by yourself

#

That might work.. should work

#

Parts of the arma netcode are.. kinda stupid sadly.

high marsh
wary vine
#

unit getUnitLoadout it returns a weapon Array like ["arifle_SPAR_01_blk_F", "muzzle_snds_M", "acc_flashlight", "optic_ACO_grn", ["30Rnd_556x45_Stanag", 30], [], "bipod_02_F_tan"] what is the empty Array []

ruby breach
wary vine
#

tyvm

neon snow
#

Any idea how could I "detect" being launched from Carrier?

carmine abyss
#

drone1 is the name of a drone. When it respawns I can't see why its not running armDrone.sqf for everyone. sqf drone1 addEventHandler [ "Respawn", { ["armDrone.sqf", "BIS_fnc_execVM", true, true, true] call BIS_fnc_MP; } ];

peak plover
#

I believe respawn only runs for player controlled units

carmine abyss
#

ah

high marsh
#

@carmine abyss Use remoteExec instead of BIS_fnc_Mp

#

firstly

carmine abyss
#

I think @peak plover may be right. I cannot get it to execute. Any ideas how to execute an sqf for all players after the drone respawns?

#
drone1 addEventHandler [
    "Respawn", {
        [] remoteExec ["armDrone.sqf", 0, true] 
    }
];```Not working
high marsh
#

You're still not able to use the respawn eh on non player entities.

carmine abyss
#

dont think so

#

i changed drone1 to player and it works just fine on repsawn

peak plover
#

๐Ÿคฆ๐Ÿป

#

How did you make the drone respawn

#

Module?

carmine abyss
#

Vehicle Respawn module in editor

high marsh
#

not the same

peak plover
#

@carmine abyss

#

Should be something for code in the module

carmine abyss
#

i'll look again good find ty

#

ugh found it. its called "Expression"

#

Got it working thanks a lot

spare crest
#

Just discovered that

for "_i" from 1 to 3 do {
    diag_log ("test: " + str _i);
} forEach [11,12,13];
``` doesn't throw an error and results in

23:55:25 "test: 1"
23:55:25 "test: 2"
23:55:25 "test: 3"

tough abyss
#

I've been trying to wrap my head around Arma modding for a bit, and I have a script that works fine in game in the code window dealy. I'm trying to package it as a mod for testing, but don't really know how. Is there a walkthrough somewhere? It relies on CBA if that matters.

#

And I get a "script not found" error too

sturdy cape
tough abyss
#

That's.... mildly useful. I think the big hurdle is what I need in my config.cpp. And also, where exactly that goes. My script detects hitpoints around the player, and if a hitpoint is glass (a window) and they're within a short distance, it breaks the glass. I'm not sure what "patches" I would need or functions in my config. So far the config.cpp is just this:

{
    class WindowBreaker
    {
        name = "WindowBreaker";
        author = "Axebeard";
        url ="";

        requiredVersion = 0.1; 
        requiredAddons[] = {"cba_xeh"};
        units[] = {};
        weapons[] = {};
    };
};
sturdy cape
#

For configs id always check the unpacked a3 stuff on your workdrive (assuming youre having a3tools properly installed) and look into edens config viewer

tough abyss
#

I've been going off other mods, and I think I have my config right finally

still forum
#

@spare crest correct. The for loop returns nil and nil forEach [] just get's silently ignored

#

cba_xeh in requiredAddons is enough, that already includes all vanilla stuff.
You might wanna have CfgFunctions in there if you want to use that

tough abyss
#

Config looks like this now:

{
    class AB_WindowBreaker_main
    {
        name = "WindowBreaker";
        author = "Axebeard";
        requiredVersion = 0.1; 
        requiredAddons[]=
        {
            "cba_keybinding",
            "cba_main",
            "cba_main_a3",
            "cba_settings",
            "extended_eventhandlers"
        };
        units[] = {};
        weapons[] = {};
    };
};

class Extended_PreInit_EventHandlers
{
    class AB_WindowBreaker
    {
        init="call compile preprocessFileLineNumbers 'WindowBreaker\XEH_PreInit.sqf'";
    };
};
class cfgMods
{
    author="";
    timepacked="1538516592";
};
#

Not sure what timepacked is though

still forum
#

Arma AddonBuilder might be inserting that. Should be a timestamp on when the pbo was packed
Timestamp says Tuesday, 2. October 2018 21:43:12

tough abyss
#

Now I'm having some issues with the animation and the sleep command. Here's what I have:


private ["_model_pos","_world_pos","_armor","_cfg_entry","_veh","_house","_window_pos_arr","_cfgHitPoints","_cfgDestEff","_brokenGlass","_selection_name","_animTimeOut","_hitpointname","_playerdist"];
_house = nearestObject [player , "House"];
_window_pos_arr = [];
_cfgHitPoints = (configFile >> "cfgVehicles" >> (typeOf _house) >> "HitPoints");
//_player    = _this select 0; 
_player = player;

for "_i" from 0 to count _cfgHitPoints - 1 do 
{
_cfg_entry = _cfgHitPoints select _i;

if (isClass _cfg_entry) then
{
    _armor = getNumber (_cfg_entry / "armor");

    if (_armor < 0.5) then
    {
        _cfgDestEff = (_cfg_entry / "DestructionEffects");
        _brokenGlass = _cfgDestEff select 0;
        _selection_name = getText (_brokenGlass / "position");
        _model_pos = _house selectionPosition _selection_name;
        _world_pos = _house modelToWorld _model_pos;
        _window_pos_arr set [count _window_pos_arr, _world_pos];
        _hitpointname = (configName _cfg_entry);
        _playerdist = _player distance _world_pos;
        if (_playerdist < 2) then
        {
        //_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
        [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
        sleep 2;
        _house setHitPointDamage [_hitpointname, 1];
        };
    };
};
};```

I want to delay the last line, but it bugs out on "sleep"
quartz storm
#

Dose anyone know where to get the Waste land Scrips because I would like to have them for my own use. ( please Dm if you have something to say)

copper raven
#

@tough abyss How are you executing your script?

tough abyss
#

For testing, I'm just punching it into the script console in-game. It should be linked to a custom key set up through CBA keybinds though

#

hence the "_player = player" thing

copper raven
#

Make sure you run it in scheduled

tough abyss
#

I don't know what that means

still forum
#

put a [] spawn {<code>} around it

tough abyss
#

Oh gotcha

#

Sort of worked, but it put the _house variable outside of the scope so it's undefined I guess?

still forum
#

Why are you even using private array. And / for config :U
Also why no SQF highlight?

```sqf
<code>
```

Also

 _window_pos_arr set [count _window_pos_arr, _world_pos];

Do you know that pushBack exists? https://community.bistudio.com/wiki/pushBack

tough abyss
#

Because I'm ripping code out of another mod and don't really know exactly what I'm doing

#

I literally have no idea why I'm using private, but taking those variables out of private didn't seem to do anything different. Still through an undefined error. And I don't know what an sqf highlight is

still forum
#
_this = player; //For testing

params ["_player"];

private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

{
    private _cfg_entry = _x;
    private _armor = getNumber (_cfg_entry >> "armor");

    if (_armor < 0.5) then {
        private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
        private _selection_name = getText (_brokenGlass >> "position");
        private _model_pos = _house selectionPosition _selection_name;
        private _world_pos = _house modelToWorld _model_pos;
        _window_pos_arr pushBack _world_pos;
        private _playerdist = _player distance _world_pos;
        if (_playerdist < 2) then {
            private _hitpointname = (configName _cfg_entry);
            //_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
            [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
            sleep 2;
            _house setHitPointDamage [_hitpointname, 1];
        };
    };
} forEach _hitPoints;
tough abyss
#

Here's how I got to this point: I found some code on Armaholic that spawns a thing at every window in a building (the _window array bit), then I managed to get the usable names of the hitpoints on the buildings that went into that array, and if they were within 2m, break em. The breaking part works fine, it's the animation and delay part that are giving me shit now. Also, it needs to work in MP

#

^ code works, but still throws an error on "sleep"

still forum
#

As said previously. Needs to run scheduled. So you have to spawn it

#

not call

#

debug console call's.

tough abyss
#

Ok, I did the spawn thing and _house is still coming up undefined

still forum
#

where are you using _house?

#

I don't see how that can become undefined inside that script

tough abyss
#

_this = player; //For testing

params ["_player"];

private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

{
    private _cfg_entry = _x;
    private _armor = getNumber (_cfg_entry >> "armor");

    if (_armor < 0.5) then {
        private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
        private _selection_name = getText (_brokenGlass >> "position");
        private _model_pos = _house selectionPosition _selection_name;
        private _world_pos = _house modelToWorld _model_pos;
        _window_pos_arr pushBack _world_pos;
        private _playerdist = _player distance _world_pos;
        if (_playerdist < 2) then {
            private _hitpointname = (configName _cfg_entry);
            //_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
            [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
            [] spawn {
            sleep 2;
            _house setHitPointDamage [_hitpointname, 1];
            [_player, ""] remoteExec ["switchMove", 0];};
        };
    };
} forEach _hitPoints;
still forum
#

That's all perfectly fine

#

Ah

#

I meant spawn around the whole script

tough abyss
#

OHHHHHH

still forum
#

Yeah. That will be undefined in there if you don't pass it through via the arguments

#

You can also

[_house,_hitpointname, _player] spawn { //Put arguments into _this
    params ["_house", "_hitpointname", "_player"]; //Get arguments back out of _this
    sleep 2;
    _house setHitPointDamage [_hitpointname, 1];
    [_player, ""] remoteExec ["switchMove", 0];
};
tough abyss
#

Putting a spawn around the whole thing actually worked marvelously, thank you

#

When I call this script now, should I do execVM with the spawn contained in the script itself, or should I "spawn" the script?

#
["Smash", "Press to smash a window"], 
{[player] execVM "\WindowBreaker\windowBreaker.sqf"}, 
{}, 
[DIK, [false,false,false]]
] call cba_fnc_addKeybind;```
still forum
#

execVM is equal to spawn compile preprocessFile(LineNumbers) so it already has the spawn

tough abyss
#

ok cool

#

It mostly works now, but it occasionally gets stuck in a loop of doing the animation 3 times. How would I force it to exit the script after the first time it plays the anim?

still forum
#

replace if (_playerdist < 2) then with if (_playerdist < 2) exitWith might work?

tough abyss
#

Didn't work, he's still wailing on adjacent windows

#

Ideally, I'd like it to choose the hitpoint the player is looking at, but I couldn't figure that one out

still forum
#
_this = player; //For testing

params ["_player"];

private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x && (getNumber (_cfg_entry >> 'armor') < 0.5)" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

{
    private _cfg_entry = _x;
    private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
    private _selection_name = getText (_brokenGlass >> "position");
    private _model_pos = _house selectionPosition _selection_name;
    private _world_pos = _house modelToWorld _model_pos;
    _window_pos_arr pushBack _world_pos;
    private _playerdist = _player distance _world_pos;
    if (_playerdist < 2) exitWith {
        private _hitpointname = (configName _cfg_entry);
        //_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
        [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
        sleep 2;
        _house setHitPointDamage [_hitpointname, 1];
    };
} forEach _hitPoints;

Method one to exit early

#

You could choose the hitpoint that's closest to the player. Would that be good enough?

tough abyss
#

That what's I was going for

#

Closest to their head or torso

still forum
#

Collect all hitpoints. Sort by distance. Take closest one.

tough abyss
#

Because on the second story of some of the Altis buildings, the guy is smashing the windows on the floor below

still forum
#

What do you need _window_pos_arr for? It's not used

tough abyss
#

It was for marking window positions for bugtesting. Came out of the code I ripped from Armaholic earlier

#

I'd use vectorDistance for getting closest position from that array, right?

still forum
#

No. You can just use distance

#
_this = player; //For testing

params ["_player"];

private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x && (getNumber (_cfg_entry >> 'armor') < 0.5)" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

private _hitpointPositions = _hitPoints apply {
    private _cfg_entry = _x;
    private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
    private _selection_name = getText (_brokenGlass >> "position");
    private _model_pos = _house selectionPosition _selection_name;
    private _world_pos = _house modelToWorld _model_pos;
    private _playerdist = eyepos _player distance _world_pos;
    [_playerdist, _world_pos, (configName _cfg_entry)]
};

_hitpointPositions sort true; //Sort ascending.

(_hitpointPositions select 0) params ["_playerdist", "_world_pos", "_hitpointname"];

//_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
[_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
sleep 2;
_house setHitPointDamage [_hitpointname, 1];
#

_hitpointPositions is an array like [ [_playerdist, _worldPos, _hpName], [_playerdist, _worldPos, _hpName] ]
the sort then sorts the subarrays after their first element in ascending order.
Thus you get sorted by _playerdist, with the smallest value being at the front

tough abyss
#

Interesting

#

It's throwing the sleep error again

#

I tried putting it all in spawn too, but then it threw other undefined errors

#

Yeah I'm a little lost on how this array works

still forum
#

๐Ÿค” I don't see any error I think ๐Ÿค”

#

You could try logging the _hitpointPositions to check that they are correct?

tough abyss
#

I was trying to read them but not sure how

still forum
#

you can set them to a global variable and read that via debug console. Or diag_log

tough abyss
#

so remove the underscore and "private" parts?

still forum
#

yeah

tough abyss
#

it just showed as []

#

Aside from the multiple animations, this version is the best so far:


[] spawn {
_this = player; //For testing

params ["_player"];

private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

{
    private _cfg_entry = _x;
    private _armor = getNumber (_cfg_entry >> "armor");

    if (_armor < 0.5) then {
        private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
        private _selection_name = getText (_brokenGlass >> "position");
        private _model_pos = _house selectionPosition _selection_name;
        private _world_pos = _house modelToWorld _model_pos;
        _window_pos_arr pushBack _world_pos;
        private _playerdist = _player distance _world_pos;
        if (_playerdist < 2) then {
            _this setAnimSpeedCoef 2;
            private _hitpointname = (configName _cfg_entry);
            //_namehint = hint format ["%1, distance %2",_hitpointname,_playerdist];
            [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
            sleep 1;
            _house setHitPointDamage [_hitpointname, 1];
            sleep 1.3;
            _this setAnimSpeedCoef 1;
            [_player, ""] remoteExec ["switchMove", 0];
        };
    };
} forEach _hitPoints;

};```
#

It should also check if the window is already damaged too, and then NOT play the animation etc

#

[] spawn {
_this = player; //For testing

params ["_player"];

private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
private _hitPoints = "isClass _x" configClasses (configFile >> "CfgVehicles" >> (typeOf _house) >> "HitPoints");

{
    private _cfg_entry = _x;
    private _armor = getNumber (_cfg_entry >> "armor");

    if (_armor < 0.5) then {
        private _brokenGlass = (_cfg_entry >> "DestructionEffects") select 0;
        private _selection_name = getText (_brokenGlass >> "position");
        private _model_pos = _house selectionPosition _selection_name;
        private _world_pos = _house modelToWorld _model_pos;
        _window_pos_arr pushBack _world_pos;
        private _playerdist = _player distance _world_pos;
        if (_playerdist < 2) then {
            private _hitpointname = (configName _cfg_entry);
            if (_house getHitPointDamage _hitpointname == 0) then {
            _this setAnimSpeedCoef 2;
            [_player, "Acts_Miller_Knockout"] remoteExec ["switchMove", 0];
            sleep 1;
            _house setHitPointDamage [_hitpointname, 1];
            sleep 1.3;
            _this setAnimSpeedCoef 1;
            [_player, ""] remoteExec ["switchMove", 0];
            };
        };
    };
} forEach _hitPoints;

};```
Seems to work for not whacking broken windows
still forum
#

Can't see how the array could become empty ๐Ÿค”

tough abyss
#

Got me. I'm about to hit the hay though, so I'll poke at it some more tomorrow. Thanks for all the help!

compact maple
#

what is this script doing ?

copper raven
#

Perhaps something for cinematics? xd

still forum
#

scroll up and read

eager prawn
#

Is there a way to block out a section of the map?

pure blade
#

yes there are different ways you can do it, but what do you want, should the player be killed or teleport or what?

eager prawn
#

No I mean from seeing the area on the actual map

#

I want to hide a "wrecked aircraft carrier" under the water

#

But the runway outline of the USS freedom goes on the map no matter what I try, so its impossible to "hide" the wreck @pure blade ,

void ivy
#

What about a blue 100% opacity marker going over it? Looks ugly but accomplishes what you want?

astral dawn
#

Maybe make it some kind of super simple object instead of adding it as a vehicle, or something of this kind

#

Like, at start you get its position and vectorDirAndUp, delete it, and recreate it as a simple object. Not sure if it will hide the runway marker but it's worth trying.

signal pulsar
#

can I post in here for help solving an rpt error?

pure blade
#

maybe ๐Ÿ˜ƒ

eager prawn
#

You can still see through 100% opacity markers, cant ya?

#

I tried a 100% opaque black marker that was 500m x 500m and you can still see through it

#

@void ivy

void ivy
#

๐Ÿคท

tough abyss
#

Ok, does anyone have a script laying around that removes the little arrow on the map in air vehicles? I don't want my map to turn into a gps.

signal pulsar
#

does anyone here have experience with using mikeros make pbo tools ?

copper raven
#

mapContent = 0; or change it in game settings, if player hosted. I don't think there is any other way. That will hide whole map content tho.

signal pulsar
#

or mikeros tools in general?

still forum
#

@signal pulsar ask your question

signal pulsar
#

im having an issue using make pbo to pack my mission folder

still forum
#

there are over 5000 people in here that all spent some time with Arma

#

The question whether anyone has used mikeros tools is kinda useless

signal pulsar
#

there is file that has an error but not rlly

#

and im trying to exclude the file

still forum
#

"not rlly" ?

signal pulsar
#

so it doesnt stop the proccess with an error

#

well i mean

#

like mikeros is throwing an error

#

but ingame the file doesnt error out and nothing is logged to the rpt

#

theres an error

#

but not one like that would prevent gameplay.

#

and it doesnt log anywhere.

tough abyss
#

@copper raven I don't mean the map content markers. I'm talking about the tiny arrow indicating air vehicles, and the intersecting lines to easily ID your position. If you look at the map in an air vehicle you'll see what I mean.

still forum
#

Can you please stop being so vague?
Please stop the "an error" and "a file"
Just say what you want

signal pulsar
#

well my real question is

#

how to format the exclude function

#

-x

#

ill send a screenshot

#

exampe

#

of what i mean

still forum
#

A pattern.

#

If you want a file just put the filename there

#

-x file.hpp

signal pulsar
#

thats what i did

#

but it gave me an error

#

wait

#

will try again and scfreenshot resultss

copper raven
#

@tough abyss Can you screenshot, that stuff? Or.. wait, do you mean radar?

signal pulsar
#

this is what it says

still forum
#

AH!

#

-X=config.cpp

signal pulsar
#

lmao

#

it still doesnt work tho

#

likedoesnt exclude the file

#

still

still forum
#

might be that it doesn't work with config.cpp

signal pulsar
#

well thats a fucker

#

bc i cant fix this error

still forum
#

is there not a no rapify option?`

signal pulsar
#

there is but isnt rapifying what checks for errors?

still forum
#

Well you could just fix the error. Add the missing inherit

#

rapify == binarize

#

so no

#

you generally dont need to rapify missions anyway

signal pulsar
#

i dont know what the missing inherit is thats my point

still forum
#

It tells you right there

signal pulsar
#

i wouldnt know how to fix that

#

i go to that lin

#

im not seeing what u would see

still forum
#

Go to that line. And add a class RscExileXM8AppButton1x1; before that

#

or just add it at the top of the config

signal pulsar
#

class XM8_App01_Button: RscExileXM8AppButton1x1

#

is what i have for that line

still forum
#

yes

#

put what I wrote. in the line above

signal pulsar
#

these are all script errors from default exile im pretty sure

#

i have never once edited this part of the file

#

and on top of that

still forum
#

Well.. That's not a script at all

signal pulsar
#

i fix this one

#

and boom new error

#

200 lines down

#

same shit

#

not defined

still forum
#

why do you even need the config.cpp? can't you just remove it?

signal pulsar
#

from the mission file?

#

its an exilemod server

still forum
#

Well -X will exclude it from the mission pbo

#

so same effect in the end

signal pulsar
#

well then i guess thats not what im wanting then

still forum
#

Why do you need a config.cpp in a mission file?

signal pulsar
#

how can i make mikeros overlook the BS erros in that file

still forum
#

doesn't really make sense

signal pulsar
#

so it will zip

still forum
#

You could also fix the rest of the errors

#

or stop trying to use mikeros stuff

signal pulsar
#

because thats how exilemod sets up their mission files by fedault?

#

lol

#

thanks.

still forum
#

Well config.cpp in missionfile is nonsense. That exile guys do that doesn't really mean anything besides that they are idiots.. Which we already kinda knew

#

Exile breaks lots of stuff because they are doing lots of dumb nonsense

signal pulsar
#

so there is no way to tell mikeros to ignore errors from a certain file and still zip the whole pbo anyways?

#

bc thats all i wants.

still forum
#

No

#

that's like the main purpose of mikeros tools. Supreme error checking

tough abyss
#

@copper raven No, not radar. I'll get you a screenshot in a secccccc

#

can't post images in this chat, need ot upload lol

still forum
#

If you want to bundle a pile of shit together with a couple of ropes then... Don't use a high-end Oscilloscope to do it..
Bad metaphor

tough abyss
#

@copper raven

still forum
#

I don't have that. I guess difficulty settings can disable that

signal pulsar
#

i legit just got mikeros today

#

so im learning be nice

#

@still forum xD

still forum
#

Why did you grab mikeros tools?

#

Why not something beginner stuff like Arma 3 tools?

signal pulsar
#

because i know mikeros is one of the better tools out there and u said it urself supreme error checking. not only that but i also liked the built in obusqf. seing as how ive already had several people try and steal content off my server.

#

however

tough abyss
#

@still forum You don't have that shit in helicopters? You entirely sure? I've been trying to get rid of it for a while and can't figure out how.

signal pulsar
#

obv obusf isnt invincible

still forum
#

Mikero doesn't have built in obfusqf. Mikero has some annoyances, but can't really be compared with obfusqf.
So if you really wanna stay with mikero, either fix your errors or remove that file

tough abyss
#

"steal content"

signal pulsar
#

so i try to make it so most of my code requires a serverside portion as well.

still forum
#

if you don't want to do either of these then just throw away the idea of packing a exile missionfile

signal pulsar
#

i have the obusqf tool thats separate from mikeros.

#

having issues with that tool not properly compressing shit too @still forum

tough abyss
#

@signal pulsar maybe go into the little pool before you swim out into a tsunami?

copper raven
#

I'm sure you can't disable that. When you disable map content, you get that thing everytime when in a vehicle, don't know why was that implemented.

still forum
#

I haven't seen that thing for a loong time