#arma3_scripting

1 messages ยท Page 532 of 1

astral dawn
#

to accelerate lookup

#

or even use missionNamespace for that...

spring stone
#

If I'd do something like this
{getPlayerUID _x} foreach allPlayers I'd assume I'd get an array off playerUIDs on the Server. But then? How'd I use this list to add the action to only a specific player with a specific player ID? (By the way, I do already have an array of the PlayerIDs/steamID64 I want to use)

astral dawn
#

you find the player object as you have posted above, then you use remoteExec and use that player as a target

#

in the remoteExec you addAction

#

so addAction runs on the computer of that player

#

do you do this from server side or from where?

spring stone
#

Oh find was actually the word that made it clear to me. (I somehow didn't know I can find a specific spot in an array....which does make sense that there is one)

#

I think I can work with that. Thanks ๐Ÿ˜‰

drifting copper
#

I am still quite noob to most things ARMA on build side.

Looking for a solution that creates a area that will delete air vehicles in in the trigger area only. Scenario is that pilots keep landing in a prohibited area to everyone's demise. I am not looking for explosion effects but just a simple "remove object" kind of function. Either I suck at google or answer is not posted on there so hoping someone can help please. Not sure how to fill it in but - http://prntscr.com/ntikl9

sullen pulsar
#

yeah pin that, took me forever to find it again peepoMad

astral dawn
#

yeah use find command @spring stone

private _index = allPlayers find {(getPlayerUID _x) == _theRequiredUID};
if (_index != -1) then {... we have found him! };
still forum
#

" I'd assume I'd get an array off playerUIDs on the Server" forEach doesn't return an array

tough abyss
#

I will make possible for players to bury money in my mission, the place dug will have no grass... Arma 3 have a clutter cutter?

still forum
#

yes, grasscutter

astral dawn
#

also if you are using it in a spawned script make sure you make the whole code I posted above atomic in case that allPlayers array changes in between commands... which could happen... once per a million years maybe ๐Ÿค”

tough abyss
#

@still forum thanks

spring stone
#

Oh, yeah you are right Dedmen. Slight overside in my Idea. Thanks at all an @astral dawn ^^

grim coyote
#

Does anyone have any idea what could be another way to execute string like this: SQF _code = str(_object) + " setDamage 1"; call compile _code;

quartz coyote
#

Can you exitWith an EH ?

#

player addEventHandler ["Hit",
{
if (condition) exitWith {};
...

grim coyote
#

sure, but the eh will still stay

quartz coyote
#

ah okay

#

how do you pause the code inside an EH ?

grim coyote
#

you can try to use waitUntil?

#

by saying that the eh will saty I mean that it wont get deleted

#

it just quits and it will run again when the event is performed

still forum
#

"also if you are using it in a spawned script make sure you make the whole code I posted above atomic"
Just store allPlayers in variable.

#

@grim coyote why are you trying to do that?

quartz coyote
#

waitUntil doesn't suit

still forum
#

@quartz coyote use spawn

#

then sleep/waitUntil/whatever inside there

quartz coyote
#

so have a spawn inside the EH ?

still forum
#

ye

quartz coyote
#

making the code scheduled again, is that it ?

#

or executing it in a scheduled environment ?

grim coyote
#

@still forum Storing scripts

#

for later use

#

but guess I need to use remoteExec :/

#

also I cant store _object I need to store "this" and then later replace "this" by new object

#

@quartz coyote basically ```SQF
_object addEventHandler ["eventName",{
_this spawn {
params ["_object","_param2","_param3"];

    waitUntil {_object getVariable ["var",false]};
    //.... code
};

}];```

quartz coyote
#

yeah, i'd understood that.
It's the scheduled / unscheduled environment I'm still learning

grim coyote
#

All you need to know is that you can't run uiSleep, while(kinda), waitUntil etc in unscheduled

#

The advantage of scheduled code is that it runs asynchonously in the background and that you are able to run code with a huge performance impact (nearly) without slowing down the game.

#

this is the reason you cant use waitUntil etc in unscheduled, it would slowdown the game too much

#

since its executing and testing for the value so fast

still forum
#

spawn creates a scheduled script, where you can suspend.
Eventhandlers are unscheduled, where you can't suspend

#

it would slowdown the game too much No that's not the reason

quartz coyote
#

thanks @still forum thats what I wanted to know

grim coyote
#

Yes I know but thats just the easiest way to explain it

still forum
#

the entire game freezes while unscheduled code executes. Meaning your waitUntil condition can never change. Meaning you freeze the game and it will never unfreeze

grim coyote
#

mhh well that was well said xd

jovial steeple
#

Do scripted objects allow comments? It keeps throwing an error when I use //Comment

astral dawn
#

What? Where do you put the scripts? Into object init fields?

jovial steeple
#

Yes

random crescent
#

just write a string

#
"this is my comment";
this allowDamage false;
jovial steeple
#

Thank you

tough abyss
#

@grim coyote you can use waitUntil in unscheduled, the only time it is allowed if condition returns true on the very first evaluation

astral dawn
#

Does the standard remainsCollector also delete inventory items which were dropped on the ground?

#

For instance I have killed an AI unit, I add him to remainsCollector, then I take out some items from his inventory.

#

And drop the items on the ground, then run away.

tough abyss
#

Does it erase browser history?

astral dawn
#

I would expect it not to, but who knows!

tough abyss
#

I know exactly who

craggy adder
#

Abstract question - is there a way to set a variable on a player and then retrieve it from the player? A la OOP?

#

Unless I'm misunderstanding you can't use an object as a namespace with setVariable and getVariable

still forum
#

yes you can

#

objects have namespaces

#

If you read

#

you'll see that it takes object

craggy adder
#

Oh see I'm just reading this wrong, got it

#

varspace can be any of these types Namespace, Object, Group, Team_Member, Task, Location, Control, Display

quartz coyote
#

I'm struggling centring my miniMap in the screen position I gave the display :

    waitUntil {!isNull (findDisplay 46)};
    private _ctrlGPS_Map = (findDisplay 46) ctrlCreate ["RscMapControl", 9943];
    _ctrlGPS_Map ctrlSetPosition [0.846354 * safezoneW + safezoneX,0.728704 * safezoneH + safezoneY,0.103125 * safezoneW,0.209 * safezoneH];
    _ctrlGPS_Map ctrlSetFade 0;
    _ctrlGPS_Map ctrlCommit 0;
    private _pos = getPos player;
    _ctrlGPS_Map ctrlMapAnimAdd  [0, 0.05, [(getPos player select 0),(getPos player select 1),0]];
    ctrlMapAnimCommit _ctrlGPS_Map;

    ["myCompassID", "onEachFrame",{
        //GPS UPDATE
        _ctrlGPS_Map = _this select 0;
        //_ctrlGPS_Map ctrlMapAnimAdd  [0, 0.05, [(getPos player select 0)+550,(getPos player select 1)-250,(getPos player select 2)]];
        _ctrlGPS_Map ctrlMapAnimAdd  [0, 0.05, [(getPos player select 0),(getPos player select 1),0]];
        ctrlMapAnimCommit _ctrlGPS_Map;
    }, [_ctrlGPS_Map]] call BIS_fnc_addStackedEventHandler;```
#

I most be missing something most have done things in the wrong order or the wrong way

still forum
#

you want the players position on the map, not in the world

quartz coyote
#

so replace getPos by ... ?

quartz coyote
#

but that returns screen coordinates in format [x, y] how do I exploit that ?

#

isn't it the other way round i want ?

still forum
#

oh nvm. ctrlMapANimAdd seems to take full position

#

can you say what your actual problem is? besides "I'm struggling"?

quartz coyote
#

so, this display is rectangle in the bottom right of the screen (aprox) in which I have a map displayed. but that map doesn't show the position of the player. it's like it was scrolled up-left somehow

#

in order to show player position I do _ctrlGPS_Map ctrlMapAnimAdd [0, 0.05, [(getPos player select 0)+550,(getPos player select 1)-250,(getPos player select 2)]];

#

which isn't the correct way of doing it

still forum
#

Might be related to the last note

quartz coyote
#

ah okay yes might be ...

#

I could drawRectangle ?

#

but then I don't know how to use that ... Draws a rectangle on the map. so it's probably not relevant

tough abyss
#

General Tip: To prevent dupe deu to syncronized execution on different clients, exec the clients codes on the server.

still forum
#

well does your +500/-250 variant work reliably?

#

might aswell keep it if it works

quartz coyote
#

it doesn't work for everybody and I can't figure out why

#

for me it works fine

#

but someone with slow ass computer it will not

craggy adder
#

Is there any recommended reading on file structure/mod architecture? I'm converting my code from a bunch of execVM scripts to precompiled functions and am curious about best practices

still forum
#

Just do whatever suits you best

#

I'm using a modified variant of the ACE structure

astral dawn
#

Is there an event handler that is called when a vehicle is deleted? For instance when the remains collector deletes a wreck object?

tough abyss
#

Deleted

quartz coyote
#

is there somewhere I can find the list of IDC for displayCtrl
and the IDD for displays ?
How do you know it's this specific IDC and that specific IDD ?

astral dawn
#

Ah thanks I'm being blind... I have even clicked on it some time in the past according to my browser history

still forum
#

From the config @quartz coyote

#

IDC/IDD's are defined in the display/control config classes

quartz coyote
#

can I check em out in the AiO config ?

still forum
#

yes

quartz coyote
#

okay thx

#

i'll go n hunt

#

in what Cfg section ... ๐Ÿ˜ฎ

still forum
#

none

quartz coyote
#

i'm in Splendid Config viewer and can't figure out where to look ...

still forum
#

RscDisplay*
for example

high marsh
#

Bottom, Rsc prefix

quartz coyote
#

right

#

got it

#

thx

brave jungle
#

opening some old code, this doesn't look right for some reason for "_i" from 1 to 6 step 1 do { - anyone getting the same feeling or just me?

spice axle
#

it is right

#

you can specify the steps made by the for loop

brave jungle
#

Just looked off, haven't used a for in a while, wasn't sure ๐Ÿ˜› ty

spice axle
#

I've personally never used it but I read the wiki article once

#

and step 1 is default I think

brave jungle
#

ah

brave jungle
#

Is there a way to add the respawn templates via script? I've made a template tool for some friends but they're currently required to add it into the description.ext - instead i'd like the tool to add this for them.

lavish ocean
jade abyss
#

@lavish ocean thx alot ๐Ÿ˜˜

spring stone
#

First off, sorry for having so many questions today - many projects atm. I'm trying to find a way to do that for some time now but I just don't get an idea:

I want to have whenever a player joins a mission have a systemchat message saying the name and the role description of the unit the player chose. So the first part would be rather easy to do with onPlayerConnected I'd guess but I just can't figure out how I then get the roledescription of the unit he chose.
I think this could be very easily done via the initplayerserver.sqf or so but I want to have it as script/function so I can use it in a mod.

Does anyone have an idea what I could do?

peak plover
#

yeah

#

@spring stone

#

Line 149

#

Basically import the mission config

private _groupsCfg = (format ["getText(_x >> 'dataType') isEqualTo 'Group' && ((toLower(getText(_x >> 'side'))) in %1)",_sides]) configClasses (missionconfigfile >> "MissionSQM" >> "Mission" >> "Entities");
#

loop through the groups and then all the units in the groups

#

find the matching unit

#

And then you can access his attributes

#
private _role = (getText(_unitCfg >> "Attributes" >> "description"));
#

the attribute "name" is the variable name of the unit

spring stone
#

Okay, gimme a moment to understand all this ^^

#

Mhhh okay I might missunderstand all that code but I'm trying to figure out right now how I could execute this whenever someone joins a mission.
The reason why I say that is that in private _role = (getText(_unitCfg >> "Attributes" >> "description")); you need to know the unit - here _unitCfg. If I'd use onPlayerConnected I'd not have that information though. (I mean, I'm willing to say that I don't understand how onPlayerConnected and/or the code above works)

astral dawn
#

Why does dynamic simulation disable simulation of an enemy vehicle driven by an enemy AI when I enter a static machinegun? :/ Or should I just give up the standard dynamic simulation and write my own? :\

tough abyss
#

Probably because getting in vehicle for some strange reason removes you from scene so engine thinks there is no one to simulate it for

#

Smells like a bug and warrants a ticket

astral dawn
#

But wait there's more! If I place a static with zeus it works fine ๐Ÿค”

tough abyss
#

Make a repro

astral dawn
#

Oh well, what's the chance that they are even going to look at it?

tough abyss
#

Well without a ticket the chance is definitely close to 0

astral dawn
#

Yeah it's working very very weird, I don't understand it, I guess I will just not use it for now. Or maybe I need to refine it so that my code only enables dynamic sim. for vehicles that are empty.
As for chances, I guess that if I create a ticket they are somewhere close to chances of this: https://feedback.bistudio.com/T126877

fluid wolf
#

Ok IDK why, this makes no sense. Type object, expected array. _Bullet = _this select 0;

astral dawn
#

What is this??

#

I mean _this

fluid wolf
#

thats literally the entire program.

#

its the first line in an SQF... and I'm not calling it right

astral dawn
#

๐Ÿ”ฎ

fluid wolf
#

...no I am calling it right

#

this execVM "Track.sqf";

#

I think my armas just having an anurism theres no way I'm erroring out trying to define a variable

astral dawn
#

well you tell it, variable _bullet is equal to element 0 of _this

fluid wolf
#

Yes

astral dawn
#

it tells you that variable _this must be an array because select works only with arrays

#

so... _this must be not array then

fluid wolf
#

select 0 is the first instance in an array

#

if its not an array its the first instance, which is itself

#

if it is an array, its the first instance of an array

#

Type Object, expected Array,String,Config

astral dawn
#

so...
where do you call it? Vehicle init field? or somewhere else?

fluid wolf
#

first line of an SQF is _Bullet = _this select 0;

#

this execVM "Track.sqf"; is in an init of a unit

astral dawn
#

so in the init field, this is a unit object's handle

#

it passes it to the script

fluid wolf
#

yes

astral dawn
#

then you do
objectHandle select 0

#

it tells you, it's an object and it expected array or config

#

you could just do _ Bullet = _this; then

fluid wolf
#

...that doesn't make a lot of sense to me. I've literally never had to use objecthandle select 0

astral dawn
#

select is an operator to work with arrays, and you are giving it not an array ๐Ÿคท

#

or you can use params inside your script:
params ["_bullet"];
use params everywhere you need to unpack parameters incoming into a function through a call or spawn or execvm

fluid wolf
#

...Oh. Oh. Its because I did this execVM and not [this] execvm

tall crescent
#

What key terms should i look up for scripting

#

mainly server code and missions

astral dawn
#

_this execVM is also valid... if you just unpack it inside your script properly

#

@tall crescent probably, above SQF basics, also remoteExec / remoteExecCall and its JIP parameters

#

Also locality things

tall crescent
#

Thank you

tough abyss
#

Hi! The grass cutter "Land_ClutterCutter_small_F" is not removing grass, why? The "Land_ClutterCutter_medium_F" one is removing...

#

But "Land_ClutterCutter_medium_F" is too much big

#

Anyone can help on making "Land_ClutterCutter_small_F" work?

devout stag
#

Land cutter small does work.

#

It just might not be very visible to you.

#

Just used it yesterday.

tough abyss
#

I have a question for someone, I have an interface, a buddy made it for me and I modified it, I'd like to make right clicking execute a script, or a function, in my case, I'd like it to close the current interface and then execute a script to open the previous interface, but the right clicking part is what I'm stuck on.

tough abyss
#

@devout stag thanks. I ran this code in the console, with the player standing on the grass: createVehicle ["Land_ClutterCutter_small_F",ASLToAGL getPosASL player,[],0,"CAN_COLLIDE"]; and there is absolutely no change in the grass.

#

Medium cutter works.

#

I got a similar thing in my mod for cutting grass if you're sniping.

jovial citrus
#

does anyone know if there's some function to create that circular progress bar used for vanilla revive?

tame portal
#

The list of events can be found here

jovial citrus
spark turret
#

Can someone tell me if VCOM Driving is still an up to date script? I remeber reading about it being abandoned long ago bc Vanilla fixed its driving or something

spice axle
#

when I got

params ["_array"];

and I need to add a default value, is

params [["_array", [], [""]];

correct?

winter rose
#

nope

#

the third argument is an array of accepted types, so here you would only accept strings

#
params [["_array", [], [[]]];``` would be better @spice axle
spice axle
#

ah yes of course, arrays inside params is a mess for me every time, thanks a lot

winter rose
#

anytime!

fluid wolf
#

Does anyone know what the animations for the landing gear on the back wasp are? Or at least where I can find them so I can force a gear up/down?

spice axle
brave jungle
#

Is there a way to add the respawn templates via script? I've made a template tool for some friends but they're currently required to add it into the description.ext - instead i'd like the tool to add this for them.

still forum
#

yes

#

The config is read by a BI script, which then creates the thingies

#

So if it can do it, so can you

#

BIS_fnc_initRespawn

#

Or no. Maybe it was BIS_fnc_selectRespawnTemplate ๐Ÿค”

brave jungle
#

Thank you ๐Ÿ˜ƒ - I'll look into it. I saw that it runs predefined scripts, but I wasn't sure where to even start ahah

still forum
#

or BIS_fnc_showRespawnMenuPosition ๐Ÿค”

brave jungle
#

So many xD

fluid wolf
#

@spice axle That doesn't work

#

AI overrides the action

#

And without an AI you cannot use actions on the object

brave jungle
#

have you tried disableAI to stop them from performing actions themselves? I think it's "FSM"

fluid wolf
#

Disable AI does nothing to aircraft

#

Literally nothing

brave jungle
#

Well it does

#

because i've used it before.

fluid wolf
#

I have disableai "ALL" on both pilot and aircraft

brave jungle
#

CHeck your object argument.

fluid wolf
#

they do not function

brave jungle
fluid wolf
#

Its this disableAI "ALL"

brave jungle
#

unitName: Object - AI unit

fluid wolf
#

for both the pilot and the plane

brave jungle
#

Well if you all AI features, it wont do anything at all.

fluid wolf
#

Thats what you think. Put a plane near a runway and it does't care

#

I did this enablesimulation false; on the pilot and disabled "ALL" for both pilot and plane and it still took off

brave jungle
#

Might help

#

` No way to solve this without disabling the simulation of the pilot.

If the plane was moving before the command with throttle setting above 0 it will continue to move in a wonky way.

Setting the fuel to 0 might be the more elegant solution, if you're okay with the canopy opening. `

#

basically it's setting it's engine and path before you've told it not to do it anymore, by the sounds of things

fluid wolf
#

It doesn't actually matter what you do to the pilot

brave jungle
#

You got showScriptErrors on yeah?

fluid wolf
#

I do not, what is that?

brave jungle
#

Tells you errors with commands

fluid wolf
#

oh wait is that the black boxes

brave jungle
#

i na black box

#

Yeah

fluid wolf
#

Yea I have that on

#

No this enablesimulation false does not matter on the pilot at all

#

A plane will continue to function without a simulated pilot

brave jungle
#

Dunno what you're doing wrong then

#

disabling sim will work

fluid wolf
#

Only on the plane

brave jungle
#

but if you're not getting expected results, you're execing it wrong

#

you should be dealing with the object, rather than the pilot.

fluid wolf
#

I'd love to think that but I have no idea how I could possibly be doing it wrong

#

Yea if you disable sim of the VEHICLE it stops moving

#

but not the pilot, it doesnt care about the pilot

brave jungle
#

It's how the engine reads the object/unit

fluid wolf
#

problem is if you disable sim of the vehicle it wont accept any commands

#

meaning if you want to park and turn off a plane

#

you can only do one or the other

brave jungle
#

What is your intended result?

fluid wolf
#

Literally landing a plane and pulling it off the runway

brave jungle
#

You thought if just recording this?

fluid wolf
#

I did

fluid wolf
#

I'm using a playmove on it

#

while {Basejetphase == 1} do {Basejet action ["LandGear", Basejet];}; is being used to FORCE landing gear to deploy because the AI will not use it otherwise

still forum
#

playMove is for a single animation

brave jungle
#

^

still forum
#

Landing a plane is something completely different ๐Ÿ˜„

brave jungle
#

Bad use of a while by the way - no delay so you'll lag like hell evemtually

fluid wolf
#

Not playmove sorry yea, the rec and playback

#

it turns off after 10 seconds, thats not the whole script for it

#

but anything short of calling that every frame and the AI retracts landing gear and smashes into the runway

#

And if I have no AI in the seat or kill him, I cant use an action on the plane at all

brave jungle
#

unitPlay and unitCapture might be smoother results anyway.

fluid wolf
#

Thats what I'm doing

#

[Basejet, BasejetLandP] spawn BIS_Fnc_Unitplay;

brave jungle
#

yep

#

don't forget

fluid wolf
#

but it needs gear to land or it explodes

brave jungle
#

compile the stuff on postInit

#

here two secs

fluid wolf
#

and the SECOND the unitplay ends, the AI tries to take off again, wont respond to engine shutoff scripts

#

and if I dont get the engine shutoff the noise just covers the area forever

brave jungle
#

var = compile preprocessFile "__path to data__.sqf";

fluid wolf
#

BasejetLand1 = compile PreprocessFile "PATHS\BasejetLand.sqf";

brave jungle
#

then you can just run [object, var] spawn BIS_fnc_unitPlay;

#

Yeah

#

Cool

fluid wolf
#

Which is what I'm doing

brave jungle
#

๐Ÿ‘ Making sure lad thats all

fluid wolf
#

thats fine

#

If I can like, force the animations that would be ideal, because then I can just have the already desimulated pilot be dead

brave jungle
#

you're better of just having scripted AI, rather than letting them have semi-control

#

if you want the same result every time

fluid wolf
#

They dont have any control, or very minimal

#

the one split second they have though is messing shit up

brave jungle
#

Then have the plane empty on startup, disable sim on it.
Have an AI pilot and disable it's AI etc. move him into the pilot seat. from there so there is a pilot on the cockpit.

fluid wolf
#

unfortunately action does not work on vehicles if the pilot isn't dead

brave jungle
#

you can kill a unit if the simulation is disabled
he wont react arma reads it as a dead object.

fluid wolf
#

Planes already disabled sim on startup, it gets its landing call off a trigger right now

#

Problem with that is if he's dead, I cant use actions on the jet

#

btu if he's alive, I cant turn the jet off

brave jungle
#

so like i've said

#

disableSim, kill him when necessary ๐Ÿ˜ƒ

fluid wolf
#

and I cant lazarus him as far as I know, so I cant turn him on and off by killing and resurrecting him

brave jungle
#

Well i've given you how i'd do it, I myself have done something similar with a helicopter landing and stuff and mine worked with little error. Gonna go back to working out this dumb respawn template thing.

fluid wolf
#

Alright

brave jungle
#

Perhaps someone with more knowledge can help you further ๐Ÿ˜

#

I rarely fuck with AI

#

How would I grab the attribute name for set3DENAttribute with system-specific modules, for example owner on the Zeus GM module.

I'm right in thinking it would be the attribute name made by the class by default right?

tough abyss
#

getVariable "owner"

#

I think

#

Use allVariables

#

to see what it has you can access

brave jungle
#

It's a classname

#

I'm thinking

#

Looking up the class names now

#

property = "ModuleCurator_F_Owner"

#

Oh well found it now ๐Ÿ˜›

quartz coyote
#

playerA locally executes

player setVariable ["myVar", true];```
Will it return ``true`` (on my server) if my server executes server-side 
```SQF
playerA getVariable ["myVar", false]
// or
playerA getVariable "myVar"```
?
brave jungle
#

Arguments are global

#

Effect is local

#

for setVariable

#

if you use the alt syntax, varspace setVariable [name, value, public] you can use the public parameter to make the effect global.

#

Public is BOOLEAN

#

so for you example

quartz coyote
#

but then I can't use player as argument or everyone will get player instead of the PlayerA ?

brave jungle
#

playerA setVariable ["myVar", true, true];

still forum
#

@quartz coyote no. Player is a command that returns the local unit

quartz coyote
#

ah

#

then I can

still forum
#

setting a variable on player means "set on current played unit"
not "set on every player"

brave jungle
#

if you wanted all players you could use forEach and allPlayers, right dedmen?
If that was what he's after that is

#

If that was what he's after that it

#

If that was what he's after that it

still forum
#

yes

brave jungle
#

My discord is soo laggy today xD

ornate sky
#

why can some ammo be spawned with createVehicle such as "Bo_GBU12_LGB" but not others such as "Sh_125mm_HE"?

dim kernel
#

Anyone know how to get the vehicle Engines RPM

jade abyss
#

By Script? ๐Ÿค” Don't think you can.

dim kernel
#

๐Ÿ˜ฆ

astral dawn
dim kernel
#

cars

jade abyss
#

have you tried that with a car?

young current
#

use the animationsource

jade abyss
#

Very nice idea! ๐Ÿ‘

tough abyss
#

Have you tried sound controllers?

quartz coyote
#

@still forum
After further testing, it seems that it works for me because +550/-250 are working with my screen rez or UI size.
people with different one will see there miniMap shifted.
How could I adapt it to every screen rez or UI size ?

still forum
#

I have no idea. Maybe collect matching values from different screen sizes / aspect ratios and see if you can find a pattern in there

quartz coyote
#

so predefined parameters and depending of the client's ones, the script would select the correct settings ?

#

could do

cosmic lichen
#

see there miniMap shifted.

#

What do you mean?

quartz coyote
#

the miniMap isn't centred on the player's location @cosmic lichen

cosmic lichen
#

tried pixelGrid system?

quartz coyote
#

no, what is that ?

cosmic lichen
#

The safezone stuff doesn't scale properly with different aspect rations

quartz coyote
#

shit reading ...

cosmic lichen
#

๐Ÿ˜„

quartz coyote
#

welp, i'll be back when I finished understanding all of this

#

๐Ÿ˜„

cosmic lichen
#

Or use GUI GRID

quartz coyote
#

nah, I like challenges !

cosmic lichen
#

Also in Eden Editor

#

try findDisplay 313 createDisplay 'RscTestGrids'

#

This will give you an idea what the different methods for dimensioning and positioning of GUI do.

quartz coyote
#

okay thx

#

but in the first place, if ctrlMapAnimAdd and ctrlCreate worked correctly, I wouldn't be doing this ......

cosmic lichen
#

In your case it would be helpful to have the code and a sceenshots (from you and from those where it's not working)

quartz coyote
#

i'll pm you

median aspen
#

Someone have a script for status bar (for in wasteland ?

winter rose
#

Discord allows you to delete one y'know ^^

oblique lagoon
#

Think im lack of auth

#

Also didnt see no url rule. Just saw it. Sorry

young current
#

looks like something in it is not working.

delicate lotus
#

I got a question about some weird script code used by BI in the Jet DLC showcase.

switch _taskID do {
    _this call _taskFunction;
    default {
        ["Task ID '%1' not defined in %2",_taskID,_taskFunction] call bis_fnc_error;
    };
};

This is an extract of code from the function: BIS_fnc_missionTasks.
It seems to call missionsTasks.sqf inside the missions folder.

But the structure of the missionTasks.sqf looks like this:

case "BIS_tskEquipment": {...};  //... indicates there is code there which is not important to my question.
case "BIS_tskJet": {};
case "BIS_tskTakeOff": {};
etc.

It seems to be possible to use case from a switch do in different file when the file gets called by a switch. There is nowhere noted on the BIKI though. And the BIKI also says that case can only be used in a switch do. Why does this even work?

winter rose
#

that'sโ€ฆ awful

delicate lotus
#

It is? I was planning on using something like this for my missions because it seems to make work a lot easier

still forum
#

It works because the switch condition is stored in a magic/secret local variable

#

and as you know, local variables carry over to lower scopes

#

so that's why that works.

delicate lotus
#

so the _this is the magic variable of that scope?

still forum
#

no

#

it's ___switch or something like that

delicate lotus
#

I guess I have not understood how scopes work then. I always thought call makes code execute somewhere else and not just in a lower scope.

still forum
#

spawn executes in a new script

#

call doesn't

delicate lotus
#

Would be cool if this example of BI code would be noted on the BIKI

#

since it seems kinda useful

winter rose
#

awful* ^^

hollow thistle
#

Bury it.

delicate lotus
#

Why is it awful though?

winter rose
#

it makes something like

switch (_condition) do {
    call {
        case "rabbit": { hint "ok"; };
        case "pink": { hint "nope"; };
    }
    default { hint "failed"; };
};```
and it skips the logic to another file, which is not really readable
delicate lotus
#

true

#

but the thing about scopes and call is really new to me.
If I got a variable, like _a in a higher scope. And I call code, the code will be able to use _a?

#

Like:

_a = 1;
call {hint str _a};
winter rose
#

yes, hence the need for private

still forum
#

@winter rose missing call in your code

winter rose
#

nope ๐Ÿ‘€

delicate lotus
#

I should start to use private then...

winter rose
#

take good care of them yes :-]

delicate lotus
#

Will params also make stuff private like private does?

still forum
#

yes

delicate lotus
#

that probably explains why I never had issues

still forum
#

don't use the private command though.
the private keyword is infinite times as fast

delicate lotus
#

ah okay

winter rose
#

well, unless you declare your var beforehand but it's not really the top case

#

e.gsqf private "_myVar"; _myVar = 5; // bad private _myVar = 5; // good

delicate lotus
#

Thanks for the help Dedmen and Lou Montana. Really appreciate it ๐Ÿ‘

craggy adder
#

Is it possible to override the default ammunition settings in a scenario? For example, say I wanted to change the velocity of a particular magazine of 9x19mm ammo to 100m/s instead of whatever the default is.

still forum
#

not really

#

you can use a fired Eventhandler. and just call setVelocity to set a custom velocity

#

But you cannot edit the default as that's config

craggy adder
#

rgr. thanks

quartz coyote
#

How can I identify what different layers exist to select the right one ? or is it just a custom name ? layerName: String - layer name on which the effect is shown. Layer names are CaSe SeNsItIvE
https://community.bistudio.com/wiki/cutRsc

craggy adder
#

Looks like I just used 1 for my custom HUD. 1 cutRsc ["CQCHUD","PLAIN"];

#

Not sure how to get a list of what exists. Looks like you can just use 100 to guarantee it'll be 'on top'? Or whatever the max int is.

quartz coyote
#

yup, thanks !

#

does the class: String - the class name of the resource. ("Default" will remove the current resource.) need to be in RscTitles ?

#

ah yes it does

#

answered my own question

tough abyss
#

If I get a display using findDisplay,can I view the controls of that display?

#

Also what does RSC stand for?

still forum
#

Resource I assume (wild guess)

tough abyss
#

I doubt that

#

It's in reference to displays

#

Maybe though

#

It's Rsc so possibly

#

You're right actually

misty gale
#

Scripting question from uber scripting beginner

#
private["_weapon","_muzzle"];
_weapon = currentWeapon player;
_muzzle = currentMuzzle player;

if (_weapon != "") then {

    [player, _weapon, _muzzle] call ace_safemode_fnc_lockSafety;

};

waitUntil {!isNil "MyVariable"};

[player, _weapon, _muzzle] call ace_safemode_fnc_unlockSafety;
#

if player change weapon during the waitUntil, are _weapon and _muzzle stored ?

#

or will it run on updated currentWeapon/currentMuzzle ?

astral dawn
#

no it doesn't auto update it

misty gale
#

purfect

#

ty ๐Ÿ™

#

(I'm sure it's not going to store the actual weapon and unsafe it if it's not in player's hand but well)

misty gale
#

it actually works and automatically switches back to previous gun to unsafe it

#

yeeeey

willow rover
#

So can someone help me get a player UID before the player character is spawned?

peak plover
#

There is an event handlwr for joining the server

quartz coyote
#

hi is there a way to change the side of an empty object ?

#

like a car

#

i'd like it changed from Civ to sideUnknown

#

I tried with createCenter and createGroupbut didn't work

west venture
#

You could put an invisible (and AI dead) sideUnknown guy in the back seat?

quartz coyote
#

i'll try

#

not working because this idiot is ejecting when the vehicle is too damaged

#

even with simulation disabled

west venture
#

this AllowCrewInImmobile true;

#

^in the vehicle init

quartz coyote
#

private _sideCars = createCenter sideUnknown;
private _grpCars = createGroup sideUnknown;

doesn't work

#

if I try sideLogic they correctly change sides

#

but sideUnknown they don't

drifting copper
#

So I have found a script by TacticalGamer on YT that shows how to enable respawn loadouts via respawn module. Looking for a way to duplicate it to OPFOR but noting I know nada, zero and zulch about coding I am at a bit lost.

Question is how to "duplicate" the following to apply to OPFOR as well without the two sides sharing kit.

desc.exe

{
    class RifleBasic
    {
        vehicle = "B_Soldier_F";
    };

    class SquadLeader
    {
        vehicle = "B_Soldier_SL_F";
    };

    class Medic
    {
        vehicle = "B_Medic_F";
    };

    class AR
    {
        vehicle = "B_Soldier_AR_F";
    };

    class LAT
    {
        vehicle = "B_Soldier_LAT_F";
    };
};```
initServer.sqf

```[west,"RifleBasic"] call bis_fnc_addRespawnInventory;
[west,"SquadLeader"] call bis_fnc_addRespawnInventory;
[west,"Medic"] call bis_fnc_addRespawnInventory;
[west,"AR"] call bis_fnc_addRespawnInventory;
[west,"LAT"] call bis_fnc_addRespawnInventory;```

This goes with a onPlayerKilled invent call command
signal kite
#

is there a function or script that tells me the actual round a weapon or vehicle is using; eg "Sh_155mm_AMOS" for "B_MBT_01_arty_F"?

drifting copper
signal kite
#

@drifting copper I'm already using that, but with mods it would be handy to get it in-game

drifting copper
#

For modded I usually search in the Config Viewer

still forum
#

@drifting copper in CfgRespawnInventory make new classes for each. And use O_ vehicle entries instead of B_
O for opfor.
And in the initServer.sqf use east instead of west

#

You need to choose other names for the new classes in CfgRespawnInventory
You can't have duplicate names

drifting copper
#

So if I understand correctly?

{
  class BLUFOR  RifleBasic```
still forum
#

classnames cannot have spaces in them

drifting copper
#

Roger

#

Thank you, most is working so far. Except for one role ๐Ÿ˜… It did not like NAR but accepted HAR. @still forum much appreciated!

drifting copper
#

Host\Local I get no errors. Though on server "Script loadouts\medicOpfor.sqf not found.

I assume it is related to case "Medic": { player setUnitTrait ["medic",true,false]; _loadoutPlayer = [player]execVM "loadouts\medicOpfor.sqf"; };?

If so how would I fix the error?

still forum
#

well is the script in the folder that it's supposed to be in?

drifting copper
#

As far is I know it calls to basic arma "medic" role. No idea where to even look. As far as I know blufor "medic" works fine with

  {
      player setUnitTrait ["medic",true,false];
      _loadoutPlayer = [player]execVM "loadouts\medicBlufor.sqf";
  };```
still forum
#

It references a script file in your missiin

#

the error complains about the file not existing

drifting copper
#

Mind if I DM you all the scripts as it will be too much for on here

still forum
#

Don't have time to look through that stuff

#

But as I said, you have a medicBlufor script in the loadouts folder, but you don't have a medicOpfor script. So you have to make one.
Probably copy and edit the blufor one

drifting copper
still forum
#

No idea where your "medicBlufor.sqf" comes from then

#

But whatever you did with that one, do the same for the opfor one

little ore
#

Is there a way in Arma 3 to set the viewdistance seperatly for each client?

spice axle
#

Yeah it is already in Vanilia game

still forum
#

@little ore #rules no crossposting. Choose one channel not two.

oblique lagoon
#

GUI onLoad seems to be not working and Could not find solution... Anybody has any idea about this??

quartz coyote
#

Yo all
I'm doing a
_ctrl ctrlSetStructuredText parseText '<t size='2'>M16A1</t>';
and i'm getting an error <t size='#2'> missing ;

#

anyone got an idea ?

still forum
#

just look at where your string starts and ends

#

it starts at the ' and ends at the next '

quartz coyote
#

no that's just me not pasting the full script

still forum
#

no it's not

quartz coyote
#

hold on

#

updated

still forum
#

Do you want me to repeat exactly what I just said now?

quartz coyote
#

still don't see what you mean

still forum
#

You have two strings in there

#
  1. "<t size="
  2. ">M16A1</t>"
    and a 2 inbetween
quartz coyote
#

should have pasted the full code :

still forum
#

why did you chose to use ' on the outer quotes? People usually use " and I've also seen you use " in the past, why change now?

quartz coyote
#
((findDisplay 9997) displayCtrl 2400) ctrlSetEventHandler ["MouseEnter",
"((findDisplay 9997) displayCtrl 1200) ctrlSetText 'Images\assault\m16a4.paa';
((findDisplay 9997) displayCtrl 1000) ctrlSetStructuredText parseText '<t size='2'>M16A1</t>';
((findDisplay 9997) displayCtrl 1001) ctrlSetStructuredText parseText '<t>Semi-automatic with three round burst fire.<br/>Effective at medium to long range.</t>';"];```
still forum
#

Okey so..

#

You really expect me to repeat myself for the third time now?

#

Now I can atleast see why you chose to use '

oblique lagoon
#
        class BTCS_Vehicle: RscListboxBTCS
        {
            idc = 1500;
            x = 0.0309451 * safezoneW;
            y = 0.253 * safezoneH;
            w = 0.0825207 * safezoneW;
            h = 0.066 * safezoneH;
            onLBSelChanged = "player setDamage 0;";
        };
``` onLBSelChanged also not working.. whats wrong with listbox
still forum
#

If you start a string with " it ends at the first "
If you start a string with ' it ends at the first ' too

quartz coyote
#

you can repeat or not, i'm just not seeing the point. but if you explain why you are repeating i'll understand i'm sure ๐Ÿ˜‰

still forum
#

I just told you

quartz coyote
#

sorry I write slower than you

still forum
#

'<t size='2'>M16A1</t>' You have two strings.
Here, I'll seperate them for you by inserting a space
'<t size=' 2 '>M16A1</t>'

#

The game things you are trying to call the script command 2 with two strings as arguments

quartz coyote
#

uh ....

still forum
#

but such a script command doesn't exist

quartz coyote
#

so just adding spacing solves the problem ?

still forum
#

no

#

๐Ÿคฆ

sullen pulsar
#

am i crazy or does uiNamespace not work in multiplayer anymore.

still forum
#

crazy

quartz coyote
#

understood

#

'<t size=''2''>M16A1</t>'

#

double them

#

working

#

thanks

still forum
#

The solution is to have either different quotes (which is why you were trying to use ' quotes inside a " quoted string) or doubling them to "escape" the quotes

astral tendon
still forum
#

isKindOf checks if the class of the object inherits some other class

#

BIS_fnc_objectType doesn't return the class

astral tendon
#

Still get the type you need to compare.

still forum
#

What are you trying to do?

astral tendon
#
vehicle player call BIS_fnc_objectType ;// return ["Vehicle","Helicopter"]
vehicle player isKindOf "Helicopter"; //return true
tough abyss
#

isKindOf is for classes

#

not categories

still forum
#

Now you showed me a piece of script and I have still no idea what you are trying to do

#

I'm quite sure you are asking the wrong questions and assuming things that aren't true

astral tendon
#

Check what "Kind of" the vehicle is.

still forum
#

That doesn't make sense

#

A vehicle can have dozens of "kind of"s

astral tendon
#

๐Ÿ™„

still forum
#

how would you know which one might be the one you want

#

What do you need to know that for?

#

What are you trying to do

astral tendon
#

Im looking at a black fish, how do I know what kind he is?

#

should I check each option with isKindOf or just check with BIS_fnc_objectType? or go trough the config file?

tough abyss
#

I think you want to know the class of an object

#
_unitClasses = [(configFile >> "CfgVehicles" >> _unit), true] call BIS_fnc_returnParents;
#

_unit is your object

#

That returns all parent classes

#
(configFile >> "CfgVehicles" >> _unit)
#

For just the class I think

still forum
#

"should I check each option with isKindOf or just check with BIS_fnc_objectType?"
objectType is probably faster, but I have not looked into what it does

quartz coyote
#

in Dialogs, if display idd is different can control idc be the same from one display to another ?

still forum
#

yes

quartz coyote
#

okay thanks

tough abyss
#

It loads the ui,but nothing is displayed

#

I can't get my RscTitle to appear in game

fluid pier
#

Is there any good starting good for scripting in Arma 3 ?

tough abyss
#

the wiki

#

extracting other missions

#

youtube

fluid pier
#

well i guess i cant just code stuff in C#?

tough abyss
#

SQF

#

is the language

fluid pier
#

I thought the engine was c#?

tough abyss
#

I'm not sure, but the scripting language used for missions is SQF

fluid pier
#

So we cant run a script in C# even if it was on a mod?

tough abyss
#

Not sure about with mods

still forum
#

The engine is C++

#

No mods also don't do C#

#

You might be mixing Arma up with DayZ who has a C# like language (still no C#)

fluid pier
#

So could i call scripts using c++ as surely the engine should handle that

still forum
#

No

#

You can write extensions in C# or C++. But unless you use Intercept you cannot call back into the game and use any of the scripting API

fluid pier
#

Ahh ok so just best to keep it in swf

#

sqf*

#

So i write the script put it in the mission and say execute script .sqf in the mission

#

Can the script change without needing to reload the game ?

still forum
#

You can reload the mission, or use filePatching and reload the script

fluid pier
#

Ok perfect ill get onto trying to create what i need to do then i was just wondering where the best place to start is

tough abyss
#

Given an IDC from a gui can I remove/ edit that element?

still forum
#

never tried

#

but should be possible

#

the ctrl commands

jade abyss
#

@fluid pier check the pinned msg in this channel, if you want to start. It's an overview with all commands (incl. examples)

tough abyss
#

I have created a new Rsc layer, and when I spawn it, it's behind the curator UI

#

So I can't interact with it

#

How can I place it on top

peak plover
#

whachu mean

#

interacting with an rsc layer?

sonic crane
#

Hello i am a idiot

jovial steeple
#

I am trying to attach a camera to an aircraft turret, Killzone Kid's tutorial ( http://killzonekid.com/arma-scripting-tutorials-uav-r2t-and-pip/ ) provides the details for the Darter's turret however Im not sure exactly what I am looking for if i want to use other vics. Could someone please tell me what files I should be searching through?

tough abyss
#

@peak plover Clicking buttons etc

astral tendon
#

Is there a fuction for the AoA (angle of attack) of the F/A 181 black wasp hud? or any way to reverse enginner that?

unborn ether
#

@tough abyss cutRsc is not suitable for interactive meanings, its suitable for things like HUD.

#

You can modify existing display via ctrlCreate or addon with curator display class substitution.

tough abyss
#

Given an IDC from a gui can I remove/ edit that element?
Can hide it with ctrlShow or move away with ctrlSetPosition, can change appearance yes. However if the control is engine driven, it might be not possible to maintain the changes

tough abyss
#

I gotthatworking

#

@unborn ether The curator overlay is an rsc though?

astral dawn
unborn ether
#

@astral dawn Welcome to BIS Consistency โ„ข

#

AFAIR that concludes any multiplayer hosted mission, including hosting editor.

astral dawn
#

Hmm interesting, thanks

#

including hosting editor.

unborn ether
#

Yes you can host editor in multiplayer.

astral dawn
#

yes I know that I can host, I didn't know that isMultiplayerSolo would return true there, might be useful for me

tough abyss
#

I didn't know that isMultiplayerSolo would return true there
it doesnt

burnt cobalt
#

if you wanted to know how much cover an object provides, how would you go about it? Other than sqf _armor = getnumber (configfile >> "Cfgvehicles" >> typeof _obj >> "armor");
The armor entry returns 0 for a lot of map objects that could be used as cover, but I can not think of ways to filter them any further unless _armor > 0 is true

still forum
#

it's mostly defined in the material on the triangle in geometry lod of the model of that object

#

Can't retrieve via script, besides maybe firing a fake projectile into it and seeing what happens

burnt cobalt
#

oh no - my worst expectation ๐Ÿ˜‰ I read about bullet penetration and found no way to read the entries that came up

#

the fake projectile is a great idea, i'll see what i can do - thanks!

tough abyss
#

If I'm using ctrlCreate ["RscPicture_test", 1200];

#

How can I access the class if its nested in another class?

halcyon crypt
#

class or control?

tough abyss
#

They're the same thing right

#

They're defined as classes?

halcyon crypt
#

they're not the same, but ctrlCreate returns the Control so you can access the control by that value

#
private _control = _someDisplay ctrlCreate ["SomeCLass", 2143214];
_control ctrlSetPosition [0,0,1,0.04];
tough abyss
#

Okay I see what you mean

#

I'm referring to the class

#

So I have a class RtsControls

#

With sub classes

#

How can I use a subclass in the ctrlCreate class

halcyon crypt
#

ahh gotcha

#

don't think that's possible

tough abyss
#

So it has to be in the root of description.ext

halcyon crypt
#

yes

tough abyss
#

That sucks :/

halcyon crypt
#

if you want to nest stuff then you have to build the entire dialog in config

#

and not use the ctrlCreate commands

tough abyss
#

That wont work

#

As I'm trying to modify an existing display

young current
#

Suggestion. Open up the arma config and look how similar vanilla stuff is set up.

tough abyss
#

There are no scripts in there

astral dawn
#

wait. if you are creating a display, you can just create whole display from config. or are you adding controls to an existing display?

tough abyss
#

The latter.

young current
#

The classes are the same

tough abyss
#

Shall I give some context of what I'm trying to do

#

Maybe you guys can suggest a better solution than mine

astral dawn
tough abyss
#

I want to make it so all classes within a certain class, are iteratively added to a display

#

But when they're within another class,they cant be found

astral dawn
#

yeah that's what my code was solving... I was adding controls to map display

tough abyss
#

I have a lazier solution

#

I'm going to try

astral dawn
#

What's the solution you have in mind?

tough abyss
#

So I wanted to iterate through all of the classes within the parent class

#

And then add them to the display

#

But obviously I cant

#

But I can just put them in a hpp file and define them in the class and in the base of description.ext

#

Or I could keep the class names in a separate array

#

But I cba typing them out twice

#

Hi,
i'm trying to reduce the number of bullet to break a wheels,
but the wheels don't break even at 1 of damage value anybody know why?

#

@astral dawn

//description.ext
class RTSControls {
    #include "dialogs\curator_extensions.hpp"
}

#include "dialogs\curator_extensions.hpp"

//sqf code
_addNewElements = {
    _curatorUI = (findDisplay 312);
    _classes = "true" configClasses (missionConfigFile >> "RTSControls");

    {
        _name = configName _x;
        _curatorUI ctrlCreate [_name, -1];
    }forEach _classes;
};
#

That does it perfectly ๐Ÿ˜ƒ

tough abyss
#

Can I spawn a building without collisions?

unreal leaf
#

A param [B,C] seems to do the same as A max B min C But is not mentioned on biki

tough abyss
#

Can I spawn a model without any collisions?

#

So its literally just rendered and nothing else

jade abyss
#

No need to repeat your Q =}

#

check the pinned link and look for simpleObject

#

(ctrl+F if not known @tough abyss )

tough abyss
#

@jade abyss But simple objects still have collisions?

jade abyss
#

Yes

#

Thats baked in the model.
๐Ÿค” idk if attachTo disabled that, can't remember right now

#

(don't think so)

tough abyss
#

It disables it with the object its attached to

#

not other objects

jade abyss
#

It disables the collision detection with other objects aswell, when it gets moved around

#

means: When a house is attached to you, you can run through other houses without collisions.

#

Different thing with PhysX Object.

#

iirc, they would still go crazy.

tough abyss
#

I just want a player to be able to have a preview of where its going to place a building without accidentally killing other units

#

or destroying other buildings

jade abyss
#

createVehicleLocal

#

So only the player itself can see it (still physX is intact)

tough abyss
#

What if the existing units are local

jade abyss
#

For everything else -> You need a new model without Geo

#

(or lets say: I can't think of any other way currently. But i personaly doubt there is.)

manic bane
#
private _op1 = _check_comp select 1;
private _op2 = _check_comp select 3;
private _op3 = _check_comp select 5;
private _op4 = _check_comp select 7;
private _op5 = _check_comp select 9;

I thought I could make it simple with forEach but I just stuck. :(
What should I do to make it simple?

jade abyss
#

maybe params

#

(first example)

#
[1,2,3] params ["_one","","_three"];
systemchat str _one; //1
systemchat str _three; //3```
@manic bane
*
manic bane
#

Thanks! I will check.

willow rover
#

How would I get a certain players UID from a serverside function?

jade abyss
#

check pinned Msg and look for: getPlayerUID

#

+allPlayers probably, if you can filter it out who it is.

willow rover
#

okay thanks

tough abyss
#

A param [B,C] seems to do the same as A max B min C
No it doesnโ€™t @unreal leaf

primal marten
#

Hi all, could you help me with why this script doesnt work? I am adding it to a vic to give an action that changes the normal flag texture to our groups. this addaction ["Change Flag", {ForceFlagTexture "images\clanFlag.paa"};];

still forum
#

"A param [B,C] seems to do the same as A max B min C But is not mentioned on biki"
it's not on the wiki because that's not at all what it does. @unreal leaf

velvet merlin
#

whats potential usage of skeleton bool returned by getModelInfo?

still forum
#

Trying to find out if a moedl has skeletal animations

#

Skeletal models are more expensive to render, but I don't know why one would care

velvet merlin
#

for some dynamic class/object handling, but so far i can see no practical purpose

manic bane
#
_list_comp ctrlAddEventHandler ["onLBSelChanged", {params[ "_ctrl", "_index" ];
    if (_index > 0) then {[] spawn fnc_I_Gorgon_comp;}];

I don't know why this doesn't work. Need help ๐Ÿ˜ฆ

still forum
#

what does fnc_I_Gorgon_comp do?

manic bane
#

It changes vehicle animation. It is precompiled.

#

When I put hint on there, it also didn't worked.

manic bane
#

Never mind. Adding sleep before that code solved problem. ๐Ÿ˜ฆ

swift lynx
#

do you guys know why player setAnimSpeedCoef 0.75; doesn't work for me? it works just fine with AIs but not players

brave jungle
#

[thisTrigger, thisList, "foxHoleName", (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] spawn VKN_fnc_createFoxholeAttack;

params ["_thisTrigger", "_thisList", "_foxHoleName", "_factionToSpawn"];

_playerPresent = false;
_delay = floor random [30, 45, 60];
_spawnPoint = selectRandom ["VKN_AI_spawnPos_1", "VKN_AI_spawnPos_2", "VKN_AI_spawnPos_3", "VKN_AI_spawnPos_4", "VKN_AI_spawnPos_5", "VKN_AI_spawnPos_6", "VKN_AI_spawnPos_7", "VKN_AI_spawnPos_8"];

{
  if ((alive _x) and (side _x == independent)) then {
    if (_x in _thisList) then {
      _playerPresent = true;
    };
  };
  sleep 0.01;
} forEach allPlayers;

while {_playerPresent} do {
  _group = [getMarkerPos _spawnPoint, west, _factionToSpawn] call BIS_fnc_spawnGroup;
  _waypoint = _group addWaypoint [getMarkerPos _foxHoleName, 0];
  sleep _delay;
};
```I'm not getting anything returned in the logs or any error message, but the group doesn't seem to be spawning. Anyone see a problem at a glance?
wary vine
#

try making the first _playerPresent private

#

also, you could probably replace that forEach loop with something like

private _playerPresent = (count (allPlayers select { ((alive _x) and (side _x == independent)) && (_x in _thisList)})) > 0;
#

but _playerPresent would not update in the while loop

brave jungle
#

Ah right

#

Of course

wary vine
#

so putting (count (allPlayers select { ((alive _x) and (side _x == independent)) && (_x in _thisList)})) > 0 directly in the while loop work

tough abyss
#

Can I reference another class in config?

wary vine
#

What do you mean ?

still forum
#

@brave jungle while {_playerPresent} do { that while loop will never exit. as _playerPresent can never become false

brave jungle
#

True

tough abyss
#

guys

#

can you still hack arma 3 koth money

#

is there a way

rough heart
#

Yeeh all we need to know is whats your steam uid?

#

@h3ph0#6005 brr brr

tough abyss
#

@manic bane missing }

#

Can I add an event handler to a building?

#

_b addEventHandler ["Hit", rts_fnc_buildingDamageHandler];

Doesn't trigger when I shoot the building

#

not any building

frail ledge
#

Use "hitpart" instead of "hit"

tough abyss
#

HitPart doesn't work either

#

I'm creating the building using createVehicle

#

And its a barracks building

ionic beacon
#

Which command to use for executing a script locally in a repeatable trigger only on the player that activated that trigger?

ornate sky
#

remoteExec with that player as second remoteExec parameter argument?

#

you can pass objects and players into remoteExec

ionic beacon
#

[] remoteExec ["script.sqf", player];
like this?

ornate sky
#

it will then execute the command only where the player is local

#

something like [arguments, "yourscript.sqf"] remoteExec ["execVM", thisList # 0];

#

I don't think sqfs can be put as the 1st remoteExec argument, but someone correct me if I'm wrong

#

better {[arguments, "yourscript.sqf"] remoteExec ["execVM", _x]} forEach thisList;

still forum
#

"I don't think sqfs can be put as the 1st remoteExec argument" correct

#

{[arguments, "yourscript.sqf"] remoteExec ["execVM", _x]} forEach thisList;
nah
[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]

stable imp
#

hey guys just wondering, im trying to break 6 vehicles into 2 seperate squads after a trigger is activated. Right now they are not splitting off correctly and im wondering if anyone can point me in the right direction, here is the activation function

#

true;
Hint "engaged";
vehicle1 joinSilent (group Group2);
vehicle5 joinSilent (group Group2);

winter rose
#

takes an array of units.

stable imp
#

ah great thanks! so I can just do [vehicle1, vehicle5] joinSilent?

#

or do I have to specify each unit of those vehicles?

winter rose
#

2nd one

stable imp
#

oof, thanks!

winter rose
#

or crew veh1, etc

stable imp
#

im getting a break for #group Group2

#

thanks again btw!

#

actually it worked when I removed group! thanks!

tough abyss
#

[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]
nah
if (isServer) then {[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]}

ornate sky
#

^ good call, otherwise trigger will fire on every machine, I forgot about that

still forum
#

Just tick the "server only" checkbox?

tough abyss
#

Yeah, or add if isServer and never wonder "Did I tick server only checkbox or not"

runic surge
#

Is the screenshot command supposed to produce bright and blown-out images that don't look like what you see in game?

willow rover
#

So I know the attachTo is a thing but how would you go about attaching trailers to vehicles without making the physics weird? I am trying to make a trailer to haul containers as part of my supply missions.

jade abyss
#

Just a hint: Don't try.

#

Either it's attachTo/vector mess (coding/performance nightmare) or (and?) it just looks... meh

#

+there were already some mods in the workshop, that added that clunky attachTo Method, maybe worth a try before you re-invent the wheel.

runic surge
#

I have tried the screenshot command with nearly every combination of graphics and display settings I could think of. Even with the asset preview recommended settings I still can't get the screenshots to look normal. I guess the command is simply broken or doesn't work with the 'new' lighting

night frigate
#

Hard to believe "screenshot" would be broken. What is it you're trying to get a screenshot of?

tough abyss
#

Yes, it was like this since screenshot introduction @runic surge

runic surge
#

@night frigate Anything. I just need the screenshots to have a specific naming system applied to them automatically, which can be done through scripting

night frigate
#

Ah, OK - I should have paid more attention to the channel name... I thought you were saying that just pressing F12 was acting weird.

#

That's my bad

#

I'm happy to test your script on my system if you like, though, to see if it does the same thing

runic surge
#

I think it's just an issue with the command itself

night frigate
#

OK. Yeah, I see M242's comment now

night frigate
#

Disabling PPAA and setting Bloom to 0 did make a difference for me. Still brighter, but closer.

hollow thistle
#

AFAIK this command is designed for editor preview images.

weak tiger
#

would there be any reason why a container (crate) would randomly make items disappear from it? most often weapons in an overfilled crate when player logs out and back in. weapons will be there for others but not the player joining

#

items are being added with a normal addWeaponCargoGlobal

winter rose
#

I would say don't overfill, maybe it has an issue with network sync

weak tiger
#

kinda part of the mission that you're allowed to overfill when transferring from a vehicle

winter rose
#

then don't disconnect :p

dull drum
#

Hi, guys! I'm new to the Arma 3 scripting. Could anybody advise me on the detailed Objects structure documentation? For example I want to know everything about the Player, Person or Unit object. Sorry if this is a wrong thread for such questions.

still forum
#

Ask a more detailed question. What is "everything" ?

dull drum
#

For example, a Player or Person has a name as in pName = name player. But I don't know what else is there except the name and what are the right keywords to the object's parameters.

still forum
#

any command that takes "object" as parameter might be relevant

dull drum
#

Wow, great. Thank you sir.

quartz coyote
#

@still forum is it possible to view the scipt behind a command ? example getPos ?

still forum
#

There are no scripts behind commands

quartz coyote
#

how do they work then ?

still forum
#

They are engine things

quartz coyote
#

shit

#

i found addOwnedMine & getAllOwnedMines but no command to return the owner of a mine. I get there is no way to achieve that ?

#

a command like getMineOwner would be great

young current
#

its the unit you use the command on

quartz coyote
#

yes but if you don't know the unit it's owned by ... ?

#

and there is no EH for placing mines

young current
#

you check all units if the mine is in their owned list?

still forum
#

True, apparently there is no command to check who the owner of a specific mine is. Probably just forgotten by the dev who added that

quartz coyote
#

๐Ÿ˜ฆ

young current
#

@quartz coyote you pick unit, and getAllOwnedMines and compare to the mine you want to check who owns it

#

then you pick another unit and go throuhg his owned mines

#

and so on

quartz coyote
#

oh...

#

I have miss interpreted the description of getAllOwnedMines

#

it could indeed satisfy my issue

#

other related question :
Is there a way to make a unit that is not demo to disable mines ?

jade abyss
#

drop EH doesn't trigger for mines? ๐Ÿค”

#

or put or however it was called

quartz coyote
#

@jade abyss nor Drop nor Put

#

well if they do, I didn't succeed

jade abyss
#

did it trigger at all?

quartz coyote
#

nope

#

if you succeed please tell me cuz it would help me a lot

jade abyss
#

Let me rephrase it:
Have you tried, if the trigger actives at all, when you tested it?

quartz coyote
#

yes

jade abyss
#

+No, i won't test it. ยฏ_(ใƒ„)_/ยฏ

quartz coyote
#

and it doesn't

#

np

jade abyss
#

Then you can't say it doesn't work with put...

quartz coyote
#

?

#

what do you mean ?

jade abyss
#

Have you tried, if the trigger actives at all, when you tested it?

#

put EH, to be even more precise

#

e.g.: PUTting a gun on the ground or so

quartz coyote
#

Yes I tried the put and drop EHs and they do not trigger when I place a mine

jade abyss
#

"at all"

#

not "when placing a mine"

quartz coyote
#

I don't care about anything else about placing mines

#

so I tested with mines

jade abyss
#

๐Ÿคฆ

#

nvm

quartz coyote
#

ok

jade abyss
#

gl

quartz coyote
#

thx

#

@young current so I'm struggling with this. It's completely wrong I know but can understand which way to put it :

_enemyMines = allMines apply {{getAllOwnedMines _x} forEach allUnits};```
still forum
#

๐Ÿค”

quartz coyote
#

yeah that's how I feel too

still forum
#

Get all "enemy" units.
Then call "getAllOwnedMines" for all enemy units. And collect all the mines that they own.
Now you have all enemy mines

quartz coyote
#

so step one :
_enemyUnits = allUnits select {side _x isEqualTo EAST};

#

step two (not so sure about this one)
_enemyMines = {getAllOwnedMines _x} forEach _enemyUnits;

#

if not lemme correct myself before spitting out the answer

#

or maybe :
_enemyMines = _enemyUnits apply {getAllOwnedMines _x};

still forum
#

forEach only returns last result, so you only get one array of mines for the last unit

#

apply returns all.
But now you have an array of arrays of mines. You probably want to get that into a single array

quartz coyote
#

uh, that I dunno how to do

#

select ?

hollow thistle
#
private _enemyMines = [];
{_enemyMines append getAllOwnedMines _x} forEach _enemyUnits;
quartz coyote
#

Thanks @hollow thistle

sullen pulsar
#

I'm correct in thinking I can use params to set a variable to a default value even when there are no more arguments being passed right?

i.e 3 arguments are passed

params [
    ["_one",1,[0]],
    ["_two",2,[0]],
    ["_three",3,[0]],
    ["_adefaultvar",false],
    "_aprivatevar"
];
tough abyss
#

I added a tanoa big house inside a big dome and added AI turrets on the house open areas. The AI turrets shot enemyes outside the dome with no visual contact. If i move the dome a bit, the AI turrets don't shot anymore. A small part of the house ceiling intersects the dome before i move it.

#

A bug?

#

I can try to do a repo.

still forum
#

@sullen pulsar yes. But I think on wrong datatype it errors out instead of using the default value, which is stupid :U

sullen pulsar
#

well a datatype isn't being defined and nothing is being passed at that point so ๐Ÿคž

#

if it works the way i think it does this thing is neat

wispy cave
#

Does anyone happen to know if something will break if I completely disable the alternative syntax of createunit? Assuming the mission I'm doing it on doesn't use that syntax

still forum
#

If nothing uses that syntax

#

then nothing will break

tough abyss
#

Today is the day Arma 3 modding changed forever

queen cargo
#

Okay

tough abyss
#

31st of May 2019, add this to the Arma history books

queen cargo
#

Why

#

My computer died today, coincidence?

tough abyss
#

...next dev branch

still forum
#

last dev branch was 3 days ago

#

next dev branch will take a while

queen cargo
#

Type faster & stop making mysteriรถs, I am the one on phone @tough abyss

tough abyss
#

Im driving

queen cargo
#

Then why are you on the phone in first place ๐Ÿ˜‚ ๐Ÿ˜‚

tough abyss
#

Historic event

queen cargo
#

Sooooo... What now is the fancy thing? @tough abyss

sullen pulsar
#

I honestly don't know how my own stuff works, vas is like such a cluster of junk it makes no sense sick

astral tendon
#

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


 player addAction 
 [
  "test1", 
  {
   systemChat "test1";
   },
  [],
  1.5, 
  true, 
  true, 
  "HeliDown",
  "true",
  50,
  false,
  "",
  ""
 ];

 player addAction 
 [
  "test2", 
  {
   systemChat "test2";
   },
  [],
  1.5, 
  true, 
  true, 
  "HeliDown",
  "true",
  50,
  false,
  "",
  ""
 ];

Its displays only the test1 when using shortcuts
The shortcut seems to only work with one at the time, in this case was only the frist one, does some one can put an note in the page? or it is possible to use two shorcuts?

#

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


 player addAction 
 [
  "test1", 
  {
   systemChat "test1";
   },
  [],
  1.5, 
  true, 
  true, 
  "HeliDown",
  "true",
  50,
  false,
  "",
  ""
 ];

 player addAction 
 [
  "test2", 
  {
   systemChat "test2";
   },
  [],
  1.5, 
  true, 
  true, 
  "HeliDown",
  "true",
  50,
  false,
  "",
  ""
 ];

Its displays only the test1 when using shortcuts
The shortcut seems to only work with one at the time, in this case was only the frist one, does some one can put an note in the page? or it is possible to use two shorcuts?

sour island
#

Performance-wise, what's the best way to put an addAction on a unit if it it's 1: an OPFOR unit, and 2: Captive?
I want the action to appear on any OPFOR unit that gets captured, and units spawn dynamically in this mission.

#

Event handler for when the players use the Take Prisoner action?

exotic tinsel
#

So im trying to automate kicking players with too many team kills. Everything is done and we are good to go except, i cant find any script commands to be executed on the server to kick a player or temporally ban them for an amount of time.
both these places say these commands for doing so are disabled.
https://community.bistudio.com/wiki/BattlEye
https://community.bistudio.com/wiki/Multiplayer_Server_Commands

is there something else out there aside from lowering the players rating everytime they join the server?

still forum
#

@sour island if you can find a eventhandler for that then sure, that would be the best

sour island
#

Think I found a solution:

["ace_captiveStatusChanged", {
    params ["_unit", "_state"];

    if (_state) then {
        systemChat format ["%1 was handcuffed.", name _unit];
    } else {
        systemChat format ["%1 was released.", name _unit];
    };
}] call CBA_fnc_addEventHandler;
still forum
#

@exotic tinsel where does it say that kick/ban are disabled?

quartz coyote
still forum
#

yes

#

setUnitTrait

#

check the wiki page

quartz coyote
#

oh sweet

#

thx !

exotic tinsel
still forum
#

why do you need #beserver ?

exotic tinsel
#

lol i dont know mate, it just says "You need to use the BE RCon tool to ban players from your server" on an official website so i figure its true.

still forum
#

" on an official website" official website that's written by community members and not updated for years

exotic tinsel
#

arh, give me a break mate. just doing research and asking the community to help validate research, its kinda the whole point of these communities.

still forum
#

Well that's why I've just told you that

exotic tinsel
#

yeah so you didnt tell me anything though, just that the website might be wrong like all websites. so what did you help me with?

sour island
#

How do I get this to apply to all units, even dynamically spawned ones?

["ace_captiveStatusChanged", {
    params ["_unit", "_state"];

    if (_state) then {
        systemChat format ["%1 was handcuffed.", name _unit];
    } else {
        systemChat format ["%1 was released.", name _unit];
    };
}] call CBA_fnc_addEventHandler;
digital jacinth
#

it is a cba event handler it listens to the event named ace_captiveStatusChanged. Meaning this even will work for any unit in the game surrendering or being handcuffed

#

the ace_captiveStatusChanged is also global, so you will get the event from any unit

#

Keep in mind this event fires for both surrendering and being handcuffed. so you probably should check the third parameter called "_state" as well, with that parameter you can figure out if someone surrendered or was handcuffed

still forum
#

@exotic tinsel so you've found out that a command that you don't even need might have been disabled years ago.
Have you tried if it's still disabled? Have you thought about just not using that specific thing that's disabled?

sour island
#

I added this to my InitServer, but no dice

["ace_captiveStatusChanged", {
    params ["_unit", "_state"];
    if ((side _unit) == "GUER")) then
    {
    if (_state) then {
        systemChat format ["%1 was handcuffed.", name _unit];
        _intelpos = getPosATL _unit;
        _intelpaper = "Leaflet_05_Old_F" createVehicle _intelpos;
        _intelpaper addAction
        [
            "Intel", 
            {
                [] spawn btc_fnc_info_hideout;
                [5] remoteExec ["btc_fnc_show_hint", 0];
                deleteVehicle _intelpaper;
            },
            [],
            1.5, 
            true, 
            true, 
            "",
            "true", // _target, _this, _originalTarget
            5,
            false,
            "",
            ""
        ];
        
        } else {
        systemChat format ["%1 was released.", name _unit];
    };
    };
}] call CBA_fnc_addEventHandler;
still forum
#

(side _unit) == "GUER") That can never be true

#

side doesn't return a string

#

Also you said you wanted opfor units

#

why are you checking for independent now?

sour island
#

Independent is our enemy in this mission

exotic tinsel
#

@still forum
i have tried both of these commands on a server running battleye. Be aware that i dont know shit about server configuration.
i do know that battleye is running for the server because of RCON

serverCommand format ["#exec kick %1", name _player];
serverCommand format ["#kick %1", name _player];
```sqf
these commands are executed server side and not client side. Let me know if there is any more information i can provide to help solve the issue.
still forum
#

where is the password?

#

serverCommand takes password as arg

#

also afaik neither kick nor ban need battleye

exotic tinsel
#

ok im getting into it. thx

sour island
#

Fixed the scope of the intel paper, but it's still not spawning and basically nothing happens when I Take Prisoner on a GUER


["ace_captiveStatusChanged", {
    params ["_unit", "_state"];
    if ((side _unit) == GUER)) then
    {
    if (_state) then {
        systemChat format ["%1 was handcuffed.", name _unit];
        _intelpos = getPosATL _unit;
        intelpaper = "Leaflet_05_Old_F" createVehicle _intelpos;
        intelpaper addAction
        [
            "Intel", 
            {
                [] remoteExec ["spawn btc_fnc_info_hideout", 0];
                [5] remoteExec ["btc_fnc_show_hint", 0];
                deleteVehicle intelpaper;
            },
            [],
            1.5, 
            true, 
            true, 
            "",
            "true", // _target, _this, _originalTarget
            5,
            false,
            "",
            ""
        ];
        
        } else {
        systemChat format ["%1 was released.", name _unit];
    };
    };
}] call CBA_fnc_addEventHandler;
quartz coyote
#

i'm trying to create a "juggernaut" perk.
I've done this. Any suggestions to do better ?

juggernautEH = player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    if (getDammage _unit > 0.9) then
    {
    player setDamage 0.5;
    player removeEventHandler ["HandleDamage",juggernautEH];
};
}];```
still forum
#

(side _unit) == GUER that can never be true. GUER doesn't exist

sour island
#

What is independent called then? Because when I monitor a green unit's SIDE, it says GUER

quartz coyote
#

@sour island independent

sour island
#

I'm looking at the in-game variable monitor and it says the guy's side is GUER

still forum
#

๐Ÿคฆ

#

Yes

sour island
#

I'll try Independent

still forum
#

Read the wiki page that was linked

digital jacinth
#

@quartz coyote you using ace medical as well?

quartz coyote
#

@digital jacinth vade retro satanas

digital jacinth
#

What ever that saysd

quartz coyote
#

jokes. No, i'm not. and don't want to

digital jacinth
#

aight. Otherweise this would not work.
Keep in mind handledmage EH fires for each body part even if it is not hit at all

#

this is also BEFORE any damage is applied

#

so getDammage _unit will return previous overal damage and not current

#

for current damage use the _damageparameter

quartz coyote
#

yeah thats why i'm using getDammage and not exploiting the given _damage

#

sorry, unclear

#

let me explain

digital jacinth
#

you can just return the damage value you want the unit for have aftwewards. so you can change the then clause with an exitWith and jsut return 0.5 flat

#
juggernautEH = player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    if (getDammage _unit > 0.9) exitWith
    {
        player removeEventHandler ["HandleDamage",juggernautEH];
        0.5
    };
    nil
}];
quartz coyote
#

basically, i'm using the EH as the closest event before the player's death. Using _damage would have meant dealing with a one time event damage. I wanted the general health of the player

sour island
#

@quartz coyote the word "Independent" doesn't even appear on that page, wth?

digital jacinth
#

_damage will be the "new" damage of the body part

quartz coyote
#

@sour island I agree it's tricky.

digital jacinth
#

that will be returned by getdammage after it was applied

#

it is not the "added damage ontop of the current" it literally is the new damage value

quartz coyote
#

I understand what _damage is. that's why i'm not using it. I want to extend the players life.

sour island
#

So what was I supposed to get out of that page other than the side is supposedly called GUER?

quartz coyote
#

@sour island should have linked this page sorry mybad

digital jacinth
#

you have to use the _damagevalue otherwise you do not know if the unit will die with this damage or not. right now you are just asking the current damage before the new damage is getting applied to. Meaning you are just checking a value that is most def below 0.9 and with next tick the unit is above 0.9 or at 1.

sour island
#

There we go

quartz coyote
#

@digital jacinth right I get your point.

#

i'll re-write that and submit again

#

@digital jacinth in your script, what does the 0.5 on it's own do ?

digital jacinth
#

handledamage is an EH that can interpret the return value of a script. meaning it will apply the value thatis being returned.

#

that is the reason why

player addEventHandler ["HandleDamage", {0}];

makes you unkillable

#

it returns 0 for everything

#

meaning your damage will always be 0 as this EH tells the game

#

again i need to stress that this EH will fire for EVERY hit point! So if you remove the EH early you might end up killing the unit as the next run of the EH might apply the necessary damage to kill the unit it

still forum
#

@sour island independent == resistance == "GUER"

#

"should have linked this page sorry mybad" no. The side page says that too. In the big yellow box

quartz coyote
#

I know from experience how hard it can be to understand the wiki when you're a beginner.

#

@digital jacinth i'm stalling. i'll test your and go to bed. i'll try tomorrow

digital jacinth
#

that is fine.

astral tendon
#

Is GetInMan event handle persistent or is does not keep with the player afther he dies or uses team swich?

sour island
#

I'm not even getting any results with this on initServer

["ace_captiveStatusChanged", {
    params ["_unit", "_state"];
    if (_state) then {
        systemChat format ["%1 was handcuffed.", name _unit];        
        } else {
        systemChat format ["%1 was released.", name _unit];
    };
}] call CBA_fnc_addEventHandler;
digital jacinth
#

you sure you are setting people to captive AFTER this is applied?

sour island
#

I'm using the ACE Take Prisoners thing with the cable ties

quartz coyote
#

@digital jacinth Not a great success. what would be ideal would be to have "what ever damage is taken, if over 0.9 then add 50% of life" ... but it seams hard to achieve with the way the EH works and the amount of hitpoints...

digital jacinth
#

@quartz coyote another possibility is to just add threshold how much damage they can take, as in, you reduce the taken damage that is getting applied.

#

@sour island are you testing locally on your machine or a dedicated server?

sour island
#

local MP LAN

#

through the Editor

quartz coyote
#

seems interesting. how would I do that ?

digital jacinth
#

@sour island weird that EH should fire every time someone surrenders or gets cuffed. same if they stop surrendering or get freed.

sour island
#

You're telling me

digital jacinth
#

@quartz coyote

params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];

private _currentDamage = _unit getHit _selection;
if (_selection == "") then {
    _currentDamage = damage _unit;
};

private _addDamage = (_damage - _currentDamage) * GVAR(damageMultiplier);

_currentDamage + _addDamage
#

@sour island try to put thatin initPlayerLocal.sqf instead. you want players to see that message, right?

sour island
#

The full script I'm trying to put together is above a few posts, this little one was just for testing purposes

#

Just to see if ["ace_captiveStatusChanged", { would actually trigger anything really

marble flare
#

any coughing or sniffle script out there?

still forum
#

most likely yes

marble flare
#

I've looked, couldn't find anything. I was hoping someone would know one.

digital jacinth
#
["diw_cough",{
  if !(hasInterface) exitWith {};
  params ["_unit", "_sound"];
  _unit say3D _sound;
}] call CBA_fnc_addEventHandler;

misc_fnc_cough = {
    private _plr = ace_player;

    if (alive _plr && (isNull objectParent _plr)) then {
        ["diw_cough",[_plr, format ["cough%1", (floor random 11) + 1]]] call CBA_fnc_globalEvent;
    };

    [misc_fnc_cough, nil,  45 + (random 255)] call CBA_fnc_waitAndExecute;
};

// coughing
[misc_fnc_cough, nil,  45 + (random 255)] call CBA_fnc_waitAndExecute;

if you do not mind cba and ace dependencies, it basically is just a loop really.

sour island
#

There are a handful of "units spout random bullshit" mods you could look at

digital jacinth
#

you need to get your own sounds tho

marble flare
#

I'm alright with CBA but I was hoping to avoid ace

digital jacinth
#

i just quickly copy pasted this form one of my missions
you can replace ace_player with call cba_fnc_currentUnit

marble flare
#

ok, thank you

digital jacinth
#

normally you can skip the addition of the eventhandler, but this is written so it also works on BE enabled servers

marble flare
#

ok

upper cliff
#

Does anyone know if/how I can make units walk on a predetermined path

sour island
#

Set em to Careless?

upper cliff
#

Well this what Iโ€™m trying to do

#

I have a cutscene with the player and an AI walking with Hubspectator_walk

#

But I want the AI to turn left and walk that way

#

I tried using the turn animation but it didnโ€™t work

surreal peak
#

setPos?

upper cliff
#

Well that would just teleport him wouldnโ€™t it