#arma3_scripting

1 messages ยท Page 422 of 1

west grove
#

yeah, that's doing it. thanks!

meager heart
#

np

steady galleon
#

anyone know how to setBehavior on UAV AI? I'm trying to make another vehicle a UAV via config but since I can't change the behavior of the AI crew (B_UAV_AI) from careless the driver remains turned out.

#

that or force turn in the driver.

fleet wind
#

Dont know in what channle to ask but does anyone know where the pictures you see spinning of faces when you are aboutto change are stored? http://prntscr.com/i9iao6 (The actual animated picture on the right)

strong canopy
#

Is there anyone about that could help me with a trigger?

#

Im not too savvy with scripts ๐Ÿ˜ฆ

#

this is what im struggling with

#

0 = [] spawn {
_center = createCenter sideLogic;
_group = createGroup _center;
_pos = getpos arrow3;
_CAS = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""];
};
for bubble1 do {
_bubble = missionNamespace getVariable ("delay1" + bubble1);
_bubble hideobjectglobal 1;
};
null=[] spawn {sleep (60+(random 60)); trigger1 setvariable ["delay1",true]; trigger1 setvariable ["delay1",false]; playSound3D ["pop", bubble1] [format["<t size='1' color='#ff7700'>%1</t><t size='1' color='#ffffff'> called in an airstrike</t>",profileName],""] remoteExec ["ST_fnc_hintSound",0];

still forum
#

@lone glade [] is a string yes.... {} is config array.

#

@strong canopy Don't see problem

tough abyss
#

@still forum Seen slack?

still forum
#

I'm not fully online yet

#

First checking all the few hundred discord messages, then emails and whatsapp, then open a youtube video that i can listen to while I check the rest, then github, then slack, then armaworld, then BIF, then check BIKI edits for crap, Then go back to Discord to read the stuff I missed while checking other stuff

tough abyss
#

Rip

still forum
#

Also I gotta make myself some curryrice with fishsticks or I'll starve

peak plover
#

Questione,

Anyone think it's a bad idea to use some locations for some stuff I wanna do and I need to use nearestLocation etc.

unkempt heron
#

Explain more @peak plover

still forum
#

Dunno if locations are in a seperate list or quadtree compared to other objects

#

if they are then that's probably the best solution

peak plover
#

nearestlocation

still forum
#

?

#

random script command without any comment?

#

apply

peak plover
#

So

#

If there's anything else, that's not created by me

#

it will find that instead

still forum
#

Even by vanilla there are tons of locations on the map

peak plover
#

Just wondering if anyone else uses them at all or ?

still forum
#

And the CBA namespaces are also there

peak plover
#

I used that before

#

But I use the invisible and named ones

still forum
#

you mean if someone looks for a location he might accidentally find yours instead of what they wanted?

peak plover
#

Okay exactly

still forum
#

I can see some noob mission maker doing that yeah

strong canopy
#

@dedmen when I try to run it it says "type array, expected nothing"

still forum
#

expected nothing???? What ex....

#

for bubble1 do { That's invalid

#

unless that's an array I guess

strong canopy
#

Gonna be honest, Im a propper noob at this, I just cobbled together bits of code I found

still forum
#

I don't even know what that for code is supposed to do

strong canopy
#

If your free could you come on TS so I could explain?

still forum
#

no

tough abyss
#

Lol

still forum
#

I don't talk

strong canopy
#

what litterally?

#

Thats sad lolk

#

lol

tough abyss
#

Paste the script and we can help

still forum
#

It's pasted above

#

above your first message to me today

tough abyss
#

Ah

#

Hmm wtf

strong canopy
#

lol

#

never a good sign

tough abyss
#

No that expression means my eyes died because of spawn

little oxide
#

It's possible to make the night vision like night at day time ?

still forum
#

You can set the time to night when NV is turned on and set it back to day when it's turned off

little oxide
#

Yeah but i want to be MP compatible, and it's not possible to set the time locally in mp, with the sync of arma

still forum
#

really?

#

That was my idea

#

you can have local weather so I thought why not time

#

In multiplayer, the effect of this command is local, not global. [...] However, if you run this command in the middle of the mission, effect is local.

#

Ah... So it's global yeah?

little oxide
#

Yeah but changed now

#

if I remember right, if you execute skiptime, to set date, he will directly come back to server date

#

but never tested with setdate

still forum
#

skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time.

#

Yes.

peak plover
#

I guess I can use nearLocations and filter them with getVariable

#

Lose some speed, but locations still seem to be the fastest, compared to other alternatives

peak plover
#

ahhh

#

so, locations are local

#

Can I somehow send them to clients?

#

like setVariable as public ?

meager heart
#

๐Ÿค”

lone glade
#

afaik locations are entities and thus broadcasted

zinc geyser
#

scripting noob here... what is the best way to get a vehicle classname if you have the displayname?

lone glade
#

you can't

#

well technically you can but it's stupid

zinc geyser
#

well that's a bummer... ๐Ÿ˜ฆ

young current
#

why do you have only the display name

#

how do you get that

#

and what do you need the class name for

#

@zinc geyser

zinc geyser
#

basically I've crawled through the configs and grabbed a list of vehicles , got the display names, populated a listbox, and sorted the listbox by displayname (OCD). When someone selects the an item on the list, I need a way to return the classname.

still forum
#

@peak plover can't nearlocations filter bz classname?

lone glade
#

why the hell did you get the display names instead of their config name

still forum
#

@peak plover no you can't send local things via publicVariable. Had that topic yeserday

pliant stream
#

you could keep a parallel array of configs

zinc geyser
#

i got the config name but the display names are sorted the config names arent

lone glade
#

...

#

you can get the display names from the config name

pliant stream
#

sort the configs beforehand?

lone glade
#

you can't do the opposite without going through each fucking class ever

zinc geyser
#

sorting the classname will not end up with the same result as sorting the display name

pliant stream
#

sort by displayname

zinc geyser
#

that is what I did

pliant stream
#

so the list view sorts differently?

errant jasper
#

In description.ext, can you somehow concatenate an eval'ed value. Something like:
MAKE_NAME NAME_##__EVAL(nextID)

brave jungle
#

Hey guys how can I retreive data from a database using extDB3?

zinc geyser
#

yep

pliant stream
#

can you disable sorting in the list view?

lone glade
#

.....

zinc geyser
#

@lone glade... not sure I'm articulating it to you right

lone glade
#

you can make an array of config names, retrieve their display names and fucking sort it then

still forum
#

@errant jasper preprocessor != config parser

#

No you can't

zinc geyser
#

but its not as straight forward as you think... I'm doing that

lone glade
#

or config pathes, whatever suits your boat

#

yes, it's very straightforward.

pliant stream
#

he's saying the list view sorts them differently

errant jasper
#

@still forum Thanks for confirmation that it is not possible.

pliant stream
#

not quite sure how that would be though...

lone glade
#

I wonder how he sorted them because list sorting works perfectly fine

zinc geyser
#

how do you send code?

#

not familiar with discord

lone glade
#

`

code

`

#

or

`code`
#

singles are for a single line, triple for blocks

zinc geyser
#

ok will send message

subtle ore
#

forgot sqf alganthe

lone glade
#

meh

#

add it if you want

subtle ore
#
_midnightIsACoolKid = true;
lone glade
#

try again

#

huehuehue :p

subtle ore
#

:)

lone glade
#

`

_midnightIsnotACoolKid = true;

`

subtle ore
#

OH

brave jungle
#

Anyone know how to retrive data from a database using extDB3? THe documentation is crap

still forum
#

@brave jungle @tough abyss
Please stop spam.. Not needed.

brave jungle
#

I've asked twice xD

#

Hardly span

#

spam*

still forum
#

exactly

subtle ore
#

Torndeco...?

lone glade
#

why torndeco too?

pliant stream
#

don't use a runtime variable for that, just do #define IS_MIDNIGHT_COOL (false) since the value is not about to change

still forum
#

Because Torndeco knows the answer

brave jungle
#

well chat was active, wasn't sure if anyone saw it dedmen. Excuse me for trying a second time.

subtle ore
#

@pliant stream Well it was obviously a joke and served no purpose other than for you to see pretty colors

#

Just wait Curious, some people will scroll up sometimes and they might find your question

brave jungle
#

okay cheers

still forum
#

extDB is a very special topic. That's why most people here don't know the answer

#

Which is why noone replied.

subtle ore
#

Thus Torndeco = ExtDB3 God

tough abyss
#
pliant stream
#

why expose some mysql api to sqf? surely it would be smarter to expose an application specific api to sqf to abstract the database access

peak plover
#

Ohh okay thanks @still forum

#

Wouldn't it be great to be able to send a local vehicle to other clients?

tough abyss
#

Your making assumptions that mysql API is exposed there based on an add-on name

pliant stream
#

what

#

i can't parse that sentence

lone glade
#

hey ded

brave jungle
#

Cheers Torndeco, ugh all this to have persistant gear across mission files :\

lone glade
#

ace_arsenal_fnc_addStat is turning out to be params galore

still forum
#

cool

#

get rid of the scripted way to add stats

lone glade
#

already done

still forum
#

problem solved.

lone glade
#

it's all config based right now

#

i'm just adding the ability to add / remove them via funcs after the fact now, I already have planned for it anyways ๐Ÿ˜„

#

plus I added a priority entry to the stats array / config, so I can decide which ones go on top, very useful to keep weight at the bottom

barren magnet
still forum
#

neither

barren magnet
#

ok to make it more precise, is suspension allowed or not

still forum
#

They are ran from engine. Not from SQF

#

you mean scheduled/unscheduled.
Most are scheduled

barren magnet
#

most?

still forum
#

I didn't try all of them

queen cargo
#

init.sqf is scheduled but game will wait for it iirc
they are all special
that is what makes them horrible

barren magnet
#

๐ŸŒˆ

queen cargo
#

so: back to topic

#

what about writing webpages in sqf? (never said when that topic was a thing)

barren magnet
#

what about writing sqf in sqf? That is the real question

queen cargo
#

sqfception?

#

can do it

#

i wrote sqf-vm

#

writing sqf-vm in sqf is the next logical step

#

emulating sqf in sqf to emulate sqf in sqf

barren magnet
#

to emulate sqs

queen cargo
#

to again emulate sqf

#

in the end we will be so slow that even outputting diag_log 1 will take years

barren magnet
#

to simluate php

#

muaahahahahahaha

queen cargo
#

question in the end will be: can it run doom

still drift
#

comment "Exported from Arsenal by Jacob";

comment "Remove existing items";
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;

comment "Add containers";
this forceAddUniform "U_BG_Guerilla2_3";
for "_i" from 1 to 3 do {this addItemToUniform "11Rnd_45ACP_Mag";};
this addBackpack "B_AssaultPack_blk";
this addItemToBackpack "FirstAidKit";
for "_i" from 1 to 3 do {this addItemToBackpack "11Rnd_45ACP_Mag";};

comment "Add weapons";
this addWeapon "hgun_Pistol_heavy_01_F";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";

comment "Set identity";
this setFace "GreekHead_A3_02";
this setSpeaker "male01gre";

#

class CfgRespawnInventory
{
class SurvivorBasic
{
vehicle = "b_Soldier_F";
displayName = "Survivor";
};

};

#

how do I add my custom export class to be the respawn class?

#

Do I change "set idenity" to something like... Player Person or something?

subtle ore
#

@still drift What?

still drift
#

I want that to be what the players spawn with

#

So I put it into an sqf file. The thing that says "comment "set identity" i

#

is that what the name will be

#

so I would se the idenity to "Survivor0" or something and then the vehicle would be vehicle = "Suvivor0" right? Because thats the ID and the ID is set to that exported loadout

#

also where do I put these files?

subtle ore
#

no....comment is ignored by the compiler. it's similar to:

//this line is ignored
lone glade
#

it's worse than //

still drift
#

aaaand I can't send screenshots for further reference

lone glade
#

because it does nothing and takes time to run

subtle ore
#

I M G U R

still drift
#

Don't I need an account for IMGUR?

subtle ore
#

N O

#

Like I said the first two times

#

literally click "upload" drag and drop

#

copy the link

#

bam

#

Took me less than two clicks

queen cargo
#

comment <STRING> best comment

#

just as efficient as writing nil

subtle ore
#

๐Ÿ™„ Here we go again

lone glade
#

or not writing anything besides it

queen cargo
#

theoretically, this should be valid sqf:

_myvar = comment "reason why nil";```
#

fuck

#

just found a valid usecase for comment

lone glade
#

"description"

still drift
#

give me a min to upload them

#

here

#

thats all 3 files

lone glade
#

hnnnnnnng, notepad++ without highlighting

still drift
#

yeah sorry about that

#

anyways what do I do to make that custom class into a respawn class?

#

And where do these files go once they're done?

errant jasper
#

You probably want to change the spelling of "Initalize"

still drift
#

oof

#

my bad

#

thats fixed now

lone glade
#

those are CfgRespawnInventory classes ^ (survivor)

still drift
#

what?

lone glade
#

BIS_fnc_addRespawnInventory takes CfgRespawnInventory or CfgVehicles classes as second argument

still drift
#

oh

#

How do I fix that?

lone glade
#

it's not an issue

still drift
#

huh

#

I really know nothing about scripting so I'm kinda doing this blind

#

Should I remove all the instances of comment? You said earlier it just ignores the script there so what do I do to make it so it will not ignore the scrip there?

torn juniper
#

like getArray or getText - is there something to "getBoolean" to get a true or false? or should I use a string "true" and translate it to true/false via script

lone glade
#

Use 0 or 1

still forum
#

There are no boolean constants.

#

And as configs can only be constants. There are no booleans in configs

#

Intercept_CBA has a getBool config function that auto converts number or string

#

In SQF true and false are also no booleans

torn juniper
#

doesn't getNumber return 0 if something doesn't exist? I guess I could base the defaults off of that

still forum
#

yes

torn juniper
#

๐Ÿ‘ thanks

tough abyss
#

getNumber hasn't always returned 0 though. It might screw up if the behaviour changes again

#

For awhile there it return 0.xxxxxxxx if it didn't exist. Messed up Exile i believe for abit

dim owl
#

Hwo can i create a display above a layer?
I created the layer like this:

"startScreen" cutRsc ["SplashNoise","BLACK"];

And create the display with:

disableSerialization;
private _display = findDisplay 46 createDisplay "RscDisplayEmpty";

after the creation i add controls with ctrlcreate.

I cant see the controls nay ideas?

little eagle
#

You can't.

still forum
#

Ay commy. How do I edit config values via script?

manic sigil
#

Create trigger, 10m around 0,0,0, repeats every 3 seconds, setdamage 1 for each units in the area - resolve the "spawn in corner" bug for Zeus?

still forum
#

Well it won't fix the bug

#

but it will punish everyone that experiences the bug

manic sigil
#

Well yeah, not a fix - but it seems that killing them resets them, so Im proposing it as a patch until the glitch is fitched. Fixed.

edgy dune
#

theres no script to make a specific ai surrender is there? other then the module

still forum
#

modules are scripts too.

manic sigil
#

@Namenai#3053 id share if I wasnt away from comp :/ ill pass along what I have later if you still need it.

queen cargo
#

@little eagle

_myvar = comment "reason why nil";```
lusty canyon
#

im trying to get the remote designator to turn on its laser but cant get it to work at all??

#

    player addaction ["<t color='#ff9326'>RDF LASER:</t> TOGGLE", 
    {
        _myPlayer = (_this select 0);
        _remoteDesignator = _myPlayer getVariable "MY_RDF_CAM_OBJECT";
        
        // DOES NOTHING
        [_remoteDesignator, "Laserdesignator"] call BIS_fnc_fire;
                
        // ALSO NOT WORKING
        _remoteDesignator forceWeaponFire ["Laserdesignator","Laserdesignator"];
        
    },
#

i have the remote slaved to the players crosshairs so having it just turn on/off the laser is better than constantly creating/moving a laser object trick

manic sigil
#

@lusty canyon doFire?

edgy dune
#

@manic sigil i crie :(

#

Oppppsss i just ran a createUnit script and it spawned 50 dogs ........

#

But thx shining , it be cool when u could

manic sigil
#

@Namenai#3053 The script as I have it: { if ((side _x) == West) then {_x setcaptive true; _x playmove "AmovPercMstpSsurWnonDnon" ; _x disableAI "ANIM";}; } forEach allUnits;

#

Obviously kinda specialized, but it can be broken down.

#

_x setCaptive true; _x playmove "AmovPercMstpSsurWnonDnon" ; _x disableAI "ANIM";

is the core part.

meager heart
#

Check syntax for forceWeaponFire should be: unit forceWeaponFire [muzzle, firemode]
Params passed to the script upon activation in _this variable for addAction is: [target, caller, ID, arguments]

player addaction ["Laser", 
{
    _player = _this param [1]; // unit that activated the action 
    _player forceWeaponFire ["Laserdesignator","Laserdesignator"];
}];

@lusty canyon

subtle ore
#

So I have :

class lights_infoMain
{
  idd = -1;
  movingEnable = 0;
  enableSimulation = false;
  controls[]=
  {
       lights_info
  };
  class lights_info: RscText
  {
       idc = 1000;
        text = "Testing 1234";
        x = 0.752656 * safezoneW + safezoneX;
        y = 0.00500001 * safezoneH + safezoneY;
        w = 0.252656 * safezoneW;
        h = 0.198 * safezoneH;
        colorText[] = {1,1,1,1};
        sizeEx = 4 * GUI_GRID_H;
  };
};

For my config, and I am curious as to how I would make this a control that didn't free the player of it's controls until pressing escape

meager heart
#

are you using cutRsc ?

subtle ore
#

should I be? I thought this was achievable with createDisplay?

meager heart
#

well if you need just to show dialog on screen you can use createDialog

subtle ore
#

Right, but I just want this to be completely visual

#

the player doesn't need to interact with it, and still be able to move around and use items like you would withought it

meager heart
#

i think then you can try cutRsc

#
_your_layer = "Midnight_layer" call BIS_fnc_rscLayer;
_your_layer cutRsc ["lights_infoMain", "PLAIN"];
subtle ore
#

Yep, seems to be working well. I'll have to use ctrlCommit to set duration to -1 then to make it infinite yes?

meager heart
#

i do it like that duration=1e+011; in cfg ๐Ÿ˜„

subtle ore
#

Lol

meager heart
#

yes was fails with -1

subtle ore
#

Dunno why it won't take -1 :/

#

Awesome, works excellently

meager heart
#

nice man

subtle ore
#

Thanks for your help ๐Ÿ‘

meager heart
#

np

subtle ore
#

At second note here, it still dissapears lol

#
class RscTitles
{
  class lights_infoMain
  {
     idd = 1000;
       movingEnable = 0;
     enableSimulation = false;
     duration=1e+01;
     type = CT_STATIC;
     controls[]=
     {
          lights_info
     };
     class lights_info: RscText
     {
           idc = 1000;
           text = "Testing 1234";
           x = 0.752656 * safezoneW + safezoneX;
           y = 0.00500001 * safezoneH + safezoneY;
         w = 0.252656 * safezoneW;
           h = 0.198 * safezoneH;
           colorText[] = {1,1,1,1};
           sizeEx = 4 * GUI_GRID_H;
    };
  };
};
#

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

meager heart
#

1e+011

subtle ore
#

damn it all to hell

#

Thanks again man lol

meager heart
#

npx2

subtle ore
#

๐Ÿ˜„

meager heart
#

is it working ?

subtle ore
#

Yep, it doesn't dissapear now ๐Ÿ˜„

meager heart
#

weee

subtle ore
#

๐Ÿ˜„

meager heart
#

๐Ÿ˜€

subtle ore
#

Okay, now next question. With these RscTitles and cutRsc can I set the text dyanmically?

#

because it seems like you can do so with dialogs and displays

#

ctrlText 1000 is also returning "" for some reason or another, even though the idc number is 1,000

meager heart
#

yes you can do it

#
_ctrls = uiNamespace getVariable "lights_infoMain";
(_ctrls displayCtrl 1000) ctrlSetText _text;
subtle ore
#

Oh cool, thanks for the example.

#

Hmmm... "undefined variable in expression".

meager heart
#

hmm... add onload then in cfg

#

wait

#
onLoad = "uiNamespace setVariable ['lights_infoMain', _this select 0];";
onUnLoad = "uiNamespace setVariable ['lights_infoMain', nil]";
subtle ore
#

AHA! ๐Ÿ˜„

#

Welp, that would explain that. Let's try it

#

Works like a charm, thanks for helping me out ๐Ÿ‘

meager heart
#

nice

kindred lichen
#

Does anyone have a kill tracker that works with ace3?

meager heart
#

Make your own ?

peak plover
#

@kindred lichen ACEX has a kill tracker

warm gorge
#

So I'm creating a dialog with a bunch of ctrlShortcutButtons, bu tfor some reason whenever I create it on the player, 1 of the buttons is focused on and has the hover colour set

peak plover
#

That's the first selection

#

hit space to select

#

or enter

warm gorge
#

Any scripting command I can use to deselect it on load?

tender root
#

You can change the selection to any other control with ctrlSetFocus

peak plover
#

yeah, maybe add a invisble meta butrton that does nothin

tender root
#

yeah just w and h to 0 and position it somewhere off the screen with something like x=safezoneX - 10

#

thats usually how I do that

#

I have a question myself: I have a function in my mod thats called by the postInit = 1; attribute in the CfgFunctions. So far, so good. The problem is that my function is now also called for the main menu intro mission. Any Ideas how I can differentiate (in the called function) between a "real" mission and an intro mission?

warm gorge
#

Cheers guys, just made a temporary button, set focus on it and delete it.

#

@tender root Its just how its called. postInit functions are executed just after mission objects are initialized

tender root
#

Yeah I know but maybe theres a way to check in my postInit function if the misison loaded is just an intro mission.

peak plover
#

hey

#

setVariable with a public flag

#

It's persistant

#

So every client who connects gets it

#

However

#

Do they get it before or after preinit?

#

is it part of the persistent functions?

kindred lichen
#

So I'm trying to find the ACE3 last damage dealt variable, but google as I may, I can't seem to actually find the exact variable name

peak plover
#

_killer = _unit getVariable ["ace_medical_lastDamageSource",_instigator];

kindred lichen
#

THANK YOU

#

Where did you find this? like is there some place that has a more detailed list of ACE variables or did you just look through the source on github?

#

I've found all the class lists, but i can't seem to find the variables.

#

I've had similar problems with things like ramps, and gates and stuff, trying to find the right variable to get them to open or animate or whatever.

peak plover
#

source on github

#

Use it once and you kinda know what to look foor

#

I just searched last damage and found it

peak plover
#

Hey whoever had the issue with zeus having to click double

#

I found a fix

#

I created the zeus on the server during postinit and then assign from player postinit

#

just made 10 of them

meager heart
#

having to click double ?

peak plover
#

For all zeus dialogs

#

Like changing the waypoint settings

#

had to clikc it double

#

for confirm

meager heart
#

oh yes i think i saw something like that

torpid pewter
#

I'm doing some ballistic testing on the guns in arma 3 and I'm trying to hit a soldier wearing armor to test the effectiveness of different calibers. I've turned off sway, but weapons still have innate innacuracy which makes consistent testing difficult. Is it possible to use a command similar to player setCustomAimCoef 0; to completely remove gun innacuracy?

lone glade
#

gun innacuracy? wat?

#

You do realize dispersion in MIL / MOA is part of how ballistics work right?

torpid pewter
#

I think the proper term is dispersion. It's described on the weapons setting page under cfg weapons https://community.bistudio.com/wiki/Weapons_settings.

I understand that's how the weapons work and should work, but for the sake of testing I'm trying to hit the chest of the target consistently to determine how protective armor is. With default disperson values for most infantry weapons it makes testing much, much more difficult to get consistent values. The other alternative would be to see the actual numbers for the vests, but I don't believe that information is accessable.

still forum
#

You'd need to make a mod to disable dispersion

lone glade
#

plus that kind of testing is pointless

still forum
#

or I guess you can script the Fired eventhandler to set projectile velocity to always go the same way

torpid pewter
#

Damn, well I'm unsure how to do both of those. Well the testing is mostly for the sake of my own curosity, but also for a roleplay event in Arma I'm planning for my friends. I'm trying to put some hard numbers for stats because most of my players aren't too familiar with the real world performance of most military equipment, and since the roleplay is going for realism I'd like to give them some concrete information to help them. A lot of them are more familiar with role playing games so they like stats too.

I know the approximate values from my own experience playing Arma, but I like hard data. I really wish the virtual arsenal just gave the damage numbers for weapons and the protection values for body armor. It's not too much of a loss, but it would be nice data to have.

lone glade
#

those numbers are bullshit

#

the "impact" stat for arsenal is simply:
sqrt(hit^2 * initSpeed) with hit being the weapon damage (which is completely ignored, bullet is used instead) and initspeed which also doesn't matter much unless you're sticking the rifle up someone's ass

torpid pewter
#

Yeah, that's why I've resulted to manual testing because I'm more interested in the real world effect rather than the vague bars of the arsenal. I get that what I'm doing isn't really necessary. At the point at which accuracy becomes an issue for my testing, the weapons are generally aren't terribly effective anyways, but this information is interesting/useful to me and I think it could be for the Arma community too. I mainly just wanted to know if a simple command existed for weapon accuracy that does what I want like the player setCustomAimCoef 0; does for sway because that command has been super helpful for my testing.

lone glade
#

Without a mod no.

austere hawk
#

damage to infantry depends on very many things and its not as simple as "at range X you need Y shots"

#

the inconsistency means that sometimes a bullet can do more damage at longer range suddenly, when it fails to penetrate completely

lone glade
#

weeeelll, it's not really inconsistent

#

I mean, it's logical that it would do more damage if it doesn't penetrate the hitselection fully

#

it's when it doesn't fully penetrate vests / other "protective" geometry that it gets dicey

kindred lichen
#

Is there a way to add an infantry kill to the scoreboard or is that an engine limitation?

lone glade
#

nah you can add kills / points willy nilly

torpid pewter
#

@austere hawk Yes of course, but I'm just trying to isolate one variable: range. I'm trying to keep everything else the same. Theoretically, when using a Katiba if I could hit the exact same place at long range on a target with body armor would it always kill in the same amount of shots does the engine have some variance built in? From my own testing short range is extremely consistent but at long range it seems like there could be some variance outside of the variable I'm testing for, but it's difficult to tell because of how hard it is to hit the chest consistently. I end up hitting the arms, or legs or head, or miss constantly, which throws off results.

austere hawk
#

if you hit the exact same spot at same range it's consistent

lone glade
#

^ that depends, if he uses ACE the wind might change ๐Ÿ˜›

#

but vanilla it should be extremely consistent

austere hawk
#

as soon as a projectile does not "die" inside the penetrated body, damage suddenly reduces significantly (1/5th of the damage and less)

kindred lichen
#

in real life, over penetration is a thing, 7.62 nato does less damage point blank than out at 300m.

lone glade
#

tbh at that point you're in shock mittens

kindred lichen
#

Yeah, but at 300-400m you die instantly

torpid pewter
#

Does Arma handle overpenetration without killing the target? I think I've seen that can happen when you hit an arm. I think i've seen that before.

austere hawk
#

penetration is completely unrelated to damage

lone glade
#

you die as soon as a damage selection reaches 1 damage, 0.9 for the head

austere hawk
#

but damage is highly influenced by penetration (or rather - amount of speed lost inside the target)

kindred lichen
#

I mean, by the time rounds are going through a body armored target in and out the back it's usually in 1-hit kill range no mater where or at what range you hit the target.

austere hawk
#

not in arma

kindred lichen
#

I've rarely seen even 7.62 go through a target, .50s and 9.3 do, and they usually 1 hit people.

#

"nah you can add kills / points willy nilly"

Am I able to add infantry kills? I've only ever found "AddScore" which just adds to the total score, not infantry kills.

winter rose
austere hawk
#

@kindred lichen "rarely seen" ... what? at pointblank in arma 7.62 goes through infantry like butter (it has about 50% velocity after passing through the chest)

torpid pewter
#

So a related question to this discussion. What exactly are the different hitbox "areas" of a soldier when it comes to how much damage is taken. I know from my own experience that when unarmored, legs and arms take many shots to kill, torso takes 1, and head also takes one. Is there any difference between the resistance of different parts of the torso, for example?

austere hawk
#

look at the config of the base human class - the hitpoints in particular

lone glade
#

pelvis / neck / face mostly

austere hawk
#

resistance also comes from the fact that - as i said - the more bullet speed is lost inside a target, the more damage it does. So damage to arms and legs will be lower than to torso due to volume

meager heart
#

btw there also different "ammo types" ...

lone glade
#

bullets

meager heart
#

yep

torpid pewter
#

That article is very much the kind of information I'm looking for I'm surprised I didn't find it earlier.

manic sigil
#

Okay, time to learn the hard rules of internet coding.

I want to make a code that checks, every three seconds or so, if a player has a primary weapon; if null, change their side to civilian. A very crude infiltration system, easily worked around but should ideally be a short script.

I'm looking at a spawned while-do loop with a sleep 3 in it to keep it from overwhelming the server. primaryWeapon is easy enough, and I can figure out the change side function (join silent to a custom civilian faction, then undo with a custom side faction.

My issue is this: How do I point primaryWeapon at each player in a jip game?

#

I could just make it an addaction system, if weapon=null then allow, else 'drop the gun before you infiltrate', but if I walk without rhythym, I'll never learn.

arctic sable
#

BIS_fnc_animatedBriefing ... is this working? or work in progress?

knotty mantle
#

@manic sigil If you want to it be running all the time for all players you could just spawn it in the "initPlayerLocal.sqf".

manic sigil
#

Problem is, this is for admin console coding ๐Ÿ˜› extra limitations

knotty mantle
#

then remoteExec probably is your friend.

#

You could use this as a script:

while {true} do {
    if ((primaryWeapon _unit) == "") then {
        _unit setCaptive true;
    } else {
     _unit setCaptive false;
     };
    sleep 3;
};```

And then do
```{
    [[_x], "yourScriptNameHere.sqf"] remoteExec ["execVM", _x, true];
}forEach allPlayers;```

Aaaand full disclosure. I am not sure if that will work with JIP as i never used remoteExec with JIP. But that is the way i understand that command and it should be really easy to test. 
Furthermore there might be a lot better solutions performance wise. But this should work.
#

Damn. wait. How do i do those code blocks in Discord? ๐Ÿค”

subtle ore
#

@knotty mantle
` sqf

`

peak plover
#

```sqf
```

subtle ore
#

shiet

peak plover
#

like dat

subtle ore
#

how tf did you do that nigel?

knotty mantle
#

Nice. Thanks guys

peak plover
#
// comment

I typed
```sqf
// comment
```

subtle ore
#

๐Ÿค”

#

Is that consistant across markdown?

peak plover
#

@here

#

๐Ÿ˜‰

subtle ore
#

0.o

peak plover
#

@subtle ore

#

๐Ÿค”

subtle ore
#

????

peak plover
#

You can put \ in front of something to disable it's magic properties

subtle ore
#

Huh, interesting

peak plover
#

```sqf Used 3x \

subtle ore
#

\`\sqf

\`\

peak plover
#

\

#

``

subtle ore
#

` ?

peak plover
#

backslash`backslash`backslash`sqf

subtle ore
#

```sqf

```

peak plover
#

๐Ÿ‘Œ

knotty mantle
#

@manic sigil scroll up a bit for a possible solution for you problem. Formatting is horrible but you can do that in notepad. Should be working for your purpose. And if you only use that script for players i would prefer the setCaptive over making them join another group.

manic sigil
#

@knotty mantle Of course I forget setCaptive t_t still need to figure it out for a looping script and JIP, but that should fit the bill better than forcing side changes.

kindred lichen
#

So I have this, and it works for ai, if it's in the init.sqf of the server.

But it doesn't work for players, and it doesn't work on zeus units even if I run the script after spawning the zeus units.

if(isServer) then
{
{_x addMPEventHandler ["MPKilled", {_killer = (_this select 0) getVariable ["ace_medical_lastDamageSource",_instigator]; _killer addPlayerScores [1, 0, 0, 0, 0]; ;}]; } foreach allUnits
};

#

Is the reason it doesn't work for players, because MPKilled is run locally on the player that was killed machine, and only the server can use the addPlayerScores function?

#

This stuff is super annoying to test my way through, because I need another person on a dedicated server.

subtle ore
#

@manic sigil setCaptive doesn't need to be looped, once set true or false it stays that way

#

@kindred lichen QT: the loopback setting will allow multiple clients on the same machine connect to the server and to act like their own clients. Easy for testing things you'd need other players for

kindred lichen
#

So I can run like 2 instances of arma and test it.

subtle ore
#

yep

#

take a look there, simply
loopBack=1; in your server.cfg

meager heart
#

also -showScriptErrors will be nice thing to have

quasi thicket
#

Can someone help me with this script... i'm pulling out my hair why it sometimes just don't work

#

concept:

4 player squads (variables: alpha/bravo/charlie/delta) that i want to simply teleport to the cargo of 2 planes (plane1/plane2) after firing a trigger on a dedicated server. Alpha/Bravo moved to plane1, Charlie/Delta move to plane2

Script (in it's entirety, doing some other stuff as well):

/* client commands */
if (group player == alpha || group player == bravo) then [{player moveInCargo plane1;},{player moveInCargo plane2;}]; 

/* server commands */
if(isServer) then {
    /* skip time */
    skipTime (23 - daytime + 24) % 24;

    /* short delay */
    sleep 2;

    /* remove from groups */
    {[_x] joinSilent grpNull;} forEach (playableUnits + switchableUnits);
}

Results:"
Local: Always works
Listen server: always works
Dedicated with 2 players: always works
Dedicated with 8 or more players: Only randomly puts people in the plane

still forum
#

if (group player == alpha || group player == bravo) -> if (group player in [alpha,bravo])
Lol that hidden else ๐Ÿ˜„
Randomly means some players are not teleported at all?

quasi thicket
#

randomly means that if i run the mission the firs time... player 3/4/7 in the squad stay behind

#

and the 2nd time player 3/6/8 for example

still forum
#

Did you try diag_log or hint to check if the teleport code does run?

little eagle
#

Maybe moveInCargo fails if executed from lots of machines at the same time, because the requested slot gets occupied by a different unit.

pliant stream
#

that's my guess

still forum
#

Yeah... Could be

#

You can use alternative syntax to specify the cargo slot instead

pliant stream
#

you ever try to get into a car at the same time with someone else and it just fails?

#

at least that happens in a2

still forum
#

Would have to take care of giving each player his slot that isn't occupied by someone else

#

Maybe use cargo index as (units group player) find player or something like that?

#

Don't know if the order of units is the same on every client

quasi thicket
#

i COULD just individually move each soldier into the plane?

#

i.e. naming every soldier in the squad A1/A2/A3/etc and then assign a slot?

still forum
#

You could do what I just told you.. Or just ignore my idea and come up with something different.. sure....

little eagle
#

Btw

#

skipTime (23 - daytime + 24) % 24;

#

This is wrong.

#

skipTime will be executed before %

#

Also, why add 24 right before getting the modulo by 24?

#

That's pointless.

still forum
#

or 23+24 seperately.. why not just +47 then? Or better.. Why not just +23 then..

little eagle
#
if (isServer) then {
    skipTime ((23 - daytime) % 24);

    private _plane1Cargo = units alpha + units bravo;
    private _plane2Cargo = units charlie + units delta;

    {
        [_x, [plane1, _forEachIndex]] remoteExec ["moveInCargo"];
    } forEach _plane1Cargo;

    {
        [_x, [plane2, _forEachIndex]] remoteExec ["moveInCargo"];
    } forEach _plane2Cargo;
};

This makes more sense to me. No idea what the joinSilent grpNull is supposed to do.

still forum
#

That would move the units if they are not inside the trigger though.

little eagle
#

OK.

still forum
#

But easy to fix

quasi thicket
#

skipTime:

Mission begins at 14:00 and i don't know how long the players will take to activate the trigger.
I want the next part to start at 23:00 precisely, regardless what the current mission time is.

little eagle
#

Well, your math is wrong, and the order of operations is too. So it'll not work atm.

quasi thicket
#

it does work though ๐Ÿ™„

little eagle
#

skipTime (23 - daytime + 24) % 24;
This will not work correctly.

#

skipTime (23 - daytime + 24)

still forum
#

Just setDate if you just want a specific date/time? ๐Ÿ˜„

little eagle
#

will be executed first and report nil

#

nil % 24
will be ignored.

#

So even if it works, the code is broken.

still forum
#

Ofcause it works.

quasi thicket
#

setDate is local

still forum
#

It will just be off by one or more days

#

Yeah and?

#

remoteExec?

#

And the trigger fires for everyone that you teleport anyway

#

so everyone executes it anyway

little eagle
#

I'd just use a server only trigger tbqh

quasi thicket
#

well, someone recommended the skipTime because it also works with JIP or something

cedar kindle
#

server synchronizes the date for jip

little eagle
#

skipTime is fine, but you need more parenthesis for the % to not be ignored.

cedar kindle
#

or should in theory

quasi thicket
#

k, ill test it

#

anyway

No idea what the joinSilent grpNull is supposed to do

Every player will get disbanded from their group after teleporting to the planes.

#

also maybe a culprit why the TP doesn't always work... maybe they get disbanded from their names variable group

little eagle
#

Why though?

#

Such a waste of resources to create that many groups for nothing.

quasi thicket
#

No group management (disabled with ACE), No ShackTac HUD markers, no magic appearing markers when placed in Group Channel.

#

no 3d teammember markers

#

That would move the units if they are not inside the trigger though.

What part does that?

little eagle
#

Well, do you want to move each unit on it's own once they reach the trigger or all at once?

quasi thicket
#

all at once

little eagle
#

I suspected all at once, because of the skipTime occuring everywhere at once too.

quasi thicket
#

i have a "Blufor NOT present" trigger activation

little eagle
#

So that's why I made the script move them all at once. And that's also why it should be a server only trigger.

still forum
#

What part does that? all of it. ๐Ÿ˜„

quasi thicket
#

yea get it

#

was looking for something specific that said player !intriggerarea

#

super psuedo

#

anyway, thanks commy.. i'll try that

little eagle
#

The command is named inArea actually.

#

unit inArea marker/trigger/array-with-coordinates

still forum
#

or just in thisList as you already have the units in the trigger in thisList inside the trigger action

little eagle
#

Yeah. That should work too. I really don't like triggers. Now that there is inArea, might as well create a scripted loop on the server.

#

With a marker on the map.

peak plover
#

^

#

Makrer/location/inArea(with array) are least taxing

quasi thicket
#

does that work with "Blufor not present" though?

peak plover
#

in thiList?

#

inArea works always, as long as the size of the trigger is not 0-0

#

player inArea trigger_1

#

returns bool

still forum
#

@quasi thicket Not that easily I think. You can manually check it ofcause bit.. ugh

quasi thicket
#

Well, not relevant for my question though... just wondering ๐Ÿ˜›

little eagle
#
// init.sqf
if (isServer) then {
    0 spawn {
        waitUntil {
            sleep 5;
            count (allPlayers inAreaArray "plane_teleport") > 0
        };

        skipTime ((23 - daytime) % 24);

        private _plane1Cargo = units alpha + units bravo;
        private _plane2Cargo = units charlie + units delta;

        {
            [_x, [plane1, _forEachIndex]] remoteExec ["moveInCargo"];
        } forEach _plane1Cargo;

        {
            [_x, [plane2, _forEachIndex]] remoteExec ["moveInCargo"];
        } forEach _plane2Cargo;
    };
};

So much more freedom with this.

quasi thicket
#

argh, @little eagle , showed your script to a missionmaker from my group and instantly went: "no that won't work!"

#

urgh ๐Ÿ˜ฆ

little eagle
#

May he tell me why?

quasi thicket
#
[10:17 AM] Captainblaffer: Just do a  forreach that runs on all clients
[10:17 AM] Captainblaffer: But in the doreach do
[10:17 AM] Captainblaffer: If (_x == player ) then {}
#

@open tendon

#

oh he's in this server as well :p

little eagle
#

That makes no sense to me.

#

Why on all clients? Why make it more complicated than it has to be?

peak plover
#

If you run moveInCargo on all clients at the same time. It will bug out, because they all would think the spot they are about to take is empty. Had the same thing a few weeks ago

#

Commy's code is perfect to avoid issues like that

little eagle
#

Yep.

#

I'm under the shower. Do what you want~

meager heart
#

lol

#

btw is that daytime even work ?

knotty mantle
#

Is there a reason to NOT put a function in the condition of presence of a unit?

peak plover
#

>condition of presence of a unit?

#

What do you mean by that?

knotty mantle
#

Because i have this function:

_limit = floor (("amountOfEnemies" call BIS_fnc_getParamValue) * 0.1 * 100); //100 ist die Zahl der gesamt Einheiten leider aktuell hardcoded

if (isNil "iterator") then {
    iterator = 0;
};


_count = {(side _x) != civilian} count (AllUnits - playableUnits);

if (_count >= _limit) exitWith {false}; 
_toinit = 100 - iterator;
_toput = _limit - _count;

if (_toinit <=  _toput) exitWith {true};

_return = ((random 1) < 0.5);
iterator = iterator + 1;
_return
#

Well you can set a probabilty for a unit. If it is placed or not

still forum
#

The reason is if you use the variable somewhere and your script would break if it's not there

#

the variable of the unit

knotty mantle
#

and you can give a condition for existence aswell (for example a parameter set at the lobby or smth)

#

I dont. My script is just a logic to give me an exact amount of enemies but if not set to 100% they should always be on different positions.

#

I did this in a "speedrun" on a Metro 2033 subway "map" and it worked like i wanted for 36 units. But here i have 100 units and for some reason i get nearly always around 70 - 80 people even if i only want 50.

still forum
#

I dn't see a problem with doing that

quasi thicket
still forum
#
_count = {(side _x) != civilian} count (AllUnits - playableUnits);

if (_count >= _limit) exitWith {false}; 
_toinit = 100 - iterator;
_toput = _limit - _count;

if (_toinit <=  _toput) exitWith {true};

Why not just.. like... Actually count them.
At the end just
if _return then iterator = iterator +1
and just check if iterator>_limit

knotty mantle
#

Because i need the total amount of units to be placed or i might end up with less units(i think).

#

In your way i have no idea how many units didnt get placed. Therefore i cant say if there is a point where every unit HAS to be placed to fill up to the wanted number. Or am i missing smth?

still forum
#

What?

#

My way counts how many units are placed that have the condition code

#

True. Units that don't have a condition code and have 100% spawn chance are not counted

knotty mantle
#

Every unit has the code. but what happens with your way if _return is false. The iterator doesnt go up. How do i know how many units i have to put there? Because if i have a limit of 80 units from those 100 placed in editor and have a ((random 1) < 0.8); Your way is great to make sure that i dont have too much units. But i am missing the part where it makes sure that there aren ยดt too few.

still forum
#

Uh...

knotty mantle
#

And if i set the random higher the units arenยดt distributed evenly.

still forum
#

Ah you want exactly that number instead of too many and too few?

knotty mantle
#

Yeah. Otherwise i would just set the probabilty to the wanted factor

still forum
#

Even that won't get you the right number of units

#

randomness is random

knotty mantle
#

Which is the way i am doing it currently as my script isnt working for some reason i dont understand

still forum
#

randomness is random. You might end up with 100% or 0% of your units.. Because random.

knotty mantle
#

Yeah but if _toInit which is the amount of units that are still in for that function is the same or lower as the amount of units that need to be placed to fill up the gap it doesnt come to the random

#

Then it is just true.

still forum
#

And if you always return true if you have too few units. And always return false if you have too many...

knotty mantle
#

Every unit then is set.

still forum
#

There is no randomness

#

I would just spawn all of them.. And delete some of them with a custom script later

#

That way you can just take all your units. And select random units to delete till the count matches

#

random distribution and exactly the number you need. The easy way

knotty mantle
#

Are you sure that in my script there is no randomness?? Your way is obviously the easier one and i will do it that way. But if my logic is so flawed that the random in my script isnt used i would like to know...

still forum
#
if (_count >= _limit) exitWith {false}; //If we already have the number of units we want. Don't place any more.
_toinit = 100 - iterator; //How many units are still left.
_toput = _limit - _count; //How many units do we need to place.

if (_toinit <=  _toput) exitWith {true}; //If we don't have enough units over just place this unit.

On the next iteration your iterator didn't increment. So even if you only have 20 units left it thinks you have 21.

#

I see how your random comes into play now

little eagle
#

This reads mildly interesting. What's the task here?

knotty mantle
#

I want to have an exact amount of units but on different positions everytime.

#

So i should increment the iterator just before that second exitWith to avoid any problems.

little eagle
#
private _units = [];

for "_i" from 1 to 20 do {
    private _unit = ... createUnit [...];
    _units pushBack _unit;
};

private _positions = [...];

{
    _x setPos (_positions deleteAt floor random count _positions);
} forEach _units;

Something like this?

peak plover
#

is there a difference when using include for \ and /

little eagle
#

I don't think there is and even Linux should handle both,

#

In Arma at least.

still forum
#

There isn't. But I'd say go for consistency

little eagle
#

Just use the backslash.

#

You agreed with yourself?

still forum
#

not anymore

#

Just somehow thought you'd do the same now. So I wanted to give you the ability to do so

knotty mantle
#

commy i placed my units in editor. With a disableAi "move" for some, some ar kneeling. Some have a patrol which is triggered. That is why i used the function in the condition of presence.

little eagle
#

Never used condition of presence.

knotty mantle
#

But in my tests i mostly end up with way too many units ๐Ÿ˜ฆ 70-80 for a cap of 50 units. And therefore i asked here where my logic is flawed.

still forum
#

give each unit a number

#

build array of numbers you want at preInit

#

and then just check myNumber in ListOfNumbersOfUnitsThatIWant

#

I told you why your logic is flawed

#

and where

little eagle
#

Knowing Arma, COP is probably just a broken leftover from an older game.

still forum
#

And you So i should increment the iterator just before that second exitWith to avoid any problems. Found the fix for that problem too

knotty mantle
#

Yeah i know Dedmen. But that point is after the line that is probably causing issues.

#

If i have a limit of 50 units. From a 100 placed. it should end at if (_count >= _limit) exitWith {false};

#

It wouldnt run into my error.

#

But i get 70-80 units placed...

#

But i might consider commys approach that COP is broken and will do the reasonable thing you suggested and just delete them afterwards. ๐Ÿ˜ƒ

little eagle
#

The less you rely on stiff hard coded stuff from the editor like triggers and init boxes, the better imho.

knotty mantle
#

Yeah i try to avoid them as much as i can.

still forum
#

I guess the condition might execute before the unit is spawned

#

Aka units might only spawn later

#

which is why you don't find them in your count check

#

So again. Just don't use condition of presence

knotty mantle
#

yep. Wonยดt do anymore as you gave me a good way to do it aswell ๐Ÿ˜ƒ Thanks for that ๐Ÿ˜ƒ

lusty canyon
#

how do you make an object not interactable by players and ai but still visually rendered?
_darterObj hideObjectGlobal true; _darterObj hideObject true;
hiding the object just removes it visually right? AI can still "see" it?

#

i still need the darter to be fully functional, like a player can still access through UAV terminal but when they cursortarget they dont see any disassemble action menu stuff

still forum
#

disableSimulation

#

no AI can't see invisible objects

#

how do you make an object not interactable by players
i still need the darter to be fully functional, like a player can still access through UAV terminal
So what do you want now? Not interactable but interactable?

lusty canyon
#

yea only interactable remotely by players

lusty canyon
#

yea i can use that, how about AI cannot see the object? (but still visually rendered)

still forum
#

Make it friendly

#

then they can see it but don't care

lusty canyon
#

if i change the side to CIV can players with nato terminals still access the darter?

still forum
#

Dunno

lusty canyon
#

ok thanks

still forum
#

Sure... Somehow...

#

It's in the debug console script somewhere

peak plover
#

Wait how you get that?

#

aha

#

nice

tame stream
#

Hi im trying to have a addaction added to a ammo box with a restriction by unit type, the addaction will load a loadout onto a player with certain loadouts restricted to certain unit types.

so far i have . . .

if (player == B_sniper_F) then {player addAction ["<t color='#FF7722'>Sniper</t>", "loadouts\Sniper1.sqf"]};```
im not too familiar with addaction restrictions, can anyone stop my mistake?
still forum
#

B_sniper_F is the variable name of the unit?

#

Or do you mean the classname?

tame stream
#

classname

still forum
#

If you want a string then you have to use a string

#

"B_sniper_F"

#

And to get the type of a object you use typeOf

tame stream
#

i wanted it to be variable but unit type/classname will server me better

tough abyss
#

how can I add vehicle door animations using scripts for when I get in and out of vehicles?

tame stream
#

playing as a sniper class B_sniper_F showed no addaction css if (player == "B_sniper_F") then {player addAction ["<t color='#FF7722'>Rifleman</t>", "loadouts\Rifleman.sqf"]};

young current
#

@tough abyss that will require messing with getin/getout eventhandler and prodcing good getin/getout animations to animate the character and syncing that to the cars animations

meager heart
#

@tame stream Make a file/function, exec/call it with your action, in that file/function you can check typeOf player and do what you want

tame stream
#

so it will check the type of class and if satisfied will execute the script

tough abyss
#

@young current So it's not by any means a good starter project for modding in Arma 3?

young current
#

no

#

would not say it is

tough abyss
#

It's a feature I've always wanted.....

young current
#

there are reasons why its not very common in arma

tame stream
#

@meager heart wouldent that still show up on the ammo box as an option that cant be selected, trying to make it as neat as possible... idea is to have player walk up to ammo box and then have 2-3 choices according to their class. Instead of see'ing all other class option aswell even if wont work for them

bold timber
#

ehm.. wrong topic.

meager heart
#

@tame stream you can check type of player and then with setUserActionText change it like you wish, so the sniper will see action with text for sniper...etc

indigo snow
#

You just cant compare an object with a string

#

player isKindOf "className..."

still forum
#

As I said... typeOf...

peak plover
#

player isEqualType "string"
Does that count as comparing object with a string?

tame stream
#

yup thats it thx guys

still forum
#

And if you want the action on a box you have to add it to a box instead of the player.

tame stream
#

added to box all good now

if (player isKindOf "B_sniper_F") then {player addAction ["<t color='#FF7722'>Sniper Light</t>", "loadouts\Sniper1.sqf"]};```

works like a charm...thx
indigo snow
#

No, the action is added to the player, not the box

tame stream
#

above code add to ammo box, sniper walk up and can choose loadout...none sniper walks up , no options

still forum
#

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

meager heart
#

gg

tame stream
#

aa dammit ... ๐Ÿค” needs a tweak

meager heart
#

object addAction.....

#

box != player

tame stream
#

the sniper has the addaction on him instead of near by ammo box

#

named object will do i suppose...testing

indigo snow
#

You can use this in the ammo box init box

tame stream
#
if (player isKindOf "B_sniper_F") then {ammo1 addAction ["<t color='#FF7722'>Sniper Light</t>", "loadouts\Sniper1.sqf"]};```

Works in single player when playing as *player*, but not in MP playing as *playable*... not sure how to fis that

gonna switch to ``this`` instead of ``ammo1``
indigo snow
#

player is always the unit the client is playing as, MP or not doesnt make a difference.

still forum
#

Btw you can use SQF highlighting.. Instead of whatever else you are using for your scripts there.

inner swallow
#

where are you running this script from?

#

Consider running it from initPlayerLocal.sqf

indigo snow
#

Ammobox init is fine for this

inner swallow
#

Also true.

indigo snow
#

Oh you mean player might not be defined yet?

inner swallow
#

yeah

indigo snow
#

Yea good point

tame stream
#

@indigo snow thats what i though as well (switched to sqf), i assumed it must work player or playable

indigo snow
#

Where do you get playable from

#

Either way, when init boxes run theres a good chance player is still Null

#

So you need to execute from somewhere else

tame stream
#

@inner swallow just addaction on ammo box for specific classes can have addaction to load class specific loadouts

inner swallow
#

uh what

indigo snow
#

I second SKs comment on running the code from initPlayerLocal.sqf instead of the ammo box init box.

inner swallow
#

Yeah it should work well from there

#

even with multiple classes

indigo snow
#

Its not a command, thats why

tame stream
#

ok will try

inner swallow
#

yeah, playableUnits returns an array of playable units

indigo snow
#

(In MP)

inner swallow
still forum
#

player is never true

#

:U

inner swallow
#

okay no

#

yeah

#

brainfart ๐Ÿ˜„

still forum
#

that playable setting in editor is unrelated to this

tame stream
#

initPlayerLocal.sqf with sqf if (player isKindOf "B_sniper_F") then {ammo1 addAction ["<t color='#FF7722'>Sharp Shooter</t>", "loadouts\Sharpshooter.sqf"]};
did the job

#

sniper walk up and has option
pilot walk up and has nothing

PERFECT !! thank all, appreciate it

knotty mantle
#

is initPlayer called by you or one of the eventscripts?

still forum
#

I guess he means initPlayerLocal

knotty mantle
#

Yeah was just thinking what it would do differently then initplayerlocal.

tame stream
#

yes local, fixed

meager heart
#

๐Ÿฟ

winter dune
#

if I have a HC and execute a RE on all clients except for the server, what can I do to avoid executing useless stuff on the HC?

#

I mean, with a -2 target for the RE

#

will it include also the HC, since it's a client?

indigo snow
#

Just check for hasInferface at the start of whatever youre executing?

subtle ore
#

does hasInterface return false for server though?

cedar kindle
#

depends on dedicated or not

#

false for dedicated, true for listen server

subtle ore
#

Gotcha

edgy dune
#

is there a way to change the position of the first person camera?

still forum
lusty canyon
#

is there a way to know when the playmusic command has stopped playing?


[_cfgMusicDisplayName, _cfgMusicClassName, _cfgMusicDuration] spawn 
{
    _displayNames = _this select 0;
    _classNames = _this select 1;
    _durations = _this select 2;
    
    while { true } do 
    {
        _randomTrack = floor(random (count _classNames) );
        
        playMusic (_classNames select _randomTrack);
        
        uiSleep (_durations select _randomTrack) ;
    };
};

testing with uiSleep the track has stopped playing for a while and its still not looping for another bgm.

lone glade
lusty canyon
#

so i have to use the EH instead of playmusic command?


[_cfgMusicDisplayName, _cfgMusicClassName, _cfgMusicDuration] spawn 
{
    _displayNames = _this select 0;
    _classNames = _this select 1;
    _durations = _this select 2;
    
    while { true } do 
    {
        _randomTrack = floor(random (count _classNames) );
        
        _ehID = addMusicEventHandler ["MusicStart", (_classNames select _randomTrack)];
    };
};

aside from the infinite loop, will this work? then to stop it setEH musicStop?

peak plover
#
["All", "MPKilled", {(_this select 0) call myFunction}, true, ['Man','StaticWeapon'], true] call CBA_fnc_addClassEventHandler;```
returns false
But if I use Killed, returns true
#

No clue why

cedar kindle
#

i don't think it supports MP events

peak plover
#

๐Ÿค”

cedar kindle
little eagle
#

It does not support MPKilled.

peak plover
#

:sadnessface:

little eagle
#

Just use killed and a global event / RE.

peak plover
#

I use description.ext xeh class works ๐Ÿ‘

little eagle
#

MPKilled has no config equivalent.

#

You still need RE / global event even if you use the mission config event handler.

peak plover
#
class Extended_Init_EventHandlers {
    class AllVehicles {
        class booBoo {
            serverInit = "_this select 0 addMPEventHandler ['MPKilled', { (_this select 0) call myFnc; }]";
            exclude[] = {"Man", "StaticWeapon"};
        };
    };
};
little eagle
#

It's the same as CBA_fnc_addClassEventHandler. Config versions are a wrapper for CBA_fnc_addClassEventHandler.

#

Ah, I see.

#

Well that works lol.

peak plover
#

works on my machine ๐Ÿ˜‰

#

hmm yes

little eagle
#

๐Ÿ‘

fleet wind
#

Just a quick one ๐Ÿ˜‰ how can i make lbAdd add things to the top of the listbox and not below the last?

little eagle
#

Can't. They're added in order.

fleet wind
#

No way to change it around ? make it add in order but the other way around ?

little eagle
#

Otherwise no. They're listed in the order they're added.

fleet wind
#

Sure can do will try the value thing How do i give them a value tho? ๐Ÿ˜‹

little eagle
#

lbSetValue

fleet wind
#

thanks

little eagle
#

lbSort sorts them alphabetically if that is what you want.

#

I'd pre sort them before adding them though.

#

Sort the array, then add the array in order.

queen cargo
#

creating one manually always will work
though ... that might be a little bit over the top

tender fossil
#

Is BIS wiki still the best place to learn UI editing in Arma 3?

queen cargo
#

arma4 surely will have a new UI system that is not weirdly build on internal static IDs and crappy configs

tender fossil
#

Yup, but I still need to battle with Arma 3 for another couple of years ๐Ÿ˜›

#

Damn, I'm gonna be so no-life when A4 comes out ๐Ÿคค

queen cargo
#
<ui ns:core="bis.arma4.ui.core" enf:my="io.x39.scripts">
    <core:background backgroundColor="#AAAAAAFF">
        <core:stackpanel>
            <core:button click="{x:static my:button_click}">
                <core:label text="OK"/>
            </core:button>
        </core:stackpanel>
    </core:background>
</ui>``` would love to see something like this
little eagle
#

Verbose.

queen cargo
#

even better if they just would take WPF and slam it into arma4 as UI system

tender fossil
#

๐Ÿ‡ต ๐Ÿ…ฐ ๐Ÿ‡ท ๐Ÿ…ฐ ๐Ÿ‡ฒ ๐Ÿ‡ธ

unkempt heron
#

Anybody ever had any success getting tooltips to work with ListNBox? I can only get it working on the first row with lbSetTooltip as there is no lnbSetTooltip command I've tried ctrlSetTooltip aswell ๐Ÿ˜

little eagle
unkempt heron
#

Yeah lnbSetTooltip doesnt exist

#

Just pops a spicy error

peak plover
#

Is there a way to set velocity to 0 completly

lone glade
#

for what

peak plover
#

I was flying, teleported player and took damage

lone glade
#

players velocity is dicey

#

because they aren't physX objects ๐Ÿ˜„

#

but setVelocity 0 should help

peak plover
#

okay

#

thanks

worldly locust
#

how to replace a "OPFOR not present" trigger with a scirpt based approach?

lusty canyon
#

is there a way to make non heli class vehicles able to slingload? i tried adding


        liftForceCoef = 60.5;
        maximumLoad = 10000000;
        slingLoadMaxCargoMass     = 50000000;
        slingLoadMemoryPoint = "slingLoad0";
        slingLoadMinCargoMass = 1;

to the f35b but ofc it did nothing

lone glade
#

Nope, you can't

inner swallow
worldly locust
#
    sleep 30; 
    count (
    allUnits inAreaArray [_position, 500, 500, 0, false] select {_x side=="EAST" && !(_x getVariable "ACE_isUnconscious")}) ==0;
    
};``` so to do a check every 30 seconds or so if the area is clear and not including unconscious AI?
inner swallow
#

that is... an interesting way of doing it

worldly locust
#

well its a non functional way of doing it for sure.

#

Personally I'd be just as happy to use a trigger, but apparently they're "bad"

#

so I'm trying to learn new skills.

still forum
#

Well you try every 30 seconds here

#

a trigger tries every 0.5 seconds

inner swallow
#

Just use a trigger honestly

still forum
#

so yes. "bad"

worldly locust
#

Yeah. I get why I should do this.

#

that's why I'm trying.

inner swallow
#

It's "bad" if you're using a bunch of triggers

#

One trigger is fairly inconsequential

unkempt heron
#

Anyone done much with RscControlsGroup im playing about with it seeing what I could do but it looks like its possible to use them inside of each other but cant seem to get it to work... anyone had any experience with them?

inner swallow
#

even within a trigger condition you can optimise it

lone glade
#

depends what you're trying to do. (controlGroups)

inner swallow
#

like you could just have

_units = allUnits - playableUnits;
while {
sleep 30; 
east countSide (_units inAreaArray [...]) > 0
};```
#

maybe you need to add an empty do{} at the end

lone glade
#

...... theshit

inner swallow
#

?

lone glade
#

_units = allUnits - playableUnits;

#

... what was the intent there?

inner swallow
#

Not including playbale units

#

heck i'd say _units = allUnits select {side _x == east}

#

then just normal count

lone glade
#

You have a small issue tho.... what if zeus / the mission spawns more units?

inner swallow
#

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

#

I'm not the mission designer

worldly locust
#

Ok. Will try that.

subtle ore
#

isn't entityCreated EVH a thing?

worldly locust
#

Not sure what you mean @lone glade

little eagle
#

Midnight, sadly no.

inner swallow
#
Personally I'd be just as happy to use a trigger, but apparently they're "bad"
so I'm trying to learn new skills.```
small rant on this - i get irritated when people push these claims of triggers being bad or whatever because it seems like a great way to frustrate relatively new mission makers
little eagle
#

Triggers are bad, because they're unnecessarily hard to maintain compared to some loop in init.sqf due to the gui and less flexibility like local variables or even customized wait times.

inner swallow
#

And often end up pushing them towards scripted solutions that can be way more tedious/perf unfriendly

#

yeah but it depends on what you're doing

little eagle
#

Triggers are way more tedious.

inner swallow
#

Really?

little eagle
#

Yes.

inner swallow
#

You place them, set activation and type

#

end of story

worldly locust
#

@little eagle that may be true. But either a trigger in eden or via script is straight forward enougb

lone glade
#

and also because they tend to break easily when the scheduler hits the shitter

inner swallow
#

Well, I've really not run into that

#

I get not wanting to use them while making complex stuff

#

but a couple of triggers in a fairly simple mission? problems are exaggerated

little eagle
#

I don't see the point as waitUntil and inArea(Array) are easier to use.

#

The synch to waypoint feature maybe.

inner swallow
#

very subjective IMO

little eagle
#

Otherwise they're just inferior in every way.

inner swallow
#

OPFOR NOT PRESENT, on activation do a thing. Set the dimensions visually via GUI. job done.

#

And yeah, it has pitfalls but hey.

worldly locust
#

Easier to you @little eagle with your vast experience. To the noob like me. Not so much.

little eagle
#

Harder to learn as well.

worldly locust
#

For example. Trigger version. Done. Dusted. Works. Script version. Not so much. Hoping for help here

inner swallow
#

I mean people also complain about using sleep and scheduled code etc

#

it's a rabbit hole

#

which in my experience is irrelevant to a lot of use cases

little eagle
#

It is shit, but for missions it's fine.

inner swallow
#

anyway rant over ๐Ÿ˜„

little eagle
#

Reddog, what are you doing?

inner swallow
#

The only thing i really dislike about triggers is that they continue to check the condition after it's been activated (and build thisList)

worldly locust
#

I'm creating tasks in towns to clear them. I've got the tasking all working, now I just need to have the conditions for success

inner swallow
#

To which my solution is usually to just deleteVehicle thisTrigger in the activation field.

worldly locust
#

so I know where -> _position and I'm working on a set radius

little eagle
#

Well, what are the conditions?

worldly locust
#

No OPFOR troops in 500m circle and if there are then they need to be unconscious via ACE

little eagle
#
0 spawn {
    waitUntil {
        sleep 5;
        {
            alive _x && {!(_x getVariable ["ACE_isUnconscious", false])}
        } count (allUnits inAreaArray "town_marker") == 0
    };

    // task complete
};
#

Just place a marker on the town.

#

And name it town_marker or whatever you like.

worldly locust
#

do I need to add a check for side in there? I don't see anything restricting to opfor?

little eagle
#

Sure, yeah.

#

side group _x == east

worldly locust
#

=="EAST" no?

little eagle
#

No.

#

The command is named east. It is it's own data type in SQF (SIDE) and not a STRING.

worldly locust
#

ah.

#

thanks.

#

wonder where I've got that into my head from.

#

*shakes head to dislodge

young spade
#

I cannot see my error for looking in the last few lines -- could someone put me out of my misery.


//evacuation.sqf
//looking for SmokeShellGreen

_shooter = _this Select 0; 
_ammotype = _this Select 4; 

hint format["%1",_shooter];
sleep 0.5;
hint format["%1",_ammotype];
sleep 0.5;
hint "";

sleep 2;

switch (_ammotype) do
    {
        case "SmokeShellGreen":
        {
            Hint "Green Smoke Detected";
            sleep 0.5;
            Hint "";
            _signalArray = [];
            _smoke = position player nearObjects ["SmokeShellGreen", 50];
            private ["_signal","_signalPos"];
            if (count _signalArray > 0) 
                then { 
                    _signal = _signalArray select 0; 
                    _signalPos = position _signal; 
                    } else { 
                    _signalPos = position player; 
                    };
            Hint format["%1",_signalPos];
            sleep 1;
            Hint "";
            _safePos = []; 
            _range = 35; 
            _maxGrad = 0.1;
            while {((count _safePos) == 0)} do 
                { 
                    _safePos = [ 
                        ["position", _signalPos], 
                        ["number", 1], 
                        ["objDistance", 9], 
                        ["range", [0, _range]], 
                        ["maxGradient", _maxGrad] 
                        ] call RUBE_fnc_randomCirclePositions;  
                    _range = _range * 1.25; 
                    _maxGrad = _maxGrad + 0.01; 
                };
            createVehicle ["Land_HelipadSquare_F", (_safePos select 0), [], 0, "NONE"]; 
        };
    
    };```

Many Thanks.
little eagle
#

Well, what does the RPT say?

#

...

#

Machiya, check the RPT file. Or at least tell us what the last shown hint is and what you even expect from this code. Because all it does is spawn a helipad.

young spade
#

Exactly - throw a grenade, check its a green one, spawn a helipad. It work right up to the final line...

little eagle
#

Check the RPT file.

young spade
#

%appdata%/Local/Arma3 -- no relevent .RPT

Script Error is 'Error undefined variable in expression : _safePos' in the createVehicle command

sour saffron
#

is there a way to lose the time stamp on diag_log entry to .rpt ?

willow haven
#

How would I go about using an entitykilled event handler but only if the entity belongs to a certain side

#

so

#

addMissionEventHandler ["EntityKilled",

#

wait

#

addMissionEventHandler ["EntityKilled",
{
_this spawn
{
params ["_target"];
if ((isPlayer _target)) exitWith {};
sleep 3; // reset time...
deleteVehicle _target;
_newTarget = independentDummyGroup createUnit [(typeOf _target), [0, 0, 0], [], 0, "CAN_COLLIDE"];
_newTarget setPosATL (getPosATL _target);
_newTarget setDir (getDir _target);
_newTarget switchMove "";
[_newTarget] call BIS_fnc_VRHitpart;
// _newTarget disableAI "ALL";
// _newTarget enableSimulation false;
};
}];

#

woops

#

``sqf

#

''sqf

#

this

#

addMissionEventHandler ["EntityKilled",
{

if ((side _x == independent) && (!isPlayer _x)) then
    {
        _this spawn
        {
        STUFF TO DO
        };
    };

}];

unkempt heron
#

im trying to make a grid system that displays a picture with a text value with controlsGroups but when I use the controlGroup inside a controlsGroup then in a display it just comes up blank with the scrollbar. I tried using ListNBox but didnt really meet what I was trying to do...

young spade
#

[SOLVED] Helps if you don't use deprecated functions! Now using BIS fnc findSafePos.

Spawns a helipad on a specific grenade; having looked for a nearby flat'ish spot.
Thoughts on best appraoch to cleaning up would be welcome.

#

//evacuation.sqf
//looking for SmokeShellGreen


//Check what has been fired

_shooter = _this Select 0; 
_ammotype = _this Select 4; 

sleep 3;

switch (_ammotype) do
    {
        case "SmokeShellGreen":
        {
            Hint "Green Smoke Detected";
            sleep 1;
            Hint "";
            
            _signalArray = [];
            
            _smoke = position player nearObjects ["SmokeShellGreen", 50];
            
            _signalArray = _signalArray + _smoke;
                
            private ["_signal","_signalPos"];
            
            if (count _signalArray > 0) 
                then { 
                    _signal = _signalArray select 0; 
                    _signalPos = position _signal; 
                    } else { 
                    _signalPos = position player; 
                    };
            
            _safePos = []; 
            _range = 10; 
            _maxGrad = 0.1;
            while {((count _safePos) == 0)} do 
                { 
                    _safePos = [(_signalPos), 0, _range, 9, 0, (_maxGrad), 0, [], [getPos player, getPos player]] call BIS_fnc_findSafePos;  
                    _range = (_range * 1.25); 
                    _maxGrad = (_maxGrad + 0.01); 
                };
            Hint format["%1",_safePos];
            _evacPOS = createVehicle ["Land_HelipadSquare_F", (_safePos), [], 0, "NONE"];
        
        };
    };```
willow haven
#

nvm, HAZ is a godsend and he fixed it

#

my next task i've deemed to be ridiculously difficult to do and have given up before I even start

river meteor
#

do nested ifs work in SQF?

subtle ore
#

Yes

#
if(cool) then
{
    if(cool && cooler) then
    {
        if(cool && cooler && coolest) then
        {

        };
    };
};
tough abyss
#

10/10 question

tame portal
#
[Code]
if(cool) then
{
    if(cool && cooler) then
    {
        if(cool && cooler && coolest) then
        {

        };
    };
};

[Returns]
Mike Posner - Cooler Than Me
subtle ore
#

LOL

tame portal
#

I really just know this song because of GTA 5

#

But it's catchy when you're driving over pedestrians

edgy dune
#

is there away to just spawn a grenade?

subtle ore
#

"to just spawn a grenade" ...what?

#

you mean the effects of a grenade?

edgy dune
#

yea

#

I guess thats wat I ment

#

like basicly use a script to spawn a smoke grenade

meager heart
#
_smoke = createvehicle ["smokeshellpurple",position player,[],10,"none"];
#

done

edgy dune
#

ohhh

#

thx

#

would it also work for grenades>

#

offensive greande*

meager heart
#
_frag_grenade = createvehicle ["GrenadeHand",position player,[],10,"none"];
#

done

#

that "GrenadeHand" is ammo for "HandGrenade" classname

#

or it will not boom and even spawn without weapon holder

still forum
#

omfg what a nice but still shit example :3

#

aka nested ifs

#

I love it.

lone glade
#

I can't believe you can't add accessories to weapons in containers (specifically player's uniform / vest / backpack)....

#

there's commands to retrieve them but not add them ๐Ÿ™„

peak plover
#

yah

still forum
#

Guys. Anyone know a shorter name for addWeaponWithAttachmentsCargoGlobal?

meager heart
#

addWeaponCargoGlobalLinked ez

still forum
#

AddLinkedWeaponCargoGlobal?
There is also addLinkedWeaponCargo then.
Just like addWeaponCargo and addWeaponCargoGlobal

sour saffron
#

Addcratemakeplayergethisownoutofthecrate

still forum
#

That's a serious question...

sour saffron
#

yeah and a serious answer

#

more than one way to skin a cat

meager heart
#

addLinkedWeaponCargo, addLinkedWeaponCargoGlobal ?

still forum
#

I don't know if Linked is clear enough

meager heart
#

from linkItem

lone glade
#

it isn't and that word isn't used for any of the getter commands

meager heart
#

also linkedItems...

lone glade
#

which isn't a getter for weapon items / attachments

meager heart
#

it is in cfg

#

cfgInventory i mean

still forum
#

I'm making a new script command.
So far
container addWeaponWithAttachmentsCargo(Global) [weaponClassname, muzzle, side, top, bipod]

Maybe
container addWeaponWithAttachmentsCargo(Global) [weaponClassname, muzzle, side, top, bipod, magazine, ammocount(optional), count(optional)]
With count you can add like N weapons of same type with same attachments

#

Oh man... How do I handle defaults..
If someone passes "" as magazine. Does he want no magazine or the default magazine associated with the classname?

#

How do I handle that

#

I guess I can just take nil as default?

tough abyss
#

Yeah

still forum
#

Is not a problem passing nil in scheduled right? as long as it doesn't come from a variable?

lusty canyon
#

is there a cba/bis func that simulates the auto hover action of choppers?

meager heart
#

nil in scheduled right ?
afaik some bis functions works like that

still forum
#

Nah.. I can't give you the ability to remove attachments that are preset in the weapon class... But that's fine right? @lone glade

lusty canyon
#

@meager heart thanks thats exactly what im looking for

lone glade
#

yes

lusty canyon
#

Actions#AutoHover didnt work im guess cuz im in a class plane not class heli?

young current
#

as in make anything hover?

#

doubt that

lusty canyon
#

not anything, atleast directional thrust vectoring planes like harrier /35b

#

would make it easier to use the pilot camera

young current
#

I mean vtols have hover mode?

lusty canyon
#

vtols dont have hover thats why i want to add it, nvm tho

how do you stop the renegade mechanic? (auto enemy when you FF or crash)
i tried player addscore and increase rank but nothing changed, tried remove group and add to new group but still considered enemy of the state

#

"all i did was crash a blackhawk full of tier 1 operators"

#

i dont know the technical term of what it is but it makes the player side == ENEMY?

meager heart
#
player addRating 2000;
player addEventHandler ["HandleRating",{0}];
lusty canyon
#

YES thats it, i knew it was something like that. my head was stuck with "score" something...

#

if i do the EH 0 rating, will there be any issues to not having the rating go up either?

meager heart
#

rating will not change

lusty canyon
#

to rephrase does having a positive rating actually effect anything?

west grove
#

last time i checked, a positive rating makes your mates not shoot you :>

#

other than that it's just the pointless endmission score, no? i dont think i've seen a point in it ever since operation flashpoint back in the days

lusty canyon
#

i thought addRating and addScore wer different? do both have to be positive so they dont shoot you?

west grove
#

oh, maybe i confused em

#

dont know really, tbh. the only time i use it is when i want the player to be enemy of all

lusty canyon
#

i want the player to never be enemy of all AI just cuz of silly mistakes in driving so i guess ill do the EH with a neg value filter

west grove
#

do the other ai see each other?

#

because might as well just give them a huge negative rating?

#

oh wait, taht wouldnt do. it'll end up as deathmatch :>

eager prawn
#

@lusty canyon I mean, it obviously depends on the mission, as this wouldn't work for all, but a way that's been done before is to have the player on civilian side, and when he makes a "screwup" (as determined by a number of eventhandlers), you swap him to blufor/opfor/whatever.

#

Not sure if that's exactly what you're looking for, but sounds like it ๐Ÿ˜ƒ

west grove
#

i probably would scrap that idea all together, because it's really not smooth to pull off and also i cant really imagine a scenario right now where that would be worth the work :p

eager prawn
#

I mean it depends on the "openendedness" of the mission

#

if it's just a mission where you have to drive on a road and not leave it

west grove
#

another solution would be to have all on blufor side and then switch the enemy groups to opfor, similar to how you suggested above.. just with the ai group and not the player

eager prawn
#

just have it with some invisible zones along the road, if exit zone, switch

#

or, if player sprints within 10m of AI, switch

west grove
#

that probably would be the smoothest way, i guess

eager prawn
#

hell, there's even a vehicle speed handler i believe

#

if speed goes above speed limit, switch

#

40km/h you're cruising, 41km/h, you dead!

#

๐Ÿ˜†

meager heart
#
player addEventHandler ["HandleRating",{0}]; //--- No change in rating
player addEventHandler ["HandleScore",{false}]; //--- No negative score added
west grove
#

"40km/h you're cruising, 41km/h, you dead!" << sounds like american police when you're black :p

eager prawn
#

sounds like a cophater when he's uninformed tbh

#

Not attackin ya, but don't make fun of people who risk their lives to protect innocent people.

lusty canyon
#

from my little understanding of EH would this work


    player addEventHandler ["HandleRating",
    {
        _returnRating = _this select 1;
        
        if (_returnRating < 0) then
        {
            _returnRating = 0;
        };
        _returnRating;
    }];

all positive values get passed along as normal while anything negative should pass 0, is this correct?

west grove
#

"Not attackin ya, but don't make fun of people who risk their lives to protect innocent people." << too late, already made fun of em

indigo snow
#
  player addEventHandler ["HandleRating",
    {
        (_this select 1) max 0
    }];
#

otherwise lgtm

lusty canyon
#

the problem with the so called protect and serve people is when they are in a peaceful gun free country, they have a QUOTA to fill so they have to prey on the innocents they protect just to justify their existence.
its the innocent people that need protection from them!

#

@indigo snow what does max keyword do?

indigo snow
#

returns whichever number is higher

#

inverse of min

#

so if (_this select 1) < 0 it returns 0

lusty canyon
#

oh cool great way to shorten my shiet code

#

i dont need to add my EHs inside the players respawn EH since they are persistent already?

#

and how do you protect your EHs / inits from mission makers that wipe players slate clean?

tender fossil
#

What are the best sources to learn UI editing in Arma 3? Still VBS wiki?