#arma3_scripting

1 messages ยท Page 418 of 1

obtuse cosmos
#

does it not work in BIS VR arsenal?

#

for the dummy players (not vehicles)

#

1 sec, I'll modify the function for you, stand by

#

ah

#

odd

#
            //--- Reset all textures after some time
            if (damage _target == 0) then {
#

I don't think this is even run?

willow haven
#

idk

willow haven
#

if you figure it out let me know, I gotta sleep

obtuse cosmos
#

okay fixed

#

well, not fixed, made work around rather

blazing quiver
#

@obtuse cosmos Hey, I looked into the animate command you linked me but I'm not able to access the config/CfgModels file for the asset since it's from a mod.

#

Am I SoL or is there any alternative?

obtuse cosmos
#
player switchMove "Acts_CivilIdle_1";
#

use switchMove

#

@willow haven I'll send fix tomorrow as it isn't perfect atm - I made progress though:

#

I can reset it fully to purple CIV VR entity but when I try to set it all white, it flickers through the textures before applying :S

#
        {
            _unit setHit [_x, 0];
        } forEach (getAllHitPointsDamage _unit select 1);
unborn ether
#

@obtuse cosmos Why not just

_unit setDamage 0;

It does the same you do

obtuse cosmos
#

I have that

#

It uses hidden selections to colour in

unborn ether
#

@obtuse cosmos Hitpoints != Selections. You can apply and read damage only from HitPoints

obtuse cosmos
#
Bov addEventHandler ["HitPart",
{
    _this spawn
    {
        _unit = (_this select 0) select 0;
        _hitParts = (_this select 0) select 5;
        _unit setDamage 0;
        if ((count _hitParts isEqualTo [])) exitWith {};
        sleep 5;
        {
            _unit setHit [_x, 0];
        } forEach (getAllHitPointsDamage _unit select 1);
        // _unit setObjectTexture [0, "#(rgb,8,8,3)color(1,1,1,1)"];
    };
}];
#

Bov is my test dummy ๐Ÿ˜„

#

Well

#

And changed 1 to 2

#

} forEach (getAllHitPointsDamage _unit select 1); > 2

#

I mean 0

#

testing locally

unborn ether
#

@obtuse cosmos Wait, are you expecting for "HItPart" EVH to trigger that way?

obtuse cosmos
#

yeah

#

it works

#

but it flickers

unborn ether
#

@obtuse cosmos so your Bov should take damage and then reset it, right?

obtuse cosmos
#

it is too late/early -> need more coffee

#

this is for BIS_fnc_VRHitpart

#

that doesn't work for entities

#

only vehicles

#

when I compiled the function after putting into a new file, with like: Haz_fnc_VRHitpart

#

didn't work at all, hence why I made hacky work around

#

trying to*

#

it is for @willow haven

#

I originally wanted to repair the original

#

Another odd thing is, the params, they are in an array

#

hence: ```sqf
_hitParts = (_this select 0) select 5;

unborn ether
#

@obtuse cosmos @willow haven Well, if you are not really willing to make velocity or direction vectors, better use "HandleDamage" as it also has reading about where and what damage, and is applied to whatever unit/vehicle

obtuse cosmos
#

ahh, I just saw why...

#

_this

#

@unborn ether Still use BIS_fnc_VRHitpart

#

this is just on top of it

#

as BIS_fnc_VRHitpart doesn't reset

unborn ether
#

@obtuse cosmos Well create your own function from scratch based on what you need <- best way to go ๐Ÿ˜‰

obtuse cosmos
#

yeah, I usually do

#

I don't need this

#

it was suppose to be a quick hacky work around fix

#

but I ended up spending a lot of time on it

#

lol

#

the shadow is FUBAR too ๐Ÿ˜„

#

if you are interested ๐Ÿ˜ƒ

unborn ether
#

@obtuse cosmos You can get the ctrlPosition of the created RscControlsGroup and set the button offseted position with ctrlSetPosition after the group is created.

obtuse cosmos
#

the scrollbar?

#

Basically, I want to create a similar effect to web page with jQuery scrollTo

#

but from when I click the button

unborn ether
#

@obtuse cosmos You cant set scrollbar positions in any normal way, besides you can use this:

_group ctrlSetAutoScrollSpeed 0.001;
_group ctrlSetAutoScrollDelay 0;
_group ctrlSetAutoScrollRewind false;

This will immediatly scroll current group to the bottom of its content

obtuse cosmos
#

I think I can work with this...

#

maybe if I have multiple RscControlsGroup?

#

In the pic, you see On Foot | In Vehicle | In Boat

#

next should be: In Helicopter | In Jet | In UAV

#

after that: Ambient Life | Ambient Sounds | Backpack Access

unborn ether
#

@obtuse cosmos You can create main group, and create sub-groups, and just make the button ctrlShow the whole group, and scrolling the main group down.

obtuse cosmos
#

ah

#

I see.

#

thanks @unborn ether - Will try tonight (in evening) 06:56 am here atm and heading out soon

peak plover
#

Anyone having flickering issue with ctrlcommit and resizing a Ctrl in a resource ?

#

I resize Ctrl 1 and both Ctrl 1 and 2 flicker

meager heart
#

if controls grouped maybe you resizing child and not all group ?

#

i know only one issue with ctrlCommit and that's not flickering

#

^ that issue is about actual commit time

peak plover
#

It's weird to say the least, but I can ty separate resource per Ctrl, or just create a few

meager heart
#

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

unborn ether
#

@tough abyss Any updates in cutRsc-like UI might cause the UI container to regenerate for some reason, and even crash. I have a display created with cutRsc, and sometimes it just crashes to displayNull.

#

@tough abyss Why? Ask BIS.

cerulean whale
#

Anyone know how to make a custom debug console ( want to integrate it into my admin / editor menu - designed to be a bit like ECC with some more useful stuff) in a dialog? I was planning to do SQF ctrlText of an RscEdit and then ```SQF
call compile ```` that but it has issues if the code entered has double quotations like " instead of '. Any ideas of a better way to compile?

unborn ether
#

@cerulean whale Strange, ctrlText always returns preprocessed string, so it will contain a proper set of delimiters. For example it will return Name 'Nickname' Lastname as "Name ""Nickname"" Lastname"

#

Does anybody have an idea how to make a scripted shutdown of an Arma binary which !isServer and !hasInterface. Headless client for example?

cerulean whale
#

I can test it again but last time I was working on this menu I had issues with that

chilly surge
#

Greetings. Iยดm currently working on a mission and wanted to randomize the headgear the players are going to wear, when they load their loadout. I tested some things, but couldnยดt get it to work. Maybe some one can help me ๐Ÿ™‚
https://pastebin.com/7Axcdr15

still forum
#

Check selectRandom wiki page

#

very trivial mistake you made

chilly surge
#

Thanks. I just feel stupid now for asking!

thorn saffron
#

Still chipping away at my shop script thingy. Today I want to tackle the price settings. I basically want 2 things going on: a list of set prices for particular weapons as well as general catch-all prices when the weapon has no specific price defined.


params = ["_class"]

// Prices set for specific classes
_specificWeaponPrices = [ 
    "arifle_MX_F",100,
    "arifle_MX_GL_F",200, 
    "arifle_MX_SW_F",300, 
    "launch_B_Titan_short_F",400, 
    "launch_NLAW_F",500 
];

// Prices set for general groups of weapons, in case the weapon that we try to find does not have specific price set
_genericWeaponPrices = [
    150, // type = 1, rifle
    50, //type = 2, handgun
    350  //type = 4, launcher
];

// We check the specific prices array to see if a price was set for our weapon
_index = _specificWeaponPrices find _class;

// The index will return the position weapon's class name if it was defined in the _specificWeaponPrices array, if not it will return -1
if (_index > -1) then {
    // Specific price found, we now set the price to the value was set by pointing the script to the position next to the class name that returned the hit, thats where is the price for our weapon
    _price = _specificWeaponPrices select (_index + 1);
} else {
    // Things got complicated and the weapon has no specific price set. In this case we need to check what type the weapon is and then use a value from our generic prices array
    _type = (getNumber(configFile >> "cfgWeapons" >> _class >> "type"));
    switch (_type) do {
        case 1: { _price = _genericWeaponPrices select 0 }; // Price set to generic rifle price
        case 2: { _price = _genericWeaponPrices select 1 }; // Price set to generic handgun price
        case 4: { _price = _genericWeaponPrices select 2 }; // Price set to generic launcher price
    };
};
lone glade
#

comment hell

thorn saffron
#

@lone glade At least I don't have to explain what I wanted to do, I can post a version without comments if you want

#

The comments were mostly for my sake, just so I can learn and see what I'm doing.

scarlet temple
#

Hey guys... i have a little problem i can't solve. My clan is allowed to build their own fob in my missions and i wrote a save script for that by myself. But this scripts safes every object within 400m radius, also objects which are already placed by the map. So my question is: Does anyone know a way to recognize / ignore default by the map placed objects?

#

silence ^^

peak plover
#

Comments are always nice

#

What's the question taro

indigo snow
#

@scarlet temple check them against terrainobjects or something?

peak plover
#

Why save map objects anyway?

#

Damage ?

indigo snow
#

read again

#

he doesnt want them

peak plover
#

How do you even get them all ?

indigo snow
#

iunno

peak plover
#

Nearobjects should do like no map

indigo snow
#

my thought, but apparently hes got them /shrug

peak plover
#

Anyway arratIntersects and nearestterrainobjects

indigo snow
#

shame we dont have the inverse of arrayIntersect

still forum
#

I do >:D

thorn saffron
#

@nigel#4210 The question is: is there not too much gross coding ineptitude? ๐Ÿ˜›

indigo snow
#

id only change the switch

#

if you add a dummy entry for the default prices at index 3, you can just _array select (_type-1)

#

i'd also slightly worry about _specificWeaponPrices getting too long for find to run fast

thorn saffron
#

@indigo snow Not sure, it could cause some confusion, also the code like this can be easily adapted for vehicles and items

indigo snow
#

fair point

thorn saffron
#

as for, the find: I do not know any better way of doing this. I also like how simple this whole set up is.

indigo snow
#

it is, just dont make shops with hundreds of items i guess

#

its no nearObjects so youd be fine 99% of the time

thorn saffron
#

The weapons, magazines and items will have a separate prices arrays

split coral
#

"shame we dont have the inverse of arrayIntersect"
wouldn't that be _array1 - _array2?

indigo snow
#

(_array1 - _array2) + (_array2 - _array1) but also handling duplicates correctly

thorn saffron
#

@indigo snow The issue I had was weapon and their count arrays could have duplicates in completely different positions, so I have to have script that checks for duplicates and adds up the duplicates' count to the unique class count. Fortunately I got some help and solved that issue.

inner swallow
#

there is pushBackUnique btw

#

may not help of course, but just in case

thorn saffron
#

@inner swallow Yeah, I used that to get the index of the unique, the issue was that the count was in the second array. Did get it to work though

#
_classnames = [];
_ammount = [];
_output = [_classnames,_ammount];
{
    _class = (_taroShopInventoryWeapons select 0) select _forEachIndex;
    _num = (_taroShopInventoryWeapons select 1) select _forEachIndex;
    _index = _classnames pushBackUnique _class;
    if (_index > -1) then  { 
    _ammount pushback _num;
    }else {
   _index = (_classnames find _class);
   _ammount set [_index, (_ammount select _index) + _num];
   };
} forEach(_taroShopInventoryWeapons select 0);

_taroShopInventoryWeapons = _output;```
#

Probably still shit, but it does the job

edgy dune
#

you now how u can use addWeaponTurret and addMagazineTurret to add vehicle wepaons to other vehicles? can you add infantry weapons to vehicles?

exotic tinsel
#

what file should i put this functionality in ? HandleDisconnect

still forum
#

HandleDisconnectFunctionalityScriptFileFunctionThingy.sqf

#

Or just h.sqf

#

or hd.lul

indigo snow
#

Its just a command, any file will do

#

or an init box

#

or a trigger

exotic tinsel
#

i know it needs to be server side but i dont know if the init is right of the serverinit

#

//========== Disconnected players become AI fix ========== 
addMissionEventHandler ["HandleDisconnect",
{
    _unit = _this select 0;
    deleteVehicle _unit;
}];
indigo snow
#

Both fire on the server

exotic tinsel
#

just trying to prevent ai when player disconnects

#

i had it in the init but we still had an ai guy when a player got kicked for battleeye issue

indigo snow
#

Doesnt really matter if you put it in either of those

#

Or a trigger

exotic tinsel
#

any idea why it didnt get rid of the ai after player got kicked, or is there a on kicked event i need to use?

still forum
#

If you don't want disconnected players to become AI you can also just.. disable ai...

exotic tinsel
#

it is

still forum
#

On disconnect player just falls over dead if AI is disabled

#

So if it doesn't for you.... ยฏ_(ใƒ„)_/ยฏ

edgy dune
#

can u add a infantry gun to a vehicle

#

nope wait nvm

unborn ether
#

@edgy dune Mass Confusion ๐Ÿ˜„

edgy dune
#

I tried it

#

and it worked ๐Ÿ˜ƒ

#

wat i ment was like making the little bird shoot the mx rifle

unborn ether
#

@edgy dune Well, unit is also a vehicle, so basicly you can "attach" a tank cannon to a player

edgy dune
#

pfffftt

#

okay

#

ill try that soon

unborn ether
#

wow

#

since when BIS is using CBA in their native functions?

still forum
#

Since never

#

Because they don't

unborn ether
#

BIS_fnc_compatibleItems uses CBA_fnc_createNamespace

still forum
#

No it doesn't.

#

That is CBA not BIS

unborn ether
still forum
#

No?

#

That is not the BIS function you are looking at

unborn ether
#

So BIS_fnc_compatibleItems is not a BIS function?

still forum
#

Yes

#

It's CBA

halcyon crypt
#

lol ๐Ÿ˜

unborn ether
#

๐Ÿ‘Œ wtf is it on BIS wiki then

still forum
#

Because BIS also has a function with that name in vanilla

#

That has the same functionality

unborn ether
#

Well anyways, who's not using CBA novadays.

lone glade
#

a lot of people

tough abyss
#

i dont ๐Ÿ˜›

still forum
#

Everyone who plays vanilla.

unborn ether
#

Arma 3 vanilla exists? ๐Ÿ˜„

inner swallow
#

Yes ๐Ÿ˜‰

meager granite
#

What's CBA?

#

๐Ÿค”

peak plover
#

๐Ÿ˜‚

#

Who is this infamous Cba I keep hearing about ?

meager granite
#

And what's that arm you're talking about

unborn ether
#

One commy2 dies elsewhere each time you say that ๐Ÿ˜„

errant jasper
#

Anyway to increase the render distance of RTT?

austere granite
#

no

unborn ether
#

Isn't it based on viewDistance or getObjectViewDistance?

austere granite
#

its 400m max either weay it hink

errant jasper
#

Its a bit higher here. But I find a semi-workaround

#

At 500m I can still see stuff. But 1km is "fogged"

lone glade
#

@eager prawn the best way to keep frames up is using "low" quality assets, less polys and lower res textures -> a shitiload more frames

#

I had about 80 fps (client) on our last CUP event, and that was with TFAR 0.92 which is very performance... unfriendly

eager prawn
lone glade
#

unless you have a shitload of frameworks in the background or are using advanced ballistics on everything ofc.

eager prawn
#

but yeah, im trying not to sacrifice gameplay for frames

lone glade
#

i'm helping for free ๐Ÿ˜›

eager prawn
#

not using anything too complex, but yeah using the classic TFAR. I've capped the slots at 90 players per mission (and there's still a queue of 15 over it)

lone glade
#

switching to ACRE or TFAR 1.0 will provide a significant performance uplift

eager prawn
#

yea but

#

TFAR 1.0

#

anything not stable scares me

lone glade
#

it's stable

#

it's just that ded's "dev" hdd is dead

obtuse cosmos
#

Like a donkey with 3 legs ๐Ÿ˜„

lone glade
#

so he can't release it ๐Ÿ˜„

eager prawn
#

@still forum Can you and me have a heart-to-heart on Teamspeak at some point? ๐Ÿ˜› Just to talk about the use of TFAR 1.0

lone glade
#

hopefully he get it sorted soon, but don't worry I keep pestering him about it.

eager prawn
#

shit, I'll buy @still forum a new HDD if it gets him to release soon

meager heart
#

I hope discord at some point will support plugins

obtuse cosmos
#

It does now

#

Node.js

meager heart
eager prawn
#

for me, I don't think Discord will ever replace Teamspeak, but it's definitely good for casual gaming/communication

unborn ether
#

It surely will not, simply because of permissions system, which is not really present in discord

lone glade
#

and the better audio on ts

unborn ether
#

Well, codecs are replaceable, its just a matter of resources

#

Discord is a public resource, while teamspeak is a private resource mostly.

lone glade
#

discord is a startup trying to get bought

unborn ether
lone glade
#

slack is the "profesionnal" variant

meager heart
#

Discord "the noobs friendly and easy to use" vs ts

lone glade
#

riiiiiiight

manic sigil
#

Is it possible to create a free-floating sprite image? Like a retextured invisible wall or something?

lone glade
#

you mean a 3D icon / image ?

manic sigil
#

Sure, though 2d is fine too (hurr hurr)

#

Trying to inject fresh memes into my groups games.

lone glade
#

but yes, use drawIcon

#

you'll have to use the corresponding draw missionEH

manic sigil
#

That may be it... for context, the plan is a breif image of Wile E. Coyote with a plunger appearing before a bomb goes ofd

eager prawn
#

is there some sort of script I can use in conjunction with Zeus to utilize the full asset library, rather than just whats default available to Zeus? similar to XCam, but with the simpler Zeus interface?

lone glade
#

what "items" are missing from zeus?

#

bushes and rocks?

eager prawn
#

bushes and rocks, yes, among many other things

lone glade
#

i'm fairly sure there's a mod for that that exists

#

can't remember the name tho :/

meager heart
#

ares something

eager prawn
#

nah

#

not ares

#

ares is a GREAT addition to zeus

#

but it doesn't utilize your asset library

lone glade
#

i'll make similar modules / functionalities after i'm done with ace arsenal (soonTM)

eager prawn
#

wait, are you from the ACE team? @lone glade

lone glade
#

contributor

eager prawn
#

ah

lone glade
#

I made ace arsenal, garrison, and a few other modules

eager prawn
#

just started using ACEX headless clients today

lone glade
#

and a big part of the wiki

eager prawn
#

was using ZISCH

#

okay

#

nice

meager heart
#

and "the greatest community quotes" gist ๐Ÿ˜„

lone glade
#

I need to add more stuff to it, especially the steam workshop comments

eager prawn
#

just told off some guys today for reuploading your guys' stuff to the workshop

#

lmao

lone glade
#

we got a bot that uses machine learning, yelling at bots is fun

eager prawn
#

๐Ÿ˜†

#

Well the reupload has been up for two months, bot hasn't caught it yet ๐Ÿ˜ƒ

lone glade
#

oh, no it's the "documentation / help" one

eager prawn
#

aahhh okay

lone glade
#

the reuploads are fine as long as they're tagged properly

eager prawn
#

at risk of going offtopic really quick, what's tagged properly mean?

lone glade
#

that they don't call it their mod or official afaik

eager prawn
#

well they call it "all the mods needed for our server in one mod"

lone glade
#

I don't have the knoweldge required to answer that as i'm not part of the team, plus i'm fairly sure nobody reads the steam workshop comments

#

it's a goddamn cesspool of toxicity

eager prawn
#

๐Ÿ˜†

obtuse cosmos
#

lol

cosmic kettle
#

Question regarding locality;
I added the HitPart EVH to local objects on a client and inside that hitpart EVH there is a remoteExecCall to the server.
For some reason it seems not to get executed. Anything specific I'm missing here?

obtuse cosmos
#

show code?

lone glade
#

must be a syntax error, and also using remoteExec in an EH that fires multiple times per hit is a very, very bad idea

#

that's the high way to network spam town

obtuse cosmos
#

yeah

lone glade
#

it's not handledamage bad but still

cosmic kettle
#

It's actually only sending on the first hit, but thx for the advise. The code is nothing big rly.

// gets executed on client for local objects
_this addEventHandler ["HitPart", ARM_Events_fnc_shootingRangeShot];

// line inside the hitpart
[_target] remoteExecCall ["ARM_Events_fnc_collapseTargetGlobal", 0];

//  collapsetargetglobal

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

_target setVariable ["BIS_poppingEnabled", false];
_target animate ["Terc", 1];
lone glade
#

outside of the false in setVar that doesn't need to be there it seems fine

#

but again i'm tired as shit so i may be missing something obvious. ๐Ÿ˜„

cosmic kettle
#

To be honest this is what I assumed to be a 1h script that has been going for +1 week.

#

Hence why I'm finally seeking help here after going over dozens of BIS forum posts etc...

lone glade
#

what's the issue?

cosmic kettle
#

I tested this with multiple people on MP dedi

#

if i run this

// line inside the hitpart
[_target] remoteExecCall ["ARM_Events_fnc_collapseTargetGlobal", 0];

locally, it works.

on the EVH, it doesnt.

lone glade
#

also, the server is 2 ๐Ÿ˜„

#

0 is global

cosmic kettle
#

I know, got desperate and am now just broadcasting

lone glade
#

add a diag log at the start before params

#

also missing a code block

cosmic kettle
#

?

lone glade
#

nevermind, my eyes playing tricks

cosmic kettle
#

np, appreciate the help man.

lone glade
#

diag_log the everloving shit out of it, each step

#

that's how you find your issues

cosmic kettle
#

thing is, I know locality is a hard one to wrap your head around, but this seems unintentional...

lone glade
#

it's not a locality issue

cosmic kettle
#

am past diag_logging already, I just do not accept targets not popping down if one shoots them...

lone glade
#

disabled simulation maybe?

#

it disables hit EHs with it.

cosmic kettle
#

The thing is, the globalcollapse gets executed on each client.

lone glade
#

? doesn't matter, the hit EH wouldn't fire.

#

it just doesn't track damage at that point

cosmic kettle
#

client has em all simulated

#

so EVH passes through

#

one only that client

lone glade
#

does the function works if you call it outside of the remoteExec?

cosmic kettle
#

but the global call should make said target drop on all clients regardless of simulation

lone glade
#

it may not be compiled or you have a typo

cosmic kettle
#

have a diag log at the and reporting the correct info

lone glade
#

the target is just not falling?

cosmic kettle
#

no ๐Ÿ˜ข

#

and I'm out of hair to tear out

lone glade
#

have you tried animateSource instead ?

#

it's more reliable

cosmic kettle
#

honestly I have not, assuming it wouldn't change since works on lcoal

#

will try it as we speak.

lone glade
#

they work differently

#

full explanations on the wiki

cosmic kettle
#

Just to elaborate

#

the global script works, because if not they wouldn't even fall locally.

#

it's just that only the local player sees them fall.

lone glade
#

that's... weird

cosmic kettle
#

ikr

lone glade
#

going to check something brb

cosmic kettle
#

willing to send the source files if wanted.

lone glade
#

you shouldn't need to script them falling afaik

#

those animations should be network synced

cosmic kettle
#

that's what I thought

#

I even had to exclude the swivel ones because on MP dedi, they don't even move...

lone glade
#

they do

cosmic kettle
#

I am suspecting BIS for removing the ani on dedi since it used to overflow netmsgs

#

I initialize every target with:

_this enableSimulation true;
_this allowDamage true;
_this animate ["Terc",0];
_this removeAllEventHandlers "Hit";
_this removeAllEventHandlers "HitPart";
_this addEventHandler ["HitPart", ARM_Events_fnc_shootingRangeShot];
lone glade
#

removing EHs may not be a good idea ๐Ÿ˜›

cosmic kettle
#

It's because the default hit evh makes them pop up. I guess I could include that part into the shootingRangeShot.

lone glade
#

you tried using setDamage instead of animate btw ?

cosmic kettle
#

I have not. Also a good suggestion to try out.

lone glade
#

1 to down them, 0 to pop them back up

cosmic kettle
#

I'll give both animateSource and setDamage a try.

#

Still, this is very intriguing.

#

I tried BIS's MP mission where they employ these targets, they don't even seem to be able to do it...

lone glade
#

if you still can't fix it, replace the hitPart EH at a config level

cosmic kettle
#

@lone glade from BIS scripts:

// --- drop target
_target animate ["Terc", 1]; 
#

Clueless me lol

meager heart
#

This way its not working ? [_target] remoteExec ["ARM_Events_fnc_collapseTargetGlobal", _target];

#

i mean if you set _target as "target" for remoteExec

cosmic kettle
#

Nah, _target is actually the target dummy and has to be broadcasted globally.
I did notice though that BI went for execVM:

hitPart = "[(_this select 0)] execVM '\A3\Structures_F\Training\data\scripts\TargetP_Inf_F_hitPart.sqf';";
#

is there a specific difference between execVM and remoteExec that I don't know about? I though the latter was advised now?

meager heart
#

remoteExec - Asks server to execute given scripted function or script command on given target PC

cosmic kettle
#

yeah from what I know:

[] remoteExec ["something", -2];

==

{
 [] execVM "something.sqf";
} forEach playableUnits;

I'm not new to scripting, just this specific problem is just not making any sense.

meager heart
#

-2 means execute on every client but not on the server

cosmic kettle
#

yup

#

so does playableunits as server aint in there

meager heart
#

forEach playableUnits < local host is server and playable unit same time

cosmic kettle
#

I know, we're strictly talking MP dedi here as everything works flawlessly in SP

#

which is even more frustrating...

#

even in MP dedi all works fine for the target owner.

#

I'm just trying to make it so spectators also enjoy the game, which seems like such easy task, but yet so unreachable.

meager heart
#

did you tested this ? > [_target] remoteExec ["ARM_Events_fnc_collapseTargetGlobal", _target];

cosmic kettle
#

Scrapping the 'specators' aspect' would mean the project would have taken <1 day. It's been going for + a week lol

#

I haven't, wouldn't this just execute it on the owner?

meager heart
#

exactly

#

isn't that what you need ?

cosmic kettle
#

I am taking the remoteExec approach as I want it to work on other, non-owner clients.

#

locally all works fine, collapseTargetGlobal is just me trying to hack in the ***** targets dropping on other clients.

#

can one animate remote objects?

#

because all ARM_Events_fnc_collapseTargetGlobal does is:

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

_target setVariable ["BIS_poppingEnabled", false];
_target animate ["Terc", 1];
#

No magic here

#

and this is legit not working

#

Well it only works on owner.

#

So to answer your question, I don't think so.

#

I might lack some understanding of remoteExec though, never claimed to be an expert...

meager heart
#

ok then...

#
[_target] remoteExec ["ARM_Events_fnc_collapseTargetGlobal", ([_target,-2] select (isMultiplayer && isDedicated))]; //--- works everywhere, local host,dedicated,single....
cosmic kettle
#

care to explain that wizardry? ^^ will try it right away.

meager heart
#

if dedicated, remoteExec target is _target, if mp host/local host -2...

cosmic kettle
#

hmm, will give it a try :)
The only thing that's bothering me is shouldn't animate work for all clients if executed on one?

#

because I am actually doing all of this remoteExec stuff because when animating the object on shooter (owner) it doesn't sync for none of the other players.

meager heart
#

thats why -2

#

test it

cosmic kettle
#

yeah, won't be able to report back immediately though, will have to start up me laptop as there is 0 people to test at 4am lol ๐Ÿ˜ƒ

meager heart
#

np... you don't have to, hope i helped you somehow ๐Ÿ‘Œ

cosmic kettle
#

Oh don't get me wrong, I appreciate everyone taking the time to even respond. My thanks sir.

meager heart
#

have fan ๐Ÿป

cosmic kettle
#

Oh maybe one last question, why remoteExec and not remoteExecCall?

#

I'm actually using the latter atm, the reasoning behind it being I want 'prioritized' remote execution.

meager heart
#
remoteExec
Content of MP message sent by remoteExec command is executed on target machine in scheduled environment and as such abides to the same rules and limitations as other scheduled code.

If you want to execute more complex code that needs to be processed as separate spawn use remoteExec command.

More specifically:

If your code includes any delays (commands like sleep or waitUntil) you MUST use remoteExec.
If your code contains more CPU demanding operations that will take some time for the game to process, you SHOULD use remoteExec, otherwise you might experience performance drops.

remoteExecCall
Unlike remoteExec, MP messages send by remoteExecCall command are executed sequentially outside of the scheduled environment. This makes the remoteExecCall command very useful, if you need to to execute multiple codes/commands in a set sequence.

The code sent by remoteExecCall MUST NOT contain any delays and SHOULD NOT be too complex and CPU demanding.
``` edited
cosmic kettle
#

Yeah, so it should in theory wait untill the call is finished?

#

oh no

#

why does it exist then?

#

just for scheduled/unscheduled difference?

meager heart
#

That's probably question to bis ๐Ÿ˜„

cosmic kettle
#

I guess it's good that that misconception is out of the way.

#

again, thanks. ๐Ÿ˜ƒ

#

once this works, next up will be MP compatible sliding targets, vectortransform looks promising.

meager heart
#

gl with that ๐Ÿ˜€

cosmic kettle
#

Anyway, the provided works in SP, so now for MP compat, but I am not really hoping on it tbh haha

cerulean whale
#

How does one cancel a gesture he is in?

#

tried switchmove "" but it doesn't work

cosmic kettle
#

what exact command are you trying?

#
[_unit, ""] remoteExec ["switchMove", 0];
sullen willow
#

If I were to use
bomb="M_Mo_82mm_AT_LG" createVehicle (getPos player);
on my multiplayer game will it just detonate on the person calling the script or will it detonate every player on the server?

peak plover
#

How do you call it?

sullen willow
#

This addaction ["Detonate","bomb.sqf"];

on the playable character init

peak plover
#

Another player can look at the player who is (this) and detonate him

#

do

if (!local this) exitWith {};
this addAction ["Detonate","bomb.sqf"];
sullen willow
#

Lmaooooo

peak plover
#

Means anyone who does not own that unit / not playing as it, will exit with nothing

sullen willow
#

That actually sounds pretty hilarious, not going to lie.

#

I might just leave it in that case

peak plover
#

haha ๐Ÿ˜„

sullen willow
#

"Oh is that a suicide bomber?"

#

runs up and pulls the cord

peak plover
#

You should then probably look into the extra parameters for the addAction and make the distance smaller

#

default distance might be too big

#

Yeah, that's hilarious ๐Ÿ˜„

warm hedge
#

Is there anyway to show light flare while noon?

#

Ah nevermind, it can't be

#

๐Ÿ˜ฆ

peak plover
#

In theory

warm hedge
peak plover
#

You could create a light and try setLightDayLight

#

It's not really a flare

#

But a possible alternative

warm hedge
#

Nah, I don't need a true light

#

Cuz I want to create a reflection light by a scope effect

meager heart
#

scope glint effect ?

warm hedge
#

Ya

#

Like BF4 or something, it might be a nice effect but it is impossible

meager heart
#

check forum there is couple threads about it

long gazelle
#

Oh mighty community, I be needing of your wisdom..
So I'm trying to create an eventHandler on my PopUp Target that when hit it will display a message "HIT". But I don't seem to get the line right, either it gives me and error or it doesn't do anything.. And the wiki sites aren't explaining anything to me..

still forum
#

@eager prawn I prefer not to talk to humans.
HDD recovery is at 48% I got 18% done yesterday.

peak plover
#

damn

#

How long will it take total?

#

Never had a broken HDD like that

still forum
#

Since I noticed #offtopic_hardware yesterday. 2-3 days. But.. Drive seems compleltly dead today. So probably not gonna make progress

peak plover
#

๐Ÿ˜ฆ

#

Darn cosmic rays

still forum
#

And it's back online. Thanks cosmic rays ๐Ÿ˜„

#

Also never had a broken HDD like that. I like that learning of new stuff.
I read the ATA protocol documentation to find out what's wrong and thus I learned I had to disable SMART because that kills the drive somehow.

quartz coyote
#

Hello.
With @warm gorge we scripted a way of synchronising every player to the Camera Intro and to the spawn. It works perfectly well on some missions but on some I have players not getting the Intro synch although the rest of the player are... Here it goes :

initPlayerLocal :

player setVariable ["loaded",true,true];

if (isNil "Intro_Start") then {
    Intro_Start = false;
};

waitUntil {Intro_Start};

if (isNil "Intro_Passed") then {
    Intro_Passed = false;
};

if (!Intro_Passed) then {
    [] spawn dm_fnc_CameraIntro;
};```

initServer : 
```SQF
while {true} do {
    private _units = playableUnits;
    private _unitsDone = {_x getVariable ["loaded", false]} count _units;
    if (_unitsDone isEqualTo (count _units)) exitWith {};
    sleep 1;
};

Intro_Start = true;
publicVariable "Intro_Start";

while {true} do {
    private _units = playableUnits;
    private _unitsDone = {_x getVariable ["introDone", false]} count _units;
    if (_unitsDone isEqualTo (count _units)) exitWith {};
    sleep 1;
};

Intro_Passed = true;
publicVariable "Intro_Passed";```

CameraIntro :
```SQF
player setVariable ["introDone",true,true];```
lone glade
#

DO NOT FUCKING SUSPEND INIT SCRIPTS

#

JESUS

#

how many goddamn times will I have to repeat that

quartz coyote
#

For some reason, some players don't get checked by the "Loaded" var script but they do on "IntroDone"

#

perhaps with a

if (isNil "loaded") then
{
    player setVariable ["loaded",true,true];
};```
???
#

But I don't think so ...

kindred lichen
#

Hey, does anyone know if an after action report mod?

#

Something that captures player and ai actions, then let's is replay it after. We've seen one by Arma Finland that was really good. It rendered the actions on a map, let you follow specific players or just scroll around the mall while the mission played out.

astral tendon
#

so, isNil variable needs to be in "", but how do i put a variable in there?
like "[units playersgroup select 1]"

unborn ether
#

@astral tendon Yes, like isNil "units playersgroup select 1" but anyways better check before select.

astral tendon
#

that will not work because "units playersgroup select 0" will return "units playersgroup select 0"

lone glade
#

you can use isNil with a code block

astral tendon
#

how?

lone glade
#

well, (isNil {code})

astral tendon
#

That will do it, thanks.

subtle ore
#
if(isNil "string") then {};
//or
if(isNil {}) then {};
astral tendon
#

but that give me a error about zero divisor

#

though is return a bool in the debug console

subtle ore
#

Can you post the full code please?

#

I just tested both lines in which I just posted, all work just fine. Not sure what you're doing wrong.

astral tendon
#
if (!isnil {units playersslots select 3}) then {units playersslots select 3 setpos getpos Cut_player_Possition_4; units playersslots select 3 setDir getDir Cut_Food_guy};
#

the 4ยฐ unit does not exist

unborn ether
#

Goes for Error: Zero Divisor?

astral tendon
#

playersslots is the players squad

#

yup, that one

subtle ore
#
private _grp = units playersslots select 3;
if (!isnil {_grp}) then 
{
  _grp setpos getpos Cut_player_Possition_4; 
  _grp setDir getDir Cut_Food_guy;
};
#

So, I don't necessarily see anything incorrect, what does units playersslots select 3 return?

astral tendon
#

nothing because there is no 4ยฐ player

unborn ether
#

Better check it via string syntax.

astral tendon
#

only me in the group that i am the select 0

unborn ether
#

anyways, its even better to use count to know what size of array you do have.

astral tendon
#

also, AI is disabled

subtle ore
#
if(count units _grp > 3) exitWith
{
  hintSilent "More than 3";
};

etc

astral tendon
#

i see

#
if (count [units playersslots] == 1) then {units playersslots select 0 setpos getpos Cut_player_Possition_1; units playersslots select 0 setDir 247.344};
if (count [units playersslots] == 2) then {units playersslots select 1 setpos getpos Cut_player_Possition_2; units playersslots select 1 setDir 247.344};
if (count [units playersslots] == 3) then {units playersslots select 2 setpos getpos Cut_player_Possition_3; units playersslots select 2 setDir 247.344};
if (count [units playersslots] == 4) then {units playersslots select 3 setpos getpos Cut_player_Possition_4; units playersslots select 3 setDir 247.344};
#

any huge diference to == and > ?

subtle ore
#

YES?

unborn ether
#

@astral tendon

private _array = [0,1,2,3,4,5];
private _lastIndex = count _array - 1;
private _lastElement = _array select _lastIndex;
#

This is what you probably look for

subtle ore
#

== isEqualTo , > is greater than right param

unborn ether
#

This returns you size, last index, and element together.

astral tendon
#

I see, i suppuse that the result is the same for that right?

subtle ore
astral tendon
#

Thanks for the help.

unborn ether
#

@astral tendon

private _array = [units playersslots];
if (count _array == 0) exitWith {};
private _pos = getpos Cut_player_Possition_1;

for "_x" from 0 to (count _array - 1) do {
    private _unit = units playersslots select _x;
    _unit setpos _pos;
    _unit setDir 247.344;
};
tough abyss
#

Anyone know of a way to detect if something is within a certain radius of your cursor?

#

Would like to display name tags of friendlies within that zone, but not everyone on screen. Don't want a clutter on the screen.

indigo snow
#

youll need to wrestle with worldToScreen and the related commands

tough abyss
#

Ya. Likely not too performance friendly to be constantly calculating that on every frame

subtle ore
#

why on every frame?

tough abyss
#

Well, for name tags on players within that zone

#

I'm using cursor to see if they are aiming at them to display it but if you are in a vehicle or sniping you likely won't be looking directly at them every time.

#

So it isn't showing up and causing friendly fire cases

#

It's not using oneachframe, but rather a loop and drawIcon3D

river meteor
tough abyss
#

It has a 15m limit, unfortunately

#

I'll play with the world to screen method when I have some free time. Thanks cptnnick

noble pond
#

im sure its perfectly possible to calculate it every frame

#

stressing out over every little bit of performance isn't worth the effort

#

and it won't save you anything anyways once the bullets start flying

tough abyss
#

Ya, will have to do some testing, see what works well and what doesn't.

vivid locust
#

Is there a way to scale a display without remaking it completly. I know there is this option:
https://community.bistudio.com/wiki/ctrlSetScale
But that's pretty nasty because the left upper corner remains the same position. I have a display with like 30 elements, is there no way to scale it?

peak plover
#

put it in a ctrl group?

#

not sure if that's what you mean

#

But then you can resize the ctrl group

vivid locust
#

How would you do that?

peak plover
#

the ctrls are children to the ctrl group

vivid locust
#

That ArmA 3 only I guess, I am still developing for ArmA 2 ๐Ÿ˜‹

shadow sapphire
#

What're you working on for Arma 2?

lone glade
#

scaling is done engine side, use safezone + pixelGrid values

vivid locust
#

It's already done with safezones but if users don't like the display's size, it would be cool to have an option to make it smaller

lone glade
#

then you'll need to use ctrlSetPosition and resize all your controls

shadow sapphire
#

Oh, gotcha!

vivid locust
#

Oh man, that sucks. But thanks for the fast replies.

drowsy axle
#

Anyone good with ACE?

#

I'm unable to get switchunits to work.

austere granite
#

What's besrt way to check if someone has apex now?

#

Someone that odesn't have it wanna check (isDLCAvailable 395180) if it's false in-game? ๐Ÿ˜„

subtle ore
#

@Adanteh#0761 Returns true from me (because I'm a cool kid and I pre ordered apex ๐Ÿ˜Ž )

#
//add default spawn position for west
[west,[2071.34,3435.72,0],"BLUFOR Base"] call BIS_fnc_addRespawnPosition;
//add default spawn position for east
[east,[11751.7,3155.33,0],"OPFOR Base"] call BIS_fnc_addRespawnPosition;
[missionNamespace,"ownerChanged",
{
  params["_sector","_owner","_oldOwner"];
  diag_log format["[SECTOR MANAGER]: Sector: %1 changed to owner: %2 from : %3",_sector,_owner,_oldOwner];
  switch _sector do
  {
    case sector_a:
    {
      if(_owner == west) then
      {
        if(_eastAlpha > -1) then
        {
          [east,_eastAlpha] call BIS_fnc_removeRespawnPosition;
        };
        private _westAlpha = [west,[5532.95,2152.66,0],"Alpha"] call BIS_fnc_addRespawnPosition;
      };
      if(_owner == east) then
      {
        if(_westAlpha > -1) then
        {
          [west,_westAlpha] call BIs_fnc_removeRespawnPosition;
        };
        private _eastAlpha = [east,[5532.95,2152.66,0],"Alpha"] call BIs_fnc_addRespawnPosition;
      };
    };
  };
}] call BIS_fnc_addScriptedEventHandler;

Any reason why the scripted event handler won't even fire?

#

Wait a nevermind facepalm

#

Found the problem, need to feed the sector to the scriptedEventHandler, I thought it just applied to any changes anywhere

weak obsidian
#

It's getting late and I'm horribly out of ideas . to check if a trigger fired, we have triggeractivated, to check if a waypoint fired we have ... what? If waypoint fires it returns true - but how do I check it? Using the handle of the waypoint as Bool?

#

sth like waituntil {_wpDone};

knotty mantle
#

You can do stuff on activation of that waypoint. for example set a variable that switches to true when it is done.

weak obsidian
#

hm. ok - but only global vars?

#

Just putting it in the waypoint statement seems so ... cludgy somehow ๐Ÿ˜„

meager heart
#

What's besrt way to check if someone has apex now?
(isClass (configfile >> "CfgPatches" >> "A3_Map_Tanoabuka") ?

subtle ore
meager heart
#

yep should work

obtuse cosmos
#

Okay... Anyone used with command?

#

When I call a function in there, it returns undefined variable

peak plover
#

make sure you get the variable from the namespace you do it in

obtuse cosmos
#
with uiNamespace do
{
    [] spawn
    {
        for "_i" from 1 to 1 do
        {
            [] call Haz_fnc_populateGroupList;
            sleep 1.25;
        };
    };
};
#

do I need the for loop btw?

#

Does it automatically loop without it?

peak plover
#

what uhh

obtuse cosmos
#

Maybe I have misunderstood "with" command?

peak plover
#

Why do you even have to run this on uinamespace?

obtuse cosmos
#

Should I use regular while-loo? Basically what i want to do is update the dialog, it will refresh the listbox, etc... instead of having to re-open it or press refresh button

#

I think I misunderstood what "with" does

#

I guess I will just use while-loop and terminate it when dialog closes?

#
while {(uiNamespace getVariable "disp_groupManagement")} do
{
    [] call Haz_fnc_populateGroupList;
    sleep 1.25;
};
peak plover
#

I really don't see why not

obtuse cosmos
#

ah wait, that doesn't return BOOL

#

so when does one use with command instead of other?

peak plover
#

I guess if you run script in a different namespace than mission

obtuse cosmos
#

rgr - I'll just use the above with dialog command

fleet parcel
#

Is there a standardized method for versioning? I'm not particularly bothered by manually versioning, but i'd prefer to use some automated versioning method if it exists :S

rotund cypress
#

Using with is not like how it is in other languages in SQF. with just lets you access the variables in that namespace.

#

And if you are populating a list (which I am assuming you are) you donโ€™t need a loop. Just add an eventhandler calling a function on the onLoad event (a function that populates the list). Then if you want to update the list (assuming some group thing) add a eachFrame eventhandler, keep populating the list in there and then use onUnload event to remove the eventhandler again.

#

@obtuse cosmos ^

lone glade
#

@obtuse cosmos use events, related to what you're filling the list with, don't update it at regular intervals unless you have no other options

rotund cypress
#

@fleet parcel what do you mean? Versioning of your mission?

#

Use git and then use releases

lone glade
#

semantic versioning is what most of the arma community (which uses versioning, so not many) uses

obtuse cosmos
#

atm

#

I have this:

#
    while {(dialog)} do
    {
        [] call Haz_fnc_populateGroupList;
        sleep 0.5;
    };
#

I assumed this would be better than calling it all on open dialogs across network after someone pressed create group button

rotund cypress
#

No

#

It will only do something over the network if you tell it to

obtuse cosmos
#

@rotund cypress I have... I need to keep updating it

#

While it is open

rotund cypress
#

EachFrame handler

obtuse cosmos
#

To show newly created groups that were done while the dialog was open

rotund cypress
#

Yeah

obtuse cosmos
#

@rotund cypress Why would I use EachFrame?

rotund cypress
#

Create a onEachFrame on creation

#

While loops require a running thread

#

Which is ehm, hmm

obtuse cosmos
#

Yeah but it only runs while the dialog is open

rotund cypress
#

So can onEachFrame

obtuse cosmos
#

Any major difference between the two?

#

For this case

rotund cypress
#

onEachFrame will be far more reliable

#

And accurate

#

Always use onEachFrame/draw when updating UI

obtuse cosmos
#

Alright, will check it out, I've never used EachFrame for dialogs but I'll try

#

only for HUD (player tags)

#

force player view, will try, thanks

rotund cypress
#

Not sure why playertags would be in a dialog or hud

#

Should be drawIcon3D

obtuse cosmos
#

yes

#

but I use EachFrame with draw3D

#

is what I meant

#

You see player tags on the HUD ๐Ÿ˜›

#

Sorry, didn't realise I had to be so literal for you

rotund cypress
#

Use draw3D instead of onEachFrame if you are using drawIcon3D

#

Still runs on each frame

#

But its designed for that purpose

obtuse cosmos
#

I use drawIcon for map

#

I use drawIcon3D in EachFrame for player tags

#

anyway, I'm not on about this anyway, issue was with dialog

#

heading out now, back later

still forum
#

To the checking to see who is about in the aim direction for the Nametag thingy.
You can also use math instead of randomly trying to hit something with screenToWorld.
You have eyePos and cameraViewDirection.
Get all players in 50m or whatever distance using nearestObjects. Then math if they are in the camera view cone.

meager heart
#

BIS_fnc_inAngleSector ?

#

With small angle values

lone glade
#

dude

#

the func is just:

#include "..\paramsCheck.inc"
#define arr [[],0,0,[]]
paramsCheck(_this,isEqualTypeParams,arr)
params ["_center", "_dir", "_sector", "_pos"];

private _dirTo = _center getDir _pos;
acos ([sin _dir, cos _dir, 0] vectorCos [sin _dirTo, cos _dirTo, 0]) <= _sector/2
#

ohgod, what have I found, theshit

meager heart
#

๐Ÿ˜„

lone glade
#

#define paramsCheck(input,method,template) if !(input method template) exitWith {[input, #method, template] call (missionNamespace getVariable "BIS_fnc_errorParamsType")};

#

wat

#

thefuck

#

optimised by Killzone_Kid

#

did he leave that there or did he add it himself...

still forum
#

I'll give you 0 chances to guess

lone glade
#

tfw you get commands like isEqualTypeParams but not a case insensitive arrayIntersect ๐Ÿ˜ญ

still forum
#

Don't actually know why they made that case sensitive...

#

Strings are by default case insensitive in engine

meager heart
#

find and in also

still forum
#

๐Ÿ˜ฎ intercept cba doesn't have arrayIntersectCI ๐Ÿ˜ฎ Only findCI and inCI WHAIII?

peak plover
#

Hey @still forum
How much data is sending an array containing 100 units over the network?
compared to
How much data is sending an array of 100 strings containing vehicleVarNames over the network?
?

still forum
#

a unit is one integer

lone glade
#

about the same

still forum
#

Stop lying

#

Go away

lone glade
#

shhhh

still forum
#

A unit is one compressed integer. Which compresses down to 1 byte < 255 and 2 bytes < 16k smth

#

So if your var names are all just one character long.. The names are still less efficient

peak plover
#

Okay

#

So 1-2 bytes per units?

still forum
#

naaaaaaaahhhh..... Kindaaaaaaa

#

1-2 bytes + overhead

#

instead of stringlength+1 + overhead

peak plover
#

Okay thanks

#

So in theory sending array of 3 units is cheaper than sending position to 1 unit

still forum
#

yes

peak plover
#

mucho good

#

I see the light in the end of the tunnel for clienside cachin

still forum
#

Pfft... Intercept.

#

Gzip compressed json over network and you're golden

peak plover
#

hmm

#

Silly question

#

Can I send a variable that's ```sqf
player setVariable ['myVar',true];

only to server?
still forum
#

Silly answer

#

publicVariableServ..... oh

#

remoteExec setVariable?

peak plover
#

๐Ÿค”

tough abyss
#

To be fair that feature was added in the dev branch at one point, never made it to stable

lone glade
#

what did?

tough abyss
#

setVariable beening broadcasted to only certain clients/server

barren magnet
#

It's documented as working on the biki though if I remember it correctly

still forum
#

Uh.. Never noticed that. Yeah. It's right there

peak plover
#

Hmm

unborn ether
#

Never knew that setVariable 3rd arg acts like JIP-arg. ๐Ÿ˜

lone glade
#

it doesn't

#

well, it does but it's not specifically for JIP

long gazelle
#

Can someone help me with an EvenHandler problem?

peak plover
#

post problem

vivid locust
#

When having a display element which has a defined width and height, could you use these values for the position aswell?
Let's say

w = 0.5;
h = 0.5;
x = 1 / w;
y = 1 / h;

Would that work?

long gazelle
#

I'm trying to have a PopUp Target to have an EH that when "Hit" will change myTUC by -1.
I'm been trying this code so far:

this addEventHandler ["HIT",  myTUC - 1]
lone glade
#

no relentless, that's stupid

#

even if you use macros for those values, that' still stupid

vivid locust
#

These are example values, why would this be stupid

lone glade
#

because the X and Y pos are different values

vivid locust
#

That's why I just said it's an example ๐Ÿ™„

peak plover
lone glade
#

the example isn't the issue, it's the intent behind it

vivid locust
#

Do you remember my question whether you can scale a control group? That's why I want to use it, I just want to know if it's possible or not.

lone glade
#

ooooh, well, use macros

peak plover
#

Yeah macros

vivid locust
#

Dude, answer my question please

#

I know macros but are you able to use values that are defined in the class itself

peak plover
#

you x and y are undefined you can't use them

lone glade
#

you can't "use" them in configs (x and y config entries)

vivid locust
#

That's what I wanted to know, nothing else. Thank you

jade abyss
lone glade
#

use a set of macros that do what you want

#

also, just to be on the safe side, DO NOT use "absolute" screen values like you did in your example.

#

never

vivid locust
#

Wtf alganthe

lone glade
#

use safezone and pixelGrid

long gazelle
#

@peak plover I've read that article and puttin {} around myTUC - 1 didn't work.

vivid locust
#

EXAMPLE VALUES

lone glade
#

just to be on the safe side

#

is this a markov chain bot that got lost ?

jade abyss
#

@vivid locust With "scaling" do you mean smth like: "my UI will have always the same size, no matter if the Res is 800x600 or 1900x1080)?"?

vivid locust
#

No

#

I know how to do that, you should know that lol

jade abyss
#

Then what do you mean.

#

Just say precisly what you wanna know =}

vivid locust
#

I always use safezones but since there is no option to scale a display, I want to use a macro like

define scalevalue 1

You could use that on width and height but not on x and y
The issue is that players want my display smaller and I want to give them the oppertunity to scale it.

#
class whatever {
    w = 1 * scalevalue;
    h = 0.5 * scalevalue;
    x = 0.5;
    y = 0.5;
}

Here's the problem, you can't use that scalevalue with x and y positions. You would need a lot of math.

jade abyss
#

thinkingsherlock By config: Nope. Since: When it's packed -> all macros will be "exchanged" with absolute values (e.g. "define bla 2*2" -> "4")

lone glade
#

yes there is

#

THERE IS AN OPTION TO SCALE DISPLAYS

vivid locust
#

It's more like giving the user the instructions "if you want the whole display smaller change the scalevalue to whatever you prefer, e.g. 0.5 would be half the size"

lone glade
#

IT'S CALLED THE UI SIZE GODDAMNIT

#

trigerring intensifies

jade abyss
#

Alganthe, sshhhttt for a sec

vivid locust
#

Wow, are you seriously saying that?

#

alganthe do you think everyone is stupid?

jade abyss
#

What you mean is only doable by Scripting.

#

Relentless, 95% of the questions come from idiots who know nothing ๐Ÿ˜„

long gazelle
#

Lord oh MAKER will you two go somewhere else to argue?

peak plover
lone glade
#

not even needed

#

just give them IDCs

jade abyss
#

@long gazelle No, thats what this Channel is for.

vivid locust
#

You said that yesterday already nigel, but control groups are not avilable in arma 2

jade abyss
#

What nigel wrote

lone glade
#

give them IDCs and use ctrlSetPosition

jade abyss
#

ah, you are still stuck in A2? ๐Ÿ˜„

long gazelle
#

For helping, that looks like childish argueing..

vivid locust
#

A2 > A3

peak plover
#

Abel do you get error btw

jade abyss
#

Meh, no, Rel.

long gazelle
#

No... I did previously but not anymore, no nothing happens..

peak plover
#
cursorObject addEventHandler ["HIT",  {systemChat '1'}]
jade abyss
#

The lack of ScriptCommands would kill me in A2 ๐Ÿ˜„

peak plover
#

Works on my machine

#

btw

#

is your variable defined

vivid locust
#

Personal preferences. Whatever, since i have so many elements in my display ctrlSetPosition is kinda hard to do because resizing will result in different positions and different distances between the elements

jade abyss
#

@vivid locust also: ctrlSetPosition should work in A2 thinkingsherlock

#

Yeah, use the ... safezone stuff for that

#

and some math

peak plover
#

use ```sqf
_count = missionNamespace getVariable ['nig_counter',0];
missionNamespace setVariable ['nig_counter',(_count + 1)];

lone glade
#

.... nice tag nigel huehuehue

long gazelle
#

Yes, it is set to 0 in another .sqf file that starts when I load the game.

peak plover
#

getvariable wih a default value to make sure the avriable exists

vivid locust
#

meeeh, math... I knew that would be the only solution.

peak plover
#

replace the blah + 1 with systemchat '1';

jade abyss
#

@lone glade Yeah, he don't want to change that tag^^

peak plover
#

see if it's EH fault

long gazelle
#

Hold one.

jade abyss
#

@vivid locust thats Armalife ๐Ÿ˜„ ยฏ_(ใƒ„)_/ยฏ

peak plover
#

@jade abyss it's standard operation protocol to use first 3 letters ๐Ÿ™„

jade abyss
#

But... NIG ?

#

Rly?

#

+Nobody forces you to use just the first 3

#

thats more or less just the "minimum"

long gazelle
#

Didn't get response.. No systemChat message displayed..

unborn ether
#

nig_hears ๐Ÿ˜

peak plover
#

๐Ÿคท

#

Something like that for ai script im working on ^

long gazelle
#

This is the exact code in the popup target Init:

this addEventHandler ["HIT", {systemChat "1"}]
#

Can an object have more than one EH?

lone glade
#

those are stackable

jade abyss
#

Yes

lone glade
#

try hitPart

peak plover
#

^

long gazelle
#

So it's not that..

peak plover
#

I think hit only runs when you do enough damage

#

Like shooting a tank with pistol won't trigger it

long gazelle
#

So replace "HIT" with "hitPart"?

jade abyss
#

Why not HandleDamage? (haven't followed the whole convo)

peak plover
#

gib it a go

lone glade
#

yes

unborn ether
#

HandleDamage?

lone glade
#

no dscha, no

peak plover
#

handleDamage ๐Ÿ‘

lone glade
#

handleDamage is:

  • Not stackable
  • Get spammed
  • It's awful
long gazelle
#

YES!

jade abyss
#

Not Stackable?! oO

unborn ether
#

Its stackable

long gazelle
#

Got a response!

jade abyss
#

dafork?

unborn ether
#

The only thing

lone glade
#

only the last returned value is used

#

so it's stackable in theory, in practice it's useless to stack em'

unborn ether
#

HandleDamage will only return the last damage value to the engine, if it does so.

long gazelle
#

hitPart worked.... I'm gonna try it with the variable now.

unborn ether
#

But all the script is stackable

jade abyss
#

Of course, the last one will be used facepalm

#

But it IS Stackable.

unborn ether
#

^

jade abyss
#

+Gets spammed = Yeah, just like any other EH ยฏ_(ใƒ„)_/ยฏ

lone glade
#

no

jade abyss
#

Yes

lone glade
#

handleDamage also trigger on damage propagation

jade abyss
#

Yeah, to receive a precise Information

unborn ether
#

The thing is it triggers, while Hit and HitPart gives no fuck sometimes

jade abyss
#

Anyway: What does he want to do with it anyway?

peak plover
#

shoot targets

#

And add or remove number

jade abyss
#

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

long gazelle
#

I'm making a target range that pops up targets as you move through it, in addition it having a timer and counting how many targets stayed up after clearing course.

#

Though adding that same bit of code to every target individually is a pain so I'm embedding it withing another code now that I know it works...

unborn ether
#

@long gazelle Btw you should have some specific selections|hitpoints to hit.

#

If you are talking about shooting range targets, like HandleDamage|Hit|HitPart will trigger on any hit, then you should decide what to do with that.

long gazelle
#

Sounds fun. ๐Ÿ˜„ But for now I'm just glad if they go down from one hit.. Maybe later make a harder course with headshots only. ๐Ÿ˜„

#

Awesome possum! It works!

#

Thanks guys. Again.

unborn ether
#

Well, then HandleDamage|HitPart is definitely what you need, as Hit only indicates a hit whatever selection it hits.

subtle ore
#
player addEventHandler["HandleDamage"
{
    if(name player == "Dscha") then 
    {
        0
        //no.dmg
    };
}];
#

Double posting is against the #rules. @stable reef

lone glade
#

ask the person who made it?

abstract narwhal
#

where do i chat?

long gazelle
#

So if I wanted to find out the hitParts of and object, how would I make and eventhandler that displayed the part hit in sysChat?

tough abyss
#

It has it right in the description of the video you posted lol

lone glade
#

abel, check the params passed by the EH on the wiki

inner swallow
long gazelle
lone glade
#

yep

long gazelle
#

Yeah I'm gonna need a translator on this..

lone glade
subtle ore
#

Someone should make sqf 101. So that things like basic passed parameters and execution aren't of confusion

inner swallow
#

Hopefully it's inherently more sensible with enfusion/enscript ๐Ÿ˜„

long gazelle
#

alganthe, how do I get these to display in syschat?

subtle ore
#

Maybe

#

systemChat str _this

long gazelle
#

I was talking about the hitPart

jade abyss
#

systemChat str [_this] <-

lone glade
#

no dscha

#

doesn't change anything ๐Ÿ˜„

jade abyss
#

Because: If _this is empty -> nothing would show up

#

shaddap Frenchy

subtle ore
#

Cut me some slack Dscha

lone glade
#

no bulli

jade abyss
#

Yes!

#

Nah, wasn't wrong what you said.

#

tbh, Commy mentioned that a few weeks ago, haven't used it before either ๐Ÿ˜„

lone glade
#

@long gazelle the selection is index 5

subtle ore
#

No i understand

#

Makes sense

jade abyss
#

Yep

lone glade
#

use select or params to get it

jade abyss
#

Something usefull from macrommy2 ๐Ÿ˜„

lone glade
#

RUN THE FURRY IS HERE

jade abyss
#

OH GAWD

still forum
#

I prefer to use strings for eventhandlers because that will people show how dumb that thing they are doing really is

#

When they notice how hard it is to have strings in their code

subtle ore
#

Such an evil furry at that

still forum
#

You want some pizza?!!!

jade abyss
subtle ore
#

Pizza? Pineapple pizza?

still forum
#

furrypizza

subtle ore
jade abyss
still forum
#

What did you expect?

jade abyss
#

Yeah... i should have known

subtle ore
#

Nothing short of

long gazelle
#

What I wrote:

this addEventHandler ["hitPart", {systemChat (_this select 5)}]

What I got:

Error: Zero divisor
lone glade
#

systemchat needs a string

jade abyss
#

this addEventHandler ["hitPart", {systemChat str (_this select 5)}]

#

str = make the stuff a string

long gazelle
#

Ok..

jade abyss
#

str [] = "[]"

#

etc

long gazelle
#

Same error.

still forum
#

Was gonna say

#

not giving a string doesn't give a zero divisor error gurls

lone glade
#

yeah, having an array too short does

long gazelle
#

So...

jade abyss
#

Does hitPart even has a 6. entry?

long gazelle
#

11

subtle ore
#

Gross, init boxes

jade abyss
#

Then try systemchat str _this; first

lone glade
#

nah, found why

#

it's an array of arrays

#

this addEventHandler ["hitpart", {systemChat str ((_this select 0) select 5)}]

#

there.

subtle ore
#

Gross

long gazelle
#

So it be a "target" no matter where I shot it.. I'm gonna be needing the position coordinates..

#

And this time its an array in array in array...

lone glade
#

more select / params

long gazelle
#

Arraying intesifies..

lone glade
#

i'm fairly sure you can't beat me at that

subtle ore
#

What about those targets with the bullseye targets on the front?

long gazelle
#

Oh I know I can't..

subtle ore
#

BI used it as a marksman bonus

long gazelle
#

I'm not using them..

subtle ore
#

So it's possible it has some hit selection

long gazelle
#

Okay, so I have center xyz position of my target and 0.095 range (approximate radius of the head.) How would I go about determining with EH that the event will happen only if hit withing this radius?

fossil yew
#

but there is no radius in there

long gazelle
#

No that won't work.. I need it to react when "HIT" not when someone fires a weapon 3km out.

lone glade
#

hitPart has a radius param

long gazelle
#

Yeah but that radius returns the radius of the entire object. My desired radius is a whole lot smaller.

lone glade
#

no, it's of the part being hit

long gazelle
#

Which is much larger than my desired radius.

fossil yew
#

Simple question - what are you trying to achieve?

#

Maybe there is another way to do it?

long gazelle
#

To be the OverLord of the universe?

fossil yew
#

sorry I see this thread is running for some time

long gazelle
#

Hold on, trying to make a picture explanation of what I'm trying to achieve.

fossil yew
#

oh don't waste your time

long gazelle
#

Well... I'm stubborn.

young current
#

hitpart returns imapct position right?

#

you calcutlate the area you want to be hit and compare to the impact point

long gazelle
#

Can it be set with an margin of error?

young current
#

for that youll need a point on the model (or coordinates)

long gazelle
#

I have a center point.

young current
#

of the model?

#

no you need coordinates around the head area

#

that you translate into world coordinates

#

and calcualte a sphere of desired radius around

#

and then compare the hit coordinates to that

#

modelToWorld will likely be needed

long gazelle
#

I give up...

young current
#

the modelspace coordinate you will need to figure out

long gazelle
#

This just got harder then it's worth.

#

I'll get back to this after a year or so..

young current
#

could like attach some stuff on 0,0,0 and then start moving it around

#

๐Ÿ˜›

#

actually anothe way is to calculate the are you dont want to be hit

cosmic kettle
#

@long gazelle
Use hitPart position, reference with target using ModelToWorld?

this addEventHandler ["HitPart", {_spr = "Sign_Sphere10cm_F" createVehicle [0,0,0]; _spr setPosASL (_this select 0 select 3);}];

^should get u started
There are multiple ways really, depending on how much control you want.

young current
cosmic kettle
#

I see you are a graphics guy @young current ๐Ÿค”

young current
#

๐Ÿฅ“

cosmic kettle
#

@long gazelle

cursorTarget addEventHandler ["HitPart", {
  private _obj = ((_this select 0) select 0);
  private _hitPos = ((_this select 0) select 3);
  hint str ((AGLToASL(_obj modelToWorld [0,0,0])) vectorDistance _hitPos);
}];

Headshot will return value of 0.6.
I'm sure there are better ways and this one lacks some obvious stuff but saying it's impossible says more about the one trying imo.
Hell, even just by integrating the value @young current provided in his beautiful drawing you're like 90% there.

young current
#

Or make a popup target model of your own with hitpoints for all bodyparts

#

would have actually been super neat if the vanilla one had those

weak obsidian
#

Wasn't there also a way to show where you had hit? Or was that in A2?

#

You'd get a small window showing a circular target and your hit.

#

Ah it's a seperate scoreboard - BIS_fnc_target my bad

pliant stream
#

let u be a vector for the hit
let v be a vector for the center of the face
let a be the maximum distance from the center of the face
then if the target is upright the hit shall be registered iff |v - u| < a
was this supposed to be a hard problem?

cosmic kettle
#

Yeah, iirc there's an A2 script doing that. As is obvious, loads of ways; make a model, name selections, recover those from hitpart EH.

#

And no not really, we're just all throwing ideas at someone who left like hours ago lol

#

Untelo, I actually posted your words in code above. Well not literally.

peak plover
#

Is there an opposite for append or an alternative to - that removes array of elements from array and edits the original?

#

Without intercept

still forum
#

deleteAt

#

sort+deleteRange

#

Not sure if sort modifies

peak plover
#

that requires my own loop so it's slower

still forum
#

yeah

peak plover
#

deleteAt modifies

#

For 1 element I use deleteAt

#

Don't wanna loop it with like tons

still forum
#

I use deleteRange in TFAR

#

Because I already know the elements are in order

peak plover
#

๐Ÿ˜ฆ

#

I know they are not

#

- it is

#

and setvariable

spark phoenix
#
_obj = "groundWeaponHolder" createVehicle (position player);
_obj setPosATL (getPosATL player);
_obj addBackpackCargoGlobal ["C_Offroad_01_F",1];

I love arma

peak plover
#

What does that do

drowsy hollow
#

It basically places an Offroad on the ground and you can pick it up and carry it like any other backpack. (But you can't really use it.)
see https://imgur.com/a/Rj4nk

#

You could even then take that "backpack" and put it inside another Offroad.

lone glade
#

I prefered when you could use "men" textures on the backpacks

#

it was hilarious;... and goddamn terrifying

willow haven
#

@obtuse cosmos you around man

obtuse cosmos
#

yup

#

what you need?

willow haven
#

did you ever figure that thing out? it was way beyond me

#

or did you stick with

#

(sidebar: how do i make it look like code when I put it in cha like you guys do)

lone glade
#

`

code

`

obtuse cosmos
#

`

#

three times

#

then type sqf

lone glade
#

see my message.

#

and before you ask:
markdown magiks

edgy dune
#

is there away to get a list of all the actions on a menu ,like for a vic?

subtle ore
edgy dune
#

thx

#

okay so that then returns a array of numbers

#

sooo

lone glade
#

you then use actionParams

#

yes it's convoluted, no there's no better way

#

the "best" part is that it will dump all of the actions, not the ones actually active huehuehue

edgy dune
#

ah okay

long gazelle
#

Hey guys, here with loads of questions again.. :D
So I'm trying to create a small duel for me and my friend using the Dueling Target object.
My problem is that I want to have the target to return a value 0 to execVM everytime red is hit and a value 1 everytime white is hit.. Any ideas on how to accomplish?

lone glade
#

why do you need that? there might be a better solution.

#

use setVariable or check for damage in your loop ?

#

0 the target is up
1 the target is down

long gazelle
#

Is there a way to track which animation phase it is?

lone glade
#

yes

long gazelle
#

How?

lone glade
#

i'll let you guess the name of the command ๐Ÿ˜„

long gazelle
#

animationPhase?

subtle ore
#

Heuhueheuh

lone glade
#

bingo

long gazelle
#

I've read its article but not too sure. Small hint please?

#

Oh, thx

lone glade
#

it returns a number, the same one you use on animationSource to "set" the animation

subtle ore
#

Look under config, animation sources

#

You'll need the name of the animSource to use it

lone glade
#

pretty much all targets use "Terc" afaik

subtle ore
#

Welp. There you go

long gazelle
#

Would this line help finding out in which state it is? this addEventHandler ["hitPart", {systemChat str (this animationSourcePhase "plate_1")}]

lone glade
#

_this in the code block and yes

#

it'll return a number

#

also, remember, use a single EH or try to stuff as much shit in one as you can instead of adding multiple ones.

#

I know this is an example but I wanted you to know this ๐Ÿ˜„

long gazelle
#

Error: animationsourcephase: Type array, expected an object