#arma3_scripting

1 messages ยท Page 522 of 1

swift crane
#

@still forum i have units inside trigger, but i have empty array after using "thislist"

#

hint str thislist

winter rose
#

is the trigger set to detect these units? like an "opfor" trigger won't be triggered by blufor

swift crane
#

aaa

#

right

winter rose
#

๐Ÿ˜‰

frigid raven
#

Are there any restrictions using an image (as .paa) as an UI background?

winter rose
#

no, just that they still need to be 2^x ร— 2^y (256ร—512, 1024ร—128, etc)

frigid raven
#

Alrighty

swift crane
#

how to use sleep command in triger activation? I want to use a little "pause" there

digital hollow
#

put your sleep and code after it in a spawn

maiden warren
#

Hey, how can I reset variables value back to 0 when it reaches certain value?

#

I have variable A = 0, every time you do stuff it gets +1 and it works fine, but I'm wondering how would I make it so when A = 5 it resets back to 0

#

omg never mind I just answered it lol

digital hollow
#

Rubber duck debugging: it's less embarrassing when your rubber duck is a rubber duck on your desk instead of a public discord channel =p

maiden warren
#

it's better on paper ๐Ÿ˜„

winter rose
#

joke aside, rubber duck works

tough abyss
#

Use % @maiden warren

maiden warren
#

It's all working fine thanks ๐Ÿ˜›

#

% though?

tough abyss
#

A = (A + 1) % 5

cursive whale
#

Modulo operator (remainder after division), so; _a = _a % 5;

#

ninja'd

tough abyss
#

When A + 1 == 5 , A will be assigned 0

thin pond
#

I'm using _backpack = "UK3CB_BAF_B_Carryall_OLI" createVehicle [5981.75,6329.81,0]; to create a backpack on a desired position, which works perfectly but is there a way i can add items to that backpack ? Also if i would spawn a box is there a way to add "addactions" on spawn ?

still forum
#

addItemCargo addWeaponCargo addMagazineCargo and so on script commands

thin pond
#

Nevermind

still forum
#

_backpack addWeaponCargo ["M16",4];

thin pond
#

made it work but I'm using something else to achive my desired functionality

tough abyss
sick drum
#

What do I need to do to make an objective complete after doing a certain action like killing something

quaint ivy
#

Hey can someone explain my why my function doesn't work if i use call but it does if i use spawn? It's dependent on arguments so I think calling it doesn't pass them where as spawning them does.

still forum
#

Cannot sleep in unscheduled

#

spawn makes sure script is in scheduled

#

call might cause it to be unscheduled

quaint ivy
#

ah alright

#

I had some sleep leftover from when i was testing it with execVM

still forum
#

execVM is a spawn. Thus it works

quaint ivy
#

yup, I just forgot to remove some sleep lines that i had for debugging

#

Another question, why Isn't function viewer letting me recompile the function?

still forum
#

maybe it's compileFinal'ed?

#

if it is, nothing can overwrite it

quaint ivy
#

Im working with CfgFunctions for the first time. Is there an attribute to make it compile instead of compileFinal?

high marsh
#

but if you use call in scheduled then aren't you still in scheduled?

still forum
#

yes

#

Yes. There is a allowRecompile entry for cfgFunctions

#

don't know at which level you need to set that

quaint ivy
#

I think in the function itself

high marsh
#

@tough abyss ๐Ÿ–•

tough abyss
#

You can set it in mission config afaik and then recompile selected function from viewer

high marsh
#

does this also affect BIS_fnc_recompile?

still forum
#

yes

quaint ivy
#

When an object is deleted with deleteVehicle, does it's variable get removed from memory since it becomes nil?

still forum
#

"yes"

quaint ivy
#

And what about an array of objects when each object gets deleted?

astral dawn
#

Well, I think an array-variable assigned to object doesn't get deleted because arrays are referenced in SQF, so it will be deleted only when it's dereferenced everywhere
^ this is not what you ask about here And what about an array of objects when each object gets deleted?

#

so, how's array of objects going to be different from one object? I don't understand

quaint ivy
#

So I'd have to manually nil it to get it deleted from memory? Im trying to make a persistent mission so I'm making sure that no variables stay in memory once they're not needed

astral dawn
#

oh, your array will become an array of null-objects if you delete all objects from the array

tough abyss
#

Use private variables they are deleted when scope ends

still forum
#

variables are reference counted

#

when last reference is gone. They are gone

quaint ivy
#

@tough abyss I would but i need certain other functions to access the variable before removing it.

tough abyss
#

toss them around via arguments to functions

quaint ivy
#

without passing them as arguments

tough abyss
#

and why is that?

quaint ivy
#

because I said functions but I meant triggers

tough abyss
#

what are inside variables and how many do you have? Understand that trying to clean after yourself could be counterproductive

quaint ivy
#

Im working on objective spawning. Need to use triggers for checking if its complete and doing cleanup of remaining junk that was spawned by the objective function

#

Since the mission is going to be persistent and dynamic im trying to make each mission a thing of its own without overlapping with any previous one.

astral dawn
#

you might look into my (or other) OOP implementations for SQF
I was going add auto serialization of member variables to it... in future not far away

quaint ivy
#

OOP?

astral dawn
#

well what is your "mission"? It's a few variables I assume, per every "mission" ""object""?

#

so you might want to save states of your object into profile namespace...

#

as I understand it

quaint ivy
#

Yeah a couple of variables such as target object, array of enemies spawned by the mission and similar

astral dawn
#

you can go like this of course: per every mission create an array, in the array every element ID corresponds to some variable, then you have some global variable with is array with missions... ๐Ÿคท

sturdy cape
#

i am creating a gas mask overlay via CutRsc and it will cover the scroll menu now,what can i do?setting its layer number to lower nor higher didnt do anything

tough abyss
#

What @astral dawn said. You can create location object and setVariables on it, then delete object when done and all the data will disappear with it

astral dawn
#

well yeah creating dummy objects is also an option actually

#

CBA has something like createNamespace AFAIK

#

which creates a dummy... namespace where you can setVariable, getVariable

quaint ivy
#

and then simply delete the namespace

astral dawn
#

in fact CBA uses exactly arma's Location objects for that xD

tough abyss
#

the namespace will be object, because you cannot create proper namespace in Arma

astral dawn
#

yeah create function like mission_fnc_delete, which will run cleanup code for your object, then do deleteVehicle _object;

quaint ivy
#

I can create a game logic to use as a namespace and then at the end of its use just make it delete itself

tough abyss
#

locations are not network synced so no danger to overwrite those vars remotely

#

no gamelogic will be global object, you don't want to do that

#

this is where you do not reinvent the wheel but use tried and tested methods

astral dawn
#

BIS use a similar tactic as I have seen in their task framework, but they use missionNamespace for all 'objects', and generate unique names for every new 'object'

#

but you can't save an object handle into profileNamespace by the way ๐Ÿค”

#

I didn't try but I guess it makes no sense

still forum
#

They cannot serialize between different sessions

tough abyss
#

you will need to serialize just like you do in c++

thin pond
#

is there a way to make it a condition within "IF" when the player has equiped a weapon ? any weapon, just the fact that he has one equiped

still forum
#

currentWeapon player != ""

#

doesn't have no weapon == has a weapon

thin pond
#

my brain is working like a charm today already found out sorry

still forum
#

rubber ducky

#

๐Ÿฆ†

winter rose
#

oh. it seems agents can't drive.

#

edit: they can, but not with "VEHICLE PLANNED" mode (setDestination)
"LEADER PLANNED" works just fine.

unborn ether
#

I once wanted to become a Frankenstein by createVehicle a unit and force him to do something.

#

Didn't succeeded for now.

#

But you actually can animate it the same way.

winter rose
#

it's actually a weird request, but wasn't there a way to trigger FADE by script?

unborn ether
#

@winter rose fade?

winter rose
#

the copy protection, degrading the game little by little

unborn ether
#

Oh, well you can just spawn empty while's

winter rose
#

fork bomb, that I know ๐Ÿ˜„

unborn ether
#

If you seeking for some normal way, I don't think there is

winter rose
#

I wanted to see it by my own eyes ๐Ÿ˜ข

high marsh
#

CutRSC

thin pond
#
player setPos [11775.2,2833.33];

//GEAR
removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeUniform player;
removeVest player;
removeBackpack player;
removeHeadgear player;
removeGoggles player;
player forceAddUniform "U_BG_Guerrilla_6_1";

//SIDE

//MESSAGE
cutText ["<t color='#ff7800' size='3'>TEXT</t><br/>", "PLAIN DOWN", -1, false, true];``` thats the teleport script I currently use and i would like to change the players side if he teleports any chance i could do this ?
high marsh
#

but there are title effects inside the trigger properties yes

#

@winter rose

#

@thin pond group the player to the side'

#
[player] joinSilent (createGroup east);
winter rose
#

@high marsh wait what? sorry, I didn't get this ^^"

high marsh
#

Under Trigger Effects in the trigger, select the TM overlay in the UI Overlay dropdown menu

#

Although, it looks like as I am testing them now. None of them work?

#

They should be their own resource in config

#

so you could use cutRSC

winter rose
#

I was talking about FADE effects, as if I cracked the game; not splashscreens though

high marsh
#

Ohh...

#

BIS_fnc_blackOut & BIS_fnc_blackIn ?

winter rose
#

naaah :p

#

FADE not as in fade in or fade out, FADE as F.A.D.E, the copy protection system

#

FADE (or DEGRADE) is digital rights management software developed by Codemasters. It operates by detecting if a game has been pirated, and initially allows the player to use the game normally. It then gradually degrades certain game features over a time, eventually rendering...

high marsh
#

ARMA 3 released on September, 2013 uses FADE as piracy protection.

#

So I assume yes

winter rose
#

maybe one cannot trigger it manually, IDK

unborn ether
#

I don't think that's some open to use context in Arma as application

thin pond
#

@high marsh I cant seem to make that work as it gives me an error "objecttype expected array"

tough abyss
#

@thin pond you can remove everything from player with a single command, for example

player setUnitLoadout "C_Soldier_VR_F";

BAM! bare unit

winter rose
#

oooh

frigid raven
#

UI .hpp file questions here allowed?

#

like how to set an .paa image as background

robust hollow
#

text="img.paa"; ๐Ÿ‘Œ

frigid raven
#

Yeah but I have a case where it does not really work - still trying out stuff before I ask

robust hollow
#

why doesnt it work

tough abyss
#

What doesnโ€™t work?

frigid raven
#

ok it works now

#
            font = "PuristaMedium";

removed that it now it works

frigid raven
#

does that actually work?

#

cause I am not able to move the dialog by dragging. That's what I intentionally wanted to do after that flag set to true

robust hollow
#

you set moving=1; on the control that you want to click to move, and then movingEnable=1; on the display itself. i do believe there is more options than just 0 and 1, but idk what they do.

tough abyss
#

MovingEnable does shit in Arma3

#

Add style ST_TITLE_BAR to control you want to move and it should do it

frigid raven
#

when adding the style to a ControlsBackground - will all normal Controls be moved with it?

frigid raven
#

crap can't change it's style since it's the picture

thin pond
#

Is there any way to set vehicles as medical vehicles by classname ? Back in the days you could define it through the editor modules

leaden venture
#

Does anyone know a way to open the vehicle garage on one single vehicle so I can edit it's appearance? The Achilles mod has this included and I'd like to do it with a script

thin pond
#

@leaden venture I'll second on this... looking for the same thing

thin pond
#

hm i dont quite know how to get this working with a set "customization area" and a "addaction"

#

also im running into problems with "cuttext" as some of the awesome german letter (รค,รผ,รถ) are not being displayed sometimes

tough abyss
#

crap can't change it's style since it's the picture this is not how styles work, they are bitflags, you can combine different styles together. But I donโ€™t think backgroundControls are meant to be interacted with, so Iโ€™m at a loss why would one want to do that @frigid raven

still forum
#

@winter rose @high marsh fade is not enabled in the steam version. Maybe it was back then. Not anymore/currently.

frigid raven
#

too late

#

I already broke the law

still forum
#

๐Ÿš“

winter rose
#

@still forum thanks for the intel!

still forum
#

Splendid!
Bye for now

winter rose
#

Hahaha! Beware of the ยฉ ^^

long pewter
#

If a mission file needs additional .sqf files, where do the additional files go<

tough abyss
#

In the mission folder

long pewter
#

safe

frigid raven
#

So i have a maker my_marker. I want to copy it somehow so I can delete it now and just "revive" it later with the same attributes. Besides saving all of its information markerPos etc. and just create a new one. - is there a convenient way to do so?

robust hollow
#

hide it by setting alpha 0?

frigid raven
#

Nah I really want to recreate the marker

#

and remove the old one

#

cause of server restarts etc (persistence stuff)

#
private _oldMarker = copyMarker "myMarker";
private _newMarker = createMarker _oldMarker;

just thought something like this exists mybe

robust hollow
#

fair enough. i dont think there is anything simpler than saving the individual attributes and applying them later.

frigid raven
#

okay then ๐Ÿ˜ฆ

tough abyss
#

@frigid raven where are you saving it?

frigid raven
#

extDB3 and/or MongoDB webservice why?

#

well I see the point here - up to that point I have to strip all parameters from the marker anyway to store it in a database eh?

#

nevermind tho - already found a way now

tough abyss
#

Make a serialize function to store it in a string and de-serialize to load from it

frigid raven
#

aye that's what I am about to do

long bolt
#

Hey, just wondering if i could grab some help real quick, basically i have a large script in my init.sqf. is there a way i can put that code into a custom sqf file and call it to the init.sqf?

still forum
#

put into file.sqf
and just write
[] execVM "file.sqf" in your init.sqf it will execute the code in file.sqf

astral dawn
#

Why not call it? Execvm will do the script asynchronously

long bolt
#

Ill try that now but for it doesnt work on my add action code when i do that even when i call it

frigid raven
#
#include "script_component.hpp"
/*
 * Author: xetra11
 *
 * serializes a marker to a hash object
 *
 * Arguments:
 * 0: _marker <STRING> - name of the marker
 *
 * Return Value:
 * _serializedMarker - <CBA_HASH>
 *
 * Example:
 * Trivial
 *
 * Public: No
 *
 * Scope: Global
 */

params [["_marker", ""]];

if (_marker isEqualTo "") exitWith { ERROR("_marker was empty string") };
private _serializedMarker = EMPTY_HASH;

{
  private _value = [_marker] call _x;
  [_serializedMarker, "marker_param_" + _forEachIndex, _value] call CBA_fnc_hashSet;
} forEach [
    { _this select 1 }, // simply storing the name
    { markerPos _this select 1 },
    { markerSize _this select 1 },
    { markerShape _this select 1 },
    { markerText _this select 1 },
    { markerBrush _this select 1 },
    { markerDir _this select 1 },
    { markerColor _this select 1 }];

DEBUG("marker serialized");
_serializedMarker;

Looks a bit hacky but can this actually work?

still forum
#

why not just put everything into one array. And store that as one entry

#

And why have _this select 1 everywhere. Why not just pass the marker as _this?

#

You are needlessly wrapping it into an array and pulling it back out everytime

frigid raven
#

I see yea the hash doesn't make sense since I only need it within the serialization and deserialization function. Therefore it also can just be an array

#
{
  _serializedMarker pushBackUnique ([_marker] call _x);
} forEach [
    { _this }, // simply storing the name
    { markerPos _this },
    { markerSize _this },
    { markerShape _this },
    { markerText _this },
    { markerBrush _this },
    { markerDir _this },
    { markerColor _this }];

@still forum better?

still forum
#

no

frigid raven
#

๐Ÿ˜ƒ

still forum
#

now you are pluggin array into markerPos

frigid raven
#

๐Ÿ˜ƒ ๐Ÿ”ซ

long bolt
#

This addaction addaction ["<t color='#FFFF00'>Virtual Garage Mod</t>", {GarageMkrName = "VG_Vehicle"; call VG_map_click}]; only works when the code is in inti.sqf but if i make it into its own sqf file it does not work even if i try call the correct sqf. im really new to this stuff and the forms are down so this is the only other place i know thanks if someone can help

still forum
#

you removed the "getting out of array" part. But not the "wrapping into array" part on the call

frigid raven
#

[_marker] call _x -> _marker call _x ?

still forum
#

๐Ÿ‘

frigid raven
#

โญ

still forum
#

@long bolt well that doesn't make any sense.
you could check your RPT log for errors. Or add diag_log's to your second sqf file to make sure it's actually being executed
What are you adding that action to? the left parameter is missing in what you copy pasted

long bolt
#

well i was doing addaction ["<t color='#FFFF00'>Virtual Garage Mod</t>", {GarageMkrName = "VG_Vehicle"; call VG_map_click.sqf}]; so its it own file but the init says im missing a ; so i tried execVM but tbh i dont really know what im doing

still forum
#

your addAction doesn't have the left parameter

#

it needs to know what to add the action to

long bolt
#

Ah not i am using this

#

its in the init field of an ingame object

still forum
#

this won't work in init.sqf, it doesn't exist.

#

Use the variable name of the object. Which you can define in the editor

long bolt
#

Ill try do that now

#

i have this in my init.sqf now laptop addaction ["<t color='#FFFF00'>Virtual Garage Mod</t>", {GarageMkrName = "VG_Vehicle"; call VG_map_click.sqf}]; and the action shows on the laptop but nothing happens when i select the action, sorry if this is very basic but im just getting started.

still forum
#

call VG_map_click.sqf
That's a syntax error

#

. are not allowed in variable names

#

I assume you are trying to execute a script in a file?

#

call cannot execute files

long bolt
#

Oh is there a recommendation to what i could use instead?

#

i would use the wikki but its down

still forum
#

No it's not down

long bolt
#

execVM VG_map_click.sqf

still forum
#

You could use execVM too

#

No that's also syntax error

#

you still cannot use . in variable names

#

if you want a string, you have to make it a string by putting it in quotes

long bolt
#

im trying to call a sqf file

still forum
#

Wiki is up.

long bolt
#

oh it is too thanks

frigid raven
#

there is no such thing like pop for an array right?

still forum
#

no

#

you can deleteAt index 0

#

I think deleteAt returns the removed element?

frigid raven
#

deleteAt works

#

oh u said it

#

yea it does - so it's actually what I needed

frigid raven
#
params [["_serializedMarker", [],
        ["_newMarkername", ""]]];

if (_serializedMarker isEqualTo "") exitWith { ERROR("_serializedMarker was empty array") };
private _markerName = _serializedMarker deleteAt 0;
if !(_newMarkername isEqualTo "") then { _markerName = _newMarkername; }; // set override marker name

private _deserializedMarker = createMarker [_markerName, _serializedMarker deleteAt 0];
{
    [_serializedMarker, _forEachIndex] call _x;
} forEach [
    // omitting marker name element
    // omitting position
    { _this select 0 setMarkerSize _this select 1 },
    { _this select 0 setMarkerShape _this select 1 },
    { _this select 0 setMarkerText _this select 1 },
    { _this select 0 setMarkerBrush _this select 1 },
    { _this select 0 setMarkerDir _this select 1 },
    { _this select 0 setMarkerColor _this select 1 }];

DEBUG("marker deserialized");
_deserializedMarker;

Please review the deserializer. Why? Because I want to be clean with this one.

still forum
#

_this select X :U

#

What is that foreach loop? that's definitely wrong

#

you are calling _serializedMarker setMarkerText _forEachIndex

#

setMarkerText doesn't take number

#

did you mean _serializedMarker select _forEachIndex ?

#

Oh btw.
your serialization code
_serializedMarker pushBackUnique ([_marker] call _x); The unique is wrong. What if you have same name and "brush"? suddenly dir will be on index 5 instead of 6. Because the duplicate brush entry is removed.

frigid raven
#

two good points

#
{
    [_serializedMarker, _serializedMarker deleteAt 0] call _x;
} forEach [
    // omitting marker name element
    // omitting position
    { _this select 0 setMarkerSize _this select 1 },
    { _this select 0 setMarkerShape _this select 1 },
    { _this select 0 setMarkerText _this select 1 },
    { _this select 0 setMarkerBrush _this select 1 },
    { _this select 0 setMarkerDir _this select 1 },
    { _this select 0 setMarkerColor _this select 1 }];

Cmon thats right now...
"myMarkerNameYeah" setMarkerSize 5
etc.

#

(praying)

still forum
#

That.... might work. Is quite inefficient though.
And you are passing an array (_serializedMarker) as argument to the setMarker commands.

#

They don't take arrays tho

#
{
    (_serializedMarker select _forEachIndex) call _x;
} forEach [
    // omitting marker name element
    // omitting position
    { _deserializedMarker setMarkerSize _this },
    { _deserializedMarker setMarkerShape _this },
    { _deserializedMarker setMarkerText _this },
    { _deserializedMarker setMarkerBrush _this },
    { _deserializedMarker setMarkerDir _this },
    { _deserializedMarker setMarkerColor _this }];

DEBUG("marker deserialized");
_deserializedMarker;

How bout this?

frigid raven
#

...

#

I didn't noticed the variables was available in those scopes

still forum
#

didn't notice*

#

were available*

frigid raven
#

And you are passing an array (_serializedMarker) as argument to the setMarker commands.
I don't understand what you mean here: [_serializedMarker, _serializedMarker deleteAt 0] call _x; ->_serializedMarker deleteAt 0 isn't an array?

#

@still forum oh cmon now!

still forum
#

You pass _serializedMarker as first argument

#

then you pass _this select 0 which will return _serializedMarker to setMarkerSize

frigid raven
#

damn

still forum
#

_serializedMarker is an array though. You are passing an array to setMarkerSize. setMarkerSize doesn't take array

frigid raven
#

you're right yeah

#

I hate my life

#

stop critisizing (wtf this word) my english! You are not allowed to do so. Only SQF critique is allowed here

#

... oh u have that color

still forum
#

uh...

high marsh
#

He's a drunk

still forum
#

Yeah how about you don't bother all moderators for random nonsense?

frigid raven
#

Looks like my jokes backfired

#

I think I gonna take a pause and won't bother you guys for a while ๐Ÿ‘‹ thx so far

digital hollow
#

Maybe we need #english =p

calm bloom
#

Hey, @tough abyss:, big thanks for the fullcrew command, ive got how to use it only now)

spice axle
#

I need some help to understand uiNamespace. I got a display and if i click button 1 something should happen, button 2 something else. Problem is i need the player object (or position of it) in the button code. So idea is to push a variable into the uiNamespace and get it there.
Questions:

  • uiNamespace is local for every client, but has a global synchronised right?
  • uiNamespace for client 1 is different to uiNamespace for client 2?
  • same variable names can be used in both uinamespaces?
still forum
#

i need the player object
Just call the player command

spice axle
#

really, the display is local?

still forum
#

uiNamespace is local for every client yes
but has a global synchronised right what does that mean?
uiNamespace for client 1 is different to uiNamespace for client 2 it's local only. so yes.
same variable names can be used in both uinamespaces? they are completely seperate.. so yes.

#

Yes. UI elements are local

#

They aren't rendered on a server and then screenshotted and sent to you ^^

spice axle
#

๐Ÿคฆ

#

thanks

still forum
#

all namespaces are local only, and seperated

tough abyss
#

Unless namespace is an object

still forum
#

They are still local

#

setting a variable on them only sets them locally by default

tough abyss
#

Unless you set it globally

still forum
#

the namespaces between 2 clients are different, even if it's the same object

#

Each client has it's own local namespace for the object

#

Does setVariable on uiNamespace with public flag set work? Technically it could.

tough abyss
#

Everything is local

#

Something is synced over network and something is not but each client has own local instances of everything

still forum
#

We take "global" effects as something that syncs automatically.
namespaces don't.
Fighting for definitions ๐Ÿ˜„

winter rose
#

word fiiight!

tough abyss
#

IMO a venture into Multiplayer should be started with the premise that "Everything is local" and then build on it

still forum
#

When you want to complain about bad hitreg. But notice that the shooter just pulled his network plug to make you stand still while he shoots at you

tough abyss
#

I think you can delegate hit reg to server but you will be fighting Arma every step of the way

still forum
#

deleteVehicle on FiredEH and remoteExec createVehicle to server with velocity ๐Ÿ˜„

tough abyss
#

Maybe donโ€™t even need to delete, just have hit box local to server

still forum
#

Don't know how one would do that part

tough abyss
#

With difficulty

#

You can have local vehicle created on server that would mimic server instance of the player

#

And have it collect the damage

#

The bullets exist on server, in the worst case they could be recreated

#

I wonder if setShotParents could trigger hitpart if it is set to some local unit

harsh sphinx
#

Any way to use exitWith or something alike to exit out of a loop as well as a script, without simply setting a flag then exiting when out of the loop?

still forum
#

breakTo/breakOut

harsh sphinx
#

Thanks, didn't really want to have to specify scope, but I guess there's not much else.

tough abyss
#

didn't really want to have to specify scope why is that, does it bite?

winter rose
#

goto's make raptors rise

sudden yacht
#

this addAction ["Drag", { player playAction "grabDrag"; player forceWalk true; _this select 0 switchMove "AinjPpneMrunSnonWnonDb"; _this select 0 attachTo [player , [0, 1, 0] ]; _this select 0 setdir 180; player addAction ["Drop wounded", {removeAllActions player; player playMove "amovpknlmstpsraswrfldnon"; handle = [] spawn {things = nearestobjects [_this select 0,[],4];{detach _x} foreach things}; thethings = nearestobjects [_this select 0,[],4];{_x switchmove ""} foreach things; }];}]; //This is a script to grab wounded... However im trying to add action to drop the wounded. Instead the unit being dragged does not detach, and the animation for that unit being dragged continues and does not cancel. Any ideas?

digital hollow
#

attachedObjects use that instead of searching near objects

sudden yacht
#

Thank you i have figured out the rest.

smoky verge
#

yo people anyone knows what should I write in the trigger section to make everyone who enters that area to go unconscious?

ruby breach
#

Depends on whether you want it to work for units on foot, units in vehicles, both, etc, etc

winter rose
#
{ _x setUnconscious true; } forEach thislist``` or, if the trigger is server-only, ```sqf
{ [_x, true] remoteExecCall ["setUnconscious", _x]; } forEach thislist``` @smoky verge
smoky verge
#

wow thats incredibly accurate thanks, basically need to make everyone on a plane unconscious

#

@ruby breach

ruby breach
#

In that event, thisList would return the aircraft. You'd need to cycle through the vehicle's occupants with crew and do what Lou posted

real moat
#

What would be the best way to pass an array on to a called function?\

robust hollow
#

as an argument?

real moat
#

Mhmm

robust hollow
#

[] call func

real moat
#
_array = ["A","B","C"];
[_array] call fnc_Placebo?
robust hollow
#

yea. or _array call func if it is the only argument.

real moat
#

I have a couple I want to send.\

robust hollow
#

works however you want, as long as it is infront of the call

#

same goes for spawn and execvm

real moat
#
_arrayOne = ["A","B","C"];
_arrayTwo = ["D","E","F"];
[_arrayOne,_arrayTwo] call fnc_Placebo?
robust hollow
#

[_arrayOne,_arrayTwo]

#

, not .

#

other than that, yes ๐Ÿ‘Œ

real moat
#

Sweet, thanks

#

And I will select that by doing:

_arrayOne = _this select 0;
_arrayTwo = _this select 1:
#

In the func

robust hollow
#

yea, though a better way is params

#

params ["_arrayOne","_arrayTwo"];

real moat
#

Awesome

#
params [
 "_arrayOne",
 "_arrayTwo"
];
robust hollow
#

the formatting of it doesnt matter, just as long as you're using the right syntax.

real moat
#

Mhmmm

#

This Discord channel is a godsend

#

Thank you @robust hollow

#

Hmmm any idea why it would be considered undefined? I currently have it in an addAction if that means anything.

robust hollow
#

show how you're using it

real moat
#
params [
    "_target"
    "_caller"
]

_styleOpen     = "<t size='1' font='PuristaSemiBold' color='#58D3F7'>";
_styleClose     = "</t>";

_variable     = "Hamburger"
_array         = ["Apple","Pear"]

_target addAction
[
    format ["%1SomeAction%2", _styleOpen, _styleClose],
    {[_caller,_variable,_array] call fnc_Placebo}
];
robust hollow
#

yea thats not how it works

real moat
#

Visual Studio suggests that my [] called are possible undefined.

robust hollow
#

the action code executes in its own instance so those local variables wont be available

real moat
#

I see

#

is there any way to get around that?
Or would I have to consider not calling the func within addAction?

robust hollow
#
_target addAction
[
    format ["%1SomeAction%2", _styleOpen, _styleClose],
    {
        params ["", "_caller", "", "_arguments"];
        [_caller,_arguments#0,_arguments#1] call fnc_Placebo;
    },
    [_variable,_array]
];
real moat
#

Fantastic

#

So kinda like how I have done the styles?

#

format ["%1SomeTest%2", _varA, _varB]

#

The _arg# refers to the variable?

robust hollow
#

is select, so its just selecting that index of the _arguments array

#

which yes in this case is your variables [_variable,_array]

real moat
#

Oh sweet! can I use #0 instead of select 0 anywhere?

robust hollow
#

almost anywhere yes. i've had an issue using it in one case, perhaps in macros, im not sure now.

edgy dune
#

has anyone ever found the acceleration due to gravity for arma? I wanted to spawn people above a certain point on a TP pole and be in air for a certain time but if I use 9.8 m/s^2 it doesnt seem to add up

real moat
#

Hey @robust hollow
What were these empty strings in the params?
params ["", "_caller", "", "_arguments"]

robust hollow
#

target and action id

real moat
#

I see

robust hollow
#

it should work, not sure why u have an error

real moat
#

No no I got cocky and left em out

#

My bad x)

#

Frick, it works

frigid raven
#

Is there a way to get the Description of a vanilla map marker?

robust hollow
#

what do you mean by "the Description"?

frigid raven
#

sec

#

frigg can't post pictures here

robust hollow
#

thats just markerText, though i assume thats not what ur talking about exactly. are you referring to location markers?

frigid raven
#

markerText it is

#

thx buddy

robust hollow
#

๐Ÿ‘Œ

frigid raven
#

maybe another question... is there a way to "intercept" the creation of mapmarkers?

#

I'd like to create other markernames as _USER_DEFINED #2/4/1 etc.

robust hollow
#

you could override the default functionality on that UI to use ur own function.

#

idk if itl work simply by removing all buttonclick events on the ok button, if it doesnt you could hide that button and make a new one in its place

#

that being said, i dont think you could replicate the "show to" functionality without creating your own sqf version of the system.

#

i havent seen any commands to modify that setting so i assume its an engine only thing

plucky goblet
#

Shame the factions created by Orbat don't work in DRO/DCO

queen cargo
plucky goblet
#

they just spawn vehicles and no infantry

frigid raven
#

@queen cargo that is a sexy mod

queen cargo
#

yup

#

and probably what you are looking for

frigid raven
#

actually yes - but I don't want to have any other mod dependency but CBA tbh

#

So I try my own stuff in an later iteration ๐Ÿคท

#

I hate frameworks etc. I always write my own stuff ๐Ÿ˜‰

queen cargo
#

was more "take this as reference" then "take this as it does exactly what you want"

ebon ridge
#

Profiling spawned scripts with Arma Script Profiler, is it possible or not? Or some other tool for doing it?

queen cargo
#

you may want to ask @still forum on this one and check the #arma3_tools channel

real moat
#

Hmmm

_array = ["Apple","Pear","Eggplant"];
_item = "Apple";
_variable = _array find _item;

hint str(_variable)

Any idea why this is giving me -1 (Not found)?

robust hollow
#

because ur missing semicolons

queen cargo
#

more because this is not the actual code

#
_item = "Apple";
_variable = _array find _item;

hint str(_variable)
SQFBOTToday at 2:06 AM
[HINT]    0
[WORK]    <NOTHING>    nil```
real moat
#

Corrected\

robust hollow
#

yea, that gives 0 so it isnt the problem code

real moat
#

Okay, shall look deeper.

robust hollow
#

paste what ur actually using?

tiny elm
#

is it possible to print output executed script code in game?

#

sorry, not the resulted output, but the code executed of the script called?

astral dawn
#

print executed code of the called script? what?

#

maybe you mean __FILE__ macro?

robust hollow
#

he wants to print the line content i think

astral dawn
tiny elm
#

Will give it a test

real moat
#

How would I grab, lets say, the last char in a string?

robust hollow
#
private _string = "12456789";
_string select [count _string - 1,1]; // "9"
real moat
#

Would you mind breaking this down for me?
I struggle to understand what is happening with [count _string - 1,1]

#

I guess count will count the number of characters?

robust hollow
#

string select [start index,length]

real moat
#

Ah!

#

Gotcha

tough abyss
#

Hi, somebody know if i can get result from server function with a simple call?

//Server function

_Display = ["RscDisplayOptionsVideo","RscDisplayStart"];

{
    _return = getText (configFile >> _x >> "onUnload");
} forEach _Display;

_return

//get result
[] call _serverfuction;

robust hollow
#

are you getting that result on the server as well?

tough abyss
#

nope client

robust hollow
#

to return it on a client you would need to broadcast the result.

tough abyss
#

hmm shit

robust hollow
#

that snippet isnt going to work how you intend anyway

tough abyss
#

i'm just trying to compare server display to client to see if client have modified display.

robust hollow
#

i recommend gathering that info on a vanilla client in editor and saving it to a file in the mission. it means you will need to keep it up to date but greatly reduces the network load.

#

it has been a few months since ive encountered modified display events though.

#

idk if ur server is more vulnerable than mine as i have things locked down pretty tight, but as far as skids modifying the events it isnt as common as it used to be.

high marsh
#

scratch that

tough abyss
#

i don't run server actually, but i try to prepare myself against script kiddies, before lunching server.

#

i have good script.txt but i've seen its client sided. most of cheat providers bypass it.๐Ÿ˜„

#

i have disable somes command with Cfg Disabled Commands useful but don't know if its bypassable.

robust hollow
#

it has no effect during preinit

tough abyss
#

So if i'm not wrong i can't get result of a script from server if i call it on client?

#

sorry but i'm beginner

robust hollow
#

if you call a script on client, it will execute on the client.

#

you cannot get a result from a server-executed script without broadcasting it

tough abyss
#

hmm got it k

#

thanks

slim oyster
#

I am trying to make a reversed checkbox attribute for 3den menus that disables the rest of the attributes in the controlgroup when it is enabled/true. I am having difficulty with an 3den attribute onLoad/AttributeLoad EH, the onCheckedChanged works as intended, the values are saved in the mission.sqm appropriately, but the onLoad event does not enforce the fade/enable on the controlgroup's attributes. Is there something special about the 3den attribute timings via onLoad/AttributeLoad or how they get enabled/displayed that is overriding these effects? https://pastebin.com/raw/S5155211

If there is something strange/some engine solution for creating the 3den menus I think I will just switch to a visual/texture change and use the standard checkbox that works as intended, just reversing the value read in functions.

robust hollow
#

i dont have an answer for your problem so am no real help to you, but cant [true,false] select bool be simplified to !bool?

real moat
#
params [
"_nodePos"
"_index"
]

_array = [
    ["nodeA", "Range", [0,0,0]],
    ["nodeB", "Airfield", [0,0,0]],
    ["nodeC", "Explosives", [0,0,0]]
];

{
    if (_index == _x) then {
    _x set [2, _nodePos]
    }
} forEach _array;
#

Am I doing something wrong with this condition?

robust hollow
#

what is _index?

real moat
#

An integer

#

0 for example

robust hollow
#

and i assume you know what _x is?

#

0 == ["nodeA", "Range", [0,0,0]] for example

#

never going to be true

real moat
#

As far as I know _x is the position in the loop forEach

robust hollow
#

you're after _forEachIndex

#

_x is the element

#

that is a over complicated way to do it though

#
(_array#_index) set [2,_nodePos];
#

you should really be sending actual snippets. is hard to give proper help when you keep sending examples like this.

real moat
#

Okay, I guess I just keep trying to want to understand this one step at time, but if its making it hard for you guys then ill just post the whole thing as is. Probably just a better way to redo it all. This has just been a project with a simple goal, just for the sake of trying to learn.

robust hollow
#

its just hard to tell what you're trying to do exactly when you ask for help on a snippet with missing semicolons and doesnt read like code you could actually use. that snippet for example being the _array resets to default every time you call the script so the whole thing is useless.

real moat
#

Object (Map) Init:

[
this,
"0",
getPos this
] call RGTA_fnc_teleportNetwork;

Note: there are multiple maps.

RGTA_fnc_teleportNetwork:

params [
    "_target",
    "_tpIndex",
    "_position"
];

_styleOpen = "<t size='1' font='PuristaSemiBold' color='#58D3F7'>";
_styleClose = "</t>";

private _tpTar = _target;
private _tpPos = _position;

// Establish Array
_tpList = [
    ["tpNodeBase", "Base", [0,0,0]],
    ["tpNodeRange", "Range", [0,0,0]],
    ["tpNodeExplosives", "Explosives", [0,0,0]],
    ["tpNodeIsland", "Island Runway", [0,0,0]],
    ["tpNodeUSS", "USS Freedom", [0,0,0]],
    ["tpNodeRGS", "RGS Posidon", [0,0,0]]
];

//Assign Array Coords
{
    if (_tpindex == _x) then {
    _x set [2, _tpPos]
    }
} forEach _tpList;

// Setup Actions
_target addAction
[
    format ["%1Base%2", _styleOpen, _styleClose],
    {
        params ["","_caller","","_arguments"];
        [_this select 1, _arguments#0,_arguments#1] call RGTA_fnc_teleportPlayer    
    },
    [_tpTar,_tpList]
];

hint "Function/Script Has Ended";

RGTA_fnc_teleportPlayer: (Nothing Yet)

params [
    "_caller",
    "_tpTar",
    "_tpList"
];
#

I understand, thank you for your patience

robust hollow
#

why do you write the index as a string?

real moat
#

During the init?

robust hollow
#

yea

real moat
#

Hmm, no reason, mistake

#

Changing it now

robust hollow
#

and the point of this script is to add an action to the object so you can teleport to the specified location?

real moat
#

Mhmm

robust hollow
#

is the action argument supposed to be [targat,allLocations] or [target,selectedLocation]?

real moat
#

Oh! About the addAction, I planned to loop the addAction too, to include all the actions.
I just have Base as the only action for now.

#

Just wanted to put that out there.

#

selectedLocation I think?
If I understand that question correctly.

#

Perhaps I should rather add the entries to the tpArray along the way and rather not edit them into a predefined array...

robust hollow
wary vine
#

why don't you hard code the positions ?

#

or use markers ?

real moat
#

Only wanted to have to move a single object around, not the object and a marker.
Each TP destination has a TP itself.

#

Reading through it now Connor\

wary vine
#

so you want all teleports to show, except the one you are at ?

#

tpNodeBase this is the object ?

real moat
#

Mhmm

#

tpList select 0 was the objects.
tpList select 1 was the addAction names.

wary vine
#

just call it once, and it should setup all tp nodes.

#

showing every option but itself

#

but you will need to hardcode positions.

real moat
#

Yup, now I play the game of pick-the-code-to-copy-paste and the purpose of my project is void.

I appreciate your input @wary vine, but you provide a lot of different stuff in your code revision, that I am left wandering what does what and I may as well have Googled the best way to arrange a TP function and copied it.

I'd like to follow @robust hollow advice on this one because it follows my structure and I can make sense of it. I'm really trying to make sure I understand every part of this, bit by bit. Yea its 6am and I just stared at a sad 100 lines of pathetic code for over 8 hours, but I'm hella done just copy-pasting.

#

Question, why is _selectedLoc private?

robust hollow
#

because its good practice to private your local variables unless your rewriting the variable from a parent scope

real moat
#

Could I ask you to please help me loop the addAction so I can wrap this up?

So anyone can walk up to any of the nodes
tpNodeBase, tpNodeRange, tpNodeExplosives, etc...
And interact on the object to be teleported to a selected destination node

still forum
#

@edgy dune gravity constant in Arma is 9.8066
@ebon ridge no, the results of profiling spawned scripts would make no sense and be completely useless.
No there is no other tool. But you could enable instruction level profiling, that way you atleast see the instructions of the spawned script.

leaden venture
#

Is there any way too add slat cages and other garage attachments to vehicles in game via script?

tough abyss
#

Yeah they are animations show hide

#

Or rather hide 0 / hide 1

velvet merlin
#

what a non resource intensive way to make AI not to lay down in trenches?

winter rose
#

_unit setUnitPos "up", but this prevents them to put a knee down

dim terrace
#

@velvet merlin roadway surface with ai stance type?

ebon ridge
#

@still forum You mean to say in general that profiling a spawned script makes no sense or just in the context of the Arma Script Profiler (i.e. in the context of frame based profiling)?

still forum
#

frame based profiling. The profiler can't see when the scheduled script starts/ends executing in a frame. It can only see the overall start and end

velvet merlin
edgy dune
#

@still forum oh okay thanks ill try that. also I didn't realize how many symbols are in ur name till i got on my phone lol

digital hollow
#

kju you could do a line intersect check straight down to see if unit is over a trench.

velvet merlin
#

is that cheaper than nearestObject? also fully reliable?

digital hollow
#

more expensive, but probably more reliable

ebon ridge
#

Thanks Dedmen. I was very interested when I saw the profiler somehow uses scope of private variable. Do you know if it is it possible to leverage private scope in sqf directly (e.g. always call this function on a variable when it goes out of scope or something), or only via plugin/intercept?

#

Basically I would like to make profile scopes for my spawned code without needing to worry about exitWith/throw breaking it. Being able to say "call exitscope" when you exit scope would be pretty useful. Something like a finally block.

still forum
#

in sqf directly No. Intercept does this by just executing code in the destructor. There are no destructors/objects in SQF

velvet merlin
#

@digital hollow nearestObject is only unreliable if you have other objects next to the trench and the infantry would be further off from the center than to the nearby misc object? or in some other sense

digital hollow
#

yeah, plus it's skinny, right? so you could be "near" but not over the trench

dim terrace
#

@velvet merlin just a texture in roadway should do the trick

velvet merlin
#

yeah good point

#

texture in what sense? to link a cfgSurface and use the parameter to have AI not crouch?

dim terrace
#
        class floor_inside: GdtStratisConcrete
        {
            files = "dlazbain";
            character = "Empty";
            soundEnviron = "int_tiles";
            AIAvoidStance = 1;
        };```
velvet merlin
#

alright. wasnt sure if that parameter works also for non terrain surfaces

#
+        lyingLimitSpeedStealth = 0;//2;
+        crouchProbabilityCombat = 0;//0.4;
+        crouchProbabilityEngage = 0;//0.75;```
did anyone play with these by chance?
#

on that note i also found an obscure config parameter during DZ SA dev to toggle AI behavior to walk only/or also run/sprint in buildings - cant think of it any more though

lost copper
#

Hi everyone! In ACE3 mod i can use flashlight on map, when it's to dark around player. How ACE3 checks light level around player?

young current
#

๐Ÿ˜›

lost copper
#

@still forum thx a lot!

astral tendon
#

revealMine is not doing the job, the AI still steps on it, is there other way to avoid mines to be trigered by AI or a side?

young current
#

why have mines if they are not supposed to blow up?

long pewter
#

Hello Arma community.

I am currently trying to create a task where you have to collect an item.
I have an item with the variable name "money1".
I have a trigger, in this condition I have: money1 in (VestItems player + UniformItems player);
In the On Activation for the same trigger I have hint "Task Complete"
This trigger is sync'd to a Set Task State to change the task to "Complete".

For some reason this is not working, can anyone spot why this may be? I referred to this video when attempting this: https://www.youtube.com/watch?v=LNLfJL3SUn8

astral tendon
#

@young current Because players were to supposed to blow up.

tough abyss
#

@long pewter money1 is variable name you need class name. Also you cannot put vanilla money in inventory.

long pewter
#

@tough abyss god dang it, I've got a mod that has briefcases of that sweet sweet cheddar that I was going to use. Is there any other way around it you can think of?

Not sure if this is possible, but can you create a trigger that activates once X amount of variables are within the trigger area?

tough abyss
#

I said vanilla, if you have mod that makes money an inventory item then you can check if user has it in inventory

shadow sapphire
#

@long pewter, I am sure there is a way to create a trigger that activates in the manner you're saying, however, you could just use a normal trigger and have the activation conditions be for anybody and then when anybody is in there, have the trigger activate a script that checks more specific stuff.

quartz coyote
#

Hello is any bug known on command enableEndDialog ? Because I have a blackscreen in my custom death scene. Confirmed 100% it's that command because I disabled it in my script and I didn't have that blackscreen anymore.
Found nothing in feedback tracker

tough abyss
#

Enables the dialog buttons to be shown during the OnPlayerKilled script.

quartz coyote
#

yeah ..........

#

?

tough abyss
#

why do you even use it?

quartz coyote
#

Because I want to ?

#

custom death scene

#

I mean it's fine if you don't want or cannot help. Just don't be negative ? You know that thing that pisses people off ?

copper raven
#

๐Ÿคท

tough abyss
#

I mean do you know what this command is supposed to do? It is very old command which is probably deprecated by now, I am just curious if you know what you're doing, because I have no idea when to use it

quartz coyote
#

I see.
It's a command that triggers the dialog buttons on the death screen ๐Ÿ˜ƒ
I have a custom death screen launched in playerKilledScript.sqs which is supposed to replace the default A3 screen.
If you don't add in enableEndDialog then you just have an deathscreen without any exit button and you just get stuck in your own game ๐Ÿ˜„

vapid crypt
#

I would assume its either not reading your playerKilledScript.sqs, or something may be fighting your dialogue creation. It is definitely an old one if its still using sqs rather than sqf. There may be an easier way to create a custom death dialogue if you can't get enableEndDialog working correctly for you.

leaden venture
#

Is there a way to add slat cages or garage attachments to vehicles with a script without opening the garage?

tough abyss
#

HeliosToday at 09:39 Is there any way too add slat cages and other garage attachments to vehicles in game via script?

#

And I told you already, yes, they are animations

#

It's a command that triggers the dialog buttons on the death screen from what I can see when enabled one of the 2 displays will be used "RscDisplayMissionEnd" - almost entirely black screen or "RscDisplayMissionFail" a mission end screen with restart and continue buttons. Which one is displayed is complicated and depends on mission end. One other command that does what enableEndDialog does is failMission, where you can actually pass what kind of end you want which again will have a say on which display is to show @quartz coyote

quartz coyote
#

Ah well that is very useful ! I'll dig into that man thanks !

austere hawk
#

@dim terrace what are the AIAvoidStance values for what effect? Is there one that forces them to stand? In my bunkers (and vanilla as well) AI cant hit enemies because to fire they kneel first, fire against the wall, then stand up again to check on the enemy...

plain cliff
#

Does anyone know of a sqf static analyser, i.e. sqf lint?

still forum
#

Well.. how about sqf lint?

#

Or the linter plugin by skace kamen for VS Code

plain cliff
#

Cool. Thanks

lofty spear
#

what better for performance, use trigger to wait when condi met, or use spawn with sleep?

still forum
#

trigger with cond. Is same as spawn with waitUntil and sleep 0.5

lofty spear
#

@still forum thx

still forum
#

well roughly same. Trigger also collects units in trigger area. If you don't need that then... Trigger more expensive

lofty spear
#

no, i dont need units, only condition

#

even if it trigger without area?

astral dawn
#

if you don't need 1000 triggers or their alternatives, I guess, use whatever is more convenient for you ๐Ÿคท cost of a custom SQF statement can't be lower than cost of SQF statement

lofty spear
#

any advices, how to find legspikes on missions? i test my mission on MP - everything was ok, but when we played on Dedic, random fps drop occurs, rpt file - no error, -showScriptError was enabled, and nothing

still forum
#

profiling

lofty spear
#

allUnits ~120, on small area 50x100

still forum
#

diag_captureSlowFrame

lofty spear
#

@still forum your profiler? ๐Ÿ˜ƒ

still forum
#

for rare fps drops that might be less useful as it constantly captures.

astral dawn
#

Maybe you need to give your server more bandwidth? I mean the basic.cfg file, although I am not a pro at servers

still forum
#

The Arma profiling only captures the one rare laggy frame

lofty spear
#

server fine enough on most missions

astral dawn
#

Do you mean low server FPS or low client FPS by the way?

#

Although if you say it's an FPS drop, not a desync, then yeah, probably do what Dedmen said. So, arma has a special profiling build, which you download and run instead of your standard arma executeable. Then you can use diag_captureSlowFrame commands and other diag_ commands, which will do profiling of engine. Dedmen's profiler is for profiling SQF scripts, not engine.

still forum
#

my profiler can profile engine too. But it's more useful for constant low fps. Less useful for rare drops

astral dawn
#

Ok didn't use it much, sorry

still forum
#

need to catch the drop yourself. Wheras with captureSlowFrame catches it for you

#

Wanted to fix debugger today.. But didn't happen sadly.

lofty spear
#

i'm not sure what u mean, server or client FPS.
fps drop on clients, for all.
profiling build should be on server, or on client its enough?

still forum
#

only on the client that is lagging

#

so only yours I guess

lofty spear
#

all was lagging ๐Ÿ˜

astral dawn
#

There is also dedicated profiling build for all platforms, so you can profile dedicated server process too. But you would have to diag_captureSlowFrame on dedicated (through remoteExec), then transfer it to client to visualize... I forgot how to do that ๐Ÿ˜ฆ

still forum
#

it saves to text file on server

#

would need to pull manually

#

but if you have clientside lags you don't care about serverside much

hoary stratus
#

someone can help me with this error File 'addons\missions_f_epc_video.pbo' not found.?

still forum
#

that pbo shouldn't exist

#

if you have it in your arma directory, delete it

lofty spear
#

i was surprised with that lagspikes, cause all logic was on serverside

still forum
#

Steam was too stupid to properly delete it months ago

#

lag* not leg. Leg is the thing you use to walk

lofty spear
#

sry for my bad English

astral dawn
#

so, what scripts are running on client then? if there are any heavy client side scripts then they will affect client obviously, if they do engine heavy tasks, like asking engine to find all trees in 10km radius. Although you have said previously that it worked allright in your self-hosting test, so IDK ๐Ÿคท

lofty spear
#

almost all triggers except connected with Tasks (will rewrite it to FHQ TT) are serverside. scripts also run only on servers. run third-party script for locked doors - sushi_scripts, but we havnt any problem with it on another mission

quartz coyote
#

@tough abyss How did you find that information, can't find anything a part from the raw "RscDisplayMissionEnd.sqf" & "RscDisplayMissionFail.sqf"

still forum
#

the displays are in config. sqf scripts are just a on the side thingy

quartz coyote
#

how can I identify the correct config to look into

still forum
#

Just look into a AiO config

quartz coyote
#

what is an AiO ?

still forum
#

Google -> "arma AiO config"

#

First reesult should be BIF forum thread

quartz coyote
#

Oh ! All In One

#

gotcha

#

can't get a hold on what I need ...

#

I'm just stupidly looking into things that are not related

#

I can't find it .................

#

can't open the cfg file so I tried with the cfg viewer but that shit is such a mess I wouldn't find anything even if I tripped over it

still forum
#

"can't open" ?

quartz coyote
#

well when I open a cfg file it's binarised

still forum
#

where did you get that "cfg" from

#

and what is a "cfg" ?

#

Arma has .bin and .cpp configs

#

and you can just debinarize it

quartz coyote
#

what are config.cfg then ?

still forum
#

No idea what that's supposed to be

#

doesn't exist

#

Only config.cpp/bin

quartz coyote
#

shitcow sorry

#

I meant config.bin

#

mybad

still forum
#

Arma 3 tools CfgConvert

#

and why not just pull a AiO config like I told you. You have everything in there. unbinarized

quartz coyote
#

yeah I googled it

#

i'm getting slightly better aint I ?

#

๐Ÿ˜ƒ

#

Found it !

#

thanks !

tough abyss
#

how can I identify the correct config to look into type utils 2 in debug console, type in your class and look at SOURCE ADD-ON(S): line, will tell you what addon it is in

quartz coyote
#

Magic Karel : (["HealthPP_black"] call bis_fnc_rscLayer) cutText ["","BLACK IN",1];//MUF-black in (remove black screen that was launched in FSM PP)

quartz coyote
#

^
that ain't the solution after all ...

final gale
#

Quick question about extensions, is it possible to execute SQF from an extension without using callExtension?

leaden venture
#

@tough abyss Hory crap, I totally missed that message. I thought I was ontop of the discord. Thanks and sorry for the double post. Saved my neck man.

astral dawn
#

@final gale so you mean, the C++ part of your .DLL calls an SQF code directly?

#

Intercept can do that(I think??), and much much more, consider doing Intercept addon instead

final gale
#

I forgot about Intercept, and I would use it but I want this to be a standalone extension and I'm only going to need the sqf call once, but in that case how does intercept execute sqf?

queen cargo
#

Only with intercept or with the same methods intercept uses such things are possible by DLL only

paper echo
high marsh
#

I would just run a script that runs through it once after key press or long duration activation instead of just running it constantly

#

Also, just use a for loop for that, use the step number as the selection index number

tough abyss
#

@paper echo consider using local variant of setObjectTexture and trigger the script globally instead, you are spamming network for no good reason atm

high marsh
#

It's a classic net switch M242, except it's only when you're signaling to turn ๐Ÿ˜›

#

Not to rubber band about

tough abyss
#

Can you give me a good reason why this is so important that it synchronises blinks precisely?

high marsh
#

None, I was joking.
Net switch = inducing network lag to other clients to gain local competitive advantage over others

tough abyss
#

No, you can send tonnes of data before arma chokes on it

high marsh
#

Depending on how many players you have, sure.

#

To exclude a client from global effect sync is impossible without directly targeting remote execution to the non affected players.

#
paramWeather = "maas_server_weather" call BIS_fnc_getParamValue;
paramFogValue = "maas_server_fogValue" call BIS_fnc_getParamValue; //main fog value
paramFogDecay = "maas_server_fogDecay" call BIS_fnc_getParamValue; //fog decay
paramFogBase = "maas_server_fogBase" call BIS_fnc_getParamValue; //fog base altitude    
if(isServer) then
{
    switch paramWeather do
    {
        case 1:
        {
            //clear
            diag_log "[MAAS WEATHER]: Recieved input of 1, setting to clear";
            {0 setRain 0; 0 setOvercast 0} remoteExec["call",0,"maas_jip_weather"];
        };
        case 2:
        {
            //partly cloudy
            diag_log "[MAAS WEATHER]: Recieved input of 2, setting to partly cloudy";
            {0 setRain 0; 0 setOvercast 0.5} remoteExec["call",0,"maas_jip_weather"];
        };
        case 3:
        {
            //raining
            diag_log "[MAAS WEATHER]: Recieved input of 3, setting to raining";
            {0 setRain 0.5; 0 setOvercast 0.5} remoteExec["call",0,"maas_jip_weather"];
        };
        case 4:
        {
            //storm
            diag_log "[MAAS WEATHER]: Recieved input of 4, seting to stormy";
            {0 setRain 1; 0 setOvercast 1; 0 setGusts 1} remoteExec["call",0,"maas_jip_weather"];
            setWind[20,20,false];
        };
    };
    0 setFog
    [
        paramFogValue,
        paramFogDecay,
        paramFogBase
    ];
    forceWeatherChange;
};

A little confused as to why this only works with execution after game start and not with lobby parameters or server init?

paper echo
#

idk if its scripting but if im adding a UserAction in config.cpp of a Vehicle is it possible to put in the Statement a sleep?
like
statement="vehicle player animate [""ClignotantsGaucheStart"", 1];sleep 1;vehicle player animate [""ClignotantsGaucheStart2"", 1];";

young current
#

@paper echo I would make it a separate looping hide/unhide animated mesh part that's on top of your lights. And then make a global hide parent bone for it so you can show or hide them just by hiding/showing the parent bone

#

This way you won't need any fancy scripts like that.

austere hawk
#

@velvet merlin i've seen that, but it only covers "no prone" and whatever is behind that jira link is not accessable for public

velvet merlin
#

@austere hawk there is no force only standing via surfaces. so either you tweak the other parameters i posted above, or go for the scripted approach (also posted above)

austere hawk
#

"the other parameters" - none of them appear to adress AI stance

quartz coyote
#

Hello all,
I am creating briefing with next that is in a stringtable.xml.
with createDiaryRecord where do I put the HTML coding ? In the stringtable or in the command line ?

#
player createDiaryRecord ["Diary", [localize "STR_h_one", localize "STR_p_one"]];```
winter rose
#

if in the xml, it has to be escaped (&lt;br&gt;)

quartz coyote
#

oh crap

#

\n isn't working ...

#

why ?

#

diary can't take no formating ?

still forum
#

There is a difference between \n in a string. And a real newline

#

and I think diary is html. So </br> or <br> or something like that

quartz coyote
#

<br/>

#

okay

#

so i'll send all that to HTML.... but I kindof wanted to keep it in Stringtable since I have translations

#

๐Ÿ˜ฆ

quartz coyote
#

aaaaaaaaaaaah Nice !

#

working !

#

thanks

#

oh and Lou had mentioned the &lt;br&gt; but I was too dumb to recognise it I apologise

lost copper
#

Hi everyone! How i can shoot from mortar by script?

lost copper
#

@quartz coyote ok. Now try to level-up this task. I want to fire mortar without anyone in them ๐Ÿ˜

quartz coyote
#

@lost copper

for "_i" from 1 to 5 do 
{
    [] spawn {
    _pos = (that's up to you);
    _exp = "Sh_82mm_AMOS" createVehicle [(_pos select 0) + ((random 20)-10),(_pos select 1) + ((random 20)-10), 400];
    _exp setVelocity [0,0,-150]
    };
    sleep (random 2) + 2;
};```
lost copper
#

@quartz coyote it is creating ammo with start velocity and direction. But i need to fire from real mortar for triggering Fired EH.

quartz coyote
#

a real mortar without an AI in it .... ?

lost copper
#

Yeah

quartz coyote
#

uh ...

lost copper
#

I try to explain

#

In ACE3 mod i can add ammo to mortar from inventory by ACE Action. Like in that video:
https://youtu.be/9d9lnQ6vGsE?t=192
But now player needs to get in mortar after loading mortar and press LMB.

quartz coyote
#

Can't help, i'm not good enough for that.

lost copper
#

So i need a script, which fires a mine from mortar automaticaly after loading mine in mortar without clicking LMB on gunner's seat.

#

@quartz coyote thx for your conversation ๐Ÿค

#

Anyone can help?

young current
#

there is the different fire commands you can try to use

#

but for any weapon to fire there needs to be someone in there to operate it

#

either a player or an AI

lost copper
#

@young current so it's impossible to fires a weapon without shooter?

young current
#

yes

#

you can put in an invisible AI shooter and remove it after firing if you like

#

but no shooting without a shooter

lost copper
#

@young current that can be a solution. One of my friend give me an another idea. Can i add AI behaviour to mortar like it works with UAV?

young current
#

UAV has invisble AI drivers and gunners

lost copper
#

So only adding invisible AI shooter if shooter slot is empty and fire by command...

young current
#

yes that should work

lost copper
#

@young current thx for your help, it will be a looong evening ๐Ÿ˜ฉ

tough abyss
#

Hi, somebody can help me with this

{
    _x params ["_class","_expectedOnLoad","_expectedOnUnload"];
    private _onLoad = getText(configFile >> _class >> "onLoad");
    private _onUnload = getText(configFile >> _class >> "onUnload");
     if !(_onLoad isEqualTo _expectedOnLoad || (_onUnload isEqualTo _expectedOnUnload)) exitWith {
        //
    };
} forEach [
    ["RscDisplayMainMap","[""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')","[""onUnload"",_this,""RscDiary"",'GUI'] call   (uinamespace getvariable 'BIS_fnc_initDisplay')"]
];

the problem is _onLoad seems to be equal to _expectedOnLoad when i output with diag_log, but the game says it's not equal and exitwith is triggered.

output

_onLoad = [""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"

_expectedOnLoad = [""onLoad"",_this,""RscDiary"",'GUI'] call    (uinamespace getvariable 'BIS_fnc_initDisplay')"

_OnUnLoad = [""onUnload"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"

_expectedOnUnload = [""onUnload"",_this,""RscDiary"",'GUI'] call   (uinamespace getvariable 'BIS_fnc_initDisplay')"

still forum
#

diag log the output of both the isEqualTo's too

tough abyss
#

@still forum all output is here

output _onLoad = [""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"

_expectedOnLoad = [""onLoad"",_this,""RscDiary"",'GUI'] call    (uinamespace getvariable 'BIS_fnc_initDisplay')"

_OnUnLoad = [""onUnload"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"

_expectedOnUnload = [""onUnload"",_this,""RscDiary"",'GUI'] call   (uinamespace getvariable 'BIS_fnc_initDisplay')"
still forum
#

check the result of the isEqualTo's

#

Like I said.. I don't like repeating myself

#

I already saw that you posted that stuff. No need to post again

tough abyss
#

the result of isEqualTo's is true there is difference thats why i dont understand.

still forum
#

so both equalTo's return true. But the exitWith still triggers? makes no sense.
Are you sure the exitWith triggers

ruby breach
#

Not really paying attention me says that you're comparing strings, where "call (" != "call ("

still forum
#

tab vs spaces maybe

tough abyss
#

@ruby breach ho yes u right strange, spaces can cause difference?

ruby breach
#

When comparing strings? Yes

tough abyss
ruby breach
#

He's not comparing return values, just the code as a string

still forum
#

did you even look at the code? ^^

tough abyss
#

He is calling the code at original post

still forum
#

huh? no?

tough abyss
#

And then is trying to params _x

ruby breach
#

no, he's not

still forum
#

Yes.. Exactly

#

That's correct..

#

And he does

tough abyss
#

Ah no he doesnโ€™t

#

i"m just trying to fix a spyglass function that dont work anymore cause of bis update.
its for comparing client display to display in array

#

Others codes have missing โ€œ even more confusing

still forum
#

make sure tabs vs spaces match up

tough abyss
#

in debug consol
getText(configFile >> "RscDisplayMainMap" >> "onLoad");
result is
"[""onLoad"",_this,""RscDiary"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"

My array [["RscDisplayMainMap","[""onLoad"",_this,""RscDiary"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"]];

this is the good way or not?

sorry but i"m not good in this.

#

Obviously different

#

Canโ€™t rely on string comparison, BIS can change statements whenever they want

#

Whatever you are doing you are not doing it right

still forum
#

Discord doesn't show us tabs vs spaces

#

Obviously different
Huh?

"[""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"
"[""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"

Certainly not obviously different to me

tough abyss
#

It is on my screen

still forum
#

squint

#

Nope. Still nothing

#

looks exactly the same to me

tough abyss
#

In the first line it looks like a tab yours looks like space

still forum
#

Discord doesn't transmit tabs

tough abyss
#

I canโ€™t post pic Iโ€™d show you

still forum
#

it converts everything to spaces before it sends it off

#

there are no tabs

tough abyss
#

The space looks bigger than the space on my screen

still forum
#

Well on the second one it splits into a newline

#

the space is the same if you copy paste

tough abyss
#

You post has single space

still forum
#

No.

tough abyss
#

I assume you copied from that?

still forum
#

Yes

#

also same spacing

tough abyss
#

That looks like tab

#

Well it could have some non printable char dragged along

#

Which would make string different

still forum
#

As I said DISCORD DOESN'T SEND TABS

#

It CONVERTS THEM TO SPACES BEFORE SENDING

tough abyss
#

Talking about image you posted

still forum
#

The image doesn't have tabs

#

it's a discord screenshot

#

THERE ARE NO TABS IN DISCORD

tough abyss
#

guys pastbin show tabs?

still forum
#

yes

#

you could also just check for yourself

tough abyss
#

@Dedmen for me its just looks the same

still forum
#

to me too

#

that's why i told you to log the output of the isEqualTo's

#

which you still didn't tell me if you did and what results you got

tough abyss
#

hmm ive edit a bit just deleted Onunload wait a sec

#

hmm now i'm seeing a real difference.

#
{ 
    _x params ["_class","_expectedOnLoad"]; 
    private _onLoad = getText(configFile >> _class >> "onLoad"); 
     if (_onLoad != _expectedOnLoad) exitWith { 
        diag_log format ["onLoad : %1        expectedOnLoad :  %2",_onLoad,_expectedOnLoad]; 
    }; 
} forEach [["RscDisplayMainMap","[""onLoad"",_this,""RscDiary"",'GUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')"]]; 

Result exitWith is triggered

output
onLoad : [""onLoad"",_this,""RscDiary"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')
expectedOnLoad : [""onLoad"",_this,""RscDiary"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"

#

This canโ€™t be real result, expectedUnload is invalid string

#

Looks like the game is trolling me

still forum
#

it has the quote on the end because @tough abyss removed thes tarting but not the ending quote

#

it is valid

#

So.. Were there tabs in there now or not?

tough abyss
#

The only way to be sure is to log not the string but toArray

#

diag_log format ["onLoad : %1 expectedOnLoad : %2",toArray _onLoad,toArray _expectedOnLoad]; log this @tough abyss

#
onLoad : [91,34,111,110,76,111,97,100,34,44,95,116,104,105,115,44,34,82,115,99,68,105,97,114,121,34,44,39,71,85,73,39,93,32,99,97,108,108,32,9,40,117,105,110,97,109,101,115,112,97,99,101,32,103,101,116,118,97,114,105,97,98,108,101,32,39,66,73,83,95,102,110,99,95,105,110,105,116,68,105,115,112,108,97,121,39,41]        

expectedOnLoad :  [91,34,111,110,76,111,97,100,34,44,95,116,104,105,115,44,34,82,115,99,68,105,97,114,121,34,44,39,71,85,73,39,93,32,99,97,108,108,32,32,40,117,105,110,97,109,101,115,112,97,99,101,32,103,101,116,118,97,114,105,97,98,108,101,32,39,66,73,83,95,102,110,99,95,105,110,105,116,68,105,115,112,108,97,121,39,41]"

dont know why i'm not getting " at the end of onLoad.

still forum
#

Because it's at the start

#

before the onLoad

#

it's part of the diag log

#

you are logging a string. thus it logs quotes

#

you could alternatively just not log a string, diag_log takes anything

tough abyss
#

There is a tab

still forum
#

There we go. Tab. As I guessed

#

And you didn't copy it into your expected

tough abyss
#

so there is a tab?

still forum
#

๐Ÿค”

#

Didn't we just both say exactly that?

tough abyss
#

9 is tab 32 is space

#

how do you set a texture of a vest with setObjectTexture?

#

@Dedmen @tough abyss I have just understood, thanks for ur helps.

#

sorry for the time you lose with me xd.๐Ÿ˜‹

#

As I said this approach you are taking is not reliable as BIS are free do what they want with onload statements

#

Hardcoding your version is asking for trouble

#

@tough abyss ive just tried to fix it, i have not write this.

still forum
#

@tough abyss not sure if you can... Actually.. Don'th think you can

tough abyss
#

@tough abyss yes u cant do that xd.

#

how?

#

or generally set the texture of a vest through console

still forum
#

We just both told you you can't

#

So... what how?

tough abyss
#

@tough abyss You have to modeling vests or helmets, you cant use this command for vests or helmets.

#

To be fair it is "yes, you can" and "no, you canโ€™t". "Yes, you canโ€™t" is pretty confusing

still forum
#

All these native english speakers and their being used to phrases always being the same

tough abyss
#

english is not my native language

#

Guys i have question, the impact of a global var on the network, vary with the number of players or not at all?

still forum
#

a public var is sent to each player once

#

you send it to the server once.
And the server then sends it to every player once

#

so the players all just see one variable.
The server sees the variable*playercount

tough abyss
#

hmm so more players, more the network will be use with public var?

still forum
#

on the serverside yes

#

but also in general. Server has to send position updates to everyone

#

more players == more clients to send data to

tough abyss
#

It doesnโ€™t automatically resync so unless you broadcast it again it will only be sent to JIP so minimal impact

#

hmm i see thanks for the info.

lusty canyon
#

why is my respawn addaction adding duplicate actions from time to time. dupes happen mostly when the server is laggy or player dies alot in quick succession:


    player addEventHandler ["Respawn",
    {    
        player addaction ["<t color='#7396ff'>UTIL EARPLUGS:</t> ON", 
        {
            _myPlayer = (_this select 0);
            _actionID = (_this select 2);
            _earPlugs = _myPlayer getVariable "DW_UTIL_EARPLUGS";    

            if ( _earPlugs == 0 ) then     {
                _myPlayer setVariable ["DW_UTIL_EARPLUGS", 1, true];
                _myPlayer setUserActionText [_actionID, "<t color='#7396ff'>UTIL EARPLUGS:</t> OFF"];
                2 fadeSound .20;
                hintsilent str "EARPLUGS ON (-80%)";
            }
            else {
                _myPlayer setVariable ["DW_UTIL_EARPLUGS", 0, true];
                _myPlayer setUserActionText [_actionID, "<t color='#7396ff'>UTIL EARPLUGS:</t> ON"];
                2 fadeSound 1;            
                hintsilent str "EARPLUGS REMOVED";
            };    
        },
        "args",    -400,    false,    false,    "",    "(alive _this)",    5,    false,    ""    ];
    }];

how can i prevent it from creating duplicates?

tough abyss
#

Try adding action to _this select 0 instead of player

#

Might want to try MPRespawn as well

swift crane
#

I'm new in coding. can u help me find the error? it says that ";" is missing {if ((side _x) == resistance) then {_x dissableAI "ALL"} else {}} forEach allUnits;

robust hollow
#

it should say where the semicolon is missing too

#

or the general area at least

#

my guess is you misspelt disableAI

#

you dont need else {} if you dont have any code to execute when the condition is false

swift crane
#

omg I'm so dumb.

#

thx

robust hollow
#

you should edit ur scripts in a text editor with syntax highlighting so you can see easier when a command is spelt incorrectly

tough abyss
#

@swift crane A good editor is Visual Studio Code, has SQF extensions!

#

Btw, does anyone know what might the issue be in the followinf scenario:
Mission file works perfectly fine on player hosted server. Doesn't work well at all when hosted on Dedi. Any ideas of what could stop some scripts from being executed or smth?

queen cargo
#

visual code nowadays has even something that is finding more bugs then SQF-Lint does ๐Ÿคฃ
though ... not public afaik

red current
#

hey all am trying to make a costom ui panel carmra for a gun sytem on a vic i have the panel art work done in paint shop but dont know how to get this panel to show inside the carmra system any help is more than welcome at this point. am trying to do this please see video timestamed his https://youtu.be/Kigx15FEPfg?t=1162

#

please also not that we have the model also the ui interface we made with pant shop just looking to find out how we implent this to are gunner cammra

quaint ivy
#

Is there a way/tool to see all of the global and public variables present in the mission? Like function viewer but shows all of the variables in missionNameSpace. I've read up on allVariables but is there a "Var Viewer" ?

austere granite
#

allVariables missionNamespace select { !isNil { missionNamespace getVariable _x } } apply { missionNamespace getVariable _x }

#

there you now have a var viewer

tough abyss
#

Nil vars are deleted from all variables on mission namespace AFAIK

wary vine
#
private _allVars = allVariables missionNamespace select { !isNil { missionNamespace getVariable _x } };
private _control = (findDisplay 46) ctrlCreate ["RscListbox", -1];

_control ctrlSetPosition [0,0,1,1];
_control ctrlCommit 0;

_allVars apply 
{
    private _index = _control lbAdd _x;
    _control lbSetTooltip [_index, missionNamespace getVariable _x];
};
#

might work

astral dawn
#

If I want custom loadouts, how faster is createUnit from custom unit class than setting loadout through script exported by Virtual Arsenal?

tough abyss
#

You can set loadout from class just as well

#

And keep the unit

astral dawn
#

I mean, performance of setting loadout through scripts, maybe there is something I am not aware of because of which I should favor setting up units in cfgVehicles rather than setting their loadout through script? no?

#

I am going to spawn units dynamicly, like ~20 of them or more sometimes

still forum
#

cfgvehicles just needs to send classname over network. And all the loadout adding is done in engine

#

with script you ofc are doing the loadout stuff via script, and it needs to be propagated over network too

#

But... The work isn't worth it. Just use scripts

astral dawn
#

so, you don't think that it's going to slow down creation of multiple units a lot, right?

still forum
#

no

astral dawn
#

Cool, thanks!

tough abyss
#

SetUnitLoadout can set loadout from class

#

1 script command

astral dawn
#

It's interesting. If I need stuff to be put into backpack, do I still need a separate backpack class?

still forum
#

yes

#

and afaik seperate vest class too

tough abyss
#

This is not what you asked initially, you asked to create unit with certain class in order to get loadout you wanted as far as I understood. You can just setUnitLoadout on existing unit with the same class thus avoiding creating a new unit

astral dawn
#

Allright, let me refine my question: I want to add custom unit loadouts for AIs in my mission. Question is, which way to go: export script from Virtual Arsenal or create configs for units. So far, the script approach seems to be better. Thanks.

tough abyss
#

You measured the speed?

astral dawn
#

No not yet

tough abyss
#

One script command with config as argument vs 10 script commands... ๐Ÿค”

#

Tough one

astral dawn
#

well, vs speed of developing configs...

tough abyss
#

Because you need to make them every time at runtime? Yes of course

#

BTW you can export loadout into config from virtual arsenal just hold shift

astral dawn
#

๐Ÿค” I guess it doesn't export a backpack for me?

tough abyss
#

Config has entry for backpack

#

What do you mean it doesnโ€™t export it

astral dawn
#

I might be wrong but I was studying some standard arma configs for soldiers, so light AT NATO soldier has this backpack class specified: B_AssaultPack_rgr_LAT
And here's what this backpack class looks like, it specifies what items the backpack has:

        class B_AssaultPack_rgr_LAT: B_AssaultPack_rgr
        {
            author = "Bohemia Interactive";
            _generalMacro = "B_AssaultPack_rgr_LAT";
            scope = 1;
            class TransportMagazines
            {
                class _xx_NLAW_F
                {
                    magazine = "NLAW_F";
                    count = 2;
                };
            };
        };

So, are you sure that I can export backpack items with the arsenal?

tough abyss
#

If you export config it will export backpack name and when you load from config it should apply this backpack with its config content

#

Because this is how loading from config works in engine

still forum
#

but will it export a backpack config with it's items?

#

that's what sparker asked

#

ofc the backpack config entry for the unit is there

tough abyss
#

I dunno try it

astral dawn
#

Ok, gonna try that, thanks!

astral dawn
#

Allright, the backpack items seem to be added properly if I export into config and then use setUnitLoadout, unfortunately it removes all weapon items

#

And... WHAT O_o setUnitLoadout: 700 us, running same loadout exported from arsenal as SQF: 60 us ๐Ÿ˜ฎ

astral dawn
#

Any idea why config setUnitLoadout is so slow?

severe bolt
#

anyone here good with Life mods?

astral dawn
#

What's the problem?

golden hill
#

Hey everyone, I imported my first weapon today but I'm somehow to stupid to get a custom firing and reload sound in the config, can someone help me out?

astral dawn
golden hill
#

oh my bad, misclicked

severe bolt
#

Line 142 fails on life_server\init.sqf
Unknown var fed_bank, any ideas? Is it just looking for an object called that?

/* Set the amount of gold in the federal reserve at mission start */
fed_bank setVariable ["safe",count playableUnits,true];
[] spawn TON_fnc_federalUpdate;
robust hollow
#

yes. by default fed_bank is the red container inside the main fed dome, if you have renamed or deleted it, this error will occur.

high marsh
#

fed_bank being the variable name of the object

tough abyss
#

And... WHAT O_o setUnitLoadout: 700 us, running same loadout exported from arsenal as SQF: 60 us ๐Ÿ˜ฎ that doesnโ€™t look right, you sure? I get sqf taking longer than applying from config

severe bolt
#

ok, also any tips for getting started or any videos for altis life scripting. Anything to get me up to pace with deving in this gamemode would be awesome

tough abyss
#

30 lines of code in sqf including loops and not including comments, how on earth you get 0.06ms itโ€™s a mystery to me @astral dawn

#

And shame on you for making me fire up PC

astral dawn
#

@severe bolt reading someone's code is not a good way to start IMO, try to do something on your own without touching any other's ready code first, who knows how improperly it may be done really...

severe bolt
#

any videos?

astral dawn
#

hmm... I can't recall when I ever studied programming by videos ๐Ÿคท

severe bolt
#

Same but they help sometimes

tough abyss
#

I started by reading someone elseโ€™s code and looking up wiki for the meaning of the commands, is there any other way like university course one can take?

robust hollow
#

did the same ^. i actually started out by rewriting life systems to be less shit.

#

made it a bit easier because i could see the end product, just needed to make it work better.

severe bolt
#

mmmm

#

thanks for the current help so far

#

ill be active in here for a while

marble basalt
#

anyone able to tell me where im missing a ; if _dam is greater than 0.5, then;

robust hollow
#

post the actual script

marble basalt
#

used a example from another page

high marsh
#
if(_dam > 0.5) then
{

};
#

post your code

#

we have no idea what is actually causing the error until you do

marble basalt
#

Player getHitPointDamage "Leg";
_dam = HitPointDamage "Leg;"
if(_dam > 0.5) then
{

playSound "LegBreak";
[] spawn
{
_sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";
sleep 1.2;
deleteVehicle _sound;
};
};

robust hollow
#
_dam = HitPointDamage "Leg;" // <--
if(_dam > 0.5) then
#

also HitPointDamage isnt a command

marble basalt
#

how do i get _dam to mean leg hit point damage

#

new to codeing

robust hollow
#
private _dam = player getHitPointDamage "hitlegs";
#

i feel like you have copied that whole then snippet right off the wiki so its worth noting: you dont need that spawn unless the sound goes on for longer than you want it to.

marble basalt
#

i did

#

lol

#

i have no idea what im doing and just going off of wiki and trial and error

#

it doesnt throw an error

#

but doesnt play the sound

robust hollow
#

does the sound exist?

marble basalt
#

yes

#

added by a mod

tough abyss
#

AI are bad drivers because make then good drives would require too much processor power?

marble basalt
#

anyone know why it wont play the sound?

tough abyss
#

Quick question. Iโ€™m trying to create a while loop but Iโ€™m struggling with how to implement it in Arma (much more familiar with Java). Long story short, I want to setDir the AI (+= 10) until it faces the player.

robust hollow
#

_unit setdir (getdir _unit + (_unit getRelDir player));
no loop required

high marsh
#

makes me wonder why commands like getRelDir when alt syntax for getDir does the same thing

#

is it for "oh I didn't realize that already existed because there wasn't a command blatantly named getRelDir"

tough abyss
#

Awesome. Would you happen to know how to increment it by 10?

high marsh
#

that will immediately set the direction of the AI to face the player

#

so you want it to increment by 10 every few seoncds?

tough abyss
#

Basically. Tested it manually myself and it works pretty well

robust hollow
#
getDir _unit; // 90
_unit getDir player; // 188.47
_unit getRelDir player; // 98.446

they dont appear to do quite the same thing

#

i do see what you're saying though for this specific case, getRelDir is unnecessary. wasn't aware of the getDir alt syntax.

tough abyss
#

Anyone have thoughts on incrementing?

#

Eg _unit = _unit + 10;

#

Or

#

_unit += 10;

robust hollow
#
private _dir = _unit getRelDir player;
while {_dir > 15 && _dir < 345} do {
    _unit setDir (getDir _unit + 10);
    uisleep 1;
    _dir = _unit getRelDir player;
};

something like this would probably work. my test ai keeps turning back to the original heading though so i assume you already have something worked out to stop that.

tough abyss
#

doWatch or lookAt could possibly work(not entirely sure).

#

Regardless, many thanks

high marsh
#

doWatch and lookAt aren't going to get 10 degree increments without getting the position relative to the direction facing

tough abyss
#

I was more or less referring to keeping the AI on target and not turning away

#

After the original script executes

high marsh
#

Why do you need the increment then?

tough abyss
#

So basically, I was looking at Arma 3 (again), and I saw how the AI just seemed to pivot almost perfectly in place. I did a basic setDir script for the AI (at 2 degree increments) and it looked basically the same

high marsh
#

This isn't the case with certain statuses

#

weapon raised for example, you might observe this

tough abyss
#

Still, itโ€™s not a bad idea for CQB situations to create your own AI turn

#

Couldnโ€™t you if you wanted to create an animation and have it executed depending on the circumstances

high marsh
#

Yes, a lot of the ai behvaior uses FSM to do this

tough abyss
#

Well, thatโ€™s basically what Iโ€™m aiming for

edgy dune
#

if i read the wiki right if I do

"hello" remoteExec ["hint", clientOwner]; 

that will only hint "hello" to the local client? so say I have this inside an action menu like such

_this addAction ["hint thing", 
{
    "hello" remoteExec ["hint", clientOwner]; 
}];
high marsh
#

clientOwner being the local client sure. But why would you execute something remotely to yourself?

edgy dune
#

i was gonna hint the vertical speed of the aircraft when the action was clicked

high marsh
#

then just use hint. It'll only have effects local

#
hint format["Vertical Speed: %1",(velocity _veh) # 2)];
edgy dune
#

ive had it where it would do that globally,perhaps thats cuase I was using the MCC execute block in zeus

high marsh
#

Don't, just don't.

edgy dune
#

ye

tiny elm
#

Hmm, I think my brain is crashing... count command returns total count of all elements in array.. how do I toggle through each element, thinking my best option is to use addaction.... but kinda lost on how to toggle through the element

robust hollow
#

how do I toggle through each element uhh, depends what ur trying to do but any loop will work. apply, count, findif & foreach being the obvious picks because they all set the current element to _x.

tiny elm
#

Trying to toggle through the array with an addaction without having to use the select command....as the array is dynamically updated...

robust hollow
#

i completely forgot about select ๐Ÿ˜ข

#

what do you mean by toggle through the array?

tiny elm
#

Yeah, I'm using !isnull to check the element has a value... for example at the start of a scenario we may have [1,2,3] ... some time later that same array is now [1,2,3,4,5] . The amount of elements in the array can change at any time.

#

Just wanting to toggle select 0, select 1, select 2

#

But because the array is dynamically updated, I can used the select command

#

Each element in the array is an object

robust hollow
#

use a for loop from 0 to 2?

tiny elm
#

Yeah thats what I first thought, that would work perfectly is the array always had 3 elements

#

If the array*

#

Is there a command that returns current element?

robust hollow
#

depends on the kind of loop

#

the ones mentioned above all use _x. the other loops dont but you can set a counter to increase with each iteration and select from the array that way. eg in a for loop _obj = _array # _i;.

#

i honestly still dont understand how any of the loops dont work for what you're trying to do.

tiny elm
#

Aha! ^^^^ thank you! "For loop" ... apologies, it's been a long day. I knew I was having a brain fart

long pewter
#

Hi Arma friends. How would I create a trigger that activates once an item enters an area?

young current
#

what kind of an item? some specific one or any item?

long pewter
#

Yeah a specific item, I've gave it the variable name "i1"

young current
#

just to be clear

#

its an inventory item, not unit or vehicle

#

would be helpful if you explain what you want to do

long pewter
#

Yeah, the task is for the player to raid a house, pick up this item - a briefcase of money from a mod I have downloaded - and bring the item back to base.

young current
#

so the item would be carried by a unit?

#

One way would be to check the contents of inventory for anyone in the trigger area

#

and if the item is in someones inventory then the trigger activates

long pewter
#

That would be ideal, how is that done?

young current
#

Im at work so can only throw ideas at you. Look up how trigger conditions work and use thislist to get all the units in the trigger area and then look up commands to list inventory items of a unit and loop that to all thislist units with for each for example and check that list if it contains your briefcase item

tough abyss
#

Use Take and Put EHs instead @long pewter

next scaffold
#

would this work for what he asked?

{
    _items = items _x;
    if("money_class" in _items) then {somethingHappens}
}forEach thisList;
long pewter
#

@tough abyss Can you explain please?

long pewter
#

Thank you Arma brothers

tough abyss
#

Anyone had any problems with arma-s respawn function, so that after while and some dying enemy comes somehow "friendly"? They will ignore player completely(also both in coop)
I am using Kaartomedias "AI Spawn Script Pack 1.0" and game is usually CO-OP with a friend.

#

Respawn is done by description ext as instant with 30s timer with no gear.

next scaffold
#

is there a way to get all the variables in an array which names start with "varName" and then push them all to another array?

robust hollow
#
private _newArray = _oldArray select {_x find "varStartsWith" == 0};

you mean something like this?