#arma3_scripting

1 messages · Page 535 of 1

still forum
#

@ebon ridge use the char code array to string thing to get a \n character

#

and then put that into string

#

endl should already do that, it returns \r\n afaik

#

check in extension what is actually the content of the string, if you get double newline it might be a problem on extension end

ebon ridge
#

toString [10] worked thanks!

velvet merlin
#

possible to scan via sqf for colliding terrain objects? (ie using bb, or what else may work better)?

spice axle
#

LineIntersection, just at the phone but look up at the wiki

velvet merlin
#

in what way specifically?

#

like there is no obj intersect obj cmd, right?

#

so you need to check if the two shapes do

smoky thorn
#

How you guys handle multiple CfgFunctions in one same mission? The open-world mission I'm currently creating happens to be first one where I need to use two different functions at the same mission. TedHo's HLF inf unit UnitCapture/play and 7erra's Arsenal shop.

Both works well when only one of the is included in the mission but once both of them are implemented one of them doesn't work.

The closest of victory I've got is with the following on description.ext

class CfgFunctions
{
#include "arsenalShop\cfgFunctions.hpp"

#include "functions1.hpp"

};

In functions1.hpp I got the HLF UnitCapture/Play stuff and it works. However when I start the mission I got the pictures error. https://ibb.co/YtZ77CV Line 3 in confing.sqf I haven't touched and it works when HLF-function is not implemented so the problems is clearly concentrated on having two CfgFunctions at the same mission.

unborn ether
#

Is there any proper way to detect CarHorn weapon being used, because both Fired | FiredMan doesn't seem to be triggered when driver horns? Thanks.

thorn saffron
#

Is there a way to change ammo count in a magazine without a weapon on a vehicle? I have a dummy mag that is just there, without a weapon and I want to change the ammo in that magazine.

cosmic lichen
#

@velvet merlin Maybe with bounding box and inArea command?

rocky mortar
#

@lavish ocean Added: RVExtensionRegisterCallback and "ExtensionCallback" mission event handler << can we have please a bit more informations on how to used it ? (function prototype, and handler exemple) >> first test, the handler returns that extension is unknown, it seems to act like a call extension function (...)

velvet merlin
#

@rocky mortar check tools channel history

rocky mortar
#

thanks you kju, i m going to look

velvet merlin
#

@cosmic lichen cant see how with a simple use
with BB, therefore comparing relative positions, radius, etc - aka more complex maths i can see, but seems somewhat difficult

#

i guess most simple would be still to make point clouds forth both
and then check if there is any overlap

#

however for a whole terrain with all its objects, this may be quite a lot of data

cosmic lichen
#

Why do you wanna check a whole terrain? Some sort of quality control?

fleet hazel
#

Guys. How to make the horizontal bar in the RscControlsGroup work by scrolling the mouse wheel?

cosmic lichen
#

If there is a vertical scrollbar I think that one gets priority

fleet hazel
#

@cosmic lichen No vertical bar.

cosmic lichen
#

Just saw the picture

fleet hazel
#

Horizontal bar only

cosmic lichen
#

Could be that scrolling is not supported by horizontal scroll bars

velvet merlin
#

@cosmic lichen correct. check for faulty placement

fleet hazel
#

@cosmic lichen thn

remote monolith
#

hey there.... a short question about "how to fuck around with triggers" wanted to split chernarus in half for pvp zone and pve zone... and want to get the players a message when they enter the red zone or leave it.... now when one player enters... all players get the message... not only the one who enters

_ZoneTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_ZoneTrigger setTriggerArea [3500, 8200, 0, true, 500];
_ZoneTrigger setTriggerStatements
[
    "this", 
    "['ErrorTitleAndText', ['PVP-Zone', 'Du bist nun in der PVP-Zone! Feuer Frei!!']] call ExileClient_gui_toaster_addTemplateToast;", 
    "['SuccessTitleAndText', ['PVE-Zone', 'Du bist nun in der PVE-Zone! Pass auf worauf du schiesst!!']] call ExileClient_gui_toaster_addTemplateToast;"
];```

ideas? also i set the trigger to LOCAL with the false in the first line... where true would be global...
vapid drift
#

how would I define a global variable in an addon that is referenced by multiple functions?

astral dawn
#

myVariable = "myVariableValue";

#

Of course you must make sure that your variable name is unique enough

#

by using prefix or something like that

#

ACE/CBA use different macros for that a lot

#

But probably that is not what you wanted to know?

vapid drift
#

@astral dawn I guess what I'm really asking is where in an addon would I define that and make sure that it actually gets set?

astral dawn
#

ah ok

#

so you are probably using cfgFunctions

#

preInit is the best place to set it I think

#

you know what cfgFunctions is, right?

vapid drift
#

yeah, that's what I'm using

astral dawn
#

ok, so just set some function to be run at preinit and do the initialization there

vapid drift
#

ok, good deal, thanks

#

been away a minute... I'm a little rusty

astral dawn
#

but I am not sure in which order one addon's preinit is going to run VS your other addons' preinit 🤷

vapid drift
#

well the functions are all in the same addon so that should be fine

#

I was just looking for a place to define all the types of ghillie suits so I wouldn't have to update several functions every time I modified it

astral dawn
#

read-only data can be stored in config

#

BUT as I know, reading configs is much much slower than reading from a global variable

#

so you will probably read these values and write them into a variable anyway to make it not so slow to read this data, but it depends on what code you run, how fast it needs to run, how often you run it, etc

vapid drift
#

basically just checking to see if a player has a ghillie in their items or are already wearing one and I plan to run it about once a second

astral dawn
#

consider event handlers instead of polling every second

#

CBA has an event handler for when player changes clothes

#

well, it will just poll this for you I think

#

maybe it's not so much use for you then

vapid drift
#

I wouldn't think so in this point... it's a pretty short amount of code to begin with

#

@astral dawn Thanks for helping

proven crystal
#

hello, do i have to remoteexecute ace_interact_menu_fnc_addActionToObject on the clients?

#

i thought it was enough to do it only on the server

#

it appears only the host sees the actions atm

ebon ridge
#

I'm having a problem deleting a respawn marker via script. It works fine in SP and local MP (both from editor) but on dedicated server the respawn doesn't disappear. The marker is respawn_west and I just calldeleteMarker "respawn_west" on the server during init phase. Any ideas?

#

never mind :/ doing it globally is apparently required for some reason?

tough abyss
#

@remote monolith add

_ZoneTrigger triggerAttachVehicle [player];
proven crystal
#

is it possible to change vcom settings on the fly? skillevels i mean?

shut finch
#

Hello. I need to detect if cargo container has items inside, and if it has, exit the loop. I've been trying various ways, but keep getting "Error type Any, expected Bool" on my if checks....

        _container = _this;
        waituntil {
            sleep 0.5;
            if !(itemCargo _container isEqualTo []) exitWith {};
            if !(magazineCargo _container isEqualTo []) exitWith {};
            if !(weaponCargo _container isEqualTo []) exitWith {};
            if !(backpackCargo _container isEqualTo []) exitWith {};
        };
    };```

I just wonder why it doesn't work, when I execute `itemCargo _container isEqualTo []` it returns bool, but when  I do these checks with if condition inside my loop it keeps throwing error.
young current
#

I don't think you can compare to empty array like that

#

What does an empty container return for that command?

shut finch
#

.< yep, I should have used exitWith {true};
problem resolved

frozen yarrow
#

Hey there,
is there a way to get something like allVariables but with the values? Including values of nested arrays

astral dawn
#

(allVariables _object) apply {[_x, _object getVariable _x]} ?

frozen yarrow
#

that does not give me the values of nested arrays though

astral dawn
#

Is nested array an array like [[1, 2], [3, 4]] ?

frozen yarrow
#

yeah

astral dawn
#

then if your _object has a variable "myvar" having value of [[1, 2], [3, 4]] then you will get it

frozen yarrow
#

the code you send up there, returns this:

["bis_wl_sectorlockmrkrs",["BIS_WL_sectorMrkrLock1_11","BIS_WL_sectorMrkrLock2_11","BIS_WL_sectorMrkrLock3_11","BIS_WL_sectorMrkrLock4_11"]],
["size",150]

(part of what it returns, didnt want to post all of it here)

#

and I want the values of stuff like "BIS_WL_sectorMrkrLock1_11" aswell

astral dawn
#

oh ok, so you need to use recursion I think

#

I'm not a master of recursion because it's hard because it's hard because it's ~ 😄

frozen yarrow
#

I could hardcode for the max number of nested arrays, but that'd be endangering my sanity

#

okay, better question: When I save a mission object (warlords sector in this case) to profileNameSpace on my server, can I somehow update the placed sector with the one I saved in profileNameSpace?

astral dawn
#

well there is no physical/computational/whatever limit why you would not be able to do that I think, but probably it's more related to #warlords_discussion and it's saving (if it has any saving, I don't know)

frozen yarrow
#

warlords sector is just an example though, so I thought this channel is still correct.
Doesn't really have to be saved.
If I any logic object (task, gameMaster etc) and copy it into a variable, and after something happened I want to restore the logic object to the state it was in when I copied it.

How would I update the changed object, to the copied?

astral dawn
#

Well, if the whole state of the 'object' is determined only by the values of the variables, then you can save variables then load them and in theory it should work allright, unless the variable values are copied to some spawned scripts or some other places...

#

getVariable/setVariable should be used, I think there is no other way

#

also, I think tasks from the BIS task framework are not logic objects but I am not 100% sure what they are

frozen yarrow
#

dang, in that case I need to make sure all arrays (even nested) are saved correctly. So back to the start :/

cosmic lichen
#

@tough abyss @velvet merlin easier imo to check for specific things, like floating entities, and objects with other objects too close I think that's a good idea. Check the bounding box or size of two objects and then check if the distance is smaller than the box of one of the objects. That way you could find potentially intersecting objects.

astral dawn
#

well, if you are not the author of the code for which you want to make the saving system, probably it's quite hard to say for you how everything is connected and if it's possible to change values on the run, probably you would want to halt the whole mission, perform load of your new values, then make it work again.... would need access to all the processing which is being done there...

frozen yarrow
#

I just want to load the previous state of sectors in warlords, so we can pause warlord sessions. Meaning it would only run once at mission start, so halting the mission once would not be ideal, but not too bad

astral dawn
#

probably it would be easier just to write save/load code for the sector module manually

#

most likely if you find the initialization code for it you will understand what the structure is and what means what

frozen yarrow
#

I should learn looking in the function viewer first 🤔
there is the BIS_fnc_WLSectorUpdate function, that basically does the things I need....

#

I'll try that for now. Thanks for helping me out 🙂

zinc sorrel
#

is there a way to get Transport helicopters from the support menu to have more accurate landings rather than land 100+ meters away? i know there's invisible heli pads, but rather not place 1000 of them around the map for a CTI mission

astral dawn
#

AFAIK the invisible heli pad is the best method

#

Well, you can delete it afterwards

astral tendon
#

Since the createVehicleLocal is about to be nuked, what is an better alternative for local creation of a vehicle with 3D preview and also allow for vehicle modification?

winter rose
#

createSimpleObject will have an aditional boolean to create locally

astral tendon
#

But that also allows the use of modifications and also get the array with BIS_fnc_getVehicleCustomization?

tough abyss
#

There will be a param i see, will just enable it for me.

#

Why they do this? i mean createVehicleLocal is not very critical for server security?

zinc sorrel
#

@astral dawn could it be used with the SingleMapClick command...so when i choose the helo's drop off destination it spawns a heli pad on that marker?

astral dawn
#

sure

tough abyss
#

nobody know for my issue?

still forum
#

Admins can see the HC

tough abyss
#

i'm not logged as admin

zinc sorrel
#

how would i set up the singlemapclick for the Helicopter trasport module?

astral dawn
dreamy kestrel
#

hello, is it possible to pass callbacks into a function? for instance...

#

_transform = { params ["_cb", ["_vals", []]]; private ["_transformed_vals"]; _transformed_vals = []; { private _y = [_x] call _cb; _transformed_vals pushBack _y; } forEach _vals; _transformed_vals; };

#

or perhaps there is already an Arma 3 function that does this? what I am looking for is a LINQ style "select" transformation.

ruby breach
#

So before anything else, sqf params ["_cb", ["_vals", []]]; private ["_transformed_vals"]; _transformed_vals = []; is a travesty. No. Just... no. ```sqf
_transform = {
params ["_cb", ["_vals", []]];
private _tVals = _vals apply {[_x] call _cb};
_tVals
};

#

You could also include _tVals in your params to make it private as well.

tough abyss
#

Since the createVehicleLocal is about to be nuked
Nobody is nuking anything, you’ve been misinformed, so please stop spreading it further @astral tendon

astral tendon
#

Só, the comand will still work just fine and no server will disable it?

dreamy kestrel
#

@ruby breach Ah, well it seems apply is what I was after in the first place. I do not even really need a transform function, that is what apply does.

tough abyss
#

apply does this, and yes you can pass callback to the function, why not? @dreamy kestrel

#

It will be entirely optional @astral tendon

dreamy kestrel
#

@tough abyss no, the callback function is the transformation I wanted to take effect, as in the apply function. problem solved 👍

#

i.e. private _add_one = [0,1,2,3] apply {_x+1};

astral tendon
#

So, why would i make a mission or an script with that comand and have the risk of being broke or unreliable due user error?

dreamy kestrel
#

or in my case, private _target_distances = targets_list apply {_shooter distance _x};

tough abyss
#

apply returns copy, if you want transform by reference then you can forEach and set

dreamy kestrel
#

@tough abyss Good to know, however, a copy is what I want. I do not want to effect the original.

astral tendon
#

@tough abyss that looks nuked to me still.

tough abyss
#

It don’t understand your dilemma @astral tendon

#

Why would a server owner deliberately break a mission by restricting CVL if the mission is using it and still run it? That is pretty idiotic thing to do

astral tendon
#

Maybe, he does not know it and it will take forever to figure.

tough abyss
#

Besides this is still debatable wether there should be server option to restrict it

#

Do you always take missions you know nothing about and put on your expensive dedicate server?

astral tendon
#

I know some who does it.

tough abyss
#

I bet they run it without BattlEye either

digital jacinth
#

I do that, i gave access to mission makers. I do not see much of a problem in a small community

tough abyss
#

And why would you restrict CVL on your server?

digital jacinth
#

well no i do not restrict it as i am against the change as dwarden already knows

tough abyss
#

You are against an option that can help with cheating problem ?

#

How does this option affect you personally?

digital jacinth
#

for close nit communities yes. I am not running some large gamemmode kinda server. peopole, make their own missions to play with friends

#

I use local only objects a ton, such as filling houses, helper objects and so on

astral tendon
#

Maybe some one or some Palace says that its safer to do.

tough abyss
#

@digital jacinth I don’t understand your objection to making it optional

digital jacinth
#

i would like the "safe" part to be opt in and not opt out

tough abyss
#

It is opt in and has been said by @lavish ocean already gazillion times

digital jacinth
#

last information i had was, it will have 3 modes, off, somewhat safe and safe, with somewhat safe being the default. might have changed again, as teh biki still has the on and off option only documented

tough abyss
#

No the 3 modes version was never safe default

#

You’ve been misinformed too

#

BI did not realise how many ppl use CVL in all sorts of interesting ways, so opt in became the only option

round scroll
#

on the agents vs units discussion some days ago, spawning the agents seems to be much less costly than a unit. Unfortunately it seems the agents cannot board anything with 'getin', otherwise it would be nice to load and unload hordes of them into helos/trucks/boats.

carmine oak
#

what's the best way to select the closest safe position?

remote monolith
#

@tough abyss your line didnt work for me... the trigger doesnt work at all when i add this line...

tough abyss
#

You sure it is my statement and not your trigger position [3500,295.67999,8200]??? This means your trigger is 8200 metres in the air, is this correct?

#

the position format is [x,y,z]

#

z is the height above the ground @remote monolith

#
_ZoneTrigger = createTrigger ["EmptyDetector", player getRelPos [10, 0], false];
_ZoneTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_ZoneTrigger setTriggerArea [4, 4, getDir player, true];
_ZoneTrigger setTriggerStatements ["this", "hint ""IN""", "hint ""OUT"""];
_ZoneTrigger triggerAttachVehicle [player];

works for me, walk a few metres forward, activated, back, deactivated ¯_(ツ)_/¯

exotic tinsel
#

can someone confirm if Respawn event handlers are stackable?

tough abyss
#

all event handlers are stackable apart from old onXXXX

exotic tinsel
#

ok thanks, getting odd behavior

remote monolith
#

@tough abyss it works for me too..when im alone in editor or the server...but if a 2nd player comes into the game and triggers it...you get the message as well.... (corrected the position... thnx for hint... copied the line from mission.sqm where its mixed up)

#

and the hint in the forum already solved my problem....

calm bloom
#

Hello guys, im testing vehicle penetration and cargo bots keep jumping out when they knowabout enemy player unit, no matter to disableai "all". Do you know how to completely turn their brains off?

verbal saddle
winter rose
#

@verbal saddle for playSound I suppose?

verbal saddle
#

Preferably anything that would support 3d audio.

#

That's why playMusic is out of the question for my situation.

tough abyss
#

@remote monolith then you must be doing something wrong, because triggerAttachVehicle makes trigger monitor local player only, so there is no way in hell it can trigger for remote player

sturdy cape
#

anyone knows a simple way to prevent a unit from being able to use weapons?

young current
#

there is none

tough abyss
#

You can override fire action @sturdy cape

sturdy cape
#

like an EH? right now i am trying a while loop which checks for weapons and class of the player and does removeweapon after.will see what that does

tough abyss
#

No it just overrides LMB

#

So when you click no fire

ebon ridge
#

what is the relationship between setTriggerActivation and setTriggerStatements? Does latter override the behaviour of the former, or is the former a pre-requisite for the latter?

still forum
#

both work together

#

setTriggerActivation is evaluated first, and then the condition code is ran with it's results, and then the onActivation statement runs if both

#

Atleast I think that's the case :U

tough abyss
#

setTriggetActivation controls Boolean this which you put in setTriggerStatements condition

ebon ridge
#

thanks

thorn wave
#

Looking to find or create a rescue winch script but not sure where to start. Any templates someone has laying around or a foundation I can use?

compact maple
#

Hey guys, I am doing so many reboot of my loczl server when testing scripts. Sometimes when I try to connect to my server, an error appear "cur mp mission is modified", I have to close my game, go to appdata, arma3, delete the curmpmission.pbo, then start my game against

harsh sphinx
#

Is there any way of getting the task name from a task created by createSimpleTask? I need to be able to do something dynamic, using setVariable on it would have been the preferred solution but the caveat of it not being set directly on the task but the FSM makes absolutely no sense to me.

dreamy kestrel
#

hello, I have successfully placed Jets DLC UAV controlled assets, VLS, the Hammer, and so on. this is all well and good, I can connect to them via UAV Terminal...

#

however I am finding that the Hammer sometimes drops artillery into the AO, and I want to prohibit the AI from doing that. is there a setting I can tell it to not engage?

craggy adder
#

Remove the ammo from it on init?

dreamy kestrel
#

@craggy adder that's absurd, but thank you for the suggestion. then it would be useless for everyone.

vapid wadi
#

wanna make sure

#

that it looks normal

sacred acorn
#

Have any of you guys had problems with PlaySound3D having wildly varying volumes?

#

For context, here's my code that's attached to an On Activation trigger:

_soundToPlay = _soundPath + "sounds\jellyfishjam.ogg";
playSound3D [_soundToPlay, trackspeakers, false, getPosASL trackspeakers, 5, 1, 175];```
#

However, when I play the mission, it seems a 50/50 chance if the volume will be either really really loud, or so quiet you need to be right next to the object to barely hear it. For the life of me I cannot figure out why it's so inconsistent. The only mods I have installed for this mission are ACE3 and CBA.

ruby breach
#

@vapid wadi Post code, not screenshots

vapid wadi
#

alright

#

1 second

ruby breach
#

You're probably getting "expected bool, type number"

vapid wadi
#

``sqf
private _ServerName = tolower(MAIN_SETTINGS_TYPE(getText,"GameSettings","discount_serverName"));
private _nameCheck = (tolower profileNameSteam) find _ServerName;
private _discountPricing = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") * 0.1;

if (_nameCheck) then {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") - _discountPricing;
} else {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice");
};
``

#

whoops

#

welp

#

thats it

jade abyss
#

3x `

vapid wadi
#

ahh

#
private _ServerName = tolower(MAIN_SETTINGS_TYPE(getText,"GameSettings","discount_serverName"));
private _nameCheck = (tolower profileNameSteam) find _ServerName;
private _discountPricing = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") * 0.1;


if (_nameCheck) then {
    _buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") - _discountPricing;
} else {
    _buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice");
};
ruby breach
#

_nameCheck is a number, not a boolean

vapid wadi
#

uhh im stupid lol, how would I fix it then?

ruby breach
#
private _nameCheck = ((tolower profileNameSteam) find _ServerName) > -1)
``` probably
vapid wadi
#

I didnt write that part, that works fine

#

its used for boosting paychecks on altis life I copied it out of our servers paycheck script and removed one of the checks

ruby breach
#

that works fine Sure it does, but it causes an error a few lines down

#

if (_nameCheck) then { doesn't work when _nameCheck isn't true or false

jade abyss
#

if (_nameCheck) then { needs a bool (true/false), you give it a number

vapid wadi
#

ahh ok

#

alright

jade abyss
#

Thats why -> Change it to the one that Gnashes posted, for example.

vapid wadi
#

if (_nameCheck != -1 && MAIN_SETTINGS_TYPE(getNumber,"GameSettings","paycheck_bonus") isEqualTo 1) then { this is how we had it before. I fucked it up sorry

#

How our old dev team had this written is like a rewrite of the Altis Life Framework. Im just new and dont usually do scripting.

#

Thanks for the help tho

sacred acorn
#

My Reddit thread for more info pertaining to my question

leaden summit
#

So I currently have SQF [ _helo, "Remove Flight Recorder", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa", "_this distance _target < 4", "_caller distance _target < 4", {}, {}, {_recorder = "rhs_flightrecorder_assembled" createVehicle position player; hint "Flight recorder removed, get it back to base"}, {}, {}, 3, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true]; in a script and later on I want to delete the object _recorder
I understand that that variable is only local to that function, so how do I go about making it so I can reference it later in the script?

round scroll
#

if there's just one instance of recorder around, make it a global variable, easiest path to follow

#

and if concerned on locality, publicVariable to broadcast it to all clients, depending on where the removal script runs

leaden summit
#

OK cool thanks

white sky
#

Is lbSetPictureColor just changing the color of the light that is illuminating the image ?

winter rose
#

@white sky something like that yes

exotic tinsel
#

would someone be willing to better explain what setGroupOwner does. i dont fully understand the wiki. Im trying to change the squad leader of a squad dynamically.

hollow thistle
#

You need to use setLeader

#

setGroupOwner sets "owner" of the group. That means who simulates the group / where group is local.

winter rose
#

@exotic tinsel setGroupOwner sets network ownership of the AI 😉

#

ninja'd!

hollow thistle
#

Eg you can set that headless client is a group owner of the group and it will simulated on hc not the server.

#

You can't change ownership of the groups where player is a leader because groups lead by player are always local to him.

exotic tinsel
#

ok now i get it, thanks all

exotic tinsel
#

what is the deal with arma. there are 3 ways to disable a coms channel and still after respawn they have access to the disabled channel.
I have this in the initPlayerLocal

            0 enableChannel [true, false];
            1 enableChannel [false];
            2 enableChannel [false];
            3 enableChannel [true, true];
            4 enableChannel [true, true];
            5 enableChannel [true, true];

            setCurrentChannel 3;

this is in the onPlayerRespawn

            0 enableChannel [true, false];
            1 enableChannel [false];
            2 enableChannel [false];
            3 enableChannel [true, true];
            4 enableChannel [true, true];
            5 enableChannel [true, true];

            setCurrentChannel 3;

same configuration in the description.ext
and in the initserver

the player can still use side chat

#

i have also used 1 enableChannel [false, false];

quartz pebble
#

By the way, is there a way to completely remove a radio channel from the list? E.g. if player has no other members in his group, he doesn't need the group channel. If player is not in a vehicle - he does not need the vehicle channel.

exotic tinsel
#

let me know if you find out. lol this has been a pain for a while for me.

quartz pebble
#

The only thing I found out so far, is the existing commands like enableChannel can't completely hide any of builtin channels.

queen cargo
#

It is possible

#

But afaik no built-in way

#

you could however, just catch the keys and manually swap channels

quartz pebble
#

Hm, nice Idea. @queen cargo thank you!

queen cargo
#

Urgh ... those closed-source DLLs ...

ivory lake
#

Is anyone aware of a work around for moveOut not working for AI that's under the players command?

#

i guess having them leave the group and rejoin but surely there is a script command where it works without needing that?

ivory lake
#

note this is when the AI units are in a turret of a moving aircraft

tough abyss
#

is there a way to add arguments to the addAction condition param

queen cargo
#

remove and readd, create global variable, call some code

#

just a few possibilities

limpid musk
#

Hi, please let me know if this is the wrong spot for this, I have been searching for a script or maybe a mod that would allow the player upon incapacitation to go back to shooting while bleeding out, or the "last stand" state, I have played on some servers before that had this feature, but all searches on the internet and workshop lead to player created missions. I have very very limited experience with scripting and any help in the right direction would be extremely appreciated. thank you

frozen agate
#

"this and assassinate, intel, rescue, secure"

#

This is a condition script for an end trigger that's only supposed to activate when the four tasks are completed

#

Only, it gives me an error when I preview

thorn wave
#

I’ve noticed in the collision light entry for an aircraft config, there is a daytime option. If set to 1 it makes no difference though. Does the engine not support that type of lighting when the time is still set to day?

remote monolith
#

@tough abyss yo see my lines of code right? so what can i do wrong then in your opinion? and like i said...when i add your line then it doesnt give me or anyone else any message at all...so it seems it doesnt trigger at all

#

but doesnt matter anymore.... problem solved...

ruby breach
#

To the best of my knowledge, that's still not been addressed; but I've not really managed a mission in about a year now.

tough abyss
#

@remote monolith You told me the line still makes it trigger for other players, now you tell me the line stops triggering it for anyone. Make up your mind, dude.

remote monolith
#

well... you should read the whole texts i write..

#

CoolGargamelgestern um 11:11 Uhr
@tough abyss your line didnt work for me... the trigger doesnt work at all when i add this line...

sturdy cape
#

How can i make ai attack a player via a script? I want to do it that way because its a melee attack and playaction/setdamage Combo. Any simple way to check targets,move to target and Start my attack fnc?

#

Or do i need to create an fsm and functions for all the Staates like Ryan did it for his Zombies? I want to keep is as simple as possible

tough abyss
#

@remote monolith @floral dew it works for me too..when im alone in editor or the server...but if a 2nd player comes into the game and triggers it...you get the message as well.... (corrected the position... thnx for hint... copied the line from mission.sqm where its mixed up)

#

Anyway, I have little interest in you said I said, so could you please stop tagging me

carmine oak
#

Is there anything that can return more accurate representation of a model than the boundingbox

weak tiger
#

why do we need CBA functions to effectively deal with inventory after arma has been out for x years? can you please add a removeItemCargo and addItemCargo for each item type already

robust brook
#

need help with weapons not showing in crate

ruby breach
#

Should be getting something along the lines of "error: type array expected string"

finite jackal
#

👋 @robust brook _item is a multidimensional array, addItemCargoGlobal accepts a single dimensional array [item, count]

robust brook
#

asylum dev team pog thanks

finite jackal
#

if you want it to add all those items, you can use {_crate addItemCargoGlobal _x} forEach _item;

cosmic lichen
#

Had anyone else have issues with ctrlTextHeight a very imprecise value?

queen cargo
#

doubt it has something to do with ctrlTextHeight

#

and rather with the way fontscaling works

cosmic lichen
#

My guess is that it does not take the line height into account propely.

#

Any known workaround for that?

verbal saddle
#

You talking about the 3denCopy thing?

#

From what I've read it appears to be using a hidden ctrlStructuredText to get the height of the text. Then using the height of the text in that control to set the height of the ctrlEditMulti.
I'd say that the height of the text within the ctrlEditMulti is much higher then the height of the text in the ctrlStructuredText control.
Files for context:
onload: https://i.imgur.com/FDkyp2K.png
display: https://i.imgur.com/cbh8OQp.png

dull drum
#

Hi, guys! Is there a handler for the new spawned units? I think that EntityRespawned does not fit for the AI spawners, right? I've tried to add units to the array with while (true) do {} but it looks that it's too much for the script - my mission never started 😃

hollow thistle
#

Without it there are only config based init handlers.

dull drum
#

But if it will be config based class how do i get spawned AI unit there?

#

also chuckled on this: 'because Man is the parent class of all animals'

hollow thistle
#

Do you use CBA or not?

dull drum
#

I have the mod, but as it is for MP mission I'd stick to the vanilla

hollow thistle
#

Then I think the only way to do this would be getting entities [[], [], true] and storing it in variable and periodicaly compare stored value with entities [[], [], true] again. That way you will know what entities were created between your loop executions.

#

This will be kinda slow 🤷

#

With cba you can do ["All", "init", {systemChat str _this}] call CBA_fnc_addClassEventHandler; and done.

dull drum
#

Nice!

verbal saddle
#

@cosmic lichen
Ok this is what I've got currently.
Using excel I created a string of numbers from 1-675 in a column.
I then created a string of numbers in a row from 1-5982.

If I put the column of numbers in to the display it will only show a specific number of lines at once.
Example code: https://pastebin.com/raw/JmXmUeuV
Example image: https://gyazo.com/a2222b7053d997f44862aea8906d558a

BUT, if I put the row of numbers from 1-5982 in the code then it will show all of the numbers.
Example code: https://pastebin.com/raw/kkc1JLPJ
Example image: https://gyazo.com/40eccccc90281e917eb110eca5f20eaa

Looks like it might be the line breaks that are causing the issue.
Does ctrlStructuredText interpret text differently when using ctrlSetText vs ctrlSetStructuredText?

cosmic lichen
#

@verbal saddle Might be the issue. Gonna test that.

#

Issue is still there even if both controls are ctrlEditMulti

sand anvil
#

Hello! So what I've been trying to do is dialogue between players in a custom mission.

Whenever player3 says anything to player1 (both are real players) it gets repeated by the amount of players on the server so I think this is the script running on every PC which causes the problem, but I don't know how to fix it.

Here's the script .sqf
`player3 KbAddTopic ["introduction","radio1.bikb","",""];
player1 KbAddTopic ["introduction","radio1.bikb","",""];

player1 KbTell [player3,"introduction","radio1"];

waitUntil {

player1 KbWasSaid [player3,"introduction","radio1",3];
};

sleep 1;

[player3, [player1,"introduction","radio2"]] remoteExec ["kbTell", player3];

sleep 5;

player1 KbTell [player3,"introduction","radio3"]; `

#

Normal way of doing KbTell doesn't work at all between players

queen cargo
#

```sqf
```

winter rose
#

@sand anvil your script may be executed on each machine!

#

you should then call it only from the server

sand anvil
#

Yup and I don't know how to make it run locally if that's the correct way of saying it

winter rose
#

where is the call defined?

sand anvil
#

Umm sorry, what do you mean?

#

It executes when player enters a trigger 0 = execVM "radio1.sqf";

#

If that's what you mean

verbal saddle
#

Well the code still shows an error with the sizing of the scrollbar so hopefully it can he helpful for debugging the issue.

cosmic lichen
#

@verbal saddle I found the issue with the text height

#

It's caused by two things. First of all, one control is a ctrlEditMulti and the second issue is the font.

sand anvil
#

@winter rose The weirdest thing is that I got this to work earlier on my old mission and it still works and I copied the script 100% and it doesn't work on my new mission anymore 😄 The only thing that differs is the length of voicelines

cosmic lichen
#

If both controls are ctrlEditMulti with the font font = "PuristaMedium"; it works fine with both your examples and mine

verbal saddle
#

1.56 - Eden Editor
CT_EDIT 2 (Since Arma 3 v1.57.135040)
Ahh

winter rose
#

@sand anvil yes, what I meant.
make the marker server-only, and trigger "on player entering" (iirc there is such a thing) and you should be good

#

or, inside your file, if (!isServer) exitWith {};

sand anvil
#

How does one make it server only? I'm really shitty at scripting 😄

winter rose
#

the trigger has a tickbox in Eden Editor, don't worry 😉

sand anvil
#

I'll try the !isServer tho

#

Oh I'll take a look

#

Oh damn

#

That might be it

#

I'll test it with my friend

#

Nah now the other player is completely silent

#

gonna try if (!isServer) exitWith {}; next

winter rose
sand anvil
#

The shitty thing about this is that I can't test with bots 😄 so it's pretty slow

#

@winter rose You are a god among men!!! It works! if (!isServer) exitWith {}; is the solution!

winter rose
#

take note everyone! \o/
but seriously, thanks 😄 hehe

sand anvil
#

Thank you ❤

static bridge
#

Does anybody know if it's possible to use UnitCapture and UnitPlay to create a dynamic, on map click, airstrike call in? I only ask this because I'd like to create a divebomb call in with Stukas and aside from UnitCapture, idk how to get the AI to simulate a divebomb. My thoughts were to spawn a plane on map click and have it execute the movement data I capture. The movement data I capture would be to bomb a Target at the origin on a map [0,0]. Then if I theoretically execute the movement data, but replace the position with _pos + UnitPosition for each frame time. Theoretically I'd get that movement data to play anywhere I click on the map and be on target. Anybody know if this sounds possible? Or maybe another work around to a divebomb script?

#

_pos = my map click position
UnitPosition is just the part of the capture data array.
[FrameTime, UnitPosition, UnitDirectionVector, UnitUpVector, UnitVelocity]

devout wolf
#

trigger
i fucked up
i have important trigger
i haven't steup it's name in editor
and activation
we are in this
trigger
any way?
to activate?

still forum
#

you don't need to give the trigger a name to let it trigger

tough abyss
#

any way?
to activate?
by?
script?

#

or?

devout wolf
#

script

#

to activate

#

anyway

#

found solution

#

i will leave it here

#

for others if they make a litlle mistake

#

_triggers = [getpos player select 0,getpos player select 1] nearObjects ["EmptyDetector", 5000];
{
_x setTriggerActivation ["ANYPLAYER", "PRESENT", false];
}forEach _triggers;

radiant egret
#

👍

thorn wave
#

Using these two winch scripts, how am I able to attach a custom basket model to the end of the rope (Winch) once activated? Once activated how could I get the patient to be loaded into it once it detects them?

#

_pilot = _this select 0;
_veh = assignedVehicle _pilot;
~0.1

#RopeDef
_SideRope = (ropes _veh) select 0;
_ropePos = ropeEndPosition _SideRope select 1;
_length = ropeLength _SideRope;
?(_length <=1.5) : goto "ExitScript";
~0.1
_ManSearch = _ropePos nearEntities ["Man", 3.5];
~0.1
?!(isNull (_ManSearch select 0)) : goto "ManCatch";
~0.1
goto "RopeDef";

#ManCatch
(_ManSearch select 0) switchmove "InBaseMoves_sitHighUp1";
~0.1
(_ManSearch select 0) enablesimulation false;
~0.1
(_ManSearch select 0) setpos [ getPos (_ManSearch select 0) select 0, getPos (_ManSearch select 0) select 1, (getPos (_ManSearch select 0) select 2) +0.5];
[(_ManSearch select 0),[0,0,1.2]] ropeAttachTo _SideRope;
ropeUnwind [_SideRope, 3, -1, true];
~0.2
_veh vehicleChat "man on winch rope";

#LengthCtrl
_length = ropeLength _SideRope;
?(_length <=1.5) : goto "ExitScript";
~0.1
?(speed _veh) >= 30 : ropeUnwind [_SideRope, 4, -20, true];
?(speed _veh) <= -30 : ropeUnwind [_SideRope, 4, -20, true];
~0.1
goto "LengthCtrl";

#ExitScript
?!(isNull (_ManSearch select 0)) : (_ManSearch select 0) moveincargo _veh;
~0.1
?!(isNull (_ManSearch select 0)) : _veh vehicleChat "man onboard";
?!(isNull (_ManSearch select 0)) : (_ManSearch select 0) enablesimulation true;
?!(isNull (_ManSearch select 0)) : [(_ManSearch select 0)] joinsilent (group _pilot);

~0.1
exit

#

Here is the rope attachment position

#

#RopeAttachPos
_SideRope = ropeCreate [_veh, _AttachPos, 4];
~0.1
_ropePos = ropeEndPosition _SideRope select 1;
~0.1
[_pilot] exec "\SCmod_fire\script\SCmod_Catch.sqs";
~0.1
_id1 = _pilot addAction ["<t color='#FFFFFF'>RS winch</t>","\SCmod_basic_waterkit\functions\SCmod_bambyRS.sqs","",4.6,false,true]; _pilot setVariable ["Raise", _id1];

_id2 = _pilot addAction ["<t color='#FFFFFF'>LW winch</t>","\SCmod_basic_waterkit\functions\SCmod_bambyLW.sqs","",4.5,false,true]; _pilot setVariable ["Lower", _id2];

still forum
#

🤢

#

```sqf

```
code highlighting

#

Also.. wtf is that SQS script??

ruby breach
thorn wave
#

Yes, I had permission to use his scripts as a template for my own. Having trouble deciphering them lol. SQS is not my specialty

radiant egret
#

didnt even know A3 still supports sqs lol

thorn wave
#

Works well client side, not server lol

ruby breach
#

I'm not even sure you'll be able to get a lot of help with SQS. Might be better off translating everything into SQF first, then tuning/debugging

winter rose
#

on it ^^ for the lulz

#

(yes, I am that bored :D)

thorn wave
#

@winter rose you're my hero lol

winter rose
#

hahaha it brings back ooold memories actually

thorn wave
#

I usually enjoy scripting, but trying to do this is a pain in my ass lol

#

@winter rose if it helps I could actually send you both the SQS scripts to make it easier? Both entries I posted are from two different files.

winter rose
#

I am doing the rescue script you pasted

thorn wave
#

Oh great. I really appreciate that. My time for scripting is very narrow now days..

winter rose
#

I only translated, I shouldn't have changed any logic

#

did it work?

thorn wave
#

Let me test it real fast

dreamy kestrel
#

how do I set a plane's (Jets DLC) targeting camera initial orientation? such as AZ, Direction, Angle, that sort of thing.

#

I need to set it on init. I know how to wire that event up on a class of objects, just not how to work with the targeting pod.

hallow spear
#

anyone know how to get the eventhandler for honking a vehicle horn?

tough abyss
#

Is "Fired" not working?

hallow spear
#

no, nor firedman

#

i believe cause its not a turret position

ivory lake
#

nah fired doesnt work for horn as it technically doesnt 'fire'

#

I assume you're wanting to see when a player does it right?

#

if so your option may be monitoring inputaction "defaultaction"

#

and checking if the currentweapon is the horn

finite jackal
#

@hallow spear could try using the keydown handler and check if player is in a vehicle and is driver

hallow spear
#

thanks for the suggestions, i will work on the key handler approach

ruby breach
#

I'm sure there's a better way of doing this, but here's the 30 second version ```sqf
(findDisplay 46) displayAddEventHandler ["mouseButtonDown", {
params ["_displayorcontrol", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
if (_button == 0) then {
if !(isNull objectParent player) then {
if (toLower(currentWeapon (objectParent player)) find "horn" > -1) then {
//It's a horn! (probably)
};
};
};
}];

hallow spear
#

thank you for this example!

drifting copper
#

Looking if someone can maybe shed some wisdom on me or if someone has the time help me. Looking for a "if is indfor then set invent random item from x list". I have 0 scripting knowledge and what I tried from google and the little I do know I managed to break my mission file.

hallow spear
#

you want an independent unit to get a random item? @drifting copper

drifting copper
#

@hallow spear yes and no. Want them to get a random "uniform" from a predefined list. This counts for editor placed and zeus spawn-in

runic edge
#

Hello guys, I'm trying to get some text displayed at the startup of my mission but the valign parameter isn't working. I'm unable to find my mistake at this point, what am I missing ?
Thanks in advance

sleep 2; 

[parseText "<t valign='top' align='right' font='PuristaBold' color='#417630' size='8'>D. I. S.  : </t> <br/> <t valign='top' align='right' font='PuristaBold' color='#417630' size='5'>Ad augusta per angustam  </t>", 
            false, 
            nil, 
            8, 
            0.7, 
            0] 
            spawn BIS_fnc_textTiles; 
            sleep 9; 

[parseText "<t valign='middle' align='left' font='PuristaBold' color='#417630' size='5'>Opération éclaircie </t>", 
            false, 
            nil, 
            5, 
            0.7, 
            0] 
            spawn BIS_fnc_textTiles; 
            sleep 6; 
[parseText "<t valign='bottom' align='center' font='PuristaBold' color='#417630' size='5'>Altis, H0600</t>", 
            false, 
            nil, 
            5, 
            0.7, 
            0] 
            spawn BIS_fnc_textTiles; 
drifting copper
#

@hallow spear found me a work-a-round via DMs. Thank you.

marsh storm
#

Hey guys - I've got a script to spawn a BO_GBU12_LGB on a target for a scripted explosion but I'm looking for a bigger blast... Anyone know if there's a munition in say, RHS, that's bigger? Can't find their classnames for ammo on their wiki at all :/

#

I'd really like the SCUD explosion or something similar but I can't find the classnames for any projectiles anywhere

spice axle
#

@runic edge where do you execute it?

dull drum
#

@hollow thistle thanks for that CBA event handler, it worked. AI is still stupid (or too smart) to do a zerg rush 😃 But it is much better than it was before (especially for troops out of groups)

runic edge
#

@spice axle It's in a file cantrecallname.sqf that i call in my init

dull drum
#

Got a question about setting up Zeus via script.
I need it only to have some units available and I need costs for these units. So the units part of the code works just fine - I can see only them in MP. But I don't have any points for the Zeus 😦
`//add Zeus Points
z1 addCuratorPoints 1;

// set Zeus available units and their costs
[ z1,
[
"RyanZombieC_man_1walkerOpfor",0.1,
"O_support_AMG_F",0.1,
"RyanZombie25mediumOpfor",0.1,
"RyanZombie15Opfor",0.1,
"RyanZombieboss7Opfor",0.2,
"RyanZombieC_man_polo_5_FOpfor",0.1
]
] call BIS_fnc_curatorObjectRegisteredTable;`

spice axle
#

@runic edge you call it? sleep isn’t a valid command in a sheduled environment. You need to spawn it.

#

Like _null = [] spawn my_function

runic edge
#

this is my mission folder

#

with my init in background

spice axle
#

What is the error message?

runic edge
#

There's none

#

it just stick the message on top

#

like valign='top' is non effective

runic edge
#

made a try with 1= ["Mission name", "By: Author name", "Date"] spawn BIS_fnc_infoText;
It's still appearing in the top right side corner of my screen

winter rose
#

BIS_fnc_infoText should appear bottom right
try without any mod…?

runic edge
#

disregard my last, I modified my hud layout back then

#

juste remember

little ether
#

What's the best way to use a units INIT to apply ACE damage to it and have it work with bandages etc?

I have damage being applied correctly with [this, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit; but when bandaged the wound never fades. Is there something I'm missing that would help?

dim terrace
#

can someone test
cutRsc ["binocular", "PLAIN"]; in stable branch?

astral tendon
#

What is the comand like abs that make numbers negative?

still forum
#

abs makes numbers absolute (positive)

#

Oh missunderstood the question

#

- makes things negative

queen cargo
#

@still forum that answer is missleading

#
private _num = -1;
diag_log -_num; // 1```
hollow thistle
#

-abs _num lenny

queen cargo
#

correct way to always get a negative number:

private _num = -1;
diag_log - abs _num; // -1

_num = 1;
diag_log - abs _num; // -1```
carmine oak
#

how do i open the debug console during briefing?

proven crystal
#
if ((isNull (getAssignedCuratorLogic player)) or (player == ace_player))
still forum
#

no need for parenthesis for isNull or getAssignedCuratorLogic

proven crystal
#

should return me true if a player is not a zeus, OR if he is a zeus but not in zeus mode?

still forum
#

first part checks if player is a zeus

#

second checks if he is NOT remote controlling someone

proven crystal
#

oh

still forum
#

if (hasZeusAccess && !isRemoteControllingUnit)

proven crystal
#

i want to exitwith whenever a player is not actually in zeus mode.

#

so i guess that is not only remotecontrol

still forum
#

check for whether the zeus display is open

#

or remotecontrol

#

RscDisplayCurator, dunno the idd

proven crystal
#

how do i check for the zeus display?

still forum
#

findDisplay

proven crystal
#

hmmm

tough abyss
#

you want display or just if it is open?

#

findDisplay 312 is display

#

could also check if curatorCamera is not null

proven crystal
#

ok that curatorcamera might be the thing for me

dreamy kestrel
#

I have spawned from artillery and AA assets at the beginning of a mission and crewed them, Mk49 VLS, Mk45 Hammer, in particular. I am finding that the AI engages lasers pointers and such in an AO on its own. I want to turn that AI behavior off. Does anyone know of a way to do that? Thanks!

tough abyss
#

AI engages lasers pointers and such what do you mean by "and such"

plush oriole
#

thermal targets?

tough abyss
dreamy kestrel
#

mainly I just want the AI to not engage anything. the only purpose I want it to serve is as a UAV Terminal object.

#

ah ok, so if I do something like crew vic_name and iterate that crew over the enableIRLasers, that should do the trick?

proven crystal
#

you might want to try something like this maybe?

#

_x disableAI "AUTOTARGET";
_x disableAI "TARGET";
_x disableAI "SUPPRESSION";
_x disableAI "AUTOCOMBAT";
_x disableAI "FSM";

#

basically they wont do anything

dreamy kestrel
#

Perfect, I'll experiment. thanks all for the suggestions.

proven crystal
#

also _x enableAI "PATH"; if you wnat them to stay where they are

dreamy kestrel
#

sure, I'm only talking about the static turret assets, but I appreciate the insights.

proven crystal
#

_group setCombatMode "BLUE";
_group setBehaviour "CARELESS";

could also be options

coarse plover
#

Hello!!!!!!! I want to try disabling friendly fire in my mission, I have tried putting the below which I found online in my init.sqf with no luck. I've also tried the Arma 3 Friendly Fire module and that does not work with the correct sync set up. Any help please? Did I put the below in the wrong place? ta

{
        if (side _x isEqualTo WEST) then
    {
        _x addEventHandler
        [
            "HandleDamage",
    {
            _returnDamage = (_this select 2);
            if ((side (_this select 0)) isEqualTo (side (_this select 3))) then
    {
            _returnDamage = 0;
    };
            _returnDamage;
    }
        ];
    };
} forEach allUnits;
ruby breach
#
This EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on
``` Individually have each player add it to themselves via initPlayer. AI need to have it added wherever they are local (probably server)
coarse plover
#

Interesting... so I'll add it to InitPlayerLocal and give it a go

#

Yea does not work I'm afraid

#

Ok lets spin this a different way... I use the following for spawn protection, how could I modify this to only take effect for WEST vs WEST damage?

0 = [] spawn { 
    while{true} do { 
        { 
            if(_x distance (getMarkerPos "safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};
#

I could then expand it to cover the map for example... janky ik 😄

ruby breach
#

You don't

#

The only way to check what you're taking damage from before it kills you is handleDamage

coarse plover
#

This method is effective in preventing death though

#

direct fire protection is enough

#

I'm aware it would not protect against indrect

tough abyss
#

doing while true sleep when you can add a trigger is not "effective"

ruby breach
#

^ performance aside, I don't believe there's a way to "prevent only west vs west damage" via script without using the EVH

coarse plover
#

Alright, thanks fellas

#

I'm at a loss for finding a working EH script for this

#

No locations work either, init.sqf or initplayerlocal

#

I even tried initserver

#

😄

ruby breach
#

If you have access to debug, local exec this on yourself - ```sqf
if (playerSide == west) then {
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
[_damage,0] select (side group _instigator isEqualTo side group _unit);
}];
};

coarse plover
#

Thanks Gnashes, I also have the ability to exec global & JIP

#

so this may do the job

#

I'll check and come back

ruby breach
#

Granted, depending on how early that is applied to JIP, may cause issues with playerSide

tough abyss
#

dont forget that any override of "HandleDamage" EH is null and void when you have another "HandleDamage" EH added afterwards

coarse plover
#

Doesn't work online with global & JIP I'm afraid @ruby breach

#

Thanks for trying tho

coarse plover
#

Theoretically, if I wanted the below to only affect WEST entities, how would I modify the below?

0 = [] spawn { 
    while{true} do { 
        { 
            if(_x distance (getMarkerPos "safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};
peak plover
#
0 = [] spawn { 
    while{true} do { 
        { 
            if (((side group _x) isEqualTo west) && {_x distance (getMarkerPos "safe_zone") < 200}) then {_x allowDamage false} else {_x allowDamage true};
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};```
#

@coarse plover

#

Also, don't use distance when checking this many units

#

You can use an alternative like inArea

coarse plover
#

Thanks dude

peak plover
#

If this is for a bigger project, use a per frame handler and check only one unit per frame, currently it would cause other scripts to lag when there are a lot of units

coarse plover
#

This is the only looping script 😃 everything else is eden / ace modules / basic triggers

#

and they are few

#

With in area, I'm guessing I could use a transparent elipse area marker

#

then format the code as:

peak plover
#

yeah transperrent ellipse

#

or a trigger with an area

coarse plover
#
0 = [] spawn { 
    while{true} do { 
        { 
            if (((side group _x) isEqualTo west) && {_x position inArea elipsemarker1}) then {_x allowDamage false} else {_x allowDamage true};
        } forEach allUnits + vehicles; 
        sleep 1; 
    }; 
};
peak plover
#
// markers have to be strings
_x inArea 'elipsemarker1'
coarse plover
#

ty ^^^

#

Thanks so much again, I'll test this and get back to you

peak plover
#

Do you only have a safezone for blufor?

coarse plover
#

Correct, this is a player west vs ai east mission

#

shit I just realised this is going to take effect for shots from the EAST side too

ruby breach
#

I did say that earlier

peak plover
#

You mean outgoing shots from blufor to opfor?

coarse plover
#

From opfor to blufor

#

Are ineffective due to the fact we have allow damage as false on the west players

restive leaf
#

You could just alter the Fired EH in the safe zone on blue players to delete their bullets as they are fired and revert after

#

Something like this that would be added to a player when they enter the SZ: sqf EH_firedSZ = player addEventHandler['Fired',{deleteVehicle (_this select 6)}];

#

Would not stop grenades or explosive charges ofc

jade abyss
#

iirc throw or put EH for nades (or however the name was)

restive leaf
#

Actually no... Maybe the solution is to alter the HandleDamage EH so that damage from BLUFOR is ignored, i.e. return 0 if the side of argument 6 is BLUFOR

plush oriole
#

setVehicleAmmoDef 1 @tough abyss

#

Oh for units

#

I think you have to read some other variable because it doesn't know how many magazines is 'full'

jade abyss
runic edge
#

Hello guys,
If I may ask a very noob question : what's my error in this _m = if(date select 4>=10) then {date select 4} else {str(0,date select 4)}; I want to display the minutes in game but as a clock do 04 if it's the fourth minute not just 4. I think if is the correct way to do this but I don't now what syntax I should use in my else.
Thanks in advance for your help !

winter rose
#

str takes only one param

#

use -showScriptErrors startup parameter to get a popup on script error, explaining (usually) where the issue is 😉 @runic edge

runic edge
#

thanks for your quick answer

#

what then if i want to display 0date select 4

winter rose
#

else { format ["0%1", date select 4]; };

#

Should do the trick ;-)

runic edge
#

I'll test it right now

#

much appreciated

plush oriole
#

Wait don't script errors turn on automatically

#

With the white on black popup on the top middle left

#

I probably turned it on without realising

jade abyss
#

Wait don't script errors turn on automatically
Nope, it's an option

plush oriole
#

Huh

jade abyss
#

StartParameter

plush oriole
#

Til

#

Well

jade abyss
#

-showScriptErrors

plush oriole
#

I must have known at some points

jade abyss
#

Probably

runic edge
#

I got the winfows jesus's talking about
there's an error as the script except the "]" here
_m = if(date select 4>=10) then {date select 4} else {format ["0%1",select**|#|** 4];};

jade abyss
#

select|#| 4 <- ?

#

What are you trying to achieve anyway?

#

want to display the minutes in game but as a clock do 04 if it's the fourth minute not just 4
There was somewhere a function for that, that gives out a string

winter rose
#

DATE select 4

jade abyss
#

Not sure if i mix it with something else, but iirc there was a param to add the leading 0

runic edge
#

oh ?
couldn't find it while I was searching for something like this

jade abyss
#
_m = if(date select 4>=10) then {date select 4} else {format ["0%1",select 4];};```
winter rose
#

yes, some getTime HH:MM something

jade abyss
#

Yeah

#

But i am not rly sure, if that was Arma or somewhere else 😂

#

fnc_toTime somethingbla

#

@runic edge @winter rose

winter rose
#

it was Arma indeed ^^ used it not so long ago hehe

jade abyss
#

😄

runic edge
#

Thanks mate so to be clear, i dont need my ifs i just need to put it in my text ?

winter rose
#

Ah yes, I wanted to use it for dates, but there is no dateToString iirc

jade abyss
#

¯_(ツ)_/¯

winter rose
#

@jade abyss, find it for me

coarse plover
#

InitPlayerLocal has the same effect as running something local exec via console right?

jade abyss
#

@winter rose No time fo dat! (huehue)

dull drum
#

Hi guys, any thoughts on the Zeus points question I've shoot yesterday?

#

Oh, I cannot mention my own previous message in Discord >__>

#

Got a question about setting up Zeus via script.
I need it only to have some units available and I need costs for these units. So the units part of the code works just fine - I can see only them in MP. But I don't have any points for the Zeus 😦
`//add Zeus Points
z1 addCuratorPoints 1;

// set Zeus available units and their costs
[ z1,
[
"RyanZombieC_man_1walkerOpfor",0.1,
"O_support_AMG_F",0.1,
"RyanZombie25mediumOpfor",0.1,
"RyanZombie15Opfor",0.1,
"RyanZombieboss7Opfor",0.2,
"RyanZombieC_man_polo_5_FOpfor",0.1
]
] call BIS_fnc_curatorObjectRegisteredTable;`

Also it's possible to set up any amount of points with the Resources module in the editor , but the addCuratorPoints command page says that it is only from 0 to 1. While BIS_fnc_moduleCuratorAddPoints page looks unsupported https://community.bistudio.com/wiki/BIS_fnc_moduleCuratorAddPoints

#

Everything above is running as initServer.sqf execVMs

tough abyss
#

Ah yes, I wanted to use it for dates, but there is no dateToString iirc
Sure there is str date

winter rose
#

[2019, 6, 20, 10, 44] yeaaaaaah

jade abyss
#

Is there any mystery involved to make valign='middle' for ctrlSetStructuredText work, or is it broken (RscStructuredText)? 🤔

jade abyss
#

... -.-

There is a bug with valign that requires adding 1 extra trailing space per line to the displayed text in order to keep it centered horizontally:```
exotic tinsel
#

would someone be so kind to give me a bullet list of things to do and not to do to increase the FPS for players on a multiplayer server? getting alot of players complaining of low FPS. between 10 and 20 fps for alot of them. I get 50 so i dont know what the issue is and i have a 5 year old vid card.

peak plover
#

Less is more

#

less objects, less enemies = more fps

#

Don't give ai backpacks and attachments

#

Delete dead bodies

exotic tinsel
#

plz do keep going or PM me. didnt know about the backpacks and attachements thing

#

what are proxies?

jade abyss
#

@exotic tinsel GPU doesn't matter THAT much. It's the CPU

exotic tinsel
#

PLZ keep going. im writing these all down

jade abyss
#

@tough abyss Have you ever tried to go mentaly crazy with setVelocity? At a certain speed the Scope deattaches from the Gun 😂

#

I did, was fun 😄

#

pushed me hiiiigh in the sky. Since then, i knew how Scopes were attached 😄

#

@exotic tinsel Loops that don't need to be executed every frame -> put a sleep in it for example

#

+Most important thing:
Optimize your code.

#

and kickout crappy Mods

#

He asked about getting better FPS

#

so... it is kinda important

#

e.g. there is crap outside like

_pos = [(getPos player select 0), (getPos player select 1), (getPos player select 2)];
blabla setMarkerPosEachFrame;
exotic tinsel
#

hehe a mission can have between 15 and 30 EI, and if mission in an urban area then max of 50 civi to populate the area.

jade abyss
#

createAgent for Civs instead of createVehicle or placed down Units

winter rose
#

a "mission optimisation" page maybe could be useful with these tips? what do you say

jade abyss
#

And the link above, posted from Lou

exotic tinsel
#

well for pilots i bump view distance up but for infantry

setObjectViewDistance [1000,800];
setTerrainGrid 25;
setViewDistance 1000;
#

altis

#

shared hosted with fragnet

jade abyss
#
thats not a lot, indicates another issue
perhaps the client draw distances are too high```
Not thinking about the obvious? Like... e.g. Scripts? Oh, i forgot, not worth it.
#

🤦

#

Or having a shitload of unoptimized crap that might not affect/suck alone, but in the mass..

exotic tinsel
#

we run a couple sleep whiles on the client for monitoring things like chat so they can use chat commands

jade abyss
#

So alot of loops?

exotic tinsel
#

no like 3 whiles with low sleep

#

i dont want to advertise here

#

can i PM it to you. i dont want to get in trouble

jade abyss
#

Send him a PM?

#

Scripts?

exotic tinsel
#

loads lol

#

@tough abyss anythoughts?

#

ok. well i got a lot of good advice. thank you all.

ruby breach
#

@coarse plover Yes and no. Yes in that both will execute the given code locally on a single machine (debug local exec runs on the machine that pressed the button only, IPL executes locally on each player's machine as they connect to the server and initialize the mission). No in that debug is happening postInit, while the other is happening during init. Something that may be useful for you in the future is https://community.bistudio.com/wiki/Initialization_Order

peak plover
#

If it comes down to it

#

Make sure the background for firefights and stuff is empty

#

Example, pushing towards ocean instead of a city

#

But if it's a tvt, that wouldn't work

#

Also

proper sail
#

Does:

_configs = "true" configClasses (configFile >> "CfgVehicles");```
Give the same output as:
```SQF
_array = getArray (configFile >> "CfgVehicles")```
still forum
#

shouldn't

proper sail
#

What would be the correct equivelant for arma 2

exotic tinsel
#

is there a simple way to detect an rpg on unit?

dull drum
#

check against weapons on unit if array of classes has one then it has an rpg?

#

Is there any way to reload current weapon via script? reload page states that it will reload all weapons, while loadMagazine is a strange thing with necessary turret position in params >_<

still forum
#

action

#

I think "ReloadMagazine"?

dull drum
#

Hmm, eventually it looks like the reload page is a lie. It reloads current weapon just fine without reloading everything. Problem solved!

#

Now I have my player behaving like some Overwatch character ^__^

astral tendon
#

How to get the key that the player binded for some imput like shift for sprint?

still forum
#

actionKeys

#

but it doesn't work properly if shift/alt/ctrl are involved. There is no way that works perfectly

peak plover
#

Hmm

#

@still forum What about the display control for the control settings?

still forum
#

¯_(ツ)_/¯

peak plover
#

I sometimes thought about the same thing

#

But never looked into it

vocal hearth
#

has anybody ever made a replacement for the sidebar action menu?

#

If it was changed into something like an ACE interaction wheel menu, I'd be super happy

#

I've never seen a mod that fooled with the sidebar though, so maybe it's untouchable

restive leaf
#

Yes, not me but both ACR and Epoch mods have dynamic radial menus. Lot of work though

vocal hearth
#

so nothing you can drop on the base game, they only work in the context of that mod

restive leaf
#

No, they are both APL-SA so...

#

More seriously, the code is designed with the mod being present but could be coded to be more generic. Epoch's DynaMenu is particularly good, context based - what you are looking at, what it's state is, what is near you, very configurable and graphically pleasing on the eye

peak plover
#

WEll

#

Don't arma life have that

#

Like a custom interaction

elder karma
#

So I'm script illiterate and need some help.

#

Would there be a way to set up camera modules, and code so a monitor was showing that camera's view? As if it were the security center display of some kind?

restive leaf
#

Yeah. Both Epoch and Exile mods have those

#

So is ppssibl3 😉

compact maple
vernal mural
#

Is there a way to retrieve the "name" of a curator ? I tried name myCurator but it returns an empty string

#

module's config says expression = "_this setVariable ['%s',_value,true];";, what is this %s duda ? Never seen this anywhere

#

Nevermind, it kinda means "the name of the attribute you are setting up". In my case the attribute is "Name", so myCurator getVariable "Name" returns Zeus#1, as expected !
Thanks everyone for being my rubber duck 😉

still forum
#

@compact maple Accidentally hit the wrong channel?

#

Yes, got enough

compact maple
#

@still forum Oops my bad, thanks for answering anyway

exotic tinsel
#

i desperately need help with solving our supposed FPS issues. Is there anyone willing to PM/Talk to me about configuration?

astral dawn
#

run the profile build

#

but I don't guarantee that you will understand the profiler sections or that anyone here will tell you what they mean

#

but if you have scripts which take FPS then you might be able to see them in the diag_captureSlowFrame output

astral tendon
#

Is there a way to check if the helicopter is ready to fly afther turn on the engine?

tough abyss
#

You mean if rotor spins fast enough?

astral tendon
#

yes

tough abyss
#

Could check rpm maybe

restive leaf
#

Hold SHIFT - if it takes off it is ready to fly 😉

#

But I'm a ground pounder so...

tough abyss
#

@dull drum maybe add magazine to weapon with addWeaponItem, that should reload it

young current
#

@astral tendon what is the purpose of the knowledge?

astral tendon
#

Why ask?

young current
#

perhaps someone has figured out what you are trying to do in some other way

astral tendon
#

I only need to check if the player helicopter engine is ready to fly

young current
#

I mean its ready to fly the momeny the engine is turned on

astral tendon
#

No its not.

young current
#

there is however a paramterer that determines the time when it actually takes off

#
startDuration = 5;```
#

if this is set to 0 the helo takes off immediately

astral tendon
#

So, how do I put that on script to check if the engine is ready and the helicopter can take off?

young current
#

I recall the value is in seconds

#

possibly you can read it from the config and calulate form the time engine turns on

#

or check if the RPM changes when the time is up and it lifts off and do something with that

astral tendon
#

rotorsRpmRTD can check it, but I guess the RPM is variable from helicopter from helicopter right?

young current
#

Indeed

restive leaf
#

It might help if you explained what you are trying to do @astral tendon

astral tendon
#

check if the helicopter can take off afther the engine has ben turn on.

restive leaf
#

For doing what?

#

Cause I will go back to my original answer of "when it takes off when you hold down SHIFT"

#

We are not mind readers... so explaining the end game of what you want always helps

astral tendon
#
If (TheHelicopterEngineIsReadyToTakeOffCommand _myheli) then {
systemChat "Hey jimbo, your helicopter is ready to take off"";
};
restive leaf
#

Why would you need that... don't you get in the helo beforehand? Maybe for a message saying "Get your arse in here bud, we are leaving!"

young current
#

yeah sounds like a lot of hassel for just to remind someone to get into the chopper

#

especially when it might not even be doable

astral tendon
#

Why soo much questions? is like if I ask how do I sprint in the game and you want me to write a hole essay why I need to that instead of saying press shift.

young current
#

also not sure if advancedFlightModel uses StartDuration

#

because what you aim to do with often helps to come up with a solution

restive leaf
#

You are asking for something that requires a bit of coding to do... i.e. our time... but you're not getting my time now

astral tendon
#

Last time I asked for a code check here I was called stupid for not using google.

restive leaf
#

That's... unfortunate. That said... the message that "Hey jimbo, your helicopter is ready to take off" really should be if the player is near the helo... cause you don't want to bring in punters when the rotors are turning anyway

#

Would this possibly be for a Life server?

astral tendon
#

🙄

restive leaf
#

Now see, that's the problem right there... demonstrated in a few semi-anonymous discord messages starting with "Why soo much questions?" Well, see all those people with blue tags... They are people who over the years have done quite a bit of stuff for ARMA in all its many incarnations. Then there are the other people on the discord many of whom have spent a large portion of their free time working on the many incarnations of ARMA... And all of us try to help people who need help. And help people do things that, sometimes have been done before but many times are new... But when you're asking the community to spend time working out how to do something there may be a question of why? Because none of us get paid for this and we have many other ARMA demands on our time and if we don't understand what you are trying to achieve, or you suddenly develop an attitude then we might just go "Meh"... just speaking for myself tbh

astral tendon
#

As far as my experience in this discord teached me is that I should not ask for script or help clear/debug a code because it's usually ends with people questioning why im even doing it or why I'm Lazy or stupid for not search on right places (Yeah, I know those places to begin with) and how I'm a terrible coder, so I'm limiting my self to only ask for commands and clarifications on how they work instead ask for help with my code as I use to do before.

Of course is not all users that do that, others actually try to help or message me explaining stuff, those guys save this discord for me.

So your, questioning may end with what I'm already expecting, sorry if I juged you wrong.

restive leaf
#

You can check my message history mate... always try to be helpful

dreamy kestrel
#

@astral tendon mostly I've found the feedback helpful. there is always the occassional turd response, but that's to be expected in a public forum such as this one. take the good from the bad.

fierce geode
#

Okay all I’ve been screwed so many times, I’m stressed,every person I have hires for custom framework has turned out to be total assholes and scammed me out of a lot of money, is there anyone out there that can make a custom framework for my community, not a milsim but a life server, and I would like it to be rp framework not altis please let me know thank you

restive leaf
#

☝ 💯

#

It's Life. He wants to get on that gravy train

astral tendon
#

I would recommend learn your self really, Its kinda hard do that kinda stuff with out people who you trust or have money into it..

restive leaf
#

#

Must say, as someone who has run persistent 24x7 servers since 2014... Make the server yourself, or in a team..
Your server has problems, how would you fix them?

#

But not pay someone to do it for you

young current
#

if you pay money for stuff you must make ironclad contracts

#

also off topic: but damn it irks me that "Altis life" mode is now called Altis

#

makes not sense to me

astral tendon
#

Just "Altis"?

young current
#

yes

#

seen that a few times now

astral tendon
#

lol, Im bad in naming conventions but dan.

#

That must be fun to search.

restive leaf
#

Deliberately I suspect🤢

young current
#

People have referred to it as "Altis" on chat at least.

#

I dont pay that much attention to what the servers and whatnot are called

#

anyway. carry on with the channel business

#

I'll catch some ZzZ

tough abyss
#

Not long before it gets shortened even more to A mod

weak tiger
#

is it possible to temporarily change an individual spawned vehicle's "threat"? ie so an AI tank would shoot at a civilian vehicle

jade abyss
#

You can try to assign the Driver group to a different Side. E.g.: Creating a new one (using the Enemyside) for him, then let him join in that one.

drifting copper
#

Again me with my noob questions, not finding much on google.

Looking for a if ai unconscious then enableSimulation false; till revived or something like that, and maybe the best way to implement it? Using ACE3 but find it annoying how knocked out AI "track" players while in unconscious state - basically ending up "twitching" all over the place.

A nudge in the right direction would be appreciated

still forum
#

"till revived or something like that" can't revive things without simulation tho I guess

drifting copper
#

Will you be able to change state back to true if someone interacts with the AI? say try to apply a bandage or open medical menu, something along those lines?

still forum
#

Not sure if ACE Interaction works if simulation is disabled

#

Maybe you could do disableAI stuff instead

#

make the AI deaf and dumb and blind

#

I'm not sure if there are good eventhandlers for ACE unconscious stuff

drifting copper
#

https://ace3mod.com/wiki/framework/events-framework.html#22-medical-ace_medical ah yes. ace_unconscious - not too sure what I am looking at.

But what you suggested first is that I look into a if _unit setUnconscious true; then _soldier1 disableAI "AUTOTARGET"; type of argument? The script does not have to be repeatable as the AI should be ziptied by the time they are revived

#

Also, with _soldier1 is that global or a unit variable name? If it is a variable name is there a way to set it to global or "all AI in mission"

still forum
#

"that I look into a if _unit setUnconscious true; then " no. Use the eventhandler to detect when a unit goes unconscious

#

"Also, with _soldier1 is that global or a unit variable name?" _soldier1 is a local variable, so it is neither global nor a unit variable name

#

"If it is a variable name is there a way to set it to global or "all AI in mission"" a variable can only point at one thing

#

As I said, use the eventhandler. The wiki page shows how

drifting copper
#

On the wiki now. Thank you

elder karma
#

@restive leaf were the people I'm making this for not already downloading a 13Gb mod-pack, I'd happily add thyose to the list.

#

But I was more concerned with general / vanilla ARMA capabilities, and if so how one goes about scripting / writing those lines to do so.

cosmic lichen
winter rose
#

hmm, like that I would say the sqm id

#

but I clearly don't know

#

@tough abyss would you mind if I provided an off-the-shelf script inspired by your sqf if (dayTime < 16) then { if (sunOrMoon isEqualTo 1) then { if (!((hmd _unit) isEqualTo '')) then { _unit unlinkItem (hmd _unit); }; }; }; on what will be https://community.bistudio.com/wiki/Mission_Optimisation ?

still forum
#

unit/objectid is apparently not really intended to be used by normal users 😄

#

It's the unique object id, same that's used over network too. I don't know of a way to retrieve that.
You know the numbers on trees that you could get in 2D editor to hide trees? That's object id.

#

Also check CfgDiary>>FixedPages there is a %LINK_UNIT_TEAMSWITCH% it autofills something.

cosmic lichen
#

Thanks alot. I already thought it was something like that. Didn't know about CfgDiary though.

tough abyss
#

ObjectId @cosmic lichen same id you use for triggerAttachObject

cosmic lichen
#

Thanks.

still forum
#

Ah! It's part of netId!

#

Atleast that's what KK thinks in comment

winter rose
#

it would make sense

tough abyss
#

There is waypointAttachObject that uses id as well, same id

#

Only works when you sync in the editor AFAIK

#

And yes it is sent over network, but net id could be something else

#

In any case this shit is old

brave jungle
#

I want to use set3DENAttribute on the module moduleRespawnPosition_F to change the side value to blufor.
I tried using side and the value of 1, as well as "BLUFOR", west and BLUFOR but it doesn't nothing, here is the config path for you to see it too
configfile >> "CfgVehicles" >> "ModuleRespawnPosition_F" >> "Arguments" >> "Side"

Any ideas?

cosmic lichen
#

_logic setVariable ["Side","-1"]; Side is represented by a number

dull drum
#

@tough abyss reload alone went pretty well, now I'll do the trick for pressing R 😃

brave jungle
#

right

cosmic lichen
#

@brave jungle I don't think set3denAttribute will work because this module uses Module Framework

brave jungle
#

Right

#

Okay

#

So to make it work I'd need to...

cosmic lichen
#

YourModuleVarName setVariable ["Side","1"];

cosmic lichen
#

So what does test = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]];

#

return?

#

typeName test fails.

tough abyss
#

What is the problem?

#

test is nil?

#

It can be

#

Says so on the wiki

cosmic lichen
#

nope

#

test contains "We can't refer to next record ((" but it's not type string

hollow thistle
#
test = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]];

typeName test;

// returns
"DIARY_RECORD"
cosmic lichen
#

@hollow thistle How did you test that?

hollow thistle
#

Entered above without thing under the comment and pressed enter.

#

😛

cosmic lichen
#

Guess I had a typo in it then, that's exactly what I did ealier.

#

Thanks 😃

vernal mural
#

hey there,
Is there a way to retrieve the player's BI Unit by script ? I know we can gather UID, profileName, Steam name. What about other player's info ?

peak plover
#

hey quick question

#

Can a mission have a script in it that runs during 3den

#

automatically?

ruby breach
#

@vernal mural Do you mean their character?

winter rose
#

nope, the Arma 3 unit I guess

ruby breach
#

Ahhhhhh, gotchya

winter rose
#

maybe a unit fills these

vernal mural
#

gonna try, thanks

#

Indeed squadParams give Unit informations 😮

#

And the Unit name is Unique, great way to check if a player can have some privileges. However I wonder if it's a HTTP request made on the fly, or if there is some kind of local storage once the game is started. If so, modification of local content might be possible

cosmic lichen
#

@peak plover What do you mean by running during 3den?

weak obsidian
#

Can anyone explain why the variable "briefingname" does not show the briefingname defined in intel class in mission.sqm and in descriptiont.ext? trying to understand why I'm always getting the filename instead of the actual briefing name when reading the variable.

still forum
#

briefingName is not a variable

weak obsidian
#

Returns the name of the current briefing/scenario name. <- THIS it does not do. It returns the filename,

cosmic lichen
#

It does. And missionName returns the foldername

weak obsidian
#

Well not for me, defined briefingname in description.ext and verified it is under the intel class in the mission.sqm, but all it shows is the filename

restive leaf
#

briefingname is a command though? Not a variable as Dedmen said

cosmic lichen
#

have you saved and reloaded the mission? MIght be a syntax error somwhere

restive leaf
#

You call it and it returns the mission name

still forum
#

You 100% sure the description.ext is in your mission/pbo?

#

checked missionConfigFile in config viewer?

weak obsidian
#

YES. It shows correctly when loading the mission and everything just not in the mission itself

#

I'm trying to use it in an intro text and all it shows it the filename

restive leaf
#

Oh. Never have mission selections. Just one mission per ARMA instance on the dedi. Learn something new every day. Thanks

weak obsidian
#

Yeah i'll try to make a new mission then and just set these things and nothing else and try to figure out why it returns the filename, not the actual briefing name. If I can reproduce I'll make bug report.

cosmic lichen
#

Can anyone spot the error ? https://pastebin.com/rEvNMXN9 Code is executed when display is loaded onLoad = "_this spawn Enh_fnc_briefingEditor_onLoad";

#

The display is found properly, also the controls, but nothing happens. No log entry, no script error. I am too blind to see it.

still forum
#

diag_log on start of script?

#

disableSerialization? can't store ctrl/display into script as can't be serialized

cosmic lichen
#

No luck

still forum
#

"colours" there's your error, you misspelled color

cosmic lichen
#

😄

still forum
#

Have you tried filling literally everything with diag logs or systemChats and seeing where something stops?

#

Can't find anything that hits my eye

hollow thistle
#

Enh_fnc_briefingEditor_onLoad are you sure its not nill at the moment of execution?

cosmic lichen
#

Yes I did. Actually this script was working when I was testing it from within a mission.

#

It's not nil.

hollow thistle
#

Because it will fail silently here for nils.

#

🤔

cosmic lichen
#

The variable retuns the code, tested that already.

still forum
#

Can you explain what's happening and what not?

#

"tested that already" how and where?

cosmic lichen
#

I checked Enh_fnc_briefingEditor_onLoad with the debug console so see if it isn't nil. Before opening the UI

still forum
#

debug console is missionNamespace

#

onLoad is uiNamespace

cosmic lichen
#

Enh_fnc_briefingEditor_onLoad -> missionNamespace

still forum
#

but if you'd put a diag_log/systemChat right after your params, you'll know 100% whether it runs or not

cosmic lichen
#

I did that, as I said 😃

still forum
#

"Enh_fnc_briefingEditor_onLoad -> missionNamespace" not sure what you're trying to tell me

#

Then explain what's wrong. Because I hear that it doesn't work, but it works. And I have no idea what's what

cosmic lichen
#

That's exactly the issue. The script runs fine, but none of the controls are filled. (ColourLB for example)

still forum
#

adding logs at the comands that fill the controls, the control is defined properly, and you are passing the right arguments to the command that add's stuff?

#

Check that the other controls are loaded before your onLoad fires? nvm spawn does that

cosmic lichen
#
private _ctrlComboTags = CTRL(90);
diag_log _ctrlComboTags;
{
   diag_log (_ctrlComboTags lbAdd _x);
   diag_log _x;
} forEach ["Linebreak","Marker","Image","Font","Execute","ExecuteClose"];```  ```22:40:13 Control #90
22:40:13 -1
22:40:13 "Linebreak"
22:40:13 -1
22:40:13 "Marker"
22:40:13 -1
22:40:13 "Image"
22:40:13 -1
22:40:13 "Font"
22:40:13 -1
22:40:13 "Execute"
22:40:13 -1
22:40:13 "ExecuteClose"```
#
{
     idc = 90;
     x = CENTERED_X(90);
     y = DIALOG_TOP + CTRL_DEFAULT_H + 92 * GRID_H;
     w = 90 * GRID_W;
     h = CTRL_DEFAULT_H;
     onLBSelChanged = "_this call Enh_fnc_briefingEditor_onLBSelChanged";
};```
#

Controls detected, data which should be added is correct. The control#90 is the correct display control with idc 90. But for some reason it's not adding the stuff to the control.

still forum
#

maybe some script runs later which deletes all elements

cosmic lichen
#

Checked that by removing every other script related to that ui

still forum
#

Add a sleep 5 between every element, so that you should be able to watch it live adding element by element

cosmic lichen
#

Alright, I found the issue

#

Calling ["ShowPanelLeft",false] call BIS_fnc_3DENInterface; ["ShowPanelRight",false] call BIS_fnc_3DENInterface; after the _display variable seems to do some weird stuff to the _display variable

#

Hiding the panels before actually storing the display into a variable solves the issue. That's actually how I did it in my other scripts.

#

Is that even possible?

still forum
#

No private

cosmic lichen
#

fucking hell

still forum
#

better PM KK on BIF 😄

cosmic lichen
#

FUCDJFo<shDFOIjahdfoüasdfdsf

still forum
#

tons of other vars in there without private too

cosmic lichen
#

I just spend 3 hours finding that.

#

Well not quite 3 hours but still

#

Alright, requested that to be changed.

#

Guess I learned another lesson today. Private variables need a TAG now too _Enh_display 😄

#

Thanks @still forum for your help

still forum
#

wonder if logging the _display would've showed you anything. Probably see the different idd

#

But weird that the other display happened to have controls with same idc

cosmic lichen
#

Nah not entirely.

still forum
#

lul. You could also spawn that thing instead of calling (from commy ACE slack)

cosmic lichen
#

Spawn what?

still forum
#

the bis fnc

cosmic lichen
#

Sure, next time I just spawn about anything

dusk badger
#

Any supply drop with random gear script? For a single player mission

cosmic lichen
#

I'd use the vanilla supply drop module and randomize the crates content.

#

However, randomizing the crates content can be a bit tedious. So I'd google for a solution to that.

jade abyss
#

Wasn't there a command for it?

#

I have seen it somewhere ... 🤔 Can't check niw, currently on mobile.

cosmic lichen
#

Biki search finds nothing.

tough abyss
#

What Lifestate returns?

plush oriole
#

a string

#

i assume

#

one of

#
"DEAD"
"DEAD-RESPAWN"
"DEAD-SWITCHING"
"INCAPACITATED"
"INJURED"```
tough abyss
#

Was asking @tough abyss

winter rose
#

The Wiki answered!

winter rose
#

freshly tested: "INCAPACITATED" @tough abyss @tough abyss

tough abyss
#

Nice 👍

winter rose
#

let's try this specific case

#

negative; no way to get that info easily

tough abyss
#

Not nice 👎

winter rose
#

true

winter rose
#

true; returns "unconscious"-based animations

#

unconscious
unconsciousfacedown
unconsciousoutprone

#

and deadstate for… well, you know

plush oriole
#

can i just check something

#

i'm doing a position based music fading thing

#

just to test

#

is it jip safe to have a localplayerjoin script or whatever it's called that plays music, then fade it elsewhere

#

and is it better to use event handlers or the script file

winter rose
#

yes, safe to have a local script

plush oriole
#

and i can't find the name of the sqf file that gets run on player load

winter rose
#

as long as it doesn't have to be synced with other player's music

plush oriole
#

yep that was the only thing

#

that's fine

#

what's the best way to run a script when a player spawns in

#

or

#

hmm

#

the issue is basically i want music to always be playing

#

regardless of jip

#

and fade it in and out

winter rose
plush oriole
#

ah thanks

plush oriole
#

can i just check something else: with JIP, presumably you only have to worry about synchronising the state of your scripts, i.e. if you destroy a building with a script, anyone who joins will presumably have it destroyed for them as well because it comes with the built in multiplayer synchronisation of the world

#

huh

#

but it syncs positions of units and things

#

that seems very odd

#

is that because it would be insane to sync the map on join

#

so if you kill a unit it would work with jip, but map buildings aren't synced

#

ok

#

thanks

#

wait so spawning the explosion

#

would the JIP client see it as they join

#

i.e. the explosion object doesn't get removed after it goes off

#

so what's the mechanism by which the syncing works like this then

#

i could see if the explosion object was created exploding for the JIP player because the explosion's explodeyness isn't tracked

#

i see

#

ok

#

wait so when someone joins do they have all these events happening on their client

#

seems like it would be slow

#

to recreate the world from what's been done to it reather than syncing the state

#

yep

#

ok

#

so it would work with setdamage (setdammage hehe) but wouldn't with a removign one

#

i don't know what removevehicle is for map objects

#

so does deleting not get synced

#

units and vehicles etc i assume are always synced

#

so i can have a non repeatable server only trigger that e.g. spawns a car, and it will work and JIP players won't be able to trigger it again

cosmic lichen
#

Using simpleTasks player # 0 for testing fails with an error message

plush oriole
#

that's a different command you linked

#

also maybe the player has no tasks, so it's an empty array so it has no first elemen

#

and this is what the task type hsould be

cosmic lichen
#

No I didn't link the wrong command

plush oriole
#

ah i see

#

yes so the task parameter needs to be of type Task

cosmic lichen
#

typeName (simpleTasks player # 0) returns "task"

#

So is it a task now or is it not.

plush oriole
#

what

#

ah i see

#

hang on but your initial question was 'what does the task parameter do'

cosmic lichen
#

Well, if I could get it to work I'd probably find out myself.

plush oriole
#

I don't really understand your question

#

you're not able to create a task and thus simpleTasks is empty

#

is that it

#

and the reason you're unable to create a task is because of the task parameter to createDiaryRecord

cosmic lichen
#

gimme a sec, gonna check something

#

The question remains the same, what does the parameter task in createDiaryRecord do? Does it create a task, does it add a reference to the task in the briefing, or does it do nothing?

plush oriole
#

ah i see

#

i would assume a reference to the task

cosmic lichen
#

In order to find that out, I create a task and afterwards added that task as parameter to createDiaryRecord

#

But nothing.

plush oriole
#

since there's a Tasks tab which tasks automatically go to

#

hmm

#

not sure then

#

but I would assume it's what the tasks system uses to create the diary menu Tasks tab and its contents

cosmic lichen
#

most likely.

#

So it's doing nothing because creating that task prior already created that entry.

#

Alright, the taskState parameter does what I expected.

plush oriole
#

ah that makes sense

#

hmm

cosmic lichen
#

Gonna add that to the wiki.

plush oriole
#

i was unable to register an account

cosmic lichen
#

pm @ dwarden for an account

plush oriole
#

on discord?

#

thanks

cosmic lichen
#

yes

sand anvil
#

Hey I'm trying to add music to a vehicle when the engine is on, but it doesn't play anything


if (isEngineOn (vehicle player)) then 
{ 


nul = [this] spawn {while {true} do {(_this select 0) say3D ["radiomusic", 25, 1]; sleep 268;};};

}; ```
#

It works without the if then thingy

#

but then it plays 24/7

ruby breach
#

Well, considering you're not looping the check but are looping the execution of the sound, that would make sense

sand anvil
#

Should the check be looped as well then?

tough abyss
#

i mean yeah, but you need to make it an efficient check.

ruby breach
#

If you want the check to happen more than once, yes

#

But that^

sand anvil
#

How would one do that 🤔

tough abyss
#

you dont need, but it's highly recommended

sand anvil
#

I'm basically just copy pastaing script from forums and praying it works xD

tough abyss
#

.

#

Well, check if the player isn't on foot (vehicle player != player) and then check the engine. Or you add a GetInEH and GetOutEH so you can terminate the loop properly

#

And you'd need to create a loop to check if the player is on foot then the rest of the code

ruby breach
tough abyss
#

Oh i didn't know that existed, instead of the GetIn and GetOut use ^

sand anvil
#

Uhhh I don't know If I can do that by myself tbh but I can try

tough abyss
#

Something like

someVehicle addEventHandler ["Engine", {
    params ["_vehicle", "_engineState"];
    if(_engineState) then 
    {
        // some code executed when the engine turns on
        nul = [_vehicle] spawn {while {true} do {(_this select 0) say3D ["radiomusic", 25, 1]; sleep 268;};};

    }
    else 
    {
        //engine off code, terminate the thread somehow.
    };
}];```
sand anvil
#

Oh dang

#

I assume someVehicle is the variable for the car?

ruby breach
#

or truck, or helecopter, or whatever

tough abyss
#

^

sand anvil
#

Ye ye

ruby breach
#

Also, if (_engineState)

tough abyss
#

you may have to mess with the _this encased in the spawn. Make sure _this select 0 is some object or valid sound source

#

good catch

sand anvil
#

Hmmm

#

I guess this should be somewhere else than on the vehicle init