#arma3_scripting

1 messages ยท Page 301 of 1

bleak schooner
#

I have the following code as a tazer function:

    waitUntil {!isNull player && player == player};
    waitUntil {!(isNull (findDisplay 46))};
    sleep 2;
    mav_tazer_fnc = {
        private["_unit","_damage","_source","_projectile","_old"];
        _unit = param[0,objNull,[objNull]];
        _damage = param[2,0,[0]];
        _source = param[3,objNull,[objNull]];
        _projectile = param[4,"",[""]];
        _old = (getDammage player);
        if(
           !isNull _source && {!isNull _unit} && {_source != _unit} &&
           {(toLower(currentWeapon _source) find "hgun_p07" != -1)}
          ) then {
            if(alive player && (player distance _source) < 50) then { 
                [] spawn {
                    tased = true;
                    player allowDamage false;
                    player setUnconscious true; 
                    uiSleep 10;              
                    player setUnconscious false;
                    player playMoveNow "AmovPercMstpSnonWnonDnon";
                    player allowDamage true;
                    tased = false;
                };
                _damage = _old;
            };
        };
        0; 
    };
    player removeAllEventHandlers "handleDamage";
    player addEventHandler["handleDamage",{_this call mav_tazer_fnc;}];
};
still forum
#

highlight code using
```sqf
<code>
```

jade abyss
#

Pls:
```sqf
CODE
```

#

๐Ÿ˜„

still forum
#

First! ๐Ÿ˜„

jade abyss
#

lucker! I added "pls:"... was a mistake

#

๐Ÿ˜„

still forum
#

Should make a Keyboard macro for that...

bleak schooner
#

was just changing it ๐Ÿ˜ƒ

jade abyss
#

SQF

#

to the 1. line
```sqf

bleak schooner
#

my question: since the 64bit update all players will get tazed but won't recive damage from other weapons. anyone have an idea why?

jade abyss
#

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

still forum
#

Well... your handleDamage function is always returning 0

bleak schooner
#

and how do i fix it?

still forum
#

If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways

#

don't return 0 ?

#

Return _damage if he was not hit by a tazer. and return 0 if he was hit by a tazer. because tazers shouldnt do damage

bleak schooner
#

can you tell me, what parts exactly of my code i have to change?

still forum
#

What? It's your code... If you have written that you know exactly what to change ๐Ÿ˜ฎ

bleak schooner
#

nope I didn't wrote it

still forum
#

Let me guess ๐Ÿ˜„ Life?

#

I'll take that as a yes ๐Ÿ˜„ Maybe you should learn to write scripts yourself instead of copying them :x

replace 0; by _damage;

bleak schooner
#

I wrote several hundred lines of codes all by myself for this mission (check the forums where I posted some) but I got stuck for weeks on this tazer so I had someone else write it for me

#

but thanks anyways

#

^^

still forum
#

Don't take it to personal ^^ I'm just a very Anti altis-life guy. And that script looks very Lifeish to me :x

jade abyss
#

Yeah

still forum
#

And you apparently having no Idea about supposedly your own script just confirms that expectation :x

tender fossil
#
  • nvm -
bleak schooner
#

openCuratorInterface

turbid thunder
#

@tough abyss you could delete them or move them they are objects I'm sorry but I'm not sure I fully understand what you mean with this, or how this is accomplishable

plucky beacon
#

SaMatra is probably the person to ask about something like this

subtle ore
#

Cool @plucky beacon

plucky beacon
#

tell me if you spot anything that doesn't look right

plucky beacon
#
{    
    if(_jip) then {
        [[],"\DNI_FpsZeus\client.sqf"] remoteExec ["execVM",_owner,false];
    };
} remoteExec ["onPlayerConnected", 2, false];

would this work?

#

I guess more or less it's about if the remoteExec can take code blocks as a parameter

rotund cypress
#

So I have a question with structuredText, how can I make it adapt to interface size? I got it with normal sizeEx = whatever * safezoneH; but with structuredText that doensn't work.

plucky beacon
#

I'm pretty sure you can still use safezone in structured text

#

I know it does for size

rotund cypress
#

<t size='1 * safezoneH'>hello</t>

#

Pretty sure that wouldn't work?

plucky beacon
#

oh sorry, I'm just looking at my dialogs hpp

jade abyss
#
format["<t size=%1>hello</t>",(1 * safezoneH)];```
rotund cypress
#

Oh alright

#

Thanks

jade abyss
#

this is working, but i don't know if its adapting.

rotund cypress
#

Ye I'm a bit sceptical as well

jade abyss
#

I think, i ended up not defining the Size at all in the end, because of that

plucky beacon
#

Hay Dad look at my UML model

rotund cypress
#

But what about larger structured text then

#

If you never resize things

jade abyss
#

*slap*

plucky beacon
#

ow

jade abyss
#

I never needed to do it SimZor. Thats why, can't help any further in your case.

rotund cypress
#

Alright

plucky beacon
#

use defines maybe?

rotund cypress
#

Btw, it should be '' around %1

jade abyss
#

@plucky beacon Do that stuff ServerSided

#

No Simzor

plucky beacon
#

but it's an addon

rotund cypress
#

Shouldn't?

#

How does that work

jade abyss
#

size=1

"size=%1", 1

#

Its just not needed, iirc.

rotund cypress
#

This is what I did <t color='#FFFFFF' font='PuristaLight' align='center' size='%1'>

#

Your saying its not even needed if you dont have %1?

#

So I can just do color=#FFFFFF?

jade abyss
#

wait a sec, before i talk nonsense

#

size='%1' <- correct (with ' )

rotund cypress
#

Right ๐Ÿ˜ƒ

#

Haha, it didn't make sense at all to me ๐Ÿ˜„

jade abyss
#

In some cases, you can ignore the ' / "

rotund cypress
#

Ye

jade abyss
#
_Text = format["<t shadow='1' align='center' size='%1'> %2", ( 0.65 * (safezoneW / safezoneH)), (_this select 0)];

_Ctrl ctrlSetStructuredText parseText _Text;```
rotund cypress
#

That will work?

jade abyss
#

Thats what i usedin 2017mod, so... yeah ๐Ÿ˜„

rotund cypress
#

NICE

#

legend

#

Headache = Gone

#

Whats 2017Mod btw?

jade abyss
#

aborted proj, since too many issues with A3.

rotund cypress
#

What was it supposed to be?

jade abyss
#

0.02 * safezoneH <- btw.: try that as Size

#

googleit, no clue if page still exists or not.

turbid thunder
#

I think I found a workaround for my footstep problem. Spamming switchMove aswell as slowing the AI's animation speed down by a lot makes their footsteps basically silent while they are still able to creep towards me in a very slow speed. I also noticed that allMissionObjects does not pick up sounds created by animations at all (both #soundonvehicle and "All" have been tested) sooooo yeah, I'm not sure if disabling footsteps is even possible through scripting alone :S

tough abyss
#

is there a way to do something like
forEach allPlayers-HeadlessClients? Ik HeadlessClients isn't a thing but whats the alternative

turbid thunder
#

_justPlayers = allPlayers - entities "HeadlessClient_F";

#

That?

#

@tough abyss ^

tough abyss
#

danke

still forum
#

Does anyone know what happened to modelToWorldWorld and modelToWorldVisualWorld ? I could really use them right now...

turbid thunder
#

@still forum It seems like it was added in the dev branch prior to the release of 1.68 (the 64 bit release) but never actually made it into the main branch

still forum
#

Also can't find anything on biki about in the list of commands in dev branch

turbid thunder
#

Well it wouldnt be the first time that newly introduced commands do not have a biki entry yet. Mayby it is still in the dev branch?

still forum
#

Probably. Guess I have to wait then

thick ridge
#

Anyone know how to prevent display event handlers from sticking around between mission restarts?

jade abyss
#

hmpf, why do attached ropes disable Engines on Planes? :/

worn hatch
#

Hey, so I was told there is a script that makes it so when your mod is run on certain servers it ends the mission. And just had a few questions:
First is this true?
If so does anyone know where I would go about obtaining this script or a tutorial on how to make one?
Is there something specific I would have to do to make the script execute on like server startup or something like that?

Thanks for any help, sorry If they are stupid questions I no more or less nothing about scripting, only about modelling really.

tough abyss
#

preInit / servername check / missionend

scarlet spoke
#

However that is barely worth the effort as anyone who has the slightest scripting knowledge can simply remove this functionality...

worn hatch
#

@scarlet spoke I was told however that it breaks copy right to edit my mods without permission. So if I put it in my mod, and then they remove it I can file copyright.

At least that is what I was told

scarlet spoke
#

Sure you can.. But on the legal side they wouldnt even be allowed to use it without your permission to begin with...

#

And noone will really care if someone edited your mod

#

At least as far as I have heard...

worn hatch
#

see I dont know exactly as Ive been getting mixed opinions across the board. but basically what Ive gathered from a few people is that while I cant stop them using it, I can file a DMCA against anyone who edits it. So adding a check to disable servers I dont like should stop that

scarlet spoke
#

I doubt that

#

But you can try and if you put enough effort into it you might even succeed. But I think in the worst case you need to get an attorney to force it

#

@worn hatch but why do you even publish your mod when you don't wnat others to use it?

worn hatch
#

no the point of it is for others to use it

scarlet spoke
#

Do you provide any character models and stuff like that?

worn hatch
#

there is just a select few communities that for personal reasons I do not want using them

#

Its going to be a terrain object pack e.g. structures and objects and nature objects like trees and stuff

scarlet spoke
#

Hm okay...

worn hatch
#

but the point of the mod will be to give terrain makers more content to use

scarlet spoke
#

Well then I can't come up with anything that will offer this kind of "protection"

young current
#

There is no way to 100% protect any mod.

tough abyss
#

doesnt Mikero have an obfuscator?

young current
#

But what you write in your license is important and will prevent some precent of wrong use and can help you for example DMCA servers. Those who dont care about such stuff at all you cant really do anything about.

#

obfuscater scrambles configs but stuff can still be used

grizzled cliff
#

mikeros obfuscator isn't really that useful when you consider it is not a feature supported by the engine, so in essence he is doing something that any other toolchain should be able to decode.

halcyon crypt
#

not that I'm a proponent or anything but it is useful to deter a certain kind of people

dusk sage
#

Is it possible to open the field manual in MP?

scarlet spoke
#

Afaik it is

dusk sage
#

Possible via key binds?

scarlet spoke
#

Ummm.... Never tried it
Isn't it listed in the pause menu?

dusk sage
#

Mhm

#

Just wondering if there was another way

scarlet spoke
#

I guess you have already digged through the control presets?

plucky beacon
#

Good morning coders

#

Oh wait it's 1:25...

arctic veldt
#

Lol, I was tempted saying morning to everyone but it was 18:37 sigh

tender fossil
#

Where are the downloaded Workshop mission files located?

plucky beacon
#

arma directory !Workshop

#

Is there an easier way to remove ACE attributes from mission sqm?

thin pine
#

Don't add them

tender fossil
#

@plucky beacon I see only my mods there, mission files aren't there

scarlet spoke
#

They might be in the missions or mpmissions directory in your ArmA directory..

plucky beacon
#

@tender fossil what? Ace attributes are from the ACE mod, are we talking about diffrent things?

#

@thin pine I didn't add them, they're put there when you save a mission with ace on, because it adds attributes for medics

#

I don't even know what Raven is talking about

warped fractal
#

Does anyone know why I can't set activations for triggers anymore? Everytime I click it, it just flashes white

plucky beacon
#

change UI to very small

#

it's annoying but ๐Ÿคท

#

hopefully a fix soon

thin pine
#

@plucky beacon what are ze negative effects of zem being zere?

plucky beacon
#

can't play with folks on vanilla?

warped fractal
#

Thanks that fixed it

plucky beacon
#

I'm not using anything from ACE on the mission I just happened to make it when I had it enabled

#

๐Ÿ‘

thin pine
#

oh so it automatically adds an entry in requiredAddons as well then?

plucky beacon
#

ya

#

annoyingly

thin pine
#

could just remove that entry but keep the attributes there. Would have to do that every time you save the mission though.

#

it's faster than removing all the attribute-classes though.

plucky beacon
#

I want to be able to load it in editor in vanilla

#

and if I remove the required addons it'll error out I'm pretty sure

nocturne bluff
#

FYI the obsfucator is so fucking useless

#

It protects against kids and nothign else

plucky beacon
#

what Obsfucator?

#

for mission files?

tender fossil
#

@plucky beacon I'm talking about vanilla mission downloaded from Workshop

plucky beacon
#

oh okay, ya we were on diffrent topics

#

uhhh workshop addons...

#

C:\Program Files (x86)\Steam\SteamApps\workshop\content\app# maybe?

rocky marsh
#

How would I go about checking to see if a player is looking at a certain door?

plucky beacon
#

thaaat's a good question

#

it would probably involved the direction there facing versus a line that's drawn between them and the door.

#

Is this just one door or a script for every door in a map

rocky marsh
#

Only a certain door

austere granite
#

use selectionPosition on the buildling, convert that to world position

#

Then check if that position is on screen by using worldToScreen

jade abyss
#

no

austere granite
#

then check if worldToScreen is within a certain margin of error (and distance)

#

orrrrrrrr

austere granite
#

if you dont need any visual stuff, just use intersect check

subtle ore
#

@austere granite the memory points for each building are not accurate. Some are at least a.couple of steps away. Particularly the doors.

austere granite
#

"Door_N_sound_Source"

jade abyss
#

And thats why -> Intersect with the GeoLOD

#

Yes, the new names for Sources

#

-.-

austere granite
#

i didnt play since new update till today and no one reported bug

jade abyss
#

Just ask me, if something is broken ๐Ÿ˜„

#

Someone reported me, that my Button didn't worked... i said "It must work, you broke it" - I went in, didn't worked, went to configs, hated BI again ๐Ÿ˜„

austere granite
#

Yeah i had that today

#

Me being like... fuck i broke something even though no new version was released

#

nope works on everything else

#

BIS

jade abyss
#

^^ as usual

viral sleet
#

Is it at all possible to add rockets to the ceasar propeller driven plane via a script somehow?

plucky beacon
#

yes, addweapon

#

pick a rocket launcher classname

#

, get in pilot and pew pew away

viral sleet
#

I dont meen add it to the planes storage i meen add it to the plane itself .ie attached under wing

plucky beacon
#

no

#

you'd have to change the model and the vehicles config

#

but you can addweapon to make a firable weapon for the pilot

#

even if it isn't visible

viral sleet
#

Oh i didnt know this

#

Ill try this later thanx nitro

plucky beacon
#

go to editor and paste this in the init of plane for maximum ridiculousness

this addMagazine "12Rnd_125mm_HE_T_Green";
this addWeapon "cannon_125mm";
#

or a quad, but it might explode on landing

viral sleet
#

I shall

plucky beacon
#

I made a gamemode for my friend where it was dogfights with only tank cannons

#

goofy stuff

viral sleet
#

What about 20 HE rockets dude.Give ys apaste for that

plucky beacon
#

everything ya need is here

viral sleet
#

Rgr

#

Can this be done server side

plucky beacon
#

yes

viral sleet
#

Awesome

plucky beacon
#

Local arguments meaning wherever the script runs, the vehicle has to be owned by that machine

viral sleet
#

CAS cessna

plucky beacon
#

I put a 50Cal on an An-12 and scared my unit when it did a strafing run suddenly

viral sleet
#

Lol

plucky beacon
#

primitive yet suprising

viral sleet
#

Youve lost me with the local arguments thing.Just wanna run it on a server and everyone gets the cas cessna if they buy one.

#

But th theserver brains trust can sort it id say

plucky beacon
#

is the vehicle spawned with a script? or on the map from editor?

viral sleet
#

Its on a warfare multiplay server eutw

plucky beacon
#

then you shouldn't have to worry about it probably

viral sleet
#

Great help nitro thnx

plucky beacon
#

๐Ÿ‘

arctic veldt
#

@plucky beacon Can I add
addMagazine "1000Rnd_Gatling_30mm_Plane_CAS_01_F";
addWeapon "1000Rnd_Gatling_30mm_Plane_CAS_01_F";

#

And have a gatling cannon on one too? >:D

plucky beacon
#

weapon needs the weapon

#

you put the magazine in both

arctic veldt
#

I did have a looksie but I'm not sure to make out of what

plucky beacon
#

theres two columns, weapons and magazine

arctic veldt
#

Gatling_30mm_Plane_CAS_01_F

#

Would that nail it?

plucky beacon
#

ya

arctic veldt
#

Thank yyou very much >:D

plucky beacon
#

anything with [number]Rnd_... is a magazine

arctic veldt
#

yep, wasn't quite sure, thanks still :p

plucky beacon
#

are you adding a gatling to a go-kart?

#

that's what I would do

arctic veldt
#

Oh lord, yes. yes yes yes.

plucky beacon
#

you might blow yourself up too but it's in the name of science

arctic veldt
#

Gonna add
addMagazine "1000Rnd_Gatling_30mm_Plane_CAS_01_F";
addWeapon "Gatling_30mm_Plane_CAS_01_F";
addMagazine "2000Rnd_20mm_shells";
addWeapon "Twin_Cannon_20mm";

plucky beacon
#

pfft

arctic veldt
#

Wait, can flares be added too?

plucky beacon
#

from the buzzard huh? why not

#

ya

#

flares will be ejected from the center of the vehicle by default

arctic veldt
#

Well, this is definitely gonna add some spice to my fun now

#

Is there specific flares I'm looking for? or can I use those 3GL ones?

plucky beacon
#

they all use the same flare launcher for the 'weapon' and the magazine diffrences are just he number of flares

#

for the weapon it's just CMFlareLauncher I think

arctic veldt
#

Do I increase the amount of ammo by repeating the line Addmagazine?

plucky beacon
#

ya that's one way to do it, just when the number reaches 0 it will 'reload' the next magazine

arctic veldt
#

"Init: Missing ;" ๐Ÿ˜ฎ

plucky beacon
#

didn't type this

arctic veldt
#

oh, oh right!

plucky beacon
#

it doesn't know where to add the magazine and weapon without it

arctic veldt
#

Ahaha that's sorted that

#

Ahahahaha amazing, thank you very much

plucky beacon
#

๐Ÿ‘

arctic veldt
#

I'm gonna have to remember this and save it, am I able to add these on the fly with the debug console by any chance?

plucky beacon
#

as long as the vehicle is named yes

#

although if it's spawned with zeus it can cause issues, so add them to the map in eden first

arctic veldt
#

Ooooo, can I have an example for a go kart?

plucky beacon
#

Take the tank one from earlier

#

Tanks have a massive amount of recoil. And you probably should make the player and cart invincible for that

arctic veldt
#

I can't seem to see it

plucky beacon
#

It's from when i was talking to Sama

arctic veldt
#

I feel I should sleep and come back tomorrow but I'm not spotting it unless it's further up ๐Ÿ˜ฎ

plucky beacon
#

You might be going too far, it wasn't that long ago

arctic veldt
#

Aye, I must truly be too tired to spot it, I see where you're talking to him but I don't see a piece I can use to add weapons through debug

plucky beacon
#

Just name a vehicle and replace this with the name

arctic veldt
#

Ah I'm getting an error when I try to add it to an SUV

#

Trying
this addMagazine "1000Rnd_Gatling_30mm_Plane_CAS_01_F";
this addWeapon "Gatling_30mm_Plane_CAS_01_F";

with veh classname in front, after, replacing this

Error Generic Error, some others too

plucky beacon
#

Classname? What

#

You have to give that vehicle a name not use the classnames

arctic veldt
#

Ahwell, thanks a bunch for the info and whatnot, it's gonna be fun

tepid pollen
#

Hey all, I'm having trouble with my script and I don't think I'm going to figure it out on my own. Basically, I'm trying to convert a string of a uniform (example: "Item_U_Example_Uniform_1") received by typeOf cursorTarget (where cursorTarget is a uniform item on the ground, hence the Item_... prefix) to a string without the prefix (ex: "U_Example_Uniform_1) by using the following in a SQF: (sorry for italics above they're not intentional)

private _unif = typeOf cursorTarget; // _unif returns "Item_U_Example_Uniform_1"
private _unifarr = _unif splitString ""; // this is where things get odd, _unifarr returns ["U","_","E","x","a","m","p","l","e","soonandsoforth"] instead of ["I","t","e","m","_","U","_","E","x","soonandsoforth"]
private _unifarrf = _unifarr deleteRange [0,5]; // this returns <null>
private _uniff = unifarrf joinString ""; // this returns nothing at all. not nil or null, just blank
hint format ["Uniff: %1\nUnif: %2\nUnifarr: %3\nUnifarrf: %4", _uniff, _unif, _unifarr, _unifarrf] // to view outputs for the variables, of course
scarlet spoke
#

Use toArray then delete the first 5 entries in the returned array and reassemble the String with toString

#

@tepid pollen

tepid pollen
#

Okay, I will try that, but why does _x splitString ""; return without the prefix?

#

even though the variable was a string originally and it shouldn't have (in theory) been removed

scarlet spoke
#

I honestly have no clue

#

The only thing I can tell you that toArray is a special command for exactly the case when you want to split up your String into an array and then manipulating each "character" by itself so splitString "" is pretty unnecessary... You may want to keep in mind though that toArray will give you an array of integers instead of strings so you need toString in order to convert these integers back into a string

jade abyss
#

```sqf
CODE
```

scarlet spoke
#

Oh yeah you are right... Completely forgot about that one ^^

#

I think it's the even better solution for this problem

tepid pollen
#

Ok, thanks guys, by the way I think its Alternative Syntax 4 of select

jade abyss
#

4 is Array?!

#

Why Array?

tepid pollen
#

actually nevermind. I was thinking from the broken up into array part. my bad

scarlet spoke
#

You can use select directly on your string ๐Ÿ˜‰

tepid pollen
#

you are right

jade abyss
#

I usualy am ๐Ÿ˜„

scarlet spoke
#

xD

tame portal
#

Don't listen to dscha

#

Bad things will happen

jade abyss
#

sush! Letme see them suffer in pain and agony! This brightens my black heart a little bit.

plucky beacon
#

Is that why Dscha beats me regularly?

vapid frigate
#

@tepid pollen are you trying to get a name to display for the uniform? if so, getText (configFile >> "CfgVehicles" >> typeof cursortarget >> "displayName") might work better?

#

assuming the one on the ground is a 'cfgvehicle', not 'cfgweapon'

jade abyss
#

*getText not getString

vapid frigate
#

my bad

jade abyss
#

๐Ÿ˜‰

#

+I guess he needs the className (without "land_")

vapid frigate
#

yeah i'm not sure what the uniform on the ground is exactly

#

wouldve thought it'd be a 'weaponholder'

jade abyss
#

Thought so too, he might placed an object on the ground.

#

And not out of the Inventory

vapid frigate
#

yeh true, pretty sure it wouldn't work for dropping one

jade abyss
#

OR: He doesn't know that and we will see him in the next days again ๐Ÿ˜„

#

Yep, it won't work.

#

But: Thats not what he was asking for ๐Ÿ˜„

runic spoke
#

you could just toArray the string, and remove the first 5 and toString it after. ๐Ÿ˜›

vapid frigate
#

or use the better way dscha pointed out

runic spoke
#

toArray, reverse, resize (count _arry) - 4, reverse, toString

jade abyss
#
"land_BLABLA" select [5,5000]```
#

Way easier.

runic spoke
#

pff, my way looks smarter

jade abyss
#

Smarter != better ๐Ÿ˜„

#

+Not smarter, just "overcomplicated"

vapid frigate
#

more obfuscated

thin pine
#

Omit the 5000 @jade abyss ๐Ÿ˜‰

jade abyss
#

NO!

thin pine
#

๐Ÿ˜‰

jade abyss
#

NO NO NO!

thin pine
#

Winkwinkwink

jade abyss
#

snap, <18 here... *Edit

tired wren
#

Stokes is always over complicated, take him at face value

thin pine
#

Control yourself

runic spoke
#

you get the same results ๐Ÿ˜›

jade abyss
#

https://community.bistudio.com/wiki/Code_Optimisation

"Optimisation is everything when running lots of instances, with low delays. However, there is such thing as premature optimisation. Also, avoid excessive cleverness.

"Excessive cleverness is doing something in a really clever way when actually you could have done it in a much more straightforward but slightly less optimal manner. You've probably seen examples of people who construct amazing chains of macros (in C) or bizarre overloading patterns (in C++) which work fine but which you look at an go "wtf"? EC is a variation of premature-optimisation. It's also an act of hubris - programmers doing things because they want to show how clever they are rather than getting the job done." - sbsmac```
#

In this case -> Its smaller AND more efficient at the same time ๐Ÿ˜„

runic spoke
#

"programmers doing things because they want to show how clever they are rather than getting the job done." lol

jade abyss
#

^^

tired wren
#

thats the motto

runic spoke
#

wait wait, how long as select array been a thing?!

#

1.27 ๐Ÿ˜

#

how have i not known about this ๐Ÿ˜

thin pine
#

Because you live under a rock

#

๐Ÿ˜›

cerulean whale
#

Lel

queen cargo
#

to further support @jade abyss
the solution using toArray should also be slower due to new arrays being allocated etc.
one still has to test
but select already is faster due to less operations happening

jade abyss
#

โ˜ ๐Ÿ‘Œ

#

1 Command (select) VS erm.. toArray, ToString, Find, erm... what else?

queen cargo
#

not sure
but those are patterns i have to teach my linter sooner or later

#

mb i should write it down somewhere ๐Ÿค”

scarlet spoke
#

What do you mean by pattern? Can't your linter deal with the toArray-solution @queen cargo ? ๐Ÿ˜ฎ

queen cargo
#

Talking about code "warning"

#

When the linter tells you that you do can make it like so

#

But it would be better to do it differently

#

More code information... Not warning

scarlet spoke
#

Ahhhh... Alright I get it
But I think that barely possible to implement in a generic way. More like with using a database with "bad code snippets"

vapid frigate
#

is this SQFLint or is there another one?

queen cargo
#

@vapid frigate ArmA.Studio

vapid frigate
#

cool, having a look

queen cargo
#

Please just do not forget that it is in very early alpha currently and such things as static analysis still is todo

scarlet spoke
#

I think there are way too many linters in development atm

#

One as a standalone, one in ArmAStudio and one in my own plugin... xD

vapid frigate
#

ah ok, might wait then. just switched from NP++ to VSCode with SQFLint and SQF Language plugins.. impressed with that so far

#

only false positives in my code are _something = switch { } statements

scarlet spoke
#

Ha that's something SQDev can deal with!

#

(In case yoiu're interested) ๐Ÿ˜‡

willow basin
#

Unless BI Devs say command X is better than Y (deprecated) I'd not force anything into the linter. Linters should give adivces unless there is a grave mistake where the linter can be 100% sure of the developers mistake. Most linters don't know what the aim of the developer is or don't know the targeted product (take A3 as granted) and thereby give false advise.

vapid frigate
#

will have a look Raven, although i'm not a fan of eclipse

#

but only used it for java

scarlet spoke
#

I think you don't need much of eclipse for scripting SQF except as an environment... ๐Ÿ˜‰

vapid frigate
#

yeh, thinking about it, it's the setting up java stuff that i find annoying

scarlet spoke
#

So there are not many things that are integrated in the defautl eclipse workflow (I think)

#

Well you certainly don't need to do that for SQF xD

#

Or do you mean installing Java? ๐Ÿค”

vapid frigate
#

setting up libs/folders, etc

scarlet spoke
#

ah okay... Yep then you don't have to do that

#

The onyl thing that is required are a few preferences indicating some default folders but if you don't use some weird custom folder setup for your ArmA installation the plugin should auto-configure them for you ๐Ÿ˜„

#

</endAdvertisement>

vapid frigate
#

@pale pecan does this lint everything in my project or only when i open sqfs?

#

appears like it's everything which is pretty impressive.. didn't find any issues

#

out of 1000+ sqfs

scarlet spoke
#

Currently it only lints when you open in an editor... Project linting is planned for the future

vapid frigate
#

ah damn.. don't really wanna click on 1000sqfs to check them ๐Ÿ˜ƒ

scarlet spoke
#

Hahah yeah xD

#

Do you know you have an error somewhere in there?

vapid frigate
#

seems to remember the errors it's found or something.. i added an error (it showed as an error), closed the sqf, restarted eclipse

#

and it still showed it

little eagle
#

@queen cargo It's written Arma 3 and not "ArmA 3".

scarlet spoke
#

Yes it does remember errors... or rather the respective markers

little eagle
#

ArmA only applies to Armed Assault.

scarlet spoke
#

Well isn't Arma 3 Armed Assault 3?

queen cargo
#

@scarlet spoke ArmA.Studio technically is a standalone too
also it will not make mistakes like SQFLint with _foo = switch { ... } or try catch (yes, it is/was wrong in there)

though ... it will allow some non-valid combinations like [] then [] which are syntactically true but wrong from typing
that, however, is not part of syntax anymore and has to be added in the code analysis part of it

#

@little eagle ??

little eagle
#

ArmA-Studio is written wrong. Please fix. Thanks.

cedar kindle
#

no, it was called "ARMA: Armed Assault"

scarlet spoke
#

But that doesn't change the fact that there are a lot of independent developmnets going on ^^

cedar kindle
#

Arma 3 is simply "Arma"

queen cargo
#

it is not
it is an IDE for the ArmA series

scarlet spoke
#

Ah okay

little eagle
#

Arma Series

scarlet spoke
#

?

little eagle
#

not "ArmA series"

scarlet spoke
#

Of course it is

little eagle
#

Doesn't exist.

#

Fix it.

queen cargo
#

it still is in ArmA 3

little eagle
#

No, it's not. It's Arma 3.

queen cargo
#

that is where that casing also comes from
so no, nothing to fix

little eagle
#

wrong

jade abyss
#

wow, you guys got problems ๐Ÿ˜‚

little eagle
#

Fix your shit

queen cargo
#

it actually is @little eagle who is mad

#

for some reason

#

again

#

as usual

jade abyss
#

Battle of the Derps ๐Ÿฟ go on, peasants. Fight.

#

(waiting for the punch of both)

queen cargo
#

true indeed @scarlet spoke
reason for the one i wrote was that i could not find a single one suiting my needs being either C/C++ based or C# based and providing all the output i need

cedar kindle
#

only armed assault was ArmA

#

this is what BI gave steam

#

hence it's Arma

little eagle
scarlet spoke
#

That was no critics... I mean I'm doing something similar myself with my plugin
I just pointed out that there are a lot of people doing the linter stuff and everyone hsa problems one of the others has fixed ^^

little eagle
#

Check the spelling everywhere on this site:
https://arma3.com/

#

Arma not "ArmA"

jade abyss
#

๐Ÿ˜‚

scarlet spoke
#

Oh c'mon don't argue about Arma vs ArmA

jade abyss
#

sush Raven

#

be quiet

queen cargo
#

they already do

cedar kindle
#

there's nothing to argue about because it's Arma

scarlet spoke
#

xD

little eagle
#

There is arguing. X39 is just wrong as usual.

queen cargo
#

stylized always as "ArmA" ... yes

jade abyss
#

But cuel, the url! Its all lowercase!!11

scarlet spoke
#

๐Ÿคฆ

jade abyss
#

I say, its "arma".

cedar kindle
#

urls are default lowercase, it's a standard

queen cargo
#

false fact @cedar kindle

jade abyss
#

I hereby ignore your opinion cuel.

little eagle
#

Now open the URL and check how BI names their game.

jade abyss
#

and its also wrong.

scarlet spoke
#

Let's go full retro:
I say it has to be OFP!!!

little eagle
#

And it's Arma and not "ArmA"

cedar kindle
#

they can be case sensitive, but that's against the standard x39

jade abyss
scarlet spoke
#

+1

jade abyss
#

๐Ÿฟ

little eagle
#

In this pic it's actuall ARMA

cedar kindle
#

yes it's a stylish logo

jade abyss
#

omnomnomnom, so tasty popcorn ๐Ÿฟ

queen cargo
#

indeed @jade abyss

little eagle
#

but whatever

queen cargo
#

it is stylized as ArmA

little eagle
#

No it's not

queen cargo
#

unicode stylization in that crap is horrible ...

little eagle
#

That is not a small M you iditio

jade abyss
#

lmfao

scarlet spoke
#

Well as there are a lot of different ways to write it could we just assume the case doesn't matter?!

little eagle
#

รŽt does when X39 does it wrong.

queen cargo
#

@mods please ... end this crap of commy2

cedar kindle
#

BI has "Arma" on their twitter, homepage, and steam

jade abyss
#

My belly, he hurts ๐Ÿ˜‚

cedar kindle
#

so you're wrong

little eagle
#

^

scarlet spoke
#

Welcome to the kindergarten!

jade abyss
#

but the pic

scarlet spoke
#

I'm out

jade abyss
#

and the url

cedar kindle
#

yeah it's not funny anymore

little eagle
#

The pic shows ARMA, Dscha

jade abyss
#

@scarlet spoke Its called: Having fun ๐Ÿ˜‰

little eagle
#

That is not a small R or M

jade abyss
#

No, it shows: BIG A smaller RM BIG A

#

ARMA

little eagle
#

And the size of a letter does not mean the capitalization of it.

jade abyss
#

But there are fonts, who only have big sizes.

#

I bet thats the case here.

#

๐Ÿฟ =}

little eagle
#

You're making stuff up.

jade abyss
#

The whole time

little eagle
#

It's clearly Arma

jade abyss
#

Yeah, ArmA.

scarlet spoke
#

@jade abyss Fun? What is that? Can I eat it?

little eagle
#

And X39, as usual is wrong.

jade abyss
#

I am laughing pretty hard right now ๐Ÿ˜„

queen cargo
#

"as usual" is the most funny part actually

cedar kindle
#

it was funny a while ago now it's just lame

jade abyss
#

Not rly

#

Okay, background:
3 Germans are involved in this Convo.

#

Overprecise Germans (Stereotypes, you know)

little eagle
#

The rest can gtfo

jade abyss
#

๐Ÿ˜„

scarlet spoke
#

Actually 4 ๐Ÿ˜‰

little eagle
#

So in conclusion, "ArmA" does not exist and it's called Arma, and X39 is stubborn and wrong as usual.

jade abyss
#

3.5

scarlet spoke
#

Lol ^^

little eagle
#

And DScha ia a troll.

jade abyss
#

Yep.

queen cargo
#

that is an insult @little eagle

little eagle
#

It's also the truth.

queen cargo
#

not only that i never doubted that it is written as Arma

#

in every instance of BI

#

i just pointed out the truth that it is stylized as ArmA

little eagle
#

No, it isn't

queen cargo
#

and yes, sizing is styling

little eagle
#

R and M are upper case too

queen cargo
#

ok ... i admit ... you are trolling

little eagle
#

ARMA

scarlet spoke
#

#SizeDoesntMatter

queen cargo
#

and annoying too in this chat

little eagle
#

lol, check the image

jade abyss
scarlet spoke
#

xDD

little eagle
#

ok

queen cargo
#

maybe you are also just stupid as fuck ...

#

i dont know

little eagle
#

arma is fine

#

so is

#

ARMA

jade abyss
#

Or ArmA

little eagle
#

and
Arma

#

But not "ArmA"

cedar kindle
#

ArmA is just annoying to type and it's literally wrong

little eagle
#

^

jade abyss
#

But, how do you shorten ArmedAssault?

#

ArmAss?

cedar kindle
#

yes

jade abyss
#

I mean, AA is already taken.

barren magnet
#

I read alot of arma here >.>

proven crystal
#

"Over"precise?? Whats that?

#

Uh... seems to have been an older bit of conversation ^^

scarlet spoke
#

Don't restart it xD

proven crystal
#

Just saying precision is an art, a philosophy. A way of life :)

scarlet spoke
#

๐Ÿ‘

frank radish
#

ArmAss sounds way too lewd

#

just stick to Arma

thin pine
#

Commy and X39 need to get a room. There's clearly some unresolved sexual tension between the two of you

queen cargo
#

not my fault @thin pine
I am sexy and i know it ๐Ÿ˜

#

he just cannot resist my taste

split coral
#

Guys, this is not right channel for that.

still forum
#

ArmA3.com ๐Ÿฟ

little eagle
#

There are people that think "R" is a lower case "r" just because it's written small.

queen cargo
#

never said that btw.
but it is ok @little eagle
you also do not need to use my tools

little eagle
#

You said look at the logo lmao

plucky beacon
#

Meanwhile in scripting channel, we can see the scripters in their natural habitat arguing about the semantic's of the game's title

jade abyss
#

That was me, @little eagle ๐Ÿ˜„

little eagle
#

Schรคm dich.

jade abyss
#

nรถ

#

boorrrnnn to be trrooollll
*sing*

little eagle
#

Your mom must be proud of you.

jade abyss
#

yep =}

#

btw.: Anyone knows a Workaround for: "Ropes attached to planes disable the Plane Simulation"? :/
Also disables the Engine completely.

plucky beacon
#

my guess would have been use an event handler to reenable the simulation

#

but i'm guessing you tried that

polar folio
#

wait, you can't make an object without collision with createSimpleObject? that's lame. or am i missing something?

plucky beacon
#

I'm pretty sure simple objects basically only have collision. No damage, cargo, or anything. Just a model and texture

scarlet spoke
#

Is there a way to reference a perFrameHandler in CBA from the handler itself? So e.g. add a PFH that checks a certain condition and if that is true it executes some code and then removes itself from the PFH-list?
As I'm typing this that what I'm searching for is the waitUntilAndExecute function but out of interest... Would it be possible?

little eagle
#

[_this select 1] call CBA_fnc_removePerFrameHandler;

scarlet spoke
#

is it always select 1 or is it always at the end of the argument-array?

#

Or are the arguments bundled in a nested array at index 0?

little eagle
#

0 is the passed arguments

#

1 is the PFH id

scarlet spoke
#

okay thx

rotund cypress
#

I have been asking myself a long time, is using private _variable = much faster than using private ["_var1, "_var2"];, or is it only an negligible difference?

still forum
#

Well...

#

When assigning a variable the engine automatically checks if there is a private before that. So if you have it or not. The check is done. Also this check is done at compileTime(preprocessFile) so this is only done once per script
private ARRAY
is a script call. Meaning it has to lookup the function. Check if the argument is correct type. and then convert the strings to variable names and define them as empty. Which is also done everytime the script is executed.

#

You can make that out yourself if that is negligible. One has 0 runtime overhead. And the other one has some. Which is several infinite times as much runtime overhead. Like... Simple infinity isn't even enough to express that

rotund cypress
#

Alright, thanks

plucky beacon
cedar kindle
#

@rotund cypress private _var is also 10 times easier to read

rotund cypress
#

I know

#

That is why I have always used it

cedar kindle
#

and it's easier to rename

rotund cypress
#

Well if you have more than one define for a variable

#

You will still have to rename it more times than 1x

#
private _var = 1234;
......
_var = 4321;
cedar kindle
#

ofc

open vigil
rotund cypress
#

But yes, I don't see why people use array type of privatizing variables

open vigil
#

All caps, but the A's were bigger

plucky beacon
#

Fonetics

cedar kindle
#

probably some old guide @rotund cypress

rotund cypress
#

Cause of the word Assault

polar folio
rotund cypress
#

๐Ÿคฃ @cedar kindle

#

no

#

Not cause of some old guide... when you look at other peoples code u often see privates in array type. For example, exile uses that method throughout their codebase

still forum
#

People use private array because back in the day they were not aware that you could local variables (private was called local back then)

cedar kindle
#

what i meant was, when they learned sqf the guide was using private ARRAY

rotund cypress
#

Oh

#

Maybe

still forum
#

And People who made SQF guides ofc did the same

rotund cypress
#

But, why does Exile i.e. not adapt ๐Ÿ˜ญ

cedar kindle
#

@still forum it was only called local for a single patch, think it was 1.52. didn't exist before that afaik

still forum
#

Because they are lazy and don't care about having good performing scripts?

#

^^

cedar kindle
#

except the command

rotund cypress
#

Well, who the fack does that

#

Especially when speaking about ArmA

still forum
#

I'd say local existed back in Arma 2

rotund cypress
#

You would generally like to have as optimised as possible

cedar kindle
#

yes the locality command, not the variable kind

still forum
#

Well.. Exile,Life, whatever.. They all have shit scripts. But no one cares

rotund cypress
#

@jade abyss IIRC I think you always use private with array type?

#

Any reason?

#

Also, IIRC BIS used private w/ array type for the last field manual update

vapid frigate
#

the other syntax only came in quite recently?

jade abyss
#

habit

rotund cypress
#

One thing I don't get is why BI does it as well

#

Karel Moricky etc...

still forum
vapid frigate
#

ah ok, i meant private _var = x;

little eagle
#

local _var = 1;

still forum
#

So they were both there since the beginning. local keyword was renamed to private in 1.53

little eagle
#

Just that no one knew about it

rotund cypress
#

Even though some people would say it's a habit, why not change that habit? Is it really that hard?

cedar kindle
#

kk added the alt syntax in 2015 from what i can tell

tough abyss
#

Until now...

still forum
#

@cedar kindle which alt syntax?

cedar kindle
#

local _var =

little eagle
#

No, that has been around since A2 at least.

#

Just that, as I said, no one knew it existed.

#

Still exists in A2 today.

still forum
#

I see what you mean. Lemme check something

#

Okey. No local _var existed back in 2012 and previously in Arma 2. Apparently wasn't on the wiki tho

vapid frigate
#

kinda confusing using 'local' anyway since it usually means something totally different

still forum
#

Yes. Everyone was confusing that back then

little eagle
#

That is why it was changed to private like one month after it was discovered.

austere granite
#

Is there anyway to exit aim down sight for infantry through script, with the normal animation type thing. Using camerview "INTERNAL" instantly switches, whereas pressing right mouse again would zoom out

little eagle
#

No.

still forum
#

BI scripters probably also didn't know it existed XD That's why it's not used in a ton of their scripts. Engine devs knew it. But they weren't doing scripts

austere granite
#

qq ๐Ÿ˜ฆ

scarlet spoke
#

Does createUnit wait for the unit to be created before it returns? Or does it simply queues the unit up for creation and then retruns immediately?

little eagle
#

@austere granite try switchCamera "GUNNER"

#

But it has it's problems since you can't choose which scope to look though.

cedar kindle
#

the unit will exist directly after the command raven

austere granite
#

Gunner does into aim down sight, using it when you're already ads does nothiong unfortunately.

little eagle
#

Yes, @pale pecan The new syntax creates the unit and reports the correct unit reference immediately and there is no delay.

scarlet spoke
#

Hm okay... Any ideas why it might not exist directly afterwards? I'm running this in unscheduled env.

little eagle
#

Dunno why people keep claiming there is.

scarlet spoke
#

Or maybe the init script needs a little delay before being run?

little eagle
#

Use the other syntax.

scarlet spoke
#

Bc I'm naming the unit in it's init and am referring to it directly after createUnit

#

Which one?

little eagle
#

The new / alternative one.

#

The one without the init script

#

The one with init script, the old one, can go into the trash.

scarlet spoke
#

Ahhhhh yes! Thank you! ๐Ÿ˜ƒ

#

I never considered that an alternative syntax can have a different return value

little eagle
#

If you need the object reference on all machines, publicVariable

plucky beacon
#

do event handlers overwrite if you don't use stackable ones?

scarlet spoke
#

Afaik yes

plucky beacon
#

Is that a reliable method of replacing an event handler?

little eagle
#

The ones added via onX (e.g. onEachFrame) do.

plucky beacon
#

I think I might be onto a solution then

cedar kindle
#

which EH drifting?

little eagle
#

BIS_fnc_addStackedEventHandler

#

But anyone else using the onX variant still overwrites you.

#

Or you overwrite them by using BIS_fnc_addStackedEventHandler.

#

onX is deprecated and should not be used. It's even on the wiki, but some people are stubborn and the stubborn ones are idiots too most of the time and idiots tend to always use the wrong method.

#

Like writing "ArmA"

subtle ore
#

Can the addStackedEventHandler be used for any event handler? Or just the ones that are stackable?

plucky beacon
#

@cedar kindle the killed one

little eagle
#
"onEachFrame"
"onPlayerConnected"
"onPlayerDisconnected"
"onMapSingleClick"
"onPreloadStarted"
"onPreloadFinished"
#

So they don't work for onTeamSwitch

subtle ore
#

Sweet. Thanks for that.

vapid frigate
#

maybe you want this

plucky beacon
#

because if it's the case with overwriting event handlers I could track the last unit to have dealt damage to it by just adding a killed handler every time someone hits

cedar kindle
#

Killed EH does not replace / overwrite

plucky beacon
#

dam

#

nevermind

little eagle
#

Generally

#

addXEventHandler

#

adds

#

setXEventHandler
sets (overwrites)

#

Except for addPublicVariableEventHandler, which is a setter despite it's name.

#

But I guess you "add" one for each variable name

plucky beacon
#

hmm

scarlet spoke
#

Does anyone have an idea why my unit gets immediately "recreated" when I press Respawn in the pasue menu? I'm using a custom respawn system that uses a respawn UI that is blended it in the onPlayerKilled and it works fine for normal deaths and player setDamage 1... I guess the respawn button does more than simply killing the player?

jade abyss
#

You using respawn EH?

scarlet spoke
#

No

#

I have configured it via a RespawnTemplate

#

Should I?

rancid pecan
#

Hello all

#

In the editor the objects go under. What's the reason ?

#

Under the ground

scarlet spoke
#

On a pier?

rancid pecan
#

No, anywhere

#

Is the photo sent?

scarlet spoke
#

nope

rancid pecan
#

I send a screenshot?4

tough abyss
#

Is this a valid syntax? ```SQF
x = 1;
while (x < 2) do {
// Stuff
} else {
exitWith {};
};

scarlet spoke
#

No

#

else expects an if-type

#

and you can't use exitWith without an if either

distant egret
#

And While uses code as condition @tough abyss

turbid thunder
#

Yeah. While is just a loop, but you can have if conditions in your while loop. Just make sure that you have something that can stop the loop when you dont need it anymore

tough abyss
#

Thanks.

tepid pollen
#

@vapid frigate @jade abyss Lecks your solution may or may not work better, but at this point I'm just happy to have a working script by using Dscha's method. Only problem is, typeOf cursorTarget only returns what I want it to when a uniform was spawned on the ground. When a player places it on the ground and tries the action, which is actually the only scenario in which I intended for the action to be used, the typeOf cursorTarget is actually GroundWeaponHolder. A bit frustrating considering how long it took to get it working and then for it to be inherently useless, but it should be an easy fix, now that I actually kind of know what I'm doing.

#

@rancid pecan You can hold alt to adjust the height of objects and units in the editor

rancid pecan
#

I know. my problem. Under the ground

#

object is Under the ground

#

Things go under the ground

tepid pollen
#

very strange... what map? is it all objects or just some? I think you are able to make them go above the ground by holding the alt key and dragging them up enough.

subtle ore
#

Is there any way to check if a config entry for uniforms is one side or another? Whenever i try and pull "side" from one it always returns 3.

#

(getNumber(_x >> "side"))

#

@tepid pollen when a player drops something on the ground, it doesnt just get placed on the ground as a invidiual uniform. It gets placed in a holder, kind of like a vehicle.

meager granite
#

0 is opfor, 1 is west, 2 is resistance, 3 is civilian

tough abyss
#

Relating to the player's cursor on the map: is there a way to get the position its looking at on the map?
It must be possible because we can place markers, but I havent figured out how to do it.

still forum
#

onMapSingleClick

#

you can get it when he clicks. But I don't think you can get it otherwise

still forum
#

Yeah but how to get the screen coords of the cursor?

plucky beacon
#

How do I use isKindOf with the config viewer? how do I know what 'kind' a thing is

little eagle
#

the base classes

plucky beacon
#

too bad there is no ctrl f in config viewer

little eagle
#

That's why I use the all in one config.

#

That and the all in one config isn't sorted alphabetically, but how the entries are added, which makes more sense most of the time

#

(tooltip right after displayname etc.)

plucky beacon
#

what's the all-in-one config

little eagle
#

dump of the vanilla master config

plucky beacon
#

just raw text?

little eagle
#

a .cpp file, yeah

plucky beacon
#

is that in the A3 addon?

little eagle
#

No, you have to make it.

plucky beacon
#

uuuugh

#

take all the configs out?

little eagle
#

idk how it's made, someone else uploads them and I use them

plucky beacon
#

Pennyworth apparently

tough abyss
#

@little eagle Thanks man! ๐Ÿ˜„

#

Hi, I'm having Undefined base class Life_RscButtonInvisible

#

Does anyone knows how to fix it?

still forum
#

I'm building my AIO configs by calling the engines ExportConfigToTextfile function. Outputs everything very nicely formatted and without syntax errors.
Most other people use scripts to print config to file though. But that sometimes messes the config up because some lines get truncated

tender fossil
#

Dumb question: what's the script command to spawn an object into gameworld?

thick oar
#

Createvehicle. Have a look at the official wiki

#

As a beginner it's a good idea to just browse this page to get an idea of what is out there and available. Cant search for something you've never heard. ๐Ÿ˜ƒ

little eagle
#

There are different commands depending on what kind of object you want to spawn.

#

createX on that wiki page is a good place to start though.

tender fossil
#

Ah, createVehicle of course haha

#

I had a blackout... I'm embarrassed now lol

#

Thanks anyways ๐Ÿ˜„

subtle ore
#

@meager granite yes, that is why i used getnumber. I know it wasnt going to return a string. But even with blufor based uniforms keeps returning 3

#

I wonder if side is there only for the purpose of disallowing indie forces and such wearing blufor uniforms?

tender fossil
#

I think it was design decision at least back in launch @subtle ore

#

Not completely sure though

#

But thinking about it, I think they changed it

subtle ore
#

Agh, well switch in plans then. Damn it.

tender fossil
#

Don't rely on me alone @subtle ore , not sure about it, just trying to remember it

dusk sage
#

You can force them to wear the uniform

subtle ore
#

@tender fossil yeah i understand. I was just hoping there was something i had done wrong or something i was missing

#

@dusk sage yeah, im just trying to filter uniforms by sides.

turbid thunder
#

Well, I think some ethical reasoning went into that aswell, but I'm kinda glad they made it so you cant just equip enemy uniforms because that would make PvP matches waaaaay harder, also, the AI would need adjustments to account for the player having their uniform. One thing I did notice though is that all civilians can freely equip uniforms from ALL sides. So, if you want to have a unit without a uniform restriction, take a random civ and group him blufor / opfor / indfor depending on where you need him and then just apply regular blufor / opfor / indfor uniform and equipment to him so he looks like a normal soldier.

EDIT: I admit I actually dont know the exact reason why they did it but you can bypass it as described above w/o scripting. AI's wont respect it though

EDIT 2: I dont actually know if that is what you even wanted to know but I'll just leave it here in case it might be useful for someone >_>

peak plover
#

Hey, since the community sites are down, anyone know any good debug commands from the back of their head?

#

Are there any that display scripts running?

tiny wadi
#

quick question since the wiki is down, how do I check when a slider is changed on a dialog

#

i want to call a function when it changes

little eagle
#

allDisplays

#

?

#

ui scripts usually run unscheduled and in eventhandlers, so no "running scripts".

peak plover
#

There should be an event for sliders

tepid pollen
#

Can someone help me get the correct syntax of remoteExec-ing the alternative syntax for sideChat? E.g. get [west, Commander] sideChat "Enemies in the base!" to remoteExec? I know I should probably use a script but I have many triggers like this and I don't want to have that many scripts if possible

tiny wadi
#

There is something you put in the control class

#

similar to action i belive

little eagle
#
[commander, "Enemies in the base!"] remoteExec ["sideChat", [west]]

???

#

Dunno if remoteExec works with sides

halcyon crypt
#

if only the biki wasn't down ๐Ÿ˜›

tepid pollen
#

it has targets, says side is a valid option for that field

#

i had it open before it went down, fortunately

halcyon crypt
#

hmm a lot of stuff is down :/

peak plover
#

@tiny wadi onSliderPosChanged = "systemChat str ['onSliderPosChanged',_this]; false";

halcyon crypt
peak plover
#

It's somewhere near 2am in czech

halcyon crypt
#

I guess someone got banned ๐Ÿ˜

tiny wadi
#

thanks @peak plover

arctic veldt
#

@plucky beacon You there? :p

plush cargo
#

@tiny wadi sliderPosChanged

#

sry dunno wtf happened but my chat was way behind

peak plover
#

my ai seem to be "learning"

#

The opfor all started at the south part

#

But it's been about 500 units through

#

and they won't take the direct route anymore

#

They ALL want to flank now

#

Any way to disable this behaviour?

#

tried disabling autocombat & fsm. nothin

half monolith
#

I have a question about an arsenal script im working on/with. it wasnt putting grenade launcher ammo in the box and i was able to solve that, the arsenal was looking for the word "shell" I am still looking for a way to put in the ammo for launchers and dont know the correct word the arsenal is looking for

plucky beacon
#

@arctic veldt ya?

tender fossil
#

Thought of the day, quoting my CS course: "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler, Refactoring: Improving the Design of Existing Code, 1999

tough abyss
#

if i can read it, the computer can read it, and it works, then it does not matter ๐Ÿ˜„

arctic veldt
#

@plucky beacon Can I get a hand with sorting the attach weapons piece through debug for a go kart? ;D I tried working it out earlier to no avail ๐Ÿ˜ข

plucky beacon
#

I'm sure you can figure it out man, as you make missions you'll put the pieces together

vague hull
#

any way to work around the game freeze when using htmlLoad with URLs?

little eagle
#

no, but try preloading it during the mission start.

#

postInit or something

vague hull
#

already doin so but a 5 second game freeze is never that nice tbh

little eagle
#

If you do it correctly, there is no game freeze, but the loading bar takes 5 seconds longer. That should be fine.

peak plover
#

@plucky beacon You get points based on damage inflicted? That's pretty cool

vague hull
#

then how to do it "correctly"?

little eagle
#

During postInit

#

So the loading bar gets extended for 5 seconds and the freeze isn't visible in mission.

vague hull
#

"there is no game freeze" != " the freeze isn't visible"

#

But I get the point

little eagle
#

Yeah, there is no magic way to eliminate the loading time.

vague hull
#

not asking for that

little eagle
#

So you preload it when a loading bar is shown anyway. That's how it's done with everything.

vague hull
#

just a way not to halt the game would be nice ๐Ÿ˜„

little eagle
#

You do that by preloading it during the loading screen.

#

Remember how 3den stopped when you placed your first unit? That was the game loading the animations. Now it's done when starting the game instead - preloaded.

thick oar
#

In fact anims are cached even. So first time loading takes a bit longer. Following loading times are reduced when the cache is used.

halcyon crypt
#

is this animation preloading thing something new?

#

last time I had the editor open with the -world=empty parameter it would still load the animations when placing a unit in eden

#

so "technically" it isn't (or wasn't) preloading but it was just a side effect of loading the intro ๐Ÿ˜›

little eagle
#

It no longer does this.

#

Sure the first unit takes a bit longer than subsequent ones, but it no longer freezes the game for seconds.

tough abyss
#

Is there a way to prevent a unit from dying? Sending it instead into an unconscious state? Something like this, perhaps: ```SQF
_this addEventHandler ["killed", {
params ["_unit"];

_unit setUnconscious true;
_unit setDamage 0.5;

}];

little eagle
#

if killed eventhandler triggers, the unit is already dead. The only way to prevent death is allowDamage false or a handleDamage eventhandler.

#

Note that the unit can still die by drowning and setDamage 1.

jade abyss
#

iirc also by hitPoint damages

tough abyss
#

Like this? ```SQF
_this addEventHandler ["handleDamage", {
params ["_unit"];

if ((damage _unit) => 0.8) then {
    _unit setUnconscious true;
    _unit setDamage 0.5;
};

}];

jade abyss
#

also negate the dmg with a erm... i think it was "true" at the end

#

Otherwise select the damage at the end

#

uno momento

tough abyss
#
_this addEventHandler ["handleDamage", {
    params ["_unit"];

    if ((damage _unit) => 0.8) then {
        _unit setUnconscious true;
        _unit setDamage 0.5;
    };
    true;
}];
``` Like that?
scarlet spoke
#

I think the EH has to return the damage that is to be applied

#

But let @jade abyss do his research to be sure ๐Ÿ˜ƒ

jade abyss
#
_this addEventHandler ["handleDamage",
{
    params ["_unit","_hitSelection","_damage"];
    if ((damage _unit) => 0.8) then {
        _unit setUnconscious true;
        _unit setDamage 0.5;
        _damage = true;
    };
    _damage
}];```
#

for example

rotund cypress
#

You are correct @scarlet spoke

jade abyss
#

wait a sec...

rotund cypress
#

Just true wont work

jade abyss
#

does

#

*edited

tough abyss
#

Thanks @jade abyss.

rotund cypress
#

How does that work? What damage does it set then?

jade abyss
#

Gonna check my old files.

#

Or was it false? idk.

#

could be false. Since false = 0

#

@tough abyss

#

True could him, once the EH is triggered

rotund cypress
#

So then it would return 0 damage which would not work in his case

tough abyss
#

I'll try it with both false and true.

rotund cypress
#

Or just return a number between 0 and 1

jade abyss
#

erm

#
_abc = [true,false] select false;
systemchat str _abc; // _abc = true;```
```sqf
_abc = [true,false] select true;
systemchat str _abc; // _abc = false;```
```sqf
_abc = [0,1] select false;
systemchat str _abc; // _abc = 1;```
```sqf
_abc = [0,1] select true;
systemchat str _abc; // _abc = 0;```
rotund cypress
#

Wat

#

Oh

tough abyss
#

"Missing )".

#

Wot.

scarlet spoke
#

So basically returning true would immediately kill the unit ๐Ÿค”

jade abyss
#

Should^^

rotund cypress
#

Seems so

tough abyss
#

The game claims there's a missing ).

scarlet spoke
#

One Boolean to kill them all!!! ๐Ÿ˜ˆ

#

In which version?

tough abyss
#
_this addEventHandler ["handleDamage", {
    params ["_unit", "_hitSelection", "_damage"];
    if ((damage _unit) => 0.8) then {
        _unit setUnconscious true;
        _unit setDamage 0.5;
        _damage = false;
    };
    _damage
}];
rotund cypress
#

So then in his case a bool wouldnt work since that would kill the unit

jade abyss
#

Where do you add that?

scarlet spoke
#

I think the command is <= and not =<

tough abyss
#

Inside a unit's init.

jade abyss
#

=
=<

scarlet spoke
#

Yeah that's what I mean ๐Ÿ˜›

little eagle
#

This won't work, @tough abyss , because the return value of damage is updated after the HandleDamage event.

scarlet spoke
#

Wait... the second example is the wrong one right @jade abyss ?

rotund cypress
#

No

#

@scarlet spoke

jade abyss
#

Who is talking to who now

#

oO

rotund cypress
#

= or =<

jade abyss
#

@little eagle sush, let him find that Prob on his own, that he has to calc _damage to it, beforehand ๐Ÿ˜›

tough abyss
#

Yeah the dude just dies.

scarlet spoke
#

@sudden breach that's not what the wiki says...

rotund cypress
#

Finn Simmons?

jade abyss
#

Who is FinnSimmones?

#

lol

scarlet spoke
#

Fuuuu

little eagle
#

lmao

tough abyss
#

Calc _damage?

jade abyss
#

if( (damage _unit + _damage) > 0.95) -> Negate dmg form the Handler and setDamage to 0.95

#

kinda like that

tough abyss
#

Doesn't work.

jade abyss
#

Do i wanna know, what mess you made?

tough abyss
#

Is this a mess? ```SQF
this addEventHandler ["handleDamage", {
params ["_unit", "_hitSelection", "_damage"];
if ((damage _unit + _damage) > 0.95) then {
_unit setUnconscious true;
_unit setDamage 0.5;
_damage = false;
};
_damage
}];

little eagle
#

yes

jade abyss
#

{ always belongs in the next line

#

*rantaround*

#

lol marcel

halcyon crypt
#

๐Ÿ˜„

jade abyss
#

XD

still forum
jade abyss
#

And again Nevithor, where do you add that?

queen cargo
#

Handle damage expects numeric

#

Remove the setdamage

tough abyss
#

In a unit's init field.

little eagle
jade abyss
#
player  addEventHandler ["handleDamage", 
{ 
    params ["_unit", "_hitSelection", "_damage"]; 
    _damage = false; 
    _damage 
}];```
Works - No damage at all
queen cargo
#

Initialize _damage with the current damage passed to you

#

And just modify the damage if needed

sudden breach
#

@scarlet spoke I was about to say ...

scarlet spoke
#

Sry I selected the wrong mention xD

sudden breach
#

๐Ÿ‘Œ

jade abyss
#

@tough abyss
Check if that works in the Init:

this  addEventHandler ["handleDamage", 
{ 
    params ["_unit", "_hitSelection", "_damage"]; 
    _damage = false; 
    _damage 
}];```
#

Then shoot that Motherhugger

queen cargo
#

Handle damage is one of the most simple events commy2...

little eagle
#

ahaha

scarlet spoke
#

Guys don't start a bashing again xD

jade abyss
#

I must disagree, X

#

handleDamage is pita, when it comes to Hitpoint Damage and normal Damage

#

Since they don't update eachother

little eagle
#
this addEventHandler ["handleDamage",  {
    params ["", "", "_damage"]; 
    _damage min 0.8
}];
jade abyss
#

Try this: Get in a car, drive against a wall -> Check your dmg, then check your allHitPointsDamage

#

you will see, what i mean then.

still forum
#

QGVAR($HitFace) ๐Ÿ˜ฎ you can use $ in variable names ๐Ÿ˜ฎ

scarlet spoke
#

dafuq?

little eagle
#

@still forum It's for Travis.

scarlet spoke
#

But is it valid in SQF?

little eagle
#

And yes you can with setVariable

jade abyss
#

@queen cargo Stop writing Kuschelromane.

#

Press enter

scarlet spoke
#

But not in a normal declaration?

little eagle
#

No.

scarlet spoke
#

lol

#

Okay

still forum
#

That may come in handy someday...

queen cargo
#

Pff... Handle damage still is simple
You guys just are using it for stuff it was not designed for initially

#

Not Rly doing that

little eagle
#

Thanks for nothing.

scarlet spoke
#

You took so long to write those 2 line @queen cargo ? xD

queen cargo
#

Currently on Mobile

jade abyss
#

again you Turtlehead, X:
Try this: Get in a car, drive against a wall -> Check your dmg, then check your allHitPointsDamage (or whatever the command was)

little eagle
#

@still forum I frequently use $ as separator for dynamically generated variable names.

#

It has the benefit of not being a valid char in configs, so you can avoid collisions when piecing together classnames.

tough abyss
#

Thanks @little eagle, your's sorta works.

#

Just need to add setUnconscious .

little eagle
#

Only sorta. If the damage is high enough, you will die regardless.

#

Especially in MP with "all the locality" going on.

tough abyss
#

Shit.

#

That isn't desired behavior.

little eagle
#

It's all broken and shitty and over complicated.

jade abyss
#

Yerp

queen cargo
#

Hitpoints for units is poorly implemented @jade abyss

jade abyss
#

HitPoints AND the locality is the Buttf...

tough abyss
#

@lavish ocean pls fix tnx

queen cargo
#

Was introduced for some stuff and never polished

jade abyss
#

@tough abyss We told you what to do: We also gave you some examples, now gogogo, try it on your own ๐Ÿ˜‰ Thats how you learn it =}

queen cargo
#

However, handle damage works perfectly fine for what it got designed for in first place

little eagle
#

Well. Not really.

jade abyss
#

Not anymore, since hitPoints came in

#

Example: your damage can be 0

#

HitHead = 1 == Dead

little eagle
#

even a simple handleDamage always returning false still kills you when running out of oxygen under water or blows up a heli when it hits the water.

#

And when a heli crashes, it spawns particles every frame killing the server

jade abyss
#

Yeah, but thats another Event, tbh. (drowning)

little eagle
#

Its broken.

queen cargo
#

Handle damage still was not designed for Hitpoints :P

tough abyss
#

Why does it return them then?

jade abyss
#

Yeah, so it doesn't work as intended anymore

#

return?

little eagle
#

as arguments in _this

#

reports, not returns

jade abyss
#

ah

#

Because: Reasons.

tough abyss
#

Aren't selections = hint points?

#

๐Ÿ‘€

jade abyss
#

(Since Arma 3 v 1.67)

#

Ah, that explains alot.

#

sneaky sneaky

little eagle
#

multiple hitpoints can use the same selection

#

And some selections don't have hitpoints, yet still can take damage

#

E.g. some lights on a car.

jade abyss
#

for example, yeah

tough abyss
#

I'll go with "broken".

little eagle
#

Also, selections can share hit-points and parts of the same fire geometry with other selections.

jade abyss
#

But at least, you can now disable the "damage" overall and just use hitPointDamage (or otherwise, if you want it simple)

tough abyss
#

Why does fire even have geometry?!

little eagle
#

Before getAllHitPointDamages it wasn't even really possible to decide which HitPoints from config even are respected by the game (have valid selections).

#

Also there can be multiple hitpoints that share the same name in one object

#

E.g. HitTurret and HitGun exist for the main gun of a tank, but also the commanders optics

#

The difference is the selection

tough abyss
#

Sounds to me like the whole thing needs trashing and rewriting...

little eagle
#

Hitpoints shouldn't ever be used in the scripting tbh. If you want to be accurate, you either use the selections or the hit indecies.

jade abyss
#

tbh. removing "damage" should be removed.

#

hitPoints only damge

little eagle
#

Although you have to know which hitpoint belongs to the selection to know which effect it has on the vehicle

#

E.g. a tank blowing up when HitFuel reaches damage >0.9

tough abyss
#

I just want a unit to go unconscious instead of dying... ๐Ÿ˜ฆ