#arma3_scripting

1 messages ยท Page 368 of 1

queen cargo
#

magic

quartz coyote
#

So

Sleep (user defined time);

Or

Waituntil { time < (user defined time) }

#

Sorry no

still forum
#

jup...
But waitUntil would actually be worse than your while loop. So.. use Sleep

quartz coyote
#

Time = (user defined time)

#

Ah okay

#

Sleep it will be then

peak plover
#

time cannot bdefined?

still forum
#

ignore that nigel ^^

queen cargo
#

missionNamespace setVariable ["time", 10]
might work ... not sure right now

quartz coyote
#

Thanks for your help @robust hollow & @still forum

still forum
#

nope @queen cargo

#

I think..

peak plover
#

Does not work, says "reserved variable in expression"

queen cargo
#

another thing i never tried
thats why i cannot recall any ref here

still forum
#

I think the catch with setVariable was that it compares case-sensitively.. tImE might work

cunning nebula
#

time is not really a variable, its a command

#

so no you can not overwrite that

still forum
#

You actually can

#

last time I told someone to overwrite switch as a test he reported it did indeed break scripts containing switch

queen cargo
#

Variable stuff has nothing Rly to do with the command stuff

still forum
#

but.... sadly noone told BI

cunning nebula
#

oO wut

#

ages ago I started working on an ambient life script, never really finished it. I'm about to give that another shot.

#

within reason

#

i dont really care what they do in their little houses

#

as long as it seems a bit more realistic when the fighting starts

#

not more than usual ^^ It's arma after all

#

I believe I've seen my fair share of script-related madness over the years.

#

hmm good point

#

maybe its best to have them move around a little as possible xD

#

atleast until they have to run and hide somewhere

#

its annyoing when they run all over the place all the time

#

many scripts do that

#

one thing i'd really like to implement is to give them homes

#

and to actually make them run inside and lock the door behind them

#

that should add a nice touch

#

a totally underused feature in my eyes

timber ridge
#

is there a discord channel dedicated to SQF and Arma scripting topics specifically?

cunning nebula
#

nice

robust hollow
#

well... this is a scripting channel for arma, so this one?

astral tendon
#

do you guys know how to force the AI boat driver to hit the sand? he stops on the edge of the beach.

timber ridge
#

@robust hollow nah, I'm looking for something more topic-oriented, like "Dialogs", "Displays", "AI behavior", "Anims", "coordinates", etc. where there's a channel for each so to say tag / topic in A3 scripting

robust hollow
#

sort of all falls under scripting

timber ridge
#

because I want to discuss or get help for something specific and don't want it to get buried under everything else?

#

I dunno, that's my preference ๐Ÿ˜„

cunning nebula
#

there is a forum for that

#

make a thread ๐Ÿ˜ƒ

timber ridge
#

BIF sucks ๐Ÿ˜„

robust hollow
#

ask the question, make it the topic of the channel ๐Ÿ‘

still forum
#

Usually stuff doesn't get burried here

cunning nebula
#

compared to the steam forums, no it doesnt ๐Ÿ˜›

still forum
#

unless your question is so effortless and dumb that everyone ignores it

timber ridge
#

I mean, the forum itself sucks for me, however, the community is pretty nice

#

I've got nothing against it

still forum
#

``nah, I'm looking for something more topic-oriented, like "Dialogs", "Displays", "AI behavior", "Anims", "coordinates", etc.
Dialogs&Displays are configs usually #arma3_config
AI behaviour #arma3_ai
Anims #arma3_animation
coordinates... uh.. what?

cunning nebula
#

hmm a channel for dialogs would make sense

#

i hate dialogs

timber ridge
#

don't really have time to explain, but coords is for all the position porn in Arma 3, modelPosToWorld, etc

robust hollow
#

scripting

cunning nebula
#

oh right, havent really tried messing with ctrlCreate yet

#

todo list is getting longer and longer :/

robust hollow
#
  • any ctrl type you define in ur mission
cunning nebula
#

๐Ÿค”

robust hollow
#

i use it to make premade control groups for HUDs and stuff

timber ridge
#

god, if only SQF had objects as an abstraction in the first place, it'd make all ctrl bullshit more bearable

#

and the syntax much more readable and maintainable

cunning nebula
#

oh my... just looked at my previous attemt at ambient life and noticed its from 2013. time passes way too quickly oO

astral tendon
#

so, how to force the AI to go foward?

#

like a press of a key?

indigo snow
#

Theres no direct translation to that

#

You tell em to move to a position

#

And theyll try their best

astral tendon
#

or, they will stop and do nothing

indigo snow
#

Thats their best, then

astral tendon
#

in my case is a boat, he dont wanna hit the land

indigo snow
#

In that case, a little bit of setVelocity might to the trick

#

Or unitCapture? Or the other new move command where you give an array of positions?

cunning nebula
#

you can use use playActionNow for that

slender halo
#

unit capture won't match waves

cunning nebula
#

oh my bad

#

missed the boat-part

#

in that case -> setVelocity

indigo snow
#

Good catch on the waves

cunning nebula
slender halo
#

i did something like that a while ago, setting a velocity to be sure the boat reaches the beach

austere granite
#

bitch

indigo snow
#

Youd need a little loop i guess

slender halo
#

that's exactly what i meant

#

^^

#

sorry

cunning nebula
#

no boat for the bitch then ? ๐Ÿ˜ฏ

still forum
#

Eww.. params

austere granite
#

๐Ÿ˜„

cunning nebula
#

_initMag = vectorMagnitude _initVel; <--- why not simply "speed" ?

austere granite
#

params pls

still forum
#

Because speed is not necessarly == vectorMagnitude

austere granite
#

make params great again

still forum
#

I guess

#

and because speed is in km/h

#

and only relative speed on Y axis

#

So actually a completly different thingymabob

cunning nebula
#

ah, right

indigo snow
#

that along its forward axis thing, cant decide if brilliant or retarded

slender halo
#

i get it about params... it's an old script...

still forum
#

params all the things

#

also missing private

cunning nebula
#

anyway, we have velocityModelSpace now ๐Ÿ˜ƒ

#

makes it even easier

slender halo
#

i made params great again

#

didn't really needed private, it was in a "spawn" with nothing else

haughty scarab
#

Hey would anyone be able to help me with a little issue im having with a script?

still forum
#

Yes!

#

Tell us what the issue is and post the script on pastebin or gist

haughty scarab
#

EDIT: https://hastebin.com/mitupaviza.cpp its susposed to give you that you found a weapon but it just gives you the "you didnt find anything" hint whether or not you did find anything but the "rare item" part works fine...

#

thanks ๐Ÿ˜ƒ

still forum
#

@slender halo as soon as you have a single call infront of your script private gives performance benefit... But doesn't really matter if you don't have a loop in there.

haughty scarab
#

oops thats not the whole script my Copy Paste broke

still forum
#

wtf is with that indentation :U

haughty scarab
#

let me look lol

#

wait what did hastebin do haha

still forum
#

I don't have time for waiting :u

haughty scarab
#

i put the new link on my older post ๐Ÿ˜›

still forum
#

Ewww

#

params

indigo snow
#

if your lootChance is between 7 and 175, youd get two hints. is that intended?

haughty scarab
#

no

still forum
#

code actually looks good...

haughty scarab
#

its susposed to be if its less than 7 or above 175

still forum
#

If you get the "You didn't find stuff" hint that means it worked.. But you just didn't find anything

indigo snow
#

your code is written to do that, since its two separate if statements

haughty scarab
#

Yeh but dedmen i actually did find something when i look in my inv

indigo snow
#

theres two chances the code after else will run

still forum
#

Oh right

haughty scarab
#

thats my issue ๐Ÿ˜›

still forum
#

Because if you hit <7 the first statement will give you loot.. the second one will overwrite your "you found stuff" hint with a "you found nothing" hint

indigo snow
#

its the two hints

haughty scarab
#

oh i had no clue lol im very new to arma sqf

indigo snow
#

^what dedmen says

#

you overwrite the first hint

haughty scarab
#

Oh, how would i fix that? i was thinking i could use a switch do but i had no idea how it works from BI Wiki

still forum
#

I like

// switch(FETCH_CONST(life_donorlevel)) do
// {
    // case 1: {_lootChance = random(170);};
    // case 2: {_lootChance = random(150);};
    // case 3: {_lootChance = random(130);};
    // case 4: {_lootChance = random(110);};
    // case 5: {_lootChance = random(90);};
    // default {_lootChance = random(200);};
// };
#

@haughty scarab Put the second if statement into the else of the first

haughty scarab
#

ok will try that thank ๐Ÿ˜ƒ

indigo snow
#

alternatively exitWith when true

#

theres no more code after, anyway, except for setting that variable to false

haughty scarab
#

Right ok, im gonna try it now thanks for the help guys

indigo snow
#

also, select floor random count --> selectRandom

cunning nebula
#

why is the chance to find a rare higher than to find a weapon ?

haughty scarab
#

the rare isnt actually rarer than the weapon thanks for pointing that out haha gotta edit the hint

still forum
#

I like that donor's can't find rare's ๐Ÿ˜„

cunning nebula
#
switch (selectRandomWeighted [
    "nothing", 65,
    "weapon", 25,
    "rare", 10
]) do 
{
    case "nothing": 
    {
        /* STATEMENT */
    };
    case "weapon": 
    {
        /* STATEMENT */
    };
    case "rare": 
    {
        /* STATEMENT */
    };
};
robust hollow
#

thats an attractive code block...

austere granite
#

that's not how it works

robust hollow
#

lol

cunning nebula
#

sigh

robust hollow
#

`

indigo snow
#

i wouldnt select directly in the switch, dat shits ugly

austere granite
#

๐Ÿ˜„

cunning nebula
#

i always fail at that

#

there

austere granite
#

PARTY

#

๐ŸŽ† ๐Ÿฐ ๐Ÿป

cunning nebula
#

i agree nick ๐Ÿ˜‰

indigo snow
#

good call on that command tho

cunning nebula
#

probably not useful for his specific case though

#

hmmm

#

@haughty scarab the parameter to increase lootchance

#

lowers the random value

austere granite
#
private _type = (random 100) call {
    if (_this > 65) exitWith { "nothing" };
    if (_this > 25) exitWith { "weapon" };
    "rare";
};

because you can

cunning nebula
#

that would make rare items actually less probable

haughty scarab
#

what do you mean? (sorry lol this is only my first week doing any scripting at all)

cunning nebula
#
_lootChance = (round(random(200)) + 1) - (missionNamespace getVariable ["mav_ttm_var_lootIncreased", 1]);
still forum
#

someone called disableAI on him?

#

He noticed that he is a Arma AI and now also want's do behave like one

cunning nebula
#

make an example

#

kill him

#

remove him

#

replace him

#

๐Ÿ˜‰

#

that'll teach em not to disobey your orders

austere granite
#

AI lives matter

cunning nebula
#

oh

still forum
#

enableSimulation?

cunning nebula
#

is it enabled for the pilot ?

#

or just the heli ?

slender halo
#

is your helico far from players ?

#

nvm

indigo snow
#

give him a push with setVelocity?

slender halo
#

did you gave the pilot a waypoint ?

#

try setVelocity [0, 1000, 0]

#

i mean, it won't help but its always funny to play with set velocity

indigo snow
#

is it scared?

#

enablefleeing / CARELESS behaviour

#

turn off the radars?

#

gently talk to it using positive words

#

ah wait

#

you do that on the vehicle

#

try it on the crew also

#

wait you dont

#

read wrong im a pickle

#

i count the collision lights as a win personally

#

give him a landing waypoint on an invisible helipad far away?

#

delete the pilot unit and immediately spawn in and move in a fresh one

#

im magic

cunning nebula
#

kill him before you delete him

#

dont be soft ๐Ÿ˜ƒ

#

interesting

indigo snow
#

figured the engine might be in a special behaviour

#

cool to see it works

#

what caused it to land in the first place, tho

still forum
#

Params ๐Ÿช

indigo snow
#

I dont think its actually attempting to land, just forcing a subroutine to boot

cunning nebula
#
[] call selectRandomWeighted [
    {
        // do something
    }, 65,

    {
        // do something else
    }, 25,

    {
        // or this
    }, 10
];

that command is fun ^^

tough abyss
#

Any idea why this CBA settings checkbox doesn't show up in the settings? @little eagle send help```SQF
[
QGVAR(doWaypoint),
"CHECKBOX",
["Custom Waypoint", "Toggle custom, distance indicator-less waypoint."],
"A3 Overrides",
true,
true
] call CBA_Settings_fnc_init;

still forum
#

QGVAR(doWaypoint) does the correct thing?

#

did you check for script errors in RPT?

tough abyss
#

No errors.

indigo snow
#

if you replace it with one of the example settings, does it work?

tough abyss
#

Nope.

still forum
#

does the script file they are in get called?

#

what file is that? pre/postInit?

#

preStart?

tough abyss
#

XEH_preInitClient.

#

I've done the same thing in another addon, only with sliders and editboxs ๐Ÿ˜•

#

Works flawlessly.

indigo snow
#

then i propose the addon isnt loaded, that XEH isnt included in the config.cpp or other shenagigans

#

you can make sure its loaded by adding a cheeky diag_log

tough abyss
#

Ah fuck.

#

#include is case sensitive

still forum
#

:u

#

that's new to me

tough abyss
#

CfgEventHandlers isn't the same as CfgEventhandlers?

still forum
#

and if #include doesn't find the file your game kills itself

#

config names are also case insensitive

peak plover
#

How do I return the element location in an array

indigo snow
#

what?

peak plover
#

goal:
select a random array element with kinda weighted array, but I want weights to change once they have been selected

indigo snow
#

you want the chance of picking a random element to change after a random element has been picked?

peak plover
#

Yes

#

I just thought of a way

#

array with 2 elements

#

and then i convert it to 2 arrays

#

value/weight

tough abyss
#

@still forum - still doesn't work. preInitClient is indeed loading.

slender halo
#

@peak plover Dedmen posted this like an hour ago

peak plover
#

Yes, that's what Im gonna use, I just need to change the weights once it's used

cunning nebula
#

selectRandomWeighted [ [0,"something"],1, [1,"something1"],1.5, [2,"something2"],5 ];

peak plover
#

So the more it's used, the less it will appear. so in the end I would have a large variety

cunning nebula
#

just include the index in the result

#

then use that to modify the array

meager granite
#

selectRandomWeighted should have only had weights required and just returned selected index

cunning nebula
#

true

meager granite
#

Sure you can just send an array of indexes but that's more data thus bit slower

still forum
#

@peak plover use find to turn element into array index

cunning nebula
#
_array = [
    [1,"wurst"], 12,
    [3,"kรคse"], 3,
    [5,"zwiebel"], 9,
    [7,"pizza"], 1
];

(selectRandomWeighted _array) params ["_i","_result"];
systemChat _result;
_array set [_i, (_array select _i) - 1];
peak plover
#

why the 3 numbers?

cunning nebula
#

first one is the index

#

of the weight

peak plover
#

ughh wait

little eagle
#

That looks wrong to me somehow.

cunning nebula
#

shrug

#

pretty sure it would work

little eagle
#

Yes, but having the index as first element is just weird. Why not make it an array with multiple copies of Kรคse?

cunning nebula
#

multiple copies of Kรคse ?

#

๐Ÿค”

#

I think I need multiple copies of coffee

slender halo
#
selectRandom ["elem1", "elem1", "elem2"]
cunning nebula
#

he wants to change the weights depending on which element was selected

little eagle
#
private _array = [
    "wurst", 12,
    "kรคse", 3,
    "zwiebel", 9,
    "pizza", 1
];

private _result = selectRandomWeighted _array;
systemChat _result;

private _index = (_array find _result) + 1;
_array set [_index, (_array select _index) - 1];
slender halo
#

i think that's what commy is talking about

little eagle
#

The way I posted has a cleaner array without duplicated information.

cunning nebula
#

well... why waste resources to find something that you already know ?

little eagle
#

So you don't have arrays with redundant information. Less error prone.

indigo snow
#

you might need to reset weights every once in a while, too

#

not sure what happens when all chances are 0

cunning nebula
#

and if you have numbers in the array instead of Kรคse

#

you'll run into troube using "find"

little eagle
#

That's true.

slender halo
#
#define PROBABILITY_LOSS 0.5

private _weights    = [1, 9, 5];
private _classnames    = ["classname1", "classname2", "classname3"];

private _classname = _classnames selectRandomWeighted _weights;

private _index = _classnames find _classname;
_weights set [_index, (_weights select _index) - PROBABILITY_LOSS];
#

use the alternative syntax

little eagle
#

Interesting.

peak plover
#
private _cargoArray = [["medsSmall",30],["generic",25],["pistol",30],["smg",15],["rifle",10],["mg",3],["at",5],["custom1",5],["custom2",5],["custom3",5],["ammo",1]];
_boxes = _boxes select {
    if (random 100 >= 75) then {
        private _cargoTypes = [];
        private _weights = [];
        private _nul = {
            _cargoTypes pushBack (_x select 0);
            _weights pushBack (_x select 1);
            false
        } count _cargoArray;

        private _cargo = _cargoTypes selectRandomWeighted _weights;
        private _change = _cargoArray select {(_x select 0) isEqualTo _cargo};
        _cargoArray set [(_cargoArray find _change),[_change select 0,(_change select 1)-1]];

        _x setVariable ["unit_loadout_faction",east];
        _x setVariable ["unit_loadout_cargoType",_cargo];
    };
};


cunning nebula
#

you could also generate the ids in the array instead of writing them by hand

peak plover
#

zgmrvn looks clean

little eagle
#

Nah, I like zgmrvn's version the most.

indigo snow
#

you might want a minimum weight of 1, though

peak plover
#

bready sure it can't be nigative

cunning nebula
#

yeh that -1 was just an example

#

i still dont like the idea of having to search the array to ge the index

indigo snow
#

Negative weights are not supported

#

If an item's weight is 0, the item is ignored

cunning nebula
#

yup

indigo snow
#

Return Value: Anything - random weighted value or Nothing if array is empty or all weights are 0

little eagle
#

Sounds reasonable.

peak plover
#

So if I always remove 1 it wil lend up being 0, so I don't need min/max

indigo snow
#

until everything is 0 and you get nil

#

so youll need some logic to maintain what you deem a reasonable minimum distribution

peak plover
#

I'll my array variant, and add a third variable

little eagle
#

Did it mention if it works with non integers?

#

non negative real numbers

#

or however the hackers call them.

peak plover
#

dollars?

indigo snow
#

floats

#

"the things between integers"

#

uh

#

partial integers

peak plover
#

haha

still forum
#

floaties

indigo snow
#

โ„+

still forum
#

๐Ÿ˜ฎ

indigo snow
#

yea

still forum
#

magnificent

little eagle
#

"Floats" sounds to me like those simple boats you put together from tree trunks. ยฏ_(ใƒ„)_/ยฏ

#

โ„0

#

Not โ„+

indigo snow
#

im rusty on my sets

little eagle
#

Raft! That's what I'm thinking of.

peak plover
#
private _change = _cargoArray select {(_x select 0) isEqualTo _cargo};
_change set [1,(_change select 1)-1];```
indigo snow
#

โ„ includes negative numbers tho

peak plover
#

uhhh

#

Does set change the cargoARray?

still forum
#

FloรŸ

little eagle
#

Yup.

peak plover
#

Really??

still forum
#

๐Ÿ˜„

little eagle
#

I meant Dedmen.

peak plover
#

hmm...

indigo snow
#

_change is not a copy

#

so it should change

peak plover
#

should

jaunty zephyr
#

๐Ÿคฃ

little eagle
#

select CODE
does copy the array

still forum
#

change should change

#

yes

little eagle
#

_change is a copy of _cargoArray

#

_cargoArray won't change

indigo snow
#

ah because it returns an array with all fitting elements

little eagle
#

Yes.

peak plover
#

yeah okay that sucks

little eagle
#

Agreed, apply and select shouldn't copy the arrays ideally. Because you could just add a + to achieve that. But, oh well.

#

No one listens to me.

slender halo
#

@peak plover you could by doing something like

(_array select 5) = 32.5
indigo snow
#

you cant do that in sqf, tho

peak plover
#

what does that mean

indigo snow
#

you can maybe vectorAdd if arma allows you to cheat that

#

in order languages that would modify that array index directly

#

but sqf doesnt let you access array elements like that

still forum
#

apply/select have to copy the array.. except if the condition is always true for select. Or always returns the same values that were there before with apply

indigo snow
#

its wierd since its just the elements, youd expect it to simply use the pointer instead of explicitly making a copy

still forum
#

That's... not how it works

#

CopyOnWrite.

indigo snow
#

ah, engineland territory then

still forum
#

_var = 35;
_var2 = _var;

_var2 is not a copy. It's a reference to the same value

#

But if you modify it you create a new value

cunning nebula
#

โ˜•

peak plover
#

(FIXED IT)

#

thanks

indigo snow
#
_a = [1,2];
_b = [3,4];
_c = [_a,_b];
_d = _c select 1;
_d set [1,9];
``` would modify _b tho?
peak plover
#

yes

indigo snow
#

Then engineland must be different when writing values to arrays

cunning nebula
#

hmm btw. @peak plover

#
private _nul = {
    _cargoTypes pushBack (_x select 0);
    _weights pushBack (_x select 1);
    false
} count _cargoArray;
indigo snow
#

ew

cunning nebula
#

this does the same

_cargoTypes = _cargoArray apply {_x select 0};
_weights = _cargoArray apply {_x select 1};
peak plover
#

Thanks ๐Ÿ˜„

#

That's so much nicer

zenith totem
#

If you broadcast nil on a variable will it remove it from the JIP queue?

cunning nebula
#

yes

jade abyss
#

CBA = MacroManiacs ยฏ_(ใƒ„)_/ยฏ

cunning nebula
#

i see little need to use it nowadays

#

extendes EHs are nice

#

but not necessary either

zenith totem
#

Is there also a way to disable automatic assigning of tasks after your current asks succeeds/fails etc

cunning nebula
#

@tough abyss copyToClipboard ((supportInfo "") joinString toString[13,10]);

#

should also work ๐Ÿ˜‰

indigo snow
#

endl is new

cunning nebula
#

*reads "end1 is near" *

#

๐Ÿ˜ฌ not sure if too much coffee or too little

jade abyss
#

The answer is: Yes.

austere granite
#

too much coffee

#

implying that is a posibility

zenith totem
#

Only when you overdose on caffeine

#

Only then is it too much coffee

jade abyss
#

That implies that you have to drink at least 4-5L of Coffee ^^

#

pretty Strong Brew. And before that happens -> Brown Flood will happen ๐Ÿ˜„

austere granite
#

brown flood in, brown flood out

#

it's synergy

jade abyss
#

Good point

cunning nebula
#

wish there was a way to completely remove/hide doors on vanilla buildings

#

always feels weird to breach a door and have it swing open towards you

astral tendon
#

how do i play multiples animations?

#

how is the sequence

still forum
#

@tough abyss diag_log has a length limit. CBA_fnc_debugLog get's around that limit

slim verge
#

? in BIS_FNC_ConsolidateArray
Why is the following used..
_cntNil = count (_this - _this);
I dont see how _cntnil can return anything other than 0 ?
Can someone please explain this useage

Full code
#include "..\paramsCheck.inc"
paramsCheck(_this,isEqualType,[])

private _cnt = count _this;
private _cntNil = count (_this - _this);
private _ret = [];
{_ret append [[_x, _cnt - count (_this - [_x])]]} count (_this arrayIntersect _this);
if (_cntNil > 0) then {_ret pushBack [nil, _cntNil]};
_ret

cunning nebula
#

๐Ÿ™ˆ

#

it's probably for occult reasons

astral tendon
#

civ_1 switchmove "Acts_Kore_Introducing";

#

this animation for some reason is verry bugy

#

the character jerks around on the ground doing other animations

cunning nebula
#

buggy ?

#

have you tried using it with "playMoveNow" ? so it gets a proper transition ?

astral tendon
#

civ_1 playMoveNow "Acts_Kore_Introducing";

#

he does nothing

slim verge
#

maybe its having a fit, afterall, all ai now have their own brains , only the leader used to have one ๐Ÿ˜ƒ

astral tendon
#

Civ_1 diableAI "BRAIN"

#

That does not work to.

cunning nebula
#

player disableAI "BREATHE";

astral tendon
#

RIP

slim verge
#

did u ask a medic to look at the ai ?, maybe its suffering from epilepsy

astral tendon
#

i am the medic

#

he is supouse to do a set of animations afhter being revived

#
0 = this addEventHandler ["HandleHeal", { 
 
    [_this select 0, _this select 1, _thisEventHandler] spawn {     
        params ["_injured","_healer", "_EH_Handle"]; 
        _startDamage = damage _injured; 
        waitUntil {damage _injured != _startDamage}; 
        if (damage _injured < 0.2) then {
            _injured call BIS_fnc_ambientAnim__terminate; 
Sleep 1;
            _injured switchMove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon";
Sleep 1;
            _injured disableAI "PATH";
            _injured call BIS_fnc_ambientAnim__terminate;  
Sleep 1;
_injured setFormDir (_injured getDir _healer);
Sleep 2;
            _injured switchmove "Acts_Kore_IdleNoWeapon_in";
Sleep 2;
            _injured switchmove "Acts_Kore_Introducing";
Sleep 4;
            _injured switchmove "Acts_Kore_IdleNoWeapon_out";
Sleep 2;
            _injured enableAI "PATH";
            _injured call BIS_fnc_ambientAnim__terminate; 
            _injured removeEventHandler ["HandleHeal", _EH_Handle]; 
        }; 
    }; 
}];````
#

but, all he does is jerk around on the ground with other animations

cedar kindle
#

with cba logging using trace you get file, linenumber, variable name and value printed

#

it's kinda superior to diag log

jade abyss
#

@astral tendon Some animations just don't work when beeing called

astral tendon
#

is there a way to make it work or is it hard coded?

jade abyss
#

HardCoded

astral tendon
#

Rip

jade abyss
#

Those type normaly work:
AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon

#

Those: Acts_Kore_IdleNoWeapon_in mostly not (especialy in MP)

little eagle
#

What cuel said. TRACE_n you can at least leave inside your code and it will be removed at compile time when not in debug mode. Unlike diag_log which you either have to remove yourself or have SQF checks for it which is kind of expensive.

subtle ore
#

lol, did the TestDance anim get forcefully screwed up? Won't even play in anim viewer, player's hands just kind of get stuck inside their back

little eagle
#

The anim is called "test" so maybe.

subtle ore
#

Well sure, but it had worked ingame a while back. Not sure if that has actually changed since Alpha. Haven't looked at it since

astral tendon
#

civ_1 playActionNow "gestureYes";

#

is not working, i did something wrong?

#

neider is playAction working

little eagle
#

?

astral tendon
#

Command doesn't seem to be functional

little eagle
#

???

#

If neither of these work, then maybe "gestureYes" is just not implemented.

astral tendon
#

nothing

#

so why is there?

little eagle
#

Where?

astral tendon
#

listing actions available in Arma 3.

little eagle
#

Well, maybe the thing appears in config, but has no actual gesture linked to it. That's just how these things are.

astral tendon
#

"This is War"

still forum
#

can someone quickly tell me if
private _var = nil still privatizes the variable?

#

Time's up. I went with private _var = scriptNull instead

meager granite
#

yes it does

grizzled spindle
#

trying to save positions of containers (IE ammo crates) whats the bes type of pos to use? currently using getPosATL

subtle ore
#

@grizzled spindle ATL will be just fine unless you've got that object out on the sea obviously. (getPosASL in that sense, Above Sea Level)

grizzled spindle
#

Yeah, For some reason got em spawning sometimes outside houses

subtle ore
#

What do you mean? How are they created?

grizzled spindle
#

Create vehicle

#

then setPosATL

little eagle
#

What format do you save them?

subtle ore
#

And you're saying, if the object was inside a house then it spawns them outside?

grizzled spindle
#

Sometimes inside

#

sometimes bottom floow (when should be top) sometimes outside haha

little eagle
#

trying to save positions of containers

#

How?

grizzled spindle
#

an array

#

in a database

little eagle
#

Yes, but how do you get the position in the first place?

#

Which command.

grizzled spindle
#

getPosATL

little eagle
#

Then setPosATL will place them at the same position.

grizzled spindle
#

Thats what i thought

little eagle
#

You sure you don't use position or getPos?

grizzled spindle
#

yeah

broken yacht
#

I need help, how to get speed and damaging power of any bullet that flyby near me within 50 meters. please help me if anyone know, how to do it

grizzled spindle
#

to place its attached to the player

#

then detached then saved

subtle ore
indigo snow
#

that doesnt do what you think it does

subtle ore
#

FireNear?

indigo snow
#

its when the shooter is near

#

not when bullets come close

subtle ore
#

I mean unless you've got something better

indigo snow
#

no but thats certainly not a solution

little eagle
#

"damaging power"

subtle ore
#

Not sure what the solution is for you then

#

Fired can return the projectile object

little eagle
#
nearObjects
broken yacht
#

@subtle ore thanks! i already tried it but still not getting how to implement this to get speed and damage power of any bullet flown near me

subtle ore
#

Firstly

little eagle
#

There is no "damaging power"

subtle ore
#

Damage power

broken yacht
#

@indigo snow yes! you are right

little eagle
#
velocity _bullet
broken yacht
#

@subtle ore when bullet come close

subtle ore
#

Will nearObjects check for bullets commy?

broken yacht
#

@little eagle but how to detect taht bullet is coming close to me

subtle ore
#

or rather, filter for bullets

little eagle
#

Why wouldn't it?

indigo snow
#

because bullets are cfgAmmo and those are wierd

subtle ore
#

Not quite sure. My first though was that it was because it's defined as a magazine, not a vehicle.

little eagle
#

but how to detect taht bullet is coming close to me
Instead of moving away? Calculate the angle between the velocity vector of the bullet and the vector from the bullet to the player.

broken yacht
#

can we treat bullet as a vehicle in script ???

little eagle
#

If the angle is sufficiently small enough, the bullet is incoming.

broken yacht
#

@little eagle you are damn intelligent ๐Ÿ˜„

#

oka but how we can get speed and damage power after detecting ??

little eagle
#
vectorMagnitude velocity _bullet
#

That will give you the absolute velocity in m*s^-1

#

Dunno about "damaging power". I guess the closest is the hitconfig entry of the bullets CfgAmmo class? But that is also multiplied by the current velocity devided by the typicalSpeed entry of the magazine.

broken yacht
#

yes correct

#

can we use init_speed variable of arma 3 to get current speed ?

#

init_speed given in ammocfg

little eagle
#

No, that would be the speed it exits the muzzle, not the current speed.

broken yacht
#

oka

#

thanks for valuable info..will ask for help i stuck on that again..:)

#

here is my sound mod pls sub it and give me feed back

little eagle
#

I don't have Arma on this machine, nor Steam.

broken yacht
#

oka np once u have subt it ๐Ÿ˜ƒ

astral tendon
#

this addEventHandler ["respawn", {this enableFatigue false;}];

#

this is supouse to remove Fatigue of the player that respawn

#

is o its init

#

but is not working

little eagle
#

this is no longer the object in the respawn eventhandlers code. The respawned units is passed as argument instead in _this instead. As first element.

astral tendon
#

this addEventHandler ["respawn", {_this enableFatigue false;}]; ?

little eagle
#

No, read the wiki. _this is almost always an array.

astral tendon
#

how?

#

this addEventHandler ["respawn", {[_this] enableFatigue false;}];

#

still errors

#

and the wiki have no exemple of arrays

indigo snow
#

man

#

ok what is _this?

#

what the value

astral tendon
#

i dont know

indigo snow
#

well thats why it doesnt work then

#

go find out

#

systemChat _this

astral tendon
#

maybe is the unit that is holding the init code?

indigo snow
#

why are you guessing?

#

you should be finding out

#

look it up on the wiki, or log the value some way

little eagle
#

systemChat str _this

subtle ore
#

systemChat _this wouldn't work would it? don't think systemChat can convert an array to a string

little eagle
#

^^

subtle ore
#

yeah there you go

astral tendon
#

this addEventHandler ["respawn", {player
enableFatigue false;}];

#

i copy that to all playable units, this will work or there can be only one "player"

subtle ore
#

no, that wouldn't work in MP

#

in SP this would be fine

#

but unless it's local to the unit (which it's not if it's in the unit init) then this won't work

little eagle
#

There is no respawn in SP.

subtle ore
#

you missed the point commy. { player enableFatigue false;}]; player

#

in the unit init?

little eagle
#

You said this would work in SP, but it's a respawn eh, so no by default.

subtle ore
#

๐Ÿคฆ

little eagle
#

Am I wrong?

subtle ore
#

No you're not. But my point was that using the player in SP would work, but not in MP. Or at least not when the unit is not local

little eagle
#

2 letters.

subtle ore
#

wasn't talking about the eh

little eagle
#

^^

#

In a way I can see this working with player. But it's absolute garbage code. And it didn't bring any understanding of what's happening.

astral tendon
#

how about inside a onPlayerRespawn.sqf?

little eagle
#

Dude. Just learn about how the eh works.

#

auto hotkey is so good.

digital hollow
#

ahk IS so good

subtle ore
#

What?

digital hollow
#

I assume commy was talking about AutoHotKey?

little eagle
#

Yes. Adding the math symbols and sub and superscript right now.

#

Will be so much easier to write that stuff soon.

tulip cloud
#

addMPEventHandler MPkilled vs addEventHandler Killed. If other players don't need to know who killed who or that someone died....Can I just use addEventHandler and have a script connected to that to handle everything?

subtle ore
#

@tulip cloud addMpEventHandler is added on every machine, iirc it can also be local to that machine in some cases

#

If you don't wan't others knowing, then a mp event handler shouldn't be your choice

tulip cloud
#

Has anyone measured the impact difference of the 2 scripts?

subtle ore
#

Impact?

#

You mean code performance?

tulip cloud
#

yeah.

subtle ore
#

I doubt there would be a difference, but i can check for you if you are un available to do so

tulip cloud
#

I'm unsure how you would test it. Seems you would need a full server and test the performance impact. If I'm correct using MPEventhandler mpkilled fires on all machines including the server. So he more clients the bigger the impact.

#

Am I reading the documentation wrong?

#

EH code will trigger globally on every connected client and server.

subtle ore
#

No, that's correct

#

Yeah, that's the dilema really. Is the amount of people

tame portal
#

@tulip cloud The performance impact should be super tiny

#

If I am correct, that command also registeres the eventhandlers in the case of JIP, so that would be the only real performance impact it could have

subtle ore
#

yeah jip

tulip cloud
#

even if we are talking 0.1120 ms vs 0.073 ms....it is significant enough to consider it.

tame portal
#

Yeah then it bloats up the list abit which gets run down when you join in progress, but apart from that it's one-time network execution and then everyone handles the trigger locally

#

In what case do you need this performance gain?

tulip cloud
#

Just making sure every script is as efficient as possible.

tame portal
#

That's really not necessary ๐Ÿ˜›

tulip cloud
#

call me OCD

subtle ore
#

JustinWaters, you are OCD ๐Ÿ˜†

tulip cloud
#

you should see my spreadsheets....

zenith totem
#

I'm slightly curious now

subtle ore
#

Spread sheets now? Do you happen to wear a tinfoil hat too ? ๐Ÿ˜›

tulip cloud
#

lol, nah. But thanks for your guy's support. (Don't want the hammer coming down for being too far offtopic.)

subtle ore
astral tendon
#

so, i am trying to make units run from the area ignoring the firefight

#

the civilians intead stop in the middle of it doing nothing

#

so, if i put they on careless thet walk in the middle of the bullets

#

and i put this set of commands

#
this disableAI "AUTOTARGET"; 
this disableAI "SUPPRESSION"; 
this disableAI "AUTOCOMBAT"; 
this disableAI "COVER"; 
this disableAI "TARGET"; ```
#

and they still behave like that

#

also diabled FSM and seens like they are even dumbier

#

they are all in the same group

#

what i am missing?

zenith totem
#

@astral tendon

subtle ore
#

๐Ÿคฆ

#

why did you disable fsm?

meager granite
#

@tulip cloud It all depends on what you do with them and at what scale. MPEHs simply send network message when appropriate event fires somewhere locally which tells everyone else to execute the event handler too, unless you have thousands of vehicles constantly getting these events triggered, having few network messages from time to time and simple event scripts executed should be a drop in the ocean.

#

It all depends on your approach in designing the mission. If you absolutely sure that certain vehicle will never change locality then just add local event on client that will own it. If locality might be all over the place then MP events might be okay but you can always just add same EH on all clients, it will be pretty much the same thing as having MPEH, minus said microscopic network impact.

#

Yeah MPHit might be worst of them all considering how often it might end up running

#

But again it all depends on what you do

#

Well, it depends. Having heavy script on EntityKilled might not be worth it if you need Killed\MPKilled just on few entities

little eagle
#

Just add the hit eh on all machines... It's the same as killed. It will only fire on the machine that owns the object, and that will be exactly one machine every time.

little eagle
#

grr

subtle ore
#

๐Ÿค”

cedar kindle
#

@tulip cloud If other players don't need to know who killed who or that someone died you mean only the server needs to know ?

tough wharf
#

you mean south of lakatoro?

#

why is it that, when the server adds items to a crate (when the crate is initialized), the client can see the items but cant take them. only items added by the client can be taken by him?

simple solstice
#

@tough wharf use the global version of add..cargo

tough wharf
#

@simple solstice i used addItemCargoGlobal
@tough abyss seems like its just a bush?

little eagle
#

Did you disable the simulation of the ammo box?

tough wharf
#

nope

#

i can open the inventory, i can see the items added by the server, but i cant take them

#

only the items added by the client

little eagle
#

What item?

tough wharf
#

backpacks weapons items, a mixed variety

peak plover
#

shooo

peak plover
#

Anyone stopping civilians ?

            _x spawn {
                sleep (0.5 + random 4.5);
                doStop _this;
                _this stop true;
                sleep random 10;
                _this stop false;
            };
still forum
#

shoot them. @peak plover

peak plover
#

But I am the polcei

slender halo
#

put a gun next to the corps

peak plover
#

I'll make a script that youcan interact with dead bodies and "plant evidence?"

slender halo
#

^^

#

Arma Noire

#

you just want them to "freeze mother f*cker" ?

peak plover
#

Yeah

slender halo
#

you could disableAI "ANIM" then set them in the animation of your choice

#

or maybe disableAI "PATH"

timber ridge
#

does doStop stops a unit with a smooth transition? f.e. stopping him while he's sprinting? will it be an instant stop or will the unit slow down gradually?

peak plover
#

smooth

#

disableAI path should be more instant

tough abyss
#

you could always do switchMove aswell on the unit

timber ridge
#

isn't switchmove instant while playmove is smooth?

tough abyss
#

I was replying to nigel, saying it should be more instant

polar folio
#

good question actually

little eagle
#

Pretty sure it doesn't.

#

But it's been a year.

polar folio
#

how do you open the arsenal without it adding the damn addaction? i need this [] spawn BIS_fnc_arsenal; but without addaction. it seems to automatically add a scroll action, if you call the code from your own addaction. weird

#

nvm. got it. for some reason the addaction param is in the addvirtualinventory functions

timber ridge
#

@polar folio could you share the solution maybe? ๐Ÿ˜‰ in code, if possible.

polar folio
#

well you jsut call it like above or like this ["Open",false] spawn BIS_fnc_arsenal; to get the arsenal with only what you have and your virtual inventory

#

just make sure to use the virtual inventory functions with the addaction param set to false beforehand

[player, getUnitLoadOut _x, false, false] call BIS_fnc_addVirtualWeaponCargo; // first bool
#

making a class based arsenal that draws the available stuff from editor placed units

polar folio
#

actually you have to init it differently it seems. jesus this is confusing. will post it on the forums once it all works

subtle ore
#

wait waahh

polar folio
#

is there no fucken way to open this shit with your own virtual inventory NOT using the premade addaction? going crazy over this shit

queen cargo
#

Copy the function @polar folio and put it into your own file...
Then remove everything

polar folio
#

trying to avoid that. thx for the hint though

icy raft
#

Hello! So... Is there an EventHandler or some prefered way to detect when a player changes his current weapon? Don't want to have to check if _oldWeapon isEqualTo currentWeapon player every damn frame. So... Is there anything like that? Couldn't find it in the EH documentation.

austere granite
#

no

#

create a scripted event system with checking that

icy raft
#

I have one, but want to avoid clugging it with useless stuff

#

Gonna try checking on the AnimChanged EH and check if the anim contains a reloading sequence

still forum
#

CBA does that.. It checks every damn frame and fires a scripted eventhandler

astral tendon
#

_injured call BIS_fnc_ambientAnim__terminate;

#

how i made this local?

icy raft
#

@still forum I'm avoiding CBA or any addons :(
And anyways, that just feels wrong, I do that with some things, but only extremelly needed stuff and in 0.2s-1.0s loops (not every frame)

still forum
#

Well.. Dozens of mods can just keep their own loops and recheck their things.. Or they all use the same framework and only a single loop exists..

icy raft
#

Better that way, I prefer to have control and kill the loops whenever needed

#

And anyway, found a way to filter the reload anims

#

Found a regex and it seems that depending of a few leters at fixed position you can determine if it's a change of weapon or any other thing

#

Someone should index that thing out

#

Gonna index them out

little eagle
#

Reloading doesn't fire AnimChanged etc. for rifles. They use gestures, not animations - and those are different things in this game. The animation names have a pattern, but there are exceptions to those, so idk how safe it is to rely on them.

astral tendon
#

My units keep reacting to firefights, is there a way to force they to ignore it?

#

the civilians are supouse to flee to a safe area instead they stop in the midle of the firefight

dim notch
#

No idea if there's a way to make them completely ignore it, but I've found that allowFleeing 0 and disableAI "FSM" makes them pretty reliably reach their destination at least

#

They'll stop for a bit when they hear gunfire, but continue pretty quickly instead of running in a random direction or starting crawling

astral tendon
#

i set they to careless and seens to work

#

and put this

#

this getSpeed "FAST";

#

on their waypoint

#

seens to work right

dim notch
#

I thought you can't get units to anything but walk with careless?

astral tendon
#

they do

#

but puting that on the waypoint make they run

#

seens to not work if i stuck it on the units init

subtle ore
#

is anyone having adding items to a virtual ammo box?

#

I am adding items to the box, and the function returns that they were added sucessfully

#

but there is nothing in there

#

weapons and such are fine

#

but just items that I'm having problems with

#
[] spawn
{
    {
        waitUntil{!isNull _x};
        sleep 1;
        private _box = _x;
        if(isServer) then
        {
        clearWeaponCargoGlobal _x;
        clearMagazineCargoGlobal _x;
        clearItemCargoGlobal _x;
        clearBackpackCargoGlobal _x;
        } else {
        clearWeaponCargo _x;
        clearMagazineCargo _x;
        clearItemCargo _x;
        clearBackpackCargo _x;
            };
        {
        [_box,(configName _x),false,true] call BIS_fnc_addVirtualWeaponCargo;
        {[_box,(configName _x),false,true] call BIS_fnc_addVirtualMagazineCargo;} forEach (getArray(configFile >> configName _x >> "magazines"));
        } forEach ("isClass _x" configClasses(configFile >> "CfgWeapons"));
        {
        _items = [_box,(configName _x),false,true] call BIS_fnc_addVirtualItemCargo;
        if(count _items == 0) then {hint "broke"; };
        _box setVariable["Weap",(configName _x)];
        } forEach ("((isClass _x) && (configName _x) isKindOf 'Vest_Base_F')" configClasses(configFile >> "CfgVehicles"));

    } forEach (entities "B_supplyCrate_F");
};
icy raft
#

@little eagle Thanks for the info! (sorry for late reply ๐Ÿ˜ฆ )

rotund cypress
#

Anyone can guess what it will output in RPT? ```sqf
["test1", "test2"] call {
24;
call {
diag_log [_this];
}
}

#

heheheheh

#

๐Ÿ˜‚

subtle ore
#

lol wtf

zenith totem
#

I may have cheated

#

[["test1","test2"]]

#

I'm not sure how that gets wrapped at all

#

Oh, the brackets around _this, idiot me

#

Looks like _this just doesn't get redefined for the second call so it uses the previous _this

rotund cypress
#

Well, ye

#

Exactly

#

I noticed it cause I was getting an error on a parameter which was expecting a boolean but got a display

#

Since a display was passed into it, from the other script

queen cargo
#

Unary this just reuses current this

#

That's why you put nil or an array in front of it

tame portal
#

What's the deal again with including game files from the missionfile? I must have forgotten what the issue is with it again...

#

Randomly results in crashes while on other machines it works fine, strange to me

little eagle
#

@rotund cypress Without reading further down the chat, [["test1", "test2"]].

#

@queen cargo If you use nil call {...}, the code block will not be executed and no error will occur in both scheduled and unscheduled environment. Also unary call does not reuse _this. It just doesn't overwrite it with a new one. Which also means that it's not set to private in the code block.

#

@tame portal It crashes the dedicated server when choosing the mission from the mission select screen as admin, preventing the mission to load.

daring pawn
little eagle
#

Why is a snake a man?

"Snake_random_F" isKindOf "Man" //true

Because one class inherits from the other.

daring pawn
#

I mean, If i'm trying to create a list of, well, houses, i'm going to need to filter out some of those things

little eagle
#

What kinds of houses do you need for your list?

daring pawn
#

Well what i'm doing is using the config coded locations of cities, then creating a marker with a 200m radius and counting the total number of buildings in that marker area. If the array created using "House" also includes lamps, its not going to be accurate for what I want. And I want houses, enterable or not at this stage

little eagle
#

Have you tried nearestTerrainObjects? Because that one uses the same logic as the map for it's filter.

daring pawn
#

Would that no still have the same issue of using "House" filter?

little eagle
#

It doesn't use classes as filter, but another sort of type unrelated to class inheritance.

daring pawn
#

Oh, interesting.

_types = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_objectives = [];
{
    _a = [_x] call EO_listLocations;
    _objectives = _a + _objectives;
} forEach _types;


systemchat str(_locPos);
{
    _locPos = LocationPosition _x;
    _nearBuildings = nearestTerrainObjects [_locPos, ["House"], 200];
    if ((count _nearBuildings) < 10) then {
        _c = _c + 1;
        systemChat str(_c);
        _objectives = _objectives - [_x];
    };

} forEach _objectives;

_objectives

Is what i'm using to create the locations at this stage

little eagle
#
Possible type names:"TREE", "SMALL TREE", "BUSH", "BUILDING", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CHURCH", "CHAPEL", "CROSS", "BUNKER", "FORTRESS", "FOUNTAIN", "VIEW-TOWER", "LIGHTHOUSE", "QUAY", "FUELSTATION", "HOSPITAL", "FENCE", "WALL", "HIDE", "BUSSTOP", "ROAD", "FOREST", "TRANSMITTER", "STACK", "RUIN", "TOURISM", "WATERTOWER", "TRACK", "MAIN ROAD", "ROCK", "ROCKS", "POWER LINES", "RAILWAY", "POWERSOLAR", "POWERWAVE", "POWERWIND", "SHIPWRECK", "TRAIL"

And those might be more accurate.

meager granite
#

Use other properties to tell house from general building like doors or windows in config, maybe check if it has buildingPos positions

little eagle
#

Cities and villages should already have locations on the map.

daring pawn
#

They do yea, but some of them on Altis for example are very small but are considered a City

#

Or Village

#

I want larger areas for this portion

meager granite
#

Actually checking doors, windows or positions might not work for A2 terrains with non-enterable buildings

daring pawn
#

Checking if they existed or the config entry for them would surely still function though @meager granite

meager granite
#

Aren't some gates or even fences have config entries too?

little eagle
#

I'd say you try nearestTerrainObjects with HOUSE, BUILDING, LIGHTHOUSE, CHURCH and CHAPEL and see if that get's rid of your lamppost problem.

daring pawn
#

Yea it seems more effective so far. I'm now trying to think where to even begin with trying to increase the marker size to the "edge" of a city

#

something like gradually increasing circle size if theres still buildings

little eagle
#

You can get the center by adding up all x positions and y positions and dividing by the number of houses.

meager granite
#

I've actually been thinking about same problem for some time now, to have Wasteland mission automatically parse island and try to find what can be considered a city\village

daring pawn
#

@little eagle Thats an interesting idea, I thought of that for really simple towns similar to say "Paros" on altis where a simple circle would easily conform like that. But for an area like Kavala, where it'd need to be an Ellipse shape is where i'd believe to run into issue with that

#

@meager granite Thats essentially the idea. I'm populating cities and areas with enemies. Trying to improve performance on spawning in large areas in comparison to what i'm doing currently, which is creating a "grid" for each building

https://i.imgur.com/IpMYmu5.png

little eagle
#

True. You can get an ellipse with this, but it will always be aligned with the maps north and east.

meager granite
#

I wish we could create several profile namespaces so you don't have to save ton of data to disk when you change 0.01% of it.

daring pawn
#

A better data saving method for persistence would be a nice thing for ArmA 4

little eagle
#

If you want to turn all cities in ellipses... You'd need to find the axis with which the cities longest side is angled towards the maps east... ๐Ÿค” This should be possible somehow.

daring pawn
#

Yea I essentially need to create a relatively accurate ellipse around all cities (well, the ones I'm filtering as decently sized)

#

For some reason, Oreokastro on Altis isn't being considered in the list as having enough buildings ๐Ÿค”

little eagle
#

Find the y center by the method I described.
Find the x center of all houses above the y coordinate.
Find the x center of all houses below the y coordinate.
Connect and you have an axis.
Too bad I don't have Arma atm to try this out.

daring pawn
#

I'll try that out, it might take me a while aha, my usage of Maths in SQF/ArmA is quite an interesting escapade

little eagle
#

Maybe you can do the same with reversed x and y. And then you get two non-orthogonal axis (plural?). Pretty sure that can be turned into an ellipsis.

meager granite
little eagle
#

Where's the interesting part?

meager granite
#

Well, there are lots of algorithms and approaches for this task, so whatever you find interesting for yourself.

little eagle
#

I can't find the one that would solve this problem.

meager granite
#

I'd go with something like this

little eagle
#

We don't have markers like this do we? But we have triangles, right? So you could make one out of this I guess.

meager granite
#

Build such tree, find two buildings farthest from each other, draw a circle between them

daring pawn
#

You'd do that on both Axis Sa-Matra no?

meager granite
#

Might be bit more complicated if you want ellipse, but very easy if you want a circle around all objects

daring pawn
#

I mean, the circle situation is solveable, its really when doing ellipses for places like Kavala that are long not simply circular

meager granite
#

Googled "ellipse around cluster", plenty of articles and posts on this topic

#

Are you trying to find out if bounding boxes intersect or something?

#

Bounding boxes are very unreliable and might not represet actual object's size

#

Take Zamak for example, it has bounding box extended forward by a lot

daring pawn
#

The Hunter is the same

meager granite
#

ah, you're using lineInterects

little eagle
#

Should they be always the same four _i ?

#

I mean the bottom plane. Should be two iterations for it and they should always be the same index.

tough abyss
#

@little eagle - aren't animals under CAManBase?

little eagle
#

No, they are not under CAManBase, which is why you should always use CAManBase as filter and not Man.

tough abyss
#

๐Ÿ‘

meager granite
#

@tough abyss Try different memory lods

#

I use "GEOM", "FIRE" for my body dragging

meager granite
#

No, for detecting floor

#

well you can use it for walls too probably

meager granite
#

I do, but going through walls handled differently, corpse follows your path so it rarely ends up going through walls

#

And I need surface checking because I manually set corpse Z each frame

#

Both

#

Corpse is actually a ragdoll

#

So when drag stops, it falls down into ragdoll

#

Its pretty compliated with lots of crutches to avoid arma bugs, but somewhat works

#

Armanormal activity

#

They just need to play their game in multiplayer sometime

#

Various ragdoll bullshit happens in 100% multiplayer games

astral tendon
#

there is a rule on what needs to be local or global?

#

i wanna play around with RNG especially puting units to spawn in radown places

#

but im afraind that in a server that may not work right

little eagle
#

There are these icons on the top left. AL EG. Those tell you how to use a command in MP.

astral tendon
#

but i have this situation

#

it does say noting about it

#

it does say noting about it

#

i was testing with my friend and see that those comands dont really work right

#

but if i put this ```if (isServer) then { [[this, selectRandom ["PRONE_INJURED_U1", "SIT_LOW_U", "PRONE_INJURED"],"ASIS"],BIS_fnc_ambientAnim] remoteExec ["call"] };````

#

seens to work for us

#

we see the animation

#

if i add that ```remoteExec ["call"]```` its seens to make it work

#

that maybe work to all other global commands?

little eagle
#

If you remoteExec a global effects command, like addItem, you'd end up with 5 items if 4 players are connected to a server.

astral tendon
#

that means RIP performace?

little eagle
#

No, it means too many items.

astral tendon
#

then the animations will be playing to all players in the server?

#

can i take this example to any other command?

#

like

    [<unit>,<morestuff>] remoteExec ['anycommand',0];
};```
#

that is some good piece of info, i will save those examples

#

i dont know if you can anser that, but why AI seens to be random in MP?

#

in my last mission, when playing in coop the AI drives act totaly diferent

#

In SP they seens to work fine

cunning nebula
#

yuck i see so much remoteExec call lately

#

even when its just a single command that could be used with remoteexec directly

#

maybe ppl are just too lazy for that

little eagle
#

call for one command is silly.

dim terrace
#

is there a way to remotely switch on laser designator?

little eagle
#

QS, it's not about performance (or traffic here really), but making twice as many keystrokes for something that in the end looks more ugly than it has to be.

still forum
#

@dim terrace What kind? A player holding a laser designator in his hands. Or that remote controllable thing that was added in Marksman dlc?

cunning nebula
#

@dim terrace action fire should do

#

last time i did that was in OFP, and I think it worked

#

this one

#

or actually

#

_unit forceWeaponFire ["Laserdesignator","Laserdesignator"];

#

try this

#

.

#

has anyone tried disabling certain AI sections for unarmed civilians?

#

I wonder if there could be performance gained from it

dim terrace
#

@cunning nebula forceWeaponFire works great - thank you ๐Ÿ˜ƒ

haughty scarab
#

Hey, does anyone know why my custom vehicle texture dissapears after 5 seconds ? after 5 seconds half the car is invisble

timber ridge
#

@haughty scarab same behavior in both SP and MP?

haughty scarab
#

couldnt test , basiaclly im on life mod so when i buy the vehicle its fine when i store and retrieve from garage it goes invis after 5 seconds

timber ridge
#

could be your life mod's bug or some bullshit conflict causing one thing to override another, or idk... this is Arma ๐Ÿ˜ƒ

haughty scarab
#

haha

cunning nebula
#

sounds like the path for the texture is stored wrong

haughty scarab
#

here is the texture path : "Textures\CopSUV.paa"

timber ridge
#

I guess you can try debugging it with showScriptErrors param in the launcher

cunning nebula
#

well sure... the question is what the garage does with that

timber ridge
#

so the game can scream freely at you if you're doing smth wrong

cunning nebula
#

I think you shouldn't even be here if you have showScriptErrors disabled ๐Ÿ˜‰

haughty scarab
#

i have it on

#

๐Ÿ˜›

cunning nebula
#

good ๐Ÿ˜ƒ

timber ridge
#

haha, agreed, another thing is to check the rpt logs?

haughty scarab
#

but i dont get any errors at all every other texture works fine its just this one its custom

timber ridge
#

haven't played Arma in a while though, don't remember their exact loc

haughty scarab
#

erm i cant actaully open my rpt logs

#

"File size is to large for notepad to open"

#

sad face

timber ridge
#

try notepad++?

haughty scarab
#

its 14 million lines long

#

same issue

cunning nebula
#

the script that restores the vehicle when you take it out of the garage

indigo snow
#

delete it or restart arma

haughty scarab
#

ill delete it and retest

cunning nebula
#

let it log the texture path to you

#

so you can compare

timber ridge
#

lol, run a bash script that will shred that file into pieces?

#

@indigo snow is right though, just delete it so it resets on next launch of Arma (i believe that's how it works)

haughty scarab
#

ok thanks ๐Ÿ˜›

indigo snow
#

@timber ridge it will create a new rpt file every launch on windows

#

if its a server.rpt, you need some fiddling if youre on linux

tough abyss
#

Anyone know the sqf command for testing actionNamedSel (new engine tech used for door/ladder changes). nm found it was getCursorObjectParams

haughty scarab
#

no erros in my rpt

astral tendon
#

is there a command to set the precense of a object?

#

i wanna put that on a trigger

winged narwhal
#

Dose anyone have a teleportor script that teleports me on to the carrier?

still forum
#

setPosASL

winged narwhal
#

this is what i am dealing with---> _tele = _this select 0;
_caller = _this select 1;

_caller setPos (getpos (BacktoBase));
hint "Player has teleported to Base.";

still forum
#

and?

#

That is about what you need

winged narwhal
#

Thx

deft owl
#

hey, i am a noob in scripting but i wanna link a modul to a player when he is selecting it on an objekt
this AddAction ["modul1","modul1.sqf"];
and i have no idea what to write in the .sqf ??? what i know is that i need the player attachTo [modul1, [0, 0, 0] ];

cunning nebula
#

open that

#

press ctrl + F

#

search for "sync"

#

find this: synchronizeObjectsAdd

#

also, bookmark that url ๐Ÿ˜ƒ

#

you'll need it alot

little eagle
#

@winged narwhal
I'd use setPosASL and getPosASL instead. Both commands work in the ASL format.
If you use getPos and setPos, you have to commands that surprisingly work in different formats. AGL vs AGLS. That means that you'd spawn inside buildings or on the waves if the BackToBase object is on a house/stone or on an aircraft carrier.
This can be avoided by using the mentioned ASL commands.

winged narwhal
#

thx for the help guys i already got it to work thx to @still forum

slender halo
#

does CBA has assoc array functions ?

still forum
#

hash

#

?

#

I guess yes

slender halo
#

let me check

still forum
#

hashGet/hashSet

slender halo
#

looks like what i was looking for

tough abyss
#

If im looking to run something server side that is going to be in a while{true} loop should I use spawn or execVM. I want the task to be executed with 0 delay

#

and this loop will last throughout the server

meager granite
#

Scheduled (spawn\execVM) loop without delay might execute several times a frame

#

If you want precise per frame execution, use addMissionEventHandler ["EachFrame", {call mycode}]

tough abyss
#

thanks ๐Ÿ˜„

still forum
#

A while loop without delay in scheduled WILL execute 3ms a frame basically it will run as often as it can in that frame. And then it will not execute till all other scheduled scripts ran atleast once

#

spawn/execVM is both the same essentially

tough abyss
#

And what would you recommend if I want something to run exactly every 5 minutes

still forum
#

define "exactly"

#

nanosecond precision?

#

Do you have CBA?

meager granite
#

Using CBA for most basic scripting tasks ๐Ÿ‘Œ

tough abyss
#

Yep nano second and yes I have CBA

still forum
#

impossible

tough abyss
#

Well whatโ€™s closest

#

If anything

still forum
#

the best precision you can get is 1000ms/fps

#

server fps limit is 50. so 20ms

astral tendon
#
  _unit = _this select 0;  
if ({!alive _x} count crew _unit == 0) then {_unit setDamage 1} 
}];````
still forum
astral tendon
#

i am forgeting someting?

still forum
#

that's the best you can get

#

maybe some brackets. You are adding that to a vehicle?

astral tendon
#

yes

meager granite
#
nextExecutionAt = 0;
addMissionEventHandler ["EachFrame", {
    if(diag_tickTime >= nextExecutionAt) then {
        nextExecutionAt = diag_tickTime + 5 * 60;

        // Something that happens exactly each 5 minutes
    };
}];
still forum
#

@meager granite You just rewrote something that CBA already has. Benefit being none. And you are now running one more EachFrame handler.

meager granite
#

Its better to have engine go through list of events

#

Rather than script go through script array

still forum
#

@meager granite Actually wrong in this case

#

your code is getting recompiled every frame

#

which is very bad

#

and very much slower than a script going through an array

meager granite
#

Recompiled? Wut?

#

Its not how it works

still forum
#

That is how it works

#

engine only stores eventhandlers as strings.

#

which get compiled before every execution

meager granite
#

Code is compiled even before it has anything to do with addMissionEventHandler

peak plover
#
{call my_fnc}

instead of

{my many lines of cunction}
still forum
#

@astral tendon Why don't you call it _vehicle then?
maybe if ({!alive _x} count (crew _unit) == 0) then {_unit setDamage 1;};

#

@meager granite Repeat. Engine turns your code back into string. And stores that. And compiles it back to code before every execution.

#

Probably a leftover from SQS times.. I reported it to BI over a year ago

tough abyss
#

Pretty sure there is a feedback ticket for that somewhere

#

@still forum - Classic BIS.

still forum
#

yep

#

that's it

#

Okey "over a year ago" was not really thaaat exact ๐Ÿ˜„

tough abyss
#
Dwarden added a comment.Feb 14 2017, 6:41 PM
thanks, we will take look into this
#

๐Ÿ˜‚

still forum
#

I could fix it in a couple hours.. But they don't let me ofcause

peak plover
#

@biminions hire dedmen

meager granite
#

Hm, apparently it does

#

Well change it for call myfunc then

still forum
#

So if you have CBA. And want to do something that CBA can already do. Please don't try to reimplement something that's already there

meager granite
#

Should still be faster than iterating script array

still forum
#

compiling functions.. noo by far not

tough abyss
#

It'd be great if BIS hired Dedmen.

still forum
#

Also the CBA array is sorted. So it doesn't iterate past the first element if that's not due yet

astral tendon
#

@still forum still nothing

peak plover
#

9000 fps servers, EH perforamnce gains, what's not to love

still forum
#

Recompiling a couple hundred chars of code is not faster than checking one number in one array element in SQF

meager granite
#

All your CBA logic is definitely slower than compiling single expression string

still forum
#

single expression string.. maybe.
But that CBA stuff doesn't have a lot of logic.
And you not only compile the string. you execute it too

#

and at that point...

tough abyss
#

Wow wow wow. Hold up.

#

Did you just say CBA was slow?!

peak plover
#

Wasn't there a graph with CBA vs vanilla

still forum
#

Also the CBA loop is already running. Adding a new loop won't make that first one disappear

tough abyss
#

You could always just remove the CBA :P
Really wish it didn't use Macros, it really makes trying to find out were a BE log snippet came from alot harder.

meager granite
#
nextExecutionAt = 0;
fnc = {
    if(diag_tickTime >= nextExecutionAt) then {
        nextExecutionAt = diag_tickTime + 5 * 60;

        // Something that happens exactly each 5 minutes
    };
};
addMissionEventHandler ["EachFrame", {call fnc}];

then

still forum
#

Yep.. Makes the compile overhead lower.. But..
Still one extra loop.. doing essentially the same work that CBA does

tough abyss
#

So should I start using more cba to save performance on stuff Bohemia broke?

still forum
#

Yes

#

Atleast before you are going to reimplement something that's already there.. Just use CBA

#

CBA was made by people who know ALL the SQF quirks and most definetly made a better job at implementing that than you could ever do

tough abyss
#

CBA is basically sex.

peak plover
#

cba is basically my sex life

#

fast

barren magnet
meager granite
#

Doesn't CBA each frame handlers calculate deltas and other stuff for each handle?

still forum
#

I think so yeah

#

@barren magnet About a dozen people asked that over the past month.. Afaik no.. not really

tough abyss
#

You can

barren magnet
#

That is a pity ... cause they should reall be disabled in MP ...

tough abyss
#

I just check shift and numpad minus at the same time

still forum
#

onCheat is only for that one cheat. Not for endmission/flush

meager granite
#

Well at this scale there would be no performance gain then

tough abyss
#

Screws with a few players

still forum
#

Yep. Add a keyhandler is a way

barren magnet
#

i do so too and tell arma that is was handled, but it does not care what my keyhandler does

meager granite
#

@barren magnet Crash their game as they're about to type it

barren magnet
#

10/10 solution XD @meager granite

still forum
#

@meager granite Yes. No performance gain by using CBA functions.
But if every mod has it's on eachFrame loop performance get's worse

peak plover
#

๐Ÿ˜‚

meager granite
#

Seriously, just track key presses and crash before last symbol

tough abyss
#

Lol

peak plover
#

Even better, instead of crashing use saveprofilenamespace in a loop, burn a hule in their HDD

tough abyss
#

I freeze my players

grave torrent
#

We had players duping with endmission. Had to block it

tough abyss
#

^

still forum
barren magnet
#

@grave torrent then how did you do it?

tough abyss
#

Key up event handler