#arma3_scripting

1 messages · Page 502 of 1

tough abyss
#

It's been like that since the first game too :/ I've been trying to make the map a map, not a gps but got stuck at this part lol

pure blade
#

what are you trying ?

tough abyss
#

Me

pure blade
#

yeah

tough abyss
signal pulsar
#

yep thanks for the advice ill just go fucking drown myself lol

#

@tough abyss

signal pulsar
#

@empty harbor your on this discord

#

can u shed some light?

#

its not packing my pbos properly at all, missing files from like every folder.

still forum
#

I don't think he'll help you 😄

#

He is the guy that specifically made his tools such that you cannot ignore the errors

pure blade
#

@tough abyss i think its impossible

empty harbor
#

my dll refuses to pack exile because of that.

#

there are a legion of mistakes in the array[] specifcations too

tough abyss
#

Isn't exile just poorly written in the first place?

still forum
#

Yep

empty harbor
#

poorly designed perhaps and not well written

tough abyss
#

I'm just guessing here, but in my eyes it's the same as life, pretty much.

still forum
#

I do have to say though... They do have some really great duct tape.. It's a wonder that this heap of garbage doesn't fall apart

signal pulsar
#

lmao

empty harbor
#

exile is fixable by those who want to use it by simply renaming their foolishly named config.cpp

signal pulsar
#

so in terms of testing exile mission file with mikeros

#

is a no go?

#

so ho

empty harbor
#

rename the file. that simple

still forum
#

You could just do the thing that I told you like 5 times now that you should do

signal pulsar
#

what* would u reccomend naming it to

empty harbor
#

haha

still forum
#

get rid of that bullshit nonsense config.cpp

empty harbor
#

pigscanfly.sqf

signal pulsar
#

but

#

why would i make it an sqf file?

empty harbor
#

as i recalll, that's what it's conetnts are.

still forum
#

Because it literally doesn't matter

signal pulsar
#

nots not i dont think

empty harbor
#

+1

still forum
#

all that matters is that it goes away

empty harbor
#

it's only a boring include file

#

#include "PigsCanFly.rvmat"
problem solved

#

there are also a large number of array[] errors. all of them easily fixable, but it takes time

signal pulsar
#

i honestly dont even want to keep trying anymore

#

i just keeps relling my my syntax is wrong

still forum
#

It's like you are trying to buy a ship that's already sinking

signal pulsar
#

i legit copied and pasted my previous

#

it worked 2 entries abouve

empty harbor
#

just patienty fix the errors

signal pulsar
#

makepbo -! -Z C:\Users\Daryl\Documents\GitHub\exilechernarus\Exile.Chernarus_2035 Exile.Chernarus_2035.pbo

#

legit just worked

#

and now its like nope syntax error

empty harbor
#

you're foolish to obfuscate anything before the errors are removed.

signal pulsar
#

yeah

#

well im fricken sick and tired of people taking my content

#

i worked hard on all these icons etc etc.

#

already had multiple players join my server just to download my mission file

#

kid message me on discord legit told me that he was gonna use some of my code on his new server

#

it wasnt asking he was just like "hey im taking ur code"

still forum
#

your code?

#

GitHub\exilechernarus\Exile.Chernarus_2035 it being from a public exile github.. Doesn't sound really like "your code"

tough abyss
#

Yeah.. I was going to comment but sometimes it's better to just not get furhter involved lol

signal pulsar
#

um its my github repo?

#

@still forum my server i use a private github repository for all my files ?

still forum
#

So it's your code yes?

signal pulsar
#

ok ok so lets be clear

#

i think i know where hes going with this

tough abyss
#

You should name it something other than exile then.

#

If you wrote an entire new gamemode make it clear that it's not the same thing.

signal pulsar
#

i named it that way bc i have multiple exile server maps

still forum
#

So you are saying it's your code then?

signal pulsar
#

on diff repos

#

no i didnt write exilemod

#

i knew

#

u were gonna have some smart comment

#

like that

#

or something

#

i know that

still forum
#

Why does your code have that config.cpp with errors that you are unable to fix, and that you don't even know what it's for, if you wrote that by yourself?

signal pulsar
#

for fucks sake

#

let me finish

#

like i said

#

do u think i make exilemod?

#

just being a smarty pants about it and being all technical

#

i think u get what im tryinng to say

#

all my custom logos/ map edits/ script modifications what ever.

#

its all in my github

#

and i spent weeks doing it all

#

ok?

#

i do not know why exilemod decided to name their files the way they did.

#

i think we both know i wasnt trying to say that every single line of code word for word is from scratch my code.

tough abyss
#

From what I understand. If you haven't made the entire map, script, or logo you can't claim ownership of it really. Only thing you might be able to copyright would be your images. Unless this is false, if you have a problem with it you can pretty much lock your server and only allow trusted people to join.

high marsh
#

"trusted" :^)

still forum
#

Also the original code might not allow obfuscation. But I can't find licenses on similar mission files

#

though.. A missing license means you cannot take it at all. If there is no license, there is nothing that allows you to do anything. Thus you cannot touch it.

signal pulsar
#

original code of exilemod ? @still forum

#

i know plenty of other servers that do this

still forum
#

of that mission file

signal pulsar
#

exile servers

#

i made this mission file for this map from scratch

still forum
#

Yeah. I know too. I also know plenty of other people who illegally reupload stuff to the workshop

signal pulsar
#

like the mission sqm file

#

making your own "community" mod pack which includes other peoples mods isnt allowed without their permission right?

#

@still forum im not good at any of the legal shit but.

still forum
#

yeah

#

Same with mission files. You cannot just repack stuff unless you have permission. And that includes every single file in that pbo that you are trying to pack.
Especially problematic are APL licensed things. As you are not allowed to obfuscate them

signal pulsar
#

ok wait wait wait

#

so ur saying

#

that if i made my own chernarus 2035 mission pbo folder from scratch

#

like i went in the map editor

#

placed all my own traders etc etc whatever was neccisary for vanilla exile to run on that map

#

i understand the part about other peoples scripts and shit like that.

high marsh
#

What would be the point of that?

#

You'd just be contributing to every exile bloat script server.

signal pulsar
#

im sorry bloat script?

#

why do all u people on this discord need to push opinions so hard

high marsh
#

Maybe you did?

still forum
#

Opinions are usually subjective.
Exile is objectively a pile of garbage, which is also why you are having problems with it.

signal pulsar
#

yes but kinda felt like he was taking out that opinion on me

drowsy axle
#

How do I find this: #include "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"?

high marsh
#

How do you find it? It's packed under a3\Missions_F_Curator

still forum
#

What do you mean by "find"?

#

You already found where it is, it says it right there

high marsh
#

The path tells the truth yes.

wary vine
#

just some advice need if possible ```sqf
private _listbox = (uiNamespace getVariable ["lega_psearch_menu", displayNull]) displayCtrl 3;
private _tvSelection = tvCurSel _listbox;

private _dataStr = "tv_data";
_tvSelection apply {_dataStr = _dataStr + format ["_%1", _x]};
private _index = _listbox getVariable [_dataStr, []];

private _arr = (getUnitLoadout player);
private _temp =+ _arr;
private _string = "(_this";

for "_i" from 0 to (count _index - 2) step 1 do {
    _string = _string + format [" select %1", _index select _i];
};

private _string = _string + format [") set [%1, '']; _this", (_index select ((count _index) - 1))];
private _gear =  (_arr call (compile _string));
player setUnitLoadout _gear;
still forum
#

(_arr call (compile _string)); 🤢

#

all the parenthesis there are useless btw

#

unary always has higher priority than binary

wary vine
#

i know thats why i asked for advice

#

for the call compile section

#

the parenthesis are just there for my viewing purpose, i just personally find it easier to read

still forum
#
 private _value = _this; //prev _string

    for "_i" from 0 to (count _index - 2) step 1 do {
_value = _value select (_index select _i);
    };
_value set [(_index select ((count _index) - 1)), ''];
#

how bout something like that?

#

I guess that you might have chained select in there?

wary vine
#

yup

still forum
#

That should work then

wary vine
#

i will give it a shot

still forum
#

execute the code right away, instead of building a string and then executing all at once

wary vine
#

index is an array of index's based on the selection

#

i.e if it was the optics selected on the primary weapon it would be something like [0,3]

#

got a zero divisor with that

#

my bad with the c+p, tyvm @still forum

still forum
#

I didn't test my code

#

it's just for "make something like this" 😄

wary vine
#

it works fine

#

just had to change a few vars

#
Lega_fnc_testFnc = {
    private _listbox = (uiNamespace getVariable ["lega_psearch_menu", displayNull]) displayCtrl 3;
    private _tvSelection = tvCurSel _listbox;

    private _dataStr = "tv_data";
    _tvSelection apply {_dataStr = _dataStr + format ["_%1", _x]};
    private _index = _listbox getVariable [_dataStr, []];

    private _arr = (getUnitLoadout player);
    private _value = _arr; //prev _arr

    for "_i" from 0 to (count _index - 2) step 1 do {
        _value = _value select (_index select _i);
    };
    _value set [(_index select ((count _index) - 1)), ''];

    player setUnitLoadout _arr;

    [lega_seize_int_unit] call lega_fnc_pSearch_openMenu;
};
#

annoying that tvsetData only allows strings so i have to use an alternate method to store anything

drowsy axle
wary vine
#

just setup your pdrive

#

they are all already extracted then

drowsy axle
#

@wary vine I don't enough space to setup a P:

wary vine
#

hmm

#

gimmie a sec

#
copytoclipboard preprocessfile "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"
#

then ctrl+v in your test editor

drowsy axle
#

Okay thanks you very much !!!

wary vine
#

thats not perfect

#

gimmie a second

still forum
#

Which pbo

#

Missions_F_Curator That

#

right there in the path

#

there is only one

wary vine
#

a pdrive would help you alot for this sorta stuff

#

saves you having to mess with arma 3 files

#

@drowsy axle even better

#
copytoclipboard loadfile "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"
still forum
#

With DokanPbo you don't need any space for a P drive

#

Free p-drive

wary vine
#

i just have mine on an old ssd

drowsy axle
#

Ah right. Thanks for the assistance. 21:01:43 ErrorMessage: Include file a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext not found. 21:01:43 Application terminated intentionally ErrorMessage: Include file a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext not found. Had this error and thought.. how can I get the file, so thanks a million.

wary vine
#

picked up a 128gb ssd for like £15

#

where are those includes to ?

#

change ```
a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext

\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext

still forum
#

where are you including from?

drowsy axle
#

The mission. I just copied this folder, the only folder.

still forum
#

You can't include external files from mission pbo's

drowsy axle
#

I can't

wary vine
#

i do @still forum

drowsy axle
#

but BIS can

still forum
#

Bi broke that when 3den came out

wary vine
#
#include "\a3\3den\UI\macros.inc"
#include "\a3\3den\UI\macroExecs.inc"
still forum
#

BIS doesn't have mission pbo's. Their missions are in a mod

drowsy axle
#

I know.

wary vine
#

@still forum i use this fine in my mission

still forum
#

How are you packing?

wary vine
#

just as a pbo

still forum
#

How

#

3DEN packs differently than mikero or arma tools

wary vine
#

both obfusqf and pbomanager work for me

still forum
#

Well I just know it's broken 😄 Maybe it's only when packed from 3DEN

#

3DEN pbo header also has something weird

wary vine
#

ahh I was going to say i use external includes all the time in my missions xD

still forum
#

Maybe it's time to test again if BI fixed it

tough abyss
#

Is this proper for a multiplayer mod? Specifically the "player" variable. Or should it be "this"?

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

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

still forum
#

this doesn't make sense there

#

cba doesn't set a this variable

#

You might mean _this. But _this doesn't contain player, because that wouldn't make sense there

#

player is correct yeah

#

player doesn't work on server. But on a server no one can press a hotkey

tough abyss
#

I get mixed up on _this vs this, but player works? Cool.

#

Using that bit above, here's a snippet of my actual code and I'm getting sqf errors related to how the player variable is defined I think:


[] spawn {
//_this = player; //For testing
params ["_player"];
_player = _this select 0;
private _window_pos_arr = [];
private _house = nearestObject [player , "House"];

ruby breach
#
params ["_player"];
_player = _this select 0;
``` 🤔
tough abyss
#

Yeah someone was helping me with the code, so I'm not really sure how parameters work

#

ditch _player?

pure blade
#

not so 😄

ruby breach
#

Not even mentioning that you're not actually passing a parameter into that scope

wary vine
#

do you even need _player at all ?

#

just use player in the script

tough abyss
#

Ok

pure blade
#

the local player you can get with only player

tough abyss
#

Gotcha

still forum
#

params get's the parameters out of _this.
_this select 0 does the same.
Both won't work if _this doesn't contain any parameters

ruby breach
#

^ Use that to understand param/params

pure blade
#

so if only pass one argument you can do this:

_hello = "ss";
_hello spawn {
    hint _this; //ss
};

if you use more than one argument you need to pass a array:

_hello = "ss";
_hello2 = "aa";
[_hello, _hello2] spawn {
    _hel1 = _this select 0;
    _hel2 = _this select 1;
    hint (_hel1 + _hel2); //ssaa

};
tough abyss
#

So do I even need a param in this case? Do I even need to define player?

pure blade
#

so if you use params you can do this so:

_hello = "ss";
_hello2 = "aa";
[_hello, _hello2] spawn {
    params["_hel1", "_hel2"];
    hint (_hel1 + _hel2); //ssaa

};
#

if you need the local player, no

still forum
#

if you always use player. you can just use player in your script yeah

tough abyss
#

Ok, great. Because my script worked when I punched it into the console in-game, I'm attempting to package it as a pbo and test it out as a mod now

still forum
#

player is a magic variable from bi no it's not

#

player is not a varaible, nor is it magic

#

it's a command that returns the locally controlled unit

pure blade
#

ah fuck yes

#

my mistake 😄

tough abyss
#
#include "\a3\editor_f\Data\Scripts\dikCodes.h"

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

Do I want the [player] part in this then? Or is it not needed?

pure blade
#

no

tough abyss
#

Keep in mind. If you're breaking windows on buildings etc JIP won't see them as broken.

#

How do I fix that? Remote exec or fnc_mp?

high marsh
#

remoteExec with jip flag

pure blade
tough abyss
#

I'm a little confused about the syntax, is this right to set 1 damage and get it to work globally and for JIP?

[_house, _hitpointname,1] remoteExec ["setHitPointDamage",0,true];
high marsh
#

Looks fine.

ruby breach
#

No

#

right arg is an array

#

remoteExec doesn't magically take gibberish and convert it to what a command needs

high marsh
#

Ah yes, he is right.

tough abyss
#

This is what I had before the remoteExec

_house setHitPointDamage [_hitpointname, 1];
high marsh
#

Gnashes, make me a remoteExec that translates gibberish

ruby breach
#

[vehicle,[hitPointName, damage, useEffects]] remoteExec ["setHitPointDamage"];

tough abyss
#

But what part of that has the JIP flags?

ruby breach
pure blade
#

that is only the format for setHitPointDamage in remoteexec

tough abyss
#

or is JIP the default

pure blade
#

add jip and targets

#

no

high marsh
#

No jip by default, target and jip flag needs to be added to gnashes example

tough abyss
#

I'm asking how to do that

#

Because I'm friggin lost

pure blade
#

you do it already above

tough abyss
#
[_house,[ _hitpointname,1] remoteExec ["setHitPointDamage",0,true];```
#

???

#

[_house,[ _hitpointname,1] remoteExec ["setHitPointDamage",0,true]];

high marsh
#
[_house,[_hitPointName, 1]] remoteExec["setHitPointDamage",0,true];
tough abyss
#

Oh dur

#

Ok seems to be working. I just noticed if you smash the Spacebar though, it plays the glass breaking sound multiple times

pure blade
#

but you remove the action after smash?

tough abyss
#

The CBA keybind runs the script, which checks for windows, breaks them etc. Not sure how to remove the action

#

I'm not using addAction if that's what you were getting at

pure blade
#

i don't work with cba, do you see the action after smash?

tough abyss
#

No the action works fine, the only thing that multiplies is the sound effect, which is added in because setHitPointDamage is silent

#

Might just need to move one of my if checks

pure blade
#

okay

tough abyss
#

Hmmm not sure how to prevent that

#

It is a thing you'd have to try to do though

#

Can I plug an "if script is running, don't run" argument into my CBA keybind?

pure blade
#

sure

#

i don't know how it works on cba

#

but there is a command

#

scriptDone

tough abyss
#
script_handler = [parameters] execVM "scriptname.sqf";
waitUntil { scriptDone script_handler };

Is what I'm seeing

#
// Register a simple keypress to an action
#include "\a3\editor_f\Data\Scripts\dikCodes.h"

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

Is what I have already, so I can probably wedge it into the brackets where the execVM is I guess

dim owl
#

Hey guys, does anyone know a method to remove the connection message? Or even modifying it? I just want to say: "A player is connecting.". Is that even possible?

pure blade
#

nah, make a if statement

if(scriptdone script_handler) then {
    script_handler = [parameters] execVM "scriptname.sqf";
};
#

@dim owl no, there is no offical way, you can try to edit the chat dialog or you spam the chat full with some spaces (warning: very dirty)

dim owl
#

Okay thanks, I saw it on another server i believe but i'm not completely sure. Is the systemchat thing in the engine? Or could I check for incoming systemchat messages and create like a filter?

tough abyss
#

@pure blade that script won't fire off, not sure if it's a CBA thing or not though

pure blade
#

if the script don't end, you must look up if the script stuck on a loop or something

tough abyss
#

Good point

pure blade
#

@dim owl use playerjoin event

#

nah, but i think its to late then

dim owl
#

Yeah i also though about an evh for that but I don't think it's going to work

pure blade
#

you can get the messages from the chat dialog i think

twin steppe
#

I'm trying to create a custom virtual arsenal and so far I've created a whitelist of equipment but people can still Save/Load in their loadout. I need to disable the option to Save/Load. Larrow made this script to somebody that was asking for the same thing: ``` [ missionNamespace, "arsenalOpened", {

disableSerialization;

_display = _this select 0;

{

( _display displayCtrl _x ) ctrlSetText "Disabled";

( _display displayCtrl _x ) ctrlSetTextColor [ 1, 0, 0, 0.5 ];

( _display displayCtrl _x ) ctrlRemoveAllEventHandlers "buttonclick";

}forEach [ 44146, 44147 ];

} ] call BIS_fnc_addScriptedEventHandler; ``` It seemed to work for players on the server but somebody that rejoins can use the Save/Load option again. How can I remote execute this script with JIP activated?

dim owl
#

You could just add it to the player init and it will be executed every time the player connects

twin steppe
#

Dont have access to that, I'm executing it on the debug console.

#

I suppose I could loop it but I think that will take a toll on the server performance.

dim owl
#

if it's not blocked by the remoteexec config, you could use {/* your code */} remoteExec ["call", -2, true]; or something like that. cannot test it atm

twin steppe
#

Will try, thanks.

peak plover
#

@quartz coyote Do you have a github?

fickle quiver
#

hello!

#

i need some help

#

how can i change a dialog text colour into black and align it?

#

thx!

pure blade
fickle quiver
#

in a dialog, i mean

peak plover
#

what kind of dialog

fickle quiver
#

normal dialog XD

fickle quiver
#

yep

#

but i mean

peak plover
#

static_

#

??

fickle quiver
#

there was some kind of operation

#

to make colours

peak plover
#

IT's different for static and structured text

fickle quiver
#

it was divided into something

#

i dont remember now XD

#

it's static

peak plover
#

here's a list of commands for gui

#

I'm sure you can find the one you're looking for

fickle quiver
#

i'd like to define it on the .hpp

#

i know it's possible, i did it a time ago

#

but i don't remember now

#

:/

peak plover
#

It's gotta be somewhere here

fickle quiver
#

yep

#

thankyou

#

!

fickle quiver
#

color worked

#

but still dont remember how to align it

#

xd

#

any help?

peak plover
#

Align_

#

??

#

Align text?

pure blade
peak plover
#

kkarma

quartz coyote
#

@peak plover hello why ?

peak plover
#

You said something about working on a pvp scenario or sth

quartz coyote
#

Yeah we're looking for someone to work with us on some project. You interested ?

peak plover
#

Nah, I don't think I'm that good at scripting yet.

#

I was just wondering about how you do things for it

#

That's why I wondered if you have a github

neon snow
#

Is there a way to make cystom chat message with played voice ? Something like when units say something about target etc

still forum
#

Yeh

#

Any of the *Chat commands. And say

neon snow
#

But I need to have recorded sound for that , correct ?

still forum
#

yeah

#

if you want to play something you need to have something to play

neon snow
#

I thought there was a way to make a chat message play with the voice of ingame AI, like when you order someone to openfire etc

still forum
#

Well.. Find the voice actor who voiced that. And ask him to speak your text ^^

neon snow
#

Ok 😀 thanks

spice axle
#

I am looking for a command which is telling me if a vehicle is open or closed. A prowler is open, a tank not. Is there a command or do i have to script it?

still forum
#

script

#

Not really easy either

peak plover
#

ABout that voice stuff, are the ai voices not scripted at all?

#

in sqf

#

@neon snow you can just use the existing voice files

neon snow
#

Uuu nice. Thanks @peak plover

keen bough
#

i have _inidbi = ["new", "Vehicle Garage"] call OO_INIDBI;
_readVehicles = ["read", ["Vehicle Garage", "Merc Vehicles"]] call _inidbi; this in my script and this is the only part i need to let the server execute, because clients dont know inidbi. Only the server does.

pure blade
#

create a function for this and use remoteexec

keen bough
#

dont have functions for the old scenario yet, is there a workaround? Dont have the time ^^ Tomorrow i am working on the functions.

still forum
#

remoteExec call?

#

and publicVariable black?

keen bough
#

right, thanks, that was the idea i needed

pulsar anchor
#

is the init eventhandler from class Eventhandlers executed on every client? Or only once by the owner?

still forum
#

should be every client that has the config entry

pulsar anchor
#

hm also jip right? So when the player joins after an object was created it has to be initialized again for him. I think I had once a issue with joining players moving objects back to their initial position defined in the init.

keen bough
#

strange, the arsenal script works perfectly but the garage-script with the dialog wont. Except the dialog, it opens. grah...

still forum
#

I don't know if init runs for JIP.. Have to test that (I won't)

pulsar anchor
#

I will, ty anyway 😛

keen bough
#

a global variable is initialized, the server knows inidbi but it somehow refuses to load the infos into the variable oO i am going crazy.

#

this is for the server:
_inidbi = ["new", "Vehicle Garage"] call OO_INIDBI;
_readVehicles = ["read", ["Vehicle Garage", "Merc Vehicles"]] call _inidbi;
theGarage = _readVehicles;

#

theGarage is still empty.

still forum
#

well is _readVehicles empty too?

keen bough
#

let me test this.

#

strange, its empty.

#

i dont get any errors either in the rtp files... now i am really confused.

#

could there be somehow a cache-conflict? since i redid the inidbi-entries all along without renaming them?

neon snow
#

My had hurts, how to get direction from one object to another but disregard of what direction first object is looking at?(thats how getRelDir works)

still forum
#

getDir

#

without rel

neon snow
#

damn, I am stupid for not reading entire pages, big thanks

carmine abyss
#

Two questions. 1. If a client runs {code} forEach allUnits, is that local only or do all multiplayer units run that code? 2. If a client runs a function like [] call myFunction, the code inside myFunction has {} forEach allUnits, does that run for allUnits in multiplayer as well?

still forum
#

if you run code locally it will be running locally

#

it doesn't do anything magically without you telling it to do that

carmine abyss
#

ty

carmine abyss
#

So when would forEach allUnits be needed? Only server run scripts?

wary vine
#

is i possible to include different files based on a config entry ?

#
if (config isEqualto something) { 
    #include something
} else {
    #include somethingelse
}
high marsh
#

Why not?

tender fossil
#

What to do when A2 server started to crash often after various necessary changes to mission file? Logs show nothing unusual apart from the usual memory dump, and it would be way too much work to go through the changes one by one

peak plover
#

you can id #ifdef in the preprocessor

proven crystal
#

how can i check if a unit is artillery?

carmine abyss
#

@proven crystal sqf private _arty = "B_MBT_01_arty_F"; if (_unit == _arty) then { code };

proven crystal
#

yeah but ho would i make it workable for artilleries from multiple mods, not just specific types

#

tomething like iskindof "Tank" just for artillery

#

i think they all inherit from "MBT_01_arty_base_F" somhow

copper raven
#

Make an array of arty classnames. Or mb there is some value in config that would indicate arty.

ruby breach
#

((typeOf _unit) find "_arty" > -1)

proven crystal
#

hmmmyap that ould work

#

mlrs for the rockets

#

i just came across the getartilleryammo command... that might be a way as well, and might lead to more use

hollow thistle
#
("Artillery" in (getArray (configfile >> "CfgVehicles" >> typeOf _vehicle >> "availableForSupportTypes"))
proven crystal
#

ah very nice

carmine abyss
#
_x enableVehicleSensor ["PassiveRadarSensorComponent", false];
_x enableVehicleSensor ["ActiveRadarSensorComponent", false];
_x enableVehicleSensor ["IRSensorComponent", false];
_x enableVehicleSensor ["LaserSensorComponent", false];
_x enableVehicleSensor ["NVSensorComponent", false];
_x enableVehicleSensor ["VisualSensorComponent", false];```How come anti-air vehicles can still lock on and shoot missiles after disabling all their sensors?
peak plover
#

Do you even need the sensors in order to lock on?

#

you'd be better off removing ammo

carmine abyss
#

I would assume so. What else would they be for?

peak plover
#

for the radar

#

I never got deep into sensors or radars, but I think they are not needed for using missiles

carmine abyss
#

ah, ok ty

still forum
#

@carmine abyss So when would forEach allUnits be needed?
What kind of question is that? forEach allUnits iterates through all units. You need that when you need to iterate through all units

@wary vine is i possible to include different files based on a config entry That's not how the preprocessor works no. Preproc runs before any script runs.

@carmine abyss https://discordapp.com/channels/105462288051380224/105462984087728128/518573130109681694 How's that supposed to work?`A unit can never ever equal a string. That's nonsense.

Sensors are only for detecting enemies afaik. If they already know about the enemy, they don't need sensors to find him.

carmine abyss
#

It's a really dumb question from a dumb person. Sorry code god.

pulsar anchor
#
a = [0];
b = a;
b set [0,1];

both a and b will be [1]

#

Is that intended behaviour? I guess internally they just copy a pointer?

#
a = [0];
b = a apply{_x};
b set [0,1];

fix

still forum
#

b = +a

#

copy a into b

#

instead of passing reference

#

in SQF everything is passed by reference

pulsar anchor
#

wow. Time to document that somewhere...

peak plover
#

bookmark 😂

ruby breach
#

That is documented. Read the wiki.

peak plover
#

dialog controls cannot be rotated?

high marsh
#

you had your answer from dedmen already, what in specific are you trying to achieve? Start with that first.

#

I learned basics from looking at wiki and examples

#

What in specific do you want to try and do?

#

Thoae are all math operators

still forum
#

You just copied the most basic things that are the same in every other language
And even in maths. Did you go to primary school? they teach maths there.

high marsh
#

It's a placeholder for var

still forum
#

a and b?
First two letters of the alphabet?

#

You know.. Like x and y in maths?

#

You are the second guy in one week that calls me rude for saying the truth

#

the other one started raging because I said "I like Inventory" when he asked what the key to open the inventory was

high marsh
still forum
#

Right... Maths... Boolean Algebra..

high marsh
#

Anywho, don't let people hold your hand through learning something new. Tackle it head on and ask questions along the way. Youtube videoa are awful for this.

#

Ratgerial, if you click on the hyperlink for ! a you'll see several examples of how that operator is used

#

Typing on mobile sucks

still forum
#

_a is a local variable.
alive player checks if the player is alive (duh) and stores the true/false it in _a.
if not _a then hint that to the player.

This all combined. If player is not alive then hint "The player is dead!"

high marsh
#

^ Boom

still forum
#

no

#

_a's purpose is to store the result that alive command returns

#

You could also just do

if (!alive player) then {
    hint "The player is dead!";
}

_a isn't really needed here

#

player is you. The player. The unit that you control

high marsh
#

You have event scripts, init fields.

#

Youtube videos are the absolute worse way to do this

still forum
#

worst*

#

"vanilla" ?

restive leaf
#

YouTube videos on scripting will not be very helpful. KillZoneKid's tutorials are pretty good but they assume a certain amount of knowledge, at least in basic coding functionality like a != b 😉

high marsh
#

In the init.sqf, and initPlayerLocal.sqf, player is defined. Player is not defined on server FYK

still forum
#

If I correct you now I'll confuse the beginners 😄 🙊

high marsh
#

Correct it

restive leaf
#

In addition, while SQF is fun ... it is not the right language to learn how to code imho

still forum
#

player is a command. commands cannot be undefined

#

vanilla is full of scripts

#

Ever entered the main menu? scripts! on every button.
Tried the arsenal? Scripts. 100% of it.

high marsh
#

Ok, player object undefined on server.

restive leaf
#

sqf is the same whether you run mods or not...

hollow thistle
#

its not undefined, its "null" 😄

#

if it would be undefined it would be nil

#

correct me if wrong

still forum
#

sqf is the same whether you run mods or not well.. Mods can make sqf bigger 😄

high marsh
#

Fine. Null!

restive leaf
#

LOL

hollow thistle
#

stop that intercept stuff, you will confuse them even more 😄

restive leaf
#

Hello World!

still forum
#

wow that was like 6 or 7 years ago....
I have literally no idea. Something shit.

hollow thistle
#

That would be a certain CTI mission framework 🤣

high marsh
#

Sent things flying into the sky

hollow thistle
#

well maybe the bugfixes for older version were first.

high marsh
#

Editor, you'll eventually need to touch SQF

still forum
#

SQS is basically SQF but just more shit syntax and shouldn't be used.
There is a C++ thing, but I wouldn't recommend to a beginner, you first need C++ AND SQF basics before you can try that

So.. You only have SQF. That's all that arma uses

#

I sent you a link before. To killzone kid's blog with some beginner tutorials

#

Besides these (Which are already outdated and partly crap) I only know of even worse youtube crap that will just teach you how to copy-paste crap code and make it even worse.

astral dawn
#

SO you have this list of commands: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
And you have a context when to execute them. Context can be: event handler (the game calls your code when something happens). You do that with addEventHandler command.
Or the context can be a script which you have created with spawn command.
There are also some mission-specific files which are called by the game, i.e. when it starts the mission, like init.sqf and others: https://community.bistudio.com/wiki/Initialization_Order

#

Start your editor, place a character

#

start the mission

#

You press escape and you have this debug console to mess with

#

You can start your coding efforts with that

high marsh
#

What's confusing about that Ratherial?

still forum
#

You are pretending that programming should be something easy that a 5yo can learn in 5 minutes.
That's not the case. You don't go from crawling to parcour running.
Your try taking small steps, and fall over. Then slowly get into walking, then maybe running a bit, one or the other jump maybe too. And slowly build your way up.

high marsh
#

Do you not know what a string is? An Array? Integers?

vagrant mango
#

Hey all. The the other day saw a Reddit thread that had a starting point to create an actionable off/red/green jump light in the back of a cargo plane. I can't find it now does anyone possibly have that link? I want to mess around with the script a bit.

high marsh
#

@vagrant mango You need to create a light source.

astral dawn
#

You probably need to do some general programming tutorials then, on a more common language

still forum
#

Do you know what a sequence is? do you know what characters are?

high marsh
#
_lightSource = "#lightpoint" createVehicle [0,0,0];
still forum
#

"word" here <--
A sequence of characters. The characters w, o, r and d

#

that's a string

astral dawn
#

Well, in every programming language there are basic data types: numbers, strings, arrays, sometimes structures. First of all you learn what basic types there are, independent of what language you are looking at.

restive leaf
still forum
#

I really think you should stop trying to learn SQF.
Get WHATEVER tutorial on youtube that teaches you the basics of programming. What Language doesn't even matter.
Once you learned how to crawl, you can start trying to learn how to walk.
Don't jump from lying on your back to running around. That just won't work.

vagrant mango
#

That's fair. SQF reads like fucking garbage. It's tough to look at and understand.

still forum
#

Yes. SQF learning youtube videos are garbage

#

I'm not telling you to learn SQF with youtube

restive leaf
#

For learning the very basics of a programing language... which you will very much need to know before tackling SQF

vagrant mango
#

@stuck surge what they're trying to say is there are common concepts in just about every programming language that transfer pretty well. Start somewhere else.

#

Python is widely the most used an accessible..

restive leaf
#

There is not, for SQF

vagrant mango
#

@stuck surge unfortunately not. Programming is either alot of experimenting on your own, or having someone help you out 1:1 which many arent willing to do because of the nature of how they got that knowledge.

still forum
vagrant mango
#

I mean this in a nice way, not being an ass. Google "What is an array". Read until you sorta get it. Then experiment.

astral dawn
#

I would recommend to look at assembler of some basic CPU some time... 🤔 It really teaches you about how programming works

restive leaf
#

LOL!

#

I started with 8086 programing 😉

vagrant mango
#

Oh don't be fucking dicks.

restive leaf
#

I actually did, as far as assembler goes

still forum
#

knowing how to find things out by yourself, and teach yourself things is like the only requirement you need to have to learn programming.
If you don't know how to google things, Or look for tutorials on youtube on your own.. You're kinda goofed. I mean maybe you're lucky and find a guy that's willing to invest his time into you and hold your hand.. He won't do that forever for free.. Because you know.. Teachers are getting paid for such stuff

restive leaf
#

But even in the simplest of programs, you need to understand the very basics, e.g. c #include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; }

vagrant mango
#

The problem is some people learn different. I start at getting someone else to explain or show me the way. Because if I go straight to experimenting I am just breaking pots and not knowing how.

#

Lol what do you mean?

#

I'd recommend starting with Python. Accessible, usable for just about anything, and theres tons of tutorials. It has a benefit of being more human readable.

#

Learn basic flow control and data types/structures

#

Won't know unless you try it.

still forum
#

Dude. You are sitting in a corner constantly telling yourself "I can't do this"
Correct. If you don't get up and start doing things, You'll never do it.
If you don't want to start learning, why do you ask us then?
We give you the answer and you're just like "no i can't do this"

#

correct

#

that's what you want

restive leaf
#

Yep... nothing can teach you how to program, only the building blocks for programing. Programming is an art

#

Yes

still forum
#

Remember the thing about crawling -> walking -> running?
programming is running.
You can't even crawl yet. So don't try learning to run while you can't even crawl.

restive leaf
#

And then one day you will be able to take over the programming of TFAR while Dedmen enjoys his retirement on Lemnos

vagrant mango
#

@stuck surge just do it and follow along. Soak it all in and when you've finished and you have questions about those things you don't totally understand then ask someone.

still forum
#

Okey then bye. If you don't wanna learn, don't waste our time

vagrant mango
#

Not "Do this for me" but "Hey, I'm not clear on how the difference between local and global scope and how the impact your code, can you expand on it?"

restive leaf
#

Then you should probably forget ARMA scripting then

vagrant mango
#

Dude.

#

One at a time.

astral dawn
#

Programming is a really very demanded skill to know today. Especially if you are in engineering or science or close to it. You can apply it in many ways, including arma of course.

high marsh
#

No

astral dawn
#

Well I started by scripting for some other game which had scripting support, on my own... but there were people to help learn further, fortunately.
But you do not require college to learn programming.

restive leaf
#

Not originally no... learned how to program well before college

hollow thistle
#

I'm self taught and work as an developer.

still forum
#

You asked what a+b is supposed to be ¯_(ツ)_/¯

vagrant mango
#

Counts can be pretty fundamental with alot of things. And while I get it, it's also bad form to insult someone who isn't in your position because you expect them to know. Programming isn't my strong suit, security is, if you came to me not understanding what the SUID bit is I wouldn't make fun of you because I think you should know. I'd ask some probing wuestions then explain. It. At the same time @stuck surge you need to just start somewhere. That's the best way. Programmers are pretty notorious for being like "Idk, here's the shitty documentation figure it out like I did". There's a ton of pride in this line of work.

#

Stop stressing. Just jump in and be ready to learn something.

still forum
#

Asking a question is now the same as saying if something is fact? Okey.

earnest ore
#

Oof.

still forum
#

True. I can't really handle idiots that well.
If you have a very specific question I can most certainly give you the answer, but I'm not that good at helping people that know nothing, don't even try to learn things by themselves, and expect everyone to be holding their hand and teach them everything they need to know from the ground up.

hollow thistle
#

I'm not sure if basics is "so much".

still forum
#

No

#

I was a beginner too. I took google and youtube. And learned things till I wasn't not a beginner anymore.

vagrant mango
#

@stuck surge stop. Go do the courses.

earnest ore
#

No, you're an idiot for not taking the free certificate in software development.

still forum
#

@open vigil ^

earnest ore
#

Which is learning how to google.

hollow thistle
#

Dedmen is a type of person that will mop a floor with you in a way that should encourage you to learn if you are not a sensitive flower.

#

Daily scripting drama :d

vagrant mango
#

😑

#

Can we all act like adults..

hollow thistle
#

You know that in the internet you should be ready to take anything with a grain of salt, do you?

#

oh.

#

he's gone.

inner swallow
#

yup.

open vigil
#

Adult stepped in.

earnest ore
#

With a sniper.

hollow thistle
#

I think he really could have ADHD as he said. 😐

#

¯_(ツ)_/¯

still forum
#

If he does, he needs professional help. Not some randoms on some discord.

open vigil
#

ADHD is not a defence for being inconsiderate

restive leaf
#

Everytime he has been here and asked a question he has exploded at someone who answered him tbh (Ratherial that is). First time he exploded at me...

open vigil
#

2nd time today he was removed. This time it’s permanent.

restive leaf
#

LOL, been scripting in the background throughout the conversation 😉

still forum
#

2nd time today. 3rd time this week

twin steppe
shy wharf
#

is there a way to convert this string: "1e11e52eb00# 438914: ammoveh_f.p3d" back into an object?

high marsh
#

No

ruby breach
#

Technically yes, although I don't recommand doing anything this way

#

You should be saving an object you need to retrieve later as a variable. But you can convert that string back into an object using something like so ```sqf
_arr = nearestObjects[player,[],50];
_arr select {(str _x) find "1e11e52eb00" > -1} param [0]

shy wharf
#

I would guess you could loop through all the objects that match

#

that seems pretty terrible though

high marsh
#

It's extremely redundant.

ruby breach
#

But again, that is bad, and you should not be doing that

shy wharf
#

alrighty, thanks for the help

proven crystal
#

shouldnt _unit removeWeapon (secondaryWeapon _unit); work to remove a launcher from a unit?

#

works with handgunweapon and primaryweapon

restive leaf
#

Yes, it should (I think) assuming that the secondaryWeapon is local

#

If not, use removeWeaponGlobal

peak plover
#

@shy wharf why are you doing that?

#

Can you not use a variable?

restive leaf
#

Damn you ARMA! Why would you not barf on this: sqf case "Artillery":{ switch(true)do{ case ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]):{ _index = _ctrl tvAdd [[0,6],_x select 4]; _path = [0,6,_index]; }; default { _index = _ctrl tvAdd [[0,8],_x select 4]; _path = [0,8,_index]; }; };The missing }; on line 724 of a 1574 line SQF script... Not one error in the RPT... And damn you @deft dock ... wtf is with Star Cluster GL rounds being Artillery? 😉 Assume the answer is, as always, ARMA...

peak plover
#

🤢

#

that looks really digusting 😂

restive leaf
#

Why... it's just a fragment of code to sort gear into categories in a trader dialog...

#

Gets funky when I have to do stuff like this (yes, need to add stuff to the String Table): sqf case 3:{ { _index = _ctrl tvAdd [[_mainindex],_x select 0]; _ctrl tvSetPicture [[_mainindex,_index],_x select 1]; _ctrl tvsetValue [[_mainindex,_index],-1]; _sp pushBack [_mainindex,_index]; }forEach [ [localize "STR_HALV_BACKPACKS","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\backpack_ca.paa"], [localize "STR_HALV_GOGGLES","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\goggles_ca.paa"], ["Military Headgear","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\headgear_ca.paa"], ["Civilian Headgear","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\headgear_ca.paa"], ["Military Uniforms","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], ["Male clothes","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], ["Female Clothes","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], [localize "STR_HALV_VESTS","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"], ["Female Vests","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"] ]; };

#

I hate dialog coding though... in any language

peak plover
#

I personally think localization and string tables are stupid and there is only one true language.

#

I don't understand people who write variable names in their native language

restive leaf
#

Well, I have people on from all over the world so localization is just polite

#

Not that I preach what I teach...

peak plover
#

yeah, back to the code

#
            switch(true)do{
                                    case ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]):{
                                        _index = _ctrl tvAdd [[0,6],_x select 4];
                                        _path = [0,6,_index];
                                    };
                                    default {
                                        _index = _ctrl tvAdd [[0,8],_x select 4];
                                        _path = [0,8,_index];
                                    };
#

what is this

#

switch true do

#

what?!??!

ruby breach
#
_thing = [8,6] select ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]);
_index = _ctrl tvAdd [[0,_thing ],_x select 4];
_path = [0,_thing ,_index];
restive leaf
#

Except that it is simply a switch statement enclosed within this switch statement: sqf default { switch(_x select 8)do{ ... }: };which is enclosed in another switch statement

#

You'd really have to see the 616 lines of code in nested switches that categorize the 3213 items available in the traders

peak plover
#

Looks like rewriting too much and slow code

#

But I guess it's life code so it has to be sloppy

#

🤷🏻

restive leaf
#

Life...? No. I do not do Life. Epoch

peak plover
#

It goes in the same category

restive leaf
#

LOL, okay

#

Again... categorizing items into a trader dialog can be complicated. Have heavily modified code written originally in 2014 by someone else... Have plans to rewrite but also have lots of other things to do both related to Epoch and to serious MILSIM

peak plover
#

Is the list completely dynamic?

#

1500 lines seems a lot

restive leaf
#

At a restart yes...

#

3200+ trader items

peak plover
#

ohh, so you generate the list only once per mission load?

restive leaf
#

No... because it has to set up the dialog each time you access the traders. Actually if someone could advise me (maybe offline) on how I might do that (not looking for someone to do the work for me), I would change things. Do hate dialog code though which is why this is code I just make incremental changes to - and mainly outside of the dialog creation portion

#

I do realise that this is not necessarily the best way to do things though 😉 But the scope of sorting all those items, (weapons and mags by mod and type - handgun, ar, lmg, smg, shotgun, gl, launcher, sniper, magazines by what they do - building parts, medical, loot, food & drink, clothing by type - military, male, female, etc.) does require a bit of work.

peak plover
#

So it could be different every time the dialog is opened?

#

Since it's so many items, I would do most of it during pre/postinit if possible

#

And just save stuff into a variable

restive leaf
#

Not that set up no... the items available to sell to a trader will change for example. Was my understanding that globals should be avoided...?

#

Especially one potentially so large

peak plover
#

Wouldn't the game lag or dialog take some time if it's that many items?

restive leaf
#

Actually not

peak plover
#

Why should using globals be avoided?

restive leaf
#

That was what someone said to me once... ? Was told to try and minimize their use in ARMA. I may have been misinformed

#

Back when I was starting out

#

If not then I guess I could just run that code at server restart and store in a global instead of the current local var

#

Extract that bit from the trader menu and simply use it when a player interacts with a trader...

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']);
};
#

It just uses ram

#

I think I tried to crash my game once to see if globals kill performance

#

At ~30million variables the ram usage reset but It didn't crash

#

I think that means it moves stuff from ram to page file or sth

#

Which would be slower

#

So if it needs something next time there might be a stutter. (like when textures load in)

restive leaf
#

I'll work on extracting the code then. Should be pretty easy... And given it would then run on the server at restart it should alleviate any server FPS issues when a trader dialog is opened. My dedi is pretty good so should be good. Thanks, appreciate it

peak plover
#

Also do what gnashes said before

#

If you are rewriting the code

#

I wouldn't even use switch at all

#

ever

restive leaf
#

Will do so... something similar at least. Basically was just modifying not rewriting the code in the past for this particular script (have rewritten several others) but now I will rework it for 2018 😉

winter rose
#

@peak plover again, pure performance vs readability (thus easier maintenance)
The performance difference on the page are for 10000 iterations; for one use the difference is virtually non-existent

peak plover
#

I'd argue that switch is less readable

#

But that's preference

#

He is using switch instead of if / select

#

cuz there's only 2 options in that switch

digital jacinth
#

switch case > if else if else

peak plover
#

Yeah that's true 'tho

proven crystal
#

so im trying to give my zeusses a quick and dirty action to take units around them as prisoners. i have a few issues though. the action and set captive and everything works thats ok, but what i cant seem to get working is to have them drop all their weapons and make the whole thing work with the ace captives system

#

because i want to load them in vehicles and drag them around as well

#

one thing is removal of weapons. i can use removeallweapons, that works, but if i want to use each weapon individually i seem to have issues when using

_unit removeWeaponGlobal (primaryWeapon _unit);
    sleep 1;
_unit removeWeaponGlobal (handgunWeapon _unit);
    sleep 1;
_unit removeWeaponGlobal (secondaryWeapon _unit);
#

wait... it seems to work now....

#

wtf

#

hmmm nope... so it works when i run the line from a units initbox during the mission, but when i run it from a script, it just removes the rifle...

#

hmm yea... so if assign a variable to a unit and then run these lines from the debug console it works

#

but if i spawn this function with the unit, it only removes the rifle

#
FEZ_FNC_Dropweapons = {
    private _unit = _this select 0;

    _unit removeWeaponGlobal (primaryWeapon _unit); 
    _unit removeWeaponGlobal (handgunWeapon _unit); 
    _unit removeWeaponGlobal (secondaryWeapon _unit);

};    
proven crystal
#

also if i do like this, i have to run the functions multiple times....

FEZ_FNC_Dropweapons = {
    private _unit = _this select 0;
    private _weapons = weapons _unit;
    {_unit removeWeaponGlobal _x} foreach _weapons;    
};    
proven crystal
#

alright so that was stupid.... i had my own function overwritten with a non functional one....

#

nevermind then....

proven crystal
#

so after thats solvd: how do i make them ace prisoners so i can load them and drag them around?

#

thought i could just call ace_captives_setHandcuffed but that doesnt seem to work

proven crystal
#

actually it does. so far so good. now i just would like them to use different prisoner animations. that used to work fine with switchmove but nor it seems to put units back into the standing handcuffed animation

#

except if i use "Acts_ExecutionVictim_Loop"

#

these sitting animations dont seem to last "Acts_AidlPsitMstpSsurWnonDnon01","Acts_AidlPsitMstpSsurWnonDnon02","Acts_AidlPsitMstpSsurWnonDnon03","Acts_AidlPsitMstpSsurWnonDnon04","Acts_AidlPsitMstpSsurWnonDnon05"

proven crystal
#

and how can i drop a units vest including its contents into a weaponholder?

#

_unit action ["DropBag", _weaponHolder, backpack _unit]; works for backpacks, vests doesnt seem to have anything siomilar...#

ruby breach
#
private _vest = vest player;
private _vItems = vestItems player;
removeVest player;
private _gwh = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_gwh addItemCargoGlobal [_vest, 1];
{
    (((everyContainer _gwh) select 0) select 1) addItemCargoGlobal [_x, 1];
}forEach _vItems;
``` is one way. Not 100% sure if there's a better way.
#

If I get time later today, I might circle back around and see if there's something more viable. I wrote that a few years back

devout stag
#

Quick question regarding ACRE and RHS

#

I'm trying to use scripting commands from ACRE to add ACRE racks to RHS vehicles, and am having no success. Grabbing documentation for the ACRE commands asap

#

I'm not sure why this won't work with RHS vehicles. I know RHS config's are annoying and badly structured but it shouldn't interfere with scripting commands (I hope...)

proven crystal
#

thanks @ruby breach works as it should

proven crystal
#

now i got to still get the guys to randomize their animations a little. i still dont really understand why the sitting stuff wont work. but i also cant find the reference on how these animations are put together...

carmine abyss
#

@proven crystal private _unit = _this select 0; what is _this referring to?

ruby breach
#

Whatever he passes as a parameter?

frigid raven
#

What do I need to watch out for when "hot swapping" Module init functions? All other functions can be recompiled without restarted Arma with the known approach of having the addon folder at the arma root directory but it does not seem to work with all functions I call through a module init function

still forum
#

_this is the input parameter that you get when you call or spawn or execVM or whatever a function

carmine abyss
#

I know that I just didn't see the parameters

still forum
#

well there are none. he's not calling the func

peak plover
#

Is there a simple way to

#

have a texture be the same size on the in-game hud as in photoshop?

still forum
#

you know you can zoom in photoshop right?

#

and you know that there are displays with different DPI right?

#

And you know that people can change the ingame hud size right?

peak plover
#

safezoneh/w

still forum
#

My idea would be. Store the size in pixels. And use the pixelGrid system

#

safezone doesn't give you screen resolution, nor DPI

#

imagine someone looking at it on a phone screen. You just won't ever possibly get the same size as in your photoshop on your desktop

peak plover
#

I want the element to always be the same size

#

No matter scren

#

aspect ratio

#

With safezoneW it seems to do that

still forum
#

what is your definition of "size" ?

#

centimeters, pixels, aspect ratio, percentage of screen size

peak plover
#

percentage of screen

still forum
#

then safezone should work. But safezone respects GUI size I think. So you'd have to account for that somehow. Are there maybe safezone commands that ignore gui size?

peak plover
#

Yeah

#

But can I kind of somehow now make it so that it's the same in photoshop?

lucid junco
#

hey there. Do someone know how to disable fireflyies???? after update i have scenerio full of them 😄

peak plover
#

So I could measure stuff in photoshop and just write the configs without trial and error

#

@lucid junco enableSimulation [false,true]

#

wrong sorry

still forum
#

again. Size is relative.

peak plover
still forum
#

"in photoshop" yeah.. Zoom.

peak plover
#

@lucid junco

still forum
#

taking your screen size. And the image size in pixels. Then calc that down to percentages
But keep in mind that safezone is not edge of screen

peak plover
#

oooh

#

I see

lucid junco
#

@peak plover thanks man. didnt know where to start to search this

peak plover
#

Np, you should ALWAYS disable the animals for multiplayer

#

they are not synced and will cause people to see rabbits that no one else can see

#

What do you mean by that dedmen, safezoneX is left side safezonx+safezonew is the right side, right?

still forum
#

no

#

it's still a bit off of the edge of the screen

#

as you can see. Read ends sometimes before it reaches the end of the screen

peak plover
#

hmm

#

So if I change to very small

#

it would not be on the edge?

still forum
#

apparently the safezone Abs commands can fix that tho

peak plover
#

So how would I be able to break it?

#

Change from very small to large?

#

And it should not be on the corner anymore?

still forum
#

The size will probably change somehow.
Best you just try around

still forum
#

looks like battlefield 😄
Maybe you'll have more luck with pixelGrid.. I never t ried that

peak plover
#

No

#

that's perfect

#

the 2 screenshots

#

have different sizes

#

But hud is exactly the same size

#

that's what I want

still forum
#

confused well. Good night 🛏
Already 2 hours over when i planned to sleep ffs

peak plover
#

😴

sturdy cape
#

what can i do to select a thrown object to pass it to a script?

tame portal
#

@peak plover oh youre nigel?

#

my slow brain only realized that now lol

peak plover
#

🤔

tame portal
peak plover
#

I forced to the side and bottom with safezone

#

I don't think I can use pixel here

#

Because the texutre at the bottom

#

it would get stretched

#

From what I understand pixelgrid is not really for that

high marsh
#

Having problems with your life config huh?

peak plover
#

👺 is not life code

#

MidnightToday at 4:04 AM

#

It's PAST MIDNIGHT

peak plover
#

@sturdy cape what can i do to select a thrown object to pass it to a script?

#

["CAManBase", "Fired", {_this call health_fnc_onFired;}, true, [], true] call CBA_fnc_addClassEventHandler;
#
// grenade
659: handgrenade_throw.p3d
#

Do you mean like this?

#
health_fnc_onFired = {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

    private _varName = str _projectile;
    health_firedNamespace setVariable [_varName,[_unit,_weapon,_magazine,(velocity _projectile)]];
    health_firedNamespace_variables pushBack (_varName);

    // check if the namespace should be cleaned
    if ((missionNamespace getVariable ['health_firedNamespace_nextClean',CBA_Missiontime])> CBA_Missiontime) exitWith {};
    call {

        // set time for next clean
        missionNamespace setVariable ['health_firedNamespace_nextClean',CBA_Missiontime + 1]; // todo bigger delay

        private _variableCount = count (health_firedNamespace_variables);

        // only clean if more than 300 variables
        if (_variableCount < 300) exitWith {};

        // delete amt will be 100 less than the total amount
        private _deleteAmount = _variableCount - 100;


        // loop through the first 100 and set them to nil in the firedNamespace
        for '_i' from 0 to _deleteAmount do {
            health_firedNamespace setVariable [health_firedNamespace_variables # _i,nil];
        };

        // delete the oones that were set to nil from variables array
        health_firedNamespace_variables deleteRange [0,_deleteAmount+1];
    };
};
#
//[blu_0_1,"Throw","HandGrenade",[0,0,0]]```
peak plover
#

Does anyone know if I can turn the following into a simple math?

#

        private _stopAt = mission_health_fullHP / 3;
        _stopAt = call {
            if (_hp > _stopAt*2) exitWith {
                _stopAt*2
            };
            if (_hp > _stopAt) exitWith {
                _stopAt
            };
            0
        };
still forum
#

Well I know how to make it simpler I guess

if (_hp < _stopAt) exitWith { 0 };
[_stopAt, _stopAt*2] select (_hp > _stopAt*2)

More expensive. but simpler

sturdy cape
#

Well id prefer to work without xeh.just need to select the ammo object on the ground as param

peak plover
#

I thought there would be like a special division and super math for that 😂

#

Without XEH? @sturdy cape

#

Do you guys not have CBA?

queen cargo
#

i am not sure what that code is supposed to do

#

especially because my head is currently somewhere else

peak plover
#

I divided my hp into 3 chunks

#

I want it to stop at one of those chunks based on which chunk it is in right now

#

I was wondering if a simple math equation could replace if etc.

queen cargo
#

but: to get it "cleaner":

private _stopAt = mission_health_fullHP / 3;
_stopAt = switch (true) do
{
    case (_hp > _stopAt * 2): { _stopAt * 2; }
    case (_hp > _stopAt): { _stopAt; }
    default: { 0 };
};```
#

chances are however, that this is the slowest variant

peak plover
#

hmm, yeah, I thought there's a math formula for sth like that

queen cargo
#

well ... technically, there is

peak plover
#

The cleanest way is for me to define the code for my call as a function and then just call that one 😄

queen cargo
#
fnc_ceil_to_neirest = {
    params ["_val", "_multiple"];
    ceil (_val / _multiple) * _multiple;
};
[_hp, mission_healt_fullHp] call fnc_ceil_to_neirest;```
#

hf

#

will not really get simpler

#

you may want to use floor though

#

depending on your requirements

#

as this would still round up 🤷

peak plover
#

neirest 😂

#

Aite, thanks 😄

queen cargo
#

stupidity

#

as i said

#

at work now

#

not really that much of a fast thinker then besides work related stuff

ornate sky
#

So they introduced BIS_fnc_3DENExportSQF which exports everything from EDEN, including markers and vehicle customizations to be called and dynamically recreated in a ZEUS mission, or a regular mission I suppose.

I managed to export the code from EDEN with it, but how do I actually use it in a zeus mission? The calling parameters are not documented or I can't find them...

still forum
#

just look into the script it generated

#

if it takes parameters, you'll read that in there

ornate sky
#

right, it takes a forest of arrays, do you happen to have an example?

still forum
#

it takes? Are you sure?

#

It should contains tons of arrays with all the info. I don't know what parameters it could even take. Can't think of anything that would make sense there

ornate sky
#

params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];

#

this is the first generated line, I'm guessing the reason it's not executing is that

still forum
#

every parameter has a default value

#

so I'd say. Just don't pass anything

ornate sky
#

I tried calling it without supplying arguments, but it doesn't spawn anything or give any error

#

you're supposed to call it from the debug console during a zeus mission for example?

still forum
#

I guess so yeah

ornate sky
#

alright, I'll dig around and if I find anything I'll post back

runic rose
#

Module Scripting in 1.86 with is3DEN = 1: 'init' mode is no longer called when the module is placed in 3den. Only 'attributesChanged3DEN' seems to be called now.
Does anyone know if this change is intentional?

proven crystal
#

how can i turn a bundle of sqf scripts that are supposed to be called server side on mission startup, into a server side mod? in their script version i start everything from initserver.sqf

digital jacinth
#

if !(isServer) exitWith {};

#

another thing could be just mount the mod as servermod only

proven crystal
#

so i just have to convert the stuff in pbo and load it on the server?

#

or is there more to it?

#

i mean i see stuff like config.cpps exist, and i dont have a clue what that might be for

#

so really i need the basics right i guess

digital jacinth
#

Not really that different. the config.cpp is bascially a description.ext with a whole lot of more options

#

so if you specify cfgFunctions or some preInit or postInit, it works the same in config.cpp

proven crystal
#

hmm i did not do that. i just load my functions as variables

digital jacinth
#

e.g. you can add something similar like this into it

class Extended_PreInit_EventHandlers {
  class diwako_ragdoll {
    init = "call compile preprocessFileLineNumbers 'diwako_ragdoll\functions\diwako\ragdoll\cba_settings.sqf'";
  };
};

Just use serverinit instead

#

But this will require CBA

proven crystal
#

thats ok i use cba anyway

#

so that would go into config.cpp?

digital jacinth
#

this is just an example, but for a script only based mod it is enough

proven crystal
#

alright ill try and play around with it.

#

yea its just a few actions and modules for zeusses and a shooting range thingy. so nothing with models or sounds or anything

digital jacinth
#

modules for zeuses need to be run by clients, unless you remoteExec the code from server onto clients

proven crystal
#

yes i do that

digital jacinth
#

Just to make sure, you do mean Ares/achilles modules, not ones that are defined in config like vanilla or ace modules

proven crystal
#

yep, its achilles

#

so the my config.cpp would look somewhat like this?

class CfgPatches {
  class FEZ {
    units[] = {};
    weapons[] = {};
    requiredVersion = 1.83;
    requiredAddons[] = {
      "ace_medical"
      ,"cba_common"
      ,"ace_common"
    };
    author[] = {"Fetzen"};
    authorUrl = "";
    version = "1.0";
    versionStr = "1.0";
    license = "https://www.bohemia.net/community/licenses/arma-public-license-share-alike";
  };
};

class Extended_PreInit_EventHandlers {
  class FEZ {
    init = "call compile preprocessFileLineNumbers 'FEZ\Fez_Init.sqf'";
  };
};
tough abyss
#

oo

proven crystal
#

oO

digital jacinth
#

i doubt you need ace_medical and ace_common in the required addon aarray., license is optional and only added by me.

#

now oyu need to look out that your pbo prefix is "FEZ" and the file called "FEZ_Init.sqf" is in the root folder of the pbo

#

also try serverinit instead of init in the preinit eh

proven crystal
#

roger

#

well one of the functions uses ace medical, so ill leave that in there

#

but i figure ill have to delay workon this for the moment because of this

#

ace tracers pbo is outdated

#

error message

#

which apparently is not only an issue with my own mission file

#

anyone else here having that?

still forum
#

Well.. Is your ace tracers outdated?

proven crystal
#

i wouldnt know why it would outdate between yeterday and today?

#

i mean there was that arma update, so i wanted to check if this is a common issue maybe?

still forum
#

Uh well.. How about the ace update from today?

proven crystal
#

ah damn, yes i ran a modpack that contains ace instead of the real thing

proven crystal
#

ok so i would have my @fez folder and inside that i have a fez.pbo and the config.cpp right. the fez_init.sqf is in the root of that pbo

#

should do?

still forum
#

yes, no, yes, yes

#

your pbo is in the addons folder inside your @fez
and ..... edits message

proven crystal
#

ok... @fez\addons\fez.pbo

#

and @fez\config.cpp

still forum
#

@fez\config.cpp? wat?

#

config.cpp inside fez.pbo

proven crystal
#

oh alright... thats why i keep asking these things ^^

#

Ok i see others have a mod.cpp in the main mod folders. Thats for displaying general mod info?

still forum
#

ju

proven crystal
#

ok... and a key i understand would only be required if its also a client side mod?

still forum
#

ye

proven crystal
#

would it cause issues if clients have it loaded and no key available?

still forum
#

with verifySignatures enabled you wouldn't be able to join servers

proven crystal
#

ok so just to be sure i would create a key anyway. although i think our unit server doesnt do it. there is a modpack that is only partially signed

proven crystal
#

hurra this seems to work nicely!

#

thanks everyone, i have just created my first little mod

#

needs some finetuning though

#

it seems to want to load some functions already when i open the editor... how could i prevent that?

still forum
#

use the is3DEN commands to detect editor

proven crystal
#

hmm so a waituntil {!is3DEN} or so somewhere?

#

sounds inefficient

peak plover
#

if (is3den) exitWith {};

proven crystal
#

but will it load the stuff then when i launch a game from eden? if it has exited the scripts before? or does it launch the whole stuff again when i hit "play in multiplayer"?

peak plover
#

preInit will run

proven crystal
#

ahyes... sweetness. all works like a charm

tardy ingot
#

Is it no-longer possible to switch the owner of a zeus module via the scripting API? (I had missions that depended on the ability to switch zeus based on in game pickups that no longer work)

peak plover
#

I haven't tried online, but it worked in local multiplayer an hour ago

proven crystal
#

so i figured out to make keys and everything, but how do i pack the stuff with the addon builder? do i have to do it directory by directory?

#

with pbo manager i just pack the whole thing but i dont think i can binarize the sqfs with it

#

hmmm works if i dont binarize i guess

still forum
#

sqf's can't be binarized 🤔

proven crystal
#

ah ok. was just hoping i could hide my crappy code ^^

pure blade
#

do you mean obfuscation?

proven crystal
#

making it unreadable. i thought it was both the same thing yep

still forum
#

obfuscation!=encryption!=binarization

#

they are all wildly different things

#

Also we help you here getting your code working. And you thank the people that help you by hiding it from everyone and preventing people from potentially learning from your code?

proven crystal
#

no just until i cleaned it up!

still forum
#

shakes head

proven crystal
#

i wouldnt mind people looking it in general. ont worry. i did send it to some poeple already.

#

theres a whole page full of really unnecessary remoteexecutes for some actions.... it just looks shit this way

still forum
#

put it on github. open source. And then send people the link so that they can drop comments everywhere 😄

proven crystal
#

the whole point of my question was to avoid that embarressment until the new year :D

still forum
#

Okey i can wait till then. Enjoy your new year banana cake
🍌 🍰

proven crystal
#

dont be mean when i do 😬

peak plover
#

Whoa, banana cake is great

#

🍰

#

Best form of obsfucating is writing terrible code

#

No one can steal your code if it's broken and does not work

#

🤔

still forum
#

They can. And you have been here for long enough that you should know that people will still steal broken stupid code

peak plover
#

true

#

nvm

still forum
#

lul. was already waiting

peak plover
#

Instead of doing if checks or writing the same function twice, sometimes when the function can be similar, it would take less space to write it only once and do the changes to the string

#

So having 2 - 3 more specific functions with a lot of less checks in each and only writing all the code once

#

but it doesn't make a big difference and is pointles

#

Unless it's something that runs like every frame for every unit or sth

nimble raven
#

Looking for a script that i can place on a radar that pretty much deletes (would prefer if they blew up) bombs dropped from planes?

peak plover
#

I haven't seen one

#

But I guess safe zone scripts are kind of like that

#

@nimble raven Do you know if the bombs work on the fired EH?

#

["CAManBase", "Fired", {systemChat str _this}, true, [], true] call CBA_fnc_addClassEventHandler;
#

This, but for the plane

#

And then if it has the bomb in there

#

You can add a per frame handler and check if the bomb is near the radar or if a radar is near the bomb

#

Then copy the position of the bomb and delete the bomb.
Spawn in an explosion

#

Because I think you can't setDamage 1 for bombs and cause them to explode

proven crystal
#

I think you can

vapid drift
#

I posted in help and was referred here... is it possible to store variables on bullets using the fired event handler?

peak plover
#

yes

#

kind of

#

bullets don't have a namespace, but you can str the bullet and use that as variable name

vapid drift
#

@peak plover Well... I was doing that but the problem was the ability to access the variables once the bullet became a nullObj

#

So I tried storing the bullet as str from the beginning and doing call compile _projectile to access the actual obj but it seems like having a colon in the name is messing it up

peak plover
#

what do you need of it after the bulelt is null?

#

if it's objNull it is gone

vapid drift
#

remove the variables stored on the player with the bullets name

peak plover
#

What do you mean by that

vapid drift
#

I was using a naming scheme like TFR_%1_path... an array stored on the shooter that tracks the bullet's path

#

when the bullets name is stored as a str, that's easy enough

peak plover
#

You want to track the path?

vapid drift
#

but when I'm tracking the path I can't use getPos on the str and I can't seem to get back to an object reference

#

Yeah, I need to track the path and some other things

peak plover
#

Tracking the path means you are saving the position on every frame

vapid drift
#

Not every frame, but yeah, that's the idea

peak plover
#

All you need is to run a cba PFH when the gun fires

#

Pass the projectile as an argument

#

no need to str

vapid drift
#

PFH?

peak plover
#

per frame handle

#

like this line 38

vapid drift
#

So this is where it gets tricky then

peak plover
#

What do you mean

vapid drift
#

What I'm trying to do is track the projectile until it hits a "target"

#

the targets have event listeners and tell the shooter that it has been hit so it stops tracking the projectile

peak plover
#

Do you mean even if it misses ?

#

or a target as in a man?

vapid drift
#

target will be an animal but it can be anything at this point really

peak plover
#

then just use hit eventhandler

#

You don't need to track it every frame

vapid drift
#

No man hold on, I'm trying to explain what happens

peak plover
#

yea

#

Do that

vapid drift
#

Once the projectile stops being tracked, the "target" connects the impact position with the last tracked point to get the angle the bullet was traveling

#

then I have to do some other mathmagician stuff to figure out whether or not that would intersect where I have notional "organs"

#

If it always hit, this wouldn't be difficult either but you already referenced the "misses" and that's the real problem. Clearing these variables on a miss

peak plover
#

not sure how many memory points animals have

#

but you can attachTo some objects inside the animal

#

Sure, yes

#

for the projectile

#

You can just save the position into an array

#

ex

#

PFH runs when bullet is fired

vapid drift
#

Well that's what I'm doing but once the projectile becomes null, I have no way to reference the stored data

#

On hits I can clean it up fine because I have another _projectile reference from the hitPart eventListener

#

but on a miss, the projectile just becomes a null object all that path data remains

peak plover
#
// as arguments for pfh:
[_projectile,str _projectile,_firedBy];
// PFH
params ['_args','_handle'];
_args params ['_projectile','_projectileStr','_firedBy'];
private _arr =  missionNamespace getVariable [_projectileStr,[]];
If (isNull _projectile) exitWith {
    // remove the PFH with _handle
    // use the firedBy (player object who fired)
    // and the array from projectileStr
};


_arr pushback (getPosASL _projectile
#

I really think it would be easier to avoid using the PFH and use hitPart EH if possible

#

no way to reference data stored just store the str _projectiel as an argument

#

@vapid drift Test this out:
Put objects inside the animal to represent organs

#

Add hit eventhandlers to the objects

#

Attach objects to the animal

#

See if th bullet penetrates the animal and hits the objects

#

That might be the easiest way to do it

vapid drift
#

that's what I wanted to do to begin with

drowsy axle
#

Hey guys, Has anyone had a look at Warlords yet? I was wondering about a few things...

vapid drift
#

I even though about making my own custom helper object type organs

peak plover
#

@drowsy axle I did, ask away

drowsy axle
#

How do the CP get taken away.

vapid drift
#

that would eliminate all of this work but using existing items is a no go because of the awkward sizes

peak plover
#

I was thinking more of like a soda can

#

some vanilla items

#

@drowsy axle what do you mean

vapid drift
#

@peak plover I'll play around some more with the string stuff and see if I can get it to work

#

I tried some objects roughly the size of lungs and what not but a .50 couldn't penetrate them so... lol

peak plover
#

What's the issue with the str thing?

#

Did you get it now btw?

#

@drowsy axle

_add = -100
{
    _x setVariable ["BIS_WL_funds", (_x getVariable "BIS_WL_funds") + _add, TRUE];
} forEach BIS_WL_allWarlords;
vapid drift
#

The string thing is that I either have an array of strings or an array of objects

drowsy axle
#

Ahh cool @peak plover

vapid drift
#

And they both have their own problems

peak plover
#

What problems?

#

You don't need an array of strings