#arma3_scripting

1 messages · Page 587 of 1

tough abyss
#

yes, I want that the player of the enemy side will be attacked by the enemy npc's, and also by the blue and green side, as a renegade

#

Is for desing a multiplayer mission with two players (one blue, one red) and the npc's (red side) attack both

mortal crypt
#

basically _unit addRating -2000

winter rose
#

-2001*

#

also, if its rating is zero to begin with

tough abyss
#

but with the rating, if the match ends, the enemy "renegade" faction always lost bcause the rating determines the ranking?!

verbal saddle
#

If you want a free for all you can use setFriend to have west hostile to west.
But that applies to all units on that side rather then just a single unit.

mortal crypt
#

Can someone help me with #define I defined it in my .hpp hpp class ALM{ #define TF47_ALM_side WEST #define TF47_ALM_onInit true #define TF47_ALM_range 200 file = "TF47\ALM"; class ALM_initEventHandler { preInit = 1; }; class ALM_initZeus { preInit = 1; }; };
But I can not access it in my scripts. Its for missions.
I read the https://community.bistudio.com/wiki/Arma_3_Mission_Parameters#Predefined_Params
And the mission is unpacked like the warining says.

verbal saddle
#

Do you have a params class as it shows in the wiki?

mortal crypt
#

tryed that bevor. But maybe I did something wrong there. Will try at again and report back.

verbal saddle
mortal crypt
#

Sadly not quite what I want. I try to make a module which I can just drag and drop into my mission and the rest is initialised. The defines should be the only thing the mission creator has to modify.

robust hollow
#

you want those defines to be accessible in the functions for when they are compiled?

mortal crypt
#

yes.

robust hollow
#

and you've defined them in the config because thats how the params example does it?

#

using defines, what you need to do is put those define lines directly in the sqf files. If both functions need the defines, create a separate file for the defines and include it in the sqf files.

eg:

// defines.inc (in the same folder as the sqf files)
#define TF47_ALM_side WEST
#define TF47_ALM_onInit true
#define TF47_ALM_range 200
// at the top of the sqf files
#include "defines.inc"
mortal crypt
#

thank you.
I guess I could also include the defines.inc in the .hpp or only in the sqf?

robust hollow
#

only if you use those values in a config too. how you have it there with the defines in the functions config, it does nothing.

#

the params example (which i assume is where you got the idea from) uses defines in the config because they are used in a config template, not in functions.

mortal crypt
#

ah ok. understood

#

Works like a charm. Thank you very much.

tough abyss
#

Thanks @verbal saddle it works perfectly

mild pumice
hazy trail
#

In initPlayerLocal, I store the clientOwner value as a global variable on the player object. On the server, I compare remoteExecutedOwner against those global variables on allPlayers to figure out who is making the remote call.

winter rose
#

@mild pumice an owner is not always a player (can be server or headless client)
you could do```sqf
private _theClientOwner = 33;
private _allPlayers = allPlayers;
private _index = allPlayers findIf { owner _x == _theClientOwner };
private _ownerPlayer = objNull;
if (_index != -1) then
{
_ownerPlayer = _allPlayers select _index;
};

#

note that owner is a server-side only command

hazy trail
#

I suspect I went with my approach when I was implementing support for headless clients.

fervent kettle
#

can someone tell me if this line looks right? i have a feeling it doesnt
{deleteVehicle _x} forEach units _x; distance getMarkerPos "deleteheli" < 30;

robust hollow
#

what are you comparing in the distance check?

fervent kettle
#

why comparing? i want to set the range of the marker

robust hollow
#

not sure what you mean. distance is used to return the distance between two positions

#

x distance y

fervent kettle
#

uhmm.. i thought it would be like marker range (less then) 30

robust hollow
#

what do you mean marker range?

fervent kettle
#

that the vehicles gets deleted when it is in a radius less then 30 of the marker

robust hollow
#
{
  if (_x distance markerPos "deleteheli" < 30) then {deleteVehicle _x};
} forEach units _x;
fervent kettle
#

@robust hollow doesnt seem to do anything

#

btw thats the whole code

[] spawn{
    {
    if (_x distance markerPos "deleteheli" < 30) then {deleteVehicle _x};
    } forEach units _x;
    hint "Dein Heli wurde entfernt";
    sleep 0.2;
    (thislist select 0) setPos getPos Base;
};
robust hollow
#

.....

#

units _x _x isnt even defined.

#

im not sure thisList would be either in the spawn.

fervent kettle
#

could i just say forEach player; ?

robust hollow
#

no

#

player is not an array

#

foreach iterates through an array

fervent kettle
#

how bout that forEach units group player; atleast thats what the wiki says, or do i have to define group too?

warm hedge
#

group player is already defined

fervent kettle
#

Ok, then idk why it`s still not working

warm hedge
#

Well technically it's not an defined variable

fervent kettle
#

oh and it is giving me an "thisList not defined" error

robust hollow
#

because thisList is a local variable

#

despite not having an underscore

warm hedge
#

It's not apparently defined in the spawn, or thrown as the argument

fervent kettle
#

can i replace thislist with another variable, let´s say "basetp"

#

actually, i might have found another solution for that

#

this one here is giving me an "zero divisor" error

_tele = _this select 0;
    _caller = _this select 1;
    _caller setPos (getpos (Base));
warm hedge
#

What's _this in this context?

fervent kettle
#

the caller

#

aka the one who executed the script

warm hedge
robust hollow
#

_this is the caller or an array? zero divisor in this case is you selecting outside the range of the array.

fervent kettle
#

yea, prob not working cause it`s being executed via trigger

robust hollow
#

😐

warm hedge
#

It doesn't even matter

fervent kettle
#

so its teleporting now* but not deleting the helicopter

tough abyss
#

hey guys, is there any way to change the carrying capacity of an item? for example i made an uniform but for some reason it can carry 70 bandages from ACE alone so i really dont want that lmao

#

idk if this is the right channel for that

high horizon
#

Idiot question, how to set % character on format structured text??? It detects it as a var, as %1, %2.

winter rose
#

pass it as argument

#

there is no escape character for it unfortunately.

#
hint format ["You have %1%2 of damage", damage player * 100, "%"];
high horizon
#

hey guys, is there any way to change the carrying capacity of an item? for example i made an uniform but for some reason it can carry 70 bandages from ACE alone so i really dont want that lmao
@tough abyss You should have changed it on the config

#
hint format ["You have %1%2 of damage", damage player * 100, "%"];

@winter rose Thx man!

tough abyss
#

yeah i know its in the config, its the mass=; argument however it doesnt do anything when i change it. it always stays at 70 despite being set for mass=40;

#

and its driving me insane

arctic bay
#

hey guys i think i migght need some help, so i was making an opfor base for my mission right, and i had set up a shooting range, is there a way i can get some guys to shoot at the tarrgets? so farr i had just maade them lie down on the floor?

#

btw im still fairly new to eden and arma 3 scripting

slim verge
#

ppeffect question.
Handle return ID's seem to persist outside not only mission restarts but also game restarts. Using a localised ID, eg _myID causes an incremental count increase , so if yesterday i ran a ppeffect script and the handle ID returned 90, if i rerun that script today it returns 91 and then 92, 93 etc. I understand why it is incremented. What I dont understand is why is persists after mission or game restarts or even complete PC restarts

Is there a way to reset the count to 0 (Don't know why i would need to do that just asking as I am learning about the ppeffects)

winter rose
#

are you using vanilla?

slim verge
#

Furthermore, if I use a global ID, eg TX_fx1, and an If ! Isnil I dont ppeffectcreate, during the mission session it does not increment however after mission styart it incremented by something like 100...

#

yes vanil;la

winter rose
#

can you show me the basic code you use to see the increment? just ppEffectCreate?

slim verge
#

if (Isnil "TX_fx1")then{
Tx_fx1= ppEffectCreate ["DynamicBlur",0];
};

#

and i dont destroy it

#

so the other lines are just enable, disable and adjust

#

and commit

#

execvm and debugging with a sidechat line

#

returning Tx_fx1

winter rose
#

I created a post-process effect, started at index 46
created many others until 50 or 51
restarted the game, created one: started at index 46

#

(deleted none)

slim verge
#

has the test mission got save enabled or not (Just wondering how this data is being stored)

#

mine does not

winter rose
#

directly in Eden

slim verge
#

ok i test in the mpmission editor what do u test in sp editor ?

winter rose
#

yep

slim verge
#

so according to your test am assuming possibly a complete engine restart you would assume there had been 45 ppefects prior to you running the test script applied by the engine

winter rose
#

Yeah; I would say not to worry about the incrementing id.
a (signed) int can go up to 2,147,483,647 sooo you have some freedom before going negative

slim verge
#

lol

#

6000 hours of exe use so far dont think i wiull get that by A4

#

just seemed weird to me

#

by using the global var was you getting an increm,ental count for the same effect or not ?

#

within the same mission instance

winter rose
#

did not try that but that's the same, really
what are you trying to achieve, in human words?

slim verge
#

nothing at the moment just exploring.. so for example not destroying the effect may save on resources versus creating the effect and then meddling etc come across stuff like this and trying to understand it

#

am actually learning ppeffect for a mission template for my community, to be used in conjunction with a hit handle damage EH to get some effects from being hit etc, temporary blindness, knock on the head etc

winter rose
#

best advice, don't overthink it
create if you need, delete or disable if you don't, recreate or enable if re-needed really

slim verge
#

i dont overthinbk, i question what i dont know, thjats a difference

#

normally code can be easily debugged right, normally lots of params or values you can return to see whats going wrong, in the ppeffect code there is a handle and thats it

winter rose
#

regarding "resources", ppEffects are not costy to create

ppEffect returns a handle, so do Event Handlers 😉

slim verge
#

tyhat returns a number and wether enabled or not so not a lot to figure stuff out with

west tree
#

Do you need to stack many effects on top of one another / additively? id guess it might also work and prevent the increment issue if you create fx filters once and only dis and re-enable them

slim verge
#

maybe, i know the stackable functions not that far into it yet

#

if you think of all the visual impairement tricks that you couold use, thats what i amexploring eg camshake, black and white fade out in, and the ppeffects can all be used in some way to achieve an effect of i've just been hit in the head, face etc if it didnt kill the unit... these are the things am exploring atm

#

so for example random chance FX, hit in face, temporary blindness followed on by some blur fx that fades out, would be an example of some of the ideas i will be implementing and to date have

west tree
#

right, you could do some interesting things by layering and having them enabled smartly. I've barely touched it myself yet though.
I can imagine it might be worth testing wether certain effects might add additional screengrabs. I'm unfamiliar with Arma's ppfx handling, but in other games heavy use of many seperate PP effects could end up causing multiple framebuffers which for in example 4k users can get expensive quite quickly :p

slim verge
#

ok so one fx at a time then

west tree
#

Just to note in case you do end up re-layering some effects and note VRAM jumps up if multiple of the same effect is enabled; havent begun testing anything with this in Arma 3 myself 🙂

#

For the sake of easier prototyping it's probably easier to start with making each effect as-needed 🙂 If no such problems arise it may well be arma already has some nice logic to solve that problem for you :p

slim verge
#

thx never thought of that

#

according to the comref, if 2 fx use the same priority, the second one you attempt to create will fail.. so this may be there safeguard for that

#

so if i use 1fx at a time all created on same priority i shouldnt get a vram hit

west tree
#

@slim verge Ah nice, that way you can then also prevent making the same effect multiple times in general 🙂

#

if you keep each effect to its own priority 🙂

winter rose
#

according to the comref
haven't heard that name in aeons…

tough abyss
#

I must make a PBO so an addon config.cpp will be loaded?

#

Because when I don't use a PBO, it just doesn't execute

still forum
#

Yes

tough abyss
#

So say I am developing a server side mod which will be the server side scripting of the server, for each change I want to test, I need to pack it before running all over again ?

still forum
#

Yes

winter rose
#

or use -filePatching iirc?

tough abyss
#

I am using file patching but it doesn't fire up the mod properly (I tested on another mod that I know works with PBO)

tough abyss
#

Yes
@still forum Are you sure?
Is this the way everyone develop? Seems a bit overkill to pack for each small change while developing 🤔

#

I wasted 4 whole days to figure this out 🤔

still forum
#

depends on what you develop

ebon ridge
#

Is there any way to control where planes go while taxiing? It seems there is some node they always want to go to in a straight line, they ignore obstacles and paved taxi ways in some cases

#

whelp reported in 2017 never responded to :/

jade abyss
#

iirc, the issue with filepatching and Dedicated Servers was, that the Server is locking the files. So you can't edit it, on the fly, like you can do on clients 😑

still forum
#

oh so really is a server issue that locking

#

wanted to look at that somedaay

jade abyss
#

I think so, yeah. I couldn't save any files that were used by the Server at all. Was about ~2-3 Months ago or so?

spiral fractal
#

is it possible to get the name (or some other detail) about the caller of the function, when function calls another function?

still forum
#

not really

#

no

#

unless you have your own setup where you pass function names through variables

spiral fractal
#

ok Thank you!

still forum
#

any specific thing you need that for?

robust hollow
#

if you use CfgFunctions with normal headers you should have _fnc_scriptNameParent?

spiral fractal
#

in mission that I edit, there is a lot of calls to the same function, and its missing parameter that I need, and if it was possible to know what function called it, it would save me at least 35 file edits...

marble basalt
#

was wondering if anyone knows of another command similar to " itemCargo" trying to pull classnames of backpacks from a cargo

robust hollow
marble basalt
#

thanks

#

didnt see that one when looking at related commands to item cargo

young grove
#

Is anyone aware why battleye "Compile Blocks" some public variable functions. E.g. call compile str "A3RL_SomeFunc = {some code that does fun stuff}"; publicVariable "A3RL_SomeFunc"; will give this in the publicvariable.log 09.05.2020 16:15:34: Muse Genius (69.69.69.120) d70fea418b52be9920b0ad80676d137e - Compile Block "A3RL_SomeFunc" Some functions don't do this and some do. I can't seem to find a pattern

upper rose
#

@jagged wing i just saw a video on that

#

hold on

#

there are a number of videos describing firing ranges; im working on improving the ones ive made myself

sharp grotto
#
systemChat(format["OWNED_DLC: %1",_ownedDLCs]);

_appID = getObjectDLC cursorObject;
systemChat(format["APPID: %1",_appID]);


if !( _appID in _ownedDLCs) then
{
    systemChat "DONT OWN DLC";
};

I need to do the same with just a classname instead of an object. Is there any way ?
I need to detect if an item is part of dlc and if the player owns said dlc.

robust hollow
#

yes it is possible. here is a modified version of some old code i had for checking dlc ownership

private _class = param [0,"",[""]];
private _configPath = configFile >> "CfgVehicles" >> _class;
if (isNull _configPath) exitWith {false};
private _source = configSourceMod _configPath;
_source == "" || {getNumber(configFile >> "CfgMods" >> _source >> "appID") in (getDLCs 1)}

it may or may not work in this form but thats the general idea for what must have worked for me in the past

sharp grotto
#

thanks alot. gonna try my luck with that

warm hedge
#

I don't think this solution works correctly, as sqf configSourceMod (configFile >> "CfgVehicles" >> "B_Truck_01_mover_F")returns "expansion", although HEMTT is apparently vanilla (platform) vehicle

robust hollow
#

hmm. ill see if i can find a better way.

warm hedge
#

AFAIK, DLC restrictions for Arma 3 is based on p3d path, or the p3d itself, not the config (so we can't use non-owned vehicles/weapons/equipments without purchasing them via make the same config)

#

It's possible to assume DLC restriction via model path, but might not perfect. So, my answer for now is you can't without spawning or try to do at existed vehicle

robust hollow
#

surely you could identify the dlc an object class comes from the same way arsenal does it when it loads the dlc icons in the list?

warm hedge
#

Arsenal's icon is completely messed

robust hollow
#

aww

warm hedge
#

Like, Driver Coveralls don't have Karts icon, Full Ghillies don't have Marksmen icon, such

#

I know the feeling, I many time facepalm like your icon with those icons

robust hollow
#

my picture is a facepalm for moments like these 😛

warm hedge
#

Same as Eden Editor's icons

#

AFAIK Eden Editor uses configSourceMODList to get icon, Arsenal uses configSourceAddonList, configSourceMODList, CfgPatches to get icon

spiral fractal
#

how can I raise event when variable set for player changes? I want to detect when value is > 80?

winter rose
#

Is anyone aware why battleye "Compile Blocks" some public variable functions. E.g. call compile str "A3RL_SomeFunc = {some code that does fun stuff}"; publicVariable "A3RL_SomeFunc"; will give this in the publicvariable.log 09.05.2020 16:15:34: Muse Genius (69.69.69.120) d70fea418b52be9920b0ad80676d137e - Compile Block "A3RL_SomeFunc" Some functions don't do this and some do. I can't seem to find a pattern
str is absolutely not needed here @young grove

fervent kettle
#

I know, i have asked this yesterday already, but it`s still not working: I am looking for a line that deletes "any player helicopter" in range "x" of a marker when it enters a specific trigger

fervent kettle
#

this is what I have got right now, it teleports but doesnt delete the vehicle

[] spawn{    
    player setPos (getpos (Base));
    sleep 0.2;
    {
    if (_x distance markerPos "deleteheli" < 50) then {deleteVehicle _x};
    } forEach units group player;
    hint "Dein Heli wurde entfernt";
};
robust hollow
#

units group player would return an array of units in the players group... not a helicopter.

fervent kettle
#

does forEach vehicles; works? prob not, sounds to easy too

robust hollow
#

((markerPos "deleteheli") nearObjects ["Helicopter",30]); try that. or just reference the helicopter directly if you can.

fervent kettle
#

Naa, it is supposed to delete any helicopter entering the trigger

#

did it like this but still not working

{
    if (_x distance ((markerPos "deleteheli") nearObjects ["Helicopter",30]); then {deleteVehicle _x};
    };
robust hollow
#

wtf...

#

units group player would return an array of units in the players group... not a helicopter.

#

replace ^^ with ((markerPos "deleteheli") nearObjects ["Helicopter",30])

#

seriously man u need to actually read what ur doing instead of pasting snippets wherever you like and hoping itl work.

fervent kettle
#

I`m trying...

#

So, i have pasted it where you told me to, but it is still not doing anything

robust hollow
#

just to be absolutely sure, replace ur whole snippet with this

[] spawn{    
    player setPos (getpos (Base));
    sleep 0.2;
    {deleteVehicle _x} forEach ((markerPos "deleteheli") nearObjects ["Helicopter",50]);
    hint "Dein Heli wurde entfernt";
};

if that doesnt work then you helicopter isnt close enough probably. ive just tested in editor and it works for me.

fervent kettle
#

uhm... had a typo in my marker..

young grove
#

@winter rose Yeah, I know that string is made by formatText to bypass the 8kb limit of format and str was needed for that. But I still have yet to find any info on battleye "compile block's"

vague geode
#

Is it possible to execute a behaviour script every time a player connects his/her jet to a specific catapult on the USS Freedom (aircraft carrier)?

ocean bison
#

Hi. Need some help with custom mission loading screen in Arma2OA.
Short: ctrlSetText don't change text control in loading screen.

I have custom loading screen class in my description.ext with text control (extends from RscText)
After calling startLoadingScreen i see my screen and text that i defined in description.ext - all is OK.
But i can't modify that text. I trying with ctrlSetText [_textIDC, "text 2"]; but have no effect;

shut shadow
#

will running this call BIS_fnc_replaceWithSimpleObject; on a lot of objects init field cause any issues? Is there a superior way to be doing it?

winter rose
#

@ocean bison I think you cannot change the loading screen's text (would need confirmation though)

#

@shut shadow at least wrap this statement with if (isServer) then { ... };

warm hedge
#

In A2OA it's possible via description.ext IIRC (as PMC missions did), but however it is offtopic isn't it?

winter rose
spiral fractal
#

if I write 5+ exitwith instead of 1 if with multiple boolean checks will it be faster/ better performance?

winter rose
#

wiki/Code_Optimisation says yes

spiral fractal
#

Thank you!

faint oasis
#

i have a question ? how to rotate an object on the y or z axis ? because the setdir it's not for that. and i think i need "setvectordirandup" but i don't know how to use that and i want to do a rotation system the same of a preview in a car spawner.

#

yes if i want to rotate an object to a specific angle i copy the vector dir and up and it's good but here i want to do a rotate platform

#

i don't know what is the good name in english i'm sorry i'm french

#

yes exactly

winter rose
#

a pedestal, but with all-axis rotation

#

ArmA is old

faint oasis
#

@eager pier ok thx

young current
#

is this the car script everyone always talks about?

crude needle
winter rose
#

@red bear see say, groupChat, groupRadio, kbTell

red bear
#

im using a ogg file, i made a sounds file, put them in there, used a description ext, and wrote stuff in a trigger yet nothing happens

faint oasis
#

@crude needle i will test thx

winter rose
#

@red bear one would need the CfgSounds and code used so one can help 😉

red bear
#

@winter rose assuming I named the audio file s2, class CfgSounds
{
class s2
{
name = "s2"; // Name for mission editor
sound[] = {\Sound\s2.ogg, 0.8, 1.0};
titles[] = {0, ""};
}; and then in the trigger i would have man1 say "s2";

lost copper
#

@red bear looks like you use wrong path for sound in your mission folder

#

If your sound is %Mission_root%/Sound/s2.ogg you should use

  sound[] = {Sound\s2.ogg, 0.8, 1.0};
red bear
#

i will try it out later thanks

minor surge
#

Hi guys, I'm having a problems with a some of the scripts I have. Since one of the updates it just stopped working. I was wondering if anyone know of any changes made by BIS that would have affected my script. Can someone please take a look and tell me if there is anything I may be missing. Thank you in advance.

#

// Declaração de variáveis
//private["_patrol","_rhib_l"];
_patrol = _this;

// Comandos
_patrol animate ["Deploy_Left_RHIB",1];
_patrol animate ["Horizontal_RHIB_Left",1];
sleep 10;
_patrol animate ["Vertical_RHIB_Left",1];
sleep 10;
_patrol animate ["Hide_RHIB_Left",0];
sleep 0.5;
_rhib_l = "MEA_RHIB_Base" createvehicle[0,0,0];
_rhib_l setDir (getDir _patrol);
_rhib_l setPosASL (_patrol ModelToWorld [-9.1,-7.1,-13.3]);
sleep 1;
_patrol animate ["Vertical_RHIB_Left",0];
sleep 10;
_patrol animate ["Deploy_Left_RHIB",0];
_patrol animate ["Horizontal_RHIB_Left",0];

#

nothing, no error. Just does not execute

#

Well it is a boat I want to spawn.

#

It is a boat from a mod that I m helping with.

#

Thank you it was not enableded the "show Script error"

#

roger, I m just doing it now

#

yeah, it does not work and no error

#

funny thing though

#

if i call the script on the debug console it works

#

does it have anything to do with class _this?

red bear
#

@lost copper doesnt seem to work

minor surge
#

I m calling by useraction, let me give you a sample

#

_patrol is a unit

#

is a ship

red bear
#

@lost copper sorry for two pings, but whenever i close the game and try to open the mission file it tells me it is not accesible while i can open any other mission

minor surge
#

@eager pier I will give it a try. It is so funny thought. It used to work before and now it does. Thank you for the help, I will keep you posted if anything.

red bear
#

its says the file is not accesible

#

I tried making a mission before and it seemed to delete itself, trying again rn

#

it says C: Users/infi/OneDrive/Documents/Arma3 - other Profiles/great/missions/missionname is unavailable. If the location is on this PC, make sure the device or drive is conncected or the disc is inserted, and then try again.If the location still cant be found, it may have been moved or deleted

#

im just trying to open the file

#

Armma3 proflies/missions/ Mission i wanna open

#

im not trying to open the mission.sqm

#

It seems that whenver i create folders/ add stuff in the mission it makes it unusable until i restart where it just deletes the stuff

#

f

#

it looks like its in documents and in onedrive, but i just uninstalled onedrive

#

it seems i have copies of my documents folders so it may take a while to fix

sour flint
#

Hello, very new to scripting, so hopefully a simple question.
I'm playing a mission with two of my mates, and I have the following script to put into the debug box:
player setpos [8139.11,27645.9,22.6];
So I can get this to move me (using the local button) or everyone (using the global button) to that location. Is there a way i can get this code to just send one player specifically (named Scott) rather than me having to send us all?
Thanks in advance.

robust hollow
#

global exec

if (profileName == "Scott") then {player setpos [8139.11,27645.9,22.6];}
#

there is no specific player targeting in the default debug console

vague geode
#

I have placed the USS Freedom aircraft carrier in the 3Den editor but for some reason AI Black Wasp pilots do not land there, instead opting to land on the AAC Airfield (the closest airfield to the carrier) instead. Any idea why and how I can fix that?

sour flint
#

global exec

if (profileName == "Scott") then {player setpos [8139.11,27645.9,22.6];}

@robust hollow tyvm for the help.

faint oasis
#

hi, i have an other question ? how to wear the enemy uniform same in "apex old man" someone have an idea ?

winter rose
#

maybe the unit is a civilian, I believe all civvies can wear any uniform (to check though)

faint oasis
#

yes but that is the problem the unit is not a civilian it's a west unit and i have added a waituntil to see if the side unit is changed when i take an uniform and not it's a west unit

winter rose
#

I mean in Old Man; I don't know how it is made - maybe Old Man is a civilian unit so it can use all the uniforms

using a uniform will not change your side, you have to script that

faint oasis
#

i have checked in the mission i know the unit is "west side" because i have the debug so i know so it's not a civilian and i don't understand because i check all .sqf in the oldman mission but i don't find where he change that maybe a variable.

winter rose
#

Old Man is still pretty new, and undocumented ¯_(ツ)_/¯

faint oasis
#

yes it's true

robust hollow
#

are you talking about a bot taking a uniform or the player?

faint oasis
#

@robust hollow the player | the same system in the oldman mission

jade abyss
faint oasis
#

after a big debug with the "oldman" map i have found where is the problem. The starter player in Oldman is a civilian "c_man_1" but with blufor side so i have create a civilian and changed his side to blufor and you can always take an enemy uniform. And the problem is not the side but the classname. If you have a b_soldier_f in civilian side that will doesn't work because the "b_soldier_f" have side 0 on default.

winter rose
#

side 1* (0 = east, 1 = west)

so now you know how to do? 🙂

vague geode
#

How can I hide a units indicator from the map (meaning even friendly units can't see its position on the map)?

misty salmon
#

How can I hide a units indicator from the map (meaning even friendly units can't see its position on the map)?
@vague geode maybe difficult settings

warm hedge
winter rose
#

WOW I missed forgot that Oo

#

but only for one unit, won't do. I can't think of a way @vague geode

warm hedge
still forum
#

@misty salmon

I want a YouTube video to appear on a screen
You won't be able to do that

misty salmon
still forum
#

Yes I know the video

#

movie camera tricks

misty salmon
#

so is it impossible in any way?

still forum
#

They download the video clientside (using a youtube download which violates youtube tos) then convert it to ogv, then load it ingame via filepatching (which is disabled on any server that wants to be somewhat safe against hackers)

#

So. Possible sure. But not in the way you want it. And if you have to ask how, you won't be able to get it set up on your own

misty salmon
#

They download the video clientside (using a youtube download which violates youtube tos) then convert it to ogv, then load it ingame via filepatching (which is disabled on any server that wants to be somewhat safe against hackers)
@still forum now I understand, thanks

faint oasis
#

@winter rose yes i know now and i'm sorry for the "side 0"

winter rose
#

Good 👀 😄

fervent kettle
#

Would that be the correct way to give the action an actionID?

_actionID = [Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.2]] remoteExec ["addAction", Tavares, true];
warm hedge
#

No

winter rose
#

from https://community.bistudio.com/wiki/remoteExec

Return Value:
Anything - Nil in case of error. String otherwise. If JIP is not requested this is an empty string, if JIP is requested, it is the JIP ID. See the topic Function for more information.
@fervent kettle

ionic anchor
#

is it possible to call a function/script from a specific tvadd entry in a CT_Tree

warm hedge
#

Via onTreeSelChanged or something?

ionic anchor
#

via onTreeDblClick

warm hedge
#

Then tvSetData and tvData are yours

fervent kettle
#

from https://community.bistudio.com/wiki/remoteExec
@fervent kettle
@winter rose Just to make sure i have got that right, if JIP is set to true, it will create a new ID wich will override the first one. If set to false, it will crate an empty string, wich is basicly useless. And all i need to do is to add an function, that asks for this one ID that gets created after every use?

ionic anchor
#

something like CT_Tree tvsetdata [[0,0], ['onTreeDblClick'] call randomfunction; @warm hedge

winter rose
#

not an action id, a JIP message id.
you cannot obtain this action id through remoteExec @fervent kettle

vague geode
#

@winter rose @warm hedge Ok, still thank you.

warm hedge
#

Uhh

ionic anchor
#

well something like that lol, still figuring it out

warm hedge
#
_tree tvSetData [[0,0], "YourFunction"];
_tree ctrlAddEventHandler ["onTreeDblClick",{
    params ["_ctrl","_index"] ;
    call (_ctrl lbData _index);
}];```Like this? IDK
ionic anchor
#

ill play about with that and see what happens, ty 🙂

candid cape
fervent kettle
#

not an action id, a JIP message id.
you cannot obtain this action id through remoteExec @fervent kettle
@winter rose on the wiki it says, i can manually give JIP an ID but i couldnt find how

winter rose
#

@fervent kettle it is the JIP argument

#

again, nothing to do with action ID.

fervent kettle
#

I understood so far, but it said i could remove the JIP message id with remoteExec ["", "JIPid"]; + that i can manually create a unique JIP id. And I am assuming that "JIPid" is the manually created JIP id

candid cape
#

@eager pier Thanks!!

winter rose
#

yes - this will not remove the action but simply avoid JIP players to have it added

#

and if you only want to add the action to current players, don't set JIP or set it to false
@fervent kettle

fervent kettle
#

I want to add it on server start, remove it when a script is being executed and added back after "_x" seconds from where it`ll repeat the whole process. For one person

winter rose
#

you should have started with that!

the best way imo is to add the action and set a condition to it

fervent kettle
#

Sorry bout that, so my condition is set to "true" right now, could i set a string wich will function as actionID?

winter rose
#

forget about its id.

in init.sqf:

DERG_ShowAction = true;
theObject addAction [(…), "DERG_ShowAction"]; // ← condition
sleep 5;
DERG_ShowAction = false; // hides the action

sleep 5;
DERG_ShowAction = true; // shows the action
#

basically, you add the action only once and never remove it
you only play with its display condition

#

@fervent kettle ↑

fervent kettle
#

I am kinda confused,
DERG_ShowAction is the name that includes the whole line
theObject is the unit in this case
where exactly does the DERG_ShowAction in the 2nd line goes? where the JIP is set?

winter rose
#

if you add the action in the init.sqf, the action will be added to all the connecting players.
now if you don't want it to be displayed, play with the variable

fervent kettle
#

I add it to one player, first time via onPlayerRespawn after that via the script he executes

#

Would i need to rewrite this line or can I just implement the DERG_ShowAction?

    [Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.2]] remoteExec ["addAction", Tavares, true];
winter rose
#

basically: if you remoteExec, you cannot get the action ID from where you remoteExec'ed

fervent kettle
#

so remove the remoteExec part? I did it like this in onPlayerRespawn now:

Tavares addAction["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.2, "remac"];
remac = true;
winter rose
#

you can use a _this var?

fervent kettle
#

instead of the units name?

winter rose
#

yes

#

I suppose Tavares is the unit that is respawning?

fervent kettle
#

Yep, but dont i need to define the unit?

winter rose
#

wait, it is not in an Event Handler?
onPlayerRespawn.sqf?

fervent kettle
#

Yea, it is in onPlayerRespawn.sqf BUT since there are multiple players it would add the option to all of them

winter rose
#

player Addaction or Tavares addAction, no difference

fervent kettle
#

error type string, expected bool prob cause the "remac" var isn`t where it is supposed to be

#

and a missing ] one

fervent kettle
#

now it`s just dropping a "missing )" error

Tavares addAction[("<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.2), "remac"];

same when using

if (player == Tavares) then {player addAction[("<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.2), "remac"]};
still forum
#

well yes

#

your () is not valid

#

what was your intention for that? why did you put it there?

fervent kettle
#

as Lou said above theObject addAction [(…), "DERG_ShowAction"]; so i thought it would be like:

if (player == Tavares) then {player addAction[(...), "remac"]};
still forum
#

no

#

just remove the parenthesis

fervent kettle
#

then it gave me a error type string, expected bool error

still forum
#

then you passed a string where a boolean should be

fervent kettle
#

the string aka actionID i need, where do I need to put that, in the condition? like

Tavares addAction["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "remac", 0.2];
still forum
#

aka actionID
There us no "actionID" string?

#

You mean the condition?

#

Just look on wiki. and count

fervent kettle
#

my condition is set to "true", can i change that to "remac"?

still forum
#

1, 2, 3, 4 like in kindergarden.

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
title 1, script 2, arguments 3

["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "remac", 0.2];
Jammen 1, jam.sqf 2, [] 3, ...

#

Can't see a error type string, expected bool in there

fervent kettle
#

so you mean i have to fill in the params?

still forum
#

Not sure what you mean

#

my condition is set to "true", can i change that to "remac"?
The condition is a piece of code. if "remac" is a variable thats either true/false then yes you can do that

fervent kettle
#

params are [] rn, do you want me to fill them ["Tavares", "Tavares", "remac", ""]

still forum
#

no

winter rose
celest flicker
#

damn im gonna either A) have a stroke B)cry or C) both

#

3 hours to figure out why literal 2 lines of code dont work and im at my wits end

winter rose
#

will we ever know which lines it is, or shall thou keep thee secret for eternity… @celest flicker

celest flicker
#

im already settling the thing in #arma3_scenario cause i figured out its not the code its the trigger itself

#

_group1 setCombatMode "RED";
_group1 setBehaviourStrong "COMBAT";

#

heres the code either way

winter rose
celest flicker
#

Lou i need serious help m8

#

when not even mission makers can help the only defense left are the scripters

#

wish i could send screenshots

#

would skip a lot of needless explanation

winter rose
#

you can post them on a hosting site and link them here

digital hollow
#

Although a lot of the times explaining a problem basically solves it.

winter rose
#

called rubberducking 🦆

celest flicker
#

so basically

#

i have a trigger area

#

its supposed to switch bots from careless to combat and from hold fire to free fire

#

_group1 setCombatMode "RED";
_group1 setBehaviourStrong "COMBAT";

#

thats what this means

#

but

#

after i place the trigger zone in mission making

#

and go to multiplayer to test the script

#

the trigger zone as an entity does not appear

#

while everything else does

winter rose
#

that's Zeus, and I am not good at it

#

(but maybe someone else is)

celest flicker
#

so where do i go from here?

#

so i climbed from mission making to scripting, do i go directly to bohemia offices now?

winter rose
#

if you create a "simple" trigger, does it show up?

celest flicker
#

so a trigger unedited?

winter rose
#

yep

digital hollow
#

_group1 doesn't mean anything by it self. How are you feeling the trigger what group you want?

celest flicker
#

i want the group called group1

#

also no

#

NO trigger works

#

edited or undited

#

im just cursed

winter rose
#

nope, just that Zeus triggers and editor triggers may differ

celest flicker
#

ok so how is the ingame mp zeus trigger called?

winter rose
#

IDK… can you try naming your trigger trigger1, and do```sqf
yourZeusUnit addCuratorEditableObjects [trigger1, true];

celest flicker
#

hmmm

#

my zeus unit?

winter rose
#

well, you have one, right?

celest flicker
#

Well yes but i never set them a variable name

winter rose
#

time to do it!

celest flicker
#

Yeah

#

Where do i write the script tho?

#

Local exec right

#

Also do i add the complementary _

#

Before the code

winter rose
#

_ is valid only for a scoped variable

celest flicker
#

I do not know what that means

#

Just say the word on where to write the command

#

also when you say m zus unit you mean the whole squad as in unity united and so on

#

or unit as in entity

winter rose
#

try the debug console, don't add underscores

#

unit as in entity, character

#

(it is true that it is prone to confusion in a military context)

celest flicker
#

so how do i open debug?

winter rose
#

Escape?

celest flicker
#

well ye but like which one

#

cause it doesnt let me write in either server global or local

winter rose
#

I don't follow you

celest flicker
#

ok i figured it out

#

i wrote it where its supposed to go but

#

how do i enter in the command

#

or only having it there in the text box does its work

#

wait

#

i entered it in

#

i think it should work

#

didnt tell me error

#

and nope still doesnt work

#

do you just want me to open a stream so you can see what dumb thing im doing wrong?

winter rose
#

negative, I am about to go to 🛌 (almost midnight here)

celest flicker
#

its almost 1AM for me too

#

also you arent a real programmer if you sleep

winter rose
#

I don't have access to a coffee machine

#

a better answer could have been: "I can code with my eyes closed"

celest flicker
#

i dont either

#

but i still dont rest till my problems are done

#

or my problems do me in

#

you either take care of them or they take care of you

winter rose
#

I'm off, though - if you are still stuck then, ping me in ~18h! 🌛

celest flicker
#

tbh i think ive been stuck with this problem for 7 hours straight

winter rose
#

then you should know better than to insist ^^
½h - 1h stuck = go do something else to clear the mind
+1h/2h = ask for advice
+1h = drop it for the day

celest flicker
#

its the only thing i have to do left

winter rose
#

ah, I can relate

celest flicker
#

and i take pauses between asking different people out

winter rose
#

a-are you asking me out?? ❤️ ❤️ ❤️

#

he he he 😄
anyway, see ya 👋

celest flicker
#

i am too tired for jokes

#

my patience ran out alongside with my energy drinks

#

only hatred fuels me into continuing to work into the night

solar chasm
#

Hey all, I'm building something in Eden and trying to get a trigger to stop animations and resume waypoints.
In the init of the relevant units, I've placed:
if (local this) then { [this, "BRIEFING"] call BIS_fnc_ambientAnim; };
The units are all on a 'Hold' waypoint, with a 'Move' and 'Seek & Destroy' after that

Then I have a trigger set up to skip the hold waypoint. Ideally when the trigger activates, the units will come out of their animation and begin their Move waypoints.

I've tried naming each unit and putting _unit call BIS_fnc_ambientAnim__terminate; into both the Move waypoint Init and Trigger On Activation boxes, but neither seems to work. (I even tried a "[] spawn {...}" with the terminate function inside - which I know is probably a horrible way to do it, but I was trying anything that came to mind...). Any thoughts, or even pointers as to where to look online are welcome. TIA!

steel fox
#

Have you named the units in the eden editor as _unit? That would be a public variable, don't start those with an underscore.

spiral fractal
#

how can I activate trigger by player controlled UAV and player? right now it set to setTriggerActivation ["ANYPLAYER", "PRESENT", true];

steel fox
#

Activate in when a player or a player controlled UAV passes through?

spiral fractal
#

yes

#

I tested with AR-2 drone and I think its not working

steel fox
#

The drone itself ins't a player, it won't ativate ANYPLAYER

spiral fractal
#

yes I thought so, is there any way to make it work?

steel fox
#

You can switch it to ANY and the check thisList for players, and if no players are found, check it for UAV's, if a UAV is found, you can use UAVControl to see if a player is controlling it.

spiral fractal
#

it seems to work, Thank you!

steel fox
#

No problem

dusty depot
#

_missionstat = 0;

#

_action_opfor_ground = player addAction ["Spawn ground enemies", "call fnc_ground", nil, 1.5, true, true, "", "_missionstat == 0"];

#

what is wrong with my addAction?

#

nothing happens when i start the game

robust hollow
#

_missionstat is a local variable. the action condition cant see it

#

different scopes

dusty depot
#

oh

steel fox
#

lemme format that for you:

_missionstat = 0;
_action_opfor_ground = player addAction ["Spawn ground enemies", "call fnc_ground", nil, 1.5, true, true, "", "_missionstat == 0"];
dusty depot
#

so i have to remove the underline of the variable?

steel fox
#

the underscore, yes

dusty depot
#

thank youy

glass zinc
#
//--- Basic loop that records player position eveyr 60 seconds and compares to to old one.
//--- Times are preset in this files only.

_name = name player;

while { hasInterface } do {
    private _starttime = time;
    private _messagecreated = false;
    private _run = true;
    private _time_to_idle = time + 60;
    fnc_key = {_time_to_idle};
    sleep 60;
    while {(time > _time_to_idle) && _run} do {
      if(_messagecreated) then{
        if !(uiNamespace getVariable "BIS_fnc_guiMessage_status") exitWith {
          _run = false;
        };
      };
      _diff = round (time - _starttime);
      //diag_log ["DIFFERENCE:", _diff];
      switch (_diff) do {
          // 10 Minutes
          case (600):{
            diag_log "1st Warning";
            systemChat (_name + ", you have not moved for 10 minutes and will be kicked if you do not MOVE your main player unit for another 5.");
          };
          // 14 Minutes
          case (900):{
            diag_log "2nd Warning";
            // Create a hint window, if the player clicks OK then the timer resets
            _name spawn {[_this + ", you have 1 minute to click OK and MOVE your MAIN Player UNIT before you get kicked.", "Warning", true, false] call BIS_fnc_guiMessage;};
            _messagecreated = true;

          };
          // 15 Minutes
          case (960): {
            diag_log "Kicking Player";
            // Close the hint window
            uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];
            // Give player final message
            systemChat (_name + " you have inactive for 15 minutes and have been kicked.");
            sleep 5;
            // Kick the player
            "end5" call BIS_fnc_endMission;
          };
      };
      sleep 60;
    };
};

anyone have any guess to why my script is not working? trying to create a better anti AFK system for our CTI server. I think its not resetting the time correctly. or im messing up some basic logic here.

steel fox
#

how is this script executed? with a call or spawn?

glass zinc
#

execVM

robust hollow
#

fnc_key = {_time_to_idle}; is that called anywhere? it probably doesnt work.

glass zinc
#

ohhh

#

i think that might be it connor

#

might have to replace {(time > _time_to_idle) with fnc_key

#

supposiedly fnc_key detects any keypress

#

thats what i was told anyway

#

i think i needed to add a event handler

#

:S

#

ill ugghh come back later when i unscrew myself a bit here

glass zinc
#

thanks i did not know about isGameFocused

#

if fixed my script as well

#

was missing some key pieces it turns out

solar chasm
#

@steel fox Thanks ... No, no underscore to name the unit. They're all labeled as specific 'variables': "CSAT_CAMP_LEADER", "CSAT_CAMP_1", etc, etc... (of course, sans quotations) Was just using "_unit" as a placeholder, but should have lost the leading underscore.

solar chasm
#

New question, as I blunder my way through all this as a newb...
I'm trying to use the debug console to get some values. I've created a script and executed it locally in the console (in Eden, via LAN hosted MP) and entered the appropriate variable in the first 'watch' field... Now how do I peruse the results easily? Is there a way to get it copied to the clipboard and paste it into a text file, or similar?

signal kite
#

@solar chasm you could use diag_log to have it written in your *.rpt file. Use a loop if you want to check it repeatedly.

robust hollow
#

copyToClipboard str var;, or ctrl + a and ctrl + c in the watch result panel

#

diag_log is good too, just as long as the result isnt longer than the character limit.

signal kite
#

thx @robust hollow. I didn't know about the 1044 character limit.

solar chasm
#

thanks for the help.
OK... my ignorance is showing. Watch result panel?
`copyToClipboard str var' ... something else I can execute in the console? So if I've set my variable as 'things' (i.e. "things = code...."), then I'd execute 'copyToCliboard str things' and Ctrl-V it in my editor?

robust hollow
#

copyToClipboard str var OR copying from the watch result panel

solar chasm
#

@signal kite Yeah... I currently have RPT turned off, in an attempt to ease the burden on my potato. But I'm hoping for something I can alt-tab out of Eden, check the code, and then alt-tab back in.

robust hollow
#

oof. read half the sentence and decided that was enough

#

yes, what you said is correct

solar chasm
#

@robust hollow (sorry, typo) yeah... again, my ignorance is embarrassing... Didn't know there was a watch results panel, and no idea how to find it in eden. =/ Doh.

robust hollow
#

in the debug console each watch panel has a return panel under it

#

same as how the main code input has a return panel right under it

solar chasm
#

Ahhh. just clicked into it and saw a cursor (edit - just thought that was negative space between the watch boxes!). Strange that it is blank when the command should have returned a value.
things = getAllHitPointsDamage LSV_1
LSV_1 is the variable name I gave to a vic. I've put "things" (sans quotes) into the first watch box.

steel fox
#

you might just be missing a semicolon after LSV_1

solar chasm
#

That would have been embarrassing, but adding a semicolon doesn't fix it.

steel fox
#

where are you executing :

things = getAllHitPointsDamage LSV_1;

this code? In the debug menu?

solar chasm
#

yes. Copy-pasta'd from your discord post just to make sure I had no typos, and still no return in the watch panel.

#

things is in the first watch box.

#

LSV_1 is the Variable Name of a specific vehicle.

robust hollow
#

a semicolon only matters if there is another statement after it

solar chasm
#

Right, which is why I didn't have one originally - I was just trying to use the debug console to get the hitbox list / values...

robust hollow
#

why not just execute getAllHitPointsDamage LSV_1 in debug?

#

dont assign it to a variable

steel fox
#

And the result will be show below the Debug Console

still forum
#

a-are you asking me out?? ❤️ ❤️ ❤️
@winter rose
Coffee and Cheesecake or snails?

solar chasm
#

Dusty, because I'm an idiot, didn't understand the structure of the debug console, and was just trying to piece it together from things I found online.

That worked. Thanks 100x over to you and Connor for helping out an ignoramus!

steel fox
#

No problem mate

solar chasm
#

(also turns out it won't execute in Eden ... only when I've launched the scenario. Which would have driven me up a wall and back down again, except I happened to be testing something else as we corresponded!)

vague geode
#

Is it possible to prevent/block NPCs from taking control of mortars? I disabled the artillery computer but that's really pointless if people can just order their NPC to take control of mortars and then order them to fire on any position with pinpoint accuracy...

PS: I am talking about a warlords mission which has mortars added as defences meaning they can be placed in any sector by paying a certain amount of CP (Command Points ["currency"])...

sour flint
#

Hey, noob scripter here.
I'm trying to add British troops to our Antistasi game, coz Brits are awesome (god save the Queen), but whenever I add them they instantly kill each other. Which despite being quiet entertaining is also quite annoying. Does anyone know how to stop this?
I've tried assigning them to a side but it doesn't seem to do anything. This is my basic script I'm putting in to the console:
_unit1 = group player createUnit ["UK3CB_BAF_Rifleman_DDPM", position player, [], 0, "FORM"];

winter rose
#

is the player east, by any chance?

sour flint
#

we play independent, but i've tried adding independent in too and they still kill each other

winter rose
#

what does ```sqf
[west, resistance] call BIS_fnc_sideIsFriendly;

sour flint
#

it says false

#

what does this mean?

winter rose
#

it means west hates indep

sour flint
#

ah

glass zinc
#

selectRandom how can i use select random to pick multiple items in the array? instead of just 1 thing? I have 7 Ai and i want it to pick from an array of classnames in the array. right now it will pick randomly and give me 7 of the same ai classnames but different each time. I want it to give me 7 different classnames.

winter rose
#

and createUnit does not set the unit's side to the group's side but to the config's side
I believe UK3CB_BAF_Rifleman_DDPM is west by default? @sour flint

sour flint
#

yeah, can "_grp = createGroup independent;" change this?

winter rose
#

@glass zinc you can use```sqf
private _randomised = _myArray call BIS_fnc_arrayShuffle;
private _first7 = _randomised resize 7;

#

@sour flint I don't think so
create them west, then join a new indep group maybe

sour flint
#

ok, i will keep trying, thanks for help though

steel fox
#

Is it possible to prevent/block NPCs from taking control of mortars? I disabled the artillery computer but that's really pointless if people can just order their NPC to take control of mortars and then order them to fire on any position with pinpoint accuracy...

PS: I am talking about a warlords mission which has mortars added as defences meaning they can be placed in any sector by paying a certain amount of CP (Command Points ["currency"])...
@vague geode Can't you just add a getIn eventhandler on the mortar and if the unit that got in is not a player, e.g isPlayer is false, just eject them from the mortar.

vague geode
#

@steel fox At least I don't know how since there aren't any mortars on mission start and players can just spawn them in while the mission is running.

steel fox
#

Upon mission start, attach a WeaponAssembled eventhandler to each player, then, if the deployed weapon is a mortar, attach the Eject thing i mentioned.

fervent kettle
vague geode
#

@steel fox Does this eventhandler only get called when a weapon is assembled from backpacks? If so I don't think it would work since the mortar spawns fully assembled.

winter rose
#

dropping an local variable in global space error
@fervent kettle what is?

fervent kettle
#

the example you gave me yesterday

steel fox
#

@vague geode When you buy them they spawn fully assembled then? Hm.

winter rose
#

@fervent kettle your code please

vague geode
#

@steel fox Yes, they do.

fervent kettle
#
Tavares addAction 
[
    "Jammen", 
    {
        params ["Tavares", "Tavares", "999", "jam.sqf"];
    },
    [],
    6, 
    false, 
    false, 
    "",
    "true", 
    0.2,
    false,
    "",
    ""
]};

and a Stone to throw at me cause I probaply did a realy big mistake by writing stuff in the params

steel fox
#
params ["_Tavares", "_Tavares", "_999", "_jam.sqf"];

check the page on params, they need to be local, e.g. with an uderscore infort of them.

winter rose
#

👀

#

big eyes indeed, @fervent kettle - you get on my paddlin' list

still forum
#

and . in name is not valid for a local variable name, nor a global outside of set/getVariable
Plus setting the same variable twice doesn't seem to make sense

fervent kettle
#

big eyes indeed, @fervent kettle - you get on my paddlin' list
glad it`s the paddlin list and not the death note

winter rose
#

they are the same in my book - you don't know my paddlin' skills 👀 😄

fervent kettle
#

That`s to cofusing, i think ima throw away that line before i land in smth worse then your paddlin list lol

#

lets say, i want to remove the action once. Once i add it it gets the actionID 0, right? so i could just say Tavares removeAction 0;

winter rose
#

if no other mod is used, yes

#

you are guessing the value
if mods or another change happens, you break your system

fervent kettle
#

theres MCC running, so 0 is being used already.

winter rose
#

hence the absolute need to:
1- get this action ID somewhere (meh)
or
2- add action once and use its condition field to show/hide

steel fox
#

@vague geode The places whee you can spawn those mortar after they are bought, are they static or just around the map? I have never played warlords

fervent kettle
#

I`ve tried to set "hide on use" to "true" but didnt hide it

vague geode
#

@steel fox You can spawn them in any owned sector. You can place them anywhere within a sector but only within a sector.

winter rose
#

@fervent kettle hide on use is to close the action menu once the action has been used.

fervent kettle
#

Right, looked it up and i misread that. But finding the actionID or using the condition field didnt work that well so far so i think ima leave it with a complex but atleast kinda working solution

winter rose
#

your call, ok

fervent kettle
#

maybe another time i write a function like that ill come back to that, thanks for your patience anyway^^

celest flicker
#

yo Lou i fixed the trigger issue

#

dont ask how not even i can remember

winter rose
#

…well okay 8D

steel fox
#

@vague geode I can't think up any elegant solution, best i can think of is checking every area every 8 seconds or so for mortars and adding the eventhandler if it isn't yet present.

There possibly is a better way, but i can't think of it

vague geode
#

@steel fox Because of the number of sectors this isn't really feasible but thanks anyways.

fervent kettle
#

one more question, how can i add the MCC option with an addAction? Or is there an MCC side command to do so? (After removing it)

vague geode
#

Is there a way to hide specific turrets from the UAV terminal list? I have some static AA which is unaccessible for players by default but it still shows up in the UAV terminal. Is there any way to hide them from there?

smoky verge
#

hey I'm not sure if this is the right channel
been trying to have a unit do an healing animation
the unit would approach the target, do an animation to holster the rifle and crouch, and then an animation to heal

carl playMove "UnconsciousMedicFromRifle";
sleep 2;
carl switchMove "UnconsciousReviveMedic_A";

but when I try that the unit always teleports about half a meter from its position
not sure why
https://www.youtube.com/watch?v=Qf6yAHlIu18&feature=youtu.be
ignoring the corpse position you can see the holstering animation and the healing animation being slightly distanced for some reason

any way to solve this?
tried with a setPos but but it never goes in that exact spot

sick sorrel
#

hello
I have a number of in-game spawned aircraft for which I would need to run these two lines of code. Right now, I just repeat them in a script and change _air1 to _air2, _air3, ..., but is there an easier / cleaner way?

{ _air1 removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _air1;
{ _air1 setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;

I was thinking of nesting it in a big "forEach [array]", but because _x then references different things, I'm not sure that would work, but if it would, I don't know exactly how to write it either 🤔

still forum
#

but because _x then references different things
_airVehicle = _x
{_airVehicle doStuff _x }forEach...

round scroll
#

my object (catapult shoe/shuttle) does not move at all with setVelocity/setVelocityModelSpace: _shuttle setVelocityModelSpace [0, 10, 0]; It's a thingX class object, with only sbsource as named property in geo lod. What do I need to do to make the shuttle move?

round scroll
#

trying to make it a vehicle and see if that works better

sage flume
#

I have a list of classnames that I scripted to find but I want to add a , to each item. How can I do this in Notepad++

warm hedge
#

You want to do from classA classB classC to classA, classB, classC?

sage flume
#

hmmm, tad more explanation please, not quite following, heck I don't have a clue 😆

#

well here is a sample of over 5,000 lines

#

"itemwatch"
"itemcompass"
"itemgps"
"itemradio"
"itemmap"
"minedetector"
"binocular"

#

and I need to add a , to each

#

I thought your answer was an explanation until I saw your ? mark later

#

there's no way I can do a find/replace all on this one

#

That I know of anyway

austere granite
#

Ctrl+A -> Ctrl+L -> End -> Comma

#

Dunno what the line split selection in np++ is

sage flume
#

got, Sorry I didn't Google first.

#

To add a word, such as test, at the end of each line:

    Type $ in the Find what textbox
    Type test in the Replace with textbox
    Place cursor in the first line of the file to ensure all lines are affected
    Click Replace All button
exotic flax
#

I simply use the "string replace" function:

Replace "\n (quote + line break) to ",\n (quote + comma + line break)

candid cape
#

Hi I need help with an script

#

The script is this

#

` addMissionEventHandler ["EntityKilled",{
params ["_killed", "_killer", "_instigator"];
if(isNull _instigator)then{_instigator = _killer}; // player driven vehicle road kill

    if(isPlayer _killer)then{

        if(
            _killed isKindOf "CAManBase"

            /*    
          You can filter the side here   
            
            && {((side group _killed) == west or 
                 (side group _killed) == east or 
                 (side group _killed) == independent or 
                 (side group _killed) == civilian)}
                
            */        
        )then{
        
        _killed_Name = "";
        _kill_HUD = "";
        _killed_Color = "#99D5FF";

        if(!(isplayer _killed))then{
            _killed_Name = getText (configFile >> "CfgVehicles" >> format["%1",typeOf _killed] >> "Displayname");
            }else{_killed_Name = name _killed};
        
        private _distance = _killer distance2D _killed;
        private _weapon = getText(configFile >> "CfgWeapons" >> currentWeapon (vehicle _killer) >> "displayname");
        _killed_Color = (side group _killed call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML;
        
        _weapon = currentWeapon _killer;
        _pictureweapon = gettext (configFile >> "cfgWeapons" >> _weapon >> "picture");
        if(_pictureweapon == "")then{
            _weapon = typeOf (vehicle _killer);
        _pictureweapon = (getText (configFile >> "cfgVehicles" >> _weapon >> "picture"));
        };

       
        _kill_HUD = format["<t size='0.8'>Has matado a <t size='0.8'><t color='%1'>%2<t color='#FFD700'> a %3 m de distancia</t>",_killed_Color,_killed_Name,floor _distance];    
        [_kill_HUD, nil,  1, 2, 0] spawn bis_fnc_dynamicText;        };
};            

}];`

#

It runs globally, I want it to run only the player, for example, when a random civilian dies, it comes out to me. And what I want is that I only get the killfeed when I kill someone

steel fox
candid cape
#

and how can I do it?

steel fox
#
addMissionEventHandler ["EntityKilled",{
    params ["_killed", "_killer", "_instigator"];
    if(isNull _instigator)then{_instigator = _killer};    // player driven vehicle road kill
         //Check if it is player driven kill and killer is local:
        if(isPlayer _killer && {local _killer})then{
          //THE REST OF THE CODE

The Isplayer if statment, just added the local check, that should work.

candid cape
#

So , I replace this if(isPlayer _killer)then{ for this if(isPlayer _killer && {local _killer})then{

steel fox
#

That should indeed work

candid cape
#

Ok , I'm going to test it

#

Thanks!!

candid cape
#

It works , thanks dude @steel fox

steel fox
#

no problem mate

candid cape
#

And other question xd

#

In the script there is a function that when you headshot him a sound sounds, the sound plays, but only once. What I can do?

#

This is the script

winter rose
#

@candid cape post in sqfbin.com and paste the link here 😉

candid cape
#

I don't know how to do it xd

steel fox
#

Lou is right, makes it a lot easier to read.

candid cape
#

In the script there is a function that when you headshot him a sound sounds, the sound plays, but only once. What I can do?

steel fox
#

How do you mean it plays only once?

candid cape
#

Yes, when I shoot him in the head it sounds, then I shoot another player in the head and it doesn't sound again

crude needle
#

The remoteExec on line 22 should be [_shooter,_sounds] remoteExec ["say3D",_shooter];

#

@candid cape

candid cape
#

Thanks , I'm going to test it

naive needle
#

Does someone know how to find the classname with just the p3d name of a model ?

candid cape
#

Press "Ctrl + F" on the .config and look for the p3d name , it will apear : model = "example.p3d"

naive needle
#

I want to make a script to find the classname with just the p3d name

#

but I guess there is no script command for that

steel fox
#

What are you trying to do with the script?

naive needle
#

Im trying to get the classname from exported objects from terrain builder so I can replace them into eden

winter rose
#

not all models have classes, you know?

naive needle
#

yes

#

Trees for example

#

I would use it in certain situations

prime trout
#

Anyone able to help me with a tiny bit of SQF code please?

I need to convert a addAction that was being ran on a table, to give a scroll option and run a sqf file with a remoteExec after (via the initPlayerLocal.sqf) . But I have now changed to a Gui menu so have a button for it to be on instead.

steel fox
#

Just put the code from the action into the button's onClick event. That's all i can say without knowing the code behind your addAction.

glass zinc
#

Hello, I have gotten my AFK kick system working the problem is it BIS_fnc_endMission does not remove the player from the server or remove him from his Player slot. Is there a way to unassign a player from a playerslot? or kick him from the server via script?

exotic flax
#
serverCommand format ['#kick %1', name player];
glass zinc
#

will that work if the script is running on the client?

robust hollow
#

i dont think so

#

you could close the lobby display, should force htem back to the server browser

#

kinda hacky but it would work

exotic flax
glass zinc
#

close lobby display?

#

how do i do that

lone zenith
#

Hey guys, does anyone know what a "weaponIndex" or "muzzle index" is? According to the wiki in the Arma 3 Actions > SwitchWeapon section, you can get it as a result of the WeaponState command- As far as I know this only returns the current weapon and doesn't give the index. Can anyone help me out?
Link to wiki:https://community.bistudio.com/wiki/Arma_3_Actions#SwitchWeapon

robust hollow
#

i'll find the display number, one moment

steel fox
#

You can just remoteExec the serverCommand, can't you?

#

Just run it on the server alone.

robust hollow
#

@glass zinc findDisplay 70 closeDisplay 2; run that before the endmission funciton.

sacred slate
#

can you fire the cm burst some how over the copilot? i fly heli's solo and i take controls as gunner, but then i cant fire cm burst. if i config all pylons to the pilot, i cant fire the turret gun anymore. having only a fixed turret position is some how endurable but would be also great to have a free look turret while piloting.

robust hollow
#

yes you could remoteexec to server for kick, but the rest of the afk script is most likely client side so may be nice to keep it all there.

glass zinc
#

thanks for the help

steel fox
#

@sacred slate You can add a button eventhandler a soon as some one enters the specifick helo on a key.

then when that key is pressed execute :

[vehicle _unit, "CMFlareLauncher"] call BIS_fnc_fire;
lone zenith
#

Hey guys, does anyone know what a "weaponIndex" or "muzzle index" is? According to the wiki in the Arma 3 Actions > SwitchWeapon section, you can get it as a result of the WeaponState command- As far as I know this only returns the current weapon and doesn't give the index. Can anyone help me out?
Link to wiki:https://community.bistudio.com/wiki/Arma_3_Actions#SwitchWeapon
@lone zenith Never mind I found the answer, and it is cancer:
https://community.bistudio.com/wiki?title=Talk:ArmA:_Actions#weapon_index

sacred slate
#

@steel fox many thanks. unfortunately i am more a player than a coder. i have the cm burst on the "C" button and i tried several times now to fiddle the key code stuff together for other stuff. can you maybe wrap somthing more around that snippet?

steel fox
#

Ofcourse, Wait one

sacred slate
#

thx 😄

prime trout
#

Any one know the function to be able to open a gui with a key rather than a dialog

#

@steel fox Manged to work off what you gave me and found the answer for the addAction swap

#

So thanks for that

#

If anyone knows that would be great cheers

steel fox
#

How do you mean "opening a gui with a key"?

prime trout
#

So rather than at the moment I have it on a scroll to open the menu

#

I know you can use a DIKcode to get a key, then use that to be able to open the menu

robust hollow
#

keydown display eventhandler?

prime trout
#

Im real new to this Arma coding so still learning haha

#

Potenitally I saw it on the Wiki, Will try tomorrow.

#

Was just wondering if anyone know straight off the bat haah

robust hollow
#

yea, i think you're thinking of keydown.

prime trout
#

This one ya?

robust hollow
#

yes

prime trout
#

Ta, will have a play tomorrow!

pliant rose
#

hey, quick question. how do i get a scripted waypoint to end. i assume i need some sort of end script command in my sqf, but i can't find anything saying what that command is.

sacred slate
pliant rose
#

i have, its not exactly what i need

#

i have an advanced waypoint that executes a custom script, and according to the wiki after the script ends it will cycle to the next waypoint, but it never does, so i assume that the script never ends

steel fox
#

@sacred slate

(findDisplay 46) displayAddEventHandler ["KeyDown", {
    params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"];
    if (_key == 46 && {not (vehicle player == player)}) then {
        if("CMFlareLauncher" in (vehicle player weaponsTurret [-1])) then {
            [vehicle player, "CMFlareLauncher"] call BIS_fnc_fire;
        };    
    };
}];

This is what I got for you, but you do sadly need an AI in the pilot seat for the bloody thing to work.

sacred slate
#

thats not much of a problem. many many thanks

steel fox
#

i have an advanced waypoint that executes a custom script, and according to the wiki after the script ends it will cycle to the next waypoint, but it never does, so i assume that the script never ends
@pliant rose It's a bit hard to help you if we can't see the script. put int on sqfbin.com and post the link here.

pliant rose
#

sure

#

_mortartarget = mortar_trigger call BIS_fnc_randomPosTrigger;
mortarman doArtilleryFire [_mortartarget, "8Rnd_82mm_Mo_shells", 1];

#

this is all it is

#

it just fires a mortar into a area around a trigger

#

but i after it does i want the ai move onto doing other waypoints

#

the script itself works fine, the ai shoots at the right place

steel fox
#

this code is in the on Activation field, right?

pliant rose
#

no it's in an sqf

#

the scripted waypoint has a field for executing sqfs

young current
#

@lone zenith the indexes depend on available weapons. the order is in the description

steel fox
#

@pliant rose Strangly, the scripted waypoint indeed seems to just stop the waypoint chain.

pliant rose
#

yeah, i know that they don't always do that because the fire mission and land waypoints work the exact same way, but they keep going when they finish

steel fox
#

Ow, no.

#

Your next waypoint is another one that fires the mortar right?

#

like a chain of scripted fire mortar waypoints?

pliant rose
#

no, i mean the fire mission and landing waypoints both execute an .sqf file

#

as for the waypoints, the next one is a cycle tied to a trigger, so it keeps firing at the area until the trigger is activated

#

but i've tried it with waypoints other than cycle, and it still doesn't work

steel fox
#

Alright, I found something that might your for you.

pliant rose
#

i actually found an alternate way myself, but i'd still like to hear yours

steel fox
#
_mortartarget = mortar_trigger call BIS_fnc_randomPosTrigger;
mortarman doArtilleryFire [_mortartarget, "8Rnd_82mm_Mo_shells", 1];
sleep 3;
mortarman_fired = true;
group mortarman setCurrentWaypoint [group mortarman, (currentWaypoint group mortarman) + 1];

That is the mortar.sqf.

In the Condition of the waypoints put:

mortarman_fired;

In the On activiation:

mortarman_fired = false;
pliant rose
#

interesting

#

i ended up just putting the script i already had in a while field

steel fox
#

That is a much better aprouch

pliant rose
#

the whole point of the script is that players have to kill a spotter to stop the mortars

#

so while the spotter is alive just keeps firing

steel fox
#

Sounds a lot more straight forward

#

Happy you found a solution

pliant rose
#

thanks for the help anyways

red bear
#

!invehicle

steel fox
#

To check if a unit is in a vehicle do:

not (vehicle _unit == _unit);

It will give you true if unit is in vehicle and false if unit is not.

#

@red bear

red bear
#

thanks, but i wanted to activate a trigger once someone left a vehicle, such as once a squad enters an area via heli that enemies spawn

steel fox
#

So activate the trigger after a squad has entered an area by helicopter and then exits that helicopter?

red bear
#

yes, once the squad touches down it activates, ig it would be easier if i just made a location trigger

dusty depot
#

use an event handler

steel fox
#

I don't know for sure if this works for helicopters, but:

this addEventHandler ["LandedTouchDown", { 	
   params ["_plane", "_airportID"]; 
   If (_plane inArea trigger) then {
        trigger_fire == true; //Or if trigger is not neccesary anymore with this, just put your On Activation code here
  };
}];

This eventhandler attached to the helicopter and de trigger with variablename "trigger" should work.
If LandedTouchDown works with helicopers.

exotic flax
#

I believe it's only for planes (based on wiki)

#

guess the best thing to check would be flight height < 1

dusty depot
#
fnc_cancel = {
{deleteVehicle _x} forEach units _opfor_group;
exitWith {};
};
#

it says a semicolon is missing between the exitWith and {};

#

where do i have to change?

steel fox
#

If (true) exitWith {};

dusty depot
#

what does true mean?

steel fox
#

exitWith is used with an if statement, you need to have one that always is true

dusty depot
#

oh

#

thanks

robust hollow
#

what is the point of exitwith if the function ends right after it anyway?

steel fox
#

I geuss to be sure it does? XD, can't have functions running around on the loose.

#

@dusty depot what is the exitWith for? And where is the fnc_cancel called?

dusty depot
#

_action_cancel = player addAction ["Cancel this mission", "call fnc_cancel", nil, 1.5, true, true, "", "missionstat == 1"];

robust hollow
#

_opfor_group wont be defined

#

different scopes

dusty depot
#

there's a action starting a mission and a cancel for despawning all spawned enemies

#

_opfor_group is difined next to the addAction

robust hollow
#
_action_cancel = player addAction ["Cancel this mission", {{deleteVehicle _x} forEach units (_this#3)}, _opfor_group, 1.5, true, true, "", "missionstat == 1"];
dusty depot
#

what is this number sign? _this#3

steel fox
#

select

robust hollow
#

when the action is called it starts in a new scope, so your local variable wouldnt exist in it.

#

or.. a new scope stack? it doesnt inherit any local variables from where you added the action. just like the condition you asked about yesterday.

dusty depot
#

ok

#

i'll try using global variables

robust hollow
#

what.. you dont need to?

#

the snippet i pasted makes it work for you

#

giving _opfor_group as an argument lets the action code see it as (_this#3)

dusty depot
#

i need to add some more commands in the function fnc_cancel

steel fox
#

.. What do you mean? You need more variable than just _opfor_group?

dusty depot
#

i'm making a function not inside the parameter of addAction because i need more commands like deleting a task or something

steel fox
#

You can stil use a function, you just need to pass the variables.

dusty depot
#

ok

#

thanks

unique sundial
#

I geuss to be sure it does? XD, can't have functions running around on the loose.
@steel fox Make sure you add it 3 times, in case the first 2 fail

steel fox
#

throw in a breakTo when all else fails

winter rose
#

@steel fox Make sure you add it 3 times, in case the first 2 fail
Three only? while { true }!

lone zenith
#

@lone zenith the indexes depend on available weapons. the order is in the description
@young current Right I figured out the code. I'm having another issue though. I can replicate the "muzzle list" shown on the wiki. However, the index for useWeapon is not identical- gun muzzles work fine, but throwables seem to be 1 index lower. Green chemlights are also not in this "muzzle list", but for useWeapon, it has the index 16- or one less than the red light (17, but in "muzzle list" it is listed as 18). Any ideas why? thanks!

#

Killzone? Maybe you know?

high horizon
#

Does anyone know if there is anyway to create a magazine model with createVehicle?

#

I need it to attach it to player

still forum
#

no

#

there isn't

#

but there is createSimpleObject

high horizon
#

I just need to set the path isnt it? @still forum

winter rose
prime trout
#

Anyone had any experience with building a web url in Arma. So it inserts the mission name inside the url?

winter rose
#

url + missionName?

#

or briefingName, depends on what you need

prime trout
#

Yeah it would be missionName for what i need

#

However _control htmlLoad = "https://unitedtaskforce.net/operations/auth/" + missionName + "/orbat";

#

Gives me a invalid number in expression

#

Obviously doing something wrong haha

robust hollow
#

_control htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English";

#

not htmlLoad = xyz

#

may also need to wrap the whole url in () to make sure it is interpreted as one string

winter rose
#

the wiki\®, saving headaches since 2006 😉

prime trout
#

Would this need to be in a .sqf file?

robust hollow
#

uhh, it would be where ever you're executing it

prime trout
#

Roger, sorry for my incompetence extremely new to all this 😂

wispy cave
steel fox
#

Doesn't matter

#

either should work

#

@wispy cave

wispy cave
#

thanks

prime trout
#

@robust hollow How should I define the _control?

steel fox
candid cape
#

Hi , I have an Admin Panel Ingame , and I want to put a script , but it only executes on Local

#

How Can I do to execute on global??

crude needle
#

@candid cape
You mean the debug console?
Click GLOBAL EXEC (red button)

candid cape
#

No

#

It's an Admin Panel

#

With buttons

#

As Tp to target

#

or tp me to target

winter rose
#

you should refer to the mod's user guide then, as this is not Vanilla Arma

candid cape
#

No, but

#

There isn't any script

#

to execute some script on global

#

?¿

winter rose
#
[{ hint "hello!"; }] remoteExec ["call"]; //perhaps
candid cape
#

Thanks

glass zinc
#
 findDisplay 70 closeDisplay 2;
           sleep 5;
"end5" call BIS_fnc_endMission;

should work right?

#

it kicks me to the debriefing screen in testing, but im unable to tell if i im kicked out of the lobby to the server browser

#

that might be because im the host in testing?

robust hollow
#

if it skips past the role selection menu, it worked.

spiral fractal
#

what is the best way to remove all nullObject from array?

austere granite
#

_array - [objNull]

winter rose
#

ninja'd 👀

austere granite
#

rekt

spiral fractal
#

when I tried it, it only removed the first null it found, I will test again

#

seems to work, Thank you!

candid cape
#

I need help with this script

#

The sound only soun once

#

Help me pls

spiral fractal
#

I have file with function in it and I use execVM in server init to read that file, why function from that file cant see variable declared inside mission.sqm?

winter rose
#

it should - depends where you declared the variable

spiral fractal
#

variable inside mission.sqf* file, without underscore

winter rose
#

sqf?

#

mission.sqf would be a user script, if you don't run it it doesn't execute

spiral fractal
#

its all working (not my mission), I wanted to add feature in my edit

winter rose
#

then find where mission.sqf is called

spiral fractal
#

inside init.sqf

#

then init_server.sqf is called, and in that file I added execVM

winter rose
#

soinit.sqf

  • runs init_server.sqf
    (btw initServer.sqf would run by itself, but that's not the point here)

init_server.sqf

  • runs mission.sqf
spiral fractal
#

no, init.sqf runs mission.sqf then couple lines later it checks if isServer and run init_server.sqf

#

I test in single player so isServer should be true

winter rose
#

if you execVM mission.sqf and you have sleep or waitUntil in it, init_server.sqf could run before variables are created

winter rose
#

…why would you call compile prepro instead of execVM?

#

but anyway
ok, it's executing mission.sqf - what's in it? any sleep?

spiral fractal
#

no its only setup variables and reading mission parameters

winter rose
#

so it does somewhere myVar = true

#

ok, and what is the issue? which variable is not found?

spiral fractal
#

on line 476, btc_log_obj_created = []; and in my function I want to run foreach on this array and it seems like it dont "see" it

winter rose
#

nowhere can I see btc_log_obj_created usage in init_server.sqf?

#

try systemChat str btc_log_obj_created?

spiral fractal
#

I did inside my function it dont show anything

winter rose
#

weird. check that you don't override anything anywhere

spiral fractal
#

function works, another debug message appear, but not this array

winter rose
#

but basically, if you do```sqf
call compile preprocessFile "setValueTo1";
// then
call compile preprocessFile "useVariable";

spiral fractal
#

but why its not working inside my function?

winter rose
#

somewhere it's messed up
either deleted, or not executed on the server, or aliens

#

(most likely the latter)

spiral fractal
#

yes, aliens seems to be the most likely reason

#

function called by trigger that set to run on server

winter rose
#

urgh

#

mixing client and server code/definition is almost never a good idea anyway :-s

spiral fractal
#

the function is server side, I declare it in init server

#

I have file with all my functions that I call inside server init , using execVM

winter rose
#

there are 2 if (isServer) in the same file at some point

spiral fractal
#

what you mean?

winter rose
#

in mission.sqf, there are two isServer checks

#

-anyway-, there is something wrong, and it is not on Arma's side

spiral fractal
#

yes, but if I find out what it will probably solve all my problems

candid cape
#

I need help with this script
@candid cape
Anyone can answer me pls

steel fox
#

@candid cape didn't you already ask this?
Anyway, if i swap the sound classes you used with a base arma one, say, "mortar 1", The issue of the sound playing only once seems resolved.

candid cape
#

And what can I do?

steel fox
#

@candid cape Well, actually, where do you put this code you posted?

spiral fractal
#

in this file, the while loop really needed? why not put the code EH itself in onPlayerRespawn?

steel fox
#

@spiral fractal Because the Hit eventhandler needs to be added to all units not just players. A killfeed usally happens when you kill something, including AI.

spiral fractal
#

ah, I understand

candid cape
#

On the init.sqf @steel fox

steel fox
#

then it should just work

#

Something wrong with the CfgSound i think.

candid cape
#

It works, it works. What happens is that it only sounds once. The cfg sound is fine, I can assure you

spiral fractal
#

is it quake style sounds? HEADSHOT?

candid cape
#

The only idea that has occurred to me is to put a sleep 1; at the end of the code and copy and paste it 40 times

robust hollow
#

sounds good to me

candid cape
#

is it quake style sounds? HEADSHOT?
@spiral fractal yes

spiral fractal
#

oh boi

#

not in arma

candid cape
#

The only idea that has occurred to me is to put a sleep 1; at the end of the code and copy and paste it 40 times
@candid cape That's a good idea 😂😂?

spiral fractal
#

at least use for loop 😄

steel fox
#

@candid cape Your CfgSounds is probably scewed, the code works fine with base arma sounds bud.

candid cape
#

Did you try it?

spiral fractal
#

maybe the code itself not execute second time?

candid cape
#

Sure

steel fox
#

@spiral fractal The code is fine, his sounds seems to be the problem

candid cape
#

The thing is, vs AI it works perfectly, I put it on my server and it only sounds 1 time

winter rose
#

respawned player is a different unit

candid cape
#

And what can I do?

steel fox
#

@winter rose The code slap an Hit handler on anything that's alive, a respawned player should get on.

winter rose
#

ouch, the while true

#

this code should be run on every client, so from init.sqf or somewhere like this

#

in the meantime, g'night!

steel fox
#

Eventuelly, hm, @candid cape How are you testing this if it runs only once? are you shooting a player that just respawned?

candid cape
#

I open sv, I tell a friend to come in. I kill it and it sounds. I relive it with the admin console and kill it again. It doesn't sound again

#

But I kill him immediately

steel fox
#

The code does a UiSleep for 3 seconds

#

it has not yet given him the hit handler

candid cape
#

UiSleep what is

#

As normal sleep?

steel fox
#

I open sv, I tell a friend to come in. I kill it and it sounds. I relive it with the admin console and kill it again. It doesn't sound again
@candid cape Wait, relive?

robust hollow
#

uisleep is realtime, sleep is simulated seconds or something like that. it is effected by low fps.

candid cape
#

Yes, I revive him

steel fox
#

Try your test again, but instead of shooting him immediately after the revive, like some serial killer, give it 5 seconds, then cap him in the head. I think It will work then.

#

@candid cape

candid cape
#

Okay, I'll try it tomorrow. Thank you

spiral fractal
#

spawn bots with zeus it should also work I think

steel fox
#

@spiral fractal He said it worked fine with AI, but not players.

spiral fractal
#

maybe when unit gets killed it becomes something like simple object, like what happens with wrecks so the EH will not fire on that unit

steel fox
#

I just think that him killing his friend as soon as he was "revived" doesn't do anything, solely because the while loop has not yet given the player object it's hit eventhandler again. As that gets deleted upon a headshot.

candid cape
#

How long will I have to wait approximately?

steel fox
#

Try your test again, but instead of shooting him immediately after the revive, like some serial killer, give it 5 seconds, then cap him in the head. I think It will work then.
@candid cape read again. but slowely.

candid cape
#

Ok

spiral fractal
#

when unit gets killed, how can you revive it?

candid cape
#

With an admin panel

spiral fractal
#

you set damage to 0?

candid cape
#

That I have for my server

spiral fractal
#

you respawn him?

candid cape
#

My server's respawn system is similar to that of the Altis, when you kill it it takes the player to the Isle of the Dead. And when I relive it a default spawn appears

next phoenix
#

how would i open my player's inventory with code?

robust hollow
#

player action ["Gear", player]; maybe

steel fox
#

Yup, makes the player open their inventory, as if they pressed the "I" key.

next phoenix
#

thank you couldn't find it anywhere haha

candid cape
#

I have tested on LAN

#

The sounds

#

And I've found that if you kill the same player it doesn't sound, but if you kill others it does.

spiral fractal
#

you cant kill the same player, when he respawn it will be "new" one, or am I wrong?

steel fox
#

What is the time between killing the same player?

candid cape
#

What is the time between killing the same player?
@steel fox There is a lot of time

#

you cant kill the same player, when he respawn it will be "new" one, or am I wrong?
@spiral fractal as I'm on LAN, is the arma3 respawn system

spiral fractal
#

then maybe for some reason the flag not reset...

#

so it will not register that EH again

steel fox
#
[]spawn{
    while{true}do{        
        {        
        if(
            ((alive _x)) 
            &&(!(_x getVariable ["Var_GF_Killfeed",false]))    
        )then{            
            _x spawn GF_Killfeed_Headshot;            
            };                        
            _x setVariable ["Var_GF_Killfeed",true];
            {waitUntil {!alive _x};
            _x setVariable ["Var_GF_Killfeed",false];
            };
        }forEach allUnits;
        uisleep 3;
    };
};

It didn't occure to me before but:

{waitUntil {!alive _x};
_x setVariable ["Var_GF_Killfeed",false];
};

Shouldn't this code be spawned? AFAIK, this code isn't running.

spiral fractal
#

if there is no AI on his server why not just add this to onPlayerRespawn instead, and its also possible to add it to AI spawn script instead of this loop

candid cape
#

What I have to put on the onPlayerRespawn?

spiral fractal
#

the addEventHandler part

candid cape
#

So I have to put this:

{waitUntil {!alive _x};
_x setVariable ["Var_GF_Killfeed",false];
};

In onPlayerRespawn?

#

@steel fox what I have to do with this code?

steel fox
#

@candid cape idk, that is why I'm asking the rest of the fine lads in this discord.

spiral fractal
#

you can try this: add file called: onPlayerRespawn.sqf to mission root dir then inside it paste code from line 50 to 106 and replace the _this on line 50 to (_this select 0) (idk why and if its required)

#

if you have AI on server you will need to add this to AI spawn script

candid cape
#

I don't have IA

#

But I'm testing with him

spiral fractal
#

this will only work for players

candid cape
#

I can't test it now, do you think it will work?

spiral fractal
#

ah, also it will work only after your friend respawn at least once, if it will work you can also add it to player init or there might be another solution...

#

maybe if you set respawnOnStart = 1; in Description.ext it will work

#

but its better if you ask again later so maybe someone who know stuff can help and not some noob like me 😆

candid cape
#

Omg

spiral fractal
#

but that way you will get better performance I think... it will not run loop and check all units

spiral fractal
#

is it possible to create array with key value pairs that I can select by key? for example [["a", 1], ["b", 2], ...] then select "b" to get 2?

exotic flax
#

not with default SQF, since those are index based only

robust hollow
#

could make a function for it

exotic flax
#

although CBA has a feature called "hashes" where the keys and values are stored separately, and functions to add, remove, and search by key

robust hollow
#

possible vanilla implementation

params ["_key","_array"];
private _index = _array findIf {(_x#0) isEqualTo _key};
if (_index == -1) exitWith {};
_array#_index#1;
exotic flax
#

the system is relatively simple;

  • store the key in array 1

  • store the value in array 2

  • search by key -> get index in array 1, return value from array 2 with same index

  • search by value -> get index in array 2, return key from array 1 with same index

  • etc.

spiral fractal
#

Connor what the # means?

exotic flax
#

it's a replacement for select

spiral fractal
#

hmm I never saw it

robust hollow
#

only works for selecting indexes

#

i think it is faster that select

#

or has a higher priority or something

#

or maybe its nothing more than a shorthand

#

🤷‍♂️

lone dagger
#

hey hope someone can help me
using the arma3 Hold action
trying to check if player has item in his inventory
but i need condition of true
if !(player items "item_Keys") then true

robust hollow
#

Since 1.82 "#" symbol can be used to select from an array. It's shorter to write and has higher priority than math functions.

#

if !(player items "item_Keys") then true
👇
if !("item_Keys" in items player) then {true} else {false}
👇
!("item_Keys" in items player)

#

(case sensitive)

spiral fractal
#

why not make the select have higher priority... thonk

robust hollow
#

in general symbols have priority over commands i think

#

there is a wiki page on it

spiral fractal
#

idk I prefer to have one command that do one thing...

exotic flax
#

thinks of a programming language where there's not multiple ways to do the same thing

spiral fractal
#

C#?

robust hollow
spiral fractal
#

I saw that page but missed the # operator because its not exists in other languages...
also when someone works on extending existing code/mission for example, and it was made before the # existed, what will he do? use # and mix it with old files that use select or replace all selects with # thonk

robust hollow
#

whatever he likes i guess. I dont think replacing selects with # is worth the time as its main advantage is being shorter to write, so most useful when writing new scripts. it has the higher precedence but im not sure how big an impact that has on execution time (if any at all).

spiral fractal
#

why not just add the [n] option? like in all normal languages? _array[1] that will replace _array select 1 and _array # 1 🙃

robust hollow
#

because sqf is no normal language.

#

i guess the main reason is because everything is one of the three operator types. nular, unary and binary. it is easier to just add a new command than it is to add support for however _array[1] would need to be interpreted.

#

pretty sure they fix most of the usual sqf gripes in enscript anyway

spiral fractal
#

it says it is similar to C# so it should be good, but after A3 release I dont expect much...

#

hmm I cant search for nil should I use objNull instead? to store empty array items?

robust hollow
#

isNil {_x#1}

#

is that what you mean?

spiral fractal
#

oh, let me check

#

it will work but not in my case, I have array item that is [nil,nil] array itself and I want to know if there any nil

robust hollow
#

nil in array

spiral fractal
#

I think its impossible with nil

robust hollow
#

i usually go for storing the null type of the value that would be in that element, or using a different type all together. eg if i have an array of strings, i might store "empty" elements as 0

spiral fractal
#

yes, this is what I will do, I will store players there so its objNull I guess

lucid junco
#

how i can disable map pop up in the mission beginning?

lucid junco
#

thx man!

#

will try

spiral fractal
#

is it possible to find item in array in array? [1,2,3,[4,5],[6,7]] I want to find 5 for example

#

and lets say I dont know if there are array items in main array

#

I thought maybe there was built in way or something...

lucid junco
#

So briefing (map at the beginning) can be disabled in editor via one click. My fault. From my point its too easy. OFP where are you ? 😄

spiral fractal
#

oh BIS_fnc_findNestedElement seems to do what I need! Thank you!

still forum
#

why not make the select have higher priority... thonk
@spiral fractal backwards compatability
why not just add the [n] option?
Not possible with SQF syntax.

nil in array
@robust hollow
commands that get nil as argument get ignored and return nil..

tough abyss
#

Trying to execute a unit capture on a non-dedicated LAN server environment. cptrRun = [] spawn MyPath; in the on activation field of a trigger set to radio alpha. This of course works fine in single player. I'm just not sure what I need to do to fix the locality issue as I am not 100% certain that playing unit captures even works in multiplayer. There's also no documentation of unitCapture in multiplayer on the wiki.

tough abyss
#

Nvm I just did remoteExec call and that fixed it.

still forum
#

Does anyone per chance have Arma open on stratis and can send me the result of
count ([worldSize/2,worldSize/2] nearRoads 5000); ?
I expect 432

warm hedge
#

Give me a bit

#

2635, modded game but nothing does with Stratis I believe

still forum
#

😢

warm hedge
#

What does it even mean?

still forum
#

means I can reproduce a bug and need to somehow fix it now

warm hedge
#

Good luck, there's nothing I can do

winter rose
#

yep same - vanilla, devBranch

jade abyss
#

Also Vanilla - Normal Branch

astral dawn
#

No idea if it's related yo your quest, but sometimes roadsConnectedTo returns not roads. Can be checked with roadsConnectedTo on the initial object returned by roadsConnectedTo. I think in some case it returned some mounds, or fence, don't remember.

still forum
#

not related

#

get >2k roads on windows client, windows server, linux 32bit server, but only 432 on linux 64bit server

manic sigil
#

'Okay, if the player has Contact, they'll get the radio backpack instead... hrm, better check the DLC appID so I can call it properly.'

"1.02179e+006"

#

Huh. That's... specific.

warm hedge
#

That is a valid number