#arma3_scripting

1 messages ยท Page 250 of 1

fallen skiff
#

but every single 3rd party mission i've tried? surely they can't be all bad... including very highly rated ones

little eagle
#

If it's multiple missions from different people then it is indeed strange

fallen skiff
#

yes

#

consistent crash behavior on all of them

#

i've spent probably 15-20 hours on nothing but efforts to fix problem

little eagle
#

And the machine runs other games well?

fallen skiff
#

yes... the only other thing i play though is project reality

#

so i can't say much for other games

#

perhaps i should try one

little eagle
#

hmm. Arma is pretty... demanding

fallen skiff
#

true... i put it in lowest vid settings for diagnosing ... but my machine meets requirements fairly well

little eagle
#

the official requirements are pretty optimistic

#

to say the least

fallen skiff
#

i have ram left to spare while running game, cpu not totally plugged, etc

#

really

#

sigh perhaps time for new mobo/cpu

little eagle
#

My Arma never goes beyond 25% CPU usage. It's a quadcore. I guess Arma can only use one core or something

#

no expert on stuff like that

fallen skiff
#

it would be surprising if a modern game like a3 could only use one core, no?

little eagle
#

Well

tough abyss
fallen skiff
#

yes excuse me... thanks again for chat on this topic

grand cargo
#

ahahahah arma uses 1 core for most things I believe/

shut prairie
#

That's why running Headless Client is so good

#

Because it uses your other core(s)

#

Also I'm looking into Arma scripting

#

Any recommendations on guides?

#

Preferably newer ones that are designed for Arma 1.62

hallow spear
#

is it possible to set the status of a RscCheckbox? (ex: set column 1 row 5 value to not checked)

hearty shoal
#

What am i doing wrong here? ```params [
["_mapClicks", false, [true]]
];

if (_mapClicks == true) then
{
hint format["Mapclicks : %1",_mapClicks];
} else
{
hint format["Mapclicks : %1",_mapClicks];
};```

#

oh whats the command to make a codeblock?

zealous solstice
hearty shoal
#

thx ๐Ÿ˜ƒ

little eagle
#

== cannot compare booleans

#

if expects a boolean, so just use:

if (_mapClicks) then {
#

also, I'd rename the variable:
_isMapClick

hearty shoal
#

oh i see

zealous solstice
#

@little eagle maybe with a ed at the end?

little eagle
#

yeah, _isMapClicked
really depends on what this actually does

hearty shoal
#

Just a simple tp on mapClick function

little eagle
#

that would read good:

if (_isMapClicked) then {
#

point is, you cannot compare booleans with ==. And it wouldn't make much sense anyway

hearty shoal
#

Really appreciate the help guys! ๐Ÿ˜„

little eagle
#

np, yw
that is what this channel is for : )

hearty shoal
#

yeah i know ๐Ÿ˜ƒ but still it feels better to thank when one gets some help ๐Ÿ˜ƒ

tidal stump
#

Hello! Playing the Apex protocol campaign, I noticed that one could now incorporate the video on games. For example on a screen.
Anyone have information on this feature?

zealous solstice
#

you mean like this?

tidal stump
#

Yes exactly

zealous solstice
#

that is not "new"

#

that is old

#

click on the link in the video description

tidal stump
#

Ah? okay I'll watch this

#

Ah! and thank you ๐Ÿ˜ƒ

unreal skiff
#

anyone have experience with creating life servers

#

?

#

i have a couple problems when i created mine

dusk sage
#

Usually detailing the problem helps

#

๐Ÿ‘Œ

lethal cave
#

what is the fastest way to force a tank to fire at a certain object without distracting on other units around him

#

i guess fireAtTarget will do, but how do i find a muzzle i need

hearty shoal
#

Im just guessing now but wouldnt you find the correct muzzle in configviewer for that specific tank?

lethal cave
#

trying it out, not sure exactly where to look

#

weapons command returns tank weapons

#

what if i wanna use other kind of ammo for that weapon, how would i go about it?

little eagle
#

-snip-

#

no, wait

#
private _turrets = allTurrets _vehicle;
_turrets pushBack [-1];

_turrets apply {[_x, _vehicle weaponsTurret _x]}
#

changing the magazine will be tricky...

hearty shoal
#

Im getting confused by params. i need to check if _myVar is false or true. It cant be anything else than that.

'''params [["_myVar",false,[true,false]];

#

The part that confuses me are how i define the allowed values.

little eagle
#

the array on the third position only needs one example of the data type

#

no point in having true and false, as both are boolean

hearty shoal
#

oh okay

little eagle
#

you cannot define "allowed values"

#

only allowed data types

#

if you only want to allow certain values , you have to check:
if !(_value in ALLOWED_VALUES) then { /* fix it */};

#

keep in mind that in <ARRAY> is case sensitive

hearty shoal
#

so say i had another one like so: params [["_myVar","string",["allowed1","allowed2"]];

little eagle
#

that doesn't work. Both "allowed1" and "allowed2" are strings

#

"string" is your default value

#

in case it was undefined or the wrong data type

hearty shoal
#

So i have to check the value after and deal with that then, got it!

little eagle
#

yes

#

param(s) can only check the data type (and for arrays the array size)

hearty shoal
#

Thank you so much! ๐Ÿ˜„

lethal cave
#

thanks for info guys, i'll try it right now

dull parrot
#

Sup folks.

hearty shoal
#

Sup sup :>

shut prairie
#

Sup @little eagle you seem to know your stuff

#

Mind teaching me or pointing me into some good well, explained guides?

hearty shoal
#

Sup sup :>

little eagle
#

There are no guides that are up to date. And imho all guides so far are lackluster.

shut prairie
#

Rip ;/

#

So how should I learn?

little eagle
#

By making mistakes

dull parrot
#

^

shut prairie
#

But how do I TRY

#

And START to learn

little eagle
#

I didn't know what I was doing. After 6 months and many deleted lines I could write basically anything

#

Still learning about some weird details of SQF from time to time...

shut prairie
#

But I don't know anything of it

#

So how do you expect me to "start writing lines"

little eagle
#

Still using that today on the obscure ones

native hemlock
scarlet spoke
#

@Latouth if you speak German I'd know a really good tutorial series...

dusk sage
#

The wiki is the bible for SQF

halcyon crypt
#

your link seems to outdated quite a bit (this page last updated: 25 Dec 2015)

little eagle
#

Better formating, but less complete

halcyon crypt
#

meh formatting is a non-issue, I usually ctrl-f my way through it. ^^

little eagle
#

same

#

something for 3den I think

#

Never seen anyone successfully using it outside of 3den though.

lethal cave
#

that's what i used to change mag on tank and fire at target

#

mission_tank_01 loadMagazine [[0],mission_tank_01 weaponsTurret [0] select 0,"CUP_20Rnd_TE1_Red_Tracer_120mmHE_M256_Cannon_M"];
mission_tank_01 fireAtTarget [mission_car_01, "CUP_Vcannon_M256_M1Abrams"];

snow pecan
#

menuAdd is for control type ctrlMenuStrip. Might be possible to use with other related control types but haven't tried that.

shut prairie
#

@scarlet spoke only speak English, no German here ๐Ÿ˜‰

ebon rover
#

Looked in CBA documentation (but it's a bit messy). If anyone can confirm this, but does CBA not support Extended Evenhandlers for certain objects with parent class Static?

Example,

class Extended_Init_EventHandlers {

     class Static
     {
         init = "deleteVehicle (_this select 0)";
     };
}; ```

This script will delete some objects that inherit from class Static, but not all. It seems from my short testing that objects that inherit from Strategic don't get effected while objects that inherit from NonStrategic do.

Anyone can confirm?
grand cargo
#

commy2 should be able to fill you in

#

@little eagle

little eagle
#

Yes. Certain objects are disabled for performance reasons. Mainly map objects. So yes, certain Static

#

But maybe it can be improved? Please make a suggestion

#

you have to add the closing parenthesis to the link. discord sucks

ebon rover
#

Gotcha. Wait, so the event handler get called on map objects too, not just mission objects?

little eagle
#

It would, but it is disabled so it doesn't

#

This was made for performance reasons in A2. But honestly the code has so much improved since then... maybe we could enable it for every object

#

I just don't want to wreck performance. Deleting something that was made for performance reasons is a huge red flag

ebon rover
#

Yeah. I'll explain the situation... hold one

little eagle
#
class CBA_Extended_EventHandlers_base;

class CfgVehicles {
    class Static_Base;
    class Static_Class: Static_Base {
        class EventHandlers {
            class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
        };
    };
};
#

^ that config should readd it for the object

#

But at that point you might as well just add it to config. Also won't work for missions

ebon rover
#

Gotcha. Well thanks man. I'll test it out and let you know.

#

I'm only going to be using it for specific objects of child Stragetic

little eagle
#

Yeah, "Static_Class" and "Static_Base". Replace them with your classes

ebon rover
#

@little eagle
Thanks again for the help. I realized now that I could have just gone to the github source and look in XEH and see for myself what was disable and what wasn't. Hindsight right?

Just to peak my interest, is there any way to make XEH run on only mission objects? Something like initMisssion = ""
I don't know if its true, but don't mission objects have an ID while maps ones don't, so you would use BIS_fnc_netId to check for id.

Of course, I don't know if this would really help with the performance issues due to your still checking if every object has an id, and this would run eveytime a person joins the game.

little eagle
#

Just to peak my interest, is there any way to make XEH run on only mission objects? Something like initMisssion = ""

Yes, but:

Of course, I don't know if this would really help with the performance issues due to your still checking if every object has an id,

#

and this would run eveytime a person joins the game.
only locally though

#

Maybe that would work. Who knows

ebon rover
#

Hmm... if I get a chance I'll try it out. Future fork? Anyway thanks again.

tough abyss
#

@shut prairie I know this is probably late, but it couldn't hurt to read a few guides on Syntax and then just... Crack open a few scripts and look at them.

#

Unpack some missions with features you like, take a look at the scripts.

#

It's very similar to building in the sense that you have the resources, you just need to know how to put them together. You can google "Arma 3 Scripting Commands" and "Arma 3 Event Handlers" for a lot of what you'll need.

#

The first time I started scripting was when I wanted to shoot vans out of a machine gun. I asked around a little bit, and I got a script that already did that, but I didn't just throw it into an SQF and never touched it again, I looked at it and learned from it and picked apart what each string did.

#

I'd say the hardest part about Arma 3 scripting is debugging, but you can look up KillZoneKid's tutorial on Arma 3 debugging.

#

A lot of people have the idea that you have to 'progress' through increasingly difficult scripting tasks in order to learn, but that's really not the case. It might be hard what you want to do initially, but that makes the learning experience all the more rich.

#

(You still should be careful about biting off more than you can chew, though.)

#

</block of text>

tough abyss
#

well put

scarlet spoke
#

So in short: Copy, Paste & Understand ^^
But it's true

tough abyss
#

Yep! That's how I learned.

#

@shut prairie Also, never be afraid to play with the scripts. Just keep a copy of the original, and toy with it all you'd like.

dusk sage
#

One of the best ways to learn is to tackle something complex

#

You learn a lot on the way

little eagle
#

don't just blindly copy stuff though. think about what it actually does. that way you can improve and simplify it most of the time.

tough abyss
#

For now, I'd seek understanding before improvement.

#

Internet connection problems can make a var set on an object with _obj setVariable ["var",1,true]; not reach a client? Sorry, i know i ask much, but this will help me to debug a situation.

little eagle
#

I don't think so. Never had it happen at least

tough abyss
#

Thankyou. I will check the code one more time.

little eagle
#

There is one thing that can happen

#

If you execute setVariable public on two machines at about the same time

#

what end up happening is, that they will end up receiving the value of the other machine after they set their value

#

So machine A will end up with B's value and machine B with A's value

tough abyss
#

I see. Not consireded it when making the code. Will see if thats the problem.

little eagle
#

A way around this is to only use setVariable public on the server

#

or the machine where the object is local (locality shouldn't change that often)

tough abyss
#

This can explain some inconsistence i'm having. Will be better to re-do the code with this in mind and avoid this situation. I found i did _p = player; and then set a public variable on _p after the player died and respawned. _p was not refering to the player anymore but probablly to the dead body.

little eagle
#

yes, that is how it works

#

If you setVar on the dead body before the unit respawns, the variable will carry over to the new unit

#

But that stops as soon as the unit respawned, then the body is seperate

tough abyss
#

Nice!!!

#

I got it. Thanks a lot.

#

Its for a script to detect combat mode. Its fixed now!

little eagle
#

nice

tough abyss
#

It was turning combat mode off on the dead body. Now i turn it off imediatlly if the player die.

shut prairie
#

@tough abyss @dusk sage @little eagle Tons of info, jam packed. Thanks so much. Thing is though, I can understand what stuff does by the name, for the most part.
For example,
[] exec "scripts/fn_statusbar.sqf"

Executed the scripts/fn_statusbar file initiating it. Totally not taking from wackbatt (think it is) on Arma life rpg forums, which he had a public statusbar script.
I'm been looking at people's scripts lately (cough, @dusk sage's mainly Altis life cough) and can understand what most/some of it "is"

tough abyss
#

Right, well, that kind of stuff is easy.

shut prairie
#

Trye

#

True*

#

But thing is...

tough abyss
#
if (hasInterface) then {
    if (player == getAssignedCuratorUnit (allCurators select 0)) exitWith {};
    playMusic "IntroMusic";
    cutText ["", "BLACK IN", 0];
    loopdone = false;
    introended = false;
     _txt_1 = ["Vauun Presents...",5,"center","3","#FFFFFF"] execVM "AL_movie\txt_display.sqf";
    //----------------------------
    _secondshot = [cam1, cam2, camtar1, 10, 1, 1, false, 0, 0, 0,"nightvision","black",1,"NoSound"] execVM "AL_movie\camera_work.sqf";
    waitUntil {scriptdone _secondshot};
 
 
    _txt_2 = ["...A Mission for TMTM",5,"center","3","#FFFFFF"] execVM "AL_movie\txt_display.sqf";
    //-----------------
    _firstshot = [cam11, cam11, camtar5, 10, 1, 1, false, 0, 0, 0,"nightvision","black",1,"NoSound"] execVM "AL_movie\camera_work.sqf";
    waitUntil {scriptdone _firstshot};
 
 
     _txt_3 = ["'Au Revoir'",5,"center","3","#FFFFFF"] execVM "AL_movie\txt_display.sqf";
    //------------------
    _thirdshot = [cam3, cam4, target7, 10, 1, 1, false, 0, 0, 0,"nightvision","black",1,"NoSound"] execVM "AL_movie\camera_work.sqf";
    waitUntil {scriptdone _thirdshot};
    loopdone = true;
    introended = true;
    [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil] execVM "AL_movie\camera_work.sqf";
};```
#

it's shit like that

#

this

#

this was a pain in the ass to troubleshoot

#

but it's deceptively simple

shut prairie
#

I'm not "home"

#

I'm on a trip, so all I can do is read

#

When I get home I'll start trying commands out with like debug console

zenith totem
#

Anyone got any idea if "getUnitLoadout" and "setUnitLoadout" are going to change or not, they've been marked as not final since 1.58

meager granite
#

There is an issue with loadout commands that they always assume that there is two muzzles in each weapon unlike say weaponsItems which changes number of magazine arrays depending on number of muzzles, I'd submit that as an issue to be fixed in loadout commands.

distant egret
#

Anyway to check if a class name is valid?

meager granite
#

isClass(configFile >> "CfgVehicles" >> "something")

distant egret
#

Thx works like a charm

zenith totem
#

I can't think of any weapons with more than 2 muzzles off the top of my head though besides vehicles

ebon rover
#

@little eagle

Just tested

class CBA_Extended_EventHandlers_base;

class CfgVehicles {
    class Static;
    class Building : Static {
        class EventHandlers {
            class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
        };
    };
};

Registered all objects it effected using

class Extended_Init_EventHandlers {
class Building
    {
        init = "INSERT CODE HERE";
    };
};

It only registered on mission objects and not map (terrain) objects. I didn't see any real performance loss. I mean obviously your going to get different results with different events, and more objects. I didn't do extremely thorough testing (like testing with different events, or on dedicated, etc.) so I could be wrong.

little eagle
#

It only registered on mission objects and not map (terrain) objects.
Interesting

#

Maybe this is caused by this using the sub classes event handlers? Who knows

ebon rover
#

Maybe a change with the engine? I know there has been a lot of changes since 2014 when you guys blacklisted certain classes

little eagle
#

sub class event handlers didn't even exist when XEH was made

ebon rover
#

Haven't been around that long lol

#

Spoiled ๐Ÿ˜ƒ

little eagle
#

me neither, but I was brave enough to redo it for post Heli-dlc A3

jade abyss
#

I am wondering, is there a counterpart to "owner"?

daring geyser
#

Hey guys! showHUD command is broken again?

jade abyss
#

erm, not when i tested last time

little eagle
#

I am wondering, is there a counterpart to "owner"?
As in a command that reports all local objects?
entities "" select {local _x} I guess.

ivory nova
#

Was practicing AI control in dual pilot helis last night and found it frustrating that I couldn't get the gunner to target structures/buildings, etc. (There were spotters hiding in a building and the gunner wouldn't fire upon them/the building.) How feasible would "target this structure/building" functionality be to script? E.g. ~ Command Menu > Select gunner > move your "Command Crosshair (?)" (middle of HUD) over structure/building > "Target that [house/church/bunker]!" > "Open fire!"

#

(In the same way that I can direct AI to move to a structure, or specific location, but instead ask them to shoot at it instead.)

jade abyss
#

@little eagle
More like:
OwnerID setVariable ["blablub",Banana]; (exec on Server)

I am just curious.

*Stupid EnterButton...
Just like in [] remoteExec["fncName",OwnerID];

little eagle
#

OwnerID setVariable ["blablub",Banana];
uhm

blablub = Banana;
OwnerID publicVariableClient "blablub";

I don't understand what else you mean.

jade abyss
#

Simply selecting the Object, related to that ID, without searching through the whole list.
nvm it.

+Hu? Since when has handleDamage 6 entrys? What did i miss? Output looks like the "gunner-Pos" who fired the shot (if Commander in Vehicle).

steep matrix
#

is there a simple way/function from BI to create a vehicle with full crew and all cargo (transportSoldiers)?

jade abyss
#

@steep matrix

_Veh = cursorTarget;
_FillIt =
{
    _Unit = "B_RangeMaster_F" createVehicle [0,0,0];
    _Unit moveInAny _Veh;
};
{
    for "_i" from 1 to (_Veh emptyPositions _x) do { call _FillIt; };
}forEach ["Commander","Driver","Gunner","Cargo"];
{
    call _FillIt;
}forEach (allTurrets _Veh);```
for example.
steep matrix
#

@jade abyss thanks testing

#

tried to use BIS_fnc_spawnVehicle but its way too messed up and limited..

#
        _transportSoldier = getNumber (configFile/"CfgVehicles"/_x/"transportSoldier");
        _crewType = getText (configFile/"CfgVehicles"/_x/"crew");

        if (_transportSoldier > 0) then
        {
            for "_i" from 0 to _transportSoldier do
            {
                _unit = _tempGroup createUnit [_crew,[-10,-10,0],[],0,"CAN_COLLIDE"];
//                _tempGroup addVehicle _newVehicle;
                _unit moveInCargo _newVehicle;
            };
        };```
#

this is what i wanted to use, but BIS_fnc_spawnVehicle makes planes flying and the game crashes soon after

jade abyss
#

oO ouch

steep matrix
#

ok yours works nicely. thanks again ๐Ÿ˜ƒ

#

ps: 15 years and still no sqf cmd to do such simple thing..

jade abyss
#

๐Ÿ˜„

#

15 years, started with .sqs, forgot everything, re-started with A3 ๐Ÿ˜›

little eagle
#

Simply selecting the Object, related to that ID, without searching through the whole list.
There is no the object A machine can have many objects...

blazing zodiac
little eagle
#

No

Tankbuster
This command creates drivers/copilots, commanders and gunners where appropriate, but it never creates cargo crew. So a gunship Huron will get a pilot >and copilot plus 2 door gunners, but nobody in the back

quiet bluff
#

how can i find position of object A relative to Object B?

#

Thanks!

quiet bluff
#

@tough abyss dont work

little eagle
#

He said "we need"

#

tbh, just write a function for it.

#

imo we don't need commands for every shit that can be achived by other means

#

and is not performance critical

candid abyss
full kindle
#

well isnt that just basic transparency?

tough abyss
#

It is. Just get a slightly transparent green texture (About 15 seconds in GIMP), and apply it to the object, then spawn the object on the ghost's position while taking its dir and posATL.

candid abyss
#

using setObjectTexture(Global)? I tried _obj setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"]; to avoid creating a texturefile, which didn't work last time I tried. it didn't change the texture at all.

candid abyss
#

just tried it again. it doesn't work on models that don't have a hidden selection.

steep matrix
#

anyone tried these yet?

b:OBJECT addmissile ARRAY
b:OBJECT forcefollowroad BOOL
b:OBJECT setpilotcameradirection ARRAY
b:OBJECT setpilotcamerarotation ARRAY
b:OBJECT setpilotcameratarget ARRAY,OBJECT
u:getpilotcameradirection OBJECT
u:getpilotcameraposition OBJECT
u:getpilotcamerarotation OBJECT
u:getpilotcameratarget OBJECT
u:haspilotcamera OBJECT```
torpid pond
hearty shoal
daring geyser
#

I have a problem with showHUD command. Can someone who used it before check it one more time? Maybe i'm doing something wrong. My description.ext file is empty so this scripting command shouldn't be disabled.
https://community.bistudio.com/wiki/showHUD

zenith totem
#

@daring geyser It would help if you posted the code you're using and what you want it to do

daring geyser
#

@zenith totem Sure. That's from examples from command syntax page:
showHUD [true,true,false,false,true,true,true,true,true];

#

Even more
showHUD [false,false,false,false,false,false,false,false,false];

And nothing is hidden ๐Ÿ˜ฆ

zenith totem
#

It would help if you posted the code you're using **and what you want it to do**

tough abyss
#

@daring geyser Where are you putting this script?

#

If you're putting it in the init field of a unit, you should be using this showHud[parameters];

hearty shoal
#

How should i change my code to make 0 cars spawn if the number is 0? im lost ๐Ÿ˜› ```fnc_test = {

params
[
["_amount",0,[0]]
];

_position = [[7525.87,5000.6,0.00143909],[7493.17,5000.71,0.00143909],[7470.39,4978.42,0.00143909]];

if (_amount < 0) then {
hint "0";
} else {for "_i" from 0 to (_amount) do {
_veh = createVehicle ["O_MRAP_02_hmg_F", selectRandom _position, [], 0, "NONE"];
createVehicleCrew _veh;
};};

};

[1] call fnc_test;```

tough abyss
#

showHud [parameters]; is just the script, you're not defining what it's pointing at

daring geyser
#

@tough abyss Have you tried to use it?

tough abyss
#

I'm at work right now, but if that's the entire script then that's your issue.

daring geyser
#

showHUD [false,false,false,false,false,false,false,false,false];
Does nothing with HUD

#

All I ask is to confirm that this command is broken or not

tough abyss
#

...Right, because you're not defining what the script is being executed for. It's executing to nothing, which is why you don't have any errors.

#

this showHud [false,false,false,false,false,false,false,false,false];

daring geyser
tough abyss
#

Do you understand that defining what the script is being executed for is seperate from the syntax?

#

It's not shown there because that would be redundant.

daring geyser
#

Really? Are you 100% sure? ๐Ÿ˜ƒ

tough abyss
#

I'm pretty sure. Humor me and try it.

daring geyser
#

Will do now

#

@tough abyss Syntax error as expected for the following line:
player showHud [false,false,false,false,false,false,false,false,false];

tough abyss
#

Did you put in 'player'?

daring geyser
#

Okay. Need someone who used this command before to confirm that showHud is broken

tough abyss
#

Rather than being snarky to the people who are trying to help you, it may be best to appreciate them.

daring geyser
little eagle
#

@hearty shoal
for "_i" from 1 to (_amount) do {

hearty shoal
#

DOH ๐Ÿ˜

little eagle
#

so _amount = 3 results in:
1,2,3

hearty shoal
#

Thank you as always ๐Ÿ˜ƒ

native hemlock
#

@tough abyss showHud only has one argument, and it comes after the command

formal vigil
#

What's the proper namespace for global variables on a dedicated server? I'm using missionNamespace and it's working fine local, but once I put my mission on server it seems not working

jade abyss
#

@formal vigil
missionnamespace setVariable ["NameOfVar",StuffInsideVar,TRUE];

formal vigil
#

@jade abyss you've just probably saved my ass ๐Ÿ˜„

formal vigil
#

Thanks, man. I'l ltry it in a few

hearty shoal
#

Do i have to enable the new revive system in eden or can i enable that in description.ext somehow?

worthy spade
hearty shoal
#

Yeah but that one is out dated and the new link only explain how to add the revive with eden

worthy spade
#

Oh, you're right. How odd of them to remove the template. Gonna have to update all my scenarios.

formal vigil
#

@jade abyss unfortunately it didn't work

#

but I think the problem is in SHK_Taskmaster because tasks are not updating, the other part of the script seems to be working

#

[p1, supRequester, supProviderArtilery] call BIS_fnc_addSupportLink; ["Task1","succeeded"] call SHK_Taskmaster_upd;

#

first line runs, I'm getting the artilery support, but then the second line isn't working as I don't get the update for current task ("Task1")

jade abyss
#

Works for me. Sounds more like it just don't get to that point, where it has to set the Var

steep matrix
#

missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player];
does this ugly workaround now always be used if one wants to RC with ZEUS? ๐Ÿ˜ฎ

little eagle
#

yes

#

it's been like that since 2014

velvet merlin
#

can one overwrite the player variable still or is it protected by now?
player = remoteControlUnit;

selectPlayer was already quite messy but this is a classic design failure again by BI..

little eagle
#

no you cannot do that

#

If you're using CBA there is
["unit", {RealPlayer = _this select 0}] call CBA_fnc_addPlayerEventHandler;

Yes it is based on polling, but at least not every mod needs it's own loop.

cedar nebula
#

hey guys, I have no idea about scripting but I need a script that I think is kinda easy to write for a scripter. I need a script that animates the hatch in my vehicle when a certain place is in use and closes it again if the seat is enpty...can somebody do that for me or help me write this script?

thin pine
#

@daring geyser I'm late. I used this command for a scene earlier. The reason why it doesn't work is because you have one parameter too much. The last parameter, the squadRadar hasn't been implemented in 1.62 APEX yet so you simply need to remove that

#

showHud with 8 parameters works just fine. You need to wait for the next ArmA update for the SquadRadar afaik

#

(Would've been nice if anyone that manages the wiki could've made that clear, I was confused originally too)

quasi thicket
#

Is it possible to change the color of a flashlight?

#
            {
                color[] = {1800,1500,1200};
#

?

hearty shoal
#

How do i check that veh is somewhat near my _pos? ```
_pos = [7805.79,3102.9,0.00143909];
_position = [[7805.79,3102.9,0.00143909],[7765.99,3102.69,0.00143909],[7723.36,3073.03,0.00143909],[7705.15,3132.25,0.00143909],[7738.89,3192.33,0.00143909]];
_veh = createVehicle ["C_Hatchback_01_F", selectRandom _position, [], 0, "NONE"];
createVehicleCrew _veh;

_veh doMove _pos;

waitUntil {veh distance _pos < 5};

_veh setDamage 1;

RPT: 18:37:46 Suspending not allowed in this context
18:37:46 Error in expression <;

waitUntil {_veh distance _pos < 2}; 

veh setDamage 1;>

18:37:46 Error position: << 2};

veh setDamage 1;>

18:37:46 Error Generic error in expression```

nocturne bluff
#

You are trying to suspend a script thread in a non suspendable evniroment

indigo snow
#

(_veh distance _pos) < 2

#

any of those might be nil too

hearty shoal
#

So how should i approach the problem ? I need to check somehow if _veh is near _pos.

austere granite
#

@hearty shoal use spawn instead of call

#

You can't use commands like waitUntil when you call a function

dusk sage
#

When the parent scope is unscheduled, for clarity

tough moth
#

Hello everyone. I am trying to make a scenario that ends with "mission failed" when respawn tickets exceed a certain number (40). I have tried using the in-game module for respawn tickets under Scenario Flow>Respawn Tickets, which works in part, but with this module it says "your team has won" when the tickets are exceeded which is not what we want.... any ideas? Any help would be greatly appreciated! Been scratching my head on this one for two days now!

hearty shoal
#

cant you just you tickets and endgame respawns? like so in description.ext: respawnTemplates[] = {"Tickets","Endgame"};

austere granite
#

UI question, if you got a clue please use @austere granite

How does one animate a UI element to open up from bottom to top? Top to bottom opening is very easy by having H of controlsGroup at 0 and then uusing ctrlSetPosition to animate open it, but... how do I make it open from bottom to top that it looks the same?

meager granite
#

You'll have to move elements inside groups against group movements

#

Might as well have group inside group and then all your elements inside it

austere granite
#

That's really the only way is it?

#

Yeah i was thinking about that, basically have another subcontrols group and then move that position downards while the other one goes up with the same commit time, but seems silly

meager granite
#

Nothing silly about, that's how UI works if you're trying to achieve exactly this effect

#

You can only have single group extend upwards but your controls will appear to be sliding up

#

If you want them to appear without movement then you'll need to have group inside group and move each other in opposite directions

austere granite
#

Then the subgroup ctrlSetpos downwards

#

yeah okay got it, guess that'll be the only way unfortunately. Was hoping for some ultrasecret hightech alternative setPos that would extend from bottom to top automagically

meager granite
#

UI coordinates start at top left so everything inside groups will be aligned to top left, its just how UI works

#

Just thought it would be useful to have padding in controls groups so you can adjust entire contents just by changing the padding

#

But for now you'll have to create second group inside to have this kind of padding

austere granite
#

Okay thanks for the help anyway, should be easy really, just didn't think about it right away

tough moth
#

Hello guys, I am having quite a bit of trouble with something that "should" be simple... What I am trying to do it make a mission end when BLUFOR run out of respawn tickets. I have it adding tickets correctly, subtracting them as players on the blufor side respawn, but it doesn't end the mission.... Here is what I have so far:

// Respawn templates from CfgRespawnTemplates. You can combine any number of them together.
respawnTemplates[] = {"Counter","Base","EndMission"};

// Side specific respawn templates. When undefined, general respawnTemplates are used instead.
respawnTemplatesWest[] = {"Counter","Tickets"};

Any suggestions would be greatly appreciated. Literally throwing a lifeline out here guys.

BIS documentation: https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Templates

open vigil
tough moth
#

@open vigil Havnt honestly referred to F3 for years... but just looking through, it seems they lack respawn ticket tamplate

open vigil
#

I thought it did, my bad.

tough moth
#

Oh no worries. Any help at this point is appreciated.

#

This is what I have set up in description.ext:

#

// ====================================================================================
//Respawn Template

// Respawn type, see the table below
respawn = 3;

// Delay in seconds before playable unit respawns.
respawnDelay = 10;

// 0 to disable the score table (it can still be opened manually by pressing 'P' key).
respawnDialog = 0;

// Respawn templates from CfgRespawnTemplates. You can combine any number of them together.
respawnTemplates[] = {"Counter","Base","EndMission"};

// Side specific respawn templates. When undefined, general respawnTemplates are used instead.
respawnTemplatesWest[] = {"Counter","Tickets"};

// 1 to respawn player when he joins the game. Available only for INSTANT and BASE respawn types.
respawnOnStart = 1;

// When 1, the score table contains score of all playable units as opposed to players only.
aikills = 0;

// ====================================================================================

#

and add tickets (2 for testing) in init.sqf

//Add Respawn Tickets

[west, 2] call BIS_fnc_respawnTickets;

open vigil
#

Hmm, I don't typically deal with respawn tickets, so I'm not sure. Pennyworth really knows his stuff and would probably be one of your best bets.

tough moth
#

Yea, I just dont get why it wont call EndMission

#

that post I left above, I have tried switching things around with both the global and side specific templates, but it just doesnt work.

#

respawn counter just goes to --:--:-- and no end mission is called.

#

so, its obviously detecting the tickets properly, and I can see it drop from 2 to 0...

open vigil
#

It sounds as if the tickets aren't linked to EndMission

blazing zodiac
#

They are, I've used that way to end a mission in 1.60

tough moth
#

o.o

#

teach me your ways

blazing zodiac
#

Is the side you are ending blufor?

tough moth
#

correct.

blazing zodiac
#

Or trying to end

tough moth
#

I want mission end when blufor exceeds respawn tickets,

blazing zodiac
#

Maybe try throwing endMission into respawnTemplatesWest?

#

I only tried it quickly and don't remember what I did in 1.60

tough moth
#

like how?

blazing zodiac
#

I ended up writing my own respawn menu and system

#

respawnTemplatesWest[] = {"Counter","Tickets"};

#

Try adding the EndMission tag in there maybe?

#

Or they could've broken it with 1.62

#

My testing was in 1.60

tough moth
#

I have tried that unfortunately.

blazing zodiac
#

Hmm, odd.

#

I know it definitely worked when I tried it. I believe I only had that though and respawnTemplatesWest

#

Mine is a PVE mod though

#

So no need for anything else

#

Definitely could've been something that was broken in the update however. Hopefully someone else can be more helpful

tough moth
#

hmm, I will test with just templateswest real quick and at least rule that out

#

respawnTemplatesWest[] = {"Counter","Tickets","EndMission"};

blazing zodiac
#

Any luck?

tough moth
#

crosses fingers

blazing zodiac
#

Lol

tough moth
#

counter just goes to --:--:--

#

no EndMission.

#

sigh

blazing zodiac
#

Hmm, odd. Could be something bugged. I can try it out when I get home myself and see if something's weird.

tough moth
#

here is other funny thing. There is literally a new module for this in Eden under Modules>Scenario Flow>Respawn Tickets..... however, when a side exceeds their tickets it says "Your side has won" which makes no sense at all. At least it ends the mission though....

blazing zodiac
#

Maybe try not adding the respawnTemplatesWest tag and doing just the default respawnTemplates?

#

Rule that out as well

tough moth
#

trying that now.

blazing zodiac
#

You could hack it together with a trigger and an end mission module possibly?

#

Have the trigger check for respawn tickets and when it's 0 end the mission

#

That's a really ugly way to do it

#

But should work

tough moth
#

yea, would have to have it check and trigger end or lose... dunno how to write that check though

#

trigger condition

blazing zodiac
#

No luck with the respawnTemplates only?

tough moth
#

checking now.

#

respawnTemplates[] = {"Counter","Tickets","EndMission"};

#

lol does exact same thing.

#

--:--:---

#

it is still subtracting tickets properly though, just no EndMission

blazing zodiac
#

Ok well it definitely sounds like something is broken

#

As far as the trigger

#

Or wait

#

A better way would probably be in the onPlayerRespawn.sqf

#

Depending on when it fires

#

When the tickets get to zero what happens?

tough moth
#

counter stops

#

--:--:---

blazing zodiac
#

Do you respawn though?

#

No right?

tough moth
#

nope

blazing zodiac
#

Ok well with the trigger

#

You can use something like

#

You can check the tickets with [] call BIS_fnc_respawnTickets;

#

And make the trigger fire when it equals 0

tough moth
#

ok so noob question, how would I put that into a trigger condition...

#

what would it look like

blazing zodiac
#

Sync the trigger to an end mission module and when it fires it will end the mission

tough moth
#

yea but what to put with [] call BIS_fnc_respawnTickets;

blazing zodiac
#

hmm, I'm actually not home to test it at the moment

#

One sec

tough moth
#

@blazing zodiac Greatly appreciate your help btw... this has been killing me for two days lol

blazing zodiac
#

You can actually just start a loop in sqf

#

So somewhere in your init or wherever else

#
  _remTickets = []call BIS_fnc_respawnTickets;
  if (_remTickets == 1) exitWith {
    "end1" call BIS_fnc_endMission;
  };
    sleep 1;
};```
#

A few different ending options there

#

waiit

#

don't use that one

tough moth
#

xD

blazing zodiac
#

Make sure that sleep is in there

#

Or that check will run every frame

tough moth
#

this loop will not affect performance?

blazing zodiac
#

It should be very minimal

#

A better way would be in an event handler

#

But that may not fire when you have no tickets left

#

I'm not sure

#

And can't test as I'm not on my Arma machine

tough moth
#

okay, let me try this scripted solution in init real quick

blazing zodiac
#

Also a repeating trigger is basically a while loop that fires every 0.5 seconds

tough moth
#

well

#

its spam looping the EndMission evert 0.5 seconds breaking everything lol

blazing zodiac
#

so respawn tickets isn't registering?

#

try checking the respawn tickets

tough moth
#

immediately upon preview it starts looping ending

#

and i still have the two tickets

blazing zodiac
#

hint str ([]call BIS_fnc_respawnTickets)

#

without the loop running

tough moth
#

had to alt F4

#

will check that now

blazing zodiac
#

Where are you adding the number of respawnTickets?

tough moth
#

init

blazing zodiac
#

Before that loop right

#

?

tough moth
#

[west, 2] call BIS_fnc_respawnTickets;

#

yes

blazing zodiac
#

Ok just making sure

tough moth
#

added 2 for testing

thin pine
#

West, 0 as params to the remTickets fnc may work

#

Unless an empty array defaults to missionnamespace, 0

blazing zodiac
#

[] call BIS_fnc_respawnTickets should return the number of remaining tickets

#

But who knows

#

Gotta have him check with it after they are added

tough moth
#

literally says -1

blazing zodiac
#

the hint is -1?

tough moth
#

yea.

#

wtf

blazing zodiac
#

Well that's weird

tough moth
#

yes.

blazing zodiac
#

You are adding that after you add the respawn tickets right

tough moth
#

[west, 2] call BIS_fnc_respawnTickets; in init

launch mission

Run hint str ([]call BIS_fnc_respawnTickets) in game debug

#

returns -1

thin pine
#

Oh

#

Your loop is problematic

blazing zodiac
#

Yea it should check for _remTickets to be == 0

#

But it doesn't matter if that function isn't working

#

and it needs to breakout

#

once firing endMission

thin pine
#

You need to exitWith that loop otherwise it'll keep looping

blazing zodiac
#

Yea

#

I'm doing this on my work laptop so it's not great.

tough moth
#

yea, no worries

blazing zodiac
#

Unfortunately if that function isn't returning the number of tickets it doesn't matter anyways

tough moth
#

yea wtf -1

#

when I abort, I can see i still have the 2

blazing zodiac
#

[missionNamespace] call BIS_fnc_respawnTickets;

#

try that

#

inside of the hint str

tough moth
#

running this on debug console, nothing

blazing zodiac
#

hmm

tough moth
#

oh wait

#

sorrt

blazing zodiac
#

not even -1

tough moth
#

sorry**

#

-1

#

yea its still -1

blazing zodiac
#

well

#

That's unfortunate

tough moth
#

thats a feature.

blazing zodiac
#

Lol

#

It used to work

tough moth
#

working as intended.

#

-1

blazing zodiac
#

Maybe try a fresh mission with only that in it to rule out anything else?

#

Oh wait are you checking in multiplayer?

tough moth
#

its funny that when the eden module for this reaches 0 tickets it ends the mission with "your side has won"

blazing zodiac
#

In single player it may return -1 since there are no respawns

tough moth
#

no im testing in MP

blazing zodiac
#

Ok I figured

#

Just a thought I had

tough moth
#

yea, the respawns work, it subtracts the tickets

#

and when they reach 0... timer stops and all respawns disabled

#

--:--:---

#

but no end

blazing zodiac
#

You could look in the BIS_fnc_respawnTickets function and see what would cause it return -1

#

And see if anything jumps out at you as fucked up

tough moth
#

I wouldnt know where to begin

blazing zodiac
#

In the functions viewer next to the debug console

tough moth
#

ah ok

blazing zodiac
#

You can see all the functions

tough moth
#

lemme take a look

blazing zodiac
#

just look for respawnTickets

tough moth
#

Returns:
NUMBER - remaining tickets after adjustment (-1 when no tickets were defined yet)

blazing zodiac
#

hmm

#

You are adding the tickets in init yes?

#

Try adding them in the debug console

#

Before running that hint

tough moth
#

ok trying now

#

sorry, just run

[west, 2] call BIS_fnc_respawnTickets;

as global exec on debug?

blazing zodiac
#

yes

#

then run the hint str ([] call BIS_fnc_respawnTickets)

#

after taht

tough moth
#

still -1

blazing zodiac
#

welp

#

I got nothing then man

#

Sounds like something is broken

tough moth
#

yea, it seems to be adding the tickets but also not lol

blazing zodiac
#

Possibly why your menu template is breaking as well?

#

Next step for me would be to set it up on a fresh mission with no mods

#

To rule out any variables

tough moth
#

-1 is feature

blazing zodiac
#

If it still is broken on a fresh mission with no mods it's definitely time to report it to the feedback tracker

tough moth
#

yea, i mean its for sure broken

#

return value is -1, but if i hit abort on mission I can see I have two left

#

where else would it get two from

blazing zodiac
#

True

tough moth
#

heading to FT now to report this.

#

lame.

blazing zodiac
#

Sounds like the best next move

#

Sorry I couldn't be more help

#

Gotta get back to work though

#

Good luck man!

tough moth
#

hey no worries, I appreciate everything man

#

thanks so much!

#

๐Ÿ‘

thin pine
#

@tough moth You only have one side that has respawn tickets, right?

tough moth
#

yes

thin pine
#

if you're still in game you should try to put this in the debug console's watch tab: BIS_fnc_respawnTickets_valuetotal

#

I opened up the function and did a check, if everything works proper then that var should return 2 (total amount of tickets)

tough moth
#

checking now

#

yes it says 2

#

which is correct

thin pine
#

there ya go

tough moth
#

[missionNamespace] call BIS_fnc_respawnTickets; returns -1 tho

thin pine
#

well

#

don't use [missionNamespace]

tough moth
#

ok, so how do I make EndMission when tickets get to 0

thin pine
#

let me modify hound's loop a bit

tough moth
#

roger

#

while {true} do {
_remTickets = []call BIS_fnc_respawnTickets;
if (_remTickets == 1) exitWith {
"end1" call BIS_fnc_endMission;
};
sleep 1;
};

blazing zodiac
#

change that 1 to a 0

#

Vegas

#

well sanchez

tough moth
#

xD

#

while {true} do {
_remTickets = []call BIS_fnc_respawnTickets;
if (_remTickets == 0) exitWith {
"end1" call BIS_fnc_endMission;
};
sleep 1;
};

blazing zodiac
#

also if you surround code with 3 ` it comes out in the code blocks

#

code here

#

3 of those before it and 3 after

tough moth
#

@blazing zodiac BIS_fnc_respawnTickets_valuetotal returns correct 2 tickets

blazing zodiac
#

great

thin pine
#
{
    while {BIS_fnc_respawnTickets_valuetotal != 0} do 
    {
        sleep 1;    
    };    
    "end1" call BIS_fnc_endMission;
}; ```
#

there's various ways you can do this tbh

#

you could even set up a trigger

#

that'll run non scheduled

blazing zodiac
#

Yea there is

thin pine
#

in fact perhaps you should

tough moth
#

trigger is better than loop

thin pine
#

trigger condition is checked non scheduled every 0.5 secs

#

so

#

in condition place: BIS_fnc_respawnTickets_valuetotal != 0

blazing zodiac
#

It running nonscheduled is definitely better

thin pine
#

in activation put the endmission thingy

tough moth
#

trying now

thin pine
#

make sure you don't set it repeated ๐Ÿ˜› you wouldn't want that

west lantern
#

do you have respawn defined because if you dont it wont work

#

I just tried and it works

tough moth
#

I literally just put BIS_fnc_respawnTickets_valuetotal != 0 in trigger condition

thin pine
#

oh wait

west lantern
#

hint str ([] call BIS_fnc_respawnTickets) this will return -1 always not sure whats with that

blazing zodiac
#

you want it to equal 0

thin pine
#

yer

#

my bad ๐Ÿ˜›

blazing zodiac
#

Hey it's late night over here in EST

thin pine
#

it's like 1pm here but I woke up half a hour ago (shame)

blazing zodiac
#

I've made more mistakes then I'd care to admit already in this series of "help"

tough moth
#

should I still have

respawnTemplates[] = {"Counter","Tickets","EndMission"};

in description?

blazing zodiac
#

Yea I think you need that for the menu to come up at all right?

#

I'm not 100% on that

tough moth
#

counter, yee

blazing zodiac
#

I only used the menu once

tough moth
#

ok, lemme try this trigger condition.

west lantern
#

tried with module and it works

thin pine
#

@tough moth are you testing in SP editor or MP?

tough moth
#

MP

thin pine
#

oh ok

#

just making sure here xD

blazing zodiac
#

Lol I said the same thing Sanchez at one point

thin pine
#

oh did yer? I was on my phone until 10 mins ago so I guess i missed it

#

๐Ÿ˜ƒ

blazing zodiac
#

Alright I really gotta run now though, gotta finish up some work and go home to sleep. Good luck Vegas, sounds like we're on the right track now.

tough moth
#

@west lantern is that with respawn module or with respawn on custom position and a respawn_west marker?

west lantern
#

respawn module, and... let me send you the mission

tough moth
#

@blazing zodiac Thanks brother. Have a good one!

#

with my current setup, and BIS_fnc_respawnTickets_valuetotal != 0 in trigger condition, it ended the mission immediately.

blazing zodiac
#

That has to be changed to == 0

thin pine
#

yeah man we said that earlier ๐Ÿ˜›

tough moth
#

lol woops

#

sorry, multitasking here

thin pine
#

lol is ok

tough moth
#

BIS_fnc_respawnTickets_valuetotal !== 0

#

?

blazing zodiac
#

no "!"

tough moth
#

ah

blazing zodiac
#

just valueTotal == 0

tough moth
#

ok trying again xD

blazing zodiac
#

== is read as "is equal to"

#

!= is read as "is not equal to"

#

Just for future reference

west lantern
tough moth
#

I see

west lantern
#

unpack that to Documents\Arma3\mpmission and test

#

check MP atributes

#

and modules

tough moth
#

yea if this doesnt work, will take a look at your module solution

blazing zodiac
#

Well if that's the actual system working it will be better then an extra trigger

#

So I would try that either way after

tough moth
#

hey it works !!!

#

trigger condition totally works guys

west lantern
#

note that it seems to work for players only not for AI

blazing zodiac
#

You can play with different end mission types as well

tough moth
#

BIS_fnc_respawnTickets_valuetotal == 0

#

works !!

blazing zodiac
#

If you wanna look through that, there are many options

tough moth
#

so i have it currently as a trigger condition

#

to use other endings, where would it need to live?

#

just on activation?

blazing zodiac
#

waht do you mean

#

like instead of that ending?

tough moth
#

yea

blazing zodiac
#

or win conditions

#

yea in on activation

red estuary
#

Not sure to ask here, but is anyone here particularly good with Arma 3's ropes (already asked Duda, no reply), EG: making something like a hoist for instance

blazing zodiac
#

Oh man, I messed with ropes a bit a while back.

tough moth
#

@blazing zodiac @thin pine @west lantern Thank you so much guys!

blazing zodiac
#

They are certainly finicky

red estuary
#

yeah, ropes are not easy to do

blazing zodiac
#

No problem @tough moth That's what this channel is here for.

thin pine
#

I've attached an offroad to an ammobox with a rope. That's everything I've done rope wise ๐Ÿ˜„ (setMass is useful fyi)

blazing zodiac
#

Is that how you disable the "E-brake"

#

I tried towing another vehicle

#

But it had it's damn parking break on

thin pine
#

setMass could perhaps be used for that yeah, but it'll still have this brake unfortunately

red estuary
#

aah rip, stupid parking brake

thin pine
#

You could probably create a towing script by making an invisible AI driver drive the car while you're towing it

red estuary
#

im planning on using a rope for a hoist not to tow anything

thin pine
#

right

#

What woudl this hoist be used for?

thin pine
#

chopper one

#

for infantry ?

red estuary
#

yes

#

to rescue infantry

thin pine
#

dayumn duda would be the perfect guy to contact :/

red estuary
#

its for the HH-60G from the USAF mod (and possibly for the CV-22)

#

yeah, got no reply from him

#

๐Ÿ˜ฆ

thin pine
#

:/

#

nothing's stopping you from looking at how duda did it. If you can find out how he attaches folks to the ropes (afaik he actually doesn't, he said the ropes are purely cosmetical) and use that system to automatically winch people up then it's doable

red estuary
#

yeah, ill have a look. Thanks!

austere granite
#

Hoist could work fine

polar folio
#

afaik the rope segments are stored somewhere. so duda might be just doing per frame movement interpolating fom one segment to the next. just guessing

elfin bronze
#

Hey, anyone know how to get an array like ["something",3] when we have ["something","something","something,"] ?

#

Hum

opaque topaz
#

Let's say I got a very complicated script and need the script to run fast. Would FSM get the job done, or do you think it would be more efficient to run my code outside the engine in a DLL (C#)?

elfin bronze
#

I want in the other way so :

_myArray = ["9Rnd_45ACP_Mag","9Rnd_45ACP_Mag","9Rnd_45ACP_Mag,","30Rnd_762x39_Mag_Tracer_Green_F","30Rnd_762x39_Mag_Tracer_Green_F"];

and I want to count like :
_myNewArray = [["9Rnd_45ACP_Mag",3],["30Rnd_762x39_Mag_Tracer_Green_F",2]];

opaque topaz
#

use hashes

#

@elfin bronze

#

Are you using CBA?

elfin bronze
#

Yup

elfin bronze
#

Ok thank

zealous solstice
#

i realy hate the name "hash" in the case. its more of a Dictionary than a hash

opaque topaz
#

^^^

#

+1 ๐Ÿ‘

austere granite
#

doesnt actually what he wants though right?

#

unless im missing something

opaque topaz
#

Yes

#

wait what? re-reading

austere granite
opaque topaz
#

I know he can create. The wiki is pretty self explanatory. CBA has an excellent wiki. If you need more help or have more questions @elfin bronze, let us know

elfin bronze
#

Yep, i want to made a listbox to list allMagzines from player. So i want to list like :
4x MagazineA
3x MX

and not like
MagazineA
MagazineA
MagazineA
MagazineA
MX
MX
MX

opaque topaz
#

gotcha

elfin bronze
#

So I Do some pushBack to get an array with all player's inventory and made listbox with that

#

My english is so bad omg

native hemlock
#

I don't think a hash is necessary, but I'd be interested to see the performance comparison. Do you want it to return an array of the type and the count for every unique type or only duplicates of one specific type that you specify?

austere granite
#
private _array = [[], []];
{
    private _id = ((_array select 0) find _x);
    if (_id == -1) then {
        (_array select 0) pushBack _x;
        (_array select 1) pushBack 1
    } else {
        (_array select 1) set [_id, ((_array select 1) select _id) + 1];
    };
    nil;
} count ["9Rnd_45ACP_Mag","9Rnd_45ACP_Mag","9Rnd_45ACP_Mag","30Rnd_762x39_Mag_Tracer_Green_F","30Rnd_762x39_Mag_Tracer_Green_F"];
private _arrayNew = [];
{
    _arrayNew pushBack [_x, (_array select 1) select _forEachIndex];
} forEach (_array select 0);
testvar = _arrayNew;
```

did this for now, might be quicker ways, but wasn't sure
#

doing a count on unique types didnt seem to be faster so w/e

elfin bronze
#

@native hemlock i want to count each type. @austere granite thank its work perfectly !

native hemlock
#

There is actually a BIS function for this that KillzoneKid optimized called BIS_fnc_consolidateArray.

#

The full version can check for duplicates of nil, but in short it's this

_items = ["9Rnd_45ACP_Mag","9Rnd_45ACP_Mag","9Rnd_45ACP_Mag","30Rnd_762x39_Mag_Tracer_Green_F","30Rnd_762x39_Mag_Tracer_Green_F"];
private _cnt = count _items;
private _ret = [];
{
    _ret append [[_x, _cnt - count (_items - [_x])]]
} count (_items arrayIntersect _items);
austere granite
#

ah yeah arrayIntersect is dank, always forget about it

shut prairie
#

Anyone had experience installing IgiLoad?

#

I put
[] execVM "IgiLoad\IgiLoadInit.sqf";

#

in the init.sqf

#

but it says to add it to the vehicles initialization field

#

how do i install it with ArmaLife rpg 4.4r3

indigo snow
#

its says not to

shut prairie
#

// USE: //
// 1. In mission "init.sqf" add line: "0 = execVM "IgiLoad\IgiLoadInit.sqf";". //
// 2. In vehicles "INITIALIZATION" field type: "0 = [this] execVM "IgiLoad\IgiLoad.sqf";" //

#

in the changelog.txt which had use instructions

indigo snow
#

odd, says otherwise in their forum post

tender root
#

@here Heyho, one short question: Is there a weaponholder, which gear can't be accessed. So that you can spawn a item but you can't pick it up.

indigo snow
#

look into creating it as a simple object

tender root
#

@indigo snow nice thx mate

proven sequoia
#

Hallo @tender root

fringe estuary
#

I notice the AI doesn't care that thier own kind is dead. Is there a script that allows them to react to dead friendlies?

little eagle
#

change AI behaviour to danger

#

sorry "COMBAT"

little latch
#

Hi, Does anyone know the animation door state for the new Hotels front door? ''' configfile >> "CfgVehicles" >> "Land_Hotel_02_F" '''

#

cursorTarget animate ["door_1_rot", 1]; Doesn't open the double door

quiet bluff
#

how do i put the magazine on the backpack in the loadout select screen

native hemlock
#

@little latch That's because it's called Door_1A_rot

little latch
#

wuteven

#

Thanks @native hemlock

native hemlock
#

That's the naming convention they use for double doors usually

little latch
#

Alright, Didn't have much experience with the doubles โค

native hemlock
#

If you are looking at an object you can get a list of animations that you can use with the animate command from doing

copyToClipboard (animationNames cursorTarget joinString toString [10]);

It's not that useful in a case like this, but the newer command animateSource can be better https://community.bistudio.com/wiki/animateSource

little latch
#

Sweet thanks

#

I looked via config but didn't have much success

native hemlock
#

To get a list of sources you can use animateSource on you can run

copyToClipboard (((configProperties [configFile >> "CfgVehicles" >> typeOf cursorTarget >> "AnimationSources", "true", true]) apply {configName _x}) joinString toString [10]);
fringe estuary
#

I'm creating a mission in which if the AI detects the players they fail the Task (Complete Mission undetected) Not sure how to make this work?

#

Sorry wrong Channel

hearty shoal
#

Im doing some dialogs and i have one button that will be a ON/OFF function. How would i go about doing that?

#

To add to that i dont want to close the dialog. I want to toggle onMapSingleClick "player setPos _pos" on/off.

jade abyss
#

_Ctrl ctrlEnable (false/true) <- ?

#

@hearty shoal

hearty shoal
#

Thats just enable or disable the button? @jade abyss

jade abyss
#

Yep

#

In any other case ->
Button to enable/disable (not disabling the btn itself)

onClick="if(MyBlockVar)then{MyBlockVar = false}else{MyBlockVar=true};";

In your Script ->
if(MyBlockVar)then{player setPos _pos};
Cmon, wasn't that hard, hu? ๐Ÿ˜›

hearty shoal
#

Ha ha yeah well i'm learning so its hard for me. No past scripting experience at all ๐Ÿ˜›

jade abyss
#

... i hate Arma.
Overall CPU: 0-1%.
Restarted -> 7x 0-1% - 1x 50%
wth?

#

wow

#

Okay... something is RLY Broken in Arma!

#

I removed an outcommented line -> It works again oO
//{ _x setDamage 1;}; }forEach (nearestObjects [_SpawnMarker, [], 50]);

#

Back in -> Broken again.

little eagle
#

stop creating infinite "spawn marker" objects?

jade abyss
#

Its not doing it?

little eagle
#

and where does that line come from?

#

it's not vanilla afaik

jade abyss
#

My own Stuff, maybe?

little eagle
#

exactly. and there is your bug too

jade abyss
#

oh commy... just stfu

little eagle
#

lol

#

I don't have slowdowns like this. It has to be something in your coding, sorry

jade abyss
#

I remove that outcommented line -> Server runs fine. Adding it back in -> (I repeat: That line is commented out) server is fkd up again

little eagle
#

shrug, but there is a curly bracket missing

jade abyss
#

Does not, but okay.
Even when -> //
It shouldn't even consider that line

jade abyss
#

Now running on 1% again. This game is confusing me over and over again

little eagle
#

maybe you loadFile that file instead of preprocessFileLineNumbers

#

maybe you escape the newline in the previous line

#

maybe it's part of a string by accident

#

who knows. And there definitely is one more closing curly bracket than there is opening ones...

jade abyss
#

fml... 2 Objects collided with eachother...

little eagle
#

physx

jade abyss
#

On the other side of the fkn map...
Seems like, sometimes they "pushed eachother" away, sometimes not...

#

Yeah

little eagle
#

yeah, physx is a huge bottleneck

#

well narrow bottleneck I guess

jade abyss
#

Funny thing is: Each time i uploaded the the File without it -> They kicked eachother away.. except for the last 3 restarts... then i took a look at it by accident... wow...

#

Noticed the 2 are beeing spawned at the same Pos -> Insta ServerDead.

Yeah, PhysX is nasty

little eagle
#

spawned with CAN_COLLIDE flag?

jade abyss
#

Nah, old way

#

"Type" createVehicle [0,0,0]
bla setPosWorld [here];

#

Or in this case -> modelToWorld

little eagle
#

use createVehicle Array with CAN_COLLIDE

#

why setPosWorld ? seems unnecessary

jade abyss
#

iirc it was faster

little eagle
#

setPosASL is the fastest

jade abyss
#

Wait, lemme search that, there was something in the perf log.

little eagle
#

but yeah. setPos'ing two physX into each other will cause massive collision overhead ...

jade abyss
#

Yeah, haven't seen those tards... i was on the other side of the map

little eagle
#

doesn't matter

#

Similar to PositionASL, however z is measured from the sea level to the the model centre [0,0,0] of an object, rather than transformed boundingCenter or land contact vertices.

#

Yeah, World should be faster then.

#

Although I don't see why you would use the model center

jade abyss
#

Yeah, read that that.

#

Random positions possible with different SpawnPoints, but same Units, different StartPos

little eagle
#

It's not the setPos'ing anyway. It's collisions. The only way seems to not spawn them into another

#

Wait, this was caused by units colliding? Or actual vehicles?

jade abyss
#

Thast why i wrote -> Or in this case -> modelToWorld

#

2 Vehicles

little eagle
#

yeah. units don't have physx

jade abyss
#

At least!

#

I don't want to imagine, what would happend on the Servers then...

#

Insta BBQing the Server

little eagle
#

Probably the same thing that happens when you pile up corpses

#

Because those ragdolls are nasty too

jade abyss
#

Yeah, nice too look at, but .... meh. I could live with the old animations.

little eagle
#

Although I noticed that the slowdowns due to that happen mainly to me with my sub par graphics card

jade abyss
#

sub par?

#

Below Avg?

little eagle
#

2011 AMD thing for laptops

jade abyss
#

Uh fk

little eagle
#

hahaha

jade abyss
#

my bad

#

And i just ordered a 6700k as DevServer for my home^^

#

I feel bad now

#

(1st world problems)

little eagle
#

it's called 6850

#

6850M

#

: P

#

(I have no idea what these numbers mean, M is for laptops)

jade abyss
#

Yeah, my Laptop got an erm... idk, 940m or so

#

*860m

little eagle
#

This machine probably ran 30k hours in the last 5 years

#

still working

#

best buy ever

jade abyss
#

That was my thought, when i scrapped my PIII-1Ghz "some" years ago.

calm vale
#

Hallo

velvet merlin
#

dont create stuff at [0,0,0] - its dangerous

lone glade
#

I heard they eat children down at [0, 0, 0]

elfin bronze
#

Hey, it's possible to modify an LbAdd on listBox ?

#

On the start of my script i do _ListBox lbAdd format ["%1x %2", _value, _displayName];
I have made a script to delete 1 items of the listbox. I Want to rename the item of the listBox on each delete items like :

Start = 2x MX
When player click on the delete button (on selected items) the list box update : 1x MX

tough abyss
#

https://community.bistudio.com/wiki/User_Interface_Event_Handlers Assign one of these to the listbox control. Create the function that does what you want to do (not sure what you want from how you described it, just make sure to use disableSerialization) Use the EH to call your function. The EH has to be created every time the dialog is closed and re-opened.

#

or just update variables with script in the delete button's action=""; field, and make it close and re-open the dialog with: closeDialog 0; createDialog 'your_dialog';

elfin bronze
#

Hum i think i'm gonna do the second method : recreating the dialog ^^

tough abyss
#

yeah, much simpler

elfin bronze
#

Yep thank

tough abyss
#

np

little eagle
#

just make sure to use disableSerialization

#

Voodoo. You only need to disable the serialization if you store CONTROL or DISPLAY type in non-array variables if you operate in the scheduled environment.
I see no reason why a UI script should ever operate in the scheduled environment. All it would do is make the UI extremely sluggish.

nocturne bluff
#

for fun?

lone glade
#

yeah me too, the number is 0

nocturne bluff
#

use perframe enjoy life

#

ez

#

quickscope230sniperscopepewpew

nocturne bluff
#

noone polling anything

#

not sure how you got perframe to "polling the fps"

lone glade
#

hahahahahaha

nocturne bluff
#

what the fuck

lone glade
#

like anyone uses that

nocturne bluff
#

lol wat.

lone glade
#

cough, not true, cough

#

you should see the BIS equivalent to what I wrote above

nocturne bluff
#

btw

#

diag_fps dosent take 16 frames

#

it returns the last 16 frames fps averaged

lone glade
#

hint: it's at least 3 times the size using multiple while loops

#

no, no they simply don't

#

what's the state of BIS revive btw :p

zealous solstice
#

no they dont work better they work worse

lone glade
#

how the fuck do you think sleep / while works ?

#

also, scheduled can exit at nearly any scope which is mildy infiuriating

#

you do realise scheduled is actually heavier on the framerate than unscheduled, right ?

#

no, i'm not.

zealous solstice
#

and not he is not joking he is right

little eagle
#

oh snap. I said the forbidden words. I'm sorry

#

don't

lone glade
#

that's retarded

zealous solstice
#

you dont need to do it on each frame

lone glade
#

not only that but in unscheduled the loop would stop itself

zealous solstice
#

you can not move that fare in 1 frame

lone glade
#

oh wait, why the fuck would you use a PFH / onEechFrame for that :facepalm:

little eagle
#

I'm so sorry

#

By sluggish I meant that the scheduler stalls the execution of the ui script.
If anyone remembers CBA keybinding before Nou changed it to unscheduled
It was unusable, because the menu took half a minute to load in MP with low FPS
Now it is opened in milliseconds

#

I mean the menu where you change keybinds

lone glade
#

..............

#

the fuck

little eagle
#

the command itself should be fast. and the script should be faster after the command too. You drop the overhead needed to get serialization to work. which does stuff at least every time the scheduler changes the currently executed script

#

every local variable must be serialized when the scheduler changes the current script

#

why would it? all it does is make the script not load again after loading a savegame

lone glade
#

he doesn't agree with you

#

unscheduled is clearly better.

little eagle
#

well, "efficiency" would mean that you can get more stuff done in less time.
I don't see how the scheduler helps there. Overhead for serialzation, overhead for measuring script run time after every command, overhead for additional variable-is-defined checks...

#

I wouldn't call that more efficient. It's a way to prevent beginner from tanking the game by actually executing nearestX every frame

#

here is one we can all agree on

#

the best script is the one that doesn't run when not needed

#

event handler

#

I don't see how

lone glade
#

rolf

#

I can't tell if you're trolling right now

#

why the fuck would you EVER do that

#

that's just awfully bad design

little eagle
#

I can believe that

lone glade
#

that's just stupid design

little eagle
#

Because handle damage fires 15 times per bullet

lone glade
#

:facepalm:

#

or, how about saving the gear when it's necessary? like, for example, when the dude is actually getting downed ?

little eagle
#

When did you need the gear info? Why not use killed if it's for example for respawn?

#

See that is the problem. With that code you execute your getGear function every X seconds

#

With the actual event handler you execute it twice per 2 hour mission

#

killed has been in A1

lone glade
#

it's just awful design in the first place, doesn't matter what year it is

little eagle
#

But I think alganthe can agree that a PFH that records the gear every X seconds would be equally stupid

lone glade
#

it's simply terrible design either way

#

unscheduled / scheduled doesn't matter in this case

#

because it's simply retarded.

little eagle
#

Yes. Exactly. My point is that a PFH is not the replacement for while true polling loops like this.
It's just as bad

lone glade
#

bad design is going to be bad design, but it's harder to produce death loops with unscheduled

#

damn words

#

not going to be soon tm

#

I know that I&A 3 is at least going to switch away from it (mission is badly written but at least there's that)

#

I let them take some stuff that I wrote

#

gear limitations (arsenal blacklist) and revive

#

my garrison function too, (also present in mars)

#

dude, btc revive forces me to die once then die again when I press respawn

#

what is solid in that

#

not only that but in the tests that we ran with 60 players mine works better, the users didn't even notice a difference

little eagle
#

doesn't the BI revive do the same thing? kill you twice?

lone glade
#

nah

little eagle
#

or was that patched?

lone glade
#

they updated it

little eagle
#

k

lone glade
#

it's still as broken as before tho huehuehue

#

it also doesn't work with vehicles

little eagle
#

reviving .... vehicles??

lone glade
#

nah, you can't get unconscious inside a car

#

and that's not the reason quick

little eagle
#

oh, yeah. I know that bug

#

but you already have a corpse if you die once. why need 2?

lone glade
#

that's because BIS coded revive like arse

little eagle
#

surprise surprise

lone glade
#

you don't need a corpse in the first place

#

because the guy can just be forced to ragdoll through setUnconscious if he's not inside a vehicle

#

inside a vehicle I just play the death animation

little eagle
#

setUncon is not a ragdoll

lone glade
#

(looks like one)

#

now that I think about it I should've commented it

little eagle
#

too many indentations 3/10

lone glade
#

not using setDamage either

#

I just override the value returned

little eagle
#

forceRespawn player

#

Your hd will kill me if I kill my previous avatar after selectPlayer

lone glade
#

waiit, people use selectPlayer ?

little eagle
#

I was looking at algathes script, Quik

#

waiit, people use selectPlayer ?
they could. wouldn't break ace at least

lone glade
#

I could add an isPlayer check but that's such an edge case that I won't bother ๐Ÿ˜›

little eagle
#

or use the _unit variable and avoid player like the plague

lone glade
#

damn I read too quickly, didn't noticed I used player there

#

๐Ÿ‘ going to fix it

little eagle
#

player can change during a script (especially in scheduled)

lone glade
#

unit returned

little eagle
#

from the previous unit to the current unit

#

respawn, selectPlayer, teamSwitch

#

also, most of the time I want my script to work with Zeus remote controlled units

#

So I don't actually want player

#

I want "MyUnit"

#

the current avatar

nocturne bluff
#

I use selectplayer

#

;)

little eagle
#

Quik, it's ACE_player in ACE

#

or call CBA_fnc_currentUnit I can't remember the full code. It's a one liner with a obscure BI variable

#

cameraOn would report the vehicle you are sitting in

#

or the drone you control

#

not what I usually want

#

It's all bad design by BI and everyone has to find ways around it

#

or ignore it and blame BI

#

But people wanted zeus support badly back in AGM

lone glade
#

IS IT ZUES COMPATIBLE ?

#

CAN I USE ZUES ?

little eagle
#

omg, please stop with that

nocturne bluff
#

ZEUS

#

PLZ

lone glade
#

the war flashbacks

nocturne bluff
#

refuses to use zeus

little eagle
#

almost as bad as items in the arsenal

#

that is problems you don't have as mission maker I guess

#

dammit. I searched for the reason why the unit test for cba diagnostic fails

#

and the reason is that it tests the fail function

#

[CBA] (diagnostic) ERROR: Assertion failed! File: x\cba\addons\diagnostic\test_assertions.sqf Line: 20
Checking ASSERT_DEFINED() is output correctly

#

facepalm

nocturne bluff
#

whoop whoop

#

I find that zeus cripples server performance and doesn't really give any better missions ;)

little eagle
#

depends on the zeus

#

is output correctlypig english

nocturne bluff
#

True, but its what 9/10 zeus are not great zeuses.

lone glade
#

cue in a dude who thinks zeus needs to "win"

nocturne bluff
#

9.99/10