#arma3_scripting

1 messages Β· Page 550 of 1

winter rose
#

time to get your brain back, by a good night(day?) of sleep!! 36 hours e_e

exotic tinsel
#

yeah im crap arma dev. but still i dont know why my map icons thing isnt showing incapacitated players

winter rose
#

I am myself making biki edit mistakes after being up for 15 hours sooo πŸ˜„

#

on it

still forum
#

side _x isEqualTo west dead players are of side civilian.

exotic tinsel
#

im not doing that. im using allplayers

#

check the code plz

still forum
#

should I repeat myself?

#

You are filtering players who'se side is west

exotic tinsel
#

yes do it

#

let me double check

still forum
#

im not doing that.
It's right there in line 3.

winter rose
#

yup
try maybe filtering by faction or something

still forum
#

I think you can check side of group instead?

winter rose
#

that too

exotic tinsel
#

im gonna do this instead
(side _x isEqualTo west) || (side _x isEqualTo civilian)

winter rose
#

but I don't know if it is valid after the unit has been found as dead, I would need to check

#

side _x in [west, civilian]

still forum
#

have you checked that lifeState of your players really returns INCAPACITATED ?

exotic tinsel
#

if (((lifeState _x) isEqualTo 'INCAPACITATED')) then

still forum
#

Yes. Yes I can read your code.

winter rose
#

also you should use Code instead of String in your event, if you use some IDE code highlight will work better

still forum
#

Have you checked?

exotic tinsel
#

yes just now, i confirmed they are incapacitated

#

wait 2 min, running test now

still forum
#

also you should
there are many "also you should" in that piece of code :D

So while your code doesn't show any icons,
(allPlayers select {side _x in [west, civilian]}) apply {lifeState _x}
in debug console does show incapacitated units?

exotic tinsel
#

the script works great, just doesnt show incapacitated players atm.

exotic tinsel
#

@still forum @winter rose

still forum
#

Didn't answer my question

in debug console does show incapacitated units?

#

need to make sure the basics work, before looking into that big script with multiple potential issues

exotic tinsel
#

yes it does, it shows the player i just incapacitated as civ and me as west

[] spawn {{ 
    hint format ["%1 - %2",name _x, side _x]; 
sleep 5;
} foreach (allPlayers select {side _x in [west, civilian]}) apply {lifeState _x}; 
};
#

also all other west vehicles show up on the map just fine. with the code i shared in link

still forum
#

What?

#

that code doesn't work

#

either you pass a nil into apply instead of an array.
or your _x is a string, can't get name or side from a string

#

also instead of hint and sleep, I'd recommend systemChat no need to wait if you can see the whole list of outputs

#

(allPlayers select {side _x in [west, civilian]}) apply { systemChat str [_x, name _x, lifeState _x, (lifeState _x) == 'INCAPACITATED']; };

exotic tinsel
#

ok, the code i shared here does work i can share the images. so not sure what u mean.

#

the code in link does show all west vehicles and us when we are alive on the map but not when incapacitated.

still forum
#

The code doesn't make sense

#

It can run in two ways, depending on the precendence of foreach vs apply.
And both ways are errors.

exotic tinsel
#

you are correct, this does not work.

[] spawn {{ 
    hint format ["%1 - %2",name _x, side _x]; 
sleep 5;
} foreach ((allPlayers select {side _x in [west, civilian]}) apply {lifeState _x}); 
};
still forum
#

Variant 1:

({} foreach (allPlayers select {side _x in [west, civilian]})) apply {lifeState _x};

forEach takes precedence over apply, forEach returns nil. You then run nil apply {lifeState _x}
which is nonsense.
Variant 2:

{} foreach ((allPlayers select {side _x in [west, civilian]}) apply {lifeState _x});

apply takes precedence. Apply returns array of strings. _x in forEach is string, neither name nor side take string

exotic tinsel
#

i add parenthesis around the apply

still forum
#

As I wrote above

in debug console does show incapacitated units?
in debug console. In a watch field.

#

If you don't want to use a watch field, you can use

(allPlayers select {side _x in [west, civilian]}) apply { systemChat str [_x, name _x, lifeState _x, (lifeState _x) == 'INCAPACITATED']; };

to print to chat.

exotic tinsel
still forum
#

perfect. So all is good in the input data coming to your script

#

Do you have error message popups enabled?

#

have you checked the RPT?

#

maybe your loop errors and that's why it doesn't show them

#

Actually.

#

yep

#

your code has syntax error

#

Line 45.
_sideColor = _sideColor = 1,0.41,0,1;

exotic tinsel
#

about to test. Im on our production server cuz my local dev doesnt allow players to connect for testing atm. so no client errors are not enabled and nothing is showing up in the rpt for the server

#

that syntax error fix didnt change anything

winter rose
#

do you have errors displaying?

exotic tinsel
#

no

winter rose
#

do you have -showScriptErrors flag?

exotic tinsel
#

no its our production server, i dont have access to the commandline

winter rose
#

for your client I mean?

exotic tinsel
#

yes but it doesnt show anything

#

AH SHIT IT WORKS!

#

im tarded again. sorry @still forum and @winter rose

still forum
#

You can go to bed now πŸ˜„

exotic tinsel
#

i converted that side color to string instead of array. lol

#

yes bed so much bed

#

well hangon

#

so how can i get this script to run for GPS?

winter rose
#

NOOO

#

go to bed πŸ˜„

tough abyss
#

Line 45.
_sideColor = _sideColor = 1,0.41,0,1;
He has been told about incorrect colour 5 hours ago, looks like waste of time tbh

exotic tinsel
#

lol, ur Criticizing me for being afk and not reading messages, while just a few lines above you can see that we fixed it and i took others advice.

#

@tough abyss

#

So glad you guys figured this out. thank so much.

still forum
#

Well you could atleast read messages that mentioned and pinged you and told you the solution to your problem

Instead of going all "OMG ARMA! SO BUGGED! EDIT WIKI IMMEDIATELY!" and wasting multiple peoples time to solve the same problem again, while it was already solved for you.

exotic tinsel
#

i left the channel open so when i came back to computer i didnt have the message.

#

real life happens sometimes

#

rarely but sometimes

tough abyss
#

So you ask and ask and ask because you don’t read replies? Let it be a lesson to next person wanting to help you

winter rose
#

Guys…

exotic tinsel
#

again i left the channel open so when i came back there was no alert and loads of messages since i left. while i have flaws im glad one of them is not being rude to others and bashing.

#

thanks again.

thorn mural
#

Has anyone else problems with scripting command "in" ?

#

Official example gives me a syntax error: _isInString = "foo" in "foobar"; // true

#

with arrays it just works fine, seems only to be corrupt with strings

exotic tinsel
#

@thorn mural try using find

astral dawn
#

@thorn mural yeah you are right, it doesn't work with strings for some reason in arma

thorn mural
#

yeah im doing that right now

winter rose
#

It will work, string in string is v1.95 (dev build)

still forum
#

noone reading the version notes ┬─┬ γƒŽ( γ‚œ-γ‚œγƒŽ)

astral dawn
#

Somehow when I read 'since' my brain thinks about past time or smth which has already happened πŸ€”

winter rose
#

All this wiki for naught!

hot kernel
#

it's not for naught, @winter rose , some of us use that wiki like it's a sacred text-- and to say we appreciate the contributors would be a gross understatement.

winter rose
#

Don't worry; I serve the wiki and it is my joy πŸ˜‹ πŸ˜‰

queen cargo
#

Better one starts implementing that in sqf-vm then

tough abyss
#

Lol, you have to keep up with all new commands haven’t you?

dreamy kestrel
#

How do you list mods as required, optional, etc, for a server mission? Is this something done via script? Or server config?

stiff stone
#

@dreamy kestrel are you using a dedicated server?

sullen gyro
#

has anyone messed around with the v44 armed and adding weapons to it? I cant seem to get the turret path figured out for it.

this addWeaponTurret ["cannon_125mm",[1]];

this works but fires from an imaginery turret above the vtol. I've tried lots of [1,1] combinations for turret path with no luck. I'm very new to this btw.

mortal wigeon
#

What's a simple way to attachTo a unit's bone so it follows the bone's rotation?

#

this bush1 attachTo [fugitive1,[0,0,0], "pelvis"]; does not follow the units rotation as he stands/goes prone etc.

#

always remains vertical

young current
#

you cant do such attach

runic quest
#

Excuse me, I would like to write a code on the special equipment (clothes, trousers) so that when this item is lost, it can not be picked up by anyone. Which grammar of Wiki should I refer to? Thank you.

young current
#

you would need to compensate vector direction changes for each frame

mortal wigeon
#

that sounds like a pain

young current
#

attachto is not meant to attach new parts to characters

#

if you want to introduce yourself to vector mathematics then you can solve the problem

#

or you can figure out some simpler way to do whatever it is you want to do

plain current
#

htmlLoad in lobby, possible?

#

With the display config and running __EVAL or something to run the htmlLoad command? What about allowedHTMLLoadURIs in CfgCommands?

dreamy kestrel
#

What sort of scripting and/or server side configuration do I need to do in order to white/black list certain mods, or allow some as optional?

hallow mortar
#

Is there any particular reason why setAperture doesn't do anything if used in initPlayerLocal.sqf? It's supposed to be local and I need it to be JIP-safe, so I figure it should work.

errant patio
#

What are the best resources for learning about the FSM Editor and how to create good FSM scripts?

astral dawn
#

Wiki should have good info about that

#

Also @errant patio you can open someone's FSM and see how it works, you can take VCOM's FSM for example

errant patio
#

alright, i'll take a look at that too. not planning to use it to control AI per se, but seeing how something like that ticks should be helpful πŸ‘

hearty plover
#
23:24:34 [1.07856e+006,28939.7,8.616,"XEH: PostInit started. MISSIONINIT: missionName=4th_Battalion_MSO, missionVersion=53, worldName=pja310, isMultiplayer=true, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
23:24:34 [1.07856e+006,28939.8,8.616,"CBA_VERSIONING: ace=3.12.6.43, cba=3.12.2.190909, zen=1.4.1.10, acex=3.4.2.13, ctab=2.2.2.1, acre=2.7.1.1016, mrhsatellite=1.52.4, "]
23:24:35 "8.616 MCC Medic System: Can't init ACE medic is on"
23:24:35 [ACE] (common) INFO: ACE is version 3.12.6.43.
23:24:35 [ACE] (common) INFO: CBA is version 3.12.2.190909 (min required 3.9.0)
23:24:35 [ACE] (common) INFO: Extension version: ace_break_line: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_parse_imagepath: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_medical: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_clipboard: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_fcs: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_advanced_ballistics: 3.12.0-8ddde18
23:24:35 [ACE] (nametags) INFO: ACRE Detected.
23:24:35 [ACRE] (sys_io) INFO: Pipe opened.
23:24:35 [ACRE] (sys_core) INFO: Loading Map: \MAK\ProjetA3-10\pja310.wrp with radio signal code 5
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35   Error position: <>
23:24:35   Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35   Error position: <>
23:24:35   Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35   Error position: <>
23:24:35   Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35   Error position: <>
23:24:35   Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35   Error position: <>
#

Anyone have any idea what this error is telling me?

wide anchor
#

I'm interested in writing a script that would allow a trader/s, for example Black Market Trader to be the only available sell point for certain items. Excluding or blacklisting the selected traders from being able to sell a (item_x) for a player if not listed.

Ive searched online for all the information i could but nothing really defines this function/script I'm trying to create plus being a noob doesn't help either, lol. If someone out there has the knowledge on how i would go about this could you please help me out.

As of now i have a Black Market Trader and Farming on my server but the items from farming i would like them only to be sold at the Black Market Trader. As of now your able to sell them at all traders, how can i fix this or can someone direct me into the right path to writing a script for this to add into the server to prevent those items from being sold at the other available traders UNLESS its a Black Market.

How would i go about getting this added?

tough abyss
#

@hallow mortar It should work, you must be doing something wrong

#

@errant patio wiki + learn from other FSM scripts

#

@wide anchor traders are not a part of vanilla package, you find better response if you ask at the relevant forum/discord

wide anchor
#

@tough abyss thanks

still forum
#

@hearty plover

Anyone have any idea what this error is telling me?
uh....
23:24:35 Error Missing )
you are missing a paren there. Do you use canInteractWith anywhere? is your ace maybe corrupted?

pallid gorge
#

Guys i'm bulding a tvt cache hunt type and i wishing if anyone can help me i am new to scripting so i need to spawn opfor player with a cache randomically anyone know how to make this ?

spiral compass
#

@finite dirge can confirm that the script did not work

hearty plover
#

I don't call that anywhere in my code. I will reinstall mods, hope that fixes it.

hallow mortar
#

@tough abyss I'm not sure what I could possibly be doing wrong. My initPlayerLocal.sqf consists of one line: setAperture 4.5;

tough abyss
#

Try other values, 200 for example, does screen go dark?

hallow mortar
#

I know the value is fine because when I run it in the debug console, the change is obvious

tough abyss
#

Does the script run? Add systemchat before and after setaperture

hallow mortar
#

The script is running. I see both systemChat messages.

tough abyss
#

Is this the only setAperture command in mission?

#

Somebody can explain me difference between this example, i dont remember.

if ((condition) && {condition}) then {};
if ((condition) && (condition)) then {};
#

In the first example second condition only checked if first condition is true

#

ok ty

winter rose
#

@hallow mortar maybe try sqf waitUntil { not isNull player }; // sleep 1; // test that if it doesn't work without it setAperture 4.5;

hallow mortar
#

Adding the sleep worked. It seems the issue is really that setAperture doesn't work during the initial briefing stage.

quartz coyote
still forum
#

one too many yes

quartz coyote
#

Thanks

rough heart
#

@wide anchor LOL, if you really want to do such stuff and modify exile to a extend that trades work differently, you will have to write that code on your own.

spice axle
#

What is the mistake in example 4? @quartz coyote

quartz coyote
#

@spice axle there is one argument too many in the setVariable command. setVariable can only hold 3 arguments max in the array
varspace setVariable [name, value, public]

spice axle
#

this setVariable ["BIS_fnc_initVehicle_customization", false, false]; // set in an init field
This is what I got there

cosmic lichen
#

I fixed it already

quartz coyote
#

@cosmic lichen thanks ❀

cosmic lichen
#

No Prob ❀

low pagoda
#

Anyone know of a IR strobe script (outside of using ACE) that can 1. Can be attached to all members of "west" (not just my team) when i trigger it 2. Also a way to turn them all off/on if needed (for all in west)? I have found some working botched to together scripts but I mainly can only find ones that are just for player only or own team .. or if I can get it to work the strobes detach after about 10 mins of game play.

#

Triggering this works to place them all on and attach but they then fall off after a short while in game - and I dont know how to then set this to take them all off again (on/off I want to put under a radio trigger).

if ((side _x) isEqualTo west) then {            
           _ir = createvehicle ["O_IRStrobe",[0,0,0],[],0,"NONE"];    
           _ir attachTo [_x,[-0.02,-0.05,0.04],"LeftShoulder"];
           _ir setLightBrightness 1;
       };
   } foreach allunits;```
winter rose
#

fyi:
```sqf
/* your code */
```

#

@low pagodasqf { private _ir = createVehicle ["O_IRStrobe", [0,0,0], [], 0, "CAN_COLLIDE"]; _ir attachTo [_x, [-0.02, -0.05, 0.04], "LeftShoulder"]; }; } forEach (allUnits select { side _x == blufor };

cosmic lichen
#

("O_IRStrobe" createVehicle [0,0,0]) is even a bit faster than createVehicle ["O_IRStrobe", [0,0,0], [], 0, "CAN_COLLIDE"];

winter rose
thorn saffron
#

AFAIK aparture settings do not work on NVGs

winter rose
#

IDK, I think not

thorn saffron
#

I remeber testing and it sadly didn't work

winter rose
#

post-process does

#

so you can have grey/blue/orange NVGs, weee

thorn saffron
#

yeah, I was more interested in aparture though. Increasing brightness/contrast is not the same

plain raven
#

anyone aware of a script that forces the AI to vote again in Warlords? This would be for the enemy team, I've pushed them back but they're still trying to get to a friendly location 5km away rather than contesting the same one

#

thinking maybe you can call a function or some kind?

tribal stump
#

Hey guys. I'm pretty sure i'm asking in the right section. I'm trying to create a "Diary record" when a unit picks up documents(From the props "intel" section.) But as far as I know this can only be done in Zeus, unless you want to script something. I've done a little digging. But haven't really found anything. I've seen a couple videos to. But they were making tasks complete when intel picked up. Any help.

finite dirge
tame socket
#

for a basic diary record when you "pickup" a document you could do this. when the player walks up to the documents he will have the option to pickup intel, if the player clicks that then it deletes the documents and will create a diary record

this AddAction ["Pickup Intel",
{
    Params ["_Target", "_Caller"];
    DeleteVehicle _Target;
    _Caller CreateDiaryRecord ["Subject", ["Title", "Text"]];
}];
tribal stump
#

@tame socket And I would just place that code in an .sqf file? And I'm assuming I would modify the title and text to my needs, correct?

#

@finite dirge Thanks dude, I'll check this out aswell.

tame socket
#

put that inside the init of the documents. i figured it would be easier to do it that way for ya. read the wiki page that he linked so you can see the other parameters that CreateDiaryRecord takes in incase you want to implement anything else

tribal stump
#

Oh, really. I'll try it out and let you know @tame socket

#

@tame socket I've added that code to the documents file. And it opens up the map. But doesn't display anything. I've edited the Subject, Title and text. What else would I have to change?

tame socket
#

what do you mean by it opens up the map? also ive never created a diary thing before so i have 0 clue what it does

tribal stump
#

xD

#

Well it added "Pick Up Intel" To my scroll menu. but nothing happened. My dude just picked it up. And so I restarted the mission and clicked "Take Intel" And it opened up my map and went to a sub menu where Diary Records would show up. but nothing is there. I just want it to display some texts in a Diary Record.

tame socket
#

thats strange, it should be fine. let me read the wiki a bit

#

try putting "Diary" as the subject

winter rose
#

Diary records may follow πŸ˜„

finite dirge
#

Hah. Well... fair point.

winter rose
#

to be totally honest I read too fast, he mentioned Diary record, not tasks πŸ˜‰

tame socket
#

nailed it

exotic tinsel
#

does anyone know how to get the action menu to show up in multiplayer with revive enabled on the server when the player is incapacitated? armas revive system hides and and doesn't show the menu even when the parameter for show when unconscious is set to true.

#

does anyone know how to get the action menu to show up in multiplayer with revive enabled on the server when the player is incapacitated? armas revive system hides and and doesn't show the menu even when the parameter for show when unconscious is set to true.

tribal stump
#

@exotic tinsel Doesn't vanilla Arma use the space bar to revive down units? Not 100% sure since I use ACE3.

#

@winter rose lol, Thanks though.

exotic tinsel
#

units getting revived works fine. i need the unit that is incapacitated to be able to use some items in the action menu.

tame socket
#

are you positive the unit is not out of range of the action?

winter rose
#

he means, when you are the down unit, action menu doesn't show up

tribal stump
#

@exotic tinsel Just use ACE3.

#

If the unit is incap and the revive works.... Then whats the issue?

#

You mean treating the wounded works. When they are incap the action doens't show?

exotic tinsel
#

the unit that is incapacitated, needs to be able to see some of the items in their menu, while INCAPACITETED that are set to show when unconscious. Not other alive players. just the unit that is down. he needs to see his action menu.

#

@tribal stump

tribal stump
#

@finite dirge Thank link you provided. That to be entered in an sqf?

#

Or would I add it after the "addaction" part?

tame socket
#

@tribal stump the link he provided is the CreateDiaryRecord portion of the addaction i showed you

tribal stump
#

So I'd use both?

#

Nevermind. I see it now. Still can't get it to work

tame socket
#

did you change the subject to Diary? if so then something should appear under the briefing tab

tribal stump
#

That was my issue. Facepalm Thanks.

tame socket
#

scroll up and i said the same thing XD

acoustic iris
#

Hello i need help, i have a arma 3 server ( altis life ) but when i join there is this :

tribal stump
#

Is the contact DLC installed on the server?

winter rose
#

well, buy the DLC

tame socket
#

read the error lol

tribal stump
#

It's pretty much telling you what you have to do.

acoustic iris
#

There is no dlc installed on the server

tribal stump
#

Then the mission is using required DLC.

#

IMO

tame socket
#

it disagrees with you. check again to make sure

tribal stump
#

Cause it tells you right there. You used premium DLC.... Buy it

acoustic iris
#

but how can I do that even those who do not have dlc can join the server?

tame socket
#

by removing whatever DLC content is being used by the server. the server thinks the DLC is being used

acoustic iris
#

and how and where can I delete it? desolate i start my server i'm bad ::

tame socket
#

we cant tell you, you have to just go through it and figure out whatever is using the dlc and remove it

acoustic iris
#

Ok...

restive leaf
#

@winter rose said "well, buy the DLC" I say... It's a Lifer... 🀷

acoustic iris
#

Yet I have all the dlc, it's not a problem of me but my server

winter rose
#

The mission has been made with some DLC content
Remove said content, mission is DLC-free

thorn saffron
#

Is there a way to make drones available to be connected only to selected players and hidden from others?

copper raven
#

disableUAVConnectability pretty sure, can't check wiki not working for me atm

delicate lotus
#

Same here. Good to know the wiki isn't just down for only me

runic quest
#

Excuse me, I would like to pass (the equipment will disappear or cannot be picked up immediately after the player drops the specific equipment). Do you have any help, thank you.

young current
#

@winter rose what did you doooo to the wiki??

#

filling it with dad jokes now eh?

winter rose
#

actuallyyy…

tough abyss
#

He added marquee

half inlet
#

is there a way to get the move position of a specific AI unit in my group that I commanded to move somewhere? (using the action menu)

#

I thought about waypoints, but they're shared across all group members

half inlet
#

nevermind, found it

burnt cobalt
#

hey guys - what's the best way to distinguish IR lasers from flashlights via cfg?

#

i compared the config values and the only obvious differences are in stuff like 'displayname', so if some addon has a weird name configured it would ot work. must be overlooking something

#

i love how without fail, one tries a lot of things, then asks, then tries some more things, then learns a thing that you asked about.

#
_isPointer = getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "Pointer" >> "irDistance") != 0;
_isFlashLight = getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "FlashLight" >> "intensity") != 0;
tough abyss
#

Why do you need to read properties, is it not enough that one says pointer and another says flashlight?

winter rose
#

mods maybe?

hot kernel
#

There's an errant object in my scenario from LOW DLC that I must get rid of. I can't find it.

_appID = getObjectDLC cursorTarget;

Isn't super useful because there's no way I'll ever be able to search in game.

#

I mean, I can't find it in the editor, there's no way I'll find it in the game

winter rose
#

make a backup of your mission.sqm, delete the Laws of War DLC line from the required addons and try to load it
it should tell you "cannot load the mission because LoW isn't installed, used because of xxx"

hot kernel
#

@winter rose thanks. I've not explained the situation well. I do have the LOW DLC but I don't want it required to play my Scenario. It was only used for a couple outfits in the first place. Totally unnecessary. I'm flat out positive I've removed every object/outfit/accessory from the DLC but it's still in the required add-ons list.
On one hand I wouldn't be terribly surprised if I missed something but on the other hand I'm super-sure I got 'em all. Is it possible that since it once required the DLC, it's stuck somehow?

winter rose
#

no

#

just to be sure, remove the DLC from Steam, do what I said, and it should throw the error of what's wrong

hot kernel
#

okay, I couldn't figure out how to disable it in the launcher. I'll look in steam-- very easy process, very tiny checkbox

hot kernel
#

I propose it is impossible to disable DLC πŸ˜„

tough abyss
#

Did you try steam?

tame socket
#

why not try
print out ALL dlc objects in the map

_MissionObjects = AllMissionObjects "All";

_DLCObjects = [];
{
    _AppID = GetObjectDLC _x;
    if !(IsNil _AppID) then
    {
        _DLCObjects PushBack _x;
    };
} ForEach _MissionObjects;

hint str _DLCObjects;

or if you know the DLC id

_MissionObjects = AllMissionObjects "All";

_DLCObjects = [];
{
    _AppID = GetObjectDLC _x;
    if !(IsNil _AppID) then
    {
        if (_AppID == IDOfDLC) then
        {
            _DLCObjects PushBack _x;
        };
    };
} ForEach _MissionObjects;

hint str _DLCObjects;
#

not sure how well this will work but its an idea

winter rose
#

copyToClipboard if there are too many ^_^

tame socket
#

^

#

or get real fancy and use IniDBI2 to write them into a txt file lol

hot kernel
#

Yeah, it says "not installed" on steam-- it's still very much installed (and un-configurable) in game-- I'll try Cody's method too-- thanks guys

winter rose
#

Why, you can still play the campaign?

tough abyss
#

If you untick Apex, can you open Tanoa?

#

I’m assuming you are restarting the game each time, yes? Yes?

hot kernel
#

in game, none of the DLC can be configured at all. The options are greyed out

#

and yes I restarted-- several times

#

like each time

tough abyss
#

What are you trying to do?

#

And what is not happening?

forest ore
#

Is there any sane way to create a while-do loop (or with some other method) that keeps polling from here to eternity for some condition to be true but applies the result only once when the condition has been met?

For example create a continuous check if a player is inArea (of some marker) then for example display a hint but only do that once (while the checking of the condition still keeps looping in the background)

tough abyss
#

Yeah create a no repeat trigger

forest ore
#

For reasons would need to do this without triggers. Also, if it doesn't repeat then it will completely stop after true has been met the first time

winter rose
#

and a boolean _showHint = false, if not _showHint then _showHint = true, hint "blah"

hot kernel
#

@tough abyss My scenario requires LOW and I don't want it to. I can't find the object/accessory/character associated to the DLC.

tough abyss
#

Eden has menu that shows dependency

hot kernel
#

if I could filter the left side panel the same way as the right side panel (by dlc) we'd be all good

#

(unless it's in a character's inventory)

tough abyss
#

There is other menu

hot kernel
#

I appreciate the help. There's a topic on the forum where I'll post the solution when we find it.

winter rose
#

does your mission have mods?

cold pebble
#

I'm receiving this error: 20:44:50 Error Type Number,Not a Number, expected Number when calling this function with parameters ["123",1] call DT_fnc_setFreq;

params [
    ["_freq","",[""]],
    ["_index,",1,[0]]
];
if (_freq isEqualTo "") exitWith {};

private _radio = call TFAR_fnc_activeSwRadio;
[_radio,_index,_freq] call TFAR_fnc_setChannelFrequency;
[_radio,0] call TFAR_fnc_setSwChannel;
if (_index isEqualTo 1) then {
    [_radio,0] call TFAR_fnc_setSwChannel;
} else {
    //[_radio,_freq] call TFAR_fnc_setChannelFrequency;
    [_radio,1] call TFAR_fnc_setAdditionalSwChannel;
};
#
20:44:50 Error in expression <te _oldFrequency = (_settings select 2) param [_channel, 0];

(_settings select >
20:44:50   Error position: <param [_channel, 0];

(_settings select >
20:44:50   Error Type Number,Not a Number, expected Number
20:44:50 File z\tfar\addons\core\functions\fnc_setChannelFrequency.sqf..., line 34
#

Full error ^^

hot kernel
#

@winter rose no, sir. no mods.

winter rose
#

@hot kernel mind to send me the mission.sqm?

tough abyss
#

@cold pebble your error seems to have nothing in common with the script you posted

cold pebble
#

Its to do with TFAR_fnc_setChannelFrequency

#

Which I find here, I'm pretty sure I'm sending through the correct parameters (and the _radio) passes through the check in params

still forum
#

setXXStereo command don't take a "index"
And your _index in [_radio,_index,_freq] call TFAR_fnc_setChannelFrequency; seems to be NaN

hot kernel
winter rose
#

Altis?

hot kernel
#

tanoa

cold pebble
#

I've removed the setxxStereo bits and still having an issue 😦 and _index seems to be defined

#
test3 = {params [ 
    ["_freq","",[""]], 
    ["_index,",1,[0]] 
];
systemChat str(_this); 
if (_freq isEqualTo "") exitWith {}; 
 
private _radio = call TFAR_fnc_activeSwRadio; 
[_radio,_index,_freq] call TFAR_fnc_setChannelFrequency; 
[_radio,0] call TFAR_fnc_setSwChannel; 
if (_index isEqualTo 1) then { 
    [_radio,0] call TFAR_fnc_setSwChannel; 
} else {  
    [_radio,1] call TFAR_fnc_setAdditionalSwChannel; 
};};

["123",1] call test3

#

That produces the same issue 😦

acoustic iris
#

someone can help me about this : 21:56:43 Warning Message: Script \life_server\init.sqf not found please 😦

cold pebble
#

Found it

#

🀦

#

_index, != _index

acoustic iris
#

He is here

#

i tried everything

#

but nothing work

cold pebble
#

I found my issue Lou πŸ˜›

winter rose
#

yep, said nothin' :p

cold pebble
#

It was a wild comma

#

πŸ˜„

winter rose
#

always close the cage, dammit

cold pebble
#

πŸ˜›

winter rose
#

@acoustic iris where do you call it

#

well...

#

@hot kernel dependencies on Arma 3 Orange - Characters and Clothing found in your SQM

#

"A3_Characters_F_Orange_Facewear"

hot kernel
#

yeah, that's what I found too. But I don't know how many times I can go through the few characters inventories and come up with naught. There's not a lot of places to look

#

It was headsets. That was the "facewear" object I removed.

#

I'll look again...

#

There are 7 characters with inventories. The first thing I checked was that the character model is not from LOW. They are all vanilla and APEX.
The second thing I checked is their clothing, head and face pieces. Despite what the sqm says there is nothing character related to LOW in the actual mission.

winter rose
#

the thing I had though, civilians don't appear in the "Entities list" in Eden πŸ€”

hot kernel
#

hmmm indeed

#

in the editor everything is in layers

#

there's nothing in the folder "civilian"

winter rose
#

ah yes, my bad

hot kernel
#

kk, thought I'd broken everything

winter rose
#

I don't use layers very much, so it didn't tilt

smoky verge
#

how can I disable AttachtoRelative from an object?
Its probably obvious but I can't see it

acoustic iris
#

I have an error, when I connect to my server it does not download the map or anything

#

My logs :

tough abyss
#

@smoky verge you make no sense

hot kernel
#

@smoky verge detach

smoky verge
#

@tough abyss I've used AttachtoRelative to tie 2 objects together
I want that when a trigger is activated it will detach them

#

simply detach?

hot kernel
#

have fun!

smoky verge
#

oh found it

#

thanks

errant patio
#

Is there a way to add an eventHandler for a group being deleted?

#

or something with equivalent functionality

astral dawn
#

Looks like not
You will have to poll the group handle until it is isNull

#

Or what do you actually want to achieve? Maybe there is another way?

runic quest
#

Excuse me, when a player can not pick up or disappear after throwing down specific equipment, how to write? tks!

errant patio
#

what i'm trying to achieve is a system where AI units are associated with a building (where they spawned at), and that building can't spawn any more units until those ones are dead.
I ended up doing what Sparker suggested but the issue i ran into is that the group doesn't seem to become grpNull when all the units are dead? the corpses still say they belong to the group for example.

Not sure why that happens but I think i'm just going to have to check if there are any units alive in the group and then go with that.

plain raven
#

are you trying to have 'waves' spawn out of the building pritchard?

#

@errant patio

#

when you spawn the group (assuming bis_fnc_spawngroup?) in the next line you can run the deleteGroupWhenEmpty command. If you make you're group global you could have a trigger condition set to check if there are any units in the group via a count, once dead it runs the script / code again. Or see if the group is null

#

to spawn another group

#
trigger activation:

spawnedGroup = [(getPosASL thisTrigger), EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call bis_fnc_spawngroup; spawnedGroup deleteGroupWhenEmpty true;

trigger condition:

(count units spawnedGroup) == 0;

Its a bit quick and dirty and is only for a CSAT squad but it should help you get started hopefully. I'm not toooo sure how it'll handle being in a building cuz this is based on trigger pos

errant patio
#

ah, at the moment i use creategroup + createunit but that's going to be expanded on a lot in the future probably.
I'll try using the deleteGroupWhenEmpty command anyway since i think it should work?

Of course, I need to clean up corpses properly too.. should be interesting :/

#

it's all a bit of a mess due to a lot of complicated stuff going into spawning these units (populating an 'open world' mission)

plain raven
#

your way is better for cusomtisation if thats what you're after, mine uses set group from config

errant patio
#

can groups be defined in mission configs? in the end this might end up being an addon rather than just a mission since i want to define my own units but.. that's a ways off lol

plain raven
#

im honestly not sure, are you trying to mix say csat with FIA to hunt down players or something?

#

btw, edited my original trigger setup, just tested and when one group is deleted it creates a new one BUT they spawn in formation so unless you got a big building they'll be outside

errant patio
#

right now the groups only have a single unit but i'm not planning to use formations.
The units atm are just from the Looters faction and so potentially i want to create a faction in the same vein but with more diversity in equipment

acoustic iris
#

someone know why when i join my server i dont download all the file and the map

astral dawn
#

@errant patio dead units are not instantly ungroupped as I know

#

Did you wait for a few minutes at least?

errant patio
#

yeah using cursortarget i noticed that.

I have to admit i haven't waited that long probably. I tried setting the GC to some extremely low settings too but it didn't seem to work either :/

runic quest
#

Excuse me, when players throw down specific equipment, they can not be picked up or disappeared. How to write this code? Thank you!

plain raven
#

@acoustic iris check your logs? any errors or anything?

@errant patio You could make something that loops every 5mins or maybe that deletes groups with dead ai in. For a custom faction, I would recommend Drongos config generator. Its easy to use but will make it an 'addon'. The long was is do as you're doing with create units then apply loadouts with add weapon etc

#

Amazingthegay, im not sure arma deletes objects by default of GC is turned off? could be wrong though

errant patio
#

i already have the FSM for spawning running on a loop. Maybe I can extend it to work on dead units and their groups to clear them :O thanks for the idea

acoustic iris
plain raven
#

yeah so if you're spawning those groups, you should store them somewhere (in an array maybe?) then you can access them for other stuff such as deleting when empty, providing your array isn't too big you could just periodically iteratet through it and check each group. Bear in mind, you're returning a group so you can check if its null (which as sparker says isn't automatically done) BUT you can't check if the ai in the group are dead, for that you can use the units command which will return any units of the specified group (see wiki), then as i've done do a simple count to make sure its == 0

#

@acoustic iris I can't see anything in that one I'm afraid and I've never played a life server, can you PM the server logs maybe?

#

make sure it has no sensitive info in it like passwords etc

errant patio
#

yeah, i'll have a look at what works. trying to make sure nothing i do kills performance lol

plain raven
#

i know that feeling!

jaunty ravine
#

Anyone up in here sitting on a Jeroen Limited Arsenal script where the ACE Misc items are where they should be?

errant patio
#

interesting thought - would it be possible to write a script that adjusted the mass of a vehicle based on its cargo (items etc.) load? Thinking about the conversation in the feedback tracker chat

winter rose
#

yes

#

using setMass and getMass, and eventually even changing the centre of gravity

errant patio
#

...would it be a good idea though πŸ€”

winter rose
#

not for planes

errant patio
#

heh, i suppose not. I do wonder if some vehicles would struggle even more to get up slight inclines though. I can't say I like the idea of making that more annoying :/

winter rose
#

AFM does take the weight of passengers though

errant patio
#

ah dang. im gonna have to test this now aren't i lol

winter rose
#

that's the issue with Arma scripting, you just have to Β―_(ツ)_/Β―

errant patio
#

hehe, yeah. I've been on a bit of a binge lately, made an addon (which i really need to polish up and release..) and now the mission i've been working on... it's very addicting.

#

okay. arma vehicle physics are really broken with tiny mass values lol

errant patio
#

Okay, i figured out why no one has bothered to do it yet - there doesn't seem to be an easy way to get the loading other than taking each item and checking its config :/

acoustic iris
#

Someone can help me about spyglass

dry scroll
#

i have a question regarding vehicle loadouts. so i set pylons 4-6 on a gryphon to contain shrieker pods. my problem is that the wepons normally used on those pylons still show up on the top right corner. altho not being on the vehicle

#

hope this is the right channel

minor lance
#

Hello guys!

#

Anyone knows how to reset player animation after being unconcious in a car?

dreamy kestrel
#

with fixed wing we can script camera orientation, reset direction, azimuth, lock, etc. is there an analog to this for rotary asset gunner positions?

#

mainly what I want to do is, when the gunner gets out of the rotary asset, I want to reset the turrent (?) i.e the AH-1Z, camera (?) i.e. the CH-53 or UH-1Y, whatever that happened to be, to a nominal forward orientation.

hearty plover
#
/*
 * Argument:
 * 0: Action name <STRING>
 * 1: Name of the action shown in the menu <STRING>
 * 2: Icon <STRING>
 * 3: Statement <CODE>
 * 4: Condition <CODE>
 * 5: Insert children code <CODE> (Optional)
 * 6: Action parameters <ANY> (Optional)
 * 7: Position (Position array, Position code or Selection Name) <ARRAY>, <CODE> or <STRING> (Optional)
 * 8: Distance <NUMBER> (Optional)
 * 9: Other parameters [showDisabled,enableInside,canCollapse,runOnHover,doNotCheckLOS] <ARRAY> (Optional)
 * 10: Modifier function <CODE> (Optional)
 */
#

Can someone better explain params 6-10

spice axle
#

The action is a returned array from the frunction ace_interaction_menu_fnc_createAction (func name iirc) and position is a position from the target object, either [0,0,0] of the model or a selection name as a string or a position [2,8,0] from origin of the model. Distance is the distance between you and the object for the action to be sown. Other params are the ones there and 10 is a function that will modiy this action, like the icon or the name

tough abyss
#

How do I close someone's inventory when they open a crate? I already added an event handler to listen for when they open the crate and tested it works fine but I've tried deleting the display and other things but none have worked.

spice axle
#

Oh forgot @hearty plover

#

Do you tried closing the dialog? @tough abyss

tough abyss
#

Tried closing Display not dialog

#

Trying this

#
    params ["_container", "_unit"];
  closeDialog 1;
}];```
#

Not working

#

Works with this, but I wanna make it so when someone opens a crate it closes automatically

#
  sleep 3;
  closeDialog 1;
};

[] spawn test;```
finite dirge
#

You could add an eventhandler for InventoryOpened and just breakout if it's a crate.

tough abyss
#

Well I'm wanting it for a specific crate

finite dirge
#

Yes?

tough abyss
#

Oh

#

Yeah

#

I could check if it's taht crate

finite dirge
#

Correct.

#

Type or by variable. It's a vehicle so, in would work fine with the class if it was for a certain type.

tough abyss
#

Alright

winter rose
#

@tough abyss do you want the player to be able to use his inventory, but not a crate?

tough abyss
#

Yeah.

winter rose
tough abyss
#

Alright

tough abyss
#

Should i use CursorObject or CursorTarget to get units and vehi? looks like it's easier to get object with CursorTarget.

winter rose
#

cursorObject is better (targets trees, bushes, etc and is no different from cursorTarget for other things)

#

it's "easier" maybe because cursorTarget uses a bigger "hitbox" idk

tough abyss
#

@winter rose
I see some notes on Wiki for CursorTarget like enemy units will not be detected that is not true right?

winter rose
#

why would it be false?
they will be detected when the player know about them, aka "declared" them with T

really, just use cursorObject @tough abyss

tough abyss
#

Seems to work fine will switch to CursorTarget, like u said hitbox seems to be a bit bigger.

winter rose
#

Β―_(ツ)_/Β―

exotic tinsel
#

Is there a way to force lower weapon on a player via script? we have dragging func on the server and when the player is looking down scope before dragging, they cant walk backwards once animation changes.

exotic flax
#

@exotic tinsel ```
player action ["WeaponOnBack", player]

This will lower the weapon of the current player.

source: https://community.bistudio.com/wiki/action
exotic tinsel
#

@exotic flax Thx mate!!!

#

@exotic flax actually thats not what i need. i want them to be able to have gun up while draggin backwards. which they can do now, but issue is when they are looking down sight before drag animation plays they cant walk backwards. so before i play the animation on them for dragging, i need to zoom them off their sight so they can walk backwards.

exotic tinsel
#

@hot kernel reading now

hot kernel
#

maybe like this?

player action ["SWITCHWEAPON",player,player,-1]
exotic tinsel
#

gonna test now

grave stratus
#

i am trying to use ussrlongbow's chatcom script where it would execute commands by calling it via in-game chat.

class commands
{
    class t100
    {
        code = [East, 100] call BIS_fnc_respawnTickets;
    };
};

this works fine but how can i change the number 100 in [East,100] to any number that i want. I am guessing i have to put some string in there but i have no idea how.

eg. by entering t356 via in-game chat, it would add 356 ticket
and by entering t1573, it would add 1573 ticket.

i know i can make it a fixed number for every command but i would like to have the flexibility

runic quest
#

https://sqfbin.com/xobokarirugupizurosu This is the code in fn_ontake item that restricts players to pick up equipment. I changed sab_CUAV_Terminal here to other class names (clothes, hats). But when I entered the game, the name of the specified item class was invalid. I can still pick it up. Where did I go wrong?

errant patio
#

i'm confused. isNil is the right way to test if a variable is defined or not, right? so...

_group = _groupNetId >
17:00:49   Error position: <_groupNetId) then{
_group = _groupNetId >
17:00:49   Error Undefined variable in expression: _groupnetid``` how am I getting this error??
spice axle
#

you need to quote the variable

#

isNil "_groupNetId"

errant patio
#

🀦

#

yeah, that works. i need to work on my reading comprehension :v

spice axle
#

Yeah best advice is double read the wiki

winter rose
#

isNil is an especially tricky one that can also "fail" silently

errant patio
#

Yeah... I think I probably need a better solution than this but I'm not sure what it's going to be yet.

winter rose
#

@errant patio if you need a net id even in SP, you can use BIS_fnc_netId

#

(I don't know if this is your goal though)

errant patio
#

i already am, this is for retrieving the group from the net id

#
if !(isNil "_groupNetId") then{
            _group = _groupNetId call BIS_fnc_groupFromNetId;```
etc
spice axle
#

There is a missing space between then and the bracket

#

@errant patio

winter rose
#

it's not code-breaking afaik

errant patio
#

sqf is pretty lax with whitespace but good catch

winter rose
#

where is first defined _group ?

errant patio
#
_buildingsWithExpiredSpawns = unitBuildingIDs select {time - (_x select 1) > _maxLifeTime};
    {
        _building = _x select 0 call BIS_fnc_objectFromNetId;
        _groupNetId = _building getVariable "spawnedGroup";
        
        if !(isNil "_groupNetId") then {
            _group = _groupNetId call BIS_fnc_groupFromNetId;
        
            if !(isNull _group) then {
                _building setVariable ["spawnedUnit", false, true];
                _building setVariable ["spawnedGroup", nil, true];
                {
                    deleteVehicle _x;
                } forEach units _group;
                deleteGroup _group;
            };
        } else {
            _building setVariable ["spawnedUnit", false, true];
            _building setVariable ["spawnedGroup", nil, true];
        };

        unitBuildingIDs deleteAt (unitBuildingIDs find _x);
        sleep 0.1;
    }
    forEach _buildingsWithExpiredSpawns;```
winter rose
#

have you heard of the private keyword our Lord and Saviour?

errant patio
#

:P

#

i will definitely have to polish a lot of things up, that's for sure

queen cargo
finite dirge
#

Hi!

winter rose
#

it was you all along Γ–

#

but if it wasn't for these damn meddling kids…

finite dirge
queen cargo
#

that actually is only rly working if you are at the desktop @finite dirge πŸ˜‰

acoustic iris
finite dirge
#

Yeah, it shows on the side, but I'm a regular user in this discord, so you'd have to scroll like mad ABlobHaha

#

@acoustic iris The server's profile.

winter rose
acoustic iris
#

Oh okay

queen cargo
#
private _arr= [  ["assertTrue",      { [] in [[],1,2,3] }],
   ["assertFalse",     { [] in [] }],
   ["assertFalse",     { [] in [[123]] }],
   ["assertFalse",     { [] in [1] }],
   ["assertTrue",      { 1 in [1,2,3] }],
   ["assertFalse",     { 1 in [2,3,4] }],
   ["assertFalse",     { 1 in [[1]] }],
   ["assertFalse",     { 1 in [] }],
   ["assertTrue",      { false in [false] }],
   ["assertFalse",     { false in [true] }],
   ["assertFalse",     { false in [1,2,3] }],
   ["assertFalse",     { false in [[false]] }],
   ["assertFalse",     { false in [] }],
   ["assertTrue",      { "abc" in ["abc",1,2,3] }],
   ["assertFalse",     { "abc" in ["ABC",1,2,3] }],
   ["assertFalse",     { "abc" in ["",1,2,3] }],
   ["assertFalse",     { "abc" in [["abc"]] }],
   ["assertFalse",     { "abc" in [] }],
   ["assertTrue",      { "abc" in "abc" }],
   ["assertTrue",      { "abc" in "zzzabc" }],
   ["assertTrue",      { "abc" in "zzzabczzz" }],
   ["assertTrue",      { "abc" in "abczzz" }],
   ["assertFalse",     { "abc" in "ABC" }],
   ["assertFalse",     { "abc" in "zzzABC" }],
   ["assertFalse",     { "abc" in "zzzABCzzz" }],
   ["assertFalse",     { "abc" in "ABCzzz" }],
   ["assertFalse",     { "abc" in "" }],
];

{
    private _res = [] call (_x select 1);
    if (_x select 0 == "assertTrue" && !_res) then {systemChat "invalid test: " + str (_x select 1);};
    if (_x select 0 == "assertFalse" && _res) then {systemChat "invalid test: " + str (_x select 1);};
}foreach _arr```
can one confirm this? (feel free to add testcases if you feel like one is missing)
winter rose
#

aaah, it requires the latest dev

tough abyss
#

], ]; really?

finite dirge
#

10/10

tough abyss
#

sqf-vm supports [[],]?

finite dirge
#

Nope. Throws an error.

#

Expected BINARYEXPRESSION start.

tough abyss
#

what about

[
   [";slkd ; lskdsakd ;sakd "],
]
astral dawn
#

I can confirm some old reports of playSound3D not being global any more

finite dirge
#
]
^
[ERR][L3|C0|]    Expected BINARYEXPRESSION start.
tough abyss
#

repro @astral dawn

astral dawn
#

playSound3D ["A3\Sounds_F\sfx\alarm.wss", objNull, false, (AGLTOASL _pos), 20, 1, 1000];

#

well, it's a copy-paste, hold on

tough abyss
#

@finite dirge and the example @queen cargo posted compiles fine?

finite dirge
#

Nope.

astral dawn
#

issue is, I am currently running an in-game-hosted server and I can hear the sound there, but when I switch window to a client which has joined the same server, I can't hear the sound any more

tough abyss
#

volume: Number (optional) Default: 1 Maximum value: 5 (limited since A3 v1.91.145537)
you have 20. it will not be capped at 5

#

I think it wont just play period

astral dawn
#

Yeah looking at that too.,.. let me try!

#

Ha yeah you are right, it plays on both if volume is within the range

#

And it only plays locally if volume is over 9000 5

tough abyss
#

Make a note on biki

astral dawn
#

Me?

tough abyss
#

you

astral dawn
#

I have no rights, so please, someone else πŸ™„

tough abyss
#

You gotta fight
For your right
To eeeeeeeeediiiit

finite dirge
#

I'll do it as soon as Lou bugs Dwarden enough to make me an account ABlobHaha

tough abyss
#

@finite dirge what sqf-vm for [123] in [[123]] should be true

finite dirge
#

[WORK] <BOOL> true

tough abyss
#

cool

queen cargo
#

never said my example compiles fine πŸ˜…

#

it is literally draft-code

#

for the test-cases

#

of SQF-VM

#

aka: SQF-VM is not yet producing expected results (maybe)

tough abyss
#

anybody got any ideas to why the variable isn't working? been trying to figure this out now for awhile.. thanks for any reponses

#
{
    Params ["_unit", "_killer"];
    _clientID getvariable ["cash", 0, true];
    _clientID = owner _killer;
    _killreward = 50;
    _playerfunds = _playermoney + _killreward;
    _killer setVariable ["cash", _playerfunds, true];
    
    [Format["Player Wallet: $%1", cash]] RemoteExec ["hint", _clientID, false];
};

/////////////////////////////////////////////////////////////////////////////////

While {true} do 
{
    {
        _unit = _x;
        _EHID = _unit GetVariable ["killedEHID", -1];
        if (_EHID == -1) then
        {
            _EHID = _unit AddEventHandler ["killed",
            {
                Params ["_unit", "_killer", "_instigator", "_useeffects"];
                [_unit, _killer] Call ControlPlayerCash;
            }];
            _unit SetVariable ["killedEHID", _EHID, false];
        };
    } ForEach (Allunits Select {!(IsPlayer _x)});
    
    sleep 3;
};```
exotic flax
#

which variable?

tough abyss
#

the cash variable

#

sorry should have made it more clearer

#

if i kill somebody, it says player wallet: $50 but doesnt carry it on

#

so it always remains $50

#

when i check it it comes back any

exotic flax
#

you mean the function ControlPlayerCash, which doesn't exist within the eventHandler (since it's a separate script)

#

it would make more sense to make it a proper function through CfgFunctions, so it will be available everywhere

carmine maple
#

@tough abyss where did you define _playermoney ?

ruby breach
#

He doesn't. Which is part of his problem

exotic flax
#

line 3 should be

_playermoney  = _clientID getvariable ["cash", 0, true];
#

and I would exchange line 3 and 4... otherwise _clientID isn't set

tough abyss
#

Clientid is a number? You can’t getvariable from a number

exotic flax
#

bad copy&paste also doesn't work 🀣

#

btw... I came here for a question too...

#

is there a way to add an init event handler to all children of a specific class (eg. add an EH to all units under Tank_F)

winter rose
#

@finite dirge on it

tough abyss
#

i got given the code about.. 2 weeks ago i've just tried to work off of it since

#

By script, no @exotic flax

#

would it help if i got you the original ?

exotic flax
#

@tough abyss it also doesn't seem to work with Extended_Init_EventHandlers, unless I add each class manually...

tough abyss
#

I dunno about modded solution they might be one or might not

#

damn that playermoney wasnt even set fuck my life

#

thanks i'll try this out

tough abyss
#

kk so i tried doing those changes

#
ControlPlayerCash =
{
    Params ["_unit", "_killer"];
    _clientID = owner _killer;
    _playermoney = _clientID getvariable ["cash", 0, true];
    _killdistance = _unit distance _killer;
    _killreward = 50;
    _killtotal = _killreward + _killdistance * 1.5;
    _playerfunds = _playermoney + _killtotal;
    _killer setVariable ["cash", _playerfunds, true];
    
    [Format["Player Wallet: $%1", _playerfunds]] RemoteExec ["hint", _clientID, false];
};
#

now i'm getting this error

#

line 10
Error Generic in expression

#

line 10 is the _playermoney = line

winter rose
#

Yeah, you are trying to getVariable on a… number

#

It's (maybe) _killer getVariable ["cash", 0]

tough abyss
#

i'll give that a try

#

so instead of _clientid getvariable it should be _killer

winter rose
#

Yeah
And no need for ["cash", 0_, true_]

tough abyss
#

so it should be _killer getvariable ["Cash"] ?

#

sorry trying to learn this shit

winter rose
#

["cash", defaultValue]

tough abyss
#

awesome

tough abyss
#

not sure what i'm doing wrong

#

its like the variable isn't attaching to the player

#

i have all this in the initserver, should i have the first half in the initplayerlocal? its just returning 0 for the getvariable

#

Can someone assist me with spawning triggers on markers via scripts?

exotic flax
#
_trigger = createTrigger ["EmptyDetector", getMarkerPos "marker_name"];
tough abyss
#
_Spawnmarkersfortele        = true;
_Respawnmarkerarray = ["ModuleRespawnPosition_F"];
if (_Spawnmarkersfortele) then {
{
    if (typeOf _x in _Respawnmarkerarray) then
    {
        respawnMainBase = createMarkerLocal ["respawnMainBase" + str(_forEachIndex), getPos _x];
        respawnMainBase setMarkerShapeLocal "ICON";
        respawnMainBase setMarkerTypeLocal "mil_circle";
        respawnMainBase setMarkerColorLocal "ColorGrey";
        respawnMainBase setMarkerSizeLocal [1,1];
//this V is the attempt to make a trigger
    _markersfortele = createTrigger ["EmptyDetector", getPos _x, true];
    _markersfortele setTriggerArea [55, 55, 0, false];
    _markersfortele setTriggerActivation ["NONE", "NOT PRESENT", true];
    _markersfortele setTriggerStatements ["this", "hint 'test';", ""];
    //this ^ is the attempt to make a trigger and it isn't working.
    };
}
forEach allMissionObjects "All";
};
#

Thats what i'm using atm

#

It's meant to be plopped ina mission which has respawn markers, it then finds all of em, places a marker on them, the goal of that is to then place a trigger on the marker for a fast travel script, so i don't have to modify this guys fast travel script. and that way I don't have to place a trigger and a map marker under all of my respawn markers as intended.

exotic flax
#

I've got the feeling the triggers ARE created, since nothing seems to be wrong here (unless the position of the module can't be found).
The only thing I can think of without testing is that the trigger is never triggered because the activation is set to "NONE".

tough abyss
#

Hmm

#

I gotta see what he's doing to make the triggers have that mouse over effect on the map screen.

exotic flax
#

well... triggers don't work on the map screen... they only work in-game

tough abyss
#

weird

#

can i pm you?

#

I wana show you the script i'm trying to make this script for.

exotic flax
#

I'm far from an expert on this topic 🀣

tough abyss
#

I feel it

#

People ask me for help and I am guessing 90% of the time

exotic flax
#

however, if I use:

_markersfortele setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true];

I do get a hint after I spawned on a respawn marker

#

so the trigger is created (and working with the correct settings)

tough abyss
#

i'll try that but the dudes trigger activation is set to type none and activation to none

exotic flax
#

but then the trigger never fires, unless it's done with an external script

tough abyss
#

I wish I knew how his script was working, it would determine how I go about this I suppose. It somehow makes the markers on the map screen have interaction and clicking them fires off a gui

#

ahh actually your triggeractivation worked

#

but this time i also put the script that is in the trigger in both fields of the setTriggerStatements

#

Ty m8

exotic flax
#

no problem

tough abyss
#
{
    Params ["_unit", "_killer"];
    _clientID = owner _killer;
    _playermoney = _killer getvariable ["cash", _playerfunds];
    _killdistance = _unit distance _killer;
    _playerfunds = _killdistance + 50 * 1.5;
    _killer setVariable ["cash", _playerfunds, true];
    
    [Format["Player Wallet: $%1", _playerfunds]] RemoteExec ["hint", _clientID, false];
};```
i'm getting $75 no matter the kill and it's still not adding.. anytime i get the variable it's just returning 0 after any kill too
#

not sure what i'm doing, i think it might just be fucked

#

even if theres another money system i can use at this point i'd be down i've been trying to get this done for 2 almost 3 weeks

hot kernel
#

@tough abyss , add a systemChat after _killdistance to see what it is? Like,

systemChat format ["%1", _killdistance];
tough abyss
#

it's returning with nothing

#

I think i'm going to call quits with it - I should have tested it first before making a whole mission around it

#

thanks to everyone that helped

runic quest
#

Excuse me, I use player addEventHandler ["Take", {this call UnionClient_system_onTakeItem}]; if (EQUAL (_item, "sab_CUAV_Terminal") & & license_civ_press) & then{

[_item] call UnionClient_system_removeItem;

Hint "UAV data for media use only";

}

I changed sab_CUAV_Terminal to other clothes or helmet, and added if the sentence below, but it did not work. Players can still pick up the corresponding equipment. Can anyone help me? Thank you very much!

errant patio
#

What's the best way to stop MP Synchronization behaviour?

tame socket
#

is there a issue running almost everything in an arma mission on the server? ive gotten into the habit of making everything that could easily be cheatable being performed on the server thanks to UE, but im wondering if this is bad to do in arma due to the load being put on the server.
for example a weapon shop. i use setvariable on the server for each connected player and keep the variable local to just the server so any money earned/lost is performed on the server. when a player tries to buy a weapon i have the client call a function on the server that tests to see if the player has enough cash, if so then it does everything else accordingly. i know something like that does not really put any stress on the server, but what im wondering is if going this route is good practice in arma or should this stuff just be done on the client

astral dawn
#

@errant patio what do you mean?

errant patio
#

Take for example fog. It's automatically synced over the network in A3 when in the past it wasn't. I'm wondering if it's possible to get that old behaviour back somehow

astral dawn
#

Log? πŸ€”

errant patio
#

Fog

#

Also true for weather and time in general

astral dawn
#

Ah sry I just woke up :D

errant patio
#

It's okay lol

astral dawn
#

Personally I have never seen anyone disable synchronization of such things, or even want to do that

errant patio
#

heh

#

i already do it with time in a rather clunky way in my mission, to allow players to be in properly dark indoor areas while others are outside in daylight. But it's really jank (onEachFrame EH to setDate) and doesn't work in 100% of cases

#

so i've been wondering if it's possible to do it any other way

restive leaf
#

But if fog is not synched then players with less will have a combat advantage over others. If this is for a COOP mission it is even worse for immersion

errant patio
#

yeah fog isn't a great example. Time works better

restive leaf
#

Anyway. Since ARMA 3 weather is global

errant patio
#

setTime is a function? I use setDate

restive leaf
#

Yeah. I meant skipTime

errant patio
#

ah right. anyway yeah it's pretty janky.

restive leaf
#

SetDate has local effecf

errant patio
#

it's also synched, it's just.. a weird command

restive leaf
#

Has to be executed on each client that you want, not the server though - at least from the biki and its notes. Never tried it

errant patio
#

Yeah. Unfortunately, that's the biggest caveat of my system

#

it only works correctly in singleplayer games where you can't see it 'not' working, and games on dedicated servers

restive leaf
#

So if you have the code running on a server remoteexec to the specific clients

errant patio
#

if it's player-hosted it's going to be set on the 'server' when they host player is under the effect of my script

#

and so people outside suddenly find themselves in night time

restive leaf
#

Remoteexec on the clients affected or run the code on the client not server

errant patio
#

? that doesn't really seem to be different

#

the problem is that the server is also a client

restive leaf
#

Doesmt matter Other than JIP. Effect of the command is local

#

I am surprised that it is not server side and global. But it is not

#

Don't run it on the server though.

errant patio
#

it's not really local. that's why i said it was weird before. The biki itself mentions that it 'seems' to get synced and it does, just not instantly like a normal global command.

My code works by running setDate on clients that are standing inside a trigger. The server in a dedicated environment thus never has its date tampered with

restive leaf
#

Based on a note on the wiki page which is easy enough

errant patio
#

Unfortunately, in a server that's hosted in game, there is a client that is also the server (the host). When the code is run on them and their date value is set, it's then propagated later by the game

restive leaf
#

It does not matter what the server thinks from the biki. If isDedicated don't run the code

errant patio
#

e_e

restive leaf
#

You can combine that with if !hasInterface don't run it either

errant patio
#

it runs perfectly on the dedicated server lol, it's player hosted that breaks.

Anyway yeah I could stop it from running if isServer is true for the client it's trying to run on, they'd have a much crappier looking bunker but for other players it'd be alright

restive leaf
#

Yeah. Unfortunately that would be true. You'd be fine with a dedicated server or the server running on a PC for someone who was a Zeus and not bothered

errant patio
#

mhmm. and so... square one :p

#

if i could stop the server from ever propagating the variable it'd be great but i'm not sure that's possible, nothing anyone has said seems to suggest so at least

restive leaf
#

You cannot if the comment on the biki page is correct. Which it seems to be. That page needs updating to reflect that

#

Using isServer and having one person who knows not to go inside is better than all affected thougg

errant patio
#

yeah. can't really tell people not to go inside since it's the central hub area of the mission but it's probably still better

restive leaf
#

Gives that player a huge advantage ofc

#

Do you set the year as well in setDate?

errant patio
#

indoor area is also a safe zone thankfully lol
i do set the year, as far as i know the issues it has according to the wiki shouldn't affect me

restive leaf
#

I'm looking at the last comment on the biki setDate page. Have you looked at those comments?

errant patio
#

yeah.

restive leaf
#

It suggests that if you don't set the year it is not global from the server. Old comment though

#

And odd too. That page needs some love

errant patio
#

since i never setDate on the server itself i'm not really affected.

restive leaf
#

But you just said that the server is a players PC yes?

#

Otherwise we were done at if isDedicated don't run the code

errant patio
#

I took your advice and told the script to not run if it's the server client

#

so now it only ever runs on clients

#

where it is local

restive leaf
#

Cool.

#

But if the server is a player's PC you might want to see whether that comment on the biki saying not setting the year on the server (or anywhere) does fix your issue

#

And let us know so the biki page can be properly updated

errant patio
#

i tinkered with that a while ago and it's just the year itself that doesn't get set. it still syncs other fields

#

and i'm still waiting on my biki account from dwarden :v

restive leaf
#

Me too LOL

astral dawn
winter rose
#

you can, but all at once

astral dawn
#

So I can remove all FAKs from a crate at once? (for instance)

winter rose
#

so it seems?

#

removeItemCargo or something like that

#

clearItemCargoGlobal

astral dawn
#

ah nvm, I forgot that my items are actually magazines
And for magazines there are such commands

errant patio
#

it's not impossible to achieve the desired effect but it is very inefficient :/

still forum
#

@astral dawn it's not possible to remove specific items from containers.
I looked into that while doing addWWACG but it's not really doable sensibly

errant patio
#

my solution would be to get the cargo of the object, manipulate that array and then clear + add back everything (with your changes of course)

But it isn't something I would want to do often during a mission :/

winter rose
#

Also, what about half-used mags? :)

errant patio
#

what about them? You can get/add them with their ammo count

winter rose
#

which one to remove then?

errant patio
#

clearMagazineCargoGlobal

winter rose
#

We talked about removeOneMagazine

If you use it without other arguments than just the classname, what does it do, remove the first one it finds, the first full one, the first not-full one, etc
If you add the ammo count parameter, does it take the closest one to the ammo count, etc

errant patio
still forum
#

If you use it without other arguments than just the classname, what does it do, remove the first one it finds, the first full one, the first not-full one, etc
neither of any of these. Read the wiki :U

#

As I said, not viable

winter rose
#

Read the wiki :U
NEVER!!

errant patio
#

anything's viable with enough bruteforcing >_> hides inventory database system

winter rose
#

That's what I mean, for such a command to work it would need some overhaul that is not going to happen

#

I suppose

errant patio
#

:p

still forum
#

I can make something that'll work, but you wouldn't want to use that

winter rose
#

πŸ˜„

errant patio
#

anyway. i had a question a while ago that im still stumped on.

I have a loot spawning system set up in my mission, that checks if a building is inside a trigger with a specific triggerText to see what kind of loot it should spawn.

It works, but would require me to pretty much cover the map in triggers, which isn't exactly ideal for portability or just... anything, really.

Something I've been wondering, if you had a similar problem, how would you tackle it - ideally without something that's part of the mission file itself

winter rose
#

framerate suddenly drops 20 FPS

  • hey what happened?
    -…I took a magazine from a box
errant patio
#

I had the idea of something like a heatmap that the map could look up, with pixel brightness indicating loot quality

astral dawn
#

duh it won't drop if you run it in execVM

errant patio
#

but i don't think it's possible in sqf

winter rose
#

@errant patio transparent markers with some colour?

errant patio
#

Still in the editor, sadly. And triggers work better if you're working in the editor

winter rose
#

also, triggers bad

errant patio
#

yeah i know :p i made the ones i had up to now as basic as possible - not repeatable and condition {true}

winter rose
#

Well, you are forgiven for this… for once.

Thy shalt read Code Best Practices twice and Mission Optimisation thrice to find salvation

errant patio
#

:p

#

alas, my problem remains unsolved

tough abyss
#

also, triggers bad
You keep misinforming people but I don’t understand your agenda

winter rose
#

I am paid by the SQF lobby, that's why

errant patio
#

i assumed you disliked them because of how many frames a complicated Condition check can cost lol

winter rose
#

because of their check every 0.5s and their unscheduled execution

tough abyss
#

Anything can be abused

#

Well let me tell you a secret, this is how the game works, it simulates shit every frame and does tens of thousands checks every frame. Triggers are only checked once for every 30 to 50 other frame checks. And they are engine checks. Of course if you start dumping your entire mission code in trigger conditions it is not going to help but there are plenty of other stupid things you can do to make your mission extra special

still forum
#

Can't tell a beginner to build their own custom scheduled/unscheduled loop with some advanced SQF stuff just because "trigger bad"
No trigger not "bad"
Trigger bad if abused, just as everything else in life

errant patio
#

sometimes you just want to use inArea and you're lazy :v

Maybe i should write a tool to let me draw polygons outside of the game and load them up in the mission... then inPolygon :v

tough abyss
#

What?

#

You mean draw like on piece of paper outside of the game?

winter rose
#

Let me tell you a secret, triggers are not bad per se, but usually people don't really need them. And people that use them, well, most abuse them.
So I invite people to tread with them carefully.

Otherwise, you end up with a mission that has 120+ triggers and cry about performance and "this shitty game"

errant patio
#

No, though importing that would be a fun challenge lol.

I mean. I have a map for my mission that is 8192x8192.

I want to cover that entire map in regions where different kinds of objects will spawn.

How do i define and store those regions in an efficient way?

#

I already use inidb2 so if I created polygon coordinate data in the right format for the game I could load it up easily enough

still forum
#

How do i define and store those regions in an efficient way?
polygons and inAreaArray

errant patio
#

Does inAreaArray support polygons? i didn't think it did

tough abyss
#

Depends on what kind of areas and how many and how often you need to check. A simple coordinate with radius is easy to store quick to check

errant patio
#

mm. I should probably start by doing that at least, to be fair. I can worry about how to generate them later

tough abyss
#

@winter rose triggers simulation can be disabled on per trigger basis making them shapeless inert local objects that are not worse than a simple object thus taking no resources until you activate them. I can argue that putting 120 units is bad for performance and much worse than 120 triggers but I don’t see you telling everyone units are bad

winter rose
#

because people tend not to see triggers are potential performance issues, units, they get that

#

also because there are way better ways to run scripts than triggers, that too

#

also because easily 90% of trigger usage I see is replaceable by simple sqf/awful usage

#

as I said,

triggers are not bad per se

tough abyss
#

But there are no issues with triggers unless you abuse the condition and even then you have to really try, much more than the shit people dump in addAction

winter rose
#

but I don’t see you telling everyone units are bad
I invite them to use agents wherever full AI is not needed, though

still forum
#

if you tell a beginner he should not use triggers, he will use a even worse script instead

winter rose
#

while I may have a bias towards triggers given the support I do, is it fair to say that it is worth giving a big warning about them?

tough abyss
#

I think you should stop being biased and leave the triggers be

winter rose
#

may

so to you, triggers are fine with their 0.5s and unscheduled execution? I feel it's like giving a handgun to a baby.

tough abyss
#

Yes they are fine 0.5 sec makes a lot of difference

winter rose
#

I mostly loathe the unscheduled code. Big conditions / big area triggers are expensive

errant patio
#

note to self: next time you want your problem solved, don't mention your stopgap solution as well or people will just start debating scheduled/unscheduled code πŸ™ƒ

tough abyss
#

There is no difference between unscheduled code and scheduled code in terms of performance or usage of system resources. The only difference is that one allows to run up to 3ms and another until it is finished. Loath spawn while true sleep if you want to hate on something

winter rose
#

I have loads of hatred towards bad code, and I don't miss targets

errant patio
#

:p

still forum
#

Big conditions / big area triggers are expensive
correct, but that's just expensive in general, not the triggers fault

#

There is no difference between unscheduled code and scheduled code in terms of performance or usage of system resources.
There is. Unscheduled code doesn't check the 3ms timeout constantly, scheduled does.

tough abyss
#

yeah, but not significant

winter rose
#

it's not the trigger's fault, it's the trigger usage that makes it so. Again, I don't blame the trigger itself but how most people use them

"let's place a trigger that's as big as the map" (looking at you BIS_fnc_IdontRememberTheName) "and let's trigger it when there are less than 3 opfor left"
that's not the trigger's fault; but triggers are usually the sign of someone not knowing how to do it

(I don't screech when I see a trigger in the editor, don't worry)

tough abyss
#

big area triggers are expensive
area size makes no difference. Checking if a unit is in trigger area is the same for small area or huge area

still forum
#

area size makes no difference. Checking if a unit is in trigger area is the same for small area or huge area
it does. Trigger collects all units in area into thisList, and also checks side and such

tough abyss
#

No

#

triggers collect all units regardless and check which ones are in trigger

still forum
#

2 years ago that atleast was the case when I investigated some performance troubles with huge trigger areas

tough abyss
#

could have been some other issues

winter rose
#

triggers not linked to anything, triggered by SIDE may be the ones that have the issue

#

well, some more testing is required I suppose.

errant patio
#

would inArea be more efficient than a trigger? :\

delicate lotus
#

I don't know what that has to do with triggers

#

a trigger checks a condition every x frames...

inArea is a check if a position is in a trigger area, in a marker area, in a location area or in a custom area.

errant patio
#

i need more sleep

delicate lotus
#

You can use a trigger to define the area for a not often checked inArea used in a script.

still forum
#

You can use inArea, because it is more specific to what you want to do.
Only want to check for players? use allPlayers.
Only want to check every 5 seconds? sleep 5

With a trigger:
Only want to check for players? let the trigger check all units first, and then filter players out afterwards
Only want to check every 5 seconds? well outta luck. 0.5 seconds is what ya get

errant patio
#

yeah. i think at this point my key problems are how do I create a system that lets me define a lot of areas and tie some variables to them

#

since essentially what I need is to be able to tell the game which loot table from the config to use, where

still forum
#

For your case, where you have lots of areas and stuff to check. It makes more sense to just script it, instead of creating a bunch of triggers

#

in script you can just iterate through your areas

errant patio
#

yeah.

#

What's the best way to define/store the areas, do you think?

tough abyss
#

Only want to check for players? let the trigger check all units first, and then filter players out afterwards
There is ANYPLAYER

winter rose
#

And what does it do under the hood?

delicate lotus
#

@errant patio if you want to just define a specific amount of areas. Use area markers or triggers without anything. This visualizes you the areas neatly in the editor.
Otherwise. Well arrays I guess

errant patio
#

this conversation is so long we are now coming in circles lmao

#

i'll keep brainstorming i guess

errant jasper
#

Hmm, three random questions

  • Do triggers still spend computation gathering the thisList if you do not use PRESENT or any thisList mode that actually requires it?
  • Unlike spawned scripts, are triggers guaranteed to be checked every 1/2 seconds?
  • Disregarding everything but the condition and on-activation, is the a practical difference between a trigger and a corresponding spawned script with a 0.5 second sleep loop ( and using isNil around the condition check and activation)?
delicate lotus
#

I thought triggers are checked every frame

still forum
#

I thought triggers are checked every frame
no

#

Unlike spawned scripts, are triggers guaranteed to be checked every 1/2 seconds?
yes and no. If the game runs with <1fps then they can't run every 0.5

errant jasper
#

alright fair point.. Though not sure if I care if my fps is <1

still forum
#

Disregarding everything but the condition and on-activation, is the a practical difference between a trigger and a corresponding spawned script with a 0.5 second sleep loop ( and using isNil around the condition check and activation)?
Well if you disregard everything then no?

#

trigger gathers object list, then checks condition, and then maybe activates.
If your condition doesn't check object list, you'll still get it

tough abyss
#

Do you know that you can check if all members of a group are present inside a trigger before activating it, right? But I see countless monstrous solutions for this check that amount to some resource hogging code, while a properly set up trigger would do it in a split second

still forum
#

The available options are specific to the connected trigger owner.
Whole Group - Activated when all the owner's group members satisfy the 'Activation Condition'.

Need to connect to the group then

tough abyss
#

set it to group yes but connect to 1 member, a player for example

#

I think this is what Lou was talking about, when you have {,,,} foreach units group yada yada in condition

#

putting loop in condition is bad indeed

errant jasper
#

Does the editor lines for "trigger owner" work differently than the lines for synchronization? I know that synchronization lines does not get reset for JIP objects.

drowsy axle
#

I am using Visual Studio Code.

still forum
#

some broken visual studio code plugin that you are using

spice axle
#

In the common vs code extension is a setting that you have to activate to allow reserved namespaces

drowsy axle
#

How do I access the settings?

winter rose
#

F1

#

or in Extensions β†’ little settings wheel

drowsy axle
#

Found it. Thanks for ya help!

still forum
#

all

drowsy axle
#

Including TOH?

still forum
#

You don't need anything

#

yes

drowsy axle
#

They all "share" commands?

still forum
#

No, I guess not.
Would be weird if they did

drowsy axle
#

So why do I need TOH commands, if I'm just in arma 3?

still forum
#

Didn't say you need them

#

Also Arma contains some TOH commands. Like the rotorlib stuff

drowsy axle
#

Okay.

short vine
#

Does anyone know of a command that will allow me to limit a vehicles "thrust" Im trying to force a plane to stay still for X seconds without disabling the simulation. Only workaround ive figured is Spawn an invisible helipad on the plane, attachto and detach when ready.

digital hollow
#

On the ground? defuel, disableAI path, lots of options.

winter rose
#

attachTo would be the simplest way to simulate wheel brakes yes

short vine
#

Yes on the ground, and its more aimed towards players than AI

winter rose
#
myPlane setDamage 1;``` πŸ‘€
short vine
#

XD

#

Lol thanks guys just wanted to know if I was missing a command but seems like i wasnt.

tough abyss
#

Attached plane will have no collisions though

#

Could try setVelocityTransformation on each frame at the same position

short vine
#

hmm that could be a problem, ill have to try your idea M242

forest ore
#
 {switch (true) do {
    case (player inArea "marker1"): {testActionID = player addAction ["Test action",{}];};
    case !(player inArea "marker1"): {player removeAction testActionID};
        };
    sleep 5;
    };
};```
Would need something like that to check (in this case) every five seconds if player is inside the area of *marker1* and then add *Test action* action if true. Now that adds a new *Test action* every five seconds while the player is inside the marker area. Is there a way to stop the function from adding a new action if one has already been added but still continue to check for the second case where player isn't inside the marker area?
grizzled spindle
#

Quick question as i have yet to find a solution... Is there a way to get something from the server and await its response, like in c# and javascript? Say I wanted a variable from the server is there a way I can get that? Or say i wanted to run a function on the server and return its result to me (client side)? Currently how i have done it for the past few years is: ClientsideFile1 -> ServersideFile->ClientsideFile2

winter rose
#

@grizzled spindle what is the situation that needs this?

finite dirge
#

That's pretty much the easiest way to do it. remoteExec from client to server and then back to the client. Making your second clientside function essentially a callback. You could use a broadcasted/public variable and then a waitUntil in the first function on the client and then have the server set it and broadcast it, but the loop would make it worse on performance (probably). That would be similar to the promise system of those await functions.

grizzled spindle
#

Loads of situations that could use this. Its currently for Altis Life. Lots and lots of data stored ina database and it would be nice to be able to easily be able to get this data without 3 files and having to split a function

finite dirge
#

You don't need to split the function, just add a param and split the function in half ABlobHaha (Hello Fellow Dirty Lifer)

grizzled spindle
#

eh?

#

What??

finite dirge
#

RemoteExec the same function 2 times with a parameter to tell the function what to run. So three executions, but only 2 files bcaFunnyLOL

grizzled spindle
#

Yeah haha, Still doesnt solve my original problem πŸ˜†

#

Well

#

It does

#

but not what I was wanting lol

finite dirge
#

I did give you the answer on how you do it in my first message. There's no function to just do that.

#

And it would likely be less efficient.

grizzled spindle
#

Yeah, thanks anyway mate πŸ™‚

errant jasper
#

I guess you want something like this (untested)

RSV_ReadVariable = {
    params ["_requestId", "_variable", "_machineId"];
    // Read from DB or whatever... Read from local variable space   
    private _data = missionNamespace getVariable _variable;
    [_requestId, _data] remoteExecCall ["OnServerVariableRead", _machineId];
};

RequestServerVariable = {
    params ["_variable", "_callback"];
    if (isNil "RSV_Request") then {
        RSV_Request = 0;
    };
    RSV_Request = RSV_Request + 1;
    private _requestId = format ["RSV_%1", RSV_Request];
    missionNamespace setVariable [_requestId, _callback];
    [_requestId, _variable, clientOwner] remoteExecCall ["RSV_ReadVariable", 2];
};

OnServerVariableRead = {
    params ["_requestId", "_data"];
    private _callback = missionNamespace getVariable _requestId;
    missionNamespace setVariable [_requestId, nil];
    [_data] call _callback; 
};

["AwesomeServerData", {
    params ["_data"];
    systemChat format ["Behold I have the server data now: %1", str _data];
}] call RequestServerVariable;
grizzled spindle
#

Yes, I like that. definitely the right direction

#

Thanks πŸ™‚

errant jasper
#

Oops, RSV_Request should increment.

grizzled spindle
#

Yes was just looking at that

winter rose
#

Regarding group's waypoints OnActivation; does the code run on every machine, or only on the group owner's?

austere silo
#

the script looks like this : USbox setPos ((getPos player) findEmptyPosition [0, 25]);

#

but its spawing at another player, it needs to spawn in front of me

astral tendon
#

how to check if a mine was disabled?

exotic flax
dense field
#

whats the best way to get a vehicle unflipping script to be usable on vics when only they're upside down/sideways?

astral dawn
#

You have answered your question right in your question

dense field
#

coolio

winter rose
#

negative vectorUp!

dull drum
#

Hi guys! Is there a good way to get a real pixel size of an icon for the drawIcon3d command?

winter rose
#

wait, due to line return I missed the "of an icon" -__-

dull drum
#

Yeah. The thing is I want to get an icon size (which could vary from 1px width to 100) and set the drawIcon3D size related to the real size of an icon, to avoid rescaling it too much. It's for the healthbar.

abstract idol
#

Hi, I started to study the editor of the game Arma 3. I began to study script commands. What does the "_" sign mean in scripts?

young current
#

can you give an example?

abstract idol
#

Ok

young current
#

or you mean like thing vs _thing

abstract idol
#

Yes, you're right

#

what is the difference between _ somecode and somecode

abstract idol
#

Oh, thank you, I was looking for this article on this site.

winter rose
#

You could have done it before having an answer, it is (really) against the #rules to have the same message in multiple channels (cross-posting) in order to get more attention. But thanks for abiding @abstract idol

abstract idol
#

I found your channel today, so I will give you questions, get used to it😁

winter rose
#

this channel isn't mine; but feel free to ask here as much as needed! πŸ‘

abstract idol
#

know that it’s not yours, but thanks anyway for the informationπŸ‘Œ

winter rose
#

a little up πŸ™ƒ does anyone know?

Regarding group's waypoints OnActivation; does the code run on every machine, or only on the group owner's?

spice axle
#

Should be group owner

#

To be 100% sure try it with a local created marker

errant jasper
#

@winter rose I only tested with a single client and a dedi but they run for all

astral dawn
#

Are there built-in or BIS-scripted or CBA-scripted functions to just get all items (weapons, mags, everything) of some cargo box in an array form and then pack it all back into the box?
I'm totally lost in all the cargo SQF commands right now

errant jasper
#

@winter rose However, the condition is the weird one!

winter rose
#

oh! How so?

errant jasper
#

So my setup was that waypoints

  1. condition true
  2. isServer or RADIO_ALPHA
  3. not isServer or RADIO_BRAVO

The radio variables are set by using the radio ingame. The on activation was this:
[judge, format ["machine %1 sees group reached WP #3", clientOwner]] remoteExecCall ["globalChat", 0];
The judge was just a unit for globalChat. For each waypoint I got both machine 2 and 4.

#

However, I could not advance past both waypoint 2 and 3 unless I activated the corresponding radio.

#

I would expect one of the, the Server, or the groupOwner to have the deciding role in when I could advance to the next waypoint.

winter rose
#

oooh, like conditions are on the group owner's side, whereas effects are global

#

crazy stuff - okay, stop using waypoints from now on πŸ˜„

errant jasper
#

Well if it was just the group owner, I as a joining player, should not have to activate RADIO_BRAVO.

#

And vica versa with the Server and ALPHA

winter rose
#

(@astral tendon ☝ here seems to be the answer)

#

phew…

errant jasper
#

not clarified yet, it was may player's group that had the waypoint

winter rose
#

tests needed

errant jasper
#

Initially, I though okay may the Server does the condition check, and the local client does the check to "advance the waypoint gui stuff - e.g. allow me to receive the next waypoint".. But then waypoint 2 should immediately broadcast the chat from the server at least, but that did not happen.

astral tendon
#

@winter rose To add, in my situation the units were from the opfor while I and my friend were bluefor so we got the systemchat, I fixed that by just adding IsServer since the code inside the waypoint was not suppoused to run on all machines, only on server.

errant jasper
#

I added global chat to the condition field and it looks like only the group owner checks... But then why am I not allowed to progress with an not isServer clause when joining a server...?

candid stump
#

Looking to learn how to use a Zeus like thing to let players make little bases in my mission.. Is that doable? Like fly around and place some sang bags down within an area?

#

Just put me in a direction and I'll muddle through all the things and eventually make it work

winter rose
#

@errant jasper were you the group leader?

errant jasper
#

yup

winter rose
#

huuuh,strange.
maybe the server hit this condition, the waypoint stays there and you don't "get" the waypoint until it is passed

OR

waypoints are calculated server-side??

errant jasper
#

wait I am gonna redo the runs.. Looks like the condition handling might have choked on the undefined radio-trigger variables

#

@winter rose My condition checks were borked... So simply put

  • Condition check at group owner only
  • Activation on all machines
#

shouldn't really do sqf after an entire day of reading pages of c++ template errors....

winter rose
#

πŸ˜„

#

but thank you very much for the wiki! πŸ‘ @errant jasper

hot kernel
#

how would I make a waypoint that cannot be completed? Say I want a unit to always "move" to position player (they can't be grouped). If I set the waypoint competion radius to 0, it'll probably just complete instantly,

[SWO_grp, 0] setWaypointCompletionRadius 0;
#

no probably, that's exactly what happens

#

or another method of an un-grouped follower?

#

the answer is probably that I don't want them to "always move" to player position, but rather periodically move to player position under conditions so nevermind, answer is self-evident

winter rose
#

a Search And Destroy WP doesn't complete;
but there is a BIS fnc that does make a group "track" another

hot kernel
#

@winter rose , thanks, the bis_fnc might work

winter rose
hot kernel
#

I'll try this some variation of this example,

_stalking = [grp1,group player,nil,nil,{player distance BIS_Heli < 100},"BIS_mrkRetreatMarker"] spawn BIS_fnc_stalk;
hot kernel
#

@winter rose does this look right?

followPLAY = [group SWO_SA, group Player,5,5,{false},""] spawn BIS_fnc_stalk;

follower/following, 5 sec interval, ~5 meters, {no end cond}, "empty"
Doesn't seem to work in the character init or the debug console. The wiki doesn't explicitly say will follow same SIDE.

winter rose
#

…what?

#
[group SWO_SA, group player, 5, 5] spawn BIS_fnc_stalk;```
use that somewhere else than in character unit and it should work @hot kernel , no matter the group sides
hot kernel
#

sorry, I didn't mean in the init properties I meant in the script that loads the character with attributes. I'll play around with it.

winter rose
#

…given SWO_SA is a unit and not a group or an empty vehicle, of course

hot kernel
#

@winter rose , I agree that it should work... but even in the debug console I get nothing. With (unit SWO_SA) or generic EAST or WEST characters.

#

changing nothing else but embedding it in a while true it works

winter rose
#

works perfectly fine for me in the editor.

hot kernel
#

@winter rose , surely I have configured something incorrectly but it seems inexplicable that the code doesn't work unless,

follower = [] spawn {
    while { true } do {
        followPLAY=[group SWO_SA, group Player, 5, 5, {false}] spawn BIS_fnc_stalk;
    sleep 5;
    };
};
winter rose
#

Vanilla Arma ?

hot kernel
#

I have FEMALE installed from Steam Workshop and Seattle but I don't think they should interfere with this kind of thing

#

the testing is all in VR

winter rose
#
[otherGroup, playersGroup] spawn BIS_fnc_Stalk``` and just that worked for me in Vanilla Arma.
hot kernel
#

using "Group Unit", or straight "Groupname"?

winter rose
#

groupName. I can try group unit if you want, but it will simply work as well

hot kernel
#

I'm gonna load an empty scene and try with only generic characters

winter rose
#

works.

#

Please, only use vanilla assets when debugging

hot kernel
#

that worked as expected. There's no way the character model makes the difference. I must have another issue somewhere. Thanks for helping me troubleshoot. @winter rose

winter rose
#

Welp, FEMALE might be on its period (harr harr)

austere silo
#

hello party people

#

the script looks like this : USbox setPos ((getPos player) findEmptyPosition [0, 25]);
but its spawing at another player, it needs to spawn in front of me

hot kernel
#

.<

austere silo
#

the USbox

winter rose
#

@austere silo you obviously execute the script locally?

austere silo
#

yea

#

thats the problem?

hot kernel
#

@winter rose , (for the record [otherGroup, playersGroup] spawn BIS_fnc_Stalk, works perfectly in the scenario, thanks again)

winter rose
#

noice
what was the issue?

austere silo
#

ah thats the answer montana`? the script should go serverside?

#

will try it out

winter rose
#

@austere silo no
β†’ player means a different unit on each machine; if you do "getpos player" and it returns another unit, it's that the code is run there

hot kernel
#

@winter rose , it would seem the problem was with this,
5, 5, {false}
for some reason, because just removing that made it work. Those optional parameters are unnecessary anyway.

winter rose
#

…no issue with these either, so IDK 😐

austere silo
#

okay...

winter rose
#

if you do sqf USbox setPos getPos player what is the outcome?

austere silo
#

will try that out

#

thx in advance

ivory lake
#

what's the preferred way to manage an unscheduled loop that has a delay?
to explain what I mean: I want to add a number, wait half a second or so, add another number

#

it feels like using something like cba waitandExecute is sort of excessive

#

maybe perframe handler with the delay?

still forum
#

it feels like using something like cba waitandExecute is sort of excessive
no it's not. That's the best way, most efficient way.

ivory lake
#

rgr that

astral dawn
#

This CBA thing is a per frame handler.
Although, it might be implemented not to run all the checks at each frame or not, I don't remember

still forum
#

depending on the delay, waitAndExec is more efficient

#

PFH checks the delay every frame, WAE doesn't

tough abyss
#

what does WAE do

still forum
#

keep sorted array sorted by time they execute

obsidian violet
#

Hey guys!
recently I created a function that will check if the player have a unit tag on them, If they dont they will be kicked from the server with a "endmission"

So everything works as it should but I wanted to reduce the files needed for mission makers to get it to work by simply keep it as a function and run it from a postinit. (so I dont need a init.sqf, initplayer, initserver etc... And that sorta works unless one thing is weird. as it is right now the missionmaker only needs two files. mission.sqm, a description.ext and the folder with the function.sqf

The problem
If one or two players join a dedicated server with this function and at the same time the mission starts, everything works, but the loading takes alot of time..

BUT if more players join the first time before the mission have started lets say 5 players go from lobby -> download the missionfile -> loadingscreen

the players will be stuck on the loadingscreen and nothing will happen.

I went around the problem by start the mission with me as the only client and then the players could load in by JIP.
I belive the Postinit function is causing this problem somehow and thats why I seek your help here.

Below is the description.ext and the function, Thanks.

Description.ext

class CfgDebriefing
{

    class End5
    {
        title =    SPG Mission;
        subtitle = "";
        description = You have to wear the SPG tag to take part of this mission;
        pictureBackground = "scripts\spg\spg.paa";
    };
};

class CfgFunctions {
    #include "Scripts\spg\enforceTag.hpp"
};

enforcetag.hpp

class KLTEnforceTAG {class EnforceTag {class postinit{postInit = 1; file = "scripts\spg\enforceTAG.sqf";};};};
#

enforcetag.sqf

if (isserver) exitwith {}; 

if (hasInterface) then {    
UnitTag = ["-SPG-"];        

private ["_unit","_SPG_member"];
waitUntil { alive player };
sleep 1;

_unit = player;
_SPG_member = false;

        if ( !isNil "UnitTag" ) then {
            if ( count (squadParams _unit) != 0 ) then {
                if ( ((squadParams _unit select 0) select 0) in UnitTag) then {
                    _SPG_member = true;
                    systemchat "Welcome SPG member!";
                };};};

        if ( !(_SPG_member) ) then {
            sleep 1;
            if ( alive _unit ) then {
                endMission "END5";                        
            };
        };    
};
winter rose
#

for description.ext and *.hpp, use ```cpp , cleaner

waitUntil { alive player }; ← might be your issue, idk

still forum
#

waitUntil { alive player }; there's your issue. You can't do that in postInit.
you need to spawn your script.

#

Also don't use private array. Use private keyword instead.

winter rose
#
UnitTag = ["-SPG-"]; 
// converts to
private _unitTag = ["-SPG-"];```
#

(unless it is used elsewhere of course)

obsidian violet
#

oh alright, thanks guys! πŸ™‚ no its just used in this function. you guys are awesome cheers!

winter rose
#

w00t w00t

tough abyss
#

It is postInit script, why would it block everything? It will just go into suspension until player is alive

still forum
#

because postInit blocks everything

#

it waits till all postInit's are ran through

obsidian violet
#

Would this still work if I simply remove the waituntil {alive player}; ?
Or will the game recognise the tag even tho the player is not alive?

still forum
#

player might be objNull, squadParams on objNull will not work

#

just put a spawn around everything

tough abyss
#

PostInit scripts are launched from init functions in their own spawned scope

obsidian violet
#

ah right, so the spawn wont block everything? since itΒ΄s gonna be runned "external" ?

still forum
#

PostInit scripts are launched from init functions in their own spawned scope
correct so?

#

initFunctions waits till they ran through. To end the loading screen

#

if your script never runs through. endless loading screen

#

@obsidian violet exactly, as after the spawn the script returns immediately

obsidian violet
#

Cool, thank you πŸ™‚

tough abyss
#

Since when spawned script can halt everything, unless of course it performs impossibly long command?

still forum
#

it doesn't

#

Noone said it does

#

the players will be stuck on the loadingscreen and nothing will happen.
That's what happens.

tough abyss
#

Initfunctions can be suspended?

still forum
#

postInit is spawned from initFunctions, and initFunctions keeps loading screen open till they are done

tough abyss
#

Sounds like bad design

obsidian violet
#
_SpawnEnforceTAG = [] spawn {



if (isserver) exitwith {}; //Deactivate this line for debug. Makes sure the script doesnΒ΄t run while you edit your mission.
if (hasInterface) then {    //Runs the script on all clients but not headless clients.
private _unitTag = ["-SPG-"];        //The Unit tags that are allowed.

private ["_unit","_SPG_member"];
waitUntil { alive player };
sleep 1;

_unit = player;
_SPG_member = false;

        if ( !isNil "_unitTag" ) then {
            if ( count (squadParams _unit) != 0 ) then {
                if ( ((squadParams _unit select 0) select 0) in _unitTag) then {
                    _SPG_member = true;
                    systemchat "Welcome SPG member!";
                };};};

        if ( !(_SPG_member) ) then {
            sleep 1;
            if ( alive _unit ) then {
                endMission "END5";                        //Insert a Endmission 5 in description.ext
            };
        };    
};
};
#

this should do the trick then? πŸ™‚
I give it a try later on.

tough abyss
#

If you spawn it from enforcetag then yes

winter rose
#

if (isserver) exitwith {}; ← so a non-SPG member can host

still forum
#

_SpawnEnforceTAG = why? useless.

obsidian violet
#

Missions within the unit is always being run from a dedicated server =)
the server cannot wear a unit tag

winter rose
#

only if the server is dedicated

#

so better use isDedicated, or better only hasInterface

#
if (!hasInterface) exitWith {};```
obsidian violet
#

oh so, only
[] spawn {all my code} ; ?

@winter rose itΒ΄s good as it is because when sitting in the editor and testing the mission, the missionmaker donΒ΄t have to worry about if the unit tag is worn. the member may be part of another unit? or some other factor πŸ™‚

winter rose
#

okie, just so you know πŸ˜‰

still forum
#

yes

obsidian violet
#

Thank all of you ❀

tough abyss
#

postInit are called scheduled so suspension is allowed but any long term suspension will halt the mission loading until suspension has finished. Parameters passed are [ "postInit", didJIP ].

#

What can be done about it?

winter rose
#

I suppose that this gibberishy explanative sentence means "it will block loading until it's not waiting anymore", but it's not clear

tough abyss
#

Well it holds loading screen from ending as Dedmen pointed. I guess presence of loading screen messes up other init processes as well

still forum
#

not sure if you want to do anything about that.
Seems reasonable. Game wants to wait till postInit is done. That makes sense.

#

people infinitely waiting in their postInit is what doesnt make sense

tough abyss
#

So loading screen is there to speed up loading scripts and hide postinitiation.

#

Maybe hardcoded limit that would end screen? Besides the order of postInit scripts is irrelevant so maybe launch a bunch of them in parallel?

#

Need to experiment

still forum
#

Besides the order of postInit scripts is irrelevant
Is it though? they are ordered by requiredAddons, so might not be irrelevant

tough abyss
#

Gonna check on that

queen cargo
#
private _arr = [  ["assertTrue",      { [] in [[],1,2,3] }],
   ["assertFalse",     { [] in [] }],
   ["assertFalse",     { [] in [[123]] }],
   ["assertFalse",     { [] in [1] }],
   ["assertTrue",      { 1 in [1,2,3] }],
   ["assertFalse",     { 1 in [2,3,4] }],
   ["assertFalse",     { 1 in [[1]] }],
   ["assertFalse",     { 1 in [] }],
   ["assertTrue",      { false in [false] }],
   ["assertFalse",     { false in [true] }],
   ["assertFalse",     { false in [1,2,3] }],
   ["assertFalse",     { false in [[false]] }],
   ["assertFalse",     { false in [] }],
   ["assertTrue",      { player in [player, 1, 2, "", []] }],
   ["assertTrue",      { player in [objNull, player, 1, 2, "", []] }],
   ["assertTrue",      { player in [objNull, 1, 2, "", [], player] }],
   ["assertFalse",     { player in [objNull, 1, 2, "", []] }],
   ["assertFalse",     { player in ["",1,objNull,2,3] }],
   ["assertFalse",     { player in [[player]] }],
   ["assertFalse",     { player in [] }],
   ["assertTrue",      { "abc" in ["abc",1,2,3] }],
   ["assertFalse",     { "abc" in ["ABC",1,2,3] }],
   ["assertFalse",     { "abc" in ["",1,2,3] }],
   ["assertFalse",     { "abc" in [["abc"]] }],
   ["assertFalse",     { "abc" in [] }]
];
{
    private _res = [] call (_x select 1);
    if (_x select 0 == "assertTrue" && !_res) then {systemChat ("invalid test: " + str (_x select 1));};
    if (_x select 0 == "assertFalse" && _res) then {systemChat ("invalid test: " + str (_x select 1));};
}foreach _arr```
Please one send me the results this time
(fixed the code too)
(Fixed the dev-branch requirement)
(Added Object `in`)
still forum
#

^ requires dev branch

queen cargo
#

also fixed now

#

object could be checked too pepethinking added object test-cases

tough abyss
#

nothing

queen cargo
tough abyss
#

my eyes

queen cargo
#

i will just assume that my in string test-cases are correct btw.

tough abyss
#

you should have passed or failed at the end

#

just finishing message

queen cargo
#

it is in the actual runtests.sqf

#

but this is a lil bit overkill to ask in this chat πŸ˜„

tough abyss
#

Run, Test, Run!

queen cargo
#

plus it uses special sqf-vm commands

#

to gather all files

#

((to name it: allFiles__ [".sqf"]))

tough abyss
#

why _x select 0 == "assertTrue"
why not have bools and just compare directly

#

[false, { [] in [] }],

#

or

{!_x} count [
false isEqualTo  ([] in [] ), 
true isEqualTo (1 in [1,2,3])
] > 0 // failed
queen cargo
#

because the test-framework supports multiple checks:

  • "assertTrue"
  • "assertFalse"
  • "assertEqual"
  • "assertNil" or "assertIsNil"
  • "assertException"
#

the reason why every testcase is shipped as separate code is again, due to SQF-VM commands

#

to name it again: CODE except__ CODE

#

that allows to catch actual SQF exceptions

#

aka: continue running if an error occurs

abstract idol
#

Hi, what does the code "private _myName = _this select 0" mean in the script