#arma3_scripting

1 messages ยท Page 620 of 1

winter rose
#

Vanilla mod
no

Vanilla is Vanilla ๐Ÿ˜„

potent river
#

Hello everyone so I decided to get my self a little project for this little quarantine that we got going on in my country so I want to create a mod that would make the helicopter dust effects larger dramatic and more realistic i guess and I got 0 idea where to start from anyone got any directions?

winter rose
#

this way โ†’

potent river
#

alright ๐Ÿ’ฏ then i guess ill start at the effects haha

potent river
#

thank you!

quasi cobalt
#

Is there a script floating around out there that lets you mark the remaining enemies after a certain amount of time has passed?

tired delta
#

Hello i have a small problem with an if statement.
I made an variable that is normally on "false". So i wanted to make an if statement that is something like this: if (_var != true) then {}; but i really don't know how to do it with "if (false) then". I hope someone can help me out ๐Ÿ˜„

ionic orchid
#

if (!_var) then {};

#

that'll invert the boolean so it becomes true and passes the check

tired delta
#

nice thank you so much

little raptor
#

@quasi cobalt

Would disabling AI autocombat and cover effect waypoints and triggers?
No

#

You've set up your trigger wrong

#

Is there a script floating around out there that lets you mark the remaining enemies after a certain amount of time has passed?
What do you mean "mark"?

tender fossil
#

Why does reloading the remaining missiles take for ages (like over a minute) with this script? Is there some special case where you get "time penalty" for reloading a whole static weapon?

private ["_unit","_weapon","_rocket","_ammo","_missile","_currentMag","_ammoCount"];

_unit = _this select 0;
_weapon = currentWeapon _unit;
_ammo = _this select 4;
_rocket = nearestObject [_unit,_ammo];

if (isNull _rocket || ({isPlayer _x} count (crew _unit) == 0)) exitwith {};

_missile = ["M_TOW_AT"];

if (!(_ammo in _missile)) exitWith {};

_currentMag = currentMagazine (vehicle _unit);
_ammocount = _unit ammo _weapon;
hintSilent format ["%1 missiles left",_ammocount];
(vehicle _unit) removeMagazine (_currentMag);
sleep 17;
(vehicle _unit) addMagazine [_currentMag,_ammocount];

reload (vehicle _unit);
#

Note: Arma 2: OA

winter rose
#

I guess reload acts as if you change magazine after emptying one

tender fossil
#

@winter rose The result is same with and without the reload command

winter rose
#

Yep; remove/add the weapon to get rid of the reload time

tender fossil
#

Ah, I see. Will try! Thanks! ๐Ÿ™‚

jade imp
#

why does this keep giving me the error "Error missing [" at the <<

    this addAction [ //red team
        "Join Red Team",    
        {
            params ["_target", "_caller", "_actionId"];
            _caller setVariable ["arenaStatus", RED];
        },
    ]; <<
tender fossil
#

@jade imp I think you have an extra , in the end of the addAction params

#

Try this

    this addAction [ //red team
        "Join Red Team",    
        {
            params ["_target", "_caller", "_actionId"];
            _caller setVariable ["arenaStatus", RED];
        }
    ];
jade imp
#

oh, youre right, lemme try

#

@tender fossil that worked, thanks!

tender fossil
#

Np ๐Ÿ™‚

cobalt leaf
#

Hey there
I'm trying to enable a trigger by planting an explosive inside it's zone, but I can't seems to make it work.
I tryed to search on google but all I can find is not relevent to what i'm trying to do.
Here is what I tried so far:

nearestObjects [position Trigger, "SatchelCharge_Remote_Ammo"];
little raptor
#

You mean you want the trigger to be triggered when you put an explosive inside it?

ebon citrus
#

(count nearestObjects [position Trigger, "SatchelCharge_Remote_Ammo", <radius here>] > 0)

little raptor
#

Or do you want the explosive to explode when someone steps in there?

ebon citrus
#

something like that

little raptor
#

I think your syntax is wrong Nica

cobalt leaf
#

Leopard20Aujourdโ€™hui ร  19:06
You mean you want the trigger to be triggered when you put an explosive inside it?

Yep , this is what i'm trying to do

#

It's for a tutorial for beginning friends

ebon citrus
#

@little raptor what's wrong with the syntax?

little raptor
#

You should provide an array with nearestObjects

#

For types

ebon citrus
#

what?

#

oh

little raptor
#
(count nearestObjects [position Trigger, ["SatchelCharge_Remote_Ammo"], <radius here>] > 0)
#

Now it's correct

ebon citrus
#

yeah yeah

#

i just used the original syntax

#

im just writing from the top of my head ๐Ÿ˜…

#

making some soup atm. Leopard posted correct syntax

#

remember to specify the radius

little raptor
#

Plus, I think this command doesn't work with explosives

#

Maybe I'm wrong

cobalt leaf
#

What values does radius takes ?

little raptor
#

nearObjects is safer

ebon citrus
#

@cobalt leaf the radius of the trigger

#

assuming the trigger is cylindrical

little raptor
#
count (position Trigger nearObjects ["SatchelCharge_Remote_Ammo", <radius here>]) > 0
ebon citrus
#

but i assume it is, otherwise nearestobjects isnt what you want

little raptor
#

@ebon citrus It is still possible to use this command with other trigger shapes

ebon citrus
#

it is, but it wont be accurate

little raptor
#

Yes it will

ebon citrus
#

because the radius is exactly that

#

no it wont

#

the radius creates a circle

#

anything within that circle is accounted

little raptor
#
(position Trigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea trigger} != -1
ebon citrus
#

if you switch up to a non-circle trigger, you want to use another command

cobalt leaf
#

so I absolutely need a elipse trigger ?

little raptor
#

This works with all shapes

ebon citrus
#

yes, but the original command doesnt

little raptor
#

@cobalt leaf No, use what I posted

ebon citrus
#

specificly, use the altered script, not the original one

little raptor
#

The triggers don't trigger when you place an explosive in them

#

So you need to use a loop

ebon citrus
#

or use the condition field

#

which in itself is already a loop

little raptor
#
waitUntil {
sleep 1;
(position Trigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea trigger} != -1
}
ebon citrus
little raptor
#

No it wont work

#

because the trigger won't even "start"

#

It only "starts" if a unit steps in it

ebon citrus
#

you can start triggers manually

little raptor
#

if condition is "Present"

ebon citrus
#

condition cant be "present"

#

that's activation

cobalt leaf
#

it doesn't seems to work...

ebon citrus
#

condition is the script that gets evaluated when the trigger is active

little raptor
#

That's what I mean. It won't activate at all

ebon citrus
#

you can activate it manually

#

you dont want to have constantly running triggers anyways

#

usually you have a simple activation method and a more complex condition

#

saves up on performance

little raptor
#

as far as I know there's no such command for enabling triggers manually

#

And yes, he doesn't need it

ebon citrus
#

i believe if you set all the activations to "none" it will run constantly

little raptor
#

He can just use an area

#

No

#

It won't

ebon citrus
#

it wont?

little raptor
#

afaik no

ebon citrus
#

afaik it does

little raptor
#

better test it

ebon citrus
#

only one way to find out

#

yep

#

looks like i was right

#

if the activation is none, then the trigger condition gets repeatedly evaluated

#

wait what?

#

we're not talking about triggering

#

we're talking about the condition

little raptor
#

nevermind

ebon citrus
#

the condition field is continuously evaluated if the activation is none

little raptor
#

Yeah i didn't change the condition

#

๐Ÿคฆ

ebon citrus
#

all good, i wasnt crystal clear on that either

#

well, that's cleared up now

#

so the condition is evaluated once per second-ish, it looks like

little raptor
#

You can change the trigger "period"

#

I mean interval

ebon citrus
#

you can also use thisTrigger to get the trigger from the condition field aswell

cobalt leaf
#

I've put the lines you told me to in my trigger's condition, but it doesn't seems to work

little raptor
#

@cobalt leaf Long story short:

(position thisTrigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea thisTrigger} != -1
#

Put this in condition

ebon citrus
#

remember to specify maxRadius

cobalt leaf
#

In activaiton ???

#

you means condition ?

little raptor
#

Yes

#

Set activation to None

cobalt leaf
#

got it working. Thanks!

ebon citrus
#

high five!

viral oak
#

hey guys, im new to modding

#

how can I edit a texheaders.bin file

#

CFG convert does not seem to do anything

ebon citrus
#

you dont edit files

little raptor
#

why?

ebon citrus
#

you inherit from them and make a change

viral oak
#

im just exploring some mods

#

I wanted to set up a helmet

ebon citrus
little raptor
#

there's no need

viral oak
#

oh ok

little raptor
#

The texHeaders file is automatically generated

ebon citrus
little raptor
#

It helps the game look up textures faster

#

that's all

viral oak
#

which tool generates it?

ebon citrus
#

you might want to use mikero's tools to unrap files instead

still forum
#

you don't edit texheaders.bin, you just simply don't at all.
That's not a file that's edited

ebon citrus
#

pbomanager is ... not good

little raptor
#

yes

still forum
#

if you are trying to edit it, you are doing something wrong

ebon citrus
#

if you want to study mods, there is also the arma 3 samples

#

i also recommend taking a look at the PMC guides to modding

#

they helped me plenty along the way

viral oak
#

sure, Im gonna check them out

#

thanks guys

ebon citrus
#

edited the link to help navigation

tough abyss
#

Is there a reason you guys can think of that values would be recognized with a CBA_FNC_ServerEvent but be null when CBA_FNC_OwnerEvent on a HC?

still forum
#

what kind of values you sending?

#

object?

copper needle
#

If I have an array like ["A", "A", "A","A"] how do I return that they are all equal?

winter rose
#

findIf not isequalto first element?

copper needle
#

Perfect thanks!

tough abyss
#

Sent you a pm Dedmen, it's sorta long and complicated

quaint oyster
#

Is it possible to delay the player going to the select respawn screen?
In an MP environment might I add.

quasi cobalt
#

@little raptor Thanks for the replies. I sorted the trigger, just being a moron with the mag names. I also sorted the marking of enemies but just scripting in a massive bombing run to wipe out the last few that are dug down somewhere in the objective area haha.

quasi cobalt
#

Do have a question about BIS_fnc_fireSupportVirtual.. On certain types of ammo, it's working perfectly but on the mag type I really want to use, it's triggering and the arti is coming down but about 700m away from the marker. Only thing changed is the mag type.

sand elm
#

hi, can i asking

winter rose
#

hi, you can ask

sand elm
#

my server display this.

#

8:41:19 Warning Message: Script functions\fn_uh80Turret.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretActionCancel.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretActions.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretControl.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretReset.sqf not found

winter rose
#

you most likely have a function (declared in CfgFunctions) and the file is not present

sand elm
#

inside class "class CfgFunctions" right

quasi cobalt
#

This makes no sense... A bug?

[getMarkerPos "M1_Arti2","R_230mm_Cluster", 200, 10, 5] spawn BIS_fnc_fireSupportVirtual;```

The R_230mm_HE is hitting on the red arrow, the Clusters are hitting on the black. Both Arti1 and Arti2 markers are pretty much in the same area. I've tried different mag types on different markers (3 in total) and the only round that has problems is the R_230mm_HE....
#

If I set all three markers to the HE round, they all hit off to the right there in the same exact spot.

winter rose
#

maybe it needs more altitude/speed? just a (wild) guess

#

but weird indeed

#

@sand elm yes

quasi cobalt
#

I didn't think of that... I'll give it a shot.

#

Holy shit.. @winter rose You were correct haha

#

Default values weren't enough. Double speed and alt and it works perfectly -.-

winter rose
#

w00t w00t

ebon citrus
#

@quasi cobalt cluster munitions are aimed at where you want them to disintegrate

#

If you give them too little altitude, they will auto-disintegrate

quasi cobalt
#

The clusters were working with default values but the HE's needed more power.

#

That was the last major thing to do in my mission so now I'm just cleaning it up ๐Ÿ™‚
There is one part where it's a time skip and it fades and displays text etc... What's the best way to reset the player position? I've tried just setting the position but if you're in UAV or doing something you fade back into the same thing you faded out on. It can't be forcerespawn right?

ebon citrus
compact maple
#

Hello, I would like to set a variable on the player, but only the server (and the player himself) can access it

player setVariable ["var", value, -2];

Number - the variable is set only on the client of given owner (clientOwner) id, or if id is negative, the variable is set on every client except the given one
Not sure about the -2

quasi cobalt
#

@ebon citrus Just for effect or does that it do something more then what's on the wiki page?

#

I'm going to use it for effect anyway, that's fancy haha

still forum
#

the variable is set on every client except the given one
your number is negative, meaning the variable is set on every client that's not "2" and 2 is server.
so you are setting it on everyone BUT the server, exactly the opposite of what you want

ebon citrus
#

@quasi cobalt it's to force the player out of the UAV view

quasi cobalt
#

Oh duh...

compact maple
#

Oh, so it's just 2, thanks, I misread it

quasi cobalt
#

Yeah, ignore me. Thanks mate, solves it all haha.

umbral nimbus
#

Are there any simelar functions like BIS_fnc_establishingShot to enhance a scenario?

winter rose
#

yes - see the GUI category

umbral nimbus
#

thnx!

cold pebble
#

@compact maple 2 means only the server will see it, you'd need to do [player,2] to get both

compact maple
#

@cold pebble Y but I wanted only the server to see it :p

cold pebble
#

but only the server (and the player himself) can access it ๐Ÿค”

#

๐Ÿคฃ

compact maple
#

forgot I wrote that lmao, I changed my mind

cold pebble
#

๐Ÿ˜›

#

no worries, you got what you needed ๐Ÿ˜›

compact maple
#

I figured that the lcient doesnt even need to know it

#

yes ๐Ÿ˜„

cold pebble
#

๐Ÿ‘

ornate marsh
#
{
[str _x] remoteExec ["systemChat"];
_player = _x;
[str _player] remoteExec ["systemChat"];
    [_player,    [ 
        "Teleport players on Pad", 
        { 
            params ["_target", "_caller", "_actionId", "_arguments"];
            _player = _this select 3 select 0;
            [str _player] remoteExec ["systemChat"];
            [_player] remoteExec ["removeAllActions",0,true];
            [] spawn {
            [teleFrame, "teleport"] remoteExec ["say2D"];
            ["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
            sleep 5.3;
            ["teleportOut.sqf"] remoteExec ["execVM",2];
            _players = nearestObjects [teleFrame, ["Man"], 5, true]; 
            [str _players] remoteExec ["systemChat"];
            {
                [str _x] remoteExec ["systemChat"];
                _location = getPosASLW telePosition;
                [str _location] remoteExec ["systemChat"];
                _x setPosASLW _location;
            } forEach _players;
            ["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
            };
        }, 
        [_player], 
        1.5, 
        true, 
        true, 
        "", 
        "_player inArea teleTrigger", 
        5, 
        false, 
        "", 
        "" 
        ]
    ] remoteExec ["addAction",-2];
} forEach playableUnits;

This script is being executed on the server. I'm essentially wanting to add an action to each player that is local to them i.e. a action that appears when they just scroll wheel, except it wont show up

winter rose
#

Because _player doesn't exist in the condition, I would say

Also, remoteExec -2 is "stupid", drop it (a server can be a player)

#

Code with -showScriptErrors, too

ornate marsh
#

i am doing, but wont show an error cause im testing on dedicated

#
    [player,    [ 
        "Teleport players on Pad", 
        { 
            params ["_target", "_caller", "_actionId", "_arguments"];
            [player] remoteExec ["removeAllActions",0,true];
            [] spawn {
            [teleFrame, "teleport"] remoteExec ["say2D"];
            ["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
            sleep 5.3;
            ["teleportOut.sqf"] remoteExec ["execVM",2];
            _players = nearestObjects [teleFrame, ["Man"], 5, true]; 
            [str _players] remoteExec ["systemChat"];
            {
                [str _x] remoteExec ["systemChat"];
                _location = getPosASLW telePosition;
                [str _location] remoteExec ["systemChat"];
                _x setPosASLW _location;
            } forEach _players;
            ["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
            };
        }, 
        [], 
        1.5, 
        true, 
        true, 
        "", 
        "player inArea teleTrigger", 
        5, 
        false, 
        "", 
        "" 
        ]
    ] remoteExec ["addAction",0,true];

also tried this script but didnt work either

exotic flax
#

what is not working, and which errors do you get?

#

and servers also have error logs

ornate marsh
#

its a community server so dont have easy access to the server rpt

#

the action will not add

exotic flax
#

testing it locally (in MP environment) I can see the remoteExec working, but no addAction being added.
Although adding the action without remoteExec also doesn't add the action

cold glacier
#

@exotic flax - Are you in the teleTrigger area?

#

If not, the action won't appear.

exotic flax
#

just noticed that ๐Ÿ˜‰

cold glacier
#

Also, just pinged the wrong person facepalm. @ornate marsh, that was for you.

exotic flax
#

btw... I asume teleTrigger is a marker area and not a trigger

cold glacier
#

Ah, there's a handful of other issues too.

exotic flax
#

well, if I change
"player inArea teleTrigger",
to
"player inArea ' teleTrigger'",
it works ๐Ÿ˜‰

ornate marsh
#

teleTrigger is a trigger,

#

ok, i'll try that

#

did you try the first or second one with that

exotic flax
#

2nd

ornate marsh
#

ok, i'll give it a shot

exotic flax
#

actually the 2nd script works with a trigger (and without modifying it)

ornate marsh
#

didnt seem to work in dedicated MP though

cold glacier
#
    // Using 'player' here, means it'll add an action on this one player. So everyone on the server will see an action to teleport this one guy.
   // Except on the server, 'player' is meaningless. So if execute on the server, it doesn't add an action to anyone.
    [player,    [ 
        "Teleport players on Pad", 
        { 
            params ["_target", "_caller", "_actionId", "_arguments"];
            //This'll remove all actions on the local player, for everyone.
            //removeAllActions is generally bad, because it'll strip *all* user actions, including ones added by mods.
            [player] remoteExec ["removeAllActions",0,true];
            [] spawn {
            [teleFrame, "teleport"] remoteExec ["say2D"];
            //This'll execute for everyone, even players not on the pad.
            ["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
            sleep 5.3;
            ["teleportOut.sqf"] remoteExec ["execVM",2];
            //So, I *think* this will teleport any nearby animals too. Because they inherit from "Man" in the config.
            //Fun fact - you can remote control animals because of this!
            _players = nearestObjects [teleFrame, ["Man"], 5, true]; 
            //...Code cut...
            //This'll again play for everyone, even players not on the pad.
            ["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
            };
        }, 
        [], 
        1.5, 
        true, 
        true, 
        "", 
        "player inArea teleTrigger", 
        5, 
        false, 
        "", 
        "" 
        ]
    ] remoteExec ["addAction",0,true];
#

Check the comments on that code for issues.

exotic flax
#

all I did was creating 2 flags (teleFrame and telePosition), and a trigger (teleTrigger) at the same place as teleFrame

ornate marsh
#

yea that's what's on my end as well, also @cold glacier , the sound is supposed to play globally, so that even if people aren't stood on it realise its being used

cold glacier
#

If teleFrame is an object, I suggest replacing that first player with teleFrame, and add the action to that.

ornate marsh
cold glacier
#

It is, but think of it this way: RemoteExec sends all of the arguments you give it over the network to other machines. player is evaluated on the current machine, and returns the player object on the current machine. This player object is then passed over the network to everyone else.

ornate marsh
#

the thing is though, the action needs to always be there, but not appear until anyone steps on the platform. I tried adding it to the teleframe object, but its a weird object so its hard to actually click the action. Thats why its just easier to add to the player

#

how could i get around that issue then?

cold glacier
#

Rather than remoteExec'ing addAction, you could remoteExec call and just pass the code you want to run on each client.

#

Though it's much better if you define a function in CfgFunctions, and remoteExec that.

exotic flax
#

or simply set addAction to teleFrame instead of the players

cold glacier
#

I tried adding it to the teleframe object, but its a weird object so its hard to actually click the action. r
@exotic flax ๐Ÿ™‚

exotic flax
#

set the distance radius higher, so it will show up even when just close to it

cold glacier
#

I'm pretty sure you'd still need to look at it, unfortunately.

exotic flax
#

I'm currently standing 2-3 meters from the object and not facing it, and works perfectly fine

cold glacier
#

You should need to look at it, but the reality is that isn't always true. Try setting the radius to 50m, and then stand 40m away from it. You should need to look roughly at it.

ornate marsh
#

im confused about this functions thing, as i've never used it before. How would i convert the script i have to work with the function. I can put the full sqf file in a pastebin if needed?

cold glacier
#

You'd need a section in your mission's description.ext with CfgFunctions defined.

ornate marsh
#

but would I just put the addAction in there, seeing as all the other code in the same sqf file is working fine?

cold glacier
#
class CfgFunctions
{
    class bensMagicalCode
    {
        class Anything
        {
                class myFunc {file = "path\to\my\func.sqf"};
        };
    };
};

You'd then call it like this:

[] call bensMagicalCode_fnc_myFunc;
#

And yeah, just make that function do the addAction

#

Then your server can execute:

[] remoteExec ["bensMagicalCode_fnc_myFunc", 0, true]
ornate marsh
#

so i'd have to make another sqf file for the addAction. Would that then allow me to use player for the addAction?

cold glacier
#

Yeah, it would.

#

You'd have something like this in the function file:

    player addAction [ 
        "Teleport players on Pad", 
        //...Etc
    ];
ornate marsh
#

so if the sqf file that i call the function from is already running serverside, i dont need to remoteExec it?

cold glacier
#

You need to remoteExec anything you want to run on the clients, if the code is currently running on the server.

#

In this case, you need to remoteExec the code containing addAction

ornate marsh
#

ok, works fine, except when i get back after the teleport sequence, the action is now there twice

#

the sounds in the teleport out script are also playing twice

ornate marsh
#

cant seem to post the code, says it cant send

#

nvm, working fine, had a random trigger placed with duplicate code in

cold glacier
#

Glad it's all sorted Ben! :)

copper needle
#

can disableUserInput be used on specific players?

cold glacier
#

disableUserInput works locally on the machine it's run on. If you want to target a specific player, just run the command only on their client @copper needle.

#

The above links for Multiplayer Scripting and remote execution might be useful!

copper needle
#

So {true} remoteExec ["disableUserInput", _arrayofplayers] would only run on players in the array right?

#

@cold glacier

cold glacier
#

[true] remoteExec ["disableUserInput", [playerA, playerB]] would do it, yeah.

copper needle
#

Alright thank you!

cold glacier
#

Be real careful with it thoufh

#

Though*

copper needle
#

will make sure to be. I'm fully aware of the risks

cold glacier
#

If you don't have it automatically re-enable user input correctly, you'll have to restart Arma to fix it.

#

Awesome! Just wanted to be sure :)

copper needle
#

I appreciate the help!

cold glacier
#

Np, good luck with it!

winter rose
#
  • ] ^^
flat geyser
#

right, so

#

Scripting can be very useful, yes?

#

So it's probably possible for me to perhaps script something that would essentially be a currency mod, just as a script.
Like, what'd be my possibilities?

young current
#

almost anything can be done.

flat geyser
#

Does this fall within the "almost"?

young current
#

there are many ways to do money yeah. you may have seen such featutes on some game modes already.

#

how difficult it is depends on how do you want to use it

flat geyser
#

literally just want it to be a value that I can add and subtract to and from

#

nothing fancy, really

oblique arrow
#

Ye thats possible @flat geyser

warm hedge
#

If you're willing to achieve by any means necessary, almost everything except hardcoded things or engine limitations are possible.

flat geyser
#

it shouldn't be that hard right?
By no means have I any clue how scripting works, so this is just a hunch

Create a variable on startup of the mission
create some way (like a command) to either increase or decrease that variable by a certain value

warm hedge
#

True. Would require only few lines of codes

flat geyser
#

time to figure out how to script I guess

winter rose
#

yyyup!

quasi cobalt
#

Could someone point me in the right direction so I can learn how to change faction relationships with triggers? EG: You kill 3 Ind men as Blufor and ind turn hostile towards blufor.

oblique arrow
quasi cobalt
#

I was looking at setFriend before but found a big argument on the forums about using it during mission runtime.

#

Eh, guess setfriend it is. Can you be even more of a legend and point me in the right direction for checking faction kills and things (If West have killed X East men: Setfriend)? Or am I diving down a rabbit hole I'm not ready for? ๐Ÿ˜›

oblique arrow
#

Hm not sure about that so I cant help with that, sorry

quasi cobalt
#

Still a legend.

oblique arrow
winter rose
#

you can use Killed EH and count side killer
as for setFriend during a mission, it was an issue in Arma 2 (where units that would know you as a friend would need to forget about you first iirc)
in A3 it is instant

quasi cobalt
#

Ahh ok awesome.

#

That first sentence though honestly doesn't make much sense to me haha.

winter rose
#

an Event Handler (EH) is code that will execute on said event (here, "Killed")
adding an EH to all resistance units will allow you to increment a variable by one if the killer is e.g of the west side

quasi cobalt
#

Ohhhh thank you!

#

That sounds a lot better then a trigger for something like this haha.

#

An EH gets called on the event right? So it's not like a trigger checking constantly if the conditions are met?

cosmic lichen
#

yes

quasi cobalt
#

Thanks heaps!

still forum
#
hint "Objective Alpha has been taken by BLUFOR."; 
redalpha1 call BIS_fnc_removeRespawnPosition; 
redalpha2 call BIS_fnc_removeRespawnPosition;```

Doesn't actually delete the respawn points given. Anyone know why? (Using the 3den editor respawn module)

@broken forge https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition where's your "id" parameter?

quasi cobalt
#

Is there a function to limit the targeting range of static turrets?

winter rose
#

nope! Besides viewdistance

quasi cobalt
#

Can you set view distance per object?

winter rose
#

of courseโ€ฆ not ๐Ÿ™ƒ

quasi cobalt
#

Guess I'm not using those awesome SAM Systems then ๐Ÿ˜ฆ

#

Killing all the planes before they are in a decent view range haha.

winter rose
#

Well, you can disable their simulation until planed are less than x meters, that's what I did

quasi cobalt
#

Oh yes that'd work!

#

Happen to have the command handy by chance? ๐Ÿ˜›

winter rose
#

enableSimulation?

quasi cobalt
#

Haha just found it.

#

Thanks heaps ๐Ÿ™‚ โค๏ธ

tough abyss
#

hello gamers, is it possible to execute a few functions with only one remoteexec?

winter rose
#

if you group them in another function, it's the safest

dire topaz
#

how do you use the cinematic camera now? the exec "camera.sqs" is outdated and doesnt work

winter rose
#

it should still work (and maybe tell you to use BIS_fnc_camera)

dire topaz
#

yeah thats it, but is it still the same process, just with a different command?

winter rose
#

I suppose so, it has been since OFP I used camera.sqs

dire topaz
#

ah ill have a look thanks, camera.sqs defo doesnt work anymore tho, it just said to use BIS_fnc_camera

dire topaz
#

i acc cant find ANYTHING, BIS_fnc_ camera and the old one dont work, camera.sqs doesnt work.. i dont know what to do

winter rose
#

try without mods?

dire topaz
#

acc yeah good idea will do

#

still doesnt work, surely im doing something wrong, ive seen missions with cutscenes before

winter rose
#

wait, what are you trying to do?
camera.sqs only provides a floating camera you can use to grab camera position data, that's it

dire topaz
#

yeah ik but it doesnt even load, just tried BIS_fnc_camera, which spawns in but as soon as i click right mouse it kicks me out

#

oh cheers ill have a look but i dont rlly understand what im doing, ill figure it out tho

#

omfg @winter rose life saver ty

ebon citrus
#

What happenrd

winter rose
#

๐Ÿ”จ

ebon citrus
#

Ok

#

I didnt even manage to read it

winter rose
#

just a crosspost, nothing popcorn-worthy

ebon citrus
#

I just got the package out

#

Maybe next time

winter rose
#

I just got the package out
title of your sextape

ebon citrus
#

I will report you for sexual harrasment

#

Where's the Human Resources

oblique arrow
#

I love the emotes heh

vague geode
#

Do I have access to the missionNamespace and BIS_fnc_listPlayers when I spawn code in the initServer.sqf without arguments or do I need to pass them as arguments?

winter rose
#

I will report you for sexual harrasment
Where's the Human Resources
I am. Now please have a sit on this black couch

#

@vague geode you have access, these are commands/functions

vague geode
#

||Ok, thanks alot. (originally)||

@winter rose Ok, thanks a lot. (edited)

winter rose
#

a lot* ^^

timid niche
#

If I use ctrlCreate is there a way to set the control as a background element?

#

So it doesnt overlap anything

timid niche
#

and is it possible to have every element faded out/hidden from the start.
Actually fading/hiding them onload looks kinda dumb since it will quickly appear before it dissaperas.

ionic orchid
#

I usually just create those controls first, but then I create every control via script so that's easier to pull off

timid niche
#

Just a lot more work

ionic orchid
#

it can be, it's just how I'm used to making UIs

exotic flax
#

What are you trying to do?
Do you want to place elements UNDER existing elements, or do you just want to have elements placed on top of each other?

timid niche
#

Trying to place a background under existing elements

exotic flax
#

Depending on the existing elements, you can use core display IDD's which set the layer you place elements in, so putting it in a higher/lower layer could do that.

By default it should be IDD 46:

// create new Display at MISSION layer
_display = findDisplay 46 createDisplay "RscDisplayEmpty";
timid niche
#

Alright but then I still have the issue of fading/hidding from start

cunning crown
#

and is it possible to have every element faded out/hidden from the start.
Actually fading/hiding them onload looks kinda dumb since it will quickly appear before it dissaperas.
@timid niche if you are talking about controls in configs, just change their background color alpha to 0

exotic flax
#

Alright but then I still have the issue of fading/hidding from start

_ctrl = _display ctrlCreate ["CLASSNAME", 1234];

// hide control completely
_ctrl ctrlSetFade 1; 
_ctrl ctrlCommit 0;

// fade in control over aprox. 3 seconds
_ctrl ctrlSetFade 0; 
_ctrl ctrlCommit 3;
timid niche
#

Yeah obviously, but then I would have to use ctrlCreate on every single control, which just makes it rather difficult/messy to look at

exotic flax
#

if you use configs for your UI, you can use ctrlSetFade/ctrlCommit in the onload property

#

and in that case you can also use class ControlsBackground to put stuff in the background of your custom UI

timid niche
#

Ill try

#

Aight works

#

ty

amber lantern
#

Could someone help me with understanding the config system and accessing it?

#

Like how do I list all enemy types and filter those?

#

And how would I get a list of all buildings (what's the difference between "Building" and "House"?)

young current
#

for what use will those lists be?

amber lantern
#

I want to spawn different kinds of zombies

#

and I'd like to spawn vehicles around buildings

#

I'd also like to randomise objects that I'll spawn in buildings

#

and on zombies

#

and I'd prefer not to write out the entire lists by hand

#

I mean I can get a list by [0, 0] nearObjects ["Building", 20000]; and so on

#

but that sounds silly

#

Should I do it differently?

young current
#

making the zombie list is definiely simperl to make by hand. there cant be that many types

amber lantern
#

I mean there's like 25

young current
#

for buildings its not as simple as not all buildings have config classes

amber lantern
#

And the names are like ryanzombie_something_something

#

(ie long)

young current
#

it takes you less time to copy paste those than create a script that parses them form the config

amber lantern
#

hmm where can I get that list?

#

I can definitely copy paste stuff

young current
#

assuming they have some attribute or name that you can even sort them with

#

in editor there is a tool to copy selected objects classes to clipboard

amber lantern
#

ooh didn't know about that, lemme see

#

Thanks for helping out btw

young current
#

woudl be good idea to work out some of the basic stuff first before jumping into creating complex random missions

amber lantern
#

Well I did go through all the tutorials in eden and this is just a learning opportunity

#

ie I would still have to learn all this anyways

#

hmm I can't seem to understand how to select multiple items from the assets list

#

wait you mean I need to spawn all those types first and then I can copy them?

#

And there's like 100 to 150 types of zombies ๐Ÿ˜„

supple leaf
#

yes, place all different units, select all, right click, log classes to clipboard

rain mural
#

Is anybody able to help me out on how I would go about checking if a missionEventHandler is active?
I have a paradrop script which allows the player to paradrop using MapSingleClick. However after the player has used it for the jump, they can then repeatedly use it. This is the code I currently have:

if (player inArea paraTrigger) then {
    openMap true;

    _paradrop = addMissionEventHandler ["MapSingleClick", {
        params ["_units", "_pos", "_alt", "_shift"];
        _marker = createMarker ["DZ", _pos];
        _marker setMarkerType "mil_end";
        _marker setMarkerColor "ColorRed";
        _marker setMarkerText " DZ";
        _marker setMarkerSize [1,1];

        player setPos(getMarkerPos _marker);
        deleteMarker _marker;
        openMap false;
    }];
} else {
    removeMissionEventHandler["MapSingleClick", _paradrop];
};

While that code would likely work, I don't want the else condition to run if the eventhandler doesn't exist as it will likely generate a script error. I have read a few forum posts but didn't really understand them to be honest.

Edit: I know the paradrop script itself works. It is just the else condition

queen cargo
#

Problem 1: _paradrop is a local variable. Aka: Unless the whole thing actually refers to some variable in a lower scope, where you properly store it, _paradrop never will contain a proper value
Problem 2: Solvable once you solved problem 1. As after that, it is just a "does this exists" check

rain mural
#

Ah I see. I did initially try a truthy check on _paradrop but if it cannot store a proper value, it'd make sense for it not working as expected. Thank you ๐Ÿ˜„

queen cargo
#

well it can

#

but ...

#
fnc_myMethod = {
  private _foo = "bar"; // _foo got created
}; // _foo got destroyed


[] call fnc_myMethod;
diag_log isNil "_foo"; // Will result in true as `_foo` only ever existed inside fnc_myMethod
#

one solution is to use a global instead ... or to just store it somewhere else
or to eg. create the EH once and leave it there forever

rain mural
#

Hmm ok. I think I can make sense of that ๐Ÿ˜‹

#

I just remembered I am dumb. I only have that EH check inside a function which only gets called after an addAction. So I need to run the EH check from a different location otherwise the EH will never get removed.

cold glacier
#

Have you considered using _thisEventHandler?

#

It stores a reference to the event handler that you're currently in.

#

Not entirely sure if it'd help in this context, actually :D

rain mural
#

I didn't even think of that to be honest. I believe I have a method which should work but if not, I will give that a shot. No harm in trying anyway

cold glacier
#

Just an idea, there's many, many ways to skin a cat, as they say :P

rain mural
#

That is very true ๐Ÿ˜„

rain mural
#

I've been racking my brain and all. I thought declaring a variable without an underscore made it accessible "globally".
Why is it that when it comes to setting the player position, it is undefined?

openMap true;
    paradrop = addMissionEventHandler ["MapSingleClick", {
        params ["_units", "_pos", "_alt", "_shift"];
        marker = createMarker ["DZ", _pos];
        marker setMarkerType "mil_end";
        marker setMarkerColor "ColorRed";
        marker setMarkerText " DZ";
        marker setMarkerSize [1,1];
    }];
player setPos(getMarkerPos marker);
deleteMarker marker;
openMap false;
removeMissionEventHandler ["MapSingleClick", paradrop];
cosmic lichen
#

are you sure marker clicked is executed before the setPos line?

#

Because right now, it's not

jade abyss
#

โ˜๏ธ

#

damn ninjas

cosmic lichen
#

๐Ÿ˜„

rain mural
#

Ah yeah... I suppose I kind of have to waituntil or something before executing the rest of the code

cosmic lichen
#

Also, currently there would be no delay between creating the marker and teleporting the player. So you might wanna get rid of the marker all together and just teleport the player onMapClick

jade abyss
#

You overcomplicate it yourself a bit there. Just4Info

#

You can easily include the code INSIDE the Eventhandler, so you don't have to wait for any code.

#

fu R3vo :angrypepe:

cosmic lichen
jade abyss
#

stahp it!

#

๐Ÿ˜‚

rain mural
#

I did originally have that but then i was being dumb because I couldn't figure out when to remove the eventhandler

jade abyss
#

So yeah, just ditch the marker and exec it from within the Eventhandler

#

Right after you executed the code

#

removeEventhandler _thisEventhandler (mockup example)

cosmic lichen
#
openMap true;

paradrop = addMissionEventHandler ["MapSingleClick",
{
    params ["_units", "_pos"];
    player setPos _pos;
    openMap false;
    removeMissionEventHandler ["MapSingleClick",_thisEventHandler];
}];
#

If you need the marker

jade abyss
#

OR

removeMissionEventhandler ["MapSingleClick", paradrop];
rain mural
#

So you CAN remove an EH inside the EH itself?

cosmic lichen
#

yes

jade abyss
#

Yeah sure

rain mural
#

WTF???

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

rain mural
#

I have been working under the logic that it is impossible to do such things

jade abyss
#

You can also add another EH inside an EH

#

Eventhandlerception etc

rain mural
#

I thought you could do that but surely removing the eh you have made whilst inside of it is just....

#

GAHHHH!

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

#

Now you know

#

gl hf in the future ๐Ÿ™‚

rain mural
#

Indeed I do and I hate myself for it! Thanks ๐Ÿ˜„

jade abyss
#

๐Ÿ™‚

cosmic lichen
#

Always good to read the description ๐Ÿ™‚

rain mural
#

I did read... most of it ๐Ÿ˜Š

jade abyss
#

"most" != everything!!11111oneoneoneeleven

rain mural
#

๐Ÿ˜‚

cosmic lichen
#

On the biki, important stuff is always at the end ๐Ÿ˜„

jade abyss
#

Notes for example

rain mural
#

Seems that way. Made this mistake a few times

cosmic lichen
#

Who hasn't ๐Ÿ˜„

rain mural
#

Indeed

cosmic lichen
#

So many hours wasted because I refused to read completely

jade abyss
#

Who hasn't ๐Ÿ˜„
@cosmic lichen
<--- perfect!!1111

fair drum
#

which command adds a launcher to a unit?

jade abyss
#

I never make mistakes you know. Like editing the backup file, wondering why it doesn't work etc.

#

addWeapon?

exotic flax
#

I guess that some people are still used to pre-1.63 ;)
Although even there it it would be possible to remove EH's by storing the index in a global variable and retrieving it again when inside the EH

cosmic lichen
jade abyss
#

dis new?

cosmic lichen
#

yes ๐Ÿ˜„

#

Well, polished

jade abyss
#

Why isn't that pinned?

cosmic lichen
#

It's not yet done

jade abyss
#

And why is "format" under "variables"? ๐Ÿค”

#

who made dis? Amateurs!!11oneone

cosmic lichen
#

It's actually in strings

exotic flax
#

Commands to handle arrays and other variables
๐Ÿ˜‰

cosmic lichen
#

Guys

#

chill

cosmic lichen
#

I edited like 1700 pages with new categories

jade abyss
#

Why do we (not) pay you?

cosmic lichen
#

the old ones need to get removed

exotic flax
#

@jade abyss did you check both? Because format is in both ๐Ÿ˜‰

cosmic lichen
#

When all other 500 commands are done I will remove the old categories, then it should only be in strings.

jade abyss
#

bot not in examples!!1111oneoneone

#

Yeah

#

gj there so far man ๐Ÿ‘

cosmic lichen
#

Ty

jade abyss
#

just speaking of it:
Anyone ever had an issue with a wild "!" appearing, after parseText?

cosmic lichen
#

like this parseText! ?

Nope

jade abyss
#
_text = format["<t align='center' font='FONTNAMEBLUB'>%1</t>", "TEXT"];
_ctrl ctrlSetStructuredText parsetext format[localize "STR_SOMESTRINGTABLENAME", _text];
#

๐Ÿค”

cold glacier
#

It's clearly excited to see you @jade abyss

jade abyss
#

Seems like

#

Haven't payed much attention to it, must have rly missed me!

cold glacier
#

xD

#

No weirdness kicking about in the stringtable then?

jade abyss
#

currently checking the stringtable output

fair drum
#

floor(random 100) < 33 will give a 33% chance to fire right?

cold glacier
#

Yeah, should do Hypoxic.

#

Could also save yourself a floor, and do random 1 < 0.33

jade abyss
#

just speaking of it:
Anyone ever had an issue with a wild "!" appearing, after parseText?

_text = format["<t align='center' font='FONTNAMEBLUB'>%1</t>", "TEXT"];
_ctrl ctrlSetStructuredText parsetext format[localize "STR_SOMESTRINGTABLENAME", _text];

Okay... that was unexpected:
The stringtable entry "STR_SOMESTRINGTABLENAME" was "Text: %1!" and has align=left.
When it was merged together with the alight=center part -> It "decoupled" the ! and added it to the left (since it is not inside the _text align definition...

cosmic lichen
jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

ornate marsh
#

having some problems with this line. telePosition is a invisible cube in the centre of a room, and im wanting to teleport all players in that room by using this line of code:

_players = nearestObjects [telePosition, ["Man"], 15, true]; 

The height doesnt matter as its only 1 story, yet if i'm at a certain spot thats like 1-2m near the object, it wont teleport me. Everything else is fine, its just this one line

robust hollow
#

I'd try using CAManBase instead of Man, though I'm not sure it will help. another method could be

_players = allPlayers select {_x distance telePosition <= 15};
ornate marsh
#

would that teleport a zeus as well though? just in case they get too close

robust hollow
#

i assume both would. you can add a condition to prevent moving specific units.

ornate marsh
#

yeah, shouldnt be too much of an inconvenience tbh

fair drum
#

is there a isKindOf for any UAV controllable?

exotic flax
#

unitIsUAV?

#

or to get all UAV loaded: allUnitsUAV (works like allPlayers etc)

fair drum
#

if I had players unpack a mortar in a trigger area, how could I go about checking if it is present? I know that thisList will give an entire array of objects, but should I go about it by checking if the class is in the list? or do some sort of isKindOf or typeOf manipulation

#

this is if the mortar has no variable name obviously cause I'm giving them the backpacks to assemble

cold glacier
#

Add that to the players, wait for them to build it, then check the area it's in.

#

In terms of checking if the object is a mortar, isKindOf is probably your best bet.

fair drum
#

i guess I could add a variable to said mortar using the weapon assembled

#

then check for the variable

cold glacier
#

Why are you wanting to check if a mortar has been assembled in the area?

fair drum
#

just to trigger a objective complete for building it in a specific area. make a full hand holding mission for ace mortars

cold glacier
#

The easiest way I'd probably do that, is wait for the WeaponAssembled event handler to fire, then when a mortar is built, spawn a script to check if it's in the area. Something like _mortar inArea "mortarTargetArea"

fair drum
#

figured out a easier way than that...

{
    if (typeOf _x == "O_Mortar_01_F") then {
        true;
    };
} forEach thisList;
#

for trigger activation

robust hollow
#

that foreach would only return true if the mortar is the last object in the list though. sure you dont want something more like this?

thisList findIf {typeOf _x == "O_Mortar_01_F"} > -1```
fair drum
#

yes that would be much better

quasi cobalt
#

Hey, is it possible to trigger a mission complete when an area as less then x men from whatever faction in it?

#

I can't seem to find anything.

winter rose
#

yes - e.g in a trigger set to "any", count thislist < 10

quasi cobalt
#

Legend. Thanks mate!

surreal peak
#

Is there an event handler for when someone pressses the autonomous button on drones?

#

I want to be able to disable this, using an event handler to automatically disable it is the simplest thing I can think of

winter rose
#

none afaik @surreal peak

surreal peak
#

shame, if you use disableAi would reselecting the button turn the AI back on

winter rose
#

I don't think so

surreal peak
#

aight ty, more testing required it seems

quasi cobalt
#

Lou, when you say set to any do you mean "anybody"?

winter rose
#

mayhaps, I don't use triggers very frequently ๐Ÿ˜„

quasi cobalt
#

Also, do you just full script missions?

winter rose
#

when I do missions, I either place units in the editor or script-spawn them

#

Type: Present

#

@quasi cobalt โ†‘

quasi cobalt
#

No Present option under type ๐Ÿ˜ฆ

#

There is Guarded by OPFOR though so maybe that'll work.

winter rose
#

nope
what is listed in Type?

quasi cobalt
#

Do I maybe have to count the alive ones? count thisList alive < 10 or something? I'll be honest... I haven't really spent much time learning the syntax yet -.-

winter rose
#

it should work like that

#

try maybe this && count thislist < 10 @quasi cobalt

quasi cobalt
#

Thanks!

#

I'm just finishing the end of the missions then I can put the final touches on everything.

#

How do you make it so a trigger isn't activated until all players are in? I can't test with anyone else at the moment but I'm assuming using "vehicle player == heli" as a condition will activate the trigger as soon as the first player enters.

#

allPlayers.... I haven't seen that once up until now -.-

winter rose
#
allPlayers findIf { !(_x in heli) } == -1
vague geode
#

@winter rose You said BIS_fnc_ambientAnim should best be executed server side so I put this into the units init-field (since it is pre-placed in the editor it should be local to the server and that's how it was recommended in the Community wiki). I use spawn in order to add a delay to make sure that the unit is already there before the code gets executed.

The problem is that the unit isn't doing anything now and is just standing around even though it has the right unit insignia which means that the code is actually working.

Any idea how I can make the ambient animation visible for the clients (including JIP) without having dozens of logic entities spawning whenever someone joins the server?

if (local this) then {
  this spawn {
    sleep 60;
    [_this, "REPAIR_VEH_KNEEL","ASIS",objNull] call BIS_fnc_ambientAnim;
    [_this,"Jets_ID"] call BIS_fnc_setUnitInsignia;
  };
};
winter rose
#

so its effect is localโ€ฆ

#

weird? ๐Ÿคจ

vague geode
#

It appears so even though switchMove is used the effects of which are said to be global...

hallow mortar
#

out of curiosity (this isn't causing the problem), why are you including the snapTo parameter, when it's an optional parameter and you're just giving it the value it defaults to if you don't include it?

queen cargo
#

is there some way to "force" grass cutters to actually ... update?
like ... removing grass cutters not always "shows" the grass again

#

(same with moving them btw.)

#

context: looking into a way to make a farming sim mod in arma 3 a reality

warm hedge
#

Farma 3 CDLC?!

exotic flax
#

but to answer you question; I believe the "remove clutter" feature in Arma is engine based, since it also works when placing objects etc. (and the grass cutter is just an empty object).
I could be wrong though...

queen cargo
#

yeah .. that much i already found out during "research" sadly ๐Ÿ˜„

oblique arrow
#

I think you can make the engine update that by placing an object nearby but I'm not sure about that @queen cargo

#

atleast in 3dent hat did the trick iirc

queen cargo
#

that ain't enough sadly ๐Ÿ˜…
just refreshes that seemingly at random

winter rose
#

Move away, then come back :p

compact maple
#

Hi, how would you save the inventory of a player in a relational database ?
I got a player table, and I tought of creating a gear table and sub_gear table, gear would be things such as uniform, backpack, headgear
Subgear would be anything that can fit in a container such as ammo
Idk what is the most optimized way to do this

vague geode
#

out of curiosity (this isn't causing the problem), why are you including the snapTo parameter, when it's an optional parameter and you're just giving it the value it defaults to if you don't include it?

@hallow mortar Oh, that's just a relic because I tried having it snap to something before to see whether that would fix it.

exotic flax
#

@compact maple we just stored the output of getUnitLoadout as a string in the database, and use setUnitLoadout in-game after getting the data

compact maple
#

I didnt saw that function, thank you

random loom
#

Is it possible to somehow detect if an error is displayed on the screen, and what it says? Trying to create some automated config tests.

winter rose
#

nope afaik (though maybe an idd or idc might be something doable?)

random loom
#

Yeah, that is sort of what I'm currently thinking

winter rose
#

buuut you can use some community tools that intercept exceptions?

random loom
#

Probably possible, but I'd like to avoid creating dependencies or extensions.

compact maple
#

But the function getUnitLoadout do save ammos depends on what containers theyre in i.e uniform back pack vest?

#

Or will setUnitloadout randomly add it to containers

winter rose
#

dunno (I think it does check the container), but you can check ๐Ÿ™ƒ

ebon citrus
#

It does

#

The containers are individual objects within the array

#

Each item/magazine is saved within the object

#

If you explore the output of getUnitLoadout a little, this would be evident

#

Effectively, setunitloadout will create a carbon copy of the loadout you pass it

compact maple
#

Nice! Thanks:)

surreal anvil
#

Hi guys! I was planning on making a rebreather for a helmet. Question is, does it have to be in a specific slot in order to give unlimited breath or can it be in any slot as long as the correct code is in place?

cold glacier
#

context: looking into a way to make a farming sim mod in arma 3 a reality
@queen cargo I suggested this as a joke damnit ๐Ÿ˜‚ . Although I would actually really like to see it, and seriously considered doing a gamemode around it xD

In terms of grass cutting... What about fishing around for a modeller to make a spawn able grass object with animation sources for cutting? I imagine spawned grass would be much more flexible than using the grass that's already there.

queen cargo
#

it is more about being able to "regrow" and remove the existing grass here

#

preparing areas etc. also is required

#

long story short: currently in the POC phase, in case someone wants to actually do the whole animation and texture stuff tho, feel free to DM me

cold glacier
#

Yeah, I'm just wondering if there's insufficient control ever existing grass/foliage. You almost want placeable fields.

tough abyss
#

does anyone know the scripting for menus in vanilla arma 3?

#

like you activate a certain trigger and your mouse appears with a menu

#

and you can select different options

ebon citrus
#

Also, it sounds like youre talking about dialogs

#

here's a guide

robust brook
#

anyway to see a child control from a parent control in the GUI editor?

ornate marsh
#

_playersPaP = allPlayers select {_x distance telePosition <= 15}; this doesnt seem to work. Wanting to select all players in a a certain area

#

_playersPaP = nearestObjects [telePosition, ["Man"], 15, true]; this works, but it doesnt cover the whole area. If im like directly under it or in the opposite corner of the room it doesnt work

#

nevermind, fixed it

ebon citrus
#

yeah, select doesnt work like that

#

use this instead

winter rose
#

yeah, select doesnt work like that
wat? well, yes it does? ๐Ÿค”

little raptor
#

Yep

#

It does

winter rose
#

see Alt Syntax 5 @ebon citrus

#
private _allOpfor = allUnits select { side _x == opfor };
ebon citrus
#

what is the need for that syntax ๐Ÿ˜…

#

but yeah, it seems like it works like that nowadays

winter rose
#

โ€ฆa filter?

little raptor
#

It has a lot of purposes

ebon citrus
#

i've been using apply for ages like an idiot

little raptor
#

apply is different

winter rose
#

like, poopton of usage yes ๐Ÿ˜„

little raptor
#

apply doesn't filter

#

unless you do something boring

#

and lengthy with it

#

like apply {if (true) then {a} else {-1}} and then removing that [-1]

ebon citrus
#

you can filter with it, yeah

#

not the best way

#

but good to know this

#

thanx Lou!

#

now i can stop being an idiot and actually go and rewrite like 60% of my scripts with this change

winter rose
#
private _array = [1,2,3];
_array select { _x > 2 }; // [3]
_array apply { _x > 2 }; // [false, false, true]
```yup
ebon citrus
#

or just use deleteAt with find

#

but yeah, lengthy

#

far less efficient than select

little raptor
#

you shouldn't use deleteAt with apply

#

It changes the array

ebon citrus
#

after the apply

little raptor
#

Even after

ebon citrus
#

you build a list of elements that dont fit and delete all those elements from the original array

little raptor
#

unless there's one element, you shouldn't use deleteAt in a loop

#

You can test it if you want

#

You'll see what I mean

ebon citrus
#
Apply here to build the list;
Delete elements according to list```
winter rose
#

deleteAt 2 // delete at 2
deleteAt 3 // delete at 4 (from the original array)

ebon citrus
#

which is why you loop the find outside the apply

#

build a list of elements

#

not a list of indexes

#

but YES

#

select alt syntax 5 is ALOT BETTER

#

and the way to go

#

im just arguing what i've been doing

jade abyss
#

OR:
Start from the end ๐Ÿ˜„

ebon citrus
#

you know what

jade abyss
#

Yeps

ebon citrus
#

im just gonna go and farm cabbages

jade abyss
#

๐Ÿ‘

ebon citrus
#

ya'll can deal with this scripting stuff

#

im not made out for it

#

๐Ÿ˜…

jade abyss
#

๐Ÿ‘

#

๐Ÿ˜„

winter rose
#

naaah, you're just farming for compliments here :p and you might have them, ya sneaky bum!

little raptor
#

that's weird

#

I just tested this:

_a = [1,2,3,4,5,6,7];
{
if (_x mod 2 == 0) then {
_a deleteAt _forEachIndex
}
} forEach _a;
_a

And it works (?!)

#

It didn't use to

#

Have they changed something here?

#

I think forEach loops properly though an array now

jade abyss
#

try with 3

little raptor
#

what do you mean?

jade abyss
#

if (_x mod 3 == 0)

little raptor
#

works

#

gives:
[1,2,4,5,7]

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

winter rose
#

dang, they fixed that magic

little raptor
#

@still forum ๐Ÿ‘†
Am I going crazy?! Or have you guys fixed it (sorry for the ping)

still forum
#

no ping

little raptor
#

I was just curious. Sorry

winter rose
#

DID YOU NOW ๐Ÿ‘€

#

Mason! What do the numbers mean!!?

little raptor
#

It is both a good thing and a bad thing

#

If you do:

_a = [1];
{
_a pushBack 1
} forEach _a;

You'll end up with an infinite loop!

#

I don't know how I feel about that! ๐Ÿ˜•

#

This doesn't work:

_a=[1,2,3,4];
{
_a deleteAt _forEachindex
} forEach _a;
_a

I expected to get an empty array, but it returns [2,4]

#

Also tried with deleteAt 0 and I got [3,4]

#

๐Ÿคทโ€โ™‚๏ธ

#

If you later see this message Dedmen, can you please explain what's going on here?! (I'm not pinging you this time)

#

I think it's a bug

still forum
#

@little raptor wasn't changed, and it'll skip every second element

#

why explain

#

isn't it logical enough?

little raptor
#

why does this work?

_a = [1,2,3,4,5,6,7];
{
if (_x mod 2 == 0) then {
_a deleteAt _forEachIndex
}
} forEach _a;
_a
still forum
#

deleteAt skips every second element

#

but because of the mod 2, you only delete every second element

little raptor
#

mod 3 works too

still forum
#

yes

#

delete
skip
false
true - delete
skip
false
true - delete

little raptor
#

oh

#

that I didn't realize

#

Thanks for the explanation

winter rose
#

yeah, realised later ๐Ÿ˜„

little raptor
#

lol yeah!

#

Bad test code! ๐Ÿ™ƒ

winter rose
#

too good to be true :p

quasi cobalt
winter rose
#

congrats! if you want to advertise it, you can move it to #production_releases, players will see it better ๐Ÿ˜‰

quasi cobalt
#

โค๏ธ

#

Likely not good enough to waste peoples time with haha

orchid stone
#

i need saved from myself. please tell me there is a better way to exit


switch(_test) do {

   case CIVILIAN: {if(1==1)exitWith {}};

}

... stuff to do if _test != CIVILIAN```
winter rose
#

O__o

orchid stone
#

i have other evaluators

robust hollow
#
if (_test isequalto civilian) exitwith {};```
?
orchid stone
#

but.... i just need a simple exit lol

#

eh i guess i need to add more context

#
        case WEST: {
            _veh = "B_T_VTOL_01_infantry_olive_F";
            _units = ["B_T_Recon_Medic_F","    B_T_Recon_F","B_T_Soldier_AAA_F","B_T_Soldier_F","B_T_Soldier_F"];
            _spawnpos = [worldsize,worldsize,0];
        };
        case EAST: {
            _veh = "O_T_VTOL_02_infantry_F";
            _units = ["O_medic_F","O_engineer_F","O_Soldier_AA_F","O_Soldier_A_F","O_medic_F"];
            _spawnpos = [worldsize,0,0];
        };
        case INDEPENDENT: {
            _veh = "I_Heli_Transport_02_F";
            _units = ["I_Soldier_SL_F","I_Soldier_AT_F","I_Soldier_AA_F","I_medic_F","I_Soldier_SL_F"];
            _spawnpos = [0,0,0];
        };
        case CIVILIAN: {if(1==1)exitWith{}};
    };```
winter rose
#

@robust hollow's avatar says it all ๐Ÿ˜… ๐Ÿ˜‚

orchid stone
#

i would rather not add unecessary evaluations

robust hollow
#

scopeName "root";

switch _test do {
    case civilian:{breakOut "root"};
    case west:{...};
    case east:{...};
    ...
};


...
winter rose
#

case CIVILIAN: {}; ? or even nothing?

orchid stone
#

perfect, ty

#

no there is more code afterwards

#

connor's example works

#

ty sir!

winter rose
#

not placing case civilian is even faster ๐Ÿคจ

robust hollow
#

he wants the script to exit and not run code after the switch too though

#

though an exitwith above the switch would have worked too

orchid stone
#

ya it would have, but i would rather evaluate the side once

winter rose
#

well yep
oh, and breakOut can stop the current script?

robust hollow
#

exits the scope with that name

orchid stone
#

connor got it. tyty

robust hollow
#

so same as exitwith if breaking out of the top level scope

winter rose
#

noice. I kinda despise breakTo/breakOut, as it's a kind of goto ๐Ÿ˜„
but they ofc have their use in some cases

queen cargo
#

cough cough return cough cough

winter rose
#

that's the closest we have, with the alternative syntax yes

#

but here, a if/exitWith is the more readable solution

queen cargo
#

shameless self advertisement
with proper alt syntaxes like SQC, that is even a proper solution

orchid stone
#

thats why i was thinking if(1==1)exitwith{}

queen cargo
#

(plus exitWith is not leaving the current call scope)

orchid stone
#

it looks rediculous

#

but functional

queen cargo
#

if(1==1)exitwith{} can be reduced to if true exitWith {}

winter rose
#

exitWith in switch would have broke out of the switch scope I believe? not the script itself?

orchid stone
#

lemme try

queen cargo
#

not sure actually

orchid stone
#

i got it up now, sec

#

ya doesn't work

#

dang

winter rose
#

anyway, an if (_test == civilian) exitWith {} before the switch is better

queen cargo
#
switch (1) do {
case 1: { if true exitWith {}; }
systemChat "foo";
};
systemChat "bar"```
#

would expect this to print "bar"
but might also print "foo" and "bar"

winter rose
#

(breakOut forces you to read scope names to know where it breaks)

queen cargo
#

(unless you just do scopeName "__function" everywher :P)

orchid stone
#

ya i was reading about it. not sure im crazy about it

#

guess im evaluating side twice

robust hollow
#

it isnt heavy enough to notice

winter rose
#

switch will evaluate side multiple times anyway

#

how do you think it is comparing it to each cases ^^

robust hollow
#
11:00:56 Error in expression <do { 
case 1: { if true exitWith {}; } 
systemChat "foo"; 
}; 
systemChat "bar">
11:00:56   Error position: <systemChat "foo"; 
}; 
systemChat "bar">
11:00:56   Error Missing ;

#

o, i should have read that first ๐Ÿคฆ

#

only prints bar

queen cargo
#

*you might have to fix things i failed at typing in discord ๐Ÿ˜›

orchid stone
#

i would expect it to drop into the first match

#

and not evaluate the rest

winter rose
#

@orchid stone it compares to every case until it find a true comparison

orchid stone
#

exactly

queen cargo
#

kinda what Zacho40 said

orchid stone
#

ok i get the point

#

just add it at the end

orchid stone
#

it would be the 4th evaluation anyway

#

got it

queen cargo
#

the last one will take the longest to execute, the first not

orchid stone
#
        case WEST: {
            _veh = "B_T_VTOL_01_infantry_olive_F";
            _units = ["B_T_Recon_Medic_F","    B_T_Recon_F","B_T_Soldier_AAA_F","B_T_Soldier_F","B_T_Soldier_F"];
            _spawnpos = [worldsize,worldsize,0];
        };
        case EAST: {
            _veh = "O_T_VTOL_02_infantry_F";
            _units = ["O_medic_F","O_engineer_F","O_Soldier_AA_F","O_Soldier_A_F","O_medic_F"];
            _spawnpos = [worldsize,0,0];
        };
        case INDEPENDENT: {
            _veh = "I_Heli_Transport_02_F";
            _units = ["I_Soldier_SL_F","I_Soldier_AT_F","I_Soldier_AA_F","I_medic_F","I_Soldier_SL_F"];
            _spawnpos = [0,0,0];
        };
    };

    if((_this select 1) == CIVILIAN) exitwith{};```
#

so thats basically the same thing

winter rose
#

โ€ฆthis is in these moments I realise we spent way a ridiculous amount of time analysing/benchmarking this game xD

queen cargo
#

biggest issue with execution times is the amount of actual instructions required

winter rose
#

we have a wiki page for everything!

#

@orchid stone place it before the switch

queen cargo
#

the if for example is faster, because less stuff is done simply

orchid stone
#

got it

#

makes sense

#

wow that topic was way more interesting than i expected, thanks guys lol

vague geode
#

Is there a way to identify which server a script is running on?

Like e.g. by getting and comparing server IPs...

winter rose
#

there is serverName

vague geode
#

@winter rose Do you ever sleep? I worried about your health, mate.

Still thanks for the tip.

winter rose
#

I happen to sometimes :-]

vague geode
#

I am asking because it's about 4 am here and I have seen you here all day long and the only reason I am here at this hour is because I just woke up due to rain...

winter rose
#

I played an MP games with friends until 2 then I fixed earlier mistakes I made on the wiki due to a regex, all solved now. But I don't work on Fridays, so there is that ๐Ÿ™‚
Thanks for your concern! ๐Ÿ‘

fair drum
#

any neat stuff I can do with VSC that I should know?

#

outside of the normal extensions

twin steppe
#

I attached a ED-1 onto an offroad and then added weapons to the ED-1 with addWeapon/addMagazine. My question is why my missiles are being shot from the ED-1, but not actually appearing.

#

I can see the smoke and hear the sound of them being fired, but they never actually appear. It's very strange. Does addWeapon not work when it's on a vehicle already attached to another vehicle?

winter rose
#

it does, since they are fired
check unattached?

vague geode
#

Is there any way to let an NPC do a move in an infinite loop? (It would be great if the solution would take global effect since the effect of BIS_fnc_ambientAnim appears to be local)

winter rose
vague geode
#

That causes the unit to go into a loop?

winter rose
#

no, use animation done EH along with this

exotic flax
#

Would there be any reason why a script doesn't run properly, but doesn't return errors either? ๐Ÿค”

// some code
diag_log ">> before switch"; // returns ">> before switch"
diag_log format ["-- %1", _mode];  // returns "-- Init"

switch _mode do {
   case "Init": {
      diag_log ">> Init"; // doesn't do anything
      // some code, doesn't run
      diag_log ">> Init - done"; // doesn't do anything
   };
   // more code, doesn't run
};
// more code, doesn't run
winter rose
#

_mode being undefined on switch? (yet still displaying)
otherwiseโ€ฆ idk
maybe some unclosed { }

exotic flax
#

The log is right before the switch, no code in between, so it should be there...
And if it would miss a bracket or other code it should give some error (and yes, errors are shown and logged)

#

Guess I'll have to debug line by line to figure out where it goes wrong ๐Ÿคฏ

#

although it's a copy from a BIS function, so it should work...

winter rose
#

a wrong case somewhere? (switch-case are case-sensitive btw, but it doesn't explain why it would stop code after the switch)

shell cipher
#

we have a wiki page for everything!
@winter rose I can't seem to find a page for mines, any chance you know of one?

winter rose
#

a mine? not personally, every time the relationship ended in an explosion

#

@shell cipher mines, on which topic?

shell cipher
#

how to setup/config entries

#

I can find bits and pieces and work out from official mines but something aren't adding up and was hoping to find more info

winter rose
#

we don't have a page on the wiki for everything ๐Ÿ˜ญ it was a figure of speech

if you have data, be sure to provide it in #community_wiki so we group the info on a brand new page ๐Ÿ™‚

shell cipher
#

๐Ÿ‘Thanks for the help

vague geode
#

no, use animation done EH along with this

@winter rose On the Community wiki it says that that event handler isn't getting triggered by switchMove...

winter rose
#

where?

vague geode
#

where?

@winter rose Quote:
Killswitch: "This command will not cause an AnimChanged or AnimDone event. However, playMove will."

little raptor
#

You have to use this workaround:

unit switchMove anim;
unit playMoveNow anim;
#

@winter rose Please add this to the wiki too.
This workaround can also fix some animations not playing on a unit (you can put it on playMove/playMoveNow and switchMove pages too)

winter rose
#

โ€ฆI use animDone with switchMove ๐Ÿค”
I'll have to do some tests and edit accordingly

cold glacier
#

Would there be any reason why a script doesn't run properly, but doesn't return errors either? ๐Ÿค”
@exotic flax would need to see more of your code to debug it, as the error in the code you sent isn't apparent!

#

Could always drop it on pastebin or somewhere.

exotic flax
#

Have fun going through 1500 lines of code ;)
Although after debugging it line for line (in blocks) I managed to fix it... still no idea why though, or why it never displayed an error...

still forum
#

Just connect debugger and step through the code line by line to see where its going?

exotic flax
#

I'm sure it was a typo somewhere, just strange it didn't give any errors

broken forge
#
  params ["_killed","_killer","_instigator"];
  if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then {
    hint "you ve just killed an independant!";
  } else {
    _unitside = getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side");
    hint str _unitside;
  };
}];``` having some issues with this. Returns the hint saying "2" which should indicate the first part of the if statement works. I think it's down to the isPlayer _instigator thing but i'd have no clue how to fix it
still forum
#

getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2
why not just
side _killed
or
side group _killed ?

broken forge
#

taking this from an old forum post and trying to integrate it into a mission ๐Ÿ˜›

#

any clue on how i'd go about fixing the if statement?

still forum
#

I don't even know what's broken

#

have you tried logging _instigator?

broken forge
#

what would that entail?

rain mural
#
if (isPlayer _instigator) && (side _instigator == "resistance") {...}

I imagine that would solve it if it was broken

broken forge
#

hint _instigator?

winter rose
#

str

broken forge
#

oh ye, forgot about that ty

#

returns "<NULL-object>"

still forum
#

hint and diag_log

#

null object won't be a player

#

I guess you should fallback to using _killer if _instigator is null

broken forge
#

okay, _killer returns "R Alpha 1-3:1" which i presume is the player character. But i still have no clue why that wouldn't activate the first part of the if statement

rain mural
#

How come I am unable to take a value from the array and use it with playMove?
Obviously I am overlooking something but it just shows "Playing: Any".

_animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];
hint format ["Playing: %1", _animsArray];
jumpCoordinator playMove _animsArray;
still forum
#

does hint display the correct thing?

#

Ah any

#

ANy means undefined variable

#

but if that really is your whole code, then that looks good to me

rain mural
#

Nah, it shows up as "Playing: Any" and I get a "Generic error in x" or something like that

still forum
#

"Any" means undefined variable. But your code looks correct

rain mural
#

This is the entirety of this function file. It is called on activation of a trigger using player call JC_fnc_aiAnims

_isInTrigger = player inArea paraTrigger;
_animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];
if (_isInTrigger) then {
    [] spawn {
        sleep 0.5;
        hint format ["Playing: %1", _animsArray];
        jumpCoordinator playMove _animsArray;
    };
};
still forum
#

yeah the variable _animsArray is undefined

winter rose
#

ta-daaa

rain mural
#

Oh

#

Not in scope

still forum
#

"spawn" creates a completely new script instance, it doesn't know about your local variables that once existed

rain mural
#

๐Ÿคฆโ€โ™‚๏ธ

#

Haha cheers ๐Ÿ˜›

broken forge
#

got it working, moved to init.sqf

tired delta
#

hey i got a problem with my if operator. When i try it it gets an error "missing ) "

#

_number = floor random 100; if (_number =< 10) then {};

#

what am i doing wrong ? or am i just dumb.

cold glacier
#

@tired delta You want <=, =< is not an operator. ๐Ÿ™‚

tired delta
#

oof

#

thank you โค๏ธ

#

xD

rain mural
#

So oddly enough, switchMove works however when I use playMoveNow, nothing happens. The AI just plays an idle anim (Not one from the array).
Any thoughts why this occurs? I think I am using playMoveNow correctly ๐Ÿค”

    [] spawn {
        _animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];

        for "_n" from 1 to 10 do {
            sleep 0.5;
            hint format ["Playing: %1", _animsArray];
            jumpCoordinator playMoveNow _animsArray;
            sleep 10;
            hintSilent "";
        };
    };
cold glacier
#

Not sure why it happens @rain mural - but you could try doing a switchMove before your spawn

#

It might be the animation the AI is currently playing can't transition to the next move or something (I'm not super familiar with the animation system)

rain mural
#

I'll give it a shot and see what happens. I'll switchMove 0; to reset the anims

winter rose
#

@rain mural โ€ฆswitchMove doesn't take Number

rain mural
#

Sorry, I meant ""

#

The AI is... locked... switchMove doesn't even fix him ๐Ÿค”

#

I am going to try giving switchMove an anim rather than " " and see if that works

#

Ok so providing an anim fixes it. Not sure why he doesn't change initially though

little raptor
rain mural
#

Ah so I switch to the move then play it?

little raptor
#

yes

#

They don't have interpolations. You have to "jump" to the animation first

rain mural
#

Ah ok. Thank you very much

little raptor
#

Also, you don't have to add a random sleep number like 10. You can get the animation time:

_animTime = -1*getNumber (configFile >> "cfgMovesMaleSdr" >> "states" >> _anim >> "speed");
if (_animTime < 0) then {
  _animTime = -1/_animTime
};
rain mural
#

Oooh ok thanks!

little raptor
#
  • Fixed the code
ripe surge
#

Does anyone have a script that limits turret rotation?

amber lantern
#

If I know the typename of a unit, say "B_Soldier_F" how can I get the parent classes of it?

#

I think that's the reverse of configName

little raptor
#

Do you mean configHierarchy?

amber lantern
#

@little raptor no

#

How do you go from the string "B_Soldier_F to parent classes?

little raptor
#

You mean like "man"?

#

or "cfgVehicles"?

amber lantern
#

hmm I wonder if it's "configName _x == ""B_Soldier_F""" configClasses ( configFile >> CfgVehicles");

#

and then you can call BIS_fnc_returnParents

little raptor
#

So you want to get the config of the soldier?

tough abyss
#

Yo, Iโ€™m looking to create a stupid super weapon (bunch of vehicles combined) and Iโ€™m looking for how

amber lantern
#

@little raptor of arbitrary typename, yes

little raptor
#

what you wrote works

#

altho it has an error

#
"configName _x == 'B_Soldier_F'" configClasses ( configFile >> "CfgVehicles")
#

In v2.0, you also get configOf command

still forum
#

whaaaa the F is that

little raptor
#

If you intend to use that you need to optimize it tho

still forum
#

"configName _x == 'B_Soldier_F'" configClasses ( configFile >> "CfgVehicles")
->
configFile >> "CfgVehicles" >> "B_Soldier_F"

little raptor
#

He says he doesn't know the base config

#

I thought it's a general question

still forum
#

what I wrote is the same as what he wrote

amber lantern
#

yeah it's a general question

little raptor
#

You know like weapons and other stuff

#

@amber lantern

"configName _x == 'B_Soldier_F'" configClasses configFile
#

Maybe this

still forum
#

no

amber lantern
#

but I suppose that if I know it's a unit then configFile >> "CfgVehicles" >> "B_Soldier_F" works

little raptor
#

Then what

#

Yes

#

That's how it's done

still forum
#

if (isClass (configFile >> "CfgVehicles" >> "B_Soldier_F"))
if (isClass (configFile >> "CfgWeapons" >> "B_Soldier_F"))
if (isClass (configFile >> "CfgMagazines" >> "B_Soldier_F"))
but the class could also exist in all 3 of these

amber lantern
#

Hmm I see that the parents returned don't match the asset browser hierarchy

little raptor
#

@still forum Then how do you get the config without even knowing where it comes from?

still forum
#

I just wrote above how

little raptor
#

What if it comes from another class?

amber lantern
#

or names

little raptor
#

Altho it's a good point

still forum
#

What I wrote above is what I wrote

little raptor
#

Most stuff come from cfgAmmo/mag/veh

#

So good point

still forum
#

you either guess, or iterate literally all configs that exist and probably get a dozen hits for your thing and still don't know what it might be

little raptor
#

What I wrote was a general search

amber lantern
#

Is there a way to filter based on the name I see in the asset config?

still forum
#

what you wrote was general search on a single level that is literally the exact same as just

'B_Soldier_F'
just implemented in a stupidly inefficient way

little raptor
#

@amber lantern All vehicles come from cfgVehicles
that's all

#

This includes all objects and units

amber lantern
#

@little raptor yeah I know, just that BIS_fnc_returnParents doesn't match the asset browser names

still forum
#

Maybe just explain your usecase, maybe there's a better way and you are thinking in the wrong direction

amber lantern
#

For example there is no "Zombies" classname

still forum
#

what "asset browser names" ?

amber lantern
#

@still forum if you are in 3den

still forum
#

You mean the categories in editor?

amber lantern
#

yeah

still forum
#

they are categories, they are not config parents

#

they are defined in the Vehicle's "editorCategory" entry

little raptor
#

if you want to search for "zombies", then:

"getText(_x >> 'displayName`) == 'Zombie'" configClasses (configFile >> "cfgVehicles")
still forum
#

editorSubcategory = "EdSubcat_Helicopters";
for example. That's in "Helicopters"

little raptor
#

Altho if you want editor classes that's different

#

What dedmen wrote

still forum
#

what are you trying to do? what's the use case?

little raptor
#
"'zombie' in toLower getText(_x >> 'displayName')" configClasses (configFile >> "cfgVehicles")
amber lantern
#

@still forum I want to randomise the units I spawn

still forum
#

the editorSubcategory is a classname, you probably want to search in its displayname

winter rose
#

isKindOf? ๐Ÿ˜„

amber lantern
#

ie I need a list of all the type names

#

And I'm not in a thousand years going to write them out by hand

still forum
#

all the type names
of a specific faction/side?

amber lantern
#

yeah

little raptor
#

Just go through all cfgVehicles and filter them by side and type

still forum
#

look in config viewer for "CfgEditorCategories"

#

in there you have a list of all categories

little raptor
#
{

} forEach ("true" configClasses (configFile >> "cfgVehicles"))
amber lantern
#

Thank you so much for the help so far btw

still forum
#

find the classname of the category that you want in CfgEditorCategories, and the subcategory in CfgEditorSubcategories
for example if you want all "Structures -> Village"
the category is "EdCat_Structures"
and the subcategory is "EdSubcat_Residential_Village"

Then find all vehicles in that category that are listed in 3den

("
getNumber (_x >> 'scope') == 2 &&
{getText (_x >> 'editorCategory') == 'EdCat_Structures' && 
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
 configClasses (configFile >> "cfgVehicles"))
#

tadaa all spawnable objects in Structures -> Village

#

And you could also do things like

#
("
getNumber (_x >> 'scope') == 2 &&
{toLower getText (_x >> 'editorCategory') in ['EdCat_Structures', 'EdCat_Structures_Malden', 'EdCat_Structures_Enoch'] && 
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
 configClasses (configFile >> "cfgVehicles"))

get all spawnable objects in
Structures -> Village
Structures (Malden) -> Village
Structuers (Livonia) -> Village

little raptor
#

what you wrote is wrong

#

You wrote tolower but the values have uppercases

broken forge
still forum
#

yep, that

broken forge
#

how would i go about changing it?

still forum
#

@broken forge its not a variable, its a config entry.
You make your own mod and change it in there

broken forge
#

rip

little raptor
#

It's wrong, what are you pointing at?

broken forge
#

was wanting to make a sort of perk system but guess that idea's out ๐Ÿ˜›

still forum
#

what are you pointing at?
at you telling others what's wrong and what they should fix

little raptor
#
("
getNumber (_x >> 'scope') == 2 &&
{toLower getText (_x >> 'editorCategory') in ['edcat_structures', 'edcat_structures_malden', 'edcat_structures_enoch'] && 
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
 configClasses (configFile >> "cfgVehicles"))
#

Fixed

tough abyss
#

Yo the guys in editor didnโ€™t help so, I wanted to know how to do a script without a trigger, just in mission start

amber lantern
#

@tough abyss you can place it in initServer.sqf

broken forge
#

execVM "script.sqf"

#

i think, or just do init.sqf

little raptor
#

execVM requires params

tough abyss
#

In the files?

#

Arma has cursed me