#arma3_scripting

1 messages Β· Page 389 of 1

edgy dune
#

is there any overloading with the damage EH?

little eagle
#

There is no overloading.

edgy dune
#

hmmm shit i see

#

alright we heres wat im tryna do

#

so theres a tank,I want it so that whenever its hit,the turret doesnt get damaged. My current solution is a while loop that runs till the tank dies and constantly fixes the turret(thats obv bad cause well.....while loop).

still forum
#

If your code is short you can also just show it to us. If your code is somewhat correct that's easier to understand. I can read code better than I can read humans

edgy dune
#

XD aye wait 1 sec

#
_this addEventHandler ["Dammaged", "zbran",0];
#

pretty sure

#

im like wrong

#

like 1000 diffrent ways

#

but

still forum
#

what is zbran?

edgy dune
#

the name of the selection

still forum
#

and what is that 0? addEventHandler takes 2 elemens in the array

edgy dune
#

the 0 is supposed to be how much damage "zrbran" takes

#

oh

#

array

still forum
#

yeah that's not at all how it works

edgy dune
#

XD

still forum
#

the second argument is a script that get's called when damage happens

edgy dune
#

oh shit,okay lemme see then

#

ahhhhh it works

#
_this addEventHandler ["HandleDamage",{
(_this select 0) setHitPointDamage ["zbran",0];   //the part that I wana heal,also this prob isnt how u comment XD
(_this select 0) setHitIndex [27,0];                 // idk set hit to not hit cause y not?
damage (_this select 0)+((_this select 2)/2)        //reduce dmg taken by half cause test reasons
}];   
hint "test"; //wow a hint 
#

heres the code if u wanted to see XD

gaunt root
#

Oooo he said a bad word lol

#

Lmao

still forum
#

Dude...

#

Go away.

#

Thanks.

gaunt root
#

He broke rule where are the threats against him

still forum
#

He is not an arrogant idiot.

gaunt root
#

Still broke a rule

plucky willow
#

who what?

gaunt root
#

Even if I’m an idiot

still forum
#

You already got your 3rd chance. And now you are fucking up again. I don't think you'll get a 4th one. maybe you do.. If you stop now.
If you just want to provoke so you get banned. You'll get what you want. We have people like you every second day... And they are usually gone after a few hours or minutes

plucky willow
#

whats going on here?

halcyon crypt
#

probably someone being an ass 😁

sterile parrot
#

The Discord has attracted another of the lowest common denominator who has an extremely hard time functioning around other people in a meaningful way ....or what marceldev said ....LOL

still forum
#

Please just ignore. He'll get banned most likely if he argues once more. So please don't provoke him

plucky willow
#

if i spawn a missile thats capable of locking on, is there a way to make it travel as if it locked onto something?

austere granite
#

no

plucky willow
#

rip 😦

#

should i bother making some ridiculous direction change script or would that not be feasible

little eagle
#

Depends on how good you are.

plucky willow
#

what i meant was, would the direction change be faster than a jet and actually work

little eagle
#

Do you want to kill the jet no matter what?

#

Because the problem would not be making the missile track. It would be having the missile be influenced by flares and not turn unrealistically quick etc.

plucky willow
#

the missile leaves the object distance limit so i just cheated with setdamage

little eagle
#

Lame. Wait, I'll write something.

plucky willow
#

lol not necessary unless you really want to

little eagle
#
commy_fnc_fireMissile = {
    if (!isNil "commy_missile") exitWith {};

    params [
        ["_origin", objNull, [objNull, []], 3], 
        ["_target", objNull, [objNull]]
    ];

    private _type = "M_Titan_AA";

    if (_origin isEqualType objNull) then {
        private _size = sizeOf typeOf _origin;
        _origin = eyePos _origin;
        _origin = _origin vectorAdd ((_origin vectorFromTo getPosWorld _target) vectorMultiply _size);
    };

    commy_missile = _type createVehicle ASLToAGL _origin;
    commy_target = _target;

    private _fnc_guide = {
        private _missile = commy_missile;
        private _target = commy_target;

        if (isNull _missile) exitWith {
            removeMissionEventHandler ["EachFrame", _thisEventHandler];
            commy_missile = nil;
        };

        private _vdir = getPosWorld _missile vectorFromTo getPosWorld _target;
        private _vlat = _vdir vectorCrossProduct [0,0,1];
        private _vup = _vlat vectorCrossProduct _vdir;

        private _speed = vectorMagnitude velocity _missile;
        private _vel = _vdir vectorMultiply _speed;

        _missile setVectorDirAndUp [_vdir, _vup];
        _missile setVelocity _vel;
    };

    call _fnc_guide;

    addMissionEventHandler ["EachFrame", _fnc_guide];
};

[player, heli1] call commy_fnc_fireMissile;
#

There. A bit longer than what I wanted, but it works.

plucky willow
#

very nice

little eagle
#

Nothing more fun than blowing up aircraft with missiles.

plucky willow
#

quick question why do you ASLToAGL when you create the missile

little eagle
#

Because createVehicle expects AGL.

#

And vector math has to be done in a flat topology. Only ASL / World is flat.

#

Careful with createVehicle though. The other syntax expects ATL for canFloat = 0; and AGL for canFloat = 1; vehicles. This version doesn't have this problem.

astral tendon
#

disableAI "WEAPONAIM";
Error Foreign error: Unknown enum value: "WEAPONAIM"

#

i never had isue with this, is just a bug form the last update?

blissful wind
#
//call line
[[_location], "scripts.sqf"] remoteExec ["execVM", 2];
//getting the param
_location = _this select 0;

using this one in several of my scripts and no problems but on this one script it keep saying the variable _location wasnΒ΄t defined, but i did the _this select 0 like on others scripts i wrote...sometiems it works fine 2 or 3 times in a row and then it doesnΒ΄t and the script just halts... any ideas?

#

its passing a location and on the other script on using that location to spawn in an object

little eagle
#

@astral tendon Yes, they tried adding warning for when you use wrong strings (enums), but they messed up and totally legal stuff throws errors.

#

Still works though.

astral tendon
#

@little eagle Thanks for the info.

#

now i also notice that weapons that i put as props on the ground have no magazine in it, is also a bug?

little eagle
#

May be intentional.

plucky willow
#

if the location is a waypoint you need to use quotes

blissful wind
#

no, its the AO marker that was selected randomly.. see it works fine on others scripts and this one too for like 2 or 3 in a row sometimes non at all

astral tendon
#

seens like it already have a magazine in it and i cannot add it

blissful wind
#

sometitmes its fine sometiems its not and i just cant figure this out why its like that on this one script.. tose ae basically the 2 lines of code

#

im going to work around it by creating a global obj at that location and then grabbing its Pos from the otehr script but i rather not have to

#

it pleases me best when i can put as much as possible in the local space

#

it works not but its with the global obj in the mix

astral tendon
#

Well, seens like a bug, if you place a firearm on the ground in the editor it apears with out magazine and if you in game place the weapon on the ground it apears with a magazine

#

and also, the firearm on the ground also already come by default with a magazine in it.

plucky willow
#

ive got a loadout script and it also doesnt place mags in the weapon

#

i prefer it that way though since the default mag isnt always what i want

astral tendon
#

You mean, visualy?

#

because the magazine is catually inside of the gun already, but it does not show on the model

#

when you place on the editor

plucky willow
#

not visually, the weapon is unloaded, you have to load it on mission start

#

i suppose that makes it not a very good script

astral tendon
#

but you cant also remove the magazine from the gun, othewise it gets invisible in the editor and in game

plucky willow
#

not sure what you mean

astral tendon
#

Place a weapon on the ground in the editor and will have no magazine but if you pick it up from the ground it does already have a magazine.

little eagle
#

Yes, and it has nothing to do with the server, Quiksilver. Even happens in SP.

#

It has a bit obscured the allowDamage false part, because of compat with other systems using the command.

#

But you can go back in time and check the older versions.

#

addForce would be interesting, but that wasn't available back then.

astral tendon
#

```Tweaked: Toolkit / Medikit that can be now carried in a vest````

#

but what vest?

little eagle
#

so enable damage, setdamage damage, restore hitpointdamage, disable damage
That's basically it.

#

Here is where it's used. Target event is essentially remoteExec with the box being the target.

#

So sad I had to laugh myself ... while crying. Couldn't stop.

#

Yeah, damage has to be reenabled, otherwise it still floats. It's all really weird and fucked up.

astral tendon
#

No vest in vanila can hold a medikit, neither one in the mod i am running that also got allot of load.

little eagle
#

New mines appear every patch.

little eagle
#

Yeah, damage has to be reenabled, otherwise it still floats.
Actually it wouldn't. I'd work without that too, because setDamage does work when damage is disabled including this fix.

#

Things are even worse. setHit/Index is the thing that doesn't work with disabled damage, so I couldn't restore the original state.

#

And THE FUCKING WIKI CLAIMED IT DOES WORK.

#

AND THEN I CORRECTED IT.

#

AND KK REVERTED IT!!!!

#

sry

subtle ore
#

πŸ€”

inner swallow
#

@astral tendon Confirmed, vests can't hold medikits or toolkits

trail parrot
#

Any way to force a smooth transition into animations where your character is lying on a wall?

#

Dont wanna go with stock ragdoll

inner swallow
#

not via arenal, not via script, not via picking up the item...

astral tendon
#

yup, even in the mod i play have more load than the bag i have, its seens like it mean to not be placed that in the first place, like they lock it

#

the medickit tough seens more lightweigth

#

or that is just my impression.

#

is there a way to detect if the player have a especific mod installed?

little eagle
#

isClass (configFile >> "CfgPatches" >> "ACE_Main")

still forum
#

Because KK has been doing a lot of shit and everyone thought "He has to be right! he is KK!" And then everyone copied his shit

little eagle
#

That was the moment I decided I didn't like him. I like everyone by default unless they give me reasons to no longer do.

still forum
#

I turned when KK gave anyone debug console access on any server and caused chaos for the BI devs

little eagle
#

Nah, that was awesome.

still forum
#

And then he had to "fix" it multiple times because he screwed up again

#

And then he left BI and Arma.

plucky willow
#

setDir resets a targets velocity (as a bug i think) maybe you can try that

little eagle
#

I can't remember trying setDir, but I sure did try a lot.

devout niche
#

Wrong section, my bad

little eagle
#

Well if you don't mind the state of the hitpoints being all messed up afterwards you can skip it.

#

But one of the objects draggable in ACE is a lamp. And setHit is used to turn it on and off.

plucky willow
#

what are some fancy ways to display text to the whole server?

#

i dont like hints or cuttext so far

little eagle
#
// initCounter.sqf
params ["_display"];

private _control = _display ctrlCreate ["RscText", -1];

_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];

_control ctrlSetPosition [
    safezoneX + safezoneW - 0.2,
    safezoneY + 0.0 * safezoneH,
    safezoneW * 0.1,
    safezoneH * 0.3
];
_control ctrlCommit 0;

MyMission_Counter = [_control];


//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";

This is objectively the easiest way.

#

_display is the mission display, #46

plucky willow
#

how do i pass in the mission display?

little eagle
#

findDisplay 46 ?

plucky willow
#

what is MyMission_Counter?

little eagle
#

The control.

plucky willow
#

so its just a variable

little eagle
#

Yes, You can name it how you like.

plucky willow
#

safezoneW and H, you multiply those to get 16x9 ratio?

little eagle
#

No? I think dividing safezoneW by safezoneH will give you 4/3 though.

jade abyss
#

@little eagle

MyMission_Counter = [_control];


//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";```
?
little eagle
#

What's the question, Dscha? You use the last line by any other script of course.

jade abyss
#

Okay, i was about to say. Wouldn't have made much sense otherwise

little eagle
#

No one wants to recreate the control just to hide the text or show a different one. Just use ctrlSetText.

jade abyss
#

Of course

#

recreate everything

little eagle
#

The amount of indents worries me.

#

The amount of indents should be inversely proportional to the length of the function.

jade abyss
#

You are inversely proportional

#

Yes?

little eagle
#

Big dick, small brain?

jade abyss
#

Big foot

#

97% of 0 = 0

#

2 boxes πŸ‘

plucky willow
#

@little eagle im getting a serialization error from trying to use the display 46

#

adding disableSerialization; didnt fix it

little eagle
#

Show it.

plucky willow
#

the script?

little eagle
#

Yes.

plucky willow
#

im too embarassed i suck at this

little eagle
#

lol

#

Shall I get my glass bowl?

plucky willow
#
commy2_fnc_displayText = {
    params ["_display","_displayText","_timer"];
    //EXAMPLE: [(findDisplay 46),"hello\nworld",5] spawn commy2_fnc_displayText;
    private _control = _display ctrlCreate ["RscTextMulti", -1];
    
    _control ctrlSetText "hello world";
    _control ctrlSetTextColor [1.0,1.0,1.0,1.0]; //white?
    _control ctrlSetPosition [
        safezoneX + safezoneW - 0.2,
        safezoneY + 0.0 * safezoneH,
        safezoneW * 0.1,
        safezoneH * 0.3
    ];

    _control ctrlCommit 0;
    sleep _timer;
    _control ctrlSetText "";

    //MyMission_Counter = [_control];

    //(MyMission_Counter select 0) ctrlSetText "hello\nworld";
};
#
                _display = (findDisplay 46);
                [_display,"hello\nworld",5] spawn commy2_fnc_displayText;
                ```
little eagle
#

The last part. Is this init.sqf?

plucky willow
#

no

#

the first part is init the last part is from some other script

#

oh i should add, i do see hello world in the top right of the screen

little eagle
#

Change:

                _display = (findDisplay 46);
                [_display,"hello\nworld",5] spawn commy2_fnc_displayText;

To:

isNil {
    _display = (findDisplay 46);
    [_display,"hello\nworld",5] call commy2_fnc_displayText;
};
plucky willow
#

apparently sleep _timer; isnt working

little eagle
#

You're thinking about this the wrong way.

#

Sec.

astral tendon
#

deleteMarker and deleteVehicle are not deleting map markers, what is wrong?

little eagle
#
//init.sqf
commy_Counter = [controlNull];

if (hasInterface) then {
    0 spawn {
        disableSerialization;
        waitUntil {!isNull findDisplay 46};
        private _display = findDisplay 46;

        private _control = _display ctrlCreate ["RscTextMulti", -1];
        
        _control ctrlSetText "hello world";
        _control ctrlSetTextColor [1.0,1.0,1.0,1.0]; //white?
        _control ctrlSetPosition [
            safezoneX + safezoneW - 0.2,
            safezoneY + 0.0 * safezoneH,
            safezoneW * 0.1,
            safezoneH * 0.3
        ];

        _control ctrlCommit 0;
        commy_Counter = [_control];
    };
};

Step 1 ^

plucky willow
#

so a global variable is better than a function in this case?

little eagle
#
// any other script
0 spawn {
    (commy_Counter select 0) ctrlSetText "COMPUTERCOMPUTERCOMPUTER";
    sleep 5;
    (commy_Counter select 0) ctrlSetText "";
};

^ Step 2

#

You can make a function out of step 2.

#

But the whole part about creating the control should only be done once.

plucky willow
#

i see

little eagle
#

You just reuse the control. This is for MP right? No savegames.

plucky willow
#

right just for MP

little eagle
#

I forgot a command in step 1. : (

#

fixed.

#

Also, why did you remove the green. It was a beautiful green. : (

plucky willow
#

what green?

little eagle
#

ctrlSetTextColor

plucky willow
#

oh, i was gonna use an rgb color picker later

#

but i figured white would be a good test color

#

also white and black are the only ones i know

#

off the top of my head

little eagle
#

You remembered R-G-B and that gives away at least three colors.

#

I have no idea what RscTextMulti is.

plucky willow
#

its the same as rsctext except you can line break?

little eagle
#

Neat.

plucky willow
#

if you could line break in rsctext then i suppose it doesnt matter

little eagle
#

Yeah. Strange to make ANOTHER class for something so basic.

plucky willow
#

well its working, just gotta figure out how these safezones work now

plucky willow
#

i dont get it but ill do some testing

austere granite
#

Need more UI classes

#

all with slightly different behaviour

#

And when we make it so in one ui type you can turn the border off, in the order we won't let you do it!

#

Oh and the one UI type will have a flashing text when selected (because it's 2003), but the other one can't even support it

little eagle
#

Focus on the top left corner, Axle.

#

Then think about what coordinate the bottom right corner is.

#

I stared at this for half an hour and then I got it.

austere granite
#

what is the center coordinate then commy?

#

is that... 0.5?

#

or is it...

#

((getResolution select 2) * 0.5 * pixelW)

little eagle
#

The center is 0.5,0.5

#

Pfh, pixel grid.

#

safezone's where's at.

plucky willow
#

so (safezoneW + safezoneX)/2 is 0.5

#

?

little eagle
#

No, 0.5 is 0.5

#

safezoneX + (safezoneW / 2)
is also 0.5

austere granite
#

safeZoneX is like -0.18 depending on ratio or whatever

plucky willow
#

what are screen measurement units?

#

im so confused

austere granite
#

what's a screen measurement unit?

plucky willow
#

safezonew returns the width of the screen in screen measurement units

little eagle
#

Outer is 4/3. Inner is your sceen resolution.

austere granite
#

ah, the 'unit' is the red box you see in commies picture

#

[safeZoneX, safeZoneY] is topleft corner of screen

little eagle
#

Yes.

plucky willow
#

and theyre negative?

austere granite
#

[safeZone + (safeZoneW * 0.2), safeZoneY] would be 20% from the left side of your screen at the top

#

etc

#

yes but ignore that

little eagle
#

and theyre negative?
Yes.

austere granite
#

all you need to know

little eagle
#

There're left and top of 0,0; so negative.

austere granite
#

is that safeZoneX is left of your screen

#

safeZoneY is top of screen

little eagle
#

Yes.

austere granite
#

safeZoneX + safeZoneW is right screen

#

safeZoneY + safeZoneH is bottom

little eagle
#

Looks right.

plucky willow
#

and all i care about is inbetween

austere granite
#

now that might come up to like -0.18, 1.23423423, 23493242 3.4142424 1488

plucky willow
#

?

austere granite
#

but

#

those numbers don't matter to you

little eagle
#

All you care about is inbetween.

plucky willow
#

and its all relative values

austere granite
#

safeZoneX + (safeZoneW * _inBetween)

#

if that should be 50% (so middle... then 0.5

#

if it should be 100% (so right side of screen, then 1)

#

etc etc

little eagle
#

Obviously you also have to subtract the width of your control from the x position if you want to place it on the right side of the screen.

#

Similar for bottom,

#

You can use the same script I posted and the debug console to play around with ctrlSetPositon and ctrlCommit 0 to experiment with it.

austere granite
#

else you get this

#

etc

#

lets say that box is __WIDTH you wanna do (safeZoneX + safeZoneW - __WIDTH)

#

....

#

ree

little eagle
#

Center:
(safeZoneX + 0.5 * safeZoneW - __WIDTH / 2)

plucky willow
#

well now i see why RSCTextMulti isnt used

#

i get the first line but i assume the second line is an entire screen height lower

little eagle
#

Maybe the control is not tall enough.

plucky willow
#

hrmm

#

how do i make the control taller

little eagle
#

Change it's height.

#

Usually by making it bigger.

#

safezoneH * 0.3

#

->

#

safezoneH * 0.5

#

idk

plucky willow
#

ill give that a try

#

nice, it works

#

i tried putting the second part into a function

#

but it kept erroring out on the sleep part

austere granite
#

Scheduled

plucky willow
#
0 spawn {
    (commy_Counter select 0) ctrlSetText "hello\nworld";
    sleep 5;
    (commy_Counter select 0) ctrlSetText "";
};
#

i had params for 5 and hello\nworld

#
commy2_fnc_displayText = {
    params ["_displayText","_timer"];
    0 spawn {
        (commy_Counter select 0) ctrlSetText _displayText;
        sleep _timer;
        (commy_Counter select 0) ctrlSetText "";
    };
};
#

like so

little eagle
#
commy2_fnc_displayText = {
    _this spawn {
        params ["_displayText","_timer"];
        (commy_Counter select 0) ctrlSetText _displayText;
        sleep _timer;
        (commy_Counter select 0) ctrlSetText "";
    };
};
#

You need to pass the arguments to the scheudled script instance. They lose all locals.

plucky willow
#

could you explain like im 5, i'm really bad at this

little eagle
#
_var = 1;
_var; // 1
call {
    _var; // 1
};
0 spawn {
    _var; // undefined :(
};
#
_var = 1;
_var spawn {
    _this; // 1 !!!
    params ["_var"];
    _var; // 1 :)
};
plucky willow
#

i think i get it?

#

so _this is commy2_fnc_displayText

little eagle
#

_this in commy2_fnc_displayText is whatever arguments you passed to the function.

plucky willow
#

oh

little eagle
#
1 call {
    _this // 1
};
#
[0,1] call {
    params ["_var1", "_var2"];
    _var1; // 0
    _var2; // 1
    _this; // [0,1]
};
plucky willow
#

that makes much more sense

#

thank you very much

little eagle
#

Params is essentially the opposite operator of array creation.

#
[_var1, _var2]
<->
params ["_var1", "_var2"];
plucky willow
#

this is so much better than cuttext

#

cant wait to use it

#

uh oh

#

this is more of an OCD problem, but when i linebreak, the alignment is left instead of center

jade abyss
#

AxleVice - Today at 2:46 AM
could you explain like im 5, i'm really bad at this```
πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚
#

At least, you are honest πŸ˜„ (there are enough there, who won't/can't admit this)

edgy dune
#

hi im namenai and I have the tendency to use while loops because they are less effiecent and costly

calm sapphire
#

Hello, I have a problem that I've been trying to solve for the last couple hours, need some help with what seems to be a pretty simple command

#

Anyone willing to help me out?

#

So

#

I want to create a trigger that activates when a civilian player walks into it. It gives him an RGO grenade and that's it.

#

So far, it seems that putting "player addItem "handgrenade";" gives every player a grenade, so how do I specify that ONLY the person who activates the trigger gets the grenade?

#

Essentially, I'm making a multiplayer mode where it's 1v5 and the five-player side can each pick up exactly one grenade that the enemy player cannot have access to.

tame portal
#

@calm sapphire I dont use triggers but I think you need to put something along the lines of "player in thisList" into the condition field of the trigger

#

However you will need to add a check so that one player doesn't get a grenade twice

meager heart
#

@calm sapphire Name your unit somehow... unit_1
Set trigger activation to unit_1 side //--- BLUFOR/OPFOR ect...
Set activation type: Present
Set condition: unit_1 in thisList
On activation put: for "_i" from 1 to * do {unit_1 addItem "handgrenade";}; hint "Bingo"; deleteVehicle thisTrigger; //--- Replace * with number of grenades you need to add for unit_1
If you need only one grenade: unit_1 addItem "handgrenade"; And try google, he knows everything πŸ˜‰

plucky willow
#

handgrenade is add magazine

#

lemme find it

#

_unit addmagazines ["HandGrenade", 1];

#

swap handgrenade for the correct name for rgo

meager heart
#
The item can also be a weapon or a magazine.
plucky willow
#

my bad

meager heart
#

np

warm gorge
#

Is there any way to workaround the issue of slingloading objects that arent local to you randomly detaching? I've tried setting the object being lifted to local with the event handler, but it doesnt work

meager granite
#

Make it local, wait a second, then sling load

warm gorge
#

I'll give that a go, cheers.

warm gorge
#

@tough abyss

_var isEqualType (text ""); //Is text
_var isEqualType ""; //Is string
#

Like this?

#

That'll work, give it a go

#

fair enough

half relic
#

Does anybody have a script at hand which adds several uniforms specifically without needing to add them individually to a crate? By several uniforms I mean several different uniforms with different classnames.

lament nova
#

Does anybody know how did this guy make IR searchlight?
https://www.youtube.com/watch?v=9ZV5edu4pRI
With the stNVG it's almost needed, and I'm trying to find out how does one do it, but couldn't find anything
Thoughts?

#

It doesn't look perfect in video ofcourse, but just wondering how did he do it in the first place
Maybe it's possible to make it better

still forum
#

A normal light that get's disabled when you turn of your NV goggles

lament nova
#

So it's basically SP thing

#

snap

#

Thanks

still forum
#

you can also do that in MP. But not that easy

little eagle
#

Should be doable with a few dirty tricks.

#

Even in MP.

lament nova
#

Thanks lads for help, that was all I needed πŸ˜ƒ

little eagle
#

Motivation?

lament nova
#

Yeah

astral tendon
#

how do i get the cargo index?

robust hollow
astral tendon
#

some times, i hate google.

#

@robust hollow thanks.

still forum
#

stop using google and search on the wiki instead

astral tendon
#

that also is unreliable.

meager granite
#

cargo index site:community.bistudio.com

still forum
subtle ore
#

@astral tendon how is the wiki unreliable?

meager granite
#

Well sometimes commands are called completely different from what you would expect so googling works better

#

Not in this case though

subtle ore
#

Yeah, but if anything else you can just look at the categories

little eagle
#

He could try using google com, not his local version (Brasil?).

meager granite
#

Added: A new ctrlTextWidth script command (used for getting the width of the longest line of text in a given control)
Actually would be great if it returned width of last non-empty line

#

You already know control width

#

Actually, returning widths of all lines would've been even better so you can easily get longest or last line if needed

#

Had a need for such command some years ago to do background for each line

stiff forge
#

Does anyone know how to make this work - waitUntil {(markerColor "m3000" == "ColorOPFOR")}; I want the script to wait until marker m3000 is red (colourOPFOR)

still forum
#

Looks correct to me

stiff forge
#

Thanks, I just checked and I had made a typo in the script itself

#

How embarrassing

#

habit of spelling it colour and not color

still forum
#

Already noticed that in your message

#

but the code you posted is correct.

#

And you should always copy-paste the exact code you are using. else asking for help is useless if you fix your mistake before you post it^^

astral tendon
#

were i can find a list of vanila hints like the ones in the showcases? i wanna find some related to how to use the mine detector

meager heart
#

@astral tendon Config Viewer > CfgHints

astral tendon
#

@meager heart thanks

astral tendon
#

[["weapons", "minesweep"]] call BIS_fnc_advHint;
does this needs to be called local?

peak plover
#

yes

plucky willow
#

i have a singleplayer script utilizing playerSide but what works best in multiplayer?

meager heart
#

@plucky willow You can try _target call bis_fnc_objectSide

plucky willow
#

also, for multiplayer, i want to know which player executed the script

little eagle
#

player reports the local avatar, Axle.

#

playerSide also works in MP. It reports the side you picked in the lobby.

plucky willow
#

interesting

#

my playerside script works in singleplayer but not multiplayer

#

ill have to look into it further

#

nvm the first line gives it away if (!isServer) exitWith {};

#

gotta remove that

little eagle
#

Interesting line concerning this problem^^

plucky willow
#

yeah i dont usually have locally executed stuff in multiplayer so i overlooked it

tame portal
#

@meager granite Still impressed by your koth UI

half relic
#

KoTH isn't for me but I most certainly respect the effort.

plucky willow
#

i personally prefer realism/milsim, playing with random people isnt for me

meager heart
#

Realism/muslim Β©

#

πŸ‘³ ☝

half relic
#

@meager heart Consider leaving this server.

meager heart
#

Why ? πŸ˜„

subtle ore
#

KOTH was excellently designed, and it scales well. It's just that, it attracts a lot of simple players

little eagle
subtle ore
#

Lovely

meager heart
#

FlyingVolvo - Today at 1:06 AM
@meager heart Consider leaving this server. I offended somebody... somehow ?

barren magnet
#

is the effect of setDropInterval global? / Is a particle source even global ?

little eagle
#

Particlesources are created with createVehicleLocal. Therefore, setDropInterval will only have local effects.

still forum
#

@half relic Consider considering

half relic
#

Heh

meager heart
#

@half relic Sorry if i offended you... somehow

#

Just don't get it

half relic
#

First off, the guy you pictured is a Sikh, second off, your joke wasn't funny, third off, keep that shit out of this discord.

meager heart
#

OK πŸ‘Œ

kindred lichen
#

Is there a reason setvehicleammo 1 didn't work on turrets?

astral tendon
kindred lichen
#

if( isServer) then { Null = [this] spawn { While {true} do { (_this select 0) setVehicleAmmo 1; sleep 30;}; }; };

trying to do this to give some MG42s unliminted ammo.

#

Works on Flak30/38s doesn't work on the mounted MGs.

austere granite
#

setVehicleDefaultAmmo 1;

astral tendon
#

can some one add a note on the isSpeech that also change were the volume settings is set to the radio an not the effect anymore

austere granite
#

also

#

what is (_this select 0)

#

the vehicle?

#

IFA might replace static vehicles

still forum
#

Yeah there is a reason. Sa-Matra talked about that

austere granite
#

they swap vehicle classes around with some of their static mechanics (meaning new vehicle and that script won't apply anymore)

kindred lichen
#

Does the new vehicle keep the same variable name?

#

can i just name them instead?

#

Or is there a better way to keep refilling their ammo, ACE3 AI don't really know how to use ammo crates.

#

O.k. naming it, works

#

if( isServer) then { Null = [this] spawn { While {true} do { mg1 setVehicleAmmo 1; sleep 5;}; }; };

when Mg1 is the vehicle, works.

#

I just used the This thing so I could copy and paste the unit, and not have rename everything.

So I've changed it to 1 script that just hits them all, since I have to name them anyways.

austere granite
#

what is it for?

#

some coop scenario type thing?

kindred lichen
#

Omaha beach.

#

To reload the german MG nests.

austere granite
#

okay

#

give me a min

kindred lichen
#

The alternative was mg42 primaries and carryalls full of Magazines.

austere granite
#

what's the MG classname?

#

don't have game running

astral tendon
kindred lichen
#

Lib_MG42_lafette_deployed
Lib_MG42_lafette_low_deployed

astral tendon
#

this is the one i use for unlimited ammo

#

works on vehicles and turrets

kindred lichen
#

That refills after every shot.

#

no performance hit? and no reloads.

astral tendon
#

so you want unlimited magazines?

kindred lichen
#

Ideally yeah, unlimited magazines, but I just put a 60s timer on it, so They can't shoot continuously, but might run into a extra long mag every once in a while.

#

Pretty sure players won't notice either way.

astral tendon
#
[    
    "Fired", 
    {
        _mag    = _this select 5; 
        _unit    = _this select 0; 
        
        if ({_x isEqualTo _mag} count magazines _unit < 2) then 
        {
            _unit addMagazines [_mag, 3]; 
        }; 
    }
]; ```
#

this one i use for RPG AI guys to have unlimited magazines

#

it will give 3 magazines once it have none

kindred lichen
#

I'm not familiar with it, but do you think there's an issue to performance if I have like 10, MGs firing at the same time, each triggering this call?

subtle ore
#

Why are you using unit inits, again Roque

#

wtf

kindred lichen
#

What's the best way to count the number of a specific object in the world.

subtle ore
#

and _x is a special variable

kindred lichen
#

like if I want to have something happen where there are 5 flags spawned? geist_flag_USA02_f

astral tendon
#

Because im just starting using scripts, but feel free to do it better.

subtle ore
#

why not use init.sqf or initPlayerLoca.sqf ?

astral tendon
#

your experience probably will do it better.

subtle ore
#

why not just learn better practice?

#

I mean, you've been told about it before. But you just don

#

you don't wan't to try?

#

I mean come on, seriously.

astral tendon
#

and why should i give you a reason to everything anyway?

subtle ore
#

Do you have a reason to keep using tirggers and unit inits?

kindred lichen
#

programmers use what they know works.

subtle ore
#

Yes, but Roque has been shown how to execute scripts before

#

The reason why i have a problem with it to begin with is because it promotes lazyness and other people follow soon to do the same thing

#

and we end up with very limited use missions as a result

austere granite
#

@kindred lichen sorry someone was being wrong on the internet, so i had to correct him

#
// -- Keep MG42 full on ammo
[] spawn {
    private _allMachineguns = vehicles select { (toLower (typeOf _x)) in ["lib_mg42_lafette_deployed", "lib_mg42_lafette_low_deployed"] };
    while { true } do {
        {
            _x setVehicleAmmoDef 1;
        } forEach _allMachineguns;
    };    
};

Just put this in init.sqf

#

and you should be good to go

#

uh fuck

#

wat, init.sqf needs that/

#

i haven't used spawn or init.sqf in years.... πŸ˜„

#

no

#

init.sqf

subtle ore
#

or

0 spawn
{

};
austere granite
#

i know unit needs it

still forum
#

no. Scripts in mission boxes "need" that (They don't really. I think CBA fixes that. Again just BI being dumb)

astral tendon
#

I tell you what, i wont give any advice to anywone in this discord, i will let you handle it;

#

are we good now?

kindred lichen
#

That looks like an infinite loop with no sleep.

subtle ore
#

Uhhh...what?

austere granite
#
// -- Keep MG42 full on ammo
[] spawn {
    sleep 3;
    private _allMachineguns = vehicles select { (toLower (typeOf _x)) in ["lib_mg42_lafette_deployed", "lib_mg42_lafette_low_deployed"] };
    while { true } do {
        sleep 30;
        {
            _x setVehicleAmmoDef 1;
        } forEach _allMachineguns;
    };    
};
kindred lichen
#

100%cpu inc

austere granite
#

yeah sorry

#

:p

#

that's what the "uh fuck" was for

still forum
#

throws an apple at @Adanteh#0761

subtle ore
#

throws cookie at Dedmen

austere granite
#

also i don't know anymore if vehicles are availble directly in init.sqf

#

OH

#

AND ADD isServer in there

#

fucking hell

kindred lichen
#

yeah, saw that too.

austere granite
#

well i'm off to bed i guess πŸ˜‚

still forum
#

Go to bed

#

lul

austere granite
#

❀

kindred lichen
#

they're easy things to forget, and don't really affect the script

austere granite
#

like i said, never use init.sqf anymore.

still forum
#

It's been so long since I wrote SQF...

austere granite
#

also there's probably a base class for the MG42 that you could do isKindOf check on in instead....but it's only on mission start and i'm too lazy to fuck it up, so /care

still forum
#

<advertisement>
Intercept is giving CBA the ability to add keybinds to Joystick keys.
And also add's a SQF command to make your gamepad vibrate.
</advertisement>

#

So you can bind your TFAR radio keys to Joystick buttons soonβ„’

subtle ore
#

Where can I sell you my soul Dedmen?

still forum
#

You already did so

subtle ore
#

😱

still forum
#

I should add more "make things vibrate" commands... Would give Arma a new vibe...

austere granite
#

Make sure to sell the vibration data though

edgy dune
#
{
//insert code here
} forEach vehicles;
``` So you know how the code above ^^ wiill loop through all vics,opfor blufor and independent. Is there away to have it just lloop through one side and reduce run time?
little eagle
#

if

austere granite
#

} forEach (vehicles select { side _x == east })

#

oryaknow

#

... just put the if inside the foreach

#

easier

edgy dune
#

well

#

yea

#

but

#

i was gona also do it for infantry

#

and its not that runtime is a issue,id just like to reduce it

#

also the mod that my unit uses,the star wars one

#

memory leaks like no fucking tomorrow cause memes

#

so

#

Im using a script that fixes the tanks,cause the tanks take one shot and their turrets then point down and gets disabled

#

so i have a script that fixes that,gives them a gun that works and chages the texture if ppl want. so in reducing the difficulty with the mem leak and im tryna rreduce run time

#

GG spelling XD

little eagle
edgy dune
#

kek

#

too many words

#

ik

earnest ore
#

wtb a function that spawns a dummy player client at will for JIP testing.

#

Doing my own head in trying to figure out how to add the connected player to a zues' edittable objects list.

daring pawn
little eagle
#

Only ones that are harder to use.

daring pawn
#

Harder to use doesn't really fuss me too much. I'm just trying to save some effort in the long run but making things simpler for edits to what faction I use for my mission

#

rather than manually putting in lists of groups

#

I'm already using configClasses atm to create some arrays of individual units, but having no luck adjusting it to do the same with groups

little eagle
#

configClasses would require the lowest effort to get those units.

daring pawn
#

Yea it was no stress at all to get the individual ones. But when i've tried adjusting it for cfgGroups not cfgVehicles, i'm getting blank return

#
_r = "( 
 {getText (_x >> 'faction') == 'BLU_F'} 
)" configClasses (configFile >> "CfgGroups");
systemChat str(_r);

Is even returning a blank atm

little eagle
#
private _side = "west";
private _faction = "BLU_F";
private _category = "Infantry";
private _group = "BUS_InfSquad";

private _config = configFile >> "CfgGroups" >> _side >> _faction >> _category >> _group;
private _units = ("true" configClasses _config) apply {getText (_x >> "vehicle")};

systemChat str _units;
#

Don't use the code string thing of configClasses and configProperties. It only overcomplicates things.

daring pawn
#

Ah yes see i'm trying to get the "BUS_InfSquad" and whats input is just say the "BLU_F" for example

#

So all i'd have to change per mission for example is just the Faction used

little eagle
#

You want a list of all groups of a faction?

daring pawn
#

Correct

little eagle
#

Just remove >> _group and maybe rename the two _units to _group?

daring pawn
#
private _side = "west"; 
private _faction = "BLU_F"; 
private _category = "Infantry";

private _config = configFile >> "CfgGroups" >> _side >> _faction >> _category; 
private _groups = ("true" configClasses _config) apply {getText (_x >> "vehicle")}; 
 
systemChat str _groups;

With that it gives me an array of "","","" etc

little eagle
#

Do you want the units or the groups?

daring pawn
#

Group names so I could use it with a function like BIS_fnc_SpawnGroup for example

little eagle
#

{getText (_x >> "vehicle")}
to
{configName _x}
for the groups.

daring pawn
#

Ah yes thats done what I want. Perfection. Appreciate it

still forum
#

function? regex

#

replace ], (That has a space on the end) by ],\n

still forum
#

yeah

#

regex

#

bottom left in the replace dialog

jade abyss
#

tonight?

bold timber
#

Guys, I need a code optimization tip.
My mod is using a custom random number generator for vehicle plates, the function is called in every init Eventhanlder (I check inside the func if the vehicle is local) and a config parameter must be in every vehicle (FFAA_numerales[], which determine how number will be generated (color, font etc) where I want generate those numbers.

Would be better if I call this function with postInit = 1; and by doing a foreach AllUnits checking if the parameter exist, and if so, call the above function?

In this way I could remove the Init Eventhandler of every vehicle because in fact it will eventually be called by whoever is calling the PostInit function.

still forum
#

But postInit doesn't catch vehicles that spawn later on

#

allUnits is overkill since soldiers don't have number plates

#

Usually

little eagle
#

Init is better for this.

bold timber
#

πŸ€” Ops, that's true, it doesn't catch the laters

little eagle
#

In every way.

still forum
#

Init on ground vehicles. And if the lag is too much just move to scheduled

bold timber
#

@still forum Ok I'll remain the same approach then. And will move to scheduled enviroment

little eagle
#

Do you have perf problems with it?!

bold timber
#

No, just to remove the class Eventhandler parameter πŸ˜‚

little eagle
#

Everything you suggested would make it worse. The init eventhandler is perfect for this. Why would you want to get rid of class Eventhandlers? Makes no sense to me.

bold timber
#

Doesn't matter, I think I was thinking in the bad way, sometimes I want get rid of unnecesary parameters to make a short config file but this isn't the case.

little eagle
#

Sounds to me like you're about to go out of your way to make something worse for absolutely no reason or benefit.

bold timber
#

Nah, I'll remain it as before. I can apply the "If it ain't broke, don't fix it" πŸ˜…

little eagle
#

"If it ain't broke, don't wreck it".

bold timber
#

hahaha

jade abyss
#

"never touch a running system" ?

little eagle
#

Yes, don't put your hands between running cogwheels.

proven crystal
#

i disagree: if it aint broken, break it!

vestal mortar
#

would anyone know what this means?

Call extension 'extDB' could not be loaded: %1 is not a valid Win32 application.

little eagle
#

Where does this come up?

queen cargo
#

Probably 64vs32 bit conflict

little eagle
#

But would the game report it like this?

vestal mortar
#

its in the rpt logs of tadst

little eagle
vestal mortar
#

yeah i didnt know where to put it sorry

proven crystal
#

i have a question regarding CBA taskpatrol and tasksearcharea

#

do i understand correctly that the difference is that taskpatrol, fixes the waypoints, while searcharea, randomly generates new waypoints?

jade abyss
#

Would make sense

proven crystal
#

also i think one uses MOVE the other is SAD

#

i am trying to get the searcharea one to work and let the dudes search buildings after the waypoints

#

apparently i can give the thing a string fo code

#

for taskpatrol i have an example how that could work.

#

but that doesnt appear to do the job for seracharea

#
[_group, _destination, "AWARE", "YELLOW", "FULL", "STAG COLUMN", "this call CBA_fnc_searchNearby", [3,6,9]] call CBA_fnc_taskSearchArea;
#

in theory that code should be executed on every waypoint....

#

im not sure if that is actually what it does...

little eagle
#

Have you read the function header?

proven crystal
#

oh crap. searcharea searches buildings automatically

#

so im basically messing things up

#

thanks for that hint.

#

is there a way to stop the generation of new waypoints?

little eagle
#

It says "indefinitely", so I don't think so.

#

But you could always copy paste the function and adjust it.

#

Just have to replace the script_component include with #include "\x\cba\addons\ai\script_component.hpp", so it finds the right file.

proven crystal
#

Sounds complicated. Might use takspatrol instead. That works by adding a series of waypoints with cycle. Then i could just delete waypoints to stop them

#

And if i want less predictable waypoints, i can just run the funktion in a loop for the randomness i think

little eagle
proven crystal
#

Yep, saw it. But i think with the patrol function i might get the same effect with less code copying

#

Not sure though, is it less efficient to have those preset waypoints on the map?

little eagle
#

"Preset waypoints"?

#

You mean those from the editor?

#

Custom scripted waypoints?

proven crystal
#

with patrolarea it generates ficΒ΄xed waypints

#

so for example there would be a waypoint cycle of 7 waypoints for each group

#

while searcharea would only generate one, and then a new one only if that is completed

#

certainly nicer to look at from zeus

#

also i wonder if the algorithm behind searcharea might be more of an issue to use with VCOM

little eagle
#

Might be.

proven crystal
#

ah actually....

#

i think the thing will interrupt once i add a waypoint in any other way

#

because then i have a waypoint that doesnt call those statements again

#

so once VCOM kicks in, the thing will not be generating new searcharea waypoints

#

or if i add a waypoint as zeus

warm gorge
#

Im having a bit of a mindblank moment, do variables persist when set to the player object over respawns?

little eagle
#

Yes.

#

There is one potential issue you might be having if you use setVariable on a killed eventhandler.

warm gorge
#

Alright sweet, thank you. And yeah nah im not doing any in that event handler so should be okay πŸ˜ƒ

proven crystal
#

i think you have to make sure to add them to player, not playableunit. if im not mistaken i once had an issue with that, but i could be wrong

little eagle
#

There's no difference in how you acquired the object.

proven crystal
#

talking about the killed eventhandler. i have an issue with that. seems to be returning the victim only, not the killer or instigator

little eagle
#

ACE?

proven crystal
#

yes

#

so thats an issue?

little eagle
#

I had to search it.

proven crystal
#

holy crap... and they havent fixed that

#

thats a bit annoying

#

glad i can at least get the victim...

little eagle
#

Have you read the first answer?

proven crystal
#

but how would i now figure out whether players killed civilians or friendly fire?

little eagle
#

private _killer = _deadGuy getVariable ["ace_medical_lastDamageSource", objNull];

proven crystal
#

ahhh

#

thanks a lot!

little eagle
#

There's no way to fix this sadly. Otherwise it would've been fixed years ago.

rotund cypress
#

Hey guys, do you know if there is a way to script scrolling of a controlsgroupctrl?

little eagle
#

RscControlsGroup ARE the scrollbars in controls.

rotund cypress
#

Yes, however, you can obviously scroll when hovering over if the contents > than the controlsgroup

#

Is there a way to script that?

#

So I can scroll up or down within the control? I.e. call it via script command

little eagle
#

Just create a dummy control somewhere deep down?

rotund cypress
#

And do what with it?

little eagle
#

Nothing. Then you can scroll for a while.

rotund cypress
#

I don't think you know what I mean.

#

I want to be able to trigger scrolling (if control is able to scroll) via a scripting command or script

#

Is that possible?

rotund cypress
#

Ah nice

little eagle
#

Never used this, but it sounds like it could be what you're looking after.

rotund cypress
#

This seems to scroll down, but not up 😦

#

Im trying to make a similar thing as to the default chat, i.e. scroll up or down with page up/down

#

Not sure how they're doing it

little eagle
#

ctrlSetPos and ctrlCommit?

rotund cypress
#

That could work I guess

little eagle
#

Just to be clear. ctrlCommit is a dely to animate these things and can be >0

#

So the control moves X seconds into the position.

rotund cypress
#

I know that hehe

#

Is the systemChat system stored in the arma 3 files?

little eagle
#

You mean the display for it?

rotund cypress
#

Well, more like the functionality, but the display would probably be stored there

#

Do you know what the display is called?

little eagle
#

There are a few template controls, but the display seems to be hardcoded or it's a hardcoded part of another display.

rotund cypress
#

Ah yeah

little eagle
#

This is the input edit box etc:
RscDisplayChat

rotund cypress
#

Yeah, I saw that

little eagle
#

These are the templates for the output / incoming chat:
RscChatListDefault
RscChatListMission
RscChatListBriefing
RscChatListMap

#

But the behavior is completely hard coded and they have no classical controls to edit with the API.

rotund cypress
#

Yeah I saw that 😦

little eagle
#

Are you making your own custom chat?

rotund cypress
#

Yes

#

I had some HUD stuff put on the same side as a chat before thinking of chat, so I told myself f*** it lets just remake the chat to have it on the right side

little eagle
#

Maybe one can edit the controls ingame should they be available with allControls. Sadly they seem to be structured text (for the multi colors?), so you can't read their displayed text at all.

rotund cypress
#

ah 😦

little eagle
#

I think I also tried adding onLoad to them, but nothing happened. I can try again...

rotund cypress
#

Don't worry about it, I got another way πŸ˜ƒ

little eagle
#

I always wanted to mess with it, because people occasionally ask how to disable the side chat.

rotund cypress
#

Ah hehe

#

showChat false;

#

πŸ˜‰

little eagle
#

showChat doesn't work for me.

rotund cypress
#

You in MP?

little eagle
#

Local hosted MP.

rotund cypress
#

Thats strange

#

Has always worked for me

meager heart
#

@rotund cypress if (!isDedicated) then {{_x enableChannel false} foreach [0,1,2,3,4,6,7,8,9];

rotund cypress
#

Im not having problems disabling the channels πŸ™ˆ

little eagle
#

You can't disable the side channel, and you can't disable the global channel for the host / admin.

#

That was the whole point in me looking for alternatives.

meager heart
#

Ok sorry need scroll up higher...😁

rancid ruin
#

please hold, someone will be happy to help with your Life related scripting problems very soon

rancid ruin
#

(i wasn't talking to myself, some scrub asked a question about life scripting then deleted it)

proven crystal
#

damn so the searcharea thig has one problem, which is waypoints in the water

#

figure i need a separate loop to prevent that.... wiki gives me a function to check whether surface is water

#

is there something to find nearest land?

#

probably could check whether its water, and in that case move the current waypoint to nearestlocation or so

#

or are there locatios in the water?

#

maybe nearestbuilding... instead...

blissful wind
#

IΒ΄ve set up TADST to test my mission in a dedicated server enviroment(as best as possible) before actually moving it to to a better solution. Im using initServer and (isDedicated) in the scripts to make sure things run where they supposed to run and everytime I spawn for example a radiotower it spawns 2 of them. IΒ΄ve tried to the best of my knowledge to fix this issue, I have looked in many forums to no success. I Β΄ve tried multiple combinations on isDedicated and hasInterface and isServer but it will create two of each everytime. I know im not far from it but how far i donΒ΄t since IΒ΄m a bit lost here. Any help or hint would really help, thank you.

still forum
#

Headless client?

blissful wind
#

no

#

IΒ΄m just making sure tasks and spawning objects is correct at this point

#

tasks are fine, obejcts not so much

#

ok now it creates only one object, right... but using deleteVehicle _radioTower; does not delete ... maybe i just need to step away from it because how can such a simple command not work

#

i Β΄ve tried making it global and even publicvariable it but still does not delete

edgy dune
#

So I have the following code to just show me what parts of a vic has taken dmg, however it doenst work on a helicopter for some reason in a mod but works on a tank from the same mod, any ideas why?

#
 hint format ["%1", (getAllHitPointsDamage (vehicle _this))  ];`
blissful wind
#

ah! solved it.... while i was testing and all i forgot to comment out the part that was looking for the radiotower ruins since once its destroyed its a new object... in this case i wasnt destroying was just creating and deleting it to check positions and whatnot... solved

#

the code would get to that part and just hault

proven crystal
#

anything wrong wih this?

    for "_i" from 1 to 60 do {
        sleep 30;
        _wpindex = currentWaypoint _group;
        _wppos = _waypointPosition [_group,_wpindex];
        if (surfaceIsWater _wppos) then {
        
            _nearestlocation = nearestLocation [ _wppos, ""];
            _wppos = locationPosition _nearestlocation; 
            [_group, _wpindex] setWaypointPosition [_wppos, 20];

        }:
        
    };
#

i think it somehow breaks the waypoint...

#

does _waypointPosition only work for editor placed waypoints?

#

says it under wppos

still forum
#

_waypointPosition doesn't exist

little eagle
#

Can't have local variable next to array either.

proven crystal
#

indeed. blind me i stared at that thing for a while

tough abyss
#

@Dedmen (βˆ©ο½€-Β΄)βŠƒβ”β˜†οΎŸ.*ο½₯q゚#0689 that name

little eagle
#

It's Kirby.

proven crystal
#

the other error in the above script btw is a : instead of ;

#

i hate that shit

drowsy axle
#

Could someone help understand what i've done wrong? There's no errors from the -showerrors ingame. ```sqf
mission_1_start = 0;
mission_1_end = 0;
if (mission_1_start == 1) then
{
player globalChat "Mission 1 has Started!";
// Spawn all units and vehicles to spawn in mission.
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_squad_1.sqf";
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
};
if (mission_1_end == 1) then
{
player globalChat "Mission 1 has Ended!";
// Delete all units and vehicles to spawn in mission.
deleteGroup west_inf_fireteam_1;
deleteGroup west_inf_squad_1;
};

little eagle
#

Well that code does nothing.

drowsy axle
#

How do you mean?

little eagle
#

Both if's will be false and nothing will happen aside from two variables being set to 0.

drowsy axle
#

Right. I was thinking of using a while command... maybe above (around) the IF 's

little eagle
#

I think I know what you want to do.

#

How do you set these variables to 1?

drowsy axle
#

In the mission via debug for now

#

Will be done via triggers ingame

#

I've done a watch on the debug and the mission_1_start = 0;
mission_1_end = 0; is correct and when I change it via debug it works (obviously)

little eagle
#
mission_1_fnc_start = {
    player globalChat "Mission 1 has Started!";
    
    // Spawn all units and vehicles to spawn in mission.
    if (isServer) then {
        [200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_squad_1.sqf";
        [200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
    };
}; 

mission_1_fnc_end = {
    player globalChat "Mission 1 has Ended!";

    // Delete all units and vehicles to spawn in mission.
    if (isServer) then {
        deleteGroup west_inf_fireteam_1;
        deleteGroup west_inf_squad_1;
    };
};
#

init.sqf

drowsy axle
#

setting them as functions?

little eagle
#

remoteExec ["mission_1_fnc_start"]
to start

#

remoteExec ["mission_1_fnc_end"]
to end

drowsy axle
#

Cool πŸ˜ƒ

#

Not used RemoteExec before

little eagle
#

That makes way more sense to me personally.

drowsy axle
#

I will test and let you know.

little eagle
#

The isServer thing is needed so not every client spawns groups.

#

Don't want to have multiple copies of groups for every client connected.

drowsy axle
#

Right

#

so the isServer is just server init.

#

So it would be best to have it in initserver.sqf?

little eagle
#

isServer is true on the server (including SP client) and false on dedicated clients.

#

So the if statement is only evaluated on one machine.

#

The server.

drowsy axle
#

So, would this work on the preview editor?

little eagle
#

In the editor or in SP you are the server.

drowsy axle
#

kk

#

Got an error. (just the file not being found.) one sec.

little eagle
#

Probably the leading slash in "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf"

drowsy axle
#
mission_1_fnc_start = {
    player globalChat "Mission 1 has Started!";
    
    // Spawn all units and vehicles to spawn in mission.
    if (isServer) then {
        [200,|#|mission_1] execVM "SpawnCommand/WEST/INF/inf_squad_1.sqf";
        [200,|#|mission_1] execVM "SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
    };
}; 

mission_1_fnc_end = {
    player globalChat "Mission 1 has Ended!";

    // Delete all units and vehicles to spawn in mission.
    if (isServer) then {
        deleteGroup west_inf_fireteam_1;
        deleteGroup west_inf_squad_1;
    };
};
``` that is what it looks like (then saying it's not found.)
#

(mission_1 is a marker on the map)

little eagle
#

Markers have to be put in quote marks.

#

"mission_1"

drowsy axle
#

right one sec

#

That was my bad

#

I didn;t create a INF inside WEST lol

little eagle
#

The leading slash is generally for the addons folder, and no leading slash is for the mission folder.

drowsy axle
#

Yeah sorted that.

little eagle
#

But there are some exceptions.

drowsy axle
#

The player globalChat "Mission 1 has Started!"; works on remoteExec ["mission_1_fnc_start"]

#

However, no people spawn

#
// nil = [200,mission_1] execVM "inf_fireteam.sqf";
private ["_rad","_spawn","_marker","_units","_troop"];
_rad = _this select 0;
_spawn = _this select 1;
_marker =  [(getMarkerPos _spawn select 0)-_rad*sin(random 359),(getMarkerPos _spawn select 1)-_rad*cos(random 359)];

// EDIT BELOW \\

_units = ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_AT_F","B_medic_F","B_Soldier_M_F"];
west_inf_fireteam_1 = createGroup WEST;

// EDIT ABOVE \\
{
    _troop = /* EDIT THIS ->*/ west_inf_fireteam_1 /* <- EDIT THIS*/ createUnit [_x,_marker, [], 0, "NONE"]
} forEach _units ;```
little eagle
#

Try executing the function manually.

#

sin(random 359)

#

This does look suspiciously wrong to me.

#

This is in deg, but the command uses radians.

drowsy axle
#

right so asin not sin

little eagle
#

No.
sin rad random 360

#

Or
sin (random 360 / 360 * 2*pi)
I guess. Same thing.

drowsy axle
#
_rad*sin(random 359)
``` to ```sqf
 sin (random 360 / 360 * 2*pi)```
tough abyss
#

rip markdown

#

good boy

little eagle
#

I think the createUnit line is wrong.

tough abyss
#

jezus

little eagle
#

Nah wait. There're weird comments^^

drowsy axle
#

lol

little eagle
#

Let me rewrite this. It's a mess.

#

Sec.

drowsy axle
#

lol

#

sorry

little eagle
#

Should they spawn inside the radius or at the circumference?

drowsy axle
#

inside the radius @little eagle had a brain fart

tough abyss
#

LOL

drowsy axle
#

But the marker is an "empty" one.

little eagle
#
params ["_radius", "_marker"];

private _position = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];

// vvv edit
private _group = createGroup west;
west_inf_fireteam_1 = _group;
private _units = ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_AT_F","B_medic_F","B_Soldier_M_F"];
// ^^^ edit

{
    _group createUnit [_x, _position, [], 0, "NONE"];
} forEach _units;
#

Untested

drowsy axle
#

testing

#

SpawnCommand/WEST/INF/inf_squad_1.sqf not found.

little eagle
#

Is the path correct?

drowsy axle
#

ill place it at root for now to test

#

WORKS AT ROOT

little eagle
#

Strange.

little eagle
#

I don't know why it wouldn't work with subfolders.

drowsy axle
#

Hmm

little eagle
#

Maybe try saving and loading the mission after you placed the files.

drowsy axle
#

I appreciate you helping as well. very nice .

#

I'll ttry that

#

Hang no

#

on

#

\ not /

#

wow im dumb

little eagle
#

What was it? Temp mission folder?

drowsy axle
#

SpawnCommand\WEST\INF\inf_squad_1.sqf not SpawnCommand/WEST/INF/inf_squad_1.sqf

little eagle
#

I hate this too...

drowsy axle
#

I'm so used to / fucking shit man

#

Yeah

restive matrix
#

any way to check if an object is being remoteControl'd by a player in sqf

drowsy axle
#

All works now thanks @little eagle was just the fucking \ 😦

little eagle
#

Cool.

restive matrix
#

ah nevermind, i can loop through the curators and check their assigned units

drowsy axle
#

@little eagle Would you mind helping with this, I know scriptDone won't work. However is there a way around this? sqf waitUntil { scriptDone { S1_WYP_1_marker = [(getMarkerPos _spawn select 0)-_rad*sin(random 359),(getMarkerPos _spawn select 1)-_rad*cos(random 359)]; S1_WYP_1 = west_inf_squad_1 addWaypoint [S1_WYP_1_marker, 10, 0]; S1_WYP_1 setWaypointType "MOVE"; } }; Originally: ```sqf
S1_WYP_1_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_1 = west_inf_squad_1 addWaypoint [S1_WYP_1_marker, 10, 0]; S1_WYP_1 setWaypointType "MOVE";

S1_WYP_2_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_2 = west_inf_squad_1 addWaypoint [S1_WYP_2_marker, 10, 1]; S1_WYP_2 setWaypointType "MOVE";

S1_WYP_3_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_3 = west_inf_squad_1 addWaypoint [S1_WYP_3_marker, 10, 2]; S1_WYP_3 setWaypointType "MOVE";

S1_WYP_4_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_4 = west_inf_squad_1 addWaypoint [S1_WYP_4_marker, 10, 3]; S1_WYP_4 setWaypointType "CYCLE";``` The 3 and 4 markers would be the wrong way around. Making the waypoint 3 at [0,0,0]

little eagle
#

scriptDone needs a SCRIPT handle, not a CODE block. I think you can just get rid of it and the waitUntil entirely.

drowsy axle
#

The 3 and 4 markers would be the wrong way around. Making the waypoint 3 at [0,0,0]

little eagle
#

I think you have to start these waypoint indices with 1.

drowsy axle
#

they start at 0 I checked.

little eagle
#

Because 0 is already a dummy waypoint that every group has and is positioned where they spawn.

drowsy axle
#

oh right

#

I'll test it

#

Yes it works.

#

Thanks!

#

Now to see if the cycle cycles

little eagle
#

That randomization method very strange though. I think you made it a square where the center is preferred with some kind of e function increasing probability. Euler would be proud.

drowsy axle
#

Who?

#

haha :/

little eagle
#

You. The sine cosine thing.

drowsy axle
#

oh that just basic stuff mate πŸ˜›

little eagle
#

Pff, details.

drowsy axle
#

yup

#

The cycle works (backwards) but works.

little eagle
#

lmao

merry ibex
#

Don't encourage them

tough abyss
#

#letsAllInvestInAnInvisibleDiscordGIF

blissful wind
#

about the \ im wondering now if it will accept ..\myscript.sqf , not that thereΒ΄s a lot of folders but in that case i dont have to edit when reusing scripts

little eagle
#

I think the leading slash works if the game does not find the same file under the addons folder in some kind of mod.

#

No leading slash makes it look only inside the mission folder.

blissful wind
#

yea with .. and \ you dont have to remember what folder it is

#

at least in python

little eagle
#

Not here.

tough abyss
#

a starting \ sometimes makes it go back to base files

drowsy axle
#

@blissful wind Also hides it from knowing where the file is from just the "call"

tough abyss
#

Why a call?

#

Out of all things?

#

πŸ˜›

drowsy axle
#

@blissful wind also if true then you need to have different file names.

little eagle
#

\path
^ addon scope, fallback to mission scope

path
^ mission scope

tough abyss
#

^

blissful wind
#

this is why i think python is much more clean

#

no semi colons no need to specify everything the computa does it for you

#

..\ jumps one back

tough abyss
#

urgh

blissful wind
#

and so on

tough abyss
#

I hate py

#

..\

drowsy axle
#

\path
^ addon scope, fallback to mission\campaign config if any

path
^ mission scope

tough abyss
#

why does it get rid of

#

the first ?

#

wot

blissful wind
#

you dont need to specify tha name of the folder

tough abyss
#

the first \

blissful wind
#

..

tough abyss
#

lol

blissful wind
#

stands ffor it

little eagle
blissful wind
#

scripts\myscript to ..\myscript

drowsy axle
#

Wouldn't the ..\ put more work on the system to find the file?

blissful wind
#

not in python

little eagle
#

..\ does not work in SQF.

#

Only with the #include preprocessor command it does.

#

SQF not.

tough abyss
#

Yeah

#

including macros from 2 folders away

blissful wind
#

yea, i was just wondering from readin back your convo about the \

tough abyss
#

#include ..\macros.hpp

blissful wind
#

doesnΒ΄t make much different except when your like "what did i name that folder"

#

well .. it and donΒ΄t need to go check

#

usually i just forget ;

#

X)

little eagle
#

SQF doesn't even has relative paths, so there is no reason for ..

blissful wind
#

thats fine i was merely curious

#

thanks for the answer, good to know

drowsy axle
#

The sqf setWaypointType "CYCLE"; doesn't work on other groups past the first one...

#

Wait nvm

little eagle
#

?

drowsy axle
#
F1_WYP_1_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_1 = west_inf_fireteam_1 addWaypoint [F1_WYP_1_marker, 10, 1]; S1_WYP_1 setWaypointType "MOVE";

F1_WYP_2_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_2 = west_inf_fireteam_1 addWaypoint [F1_WYP_2_marker, 10, 2]; S1_WYP_2 setWaypointType "MOVE";

F1_WYP_3_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_3 = west_inf_fireteam_1 addWaypoint [F1_WYP_3_marker, 10, 3]; S1_WYP_3 setWaypointType "MOVE";

F1_WYP_4_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_4 = west_inf_fireteam_1 addWaypoint [F1_WYP_4_marker, 10, 4]; S1_WYP_4 setWaypointType "CYCLE";```
#

didn't change the S1_WYP_1 setWaypointType "MOVE";

#

S1_WYP_1

#

lol

little eagle
#

I don't follow.

drowsy axle
#

This: S1_WYP_4 setWaypointType "CYCLE";

#

Was for all groups

#

So the default waypoint is move if not set

#

Hence why the CYCLE didn't show

little eagle
#

Does it work now?

drowsy axle
#

How do I put a vehicle in group?

blissful wind
#

@drowsy axle with crew right ?

#

bis_fnc_spawnvehicle, if its of any use to you.. select 0 is the vehicle select 1 is the crew

drowsy axle
#

AHH right. I'll have a look at it tomorrow

spice crypt
#

anyone able to tell me the location/file of the group maker icon (hexagon) as used in the in-game environment? i can't find the damn thing. tia.

spice crypt
#

nevermind, found it... it's at "a3\ui_f\data\igui\cfg\cursors\select_ca.paa".

cinder gyro
#

I looked for it there, must've missed it

half moth
#

Anyone know of a civilian killed notification script? Seems all I can find via search no longer work and don't see much convo on the subject recently.

subtle ore
#

@half moth

addMissionEventHandler["EntityKilled",
{
  params["_killed","_killer","_instigator","_useEffects"];
  if(side _killed isEqualTo civilian) then
  {
    //your notif code here
  };
}];
half moth
#

Thanks for the quick reply!

subtle ore
#

Yep, no problem.

warm gorge
#

For a constant server side loop, is there any benefit in rescheduling the loop every now and then rather than just having it run the same one over and over again? Someone once told me that its better to do this but I'm not too sure

still forum
#

rescheduling requires more cpu time than just letting it run

little eagle
#

Reschedule it every frame.

warm gorge
#

Yeah I think ill just stick to letting it run

still forum
#

I prefer commy's answer tho

compact maple
#

What does reschedule mean ?

little eagle
#

It was a joke.

still forum
#

sounds reasonable

#

@compact maple kill the script and start it again

compact maple
#

Oh okay thanks

#

Never noticed it but saw your name on cba git @little eagle

candid jay
#

hello ev’one, is there a way to use attachTo on one relative position of an object to a relpos of another object? for instance to make ends match

jade abyss
#

?

#

You mean checking if an Obj. is at a certain position?

daring pawn
#

when declaring a variable to equal something. IE _var = []; is there a way to do this when you don't know what "_var" is? for example, you can, with the pushBack command, combine something like (_var select (_forEachIndex)) pushBack _r) however that is not possible to do (_var select (_forEachIndex) = [];

little eagle
#

Assignment in SQF needs an identifier on the left side, not an expression.

daring pawn
#

Can you think of some work around? At the moment I achieve what I need, however I'm getting an array that is [["things","stuff"]] as I have to define the array already as _array = []; then pushback into it is causing it to add an array

#

I think I recall having a look at set yesterday evening, not sure what about it wasn't suitable. I'll peek again

#

Ah yes, I did have a loot at it. It still resulted in the array being [["stuff",'things"]]

#
private _side = str PMF_EnemySide;
private _faction = PMF_EnemyFaction;

_ArmoredGroups = [];
_InfantryGroups = [];
_MechanizedGroups = [];
_MotorizedGroups = [];
_SpecOpsGroups = [];
_SupportGroups = [];

_categories = ["Armored","Infantry","Mechanized","Motorized","SpecOps","Support"];
_groups = [_ArmoredGroups,_InfantryGroups,_MechanizedGroups,_MotorizedGroups,_SpecOpsGroups,_SupportGroups];
{
    _config = configFile >> "CfgGroups" >> _side >> _faction >> (_categories select (_forEachIndex));
    _r = ("true" configClasses _config) apply {configName _x};
    (_groups select (_forEachIndex)) pushBack _r;
    //diag_log (_groups select (_forEachIndex));
} forEach _groups;

[_ArmoredGroups,_InfantryGroups,_MechanizedGroups,_MotorizedGroups,_SpecOpsGroups,_SupportGroups]

Is the full code i'm using

#

Using part of what you sent me last evening

little eagle
#

(_groups select (_forEachIndex)) is just _x.

jade abyss
#

As we mentioned before

halcyon crypt
#

it should be just fine and does exactly what you're telling it to do πŸ€”

little eagle
#

What's the result, and what is the expected result?

daring pawn
#

Result is

[["BUS_TankPlatoon","BUS_TankPlatoon_AA","BUS_TankSection","BUS_SPGPlatoon_Scorcher","BUS_SPGSection_Scorcher","BUS_SPGSection_MLRS"]]

I'd like to not have the array nest inside the other

#

Thats for _armoredGroups

little eagle
#

Replace pushBack with append.

daring pawn
#

πŸ™„ well... thats done it. Damn I looked through every other array modifier

#

Thanks again

plucky beacon
#

but that's just my way of asking not asking

tough abyss
#

Question: I've a control, which text I set with ```SQF
_missionInfo = _dialog displayCtrl 80017;
_missionInfo ctrlSetStructuredText parseText format [
"<t size = '1' font = 'RobotoCondensedBold' color='#ffffff' align = 'left'>
%1 on %2
<br/>
Active SQF: %3
<br/>
Active FSM: %4
<br/>
Pos: %5
<br/>
Time: %6m
<br/>
CursorObj: %7
</t>",
missionName,
worldName,
(diag_activeScripts select 0) + (diag_activeScripts select 1) + (diag_activeScripts select 2),
diag_activeScripts select 3,
getPos player apply {floor _x},
floor ([time / 60, serverTime / 60] select isMultiplayer),
cursorObject
];

The last line, when looking at a given object can look like this `CursorObj: 139011: t_pinusp3s_f.p3d`, but when looking at the sky (at no object), it simply reads `CursorObj:`, rather than `CursorObj: <NULL-object>`. Why?
little eagle
#

That's the first time I see code where one line wraps around four.

tough abyss
#

Better?

little eagle
#

I think this may be because <> are html chars that parseText is trying to make sense of.

tough abyss
#

Could be, any way around that?

little eagle
#
_str = str cursorObject;
_str = [_str, ">", "&gt;"] call CBA_fnc_replace;
_str = [_str, "<", "&lt;"] call CBA_fnc_replace;
_str
tough abyss
#

What is "&gt;"?

little eagle
#

html for >

#

"Greater Than"

tough abyss
#

πŸ‘

#

4 lines of code to write <NULL-object> seems really inefficient, though.

little eagle
#

If you want to use parseText etc. with arbitrary input, this is what you have to do.

tough abyss
#

Would it be the same with composeText?

subtle ore
#

@plucky beacon Very good summary

plucky beacon
#

Thanks, I was hoping Commy would think so too πŸ˜‰

little eagle
#

I was about to complain that it's a triangle and not a circle. But it said "cycle", not "circle".

plucky beacon
#

LOL

#

You literally just went through the cycle

subtle ore
#

You need commy the god's approval

plucky beacon
#

Kind of a shame we can't do reactions here, I'd make some good ARMA emojis

little eagle
#

There is no S in the plural. It's just emoji.

plucky beacon
#

πŸ™ƒ πŸ”«

meager granite
#

Future of human evolution according to Arma 3

still forum
#

Shoenose?

still forum
#

That's honestly not that bad... Could count as Art

little eagle
#

Broken uniform model?

meager granite
#

Nah, ragdolls

#

Switching locality results in either this

#

Even with all my quircks like delays and waiting until body is fully rested (doesn't jiggle anymore), it gets messed up like this on real server randomly

#

πŸ€” πŸ”«

little eagle
#

Is this attachTo?!

meager granite
#

Setting position each frame, that's why I need locality change so person dragging can do setPos each frame

#

It looks smooth for dragging and acceptable for dragged

#

But its Arma.

little eagle
#

So it's using setUnconscious.

meager granite
#

No, I wanted to let you drag any dead body (units in revive are actually dead in my missions)

#

Anyway, its all fucked now, until there is a command to force stop the ragdoll state or these bugs fixed.

jade abyss
#

uhm

#

wasn't there something

#

hm, might have mixed that with another Engine. nvm

lone glade
#

thanks for the nightmares matra, my god

#

almost as bad as using people as backpacks

still forum
#

That guy looks unhappy

meager granite
#

:-3