#arma3_scripting

1 messages ยท Page 89 of 1

slow brook
#

hmm, but PublicVariable then throws error when I try using it that way

#

It also responsed with a channelID of 4

#

which is supposed to be a reserved ID?

winter rose
#

what

slow brook
#

Check the screnshot

queen cargo
#

you will just need an empty dialog config for it

slow brook
#

If I call CreateAdminChannel on server exec, it returns channel 4

#

Which is supposed ot be Vehic

winter rose
#

no

#

it's a custom channel ID

slow brook
#

ChannelID 6-15 are custom?

#

So what its actually doing is taking 6 out and starting from there?

winter rose
#

correspondence table

slow brook
#

Ah right

tough abyss
#

The thing that I'm trying to do BTW is : using disableChannels in description to remove the players ability to place markers on side or global. So they would be forced to "copy map" and roleplay

#

The stuff is from vanilla I think. Ours worked better, but...

candid sun
#

i've seen the gui in xms2, i wouldn't trust you an inch

tough abyss
#

Also disableChannel never worked for me on global and side chat for some reason

queen cargo
#

the UI in XMS2 was made with configs @candid sun, the createCtrl command was not around when it was created

tough abyss
#

Commy you might have been the admin

#

I noticed that admins have all channels either way

indigo snow
#

IIRC many of the channels are special as well, like the group one that can't or couldn't be disabled

tough abyss
#

In SP I can't disable them

#

only group and global though

indigo snow
#

global likely because it treats you as "admin"

urban lava
#

anyone know how to get all the groups inside of a trigger area?
i tried using
private _groups = allGroups inAreaArray thisTrigger;
and
private _groups = units _side inAreaArray thisTrigger;
_groups = _groups apply {group _x};
_groups arrayIntersect _groups;
which i had found from searching here but neither worked

indigo snow
#

\ o /

granite sky
#

Second one should work, but if you don't have a specific side then change units _side to allUnits

hallow mortar
#

Groups (the entity type) don't have actual positions, so it's hard to tell whether "the group" is inside something. (inAreaArray doesn't accept things of type Group as an input, for example)
The first example just doesn't work on that basis.
The second example looks like it finds groups that have any of their units inside the area; it's up to you whether that counts, or if you only want groups where the leader, or all the units, are in the area.

lunar mountain
#

hey guys. Quick question: killed EH triggers only if the vehicle is local?

zinc loom
#

listbbox looks nice for my gui, but i dont know how to use it, can anyone give me a tip ?

little raptor
#

what do you want to use it for?

zinc loom
#

a listbox with 2 colums

#

listNbox

#

mb

little raptor
#

well which part of it have you figured out already?

#

do you know how to create the config for it?

stable dune
zinc loom
#

@little raptor im watching the wiki, so yes

little raptor
#

well all you need to do is add rows to it now using lnbAddRow
and the only difference with listBox is that instead of just using an index to get an item, you use an array of [row, column] to refer to stuff

#

wdym?

stable dune
#
["message"] remoteExec ["BIS_fnc_infoText", [0, -2] select isDedicated];    // ideal - the dedicated server will not run the code, a player-hosted server will

?

indigo snow
#

both arguments and effects are local so, use the MP EH variant

little raptor
#

and what does that have to do with eden?

#

it wouldn't work anywhere you were a server

#

it had nothing to do with eden

#

well it's always been [0, -2] select isDedicated idk where you got [0, -2] select isServer; from...

zinc loom
#

@little raptor columns[] = {0.3,0.6,0.7}; would that set my listnbox to 3 ?colums ?

little raptor
#

yes

#

tho you might want to use 0 for the offset of the first column?

zinc loom
#

i tank to use idcleft and idc right

#

discovery of the day; listNbox

tough abyss
#

Anyone else's Killed EH trigger more than once (sometimes not 100%). I last tested this in the summer.

queen cargo
#

with or without a medical system running @tough abyss?

tough abyss
#

With ACE 3 of course.

queen cargo
#

then feel free to ask one of @daring zinc s minions or himself

daring zinc
#

killed should function just like it does in vanilla in ace

#

the only thing you have to watch out for is the handleDamage eh

zinc loom
#

kinda works, now i have to figure out , how to put in icons, and this beautifull pictures of rifles etc

#

where could i find that information ?

queen cargo
granite sky
#

lnbSetPicture & lnbSetPictureRight

#

The images will be in the weapon config somewhere.

zinc loom
#

was just looking at it ty sur

granite sky
#

just picture I guess. getText (configFile >> "CfgWeapons" >> _weaponClass >> "picture")

granite sky
#

Doesn't it change every frame from when the trigger condition is fulfilled until when the trigger activates?

zinc loom
#

do i have somethihng like onLBSelChanged for listNbox ?

granite sky
#

I think you get the listbox event handlers on listnbox

zinc loom
#

yes it does

slow brook
#

Whats the performance thing you can do to see how expensive a script is again?

#

Shows you runtime

granite sky
#

diag_codePerformance

slow brook
#

Ah yeah, cheers John

granite sky
#

If you use the Advanced Developer Tools mod then you get a button built-in.

slow brook
#

Cheers

#

I love people just adding random scripts that they don't test

#

Like, yes spawn 1000 objects that never clean themselves up

sullen sigil
#

there's one built into the base game debug console too, the speedometer icon

granite sky
#

oh hey, never noticed that.

sullen sigil
#

yup ๐Ÿ™ƒ

tough abyss
#

Used it to count deaths and then display on ending screen. Mission with ~150 ai returned with around 200-250. Most likely just a fault on my end, as I've not heard anyone else having the same issue and seems like you guys have not as well.

zinc loom
#

im learning to script, atm i dont even know how to judge the performence of my scritp ๐Ÿ™‚

granite sky
#

Arma will run a maximum of 3ms of scheduled scripts per frame, if you want a reference point.

unkempt sorrel
#
private OBJECT_FUNC = "OBJECT_CLASSNAME" createVehicle getPosATL player;
OBJECT_FUNC spawn {_this setObjectScale 10; _this allowDamage false;};
while {true} do {OBJECT_FUNC spawn {_this setPosATL getPosATL player;}; sleep 0.01};
#

What am I missing here? ๐Ÿ˜›

#

It works in single player but not in multiplayer ๐Ÿ™‚

sullen sigil
#

what on earth

#

did chatgpt write this

granite sky
#

I thought the parser bitched out immediately if you did private name_without_underscore

sullen sigil
#

itdoes

granite sky
#

nice helpful error too :D

sullen sigil
#

we love to see it

granite sky
#

Generally if you want to move an object around with a player you just use attachTo

#

Although setObjectScale has a lot of caveats so I wouldn't know about that.

#

player is different on each client so you need to handle that properly in MP.

sullen sigil
#

and you should absolutely not run spawn within a while loop meowsweats

granite sky
#

neither of the spawns make any sense.

sullen sigil
#

none of it does

slow brook
sullen sigil
#

it does not

zinc loom
#

hm, im still with my eden editor, but the editor doesnt look like this

signal estuary
#

Is this game worth buyin

sullen sigil
#

wrong chat

signal estuary
#

Which one the chat

winter rose
simple trout
winter rose
#

jolly goodness, you are right! I beg your pardon

sullen sigil
lunar mountain
#

yuup, mpkilled fires twice, wtf :D

simple trout
candid sun
#

mpkilled / 2

#

pro solution

winter rose
#

R is the 18th letter of the alphabet, it should be enough :p

warm swallow
#

is there a way to return the object of a player's inventory item if they are wearing it? Like uniform, vest, backpack, where it has a model?

and, can the movement of that item be overriden?

lunar mountain
#

hahah, I guess I figured it out. Didn't have a server check :)

warm swallow
#

but is there anything for headgear?

merry stone
#

Hey all,

I have a mission that is using GFs Auto Loot script (old) which works fine on my PC in single player and when hosting multiplayer from my PC. However, when I run my mission on my server, it closes and returns to the mission selection screen. Just wondering if someone is able to help me out?

Lines from my rpt file when my mission attempts to load on the server is attached (txt file)

line 586 and 587 from GF_Auto_Loot.sqf script:

_a = 0;```
pulsar pewter
#

How can I get an Airport ID?
I've got a script to easily get all Airports near a target location. But now, I need to somehow get the associated airportID so my landAt command can work. I'm a bit stumped.

_airports = nearestLocations [_controllerPosATL, ["Airport"], 400];
systemChat _airport;
if (_airports isEqualTo []) then
{
  _returnWP setWaypointType "LOITER";
}
    else 
    {   
    _airport = _airports select 0;     
    _UAV landAt _airport; 
    waitUntil {sleep 1; speed _UAV == 0}; 
    deleteVehicleCrew _UAV;
    };
warm swallow
pulsar pewter
#

Dang. I get the coordinates no problem (nearestLocations returns Location, which includes 3D position). Problem is translating that to the airportID, as landAt takes airportIDs or airport objects (Dynamic Airports), not coordinates.

granite sky
#

It's probably from config order of airstrips.

pulsar pewter
#

Thanks anyway, Lou!

warm swallow
#

is their something like eyePos but returns the object of headwear instead of the position of the eyes.

Or a workaround to where I can use attachTo with a position?

granite sky
#

@pulsar pewter Some config:

private _mainRunway = configFile >> "CfgWorlds" >> worldName;
private _otherRunways = "true" configClasses (_mainRunway >> "SecondaryAirports");
#

Those should have ilsPosition in them.

winter rose
pulsar pewter
#

I found this function that someone wrote to find nearest airportID. Haven't looked it over yet.

getNearestAirfieldId =
{
 params ["_nearTo"];
 private _world = configfile >> "CfgWorlds" >> worldname;
 private _index = 0;
 private _closestDist = 1000000;
 private _closestIndex = -1;
 
 _checkAF =
 {
  params ["_ilspos"];
  private _p = getArray _ilspos;
  private _dist = _p distance2D _nearTo;
  if(_dist < _closestDist) then
  {
  _closestIndex = _index;
  _closestDist = _dist;
  };
  _index = _index + 1;
 };
 
 (_world >> "ilsPosition") call _checkAF;
 
 _sec = _world >> "SecondaryAirports";
 
 for "_i" from 0 to (count _sec - 1) do
 {
  _ap = _sec select _i;
  (_ap >> "ilsPosition") call _checkAF;
 };
 
 _closestIndex
};

Found at: https://forums.bohemia.net/forums/topic/223419-jet-auto-landing-carriers/

granite sky
#

There's an ilsDirection too but I'm not sure if there's a good way to get runway start/end.

pulsar pewter
#

I'm curious about this question. For my immediate purposes, all I need is the nearest airportID to a pos, which that function seems to get. After that, landAt takes over.
But now I wanna learn how to actually work with configs n stuff so I can figure this out more generally.

tough abyss
#

killed only runs on the machine where the object is local
don't use MPkilled , ever
Just add the killed eventhandler on all machines

warm swallow
#

@balmy raven that would go in your initPlayerLocal on dedi

balmy raven
#

Aaaaah

#

That makes sence

#

I'm new to dedicated scripting

warm swallow
#

yea just make sure the classes of the people you put down match

balmy raven
#

Thank you โค๏ธ

#

Yeah, it works when I local host

warm swallow
#
if (_playerRole == "O_Soldier_SL_F") then {_role = "Leader"};
if (_playerRole == "O_Soldier_AR_F") then {_role = "MachineGunner"};
if (_playerRole == "O_medic_F") then {_role = "Medic"};
if (_playerRole == "O_soldier_M_F") then {_role = "Marksman"};
if (_playerRole == "O_Soldier_F") then {_role = "Rifleman"};
if (_playerRole == "O_Soldier_LAT_F") then {_role = "RiflemanAT"};
if (_playerRole == "O_Soldier_TL_F") then {_role = "Grenadier"};
if (_playerRole == "O_Soldier_A_F") then {_role = "AmmoCarrier"};
balmy raven
#

Just not on dedicated

warm swallow
#

ok

balmy raven
#

Thank you for your help!

warm swallow
#

yep

tough abyss
#

It only fires twice in some cases. Also using HC. I ended up putting a adding a variable to units which run the EH. Then if it has it has the variable on the unit it will exitWith {}

#

But now I found out about scoreSide. And it seems a lot better

#

Also I feel dirty when using EH's and I feel like anything I attach to every unit will cause slow downs :(

#

bug in ACE, apparently killed triggers twice if you use setDamage 1 on that unit inside handle damage

urban lava
#

quick question: does anyone know the name for seek and destroy when trying to add a waypoint via script? Also is there a guide to all these waypoint names for scripts?

granite sky
#

"SAD"

tough abyss
#

once for setDamage and once for the returned damage I assume

urban lava
#

thank you

tough abyss
#

Same should happen with MPkilled

#

The MP eventhandlers are dumb and must die

tough abyss
#

I used to use EH's and a sleep and check for dead body removal as well.

#

Is the corpseLimit useful and helps?

#

new corpse manage from BI works, but there is one bug

indigo snow
#

adter a while it becomes ground weapons holders

tough abyss
#

It doesn't remove bodies of those who disconnect when AI is disabled

#

Can using onPlayerDisconnected help with that?

#

Probably. But whats the point when you have to use scripting anyway?

#

The sad thing is, that I removed the body removal stuff from AGM in favour of this shit.

#

And AGM did handle disconnect...

#

using a script on every unit sounds bad, using a script on ever player does not sound that bad...

#

When using HC, the server usually doesn't get enough to do anyway

#

I loved AGM...

#

Old Fashioned Menu option for ACE 3... my dream

open fractal
#

my friend saw debug messages left over from testing when he hosted my mission and got a kick out of it printing "SAD" as players got spotted

simple mantle
kindred tide
#

how can i change the tint of the icon that appears in editor from blue to white?

#

(it inherits from game logic)

#

i set its icon image as a flag and can hardly see it because of blue tint

#

changing side to neutral somewhat helped, its tint isnt as intense

tough abyss
#

RIP commy-rose

little raptor
little raptor
#

An example for converting from weapon model coords, to weapon bone, to unit coords, to world

little raptor
# sullen sigil

Why does the watch item say Watch? meowsweats
It should say Expression 1, etc.

stray jacinth
#

simple command im struggling with

#

deleteMarker "Marker1"; && deleteMarker "Marker2"; && deleteMarker "Marker3";

#

how could i get rid of multiple markers with a single trigger

south swan
#

it's not .sh, you don't need && blobdoggoshruggoogly

#

just ; after each command. Preferably with one command per line for readability

stray jacinth
#

ohhh ty

#

oh that works great

#

ty sm

warm hedge
#

&& or and is to compare booleans, not to combine multiple commands

slow brook
#

Is there a way to detect when Curator is given to a Unit? Rather than spawning a loop that checks every 30s for getAssignedCuratorLogic ?

#

Ie an EventHandler

warm hedge
#

Do you mean if someone has ascended?

slow brook
#

Yeah, so curatorAssigned. Triggers when a unit ascends

#

Ideally would return _TargetObj, _callerObj, CuratorObj

#

LIke Player X assigned CuratorModule Y to Player Z

#

Found it, curatorUnitAssigned

slow brook
#

Its under module events

#

yeah

warm hedge
#

You beat me to it

#

๐Ÿ˜„

slow brook
#

Was sitting here trying to find it, and search was not helping

#

It's just missing the person who assigned the logic

#

damnit

hallow mortar
#

It's done by script so there is no "person responsible"

slow brook
#

Well its the curator logic that's assigning it in game. I get that it's a called action, but someone/thing has to initiate it

#

Even if it was Logic that did the initial setup, and then captures the player zeus' who did it after

hallow mortar
# slow brook Well its the curator logic that's assigning it in game. I get that it's a called...

A player placing a module to assign curator is one of the ways it can happen, but what's ultimately happening is use of the assignCurator command. This command does not track the player who executed it, and like any script command it can be executed without any player input whatsoever. For example, it could be executed in initServer.sqf, or in a trigger activation code, or .... And in any of those cases, there's no "player responsible" to report even if it wanted to.

slow brook
warm hedge
#

Is not an addEventHandler handler

hallow mortar
#

It's also supposed to be added to the curator logic, not to the player

south swan
still forum
south swan
#

i'm pretty sure that _player addEventHandler ["curatorUnitAssigned",... couldn't possibly work when said "curatorUnitAssigned" is scripted EH blobdoggoshruggoogly

slow brook
#

Yeah that doesn't work anywhere near as well as just having a waituntil {(!(isnull getAssignedCuratorLogic player))}

#

For anyone else...
initPlayerLocal.sqf

// Zeus Handler
[player] spawn {
    params ["_player"];
    waituntil {(!(isNull (getAssignedCuratorLogic _player)))};
    private _curator = getAssignedCuratorLogic _player;
    [_player, _curator] call _fnc_playerZeusLogging;
};
south swan
#

"and remember, each and every waitUnitl {} loop (especially without sleep inside) devalues tens and hundreds of Dedmen-hours of work optimizing SQF VM"

slow brook
#

i'll use it till curatorAssigned / curatorRemoved becomes a player side eventhandler ๐Ÿ˜„ ยฏ_(ใƒ„)_/ยฏ

#

I mean, CuratorPinged & CuratorFeedbackMessage is a thing, which probably has less use than basing / adding all your event handlers when the curator module is given

zinc loom
#

hi everyone, i managed to redo all my dialogs with listnbox, looks great, not im trying to figure out : what is the best way to store "virtual classes"

#

i literaly have [_configName,[all,"new",variables]] storred in an array

#

is that a "smart" way to do ?

little raptor
little raptor
zinc loom
#

nothing atm, im like learning how to code, atm this array is out of [_classname,[price,trunksize]]

#

so i can show all the data from the configfile of a Car, and add my data

zinc loom
#

so my question is, whats the best way to store persistent data for existing classes

little raptor
#

What you wrote works yeah

zinc loom
#

ty sir

proven charm
#

hashmaps are also good way of storing data with key

#
_myHashMap = createHashMap;  
_myHashMap set [_classname, [price,trunksize]];
_value = _myHashMap get _classname;
little raptor
restive pike
#

hi im trying to make a script that checks if players have an item in their inventory and are in a vehicle then it gives them an ace interact option, but my scripts not working, anyone have some pointers?

#

_items = items player;

if ("Wildfire CD" in _items) && (isNull objectParent player) then {

    add_fnc_main ={
    private _subActions = [];
    /*
    subaction 1
    */
    _subActions pushBack [[ 
        "Insert CD",
        "Play Wildfire",
        "\A3\ui_f\data\igui\cfg\actions\unloadVehicle_ca.paa",
        {_this call RadioJuke_fnc_sub},
        {true},
        {},
        []
        ] call  ace_interact_menu_fnc_createAction, [], 1, ["ACE_SelfActions"]];
    };
/*
    function 1
*/
RadioJuke_fnc_sub = {
    playSound3D ["Julz_Jukebox\tracks\Wildfire.ogg" , player, false, getposASL player];
    };
};
/*
Main action
*/
private _mainAction = [
    "Insert CD",
    "Play wildfire",
    "\A3\ui_f\data\igui\cfg\actions\unloadVehicle_ca.paa",
    {},
    {true},
    {_this call RadioJuke_fnc_main},
    []
] call ace_interact_menu_fnc_createAction;


["Insert CD", 0, ["ACE_MainActions"], _mainAction ] call ace_interact_menu_fnc_addActionToClass;```
hallow mortar
#

"Wildfire CD" isn't a valid classname, classnames can't have spaces in them

proven charm
zinc loom
#

i need help, im looking for the smartest way to fire events every defined number of seconds ...only idea was a trigger ... any better ideas ?

warm hedge
#

while and sleep

zinc loom
#

or better to say, im looking for an event, which is trigered ever x seconds

#

so i can start a function with a while loop in the init ?

#

maybe i want it serverside, so the server only makes does it , i can put a function in init.sql what uses if (isServer)

#

while true do { blalba; sleep 600;};

#

and i place the function in initServer.sqf

#

is this the idea ?

warm hedge
#

Basically

zinc loom
#

ty sir !

winter briar
#

This the code im using

addMissionEventHandler['Draw3D', {
{
    if ((player distance _x) < 700) then {
        drawIcon3D['', [1, 1, 1, 1], [(ASLtoATL eyePos _x) select 0, ((ASLtoATL eyePos _x) select 1) - 1, ((ASLtoATL eyePos _x) select 2) + 0.3], 0.1, 0.1, 45, name _x, true, 0.03, 'PuristaLight'];
    }
} forEach allUnits - [player];
}];
warm hedge
#

Do you mean you prefer to have smaller texts when is far away?

winter briar
#

ye that it stays on his head pos instead of going down

warm hedge
#

Then you can just check distance between camera and target and divide the size with it

winter briar
#

how would the calculation be? (cameraOn distance _x) / ?

warm hedge
#

positionCameraToWorld can check the cam pos

winter briar
warm hedge
#

size / distance, not distance / size

hallow mortar
#

They're not trying to change the size with distance, they're trying to change the vertical position with distance - or perhaps more accurately to stop the vertical position appearing to change with distance

winter briar
#

ye that the vpos

hallow mortar
#

btw, for calculating the icon position, you don't need to have three separate ASLtoATL eyePos _x retrievals - it's a waste of performance to run the command 3 times.
You can do it more efficiently like this:

private _basePosition = ASLtoATL eyePos _x;
drawIcon3D [ '', [1,1,1,1], [_basePosition#0, (_basePosition#1) - 1, (_basePosition#2) + 0.3], ... ];```
or even more efficiently like this:
```sqf
drawIcon3D [ '', [1,1,1,1], (ASLtoATL eyePos _x) vectorAdd [0,-1,0.3], ... ];```
#

I'm dubious about that -1 in the position calculation, though. That's a horizontal offset in world space, meaning its effect will be different depending on the angle you're looking at the unit from. I'm not sure that's what you want.

winter briar
#

ye i change it to the z coord mb

#

so how would be the calculation for the vertical pos pos / distance?

zinc loom
#

whats the best way to deal with dialogs, any good tutorials ? my question is how to make something like a player menu, where u have buttons that change most tof the dialogs design

#

my idea was to create all the things and change visibility

#

can i open a dialog in a dialog, specified area ?

hallow mortar
# winter briar so how would be the calculation for the vertical pos pos / distance?

This is the way I'd do it.

private _vertOffset = linearConversion [0,700,player distance _x,0.3,1,true];

drawIcon3D [ '', [1,1,1,1], (ASLtoATL eyePos _x) vectorAdd [0,0,_vertOffset], ... ];```
The `0.3` and `1` in the `_vertOffset` calculation are the minimum and maximum offset values. You'll need to calibrate them yourself to get the exact position you want.
#

Note that drawIcon3D also has parameters for screen space text offset (as compared to the world space offset you're already doing) which you might like to experiment with as well.

vapid scarab
south swan
#

inb4 worldToScreen to convert AGL into screen coordinates + offset by text size in screen coordinates + screenToWorld back ๐Ÿ™ƒ

south swan
vapid scarab
south swan
# winter briar so how would be the calculation for the vertical pos pos / distance?

or use offsetY in drawIcon3D: ```sqf
addMissionEventHandler ["EachFrame", {
{
private _text = format ["%1(%2 m)", name _x, player distance _x toFixed 0];

drawIcon3D [
"", //texture,
[1,1,0,1], //color,
[0,0,0.3] vectorAdd ASLtoAGL eyePos _x, //position,
0, //width,
0, //height,
0, //angle,
_text, //text,
true, //shadow,
0.02, //textSize,
"TahomaB", //font,
"center", //textAlign,
false, //drawSideArrows,
0, //offsetX,
-0.01 //offsetY << THIS ONE
]; } forEach (units west);
}];```

#

oh, it was already proposed. Silly me notlikemeow

vapid scarab
#

Is there a way to make this work?

// macro.hpp

#define MACRO(ARG) \
  #define VAR ARG

Current Behavior:

// myfunction.sqf

#include "macro.hpp"

// Before Preprocess
MACRO("Hello World")

// Desired Preprocess
#define VAR "Hello World"

// Actual Preprocess
"define" VAR "Hello World"
still forum
#

#define HASH #

#define MACRO(ARG)
HASH##define VAR ARG

#

But I have the feeling someone asked this recently and failed

vapid scarab
#

un momento

#

Nope
""define VAR "Hello World"

still forum
#

actually what is your final target

#

Even if you can generate #define VAR "Hello World" that would just make the script compiler fail, if you intend to compile that as a script

vapid scarab
#

Im simply trying to hide a #define from a userConfig file. But why would that fail though?

winter rose
#

more like why would you want to do that.

vapid scarab
#

Just to hide it from the user. Im making a mission framework. Its of little consequence.

winter rose
#

define the #define in an #include, problem solved

limber panther
#

Hello everyone!
I would like to ask a question. In a multiplayer scenario, after triggering, i wish to play loud and clear sound to everyone, who is on the server regardless their location. For this purpose i've been using playsound "gas"; and it worked just fine. But now i would like to change it a little. Instead of everyone, i want to play the sound to members of one faction only. For example, after triggering, all BLUFOR members should hear it loud and clear at the same time no matter where they are. I looked at parameters for playsound, playsound3D, say, say2D, say3D, createsoundsource but i couldn't decide, what is the right script for me.

vapid scarab
#

ARGS_ARRAY remoteExec ["TAG_fnc_myPlaySound", west];

limber panther
vapid scarab
#

You can specify side, group, or units in remoteExec.
Alternatively, if the trigger is local,
if (side group player isEqualTo west) then { /* Play Sound */ };

#

Read up on side from the arma wiki though. Using side on player is inconsistent. Use hypoxics example (i updated mine) as that should remove inconsistency with side

fair drum
#

side group player

limber panther
#

by trigger i meant some kind of addaction, i would like to put an addaction to an object and if someone uses the addaction it will do a few things as well as plaay that sound for all blufor players but NOT for all players in other factions

vapid scarab
#

^

fair drum
#

["mySoundClass"] remoteExec ["playSound", west]

#

[["mySoundClass", false, 0]] remoteExec ["playSound", west]

#

["mySoundClass"] remoteExec ["playSound", side group _caller] - for addAction if you want caller's side

limber panther
fair drum
limber panther
#

for example if a civilian uses the addaction, still play the sound to blufor

fair drum
#

then use the first one

limber panther
#

by my sound class you mean the name of the sound file which i used here playsound "gas"; as gas?

fair drum
#

yes

limber panther
fair drum
# limber panther so in this example the "west" is telling the "remoteexec" function, where to exe...
    targets (Optional, default: 0):

        Number (See also Machine network ID):
            0: the order will be executed globally, i.e. on the server and every connected client, including the machine where remoteExec originated
            2: the order will only be executed on the server
            Other number: the order will be executed on the machine where clientOwner matches the given number
            Negative number: the effect is inverted: -2 means every client but not the server, -12 means the server and every client, except for the client where clientOwner returns 12

        Object - The order will be executed where the given object is local

        String - Interpreted as an Identifier (variable name). The function / command will be executed where the object or group identified by the variable with the provided name is local

        Side - The order will be executed on machines where the player is on the specified side
        Group - The order will be executed on machines where the player is in the specified group
        Array - Array of any combination of the types listed above
limber panther
vapid scarab
#

https://community.bistudio.com/wiki/remoteExec
the second argument on the right (3rd argument for remoteExec) targets the clients that the function should call on. As hypoxic just shared, a target can be a side, where it will execute the given function on all players from that side.

limber panther
#

remoteexec sounds like a good work around, i'll give that a try, thanks for tips guys

sudden yacht
#

for orbit module. image can the image be jpeg? And how do i set the path for it?

warm hedge
#

*ORBAT?

sudden yacht
#

yes my bad.. ORBAT

fair drum
#

no that's what things do around a planet.

sudden yacht
#

lmao

warm hedge
#

So, the question - you can actually use a jpg

#

Since is the completely same way with any other textures

sudden yacht
#

How do i assign that texture? I forget.

warm hedge
#

Assign in what sense? Where?

fair drum
#

BIS_fnc_moduleStrategicMapInit
BIS_fnc_moduleStrategicMapORBAT
BIS_fnc_moduleStrategicMapImage
BIS_fnc_moduleStrategicMapOpen

look it up in the function viewer and call the functions directly

or use the Custom Image module and link a path to the jpg as a string

tiny gust
#

Hi there.
Been a long time since I played. Really want to get back in. Only one issue though, I want my incognito script to work right.
I paid a guy, long time ago, to make my unit a good standalone incog script. He did a lot of work, but there were some issues. I can't remember if I fell out of touch, or he did, but it ended up unfinished. When the mod has worked(which is very rare), it's perfect. But I for the life of me cannot get it to work consistently.
If anyone wants to look at it, be my guest. If you can fix it, we can talk payment as well.

pulsar pewter
#

AFAIK against the EULA to pay someone to make arma content without approval, but I dont know if that only applies to paying someone to use Arma tools or such stuff to make something, rather than scripting only.

warm hedge
#

SQF doesn't involve Arma related tools, so script is good to go

pulsar pewter
#

Got it, that's good to know, Polpox. I didn't know that rule only applied to using BI tools. Learn something new every day ๐Ÿ™‚

warm hedge
#

Please debug it please! Maybe not, but SQF essentially is just a text file

zenith stump
#

If I set condition for trigger as "triggerActivated task1", does the trigger fire when the trigger called "task1" has been activated?

Just making sure I've understood this correctly.

tiny gust
#

glad to know I didn't break any terms, I would seriously be happy to send some code to anyone willing to take a peek

zinc loom
#

im using lnbsetpicture , it works well, but all pictures look linda black , i guess because of the underground color

what am doing wrong, i want the picture with the regular color, like upper layer i dont know

#

oh i see it i think

#

N1

#

mb did not define colorPicture[] = {1,1,1,1};

pulsar pewter
#

Quick question:
So, I've got a script counting how many objects of a type are within a specific range, and saving their location. Then, I want a hint to say, per line, the details of each object's Pos. If I want to write the script in a generalized way, not knowing how many objects will be within range when the script is called, how can I structure the hint command to do so? Is there a way?
I know how to do it, through formatText, how to set it up with linebreaks and all if I knew the number of objects, but not how to generalize it...

#

I guess I could count the array that I'll be using with the objects' pos and then just do an overlong if then structure for up to n cases, but I imagine there's an easier way.

granite sky
#

You can just loop over the array and append to the string.

#

"one" + "two" = "onetwo"

#

There's also joinString, and format can join strings like this:
_str = format ["%1 %2", _str, "more stuff"];

#

You can put linebreaks in a hint with "<br/>", IIRC

pulsar pewter
#

So...

_arraywithObjPos = [...];
_string = ["Objects detected at:"]
{
_string = format ["%1%2%3, _string, linebreak, _x]} forEach _arraywithObjPos;
hint _string;

Something like that?

#

Will play around with it, thanks John!

leaden ibex
warm swallow
#

@little raptor this is where I am at:


_gagHolder = "GroundWeaponHolder_Scripted" createVehicle position player;

_gagHolder addItemCargoGlobal ["G_Blindfold_01_black_F",1];

onEachFrame
{
    _gagHolder = ((attachedObjects player) select {typeOf _x == "GroundWeaponHolder_Scripted"})#0;
    
    _eyePos = ASLToAGL eyePos player;

    _gagHolder setPos _eyePos;

    _gagHolder setVectorUp (getCameraViewDirection player);
};

I not working at all lol. I am feeling like this would be a whole lot simpler just using attach to, but attach to using 'mouth' or 'face' as a memPoint bone doesnt work.
Using the translation guide, I used oblicej, which also doesnt work. Any ideas on what I am doing wrong or how I can use attachTo?

leaden ibex
warm swallow
#

ah, ty but in my mission it is already attached, so it was seeing it

#

but yea I need to attach it previously

leaden ibex
#

Also I never used onEachFrame. Using spawn here might be better. (Or CBA perFrameHandler).

warm swallow
leaden ibex
#

Is it possible that different onEachFrame exists and "ends" this one?
From the wiki, it looks like only one onEachFrame can exists

leaden ibex
warm swallow
leaden ibex
#

Exactly what I am trying to help you solve now

warm swallow
#

yea

leaden ibex
#

Add a hint in there with all the important info

#

Eye pos, gagHolder pos for starters

warm swallow
#

this is where I am at right now

#

It follows me correctly, but the rotation of it is in correct.

leaden ibex
#

I am not sure how ground weapon holder works precisely. When you have more things in it, it will shuffle them around. But probably with one it just centers it.

leaden ibex
#

And probably add a check for < -1 then +2

#

And see what happens

warm swallow
#

jit i aint gonna lie

#

i am struggling

#

ill get back to you when I can figure something out

leaden ibex
#

Hopefully I'll be asleep by then. But I wish you luck! Let me know if you got it working. If not, I can try to recreate it too

warm swallow
#

thanks man

limber panther
#

sorry for bothering but this simple yet pesky script is giving me a hard time
This script works perfectly fine: sqf _voj = _this select 1; comment "Exported from Arsenal by Frank Wickets"; comment "[!] UNIT MUST BE LOCAL [!]"; if (!local _voj) exitWith {}; comment "Add weapons"; _voj addWeapon "Pipe_aluminium"; while this script doesn't work at all: sqf _voj = _this select 1; if (!local _voj) exitWith {}; _voj addItemToUniform "Item_Money_bunch"; _voj addItemToVest "Item_Money_roll"; _voj addItemToBackpack "Item_Money_stack"; Both of them are located in sqf files and both of them are executed by addAction in game. To me they seem identical and it makes me scratch my head why one works and the other one doesn't. Can someone give me a hint please? Thanks

leaden ibex
limber panther
# leaden ibex Does the second one pass the local check? Just add a hint with "jop, proลกlo"; a...

i actually sent just a section of the script that doesn't work, here is the whole script: ```sqf
_voj = _this select 1;
if (!local _voj) exitWith {};
_voj addItemToUniform "Item_Money_bunch";
_voj addItemToVest "Item_Money_roll";
_voj addItemToBackpack "Item_Money_stack";
hint "A robbery in progress at Sun Oil gas station.";
[sun, true] remoteExec ["hideObjectGlobal", 2];
[sun1, false] remoteExec ["hideObjectGlobal", 2];
["gas"] remoteExec ["playSound", west];
sleep 3;
["SunOil"] remoteExec ["playSound", west];

leaden ibex
#

Or has no space for the item

limber panther
limber panther
leaden ibex
limber panther
#

by the way, i sent you a PM @leaden ibex (not related to the scripting, please have a look)

limber panther
dreamy kestrel
#

stupid question maybe... is there a better way to verify existence of an image resource, assuming I have the plausible path of the file, than fileExists?

simple trout
#

yes, there is another way

#

but only with a macro

warm hedge
#

Not sure why fileExists doesn't fit for you

tough abyss
#

Anyone got a workaround when units radio in chat NEGATIVE when they can't perform a doMove command?

#

I am mostly dealing with this issue when I try to get them to move to a specific position inside a building.

little raptor
#

and why do you use setPos? meowsweats

#

omg

warm swallow
#

um

little raptor
#

using 'mouth' or 'face' as a memPoint bone
there are no such mempoints afaik

warm swallow
little raptor
#

use createSimpleObject

#

to create the model

warm swallow
#

ah

little raptor
#

did you test in A3?

warm swallow
#

wdym

little raptor
#

player selectionNames "memory"

warm swallow
#

oh no

#

ok

#

so there is one for head

little raptor
#

player selectionNames "memory" find "head"

#

there is one

warm swallow
#

yea

little raptor
#

but no face or mouth like I said

warm swallow
#

yea

#

{
deleteVehicle _x;    
} forEach (attachedObjects player);


_gag = createSimpleObject ["G_Blindfold_01_black_F", getPos player, false];
_gag attachTo [player, [0, 0, 0], "head", true];
#

this doesnt work

little raptor
#

like I said create the model

warm swallow
#

ah

little raptor
#
_gag = createSimpleObject ["\a3\Characters_F_Enoch\Facewear\G_Blindfold_01_F.p3d", [0,0,0], false];
#

and plz stop using getPos and setPos...

warm swallow
#

sorry I dont really use config viewer what is the tree selection path?

little raptor
#

configFile >> "CfgGlasses" >> "G_Blindfold_01_black_F"

#

if you use my mod you can just type the class in the top left search bar and hit enter

warm swallow
#

ah

#

I am

#

thank you so much! i got it lol, just wasnt using the correct mempoint bone

#

so now it follows bone rotation correctly without needing your onEachFramescript

#

thank you!

little raptor
warm swallow
#

was going for this kind of look, but thank you nonetheless

little raptor
#

oh right it's a gag ๐Ÿ˜‚

#

not blindfold

warm swallow
#

lol

little raptor
#

the eachFrame method wouldn't have this problem tho

warm swallow
#

yea

#

not so sure why the exposure is so high tho

#

eye rape

warm swallow
little raptor
#

that won't help

#

you have to calculate the bone pos and direction in the visual LOD

warm swallow
#

can you calculate bone pos?

little raptor
#

selectionPosition

#

and selectionVectorDirAndUp

#

like that code I showed before

warm swallow
#

yea

#

thank you

blazing zodiac
#

Do any of the ACE guys have a fix for MPKILLED eventhandlers sometimes returning the unit that was killed as the killer? The problem went away if I removed the ACE medical system but I would prefer having it in.

gleaming rivet
#

@blazing zodiac visit the ACE3 slack.

molten yacht
#

So, the "User Texture" items are really nice, but if I have say, transparent writing on there, how can I make that writing shiny? Is that where using an RVMAT comes in?

winter rose
molten yacht
#

mmm... point

#

I was thinking of procedural textures at first

#

but it's also weird because this is a special editor object, so I'm not 100% sure where to ask. I guess I'll ask in texture makers.

#

I do have a scripting question - is there any way to "tint" an object to be darker or a different color than it normally is?

winter rose
#

no, just new texture / different material I guess (I'm not good at material thing)

#

with something that would be setObjectTexture/setObjectMaterial-able ofc

molten yacht
#

yeah that's the problem, usually the object isn't allowing that command

#

oh well

winter rose
#

then no

#

hmyep

#

ah yes you can make something darker!

#

set the daytime to "night" ๐Ÿ™ƒ

#

runs away quickly

slow brook
#

Can you not just set an overriding Alpha layer?

molten yacht
#

I believe I am obligated to yeet an egg at thee

#

or perhaps a tomato

#

(how would I do that, Tad?)

slow brook
#

So do something like?#

_mysign  setObjectTextureGlobal [0, "\image.paa"];
_textureColour = "#(rgb,8,8,3)color(255, 255, 255, 0.1)"
 _mysign setObjectTextureGlobal [1, _textureColour];
warm hedge
#

It does take 0-1

molten yacht
#

ah

#

hmm

#

I mean it's like, "what if I wanted this rock to be jet black and shiny"

#

signs I know how to do

molten yacht
#

the problem I run into is that a lot of objects don't seem to have a "settable" texture

slow brook
sullen sigil
#

if it has no hiddenselections you're out of luck

molten yacht
#

yeah, most objects don't have the hiddenselection to manipulate

sullen sigil
#

most objects dont as it takes more processing

#

as a brief explanation

molten yacht
#

mhm

#

even if it leads to me just like, making an addon that patches the existing thing to have a different texture X_X

sullen sigil
#

you cannot without modifying the model

#

so simply, you cannot

molten yacht
#

oof, wretched

#

oh well

#

I have many impossible things on my wish list, including "for the love of god chop up the tanoa buildings so I can have stairways and catwalks to place in the editor"

#

at this rate I'm literally going to model my own

sullen sigil
#

does anyone know of a way to grab part of the image from a camera? trying to make picture in picture fake windows not look awful due to the camera originating from one point but unsure if its possible. in an ideal world id have the camera in the same position as the player relative to the window then just grab what is visible through the window then put that on the texture

sullen sigil
south swan
#

render camera image to one texture, assign that texture to RscPicture in some UI texture, move/scale/overlay with stuff in UI texture, then assign UI texture to the object (or real interface). Yaay for more convoluted ways of reimplementing game rendering in sqf

#

(then set that object in front of second camera and repeat the loop...)

little raptor
#

which you can't fix

sullen sigil
sullen sigil
little raptor
#

hide it? meowsweats

slow brook
#

Picture in Picture?

sullen sigil
little raptor
#

wut?

sullen sigil
#

the position the window actually is is in the corner of a map; the position it needs to "appear" is just elsewhere in the map

#

like this but rendering the camera at a position relative to where the player is relative to the "window" and just grabbing the part that should be seen

still forum
little raptor
#

part that should be seen
no part is seen if the object is in front of you

#

you say the cam is on player's eye

sullen sigil
#

hang on i'll draw an example diagram

little raptor
sullen sigil
#

where the example is where the actual "window" is

little raptor
#

are you saying that the camera is in an entirely different place?

sullen sigil
#

yes

little raptor
#

then how are you supposed to see what's behind the window?

sullen sigil
#

with r2t like thismeowsweats

#

that works "fine" for my uses, it's just scaling it up to larger things may cause distortion to be much more obvious

little raptor
#

now the cam is in the middle of nowhere

sullen sigil
#

yes, you could move the billboard and the player and it'd look the same if you surrounded the billboard with vr objects

#

that's the point, its a window showing somewhere else in the world ๐Ÿ˜…

little raptor
#

well so you mean you want to show some other objects that are copies of the ones behind the actual window?

sullen sigil
#

this is for my capital ships system where i have a static ship in the corner of the map which players can walk around on, and then there's one that flies around. the idea is i will have the cameras attached to the ship that is moving, and the r2t windows in the static ship so it looks like the player can see out of the static ship to what is going on around the moving one

#

make more sense?

#

its quite convoluted already and my poor explaining skills do not help ๐Ÿ˜…

little raptor
#

so it's not a window. it's a "portal" meowsweats

sullen sigil
#

if you want, i'd call it a window but to each their own ๐Ÿ™ƒ

#

just a window to elsewhere

#

this works for it, but at larger scales distortion is much much more noticeable and trying to see if theres any way to get around that

little raptor
#

that at least makes the perpendicular looking better

#

but looking at an angle thru the window will be weird

#

probably worse

little raptor
#

actually no it won't

#

or maybe it could think_turtle

#

if you stretch the texture beyond the screen you could make it kinda work

sullen sigil
little raptor
#

yeah it does

#

it would get smaller when you move away meowsweats
so I guess it's just always worse. nvm

#

if you can just go with the ui texture thing

sullen sigil
#

though wonder if i could change the fov of the camera to compensate?

vapid scarab
limber panther
#

Greetings folks!
I'd like to share with you an interesting information. Yesterday i made another script that didn't work. But the solution i found to get it working was really unexpected.

#

Seemingly simple script: ```sqf
_voj = _this select 1;
if (!local _voj) exitWith {};
_voj addItemToUniform "Item_Money_bunch";
_voj addItemToVest "Item_Money_roll";
_voj addItemToBackpack "Item_Money_stack";

#

Well guess what, the class name of those items is wrong, but here's the interesting part, how did that happen

#

When you are in the Editor and hower with you mouse over an item in the right panel menu, it displays a tooltip with name of the item and its class name

limber panther
#

However these classnames turned out to be incorrect

#

After playing around i realised, that actual classnames of those three items are actually different, so i replaced them and the script works.

#

A thing to note: these three items are not from a workshop mod, they are all from the game

hallow mortar
#

It's because the item in the Editor is the world-placeable item - a fake container which contains the inventory item. Inventory items aren't real and can't exist in the world on their own; they only exist as a thing inside a container.

#

You can find the inventory item belonging to a placeable container by looking at the container's cargo config.

limber panther
#

i think you misunderstood

#

in editor you have on the right side the menu with everything you can put down while creating a mission - vehicles, units, items, etc... so there, if you chose an object and just point your mouse on it it shows you the name, i didn't place it down, i know that inventory items are always in some kind of an invisible container even when on ground

hallow mortar
#

Yes, and the name it shows you is the name of the container object. It's a special invisible container that's configured to come with one of that item loaded in it.

limber panther
#

now you're making me confused, i never had to deal with such a thing with any other inventory item but nevermind i just wanted to share an interesting information, someone could find it helpful

sullen sigil
#

sometimes they are the same classname

#

as one is cfgvehicles and one is cfgweapons they can do
but shouldnt do

hallow mortar
#

In Arma, every different premade variation of a thing is a different config class. That includes preloaded inventory. If you want, say, a Hunter with two grenades in it by default, and a Hunter with four grenades in it by default, those have to be unique classes.
The same applies to the invisible container objects used for "free-floating" inventory items. The placeable inventory items in the Editor are actually each a unique type of invisible container, which is configured to be preloaded with one of the appropriate inventory items in its config.

winter rose
# limber panther i think you misunderstood

I think he is right - where did you find the classname, in the "items to put down"?
if so, try to find it in the crate inventory item list - the classname will be different

#

e.g you cannot createVehicle "arifle_MX_F" - you have to createVehicle GroundWeaponHolder and addWeaponCargo "arifle_MX_F"

limber panther
#

I got you @hallow mortar right on the beginning, no need for further explanation, but i appreciate it, i just said what happened to me, i get what you mean and just mentioned that it's confusing me, because i've been doing scripts for spawning such objects for some time and never encountered this kind of issue, but perhaps i was just lucky untill now

sullen sigil
#

reason you've never encountered it before is probably what i said

tribal sinew
#

createDiaryRecord lets you use this tag below. What's unit ID in this case ๐Ÿค” ?

winter rose
tribal sinew
winter rose
#

unsure, or internal ๐Ÿ™‚

sullen sigil
#

where's that page? meowsweats

winter rose
tribal sinew
hallow mortar
sullen sigil
#

ah I see

#

ah that's for players nvm

#

probably internal then

tribal sinew
#

this maybe?

#

or is "B Alpha 1-1" only related to the group?

sullen sigil
#

doubtful, if the type isn't linked on the wiki it probably doesnt exist

#

yeah

tribal sinew
#

gotcha

south swan
vapid scarab
hallow mortar
#

You can find the inventory item belonging to a placeable container by looking at the container's cargo config

little raptor
#

in other words, right click on item, find in config viewer, then TransportItems class

#

iirc

vapid scarab
#

How would i do this programmatically?

hallow mortar
little raptor
vapid scarab
#

Love it, thank you!

little raptor
#

not 100% sure if you should check the name, etc. of the item instead of just configName tho

#

as far as I've seen the class names under TransportItems, etc. are the same as item class names

#

looks like you should

limber panther
little raptor
#

for weapons it's weapon and for magazines magazine instead of name

hallow mortar
# little raptor

I (or someone) should test at some point whether the _xx_<classname> format is actually required or if it's just convention

little raptor
#

I think it's just convention

#

other items I looked at were the actual item class names without _xx

limber panther
#

i started a mission, then when i was a player i switched to zeus, as a zeus i spawned my items, then went back to player, i picked up those items to my inventory, then opened an arsenal and exported it, outside of the game i then pasted the export to a text document and there it showed me those names i was looking for @vapid scarab

hallow mortar
#

...is that simpler?

vapid scarab
#

I know that much. Were you using different names from the ones listed in that?

limber panther
vapid scarab
#

Im going to have to check your case.

limber panther
#

@hallow mortar you are a pro in scripts, direct digging for classname is a matter of seconds for you, but someone like me, who doesn't understand it much, is going to be super confused by your suggested way, i'm just trying to say that some people (beginners) will much rather appreciate a longer but simpler and more understandable way, but it's just my opinion

hallow mortar
#

You don't have to understand the config to rightclick on the object, select "find in config viewer", and then click on TransportItems. It's a 3-step process, you don't have to dig for anything. It's very simple.

zinc loom
#

is something wrong with this line ?_vTrunkSize=(_player getVariablie["JV_vTrunkSize",0]);

hallow mortar
limber panther
zinc loom
#

omg im so stupid

#

ty sit

#

the error was missing ;

limber panther
zinc loom
#

after 2 hours , i need a breeak ty sit that was it

hallow mortar
#

This is one of the cases where syntax highlighting comes in handy. A mistyped command would be treated as a global variable name and highlighted accordingly, making it easy to distinguish.

zinc loom
#

true, i try to make it, i use notepad++

vapid scarab
# zinc loom true, i try to make it, i use notepad++

I strongly recommend VSCode.
I use Dark Modern Theme (might be from C/C++ Themes Extension)

I recommend these extensions:
Arma 3 - Open Last RPT
2 different sqf language highlighters (ill come back to this later, as im afk)
SQF-VM

Ive also heard that the Prettier extension is really helpful... I havent used it before so idk.

still forum
#

If you use vs code you also get access to the sqf debugger

zinc loom
#

i felt so cool when i started using notepad++ instead of notepad ...

grand idol
#

is there a way to get around diag_log's 1044 character limit? Another logging command?

little raptor
#

log multiple times? meowsweats

#
fnc_log = {
  params ["_str"];
  for "_i" from 0 to count _str-1 step 1044 do {
    diag_log (_str select [_i, 1044])
  };
}
grand idol
#

I'm trying to dump a large hashmap:

_maglist = [];
from _i to _index2 do
    {
        _mag = AmmoMap get _x;
        _magClass = _mag select 0;
        _displayName = getText(configFile >> "CfgMagazines" >> _magClass >> "displayName");
        _ammoPerMagazine = getNumber(configFile >> "CfgMagazines" >> _magClass >> "count");
        _maglist pushBack [_magClass, _displayName, _ammoPerMagazine];
    } forEach AmmoMap;
diag_log format['BSF _maglist %1',_maglist];

I'm not sure how to index it. I was thinking something like

_maglist = [];
_ndex = 0;
_index2 = 10;
from _i to _index2 do
    {

With an _index2 = _index2 + 1; in there.

winter rose
#

you are doing "from to do" then "foreach"

#

not how it works. what do you want to do exactly?

grand idol
#

I have a large hashmap that contains data formatted like
["30Rnd_9x21_Mag",["30Rnd_9x21_Mag","HG",1]],
I want to grab the class name, display name, and count, then output somehow.

winter rose
#

_x, _y ?

south swan
#

if you only need to do it once - copyToClipboard helped me egress more than 10k characters at once blobdoggoshruggoogly

south swan
#

small trap: amount of data also depends on the editor you paste it into. VSCode only took 10k, stock Win10 Notepad took as much as i've tried

#

i seem to find like 40KB-ish text files of export results in my old notes now that i actually check

grand idol
#

That did it, thanks a lot.

vapid scarab
slow brook
#

Anyone else find bis_fnc_findsafepos a bit glitchy when it comes to vehicle use? sometimes it will just put a vehicle inside another when passed in to CREATEVEHICLE

#

For example

it's set a min =5, max = 100 and objMin = 5

#
private _playpos = getpos _vehicle;
private _safepos = [_playpos,5,100,5] call bis_fnc_findsafepos;
zinc loom
#
// your code here
    _i=0;
    _array = [];

    {
    _array pushBack (configName _x);
    lnbAddRow [500, [getText (_x >> "displayName"),str getNumber (_x >> "cost")]];
    lnbSetPicture [500, [_i, 2], getText (_x >> "picture")];
    _i=_i+1;
    } forEach _cfgArray;

#

is there a better way to handle thin index counter ?

slow brook
#

why not just use the arrayIndex

zinc loom
#

em , i guess the answer is yes

#

_forEachIndex ? damn you are good

slow brook
#

nah someone pointed it out to me the other day

winter rose
#

now you're both good

astral bone
#

how could I do text padding

#

1 -> 01
22 -> 22

hallow mortar
#

For numbers specifically, toFixed

#

Oh, no, that's for the other end

#
while {count _str < 2} do {
  _str = "0" + _str;
};```
winter rose
#

or```sqf
if (_num < 10) then { "0" + str _num } else { str _num }

astral bone
#

(format ["%1:%2:%3",_hour,_minute,_second]); hmm

astral bone
#

oh wait

winter rose
winter rose
astral bone
#

not quite

#

systemTime apply {if (_x < 10) then {"0" + str _x} else {str _x}}; might be it. buut apply being run every second-?

#
systemTime params ["_year", "_month", "_day", "_hour", "_minute", "_second", "_millisecond"];
        _ctrlTimer ctrlSetText (format ["%1:%2:%3",_hour,_minute,_second]);
        _ctrlTimer ctrlSetTooltip (format ["System Time:\n%4:%5:%6\n%3/%2/%1",_year,_month,_day,_hour,_minute,_second]);
        uiSleep 1;
#

Code adapted from 3DEN enhances session timer

astral bone
#

So, the apply every 1 second shouldn't be an issue?

winter rose
#

no
anyway, how else would you want to do it?

astral bone
#

I dunno, just was iffy b/c apply makes a whole new array right?

winter rose
#

zomg, an array ofโ€ฆ 7 items! ๐Ÿ˜„

astral bone
#

twice every second* b/c my events are weird xD

#

I have the same events as 3DEN Enhanced, but it's calling it twice. Shouldn't be an issue I don't think, though.

#

ok, lets try it out :P

#

horray!

#

Thank you ^^

winter rose
#

at least you didn't go mm-dd-yyyy :p

astral bone
#

hmm- what font should I use

vapid scarab
#

I really the Roboto fonts

astral bone
#

maybe I could expand it to display a clock on all- uh- primary menus?

#

idk, like main menu, in game, eden, arsenal-

#

eh well :P

astral bone
#

Why not use BIS replace with simple object function? MP, b/c it'll be local objects only so it can cause issues?
Takes a while to run it for each object?
Just curious :P

winter rose
#

most likely heavy network traffic

astral bone
#

"Try not to use too much, and never in MP"

cosmic lichen
astral bone
#

oh pfft, I didn't even realize you were who made it xD

grand idol
#

Can a hashmap be searched (in reverse) by the data in an element to find it's corresponding key?

#

Yeah, I know.

winter rose
#

wait no

astral bone
#

select?

winter rose
#

use in values _hashmap perhaps

#

OK, I'm too tired to help ๐Ÿ˜„

hallow mortar
#

select doesn't seem to have a syntax for hashmaps

astral bone
cosmic lichen
#

I'd stick to the default font set in Eden Editor

hallow mortar
#
_results = [];
{
  if (_y == _wantedValue) then {
    _results pushback _x;
  };
} forEach _hashmap;```
astral bone
#

yea, I was thinking I could try EtelkaMonospaceProBold but running code to change the font to EtelkaMonospacePro and it looks good

#

oh, is it possible to completely hide water in eden? ๐Ÿค”

winter rose
hallow mortar
#

Well, yes. The value may also be an array that you want to check for a particular element in, and so on. The _y == _wantedValue was more of a standin for whatever comparison you want to make against the value.

#

Just to demonstrate the use of _y in a hashmap forEach.

#

can I just say how much I hate the kerning on _y

winter rose
grand idol
wintry stone
#

New with Arma 3 editing but for making Ai movie to locations where do you even start?

winter rose
#

you could e.g use waypoints ๐Ÿ™‚

cosmic lichen
#

Waypoints

wintry stone
#

Okay before I even get that far.. Would it worse in zues mode and if so how do I add zues into my scenario

humble bough
wintry stone
#

Thanks

manic sigil
# wintry stone Okay before I even get that far.. Would it worse in zues mode and if so how do I...

To add zeus, you should choose if you want a playable unit or to start as zeus.

If you want a playable unit, place one unit down and set them as playable, and give them a Variable name - double click and add a name in the top bar.

Then, press F9 to open the tray of modules and search for Game Master; place one down, double click on it, and set Owner to whatever variable name you gave the playable unit.

(Feel free, anyone, to chime in and correct terms :p)

wintry stone
#

No playable as Zeus

winter rose
manic sigil
granite sky
wintry stone
#

I just wanted to do Ai battles and I keep learning more stuff Lmao.

winter rose
#

just for AI battles? place units in the Eden Editor, press play, enjoy ๐Ÿ™‚

zinc loom
#

does ct_combo use lbCurSel ?

cosmic lichen
winter rose
#

OFP vibes ๐Ÿ‘ด

#

drive around with the Skoda sport model, etc ๐Ÿ˜Š

manic sigil
wintry stone
winter rose
winter rose
wintry stone
#

Sorry if I dint ask in the correct channel first.

winter rose
#

you can either start the Eden Editor, place entities around, press play
play any Zeus scenario where you can place units in real time
create your own Zeus scenario (overkill)

winter rose
wintry stone
#

Planing on just dropping units in and issuing them commands in Zeus.

winter rose
#

you can play Zeus, available in Singleplayer missions

wintry stone
#

How does that work in single player?

zinc loom
#

me again,

        _vAmount =(_x select 1) * (_vItem select 1);
        _return = _return + _vAmount ;

is something wronf with this lines ?

slow brook
#

Yeah

#

_return = 0;
_vAmount =(_x select 1) * (_vItem select 1);
_return = _return + _vAmount ;

#

Also, what is _x

zinc loom
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
tidal aurora
#

how come my diag_log messages do not show up int .rpt file even if it is in the first line of init.sqf? (non-dedicated lan server)

zinc loom
#
// your code hereJF_calculateFreevTrunkSpace=
{
    params["_obj"];
    _return = 0;
    _vTrunk= _obj getVariable ["JV_vTrunk",[]];
    if (_vTrunk isEqualTo []) then 
    {
    } 
    else  
    {
        {
            _vItem = [_x select 0] call JF_returnvItemInfos;
            _vAmount =(_x select 1) * (_vItem select 1);
            _return = _return + _vAmount ;
        } forEach _vTrunk;
    };
    _return

};
#

tone of this 2 lines makes it generic error

winter rose
wintry stone
#

Oh it should be easy then.

winter rose
zinc loom
#

em kinda yea, //_return = _return + _vAmount ;

tidal aurora
zinc loom
#

it displays now something, not the right thing, but not 0

#

if i uncomment that line, all goes wrong , i have to check my datatypes, i think imade somewhere a misktake

slow brook
#

IS _X an array type or int

#

sorry, what values are you storing in the array for the trunk

#

and full error

#

from RPT

zinc loom
#

no, x looks like [string,int]

slow brook
#

So.. vtrunk is [[Name,0],[Name,1]]

zinc loom
#

yes sir

#

well numbers are different, but jyes

slow brook
#

RPT error

tidal aurora
winter rose
#

ah, most likely a cache issue then

tidal aurora
#

arma works in mysterious ways

winter rose
#

the real game difficulty ๐Ÿ˜„

zinc loom
#

@slow brook ty for support but i dont know what sthis rpt thing is, and i changed all return to int and it works now ... no clue

#

_return is not _int ...

slow brook
wary sandal
#

is there a command that prevents an ammo (PG-7 rocket for example) from exploding when I strap it under a drone?

#
_veh = this;
_pos = position _veh; 
_shell = "R_MRAAWS_HEAT_F" createVehicle _pos;
_shell enableSimulation false; 
_shell attachTo [_veh, [0,0.17,-0.13]];
_veh setVariable ["attachedShell", _shell];
#

when I attach this shell to a darter and take it out flying, 30-60 seconds later the shell randomly detonates

sullen sigil
#

disable damage perhaps?

fair drum
#

ammo usually auto kills itself off after a certain time

wary sandal
granite sky
#

Make a simple object of the model maybe.

fair drum
#

best to create and attach the model, then do your own custom explosion scripting

wary sandal
#

is there a wiki article explaining it?

fair drum
#

no, you just create an ammo like you do above, then destroy it early

#

you just use the model so you have something inert, then build the explosion when you want

wary sandal
#

so I create a simple object with the model of the MRAAWS heat rocket and summon another one that is not a simple object when I want it to explode?

fair drum
#

aye

wary sandal
#

this solution worked like a charm, thanks

#

for this kind of script ran in the init field of objects, should i make it so only the server runs the code?

#

i've read that code in init fields runs both for the server and for the client

#

which I don't think is necessary if i simply want the rpg ammo to detonate when it touches something

fair drum
#

Yes put a server filter in it

wary sandal
#

alrighty

winter rose
dreamy kestrel
#

Q: I'm looking for a table or something that enumerates the known, prevailing wisdom, suggested, recommended, whatever, magazine types...
got a situation where I think what I have are some handgunWeapon compatible items and magazines, but seems to be reporting a secondary or GL magazine type... it could be that my 'source of truth' is missing the mark, so I'd like to compare notes and adjust accordingly.
thanks...

granite sky
#

At a config level it's just magazines[] and magazineWells[], but yeah, compatibleMagazines is super helpful.

dreamy kestrel
#

yes but I am also discerning 'primary' magazine from 'secondary' i.e. GL, or sidearm, which I guess can also be 16 ... defined as TYPE_MAGAZINE_SIDE_GL in my case. so I need to verify the weapon type itself in that instance...

#

I think I see what I did...

zinc loom
#

if i have _temp = int (5%2); is that ok ? and whaat is t he result ? can i somehow make sure the result is allways rounded down, no mather what ?

dreamy kestrel
#

which a bit about what I am driving at, I want to visualize both the occupied slots as well as the unoccupied ones appropriately, as either the ghost magazine or GL round, whichever is appropriate. but I think I see what I did in terms of weapon type. case of incorrect class, I think, mistaken identity. anyway. got some sorting out to do there.

zinc loom
#

or something like( a - (a mod b) )%b ?

granite sky
#

you mean round ?

#

mod and % are synonyms in SQF, I think. Aside from the precedence.

zinc loom
#

no i think i need floor ty !

granite sky
#

oh that part, yes.

#

floor (5.5%2) = 1

winter rose
sullen sigil
flat eagle
#

when using remoteExec do i need to use it when spawning AI on a server? or is it ok to just use execVM?

winter rose
flat eagle
#

i want to to spawn some AI using a script. when the server goes to use the script to spawn the AI is it OK if the script is just executed on the server or does the script have to be executed on all machines(clients)?

granite sky
#

If you createUnit some AIs on the server then they're visible everywhere with the same gear.

winter rose
flat eagle
#

ok so if it get executed on all machines it will create too many AI

winter rose
#

yup
one spot of creation, global effect = broadcast to all systems already ๐Ÿ™‚

flat eagle
#

thanks Lou

granite sky
#

Unless an object creation function has "local" on the end you can assume it's creating it with global effect.

zinc loom
#

i ahave a problem :

i use a function, in this function, that is triggered by a button in a dialog, this function checks a combobox, and uses the index to do something ... everything works, as soon as i press the button, but if i switch the combobox, the dialog changes everything correctly, but if i press the other resource, it still loads the one selected in the first procces

#

not sure what to share ...

#
JF_LoaderDialog_loadButton=
{
    _display = findDisplay 110;
    _displayData = _display getVariable ["JV_LoaderDialogData",[]];
    _obj = _displayData select 0;
    _vTrunkSize = _obj getVariable ["JV_vTrunkSize",0];
    _vTrunk = _obj getVariable["JV_vTrunk",[]];
    _giver = _displayData select 1;
    _index =lbCurSel 30;
    _giverData = _giver getVariable ["JV_vItemsAvalible",[[]]];
    _vItemDeposit = (_giverData select _index);
    _vItem = [_vItemDeposit select 0] call JF_returnvItemInfos;
    _usedvSpace = [_obj] call JF_calculateUsedvTrunkSpace;
    _vSize = _vItem select 1;
    _int = floor ((_vTrunkSize -_usedvSpace) / _vSize);
    
    ///check if we have space, use double or single click method
    
    if (_int > 0) then 
    {
        if (_this select 0) then 
        {
            [_obj, _vItem,_int]call JF_createvItemsInvTrunk;
        
        }
        else
        {
            [_obj, _vItem,1]call JF_createvItemsInvTrunk;
        };
    

        /////refresch lnb
        _vTrunk = _obj getVariable["JV_vTrunk",[]];
        lnbClear 500;
        {
            lnbAddRow [500,[(_x select 0), str (_x select 1),"0"]];
        }forEach _vTrunk;
    
        _usedvSpace = [_obj] call JF_calculateUsedvTrunkSpace;
        ctrlSetText[102, "Space: "+ str _usedvSpace +"/"+ str _vTrunkSize];
        lbsetcursel[30,0];
        ctrlSetFocus (_display displayCtrl 30);
    };
};

#

its line _index would not be refreshed ...

granite sky
#

lbsetcursel[30,0];

#

This re-triggers, I think.

#

So it'll just call that function again with index 0.

zinc loom
#

?

#

the last 2 lines are just a test

#

i deleted them

granite sky
#

Don't post code that you're not running then.

zinc loom
#

i deleted it because i thought it retriggers without a reason, so yes, i deleted it after your comment

#

your comment was the reason, it was in the code, 1 minute ago ..

#

still same result

dreamy kestrel
#

got a problem with weaponsItemsCargo, and it's kind of a critical one, IMO... curious to find workarounds... as long as the platform takes only one way to load, sidearms, launchers, for instance, it is fine, I can discern the primary mag, it is always the first one.

however, consider a primary weapon that takes a muzzle load as well as a mag load, when either is loaded (conversely unloaded), then I can no longer discern primary from secondary based upon the weapon info description alone. i.e.

// Loaded with primary mag only:
[["arifle_AK12_GL_F","ACE_muzzle_mzls_B","rhsusf_acc_anpeq16a","",["rhs_75Rnd_762x39mm_89",75],[],""]]
//                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^

// Loaded with secondary muzzle only:
[["arifle_AK12_GL_F","ACE_muzzle_mzls_B","rhsusf_acc_anpeq16a","",["1Rnd_HE_Grenade_shell",1],[],""]]
//                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^

starting to see the kerfuffle? it's kind of critical, because there is a sense in which I'd like to bitmask across the range, and/or with indexes, reliably, but with this being the case, not so much. or at least not without a transform swapping mag slots to start with.

suggestions?

sullen sigil
#

pistols have this same system too, just isn't visible in inventory

granite sky
#

I don't get it. What are you trying to achieve?

#

Like if the question is "does this weapon fire bullets or just grenades" then weaponsItemsCargo is not the method.

dreamy kestrel
#

I am presenting a CT_LISTNBOX with certain positional rows being the secondary (GL, when available) or primary magazine. this approach breaks when faced with inconsistent results from weaponsItemsCargo.

granite sky
#

It sounds like you'll have to do it the hard way?

#

Look up each muzzle's compatibleMagazines and check it against the loaded mags.

dreamy kestrel
granite sky
#

hmm. If both are loaded then it puts them in the "right" place?

dreamy kestrel
#

bingo correct. but one is unloaded.
I can check against the compatibility, which I am, but I am still left with the inconsistent weapon info.

granite sky
#

So what's the problem?

#

You know there's a muzzle version of compatibleMagazines, right

dreamy kestrel
#

in the second instance I would half expect:

[["arifle_AK12_GL_F","ACE_muzzle_mzls_B","rhsusf_acc_anpeq16a","",[],["1Rnd_HE_Grenade_shell",1],""]]

If I am holding to the documented semantics.

granite sky
#

It's probably bugged but then it's Arma. It's a lot more reliable working around stuff when you can rather than begging people to fix it.

#

In this case there's a straightforward workaround with compatibleItems on the primary muzzle.

dreamy kestrel
#

compatibleItems? primary muzzle?

granite sky
#

compatibleMagazines :/

dreamy kestrel
#

I am already using those, like I said, but I am assuming that the masking/slots are 'correctly' aligned...
so back to the weapon info shape itself, the magazine type for a GL round is 16? or more precisely, I suppose, gauging 'all' the types for all the compatible magazines, and ordering accordingly.

dreamy kestrel
#

okay doke, this will sort of get me there. notwithstanding some effort to massage a useful function out of it, but it is a start.

_y = cursorobject;
_cfg_mags = configfile >> 'cfgmagazines';
_cargo = weaponsitemscargo _y;
_info = _cargo select 0;
_class = _info select 0;
_mags = _info select [4, 2];
// _mags;
_mag = _mags select 0 select 0;
// _mag;
_compat_mags = compatiblemagazines _class;
_mag_types = _compat_mags apply { _cfg = _cfg_mags >> _x; getnumber (_cfg >> 'type'); };
_base_count = count _mag_types;
_mag_types = _mag_types arrayintersect _mag_types;
_mag_types;

assuming cursorobject is the vehicle in which the weapon is inventory. also assuming the GL is loaded and not the primary mag.
but in this case the distinct mag types count exactly 2, which I suppose is not surprising.
anyway ๐Ÿป

dreamy kestrel
#

alright so back to the fundamental fundamental question about magazing types, where in the docs are they enumerated?

warm hedge
#

CfgMagazines

dreamy kestrel
#

for example, I think I should have 32 for handgun magazines, but instead I found a 16... does not seem that consistent. oh strike that, I read it wrong. ๐Ÿ™‚

warm hedge
#

Wait, what are you asking exactly?

dreamy kestrel
#

when we are scanning a config for magazine types... interpreting those values.

warm hedge
#

Again CfgMagazines

#

Or simply check in-game

dreamy kestrel
#

I have what I need, I think, but if I am missing something re: the actual types... would be handy to know more about what I do not know. ๐Ÿ˜‰

warm hedge
#

Actual types?

#

I have no idea what are you talking about

dreamy kestrel
#

there is way too much context to bring you up to speed. it all started learning more about the finer points about weaponsItemsCargo when the platform was unloaded...

warm hedge
#

Platform?

dreamy kestrel
#

weapon, class name

#

in context of accessories, mags

warm hedge
#

Okay, please write down what exactly is your goal

#

I'm still wondering because I can't understand you

dreamy kestrel
#

more generally inventory manager, fully interpreting weaponsItemsCargo

warm hedge
#

And in case of something like that, why you need to have CfgMagazines list?

dreamy kestrel
#

I am mid-way through a hybrid virtual arsenal / inventory manager project which stitches all that stuff together in a cohesive UI framework.

#

not so much the mags list itself, although I do need that for arsenal purposes, that much is sorted through. more the weaponsCargo interpretation, especially when you have a partially loaded primary weapon, with GL and/or mag.

#

it breaks the pattern described in the docs.

#

and I need to know how to interpret mags by their types.

#

but like I said, it's a lot of context, and do you really want to go that deep with me?

warm hedge
#

Small arms (personal weapons) magazines don't have any types where it goes

#

But weapons determine where it goes

warm swallow
#

can ctrlSetText be used with remoteExec?

winter rose
#

no, controls are local

warm swallow
#

is there any way to do it over network then?

warm swallow
#

for me, ctrlEnable was working with it

winter rose
#

I doubt that heavily. strongly, even

warm swallow
#

wtf

warm hedge
#

I don't know why you want to remoteExec them?

winter rose
# warm swallow wtf

if you use remoteExec it may work, but only on the local machine
as in, "hey, send this to everyone and yourself!" and the machine only applies it to itself

that's about it

warm swallow
#

but then why wouldnt ctrlEnable work, odd

warm swallow
winter rose
#

just don't use it for that
there is a conception mistake in your code

warm swallow
#

@winter rose is there another workaround I can use to get this to work? I am just trying to open the UI on another client when they use an ace interaction.. i must be forgetting something

winter rose
#

not going there

warm hedge
#

Tell the client to open their UI in THEIR end

warm swallow
#

is that not what remoteExec does, exec where the given client is local?

#

"The order will be executed where the given object is local"

winter rose
#

do you remoteExec code, or do you remoteExec the command

warm swallow
#

I will reexamine my code, thank you @winter rose

warm swallow
#
setup =
                    {
                        params ["_target"];

                        createDialog "setup";
                        _tagData = _target getVariable "setup_data";
                        {
                            _x params ["_idc", "_data"];

                            ctrlSetText [_idc, _data];
                            ctrlEnable [_idc, false];
                        } forEach _tagData;
                    };

                    [_target] remoteExec ["setup", _player];
#

not sure if I went in the direction I was supposed to, but I moved all my code intended to be run locally under one function.
The _tagData returns what it should, and the fields are disabled, but can still not set the text. rip

proven charm
tender fossil
#

How do people here stay motivated to work on a (larger) project if you don't have a community continuously playing the stuff you're making? It feels very lonely to me and I struggle to finish my tasks not only but also because of that. I worked on a gamemode I was less interested in than my main project for years since it was much more rewarding to be surrounded by a community

cosmic lichen
#

Release it to the public I guess?

tender fossil
little raptor
zinc loom
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
tender fossil
zinc loom
#
JF_LoaderDialog_loadButton=
{
    _display = findDisplay 110;
    
    _ctrl = _display displayCtrl 30;
    _index = lbCurSel _ctrl;
    
    _displayData = _display getVariable ["JV_LoaderDialogData",[]];
    _obj = _displayData select 0;
    _giver = _displayData select 1;
    
    _vTrunkSize = _obj getVariable ["JV_vTrunkSize",0];
    _vTrunk = _obj getVariable["JV_vTrunk",[]];
    
    
    
    _giverData = _giver getVariable ["JV_vItemsAvalible",[[]]];
    _vItemDeposit = (_giverData select _index);
    
    _vItem = [_vItemDeposit select 0] call JF_returnvItemInfos;
    
    _usedvSpace = [_obj] call JF_calculateUsedvTrunkSpace;
    _vSize = _vItem select 1;
    
    
    ///check if we have space
    _int = floor ((_vTrunkSize -_usedvSpace) / _vSize);
    if (_int > 0 && lbCurSel 30 != -1) then 
    {
    //    [_obj, "CopperOre",1] call JF_createvItemsInvTrunk;
    //    [_obj, "CopperIngot",1] call JF_createvItemsInvTrunk;
        [_obj, _vItem select 0,1] call JF_createvItemsInvTrunk;
    

        /////refresch lnb
        _vTrunk = _obj getVariable["JV_vTrunk",[]];
        lnbClear 500;
        {
            lnbAddRow [500,[(_x select 0), str (_x select 1),"0"]];
        }forEach _vTrunk;
    
        _usedvSpace = [_obj] call JF_calculateUsedvTrunkSpace;
        ctrlSetText[102, "Space: "+ str _usedvSpace +"/"+ str _vTrunkSize];
    };    
    
};
#

i teste4d this function now and i have a problem, as soon as it runs it looks like _index = lbCurSel _ctrl;gets kinda frozen, does not change

#

any ideas

#

a button runs this function ...

#

ctrl 30 is a combo box

#

if i press the button, its like _index stays the same all the time

#

if that doesnt work, any similar gui parts like the combo box ? type 4

cosmic lichen
#

lbCurSel 30
try
lbCurSel _ctrl

#

Generally speaking. Try to avoid the syntax that uses idc but instead use the one that directly references the control

#

If that doesn't help. Add some logging to make sure all variables are what they are supposed to be.

zinc loom
#

it does not , the code uses this in line 5 and 6

#

would you help me and explain, how do i do the logs?

#

who do i check runtime state of variables ? im pretty new

#

i want the _indec _vItenDeposit and _vItem to be logged every thime this function fires, diag_log format ["%1, %2, %3", _ index, _vItedDeposit, _vItem];

kindred tide
#

how can i check what type of vehicle the unit is in?

#

(helicopter, car etc)

proven charm
zinc loom
#

diag_log format ["%1, %2, %3", _index, _vItemDeposit, _vItem]; is this ok ?

kindred tide
#

ooh, does it matter how far down the class hierarchy it is? e.g if it's CarC : CarB : CarA : Car, would it still return true for whether a CarC is Car?

warm hedge
#

Yes

kindred tide
#

okie, thank

drifting portal
#

(And a test to my skills)

#

Just always expect something to not succeed and you are doing it only for your fun and amusement

zinc loom
#

@drifting portal wanna team up ? so we can waste our time together ๐Ÿ™‚

drifting portal
zinc loom
#

im coding a new rpg framework (and im a total noob), so if someone is interested in guiding me , pm me, i ahve a private server and the mission will be definitly played ...

tender fossil
wary sandal
#

How can I tell an UAV to fly at an exact point in the world?

#

I'd like it to fly carelessly straight into wherever I want it to go

drifting portal
#

You want it to crash?

wary sandal
#

can that be scripted?

drifting portal
#

I guess make it so that when it reaches a certain area it directs itself towards the point to crash into and give it a speed boost

#

Or you could use velocityTransformation or Bis_fnc_UnitCapture

tender fossil
# zinc loom im coding a new rpg framework (and im a total noob), so if someone is interested...

Funny coincidence, the project I'm talking about is a RPG framework (or more like a gamemode and not a framework if strictly defined). I wish you the best of luck, since based on my experience RPG is the hardest category (or one of the hardest at least) in game/Arma development to get it right. The code gets complex quite easily too, but I find the game design the most difficult aspect of it since everything in multiplayer RPGs is very context sensitive

wary sandal
#

sure I can script the movement of the drone myself but i don't think it'd be realistic

drifting portal
#

I'm not sure why you need it to pass through an exact point if its not a scripted sequence

manic sigil
zinc loom
#

i do not think rpg is the hardest, since rpg is based a lot in game mechanics, which can be added 1 by 1, a lot of the times you just add 1 new vItem with working actioons ...

#

rpg can be developed in different ways, all other styles have a specific

tribal sinew
#

I have a server only trigger that does [48, [0.049, 0.09, 87]] remoteExec ["setFog", 0]; from an sqf file (and a couple different things).

What's weird - the fog doesn't appear for my player unit when testing this on a dedicated server but when I go into spectator mode it actually works.

tribal sinew
wary sandal
manic sigil
manic sigil
wary sandal
#

basically just a piloting assist that automatically crashes the drone into whatever

tribal sinew
#

whats also interesting, when I do skiptime (around 1 hour) the fog appears

#

okay, ive tried skipTime 1 before doing the setFog

#

and it works properly now

manic sigil
#

I mean, you are also giving it like 48 seconds to grow to that value :p

tribal sinew
#

yes, thats intentional

#

the fog seems to be set only if its not night anymore ๐Ÿค”

manic sigil
vapid scarab
#

@manic sigil sup!

hallow mortar
#

You're probably going to want some kind of setVelocity/setVectorDirAndUp/setVelocityTransformation stuff. Trying to get the AI to do it on its own is likely to be either impossible or not worth the effort

manic sigil
#

As Nikko said; the AI is all about avoiding hitting things. Overwriting that is gonna be a real trick; either forcing the drone to do it, or deleting the drone and replacing with a guided munition with a drone attachTo'd the top.

dreamy kestrel
vapid scarab
manic sigil
vapid scarab
#

Hmmmmmm. As an alternative for the question OP, may I suggest trying to make this problem simpler?

hallow mortar
#

Using vectorFromTo should make it fairly simple as long as you don't need proportional guidance (leading)

dreamy kestrel
wary sandal
wary sandal
manic sigil
#

This is why I ask for player perspective, it gets the intent across easier and leads to more feedback ๐Ÿ™‚

wary sandal
dreamy kestrel
manic sigil
astral bone
#
while {is3DEN} do
{
    (systemTime apply {if (_x < 10) then {"0" + str _x} else {str _x}}) params ["_year", "_month", "_day", "_hour", "_minute", "_second", "_millisecond"];
    _ctrlTimer ctrlSetText (format ["%1:%2:%3",_hour,_minute,_second]);
    _ctrlTimer ctrlSetTooltip (format ["System Time:\n%4:%5:%6\n%3/%2/%1",_year,_month,_day,_hour,_minute,_second]);
    uiSleep 1;
};```
I'm wondering if maybe I should do a waitUntil or something for the second to change, then begin the loop, so it doesn't initialize the loop at 1 second and 99 miliseconds xD
#

Also might make a clock viewable from the menu. So if you want to know the time, just pause the game.
Or maybe it should be in the map, or in game- Thoughts?

#

System time* not the in game time :P

stray jackal
#

I think it's going to be the same regardless since you're using systemtime

astral bone
#

Yea, but the uiSleep will make it so it updates only 1 time every second

grizzled lagoon
#

Hello, is it possible to detect when a player leaves the server or fails to connect using a script included in a mod?

grizzled lagoon
#

yes but it runs on the server, not the client

proven charm
grizzled lagoon
#

yes

proven charm
grizzled lagoon
#

thks i look that

upper siren
#

Hello! not sure how to google this but is there way to press the "ESC" button twice with SQF?

warm hedge
#

To do what?

upper siren
#

I've got some ACE Spectator remnants in the "Select respawn location" screen after dying that only disappear after hitting ESC twice.

proven charm
grizzled lagoon
#

Hello, I have problem with my function. I execute it with the "preInit" argument for loads when the game starts, but when i use spawn to create a loop within the function, it doesn't work. Do you have a solution to resolve this problem?

kindred tide
#

is destrType the most reliable way to check if some object is destructible?