#arma3_scripting

1 messages ยท Page 602 of 1

ebon citrus
#

@surreal peak

surreal peak
#

ah I see. Thats cool

ebon citrus
#

timings are off and audio is missing, but meh

#

because some doors would open on you in arma, so i decided to make breaching just slightly warp the door and allowing it to be unlocked

#

also, the animations are from the mocap melee mod

tough abyss
#

I see u using cursorObjec tho

#

thats what im using too

ebon citrus
#

?

#

im using cursorobject just to lock the door

#

in the debug

#

the actual script is in an addon

tough abyss
#

oh alright

#

Yeah I got mine to 50% work

#

for instance it also gets stuck on the animatino

ebon citrus
#

use playmovenow

tough abyss
#

Ok

velvet merlin
#

is there a way to guide a bomb dropped by an AI plane into a target/position (outside scripted flight path via setVelocity)?

jade abyss
velvet merlin
#

didnt work ๐Ÿ˜ญ

#

probably needs canLock/laser guided/etc

jade abyss
#

Yeah, i think it was mentioned there somewhere

plucky wave
#

I have an array of strings that I need to convert to an array of integers (yes they're valid numbers), best way to do this?

robust hollow
#

_array = _array apply {parseNumber _x};

bright steeple
#

(Name) = "groundWeaponHolder" createVehicle getpos this; (Name) addWeaponCargo ["Weapon classname",1]; produces the weapon but without a magazine inserted. Is there a way to place weapons with magazines inserted?

copper raven
rocky flicker
#

Hey! I Wonder if it is possible to setup MechanizedUnits in warlords through description.ext for blufor and opfor? It says in the wiki that only independent side utilizes groups and as there is no example saying mechanized for blu/opfor I figured it might not be possible...

tough abyss
#

@copper raven thanks!

bright steeple
#

@copper raven There it is! Cheers

ornate prairie
#

i have the arma 3 garbage collection running, it will automatically remove corpses to prevent lag. Is it possible to exclude specific corpses from this? I have dead bodies that are hand places as part of the missions story, only for them to be gone in game.

winter rose
#

@velvet merlin setMissileTargetPos perhaps?
also, you could play with setVectorDirAndUp to turn it towards the target

winter rose
velvet merlin
#

Lou i think the problem is we disabled the auto homing of the bombs

#

(but even with this one by default it doesnt work/depends on the sqf cmd and if it defines a target)

winter rose
#

also, the target has to be in the missile aiming cone too

analog quest
#

Hey guys, so I made this Medical stomper which basically has some stretchers on top of the vehicle. Now I am wondering how I would make a script to put the wounded on top of the stretchers, while remote controlling the UAV ofcourse. is this possible?

foggy hedge
#

Can I not use addAction n on the data terminal? I have this in my init.sqf:

DataTerminal1 addAction ["Deploy close range targets", "Range1CloseDeploy.sqf", "nil", "1.5", "true", "true", "", "true", "5", "false", "", ""];
DataTerminal1 addAction ["Deploy close-medium range targets", "Range1Close-MidDeploy.sqf"];

#

Neither works, the scripts mentioned do work as I have tested them by calling them from the debug console

winter rose
#

Can I not use addAction
then you can

#

let me check our friend the wiki

foggy hedge
#

It should work, I consulted the wiki. I can move it to another object like a laptop or even every player's action menu if you think that would help, but I would like to save the player action menu for other things like activation of bullet tracing (firing range setup)

winter rose
#

so yeah, your above code is wrong

#

you added quotes everywhere

#

the second one should work, note that your scriptnames are different

foggy hedge
#

Yeah, they're different scripts. I changed the first one to include all parameters in the wiki in case that changed something. Also, can I specify the range (5) without specifying the (default) parameters before it, or should I write it all out?

winter rose
#

all before

foggy hedge
#

alright

winter rose
#

and 5, not "5"

foggy hedge
#

I'll try moving it to another object, maybe something about the data terminal is messing it up

winter rose
#

you could have a "removeAllActions" somewhere yes

foggy hedge
#

I doubt it as I just started working on this and as such have maybe 50 lines of code in all the scripts combined so far

#

I'll see what I can do

winter rose
#

also, mods?

foggy hedge
#

... a fair amount (smallish unit modpack). Only Aegis and Ace are required by the scenario though

winter rose
#

try in vanilla

#

@foggy hedge it might be one of the mods

in your init.sqf, maybe wrap all this with a spawn:

[] spawn {
  sleep 1;
  stuff addAction stuff;
};
foggy hedge
#

After placing some debug hints around it looks like errors in the init before the addAction stuff was causing the init.sqf to abort, interesting stuff

#

Fixed now, thanks

winter rose
#

always code with -showScriptErrors enabled - saves you from some unnecessary headaches @foggy hedge ๐Ÿ˜‰

foggy hedge
#

I... may have been ignoring the script errors that were popping up during loading after solving them and creating new bugs multiple times

#

All fixed now

#

... probably

#

Thanks for the help!

winter rose
#

I... may have been ignoring the script errors that were popping up during loading after solving them and creating new bugs multiple times
๐Ÿ’ฅ ๐Ÿ”จ

#

Thanks for the help!
With pleasure ๐Ÿ˜

fluid wolf
#

I'm doing this wrong and I'm not sure how. (gofordrop == true) is a perfectly valid condition, isn't it? Or did I make a stupid spelling mistake

#

because its giving me a generic error on it

warm hedge
#

No, gofordrop does work

#

You can't use == into boolean

fluid wolf
#

... oooohhhh

#

so I'll just switch it to 1 and 0 and it should function then

warm hedge
#

Huh?

#
gofordrop == true;
if (gofordrop) then {hint "works!"};```
fluid wolf
#

...

#

oh. Thats even easier

thorn saffron
#

Are there any invisible characters that can move around in base arma? I'm attaching units to another unit to give the illusion of movement. I used a civilian with hide object, while it works in SP the civilan does not get hidden in MP.

_dummy hideObjectGlobal true;
[_dummy, true] remoteExec ["hideObject ", 0];

Neither line hid the civilian.

winter rose
#

no need for , 0 in remoteExec
where did you run this code @thorn saffron?

#

you also have a space in your remoteExec string, I suppose it breaks it

thorn saffron
#

derp

winter rose
#

Works nao?

#

(hideObjectGlobal must be run server-side)

thorn saffron
#

[_dummy, true] remoteExec ["hideObjectGlobal", 0]; This would run it on every machine including server, right?

spark turret
#

how do i test for a variable being a marker?

#

after all its just a string.

#

maybe _marker in allMapMarkers? that would test for existance.

restive leaf
#

getMarkerType? Will return false if is not a marker, i.e. does not exist as a marker

spark turret
#

nice.

#

tahnks

winter rose
#

@thorn saffron ```sqf
[_dummy, true] remoteExec ["hideObjectGlobal", 2];
// or
[_dummy, true] remoteExec ["hideObject"];

spark turret
#

how do i test for a var being an array?

#

ah, "isArray"

#

nm

winter rose
#

@spark turret _value isEqualType []

#

(isArray being for config entries)

spark turret
#

ah cool, does work for other field types as well?

#

i want to test if an object is already an ACE arsenal. any function for that?

still forum
#

i want to test if an object is already an ACE arsenal.
objects "are" not arsenals, objects can have arsenals on them. Via ace interaction menu, or normal action menu, or whatever other method that you cannot possibly know about or even imagine (stand near it lie down and turn around 5 times then stand up and jump twice then crouch down, boom arsenal opens)

spark turret
#

.. not sure if trolling but i wouldnt be surprised if ace does that

#

magic arsenal dance

still forum
#

you can check for variable "ace_arsenal_virtualItems" existing on the object, but the variable existing doesn't mean that there is currently a arsenal on there, and the variable not existing doesn't mean that there is not an arsenal on there

spark turret
#

thats a boolean or an array of the items available in said arsenal?

still forum
#

its a nondescript variable

#

you can check for it being undefined

spark turret
#

first result on google: "Nondescript variable names are not particularly helpful ..."

#

so nondescript = no value assign, just declared?

still forum
#

the datatype doesn't matter is what I'm trying to say

#

only checking for defined/undefined is important here

fair drum
#

why does additemcargoglobal seem to do double the count value I put in on a dedicated server?

#

either that or I messed something up. which isn't out of the realm of possibility lol

spark turret
#

maybe run from an init and therefor on all clients + server?

fair drum
#

ahhhh i bet thats what went wrong. i had it placed in the init of a box

#

using this additemcargoglobal blah

spark turret
#

you can put safety measures:
if (!isServer) exitWith {};
will terminate if run on anything but the server

#

so it wll only run once, independent from where it was run

fair drum
#

big brain. ill remember for next time

spark turret
#

learned that after testing worked on testing and packed 800kg loadouts into AI during the mission. so heavy they couldnt move

surreal anvil
#

HI guys! I'm trying to find the Id for my BIS_fnc_HoldAction that I made to go on a computer. No others actions on it. Where can I find that?

#

The purpose is to run BIS_fnc_HoldActionRemove to get rid of it, and for that I need the Id for the action as a parameter

copper raven
#

the add function returns you the id

still forum
#

Today i learned the joy of binding
[cursorObject, true] remoteExec ["engineOn", 0]; to a hotkey

winter rose
#

why , 0, tho

still forum
#

because arg local and I'm lazy

winter rose
#

I mean, just remoteExec ["engineOn"] - and it's lazier!

surreal anvil
#

Ah. How would I go about saving the returned actionId into a variable from?

Script looks something like this:

[  
 manual_override_computer,             
 "Access Computer",            
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",   
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",   
 "_this distance _target < 2",        
 "_caller distance _target < 2",        
 {},               
 {},               
 { 
 hint "Test";
 },      
 {},               
 [],               
 2,               
 0,               
 true,              
 false              
] remoteExec ["BIS_fnc_holdActionAdd", 0, placeholderTarget];
winter rose
#

@still forum I mean,

args remoteExec ["command", 0];
// equals
args remoteExec ["command"];
```right?
still forum
#

dunno

surreal anvil
#

Am I making sense in what I want to do?

winter rose
#

Yes, but you would have to run with remoteExec a local script

surreal anvil
#

Hrm

#

Not quite sure I get what you mean, Lou

winter rose
#

like
{ stuff to exec } remoteExec ["call"] @surreal anvil

surreal anvil
#

Hm

winter rose
#

m.

#

๐Ÿง…

#

@surreal anvil not convinced?

unique sundial
#

@still forum I mean,

args remoteExec ["command", 0];
// equals
args remoteExec ["command"];
```right?

@winter rose yes

winter rose
#

yay, I got that right!

ornate quail
#

Hola, I'm not sure if I'm just being dumb or if I should just go to bed
This var: _hitselection which I put into a global var to check it's content in the debug menu returns "_hitselection" as string and not "arms" or "head" or "body" as it's supposed to be:


_damage = getAllHitPointsDamage _target select 2;
_inj_head = _damage select 3;
_inj_body = (_damage select 5) + (_damage select 6) + (_damage select 7);
_inj_arms = (_damage select 9) + (_damage select 10);

if (_inj_head > _inj_body) then
{
    if (_inj_head > _inj_arms) then
    {
        _hitselection = "head";
    };
};
if (_inj_body > _inj_head) then
{
    if (_inj_body > _inj_arms) then
    {
        _hitselection = "body";
    };
};
if (_inj_arms > _inj_head) then
{
    if (_inj_arms > _inj_body) then
    {
        _hitselection = "arms";
    };
};


["_hitselection"] spawn
{
    params ["_hitselection"];
    _target = p1;
    hitselection = _hitselection;
};```
#

p1 is my unit.
this code is very much simplified so I could find where the error is

winter rose
#

[_hitSelection] spawn

#

@ornate quail ^

ornate quail
#

ohh, so if I have multiple variables there, let's say I want to also foward _target would I just put it like this: [_hitselection,_target] spawn ?

winter rose
#

Yeah

#

and params them

ornate quail
#

Ahh thanks

#

In params they do have qoutes though?

winter rose
#

Yep

#

You just passed a string as argument, not the variable itself

#

The rest seems good!

ornate quail
#

Roger, much appreciated ๐Ÿ˜„

surreal anvil
#

@winter rose I think I know what you mean, just haven't gotten an opportunity to try it yet, hence my "hm"

winter rose
#

okido

peak plover
winter rose
#

It's in alpha state, we may remove commands from it

exotic flax
#

Biki 2.0 is in the works ๐Ÿ˜‰

winter rose
#

was

restive leaf
#

Wait til Lou sees how much he's gonna have to do for ARMA 4

winter rose
#

zdahp reminding meh!

restive leaf
#

"Reminding" you... so you have access to the API? think_turtle

#

ARMA 4 confirmed

exotic flax
#

Lou, you can always blame the devs for not documenting their code ๐Ÿ˜‰

restive leaf
#

Blame Dedmen? Or have they stuck him in the SQF closet and thrown away the key?

exotic flax
#

Why not both?

still forum
#

@restive leaf no api

restive leaf
#

None that you've seen anyway ๐Ÿ˜‰

#

Well, more seriously there is already a basic enforce syntax document available... question is how much it changes

#

But no function references or the things we've come to expect on the ARMA section of the biki

#

Though outside of Bohemia there is more documentation around...

exotic flax
#

If no one is willing/able/capable to add stuff to the wiki than it won't be added ๐Ÿคทโ€โ™‚๏ธ

winter rose
#

if there is a release, they will provide a basic documentation like export, and we will get to do fill it more
I don't believe an Arma 4 would be released without a beta anyway
Alsoโ€ฆ #offtopic_arma or #community_wiki ๐Ÿ˜‰

distant oyster
#

EDIT: Nope crashes the game.
whoa just found a new way for recursion.

_a = [1,1,2];
_a apply {
    if (_x == 1) then {_a append [3]};
    _x
};
_a // [1,1,2,3,3]
still forum
#

pushBack would be more efficient

#

also there's no recursion there

distant oyster
#

in this case not but i have another application that does

#
_ctrls apply {
    _ctrls append ("isNumber(_x>>'type')" configClasses (_x >> "controls"));
    _x
};```
#

especially useful for getting the controls from controlsgroups

distant oyster
#

Actually it is a bad idea. it crashes the game on some instances...

still forum
#

probably if the array resizes ๐Ÿฟ

distant oyster
still forum
distant oyster
#

i was kind of expecting it to mess up but not on such an seemingly random basis

still forum
#

it probably happens at specific array sizes.
like when appending on an array of size 8, or 32

#

something like that

distant oyster
#

hmm i executed the same script with the same array 4 times and it crashed but on another one just once was enough

still forum
#

it probably happens at specific array sizes.

distant oyster
#

array size was always max 3

winter rose
#

protip: don't edit something you iterate ๐Ÿ˜

distant oyster
#

Solution: Message before it executes: "The game might crash in the next few seconds. Dont know dont care."

ebon citrus
#

getCursorObjectParams doesnt return selection-name for vehicles. Intentional or bug?

still forum
#

never heard of that command ๐Ÿ™ƒ

ebon citrus
#

really handy

ebon citrus
#

i use it in my action-menu replacement scripts

jade abyss
#

Use the lineIntersect instead

#

more precise

ebon citrus
#

this doesnt return selections, does it?

restive leaf
#

Nope, not the ones you want

ebon citrus
#

damn

#

because the doors have their own selections

jade abyss
#

It does

#

I used it in OBE

restive leaf
#

Oh, you mean using returnUnique false @jade abyss

ebon citrus
#

@jade abyss which part of the return is the selection?

#

because i'm not seeing it

restive leaf
#

Me neither tbh

jade abyss
#

I used a mix of LineIntersectSurface and intersect

#

intersect for doors

ebon citrus
#

still doesnt help

jade abyss
#

If you say so

ebon citrus
#

im looking to get the name of the selection of a vehicle you are looking at

#

LineIntersectSurface nor intersect return the selection

#

so it's not me saying so

#

it's the wiki saying so

jade abyss
#

Finds named selections in object which are in specified LOD, intersected by given section of a line. Return value is in the form of [selection, distance]. Multiple returned arrays are nested within a single array. No intersection returns []. lodName could be one of the following:

ebon citrus
#

there we go

#

finally

#

now just to check if it works with vehicles

#

but before that

restive leaf
#

Yeah... it was the fact that you also use intersect I think

ebon citrus
#

Thank you for you help โค๏ธ

#

it's otherwise great, but doesnt return the selections of a door on any of the LOD's, strange

#

car-doors, that is

restive leaf
#

You mean the V3S?

ebon citrus
#

no, like vehicles

#

actual cars

#

it finds the glass, bumbers, wheels etc.

#

but doors are not selections, even on "VIEW"

winter rose
#

The Ifrit has doors iirc, but I don't know if they are still openable now

ebon citrus
winter rose
#

no

ebon citrus
#

ok

winter rose
#

Update about?

ebon citrus
#

oh, yeah, never mind

#

it's not wrong

#

it's jsut that those aprts dont have selections

#

strange

#

because the doors are in "selectionNames"

#

ifrit doesnt have door selections either

#

only wheel, glass etc.

#

like they dont show up in any of the commands, only in selectionNames

trail grove
#

Does anyone have a ready script for saving/exporting certain groups {, / with} vehicles and objects ?

ebon citrus
#

saving?

#

saveGame

#

unless you want to setup extdb

trail grove
#

to clear/restart map and move assets

typeOf _ac
,getPosWorld _ac
,[vectorDir _ac,vectorUp _ac]
,call{ _v_s = everyContainer _ac;
{ .. } foreach _v_s; .. }
..
fair drum
#

best way to get a group to follow a single unit? no vehicles involved.

ebon citrus
#

assign unit as group leader

#

or set a move-waypoint or follow waypoint

fair drum
#

does the follow waypoint actually work? i read a lot about how its just a heli waypoint that works clumsy

#

or is that old info

ebon citrus
#

๐Ÿคทโ€โ™‚๏ธ

#

test

fair drum
#

yup follow waypoint does nothing on infantry

jaunty ermine
#

Does anyone know if a pylon's weight value is updated when the magazine is empty?

fair drum
#

hmmm how can I get this to work?

[Main_Entrance, Docks] execVM "scripts\teleports\tunnelTeleOptimized.sqf";
_entrance = _this select 0;
_exit = _this select 1;

_entrance addaction [

    ("Teleport to " + str _exit),
    {
        _target = _this select 0;
        _caller = _this select 1;
        _caller setpos (getpos (_exit))
    }
];

I get a failure on getpos (_exit)) saying undefined, but I thought I did earlier in the code. I'm trying to make this teleport script work with arguments so I don't have to type every single possible location.

robust hollow
#
_entrance = _this select 0;
_exit = _this select 1;

_entrance addaction [

    ("Teleport to " + str _exit),
    {
        _target = _this select 0;
        _caller = _this select 1;
        _caller setpos (getpos (_this select 3))
    },
    _exit
];
#

the addAction code is a new scope, so local variables from the script it was added in arent available.

fair drum
#

oh I see. derp

ebon citrus
tough abyss
#

is it possible to change a cfg value of a vehicle in game using setVariable?

warm hedge
#

Impossible

tough abyss
#

unfortunate

forest ore
#

How to pass the arguments into the function that can be seen in this addAction sqf soldier1 addAction ["Test action",{_this call TEST_fnc_onLoadFunc},"Test_Access",0,false,false,""];
when not using addAction but something like this soldier1 call TEST_fnc_onLoadFunc

warm hedge
#

In this case Test_Access is passed into _this select 3

forest ore
#

Should be yes, I guess.
But what I'm trying to ask is that how do I pass those arguments when not using addAction. I have this now and does not work the same way as with addAction

[soldier1,["Test_Access",0,false,false,""]] call TEST_fnc_onLoadFunc;```
*edit: ok so first of all I needed to get rid of the unneeded addAction specific parameters. Then I needed to change the parameters in TEST_fnc_onLoadFunc to match the caller (in this case soldier1) and the arguments (in this case "Test_Access"). Got this part working now as I need it to*
fossil yew
#

Hi, one tough question. Does anyone know how to create a "someone is calling me" effect like in Old Man when main character has been called?

#

Obviously it's playSound, but in terms of graphics being shown on the screen?

warm hedge
#

BIS_fnc_OM_phone_incomingCall Maybe? Or you could check inside of some of functions to emulate it

ornate prairie
#

how would one disable a respawn point that was made using the respawn position modules?

fossil yew
#

thx POLPOX

#

I think you need to delete the module entity @ornate prairie

ornate prairie
#

ah ok

forest ore
#

salamibean, you can also use enableSimulation on those vanilla modules. With respawnModule_1 enableSimulation false you can disable the module

ebon citrus
#

Is that so

#

Never used the Editor respawn modules, but i think that's noteworthy if not yet documented

winter rose
#

I don't think so, because most modules are just script and variables "holders", but some scripts may take simulation into account

forest ore
#

Well.. I have been using that enableSimulation for just that
edit: I mean for enabling or disabling vanilla BIS modules on the go that are available in the Eden editor

ebon citrus
#

I tend to make my own respawn scripts with cardgames and street performers

ornate prairie
#

i will delete and disable simulation just to be safe lol
i need it off permanently so its not a big deal

fair drum
#

how can i get units group into an array of strings?

winter rose
#

Strings representing what, their names?

fair drum
#

yeah i want to do a getartilleryammo but can't use units group cause getartilleryammo requires an array of strings and units group gives me an array of objects

winter rose
#
units _theGroup apply { name _x };
#

But it won't work for this usage

#

GetArtilleryAmmo does not take unit names ๐Ÿ˜…

fair drum
#

oh i'm reading this wrong

#

i need an array of units

winter rose
#

Yup, Return value

fair drum
#

so doesn't units group give me an array of units then since a unit is an object?

winter rose
#

Yep

fair drum
#

so i should expect getArtilleryAmmo units groupname to return an array of strings of every possible ammo in each of the units in the group?

#

units artygroup returns: [arty1D,arty1G,arty1C,arty1D_1,arty1C_1,arty1G_1]

therefore, getArtilleryAmmo (units artygroup) should return: ["ammo1","ammo2"...]

but I get a []

crude vigil
#

Did you try returning their vehicles instead of the units?

#

I personally dont know the command so not sure, but that may work

fair drum
#
getArtilleryAmmo [

    vehicle ((units artygroup) select 0)
]

I did this and it worked, so yes, you are right

end result
https://pastebin.com/P44HzihW

winter rose
#

What? No.

#

You pick the first group vehicle every time

fair drum
#

i know. if they are all the same arty, it shouldn't matter right?

topaz fiber
#

hi again,
is it normal that no matter how many scripts i try i cant simply get a player to respawn with the gear they died with? whats most interesting is sometimes it works.....

fair drum
#

you want the gear that they had at the time of death or the gear they had at the start of the mission

topaz fiber
#

on death

#

could something stop scripts from running?

#

lag? network?

fair drum
#

locality usually messes me up. check that

topaz fiber
#

i wouldnt mid so much but 1/10 times it works

#

How can i test to see if a script has run?

ebon citrus
#

is there a command to add a value to a single component of a coordinate position? Let's say i want to increase the height of a position without having to redefine every single component of it?

#

or just add vectors together?

#

i guess it's gonna be the later one

exotic flax
#

This is probably one of the simplest methods, although vectorAdd will do the same things (if not better)

// move object 1m higher
_object setPos [_object getPos select 0, _object getPos select 1, (_object getPos select 2) + 1];
ebon citrus
#

did it with vectoradd

#

pos vectorAdd[0,0,z];

winter rose
#

@exotic flax vectorAdd is better, also getPos _object ๐Ÿ˜‹

exotic flax
#

I was on my phone

still forum
#

forbids phone

ebon citrus
#

is there a way to enable mouse-cursor in the camera?

#

(camera created through camCreate)

warm hedge
#

Maybe via making a dialog?

ebon citrus
#

might have to do that

#

an empty dialog

#

yep, that does the job

hallow mortar
#

Does exitWith {0} in a handleDamage eventHandler count as returning 0 for the purposes of the damage handling?

still forum
#

think i heard there were issues with that

#

but if you wrap it in a call{} then yes

hallow mortar
#

It seems like that would exit the call but not the EH

#

I think I've just figured out an alternate route though

still forum
#

it does, and thats the same thing

#

if the whole EH is a call, exiting the call will exit the EH

hallow mortar
#

I was confused by how to format that so I just modified an existing if into an if else, which also works but has the added benefit of my thick head understanding it

surreal anvil
#

So I return, once again trying to remove a BIS_fnc_HoldAction from my object. I tried this:

[manual_override_computer] remoteExec["BIS_fnc_holdActionRemove",0];

It didn't work though. No errors, just didn't get rid of the old HoldAction. Am I doing it wrong?

hallow mortar
#

holdActionRemove requires you to provide the ID of the action to remove

#

the ID is returned when you call BIS_fnc_holdActionAdd. You'd want to store it as a variable at that time, then reference the variable when you want to remove it. In your remoteExec, you would reference it like so:

[[manual_override_computer,_yourIDvariable]] remoteExec ["BIS_fnc_holdActionRemove",0];```
#

Depending when/where you add the action to begin with, you might need to convert the ID from a local to a global variable when you store it, then back again when you reference it.

surreal anvil
#

Hm

#

The holdAction I want removed is created like this:

[   
 manual_override_computer,              
 "Access Computer",             
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    
 "_this distance _target < 2",         
 "_caller distance _target < 2",         
 {},                
 {},                
 {  
 hint "UNAUTHORIZED ACCESS DETECTED! PLEASE REMAIN WHERE YOU ARE, SECURITY WILL BE WITH YOUR SHORTLY... HAVE A GOOD DAY..."  
 },       
 {},                
 [],                
 2,                
 0,                
 true,               
 false               
] remoteExec ["BIS_fnc_holdActionAdd", 0, securityCodeMan];  

That's the only code in it

hallow mortar
#

one sec

surreal anvil
#

I appreciate the help a lot, by the way

hallow mortar
#

It returns the variable the same as any other script command returns it: silently, and only storing it if you tell it to.

You tell it to store it like so:

_yourIDvariable = [ ...etc
surreal anvil
#

Alright, and it still creates the holdAction if I do it that way?

still forum
#

It returns the variable the same as any other script command returns it
no it doesn't. remoteExec doesn't

hallow mortar
#

I was just thinking that

still forum
#

that makes this a bit more complicated

#

Quite sure same question was asked yesterday

surreal anvil
#

Think that might've been me, too. This is the continuation of that

winter rose
#

use local code as I told you, and use another local code to remove the action

hallow mortar
#

It looks like the action ID is passed as an argument to any of the code results of the action, so it's a little more complicated but not unsolvable

surreal anvil
#

I'll fiddle some more and see if I can make it work

surreal anvil
#

Right. Some refactoring has been made.

_actionId = [manual_override_computer, "Access Terminal", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, { hint "Test";}, {}, [], 2, 0, false, false] call BIS_fnc_holdActionAdd;

What I'm doing here is simply to try and store the Id.

I then try to convert it to a global variable like this:

publicHoldActionId = _actionId;
publicVariable "publicHoldActionId";

I THEN try to use the public variable as a parameter in the remoteExec. It's not working though, and now I'm truly stumped.

#

Sorry for my stumbling, but this is somewhat difficult for me to grasp

still forum
#

publicVariable on that ID makes no sense

#

as its only valid locally

surreal anvil
#

Okay, how would I change that around to actually let me use globally?

crude vigil
#

Every player when you assign an action gets a different ID. Therefore, you need to retrieve them and remove them accordingly. You can do this easily by storing the variable on player by setVariable, so when you want to remove, you can then get the ID on each player and remove them that way.

still forum
#

where/how do you add that action?

crude vigil
#

I think he had written a remoteExec code before

still forum
#

this is not a simple question that can just be answered with a solution without all the information about what you are actually doing

crude vigil
#

so this is just a snippet of actual code

still forum
#

remoteExec and that code snippet above are doing VERY different things.. soo
what doing, exactly?

modern adder
#

Is there any way to reliably check if a mod is loaded?

crude vigil
#

check cfgPatches entry?

#

not sure if there is a better way.

modern adder
#

Besides making it a dependency of course, as I'd like to make a mod an optional dependency which provides extra functionality

warm hedge
#

isClass'ing CfgPatches is the best way IMO

modern adder
#

ok

#

cheers

surreal anvil
#

Yeah true. I'll explain in full in a bit what my desired sequence of events is

ebon citrus
#

is there any way to detect dummyitem.p3d any more accurately?

#

the hitboxes for them are HUGE

#

for so small items

#

or to have items in a ground-container that isnt as big as the sun?

#

i dont really feel like making a custom object for all arma 3 items

#

maybe i'll try lineIntersectsSurfaces instead of lineIntersectsObjs

#

not expecting much

surreal anvil
#

Right, so. Explaining what I'm trying to do with these holdActions:

There are two objects. A man, and a computer.

The computer creates a BIS_fnc_holdAction on itself.

The man has a BIS_fnc_holdAction that, when run, creates a new holdAction on the computer.

All of this works. What I WANT to do is remove the already existing holdAction that the computer has. This would likely be done from the man's holdAction, as it creates the new action to begin with.

Does that make sense?

dim terrace
#

is there some event which I could use to detect if vehicle is transporting something (ViV)?

still forum
#

not event, but you can use this to detect

dim terrace
#

well, being loop is not any option

#

i can also use attachedObjects for it

ebon citrus
#

can i somehow change the size of a dummyitem?

slate cypress
#

How do I modify the following to include distance parameter?

#

[player, "music1"] remoteExec ["say3D"];

#

I tried:

#

[player, "music1", 200] remoteExec ["say3D"];

#

But that doesn't work...

exotic flax
#

try

[player, ["music1", 200]] remoteExec ["say3D"];
nimble hill
#

QQ: Is there a real difference in performance impact waitUntil { time > 2400; sleep 1; }; vs. waitUntil { time > 2400}; ? It seems obvious to use the sleep, but the command is so simple that it might not even be measurable unless you spawn thousands of waituntils? (aside from the fact you cant do that command because it returns nil)

exotic flax
#

afaik does waitUntil normally run every frame (as long as the code inside allows it), so adding a sleep inside it will simply slow down the check to once per second instead of once per frame.

#

and I'm not sure how long a frame takes, but it's certainly more than once per second, meaning it will cause extra load when not limiting it

still forum
#

at 60fps a frame might be 16ms long. Which means waitUntil would check its condition 60 times a second

#

with sleep1 it only checks "is the sleep over yet?" 60 times a second

ebon citrus
#

you mean 1 time per second?

#

oh wait, no, sorry i misread

#

it was about checking the sleep and not the condition

still forum
#

nah, i meant what I wrote ^^

ebon citrus
#

me too

#

i guess blindness is contagious

winter rose
#

@lost copper

TheRecord = player createDiaryRecord ["diary", ["Test", "Test"]];
// ...
player removeDiaryRecord ["Diary", TheRecord];
```works! going to fix removeDiaryRecord page too
digital hollow
#

What's a better way to check whether a vehicle has a primary gunner seat?

fullCrew [_vehicle, "gunner", true] isEqualTo []
waxen tendon
#

is there any difference between:

fnc_someStuff = {
    if (condition) then {
        /* some code */
    };
};

and


fnc_someStuff = {
    if !(condition) exitWith {};
    /* some code */
};

?
* the = was added later

warm hedge
#

Both wouldn't work

#

So no difference

waxen tendon
#

what am i doing wrong?

warm hedge
#
fnc_someStuff = {/*smth*/};```
waxen tendon
#

nvm, sorry for the very crucial typo

#

aight, now, what is the difference between the two?

warm hedge
#

Well, the difference is โ€œdifferent codeโ€ after all. It would does the mostly same thing but you know there's always hundreds and hundreds way to do the same thing so...

waxen tendon
#

yeah, thats practically no difference, thanks a lot!

ebon citrus
#

@digital hollow you could always look at the config ๐Ÿคทโ€โ™‚๏ธ

topaz fiber
#

Morning,
any idea what this could mean in my server rpt. mission doesnt run

mission.sqm, line 10248: '._plyr': '๏ฟฝ' encountered instead of ';'
Everything works fine before i pack it

ebon citrus
#

"pack" it?

topaz fiber
#

export to .pbo

ebon citrus
#

with what?

topaz fiber
#

the game. 'Export to multiplayer'

ebon citrus
#

sure

#

you have an undefined character at line 10248

#

have you tried not packing it or using something else?

topaz fiber
#

i have not

#

i thought a dedi server needed a .pbo

ebon citrus
#

๐Ÿคทโ€โ™‚๏ธ

#

have you tried packing it using something else?

#

are you running mods?

#

are you using non-ascii characters in the mission?

topaz fiber
#

ha, no idea, it worked, then it didnt, trying to debug it now

#

that line is nothing special

ebon citrus
#

oh, ok

#

good luck

#

also

topaz fiber
#

Fixed it ๐Ÿ‘

hallow mortar
#

Is there a way to identify the approximate size class of a projectile based on the information in a handleDamage EH's _projectile param? Other than matching it to a list of classnames?

#

specifically I want to be able to differentiate between hits inflicted by a rifle and an HMG

lost copper
#

@lost copper

TheRecord = player createDiaryRecord ["diary", ["Test", "Test"]];
// ...
player removeDiaryRecord ["Diary", TheRecord];
```works! going to fix removeDiaryRecord page too

@winter rose yes, example on removeDiaryRecord page looks like cool. Thank you, now my idea works perfect!

surreal anvil
#

Hi guys! Back yet again, and I think I've made some progress.

Like I said, I'm trying to remove the holdAction from my computer from another object.

I've changed the code around so the first holdAction is created like this:

 
  private _holdActionID = [ 
      manual_override_computer,  
      "Acces Terminal",  
      "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
      "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
      "_this distance _target < 3",  
      "_this distance _target < 3",  
      {},  
      {},  
       
      { 
    hint "UNAUTHORIZED ACCESS DETECTED. TERMINAL DISABLED. REPORT TO FACILITY MANAGER TO UNLOCK TERMINAL."; 
      }, 
      {},  
      [],  
      2,  
      1,  
      false,  
      false  
  ] call BIS_fnc_holdActionAdd; 
   
   
  manual_override_computer setVariable[ "intelActionID", _holdActionID ];

If I understand the code right, it now stores the actionId as a variable on the manual_override_computer.

What I need to do now is access the actionId from another object. How would I go about doing that in this situation?

winter rose
#

getVariable?

surreal anvil
#

Does that work despite setting the initial _holdActionID as private?

winter rose
#

yes, because you set the value of _holdActionID on the computer's namespace

surreal anvil
#

Ah, so any variables I assign to the computer via setVariable become publicly accessible?

#

Oh my God, it works!

#

Thank you so much, @winter rose!

winter rose
#

you are saving the value "in" (on the object of) the manual_override_computer yes.

you are using setVariable without the "synchronise network" flag (you don't need it), therefore the value is local to the player's computer.

be sure to use manual_override_computer getVariable ["intelActionID", -1] syntax - so in case you reach this code without have set the value first, it doesn't error and still return a default value (here, -1)

surreal anvil
#

Ah, do I need synchronise network to make it work in multiplayer?

winter rose
#

nope, not at all

#

because the index can be different for every client, which is why it is important -not- to override values

surreal anvil
#

Hm, okay!

#

This is what I'm doing on the other object, and it works like a charm!

_holdActionID = manual_override_computer getVariable[ "intelActionID", -1 ];
 [manual_override_computer, _holdActionID] call BIS_fnc_holdActionRemove;
#

So, once again, thanks a bunch, Lou, and all the others who've helped me out during these days. I truly appreciate it

hallow mortar
#

Here's what's bugging me though. Do you want the action to be removed for everyone? Because I think what you've got might only remove the action for whoever the removal code is local to.

#

(Lou might correct me on that, but that's my reading of the existing code)

surreal anvil
#

I do want it removed from all clients, yes. I'm not terribly competent with Arma scripting but I don't see why it wouldn't remove the action from all clients?

hallow mortar
#

Because BIS_fnc_holdActionRemove is only being called on the one client, and it has local effect

exotic flax
#

to be fair, BIS_fnc_holdActionAdd is also local, so if it gets added to a single person it also can be removed from a single person.

surreal anvil
#

So the question is whether or not this action is added to all players and subsequently removed from all players, which is the intended effect?

exotic flax
#

If you check example 2 on the wiki of BIS_fnc_holdActionAdd, it will use remoteExec to add the action to all players (including JIP).
But as the note by R3vo mentions, it will also run for new players even when the action is already removed beforehand.

#

So instead of removing the action I would simply add a condition (5th param) to only show when it should be available

hallow mortar
#

yes, in the "action completed" code, set a global variable like "actionDone" to true (and make sure it's global using setVariable's arguments), and in the condition to show the action have a check to only show if that variable is false

surreal anvil
#

Does this mean I have to rewrite the script to run remoteExec instead to make sure it applies to all players?

#

Because the issue I was having with remoteExec was storing the actionId

hallow mortar
#

if you're not removing the action, you don't need the actionID

surreal anvil
#

That's... very true

#

Right, I'll write up a separate function with remoteExec and see how that works

hallow mortar
#

Add this to the action completed parameter in holdActionAdd:

[missionNameSpace,["actionComplete",true]] remoteExec ["setVariable",0,true];

and in the condition to show the action parameter:

(_this distance _target < 3) && ((missionNamespace getVariable ["actionComplete",false]) == false)
#

(had some bracket formatting issues. All fixed as of this message)

#

Meanwhile, can someone who knows things confirm whether this would cause an error if _projectile was an empty string?

if ((_projectile isKindOf "BulletBase") or (_projectile isKindOf "RocketBase")) then {
    _projectileType = typeOf _projectile;
    _calibre = configProperties [configFile >> "CfgAmmo" >> _projectileType >> "caliber"];

    if (_calibre > 2) then { ... };
    
};
exotic flax
#

well, since "nothing" is not in CfgVehicles is shouldn't work, but out of my head I don't know if it will render an error (SqfVM doesn't btw)

#

although you can prevent it with

if (!(_projectile == "") and {(_projectile isKindOf "BulletBase") or (_projectile isKindOf "RocketBase")}) then {
surreal anvil
#

@hallow mortar It's giving me a "Generic error in expression" when trying to implement ```sqf
(_this distance _target < 3) && ((missionNamespace getVariable ["actionComplete",false]) == false)

hallow mortar
#

You definitely put that in the "condition for action to be shown" parameter?

#

@exotic flax thanks

surreal anvil
#

Yep. I think it might be throwing it because that variable doesn't actually exist until I run the other holdAction. Possibly?

hallow mortar
#

It shouldn't be that, because the false argument in getVariable is a default value to use if the variable doesn't exist

surreal anvil
#

This is how I implemented it:

[ 
      manual_override_computer,  
      "Search For Intel",  
      "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
      "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
      (_this distance _target < 3) && ((missionNamespace getVariable ["actionComplete",false]) == false),  
      "_this distance _target < 3",  
      {},  
      {},  
       
      { 
    hint "UNAUTHORIZED ACCESS DETECTED. TERMINAL DISABLED. REPORT TO FACILITY MANAGER TO UNLOCK TERMINAL."; 
      }, 
      {},  
      [],  
      2,  
      1,  
      false,  
      false  
  ] remoteExec ["BIS_fnc_holdActionAdd", 0, manual_override_computer];
hallow mortar
#

You forgot the "" around the condition parameter

surreal anvil
#

" (_this distance _target < 3) && ((missionNamespace getVariable ["actionComplete",false]) == false)"?

exotic flax
#

yes, it's a code string (don't ask me why)

surreal anvil
#

Right, that's throwing an error saying I'

#

'm missing a "]"

exotic flax
#

do this:

"(_this distance _target < 3) && ((missionNamespace getVariable ['actionComplete',false]) == false)"
#

because you can't use quotes within quotes ๐Ÿ˜‰

surreal anvil
#

Oooooooooooooooooooh

exotic flax
#

or escape them:

"(_this distance _target < 3) && ((missionNamespace getVariable [\"actionComplete\",false]) == false)"

(should work as well)

surreal anvil
#

Next error: "Type Bool, expected Number, String"... etc

hallow mortar
#

Does it give a position for that error?

surreal anvil
#

Yeah, at the place this is implemented

#

Maybe change == false to == 'false'?

hallow mortar
#

That would do it, and also change it accordingly in the getVariable parameter and the setVariable operation

#

or change == to isEqualTo

surreal anvil
#

Right, I'll try those

hallow mortar
#

Easier to just change to isEqualTo then you don't have to change anything else

#

absolutely baffling that == doesn't work with booleans, but there you go

surreal anvil
#

isEqualTo solved it

#

Yeah I've never understood why booleans won't get checked the same way other types are, but hey

#

Thanks, @hallow mortar and @exotic flax! I think the code's ready to be implemented now

ebon citrus
#

Another reason to go full on night of the long knives on the booleans

#

0/1 > true/false

slate cypress
#

is there a default animation for slinging a weapon

ebon citrus
#

i believe so

#

check the animations viewer

slate cypress
#

ok thanks

ebon citrus
#

what's wrong?

exotic flax
#

so how do you go "undercover", other than setting the variable UNDERCOVER ?

ebon citrus
#

yeah, i think this is a little bit too little context

surreal anvil
#

An OldMan variable maybe?

exotic flax
#

no, OldMan is doing it the correct way ๐Ÿ˜‰

ebon citrus
#

is old man doing it with captives?

exotic flax
#

of course, it's the only way to make it work properly

warm hedge
#

if !(params [
["_unit", objNull, [objNull]]
])```
Wha...?

exotic flax
#

there are soo many things wrong in that script...

slate cypress
#

When talking about "group", is it referring to a collection of units or is it referring to the side such as "OPFOR" or "BLUFOR"?
I wish to change the side such as "OPFOR" of a specific player unit.
https://community.bistudio.com/wiki/joinSilent

exotic flax
#

group is a group, like a group of units

slate cypress
#

oh

warm hedge
#

Group is group, not a side. You can dosqf createGroup OPFOR;to make an empty group

slate cypress
#

I want to change the faction of the player though.

warm hedge
#

It's impossible directly

slate cypress
#

Do I have to change the faction of the group?

#

And then add them

warm hedge
#

You can't change the side of a group neither

ebon citrus
#

your best bet is to take the unit's loadout and spawn a new one of the faction of your choosing and set their loadout

#

and then set the unit to control that

#

a little hacky

#

wont move variables or eventhandlers

warm hedge
#

So you can make a different side group and join it. But it's rather buggy IIRC

slate cypress
#

hm

ebon citrus
#

yeah, joining other side's group gets really glitchy

warm hedge
#

Also depends on the situation, you can use setFriend command

slate cypress
#

because I'm trying to make a quick system where they turn to the civi side when in a specific building

#

as in a safe zone where enemies won't kill them

warm hedge
#

Then setFriend

ebon citrus
#

setCaptive

slate cypress
#

but i want them to still be able to move freely with their gun

ebon citrus
#
Mark a unit as captive. If unit is a vehicle, commander is marked. A captive is neutral to everyone (belong to civilian side), and will not trigger "detected by" conditions for its original side.```
#

that's the only thing it does

#

it wont make your gun go away or anything

slate cypress
#

oh right

#

sorry it's because I thought of captive as in the Zeus version of captive

ebon citrus
#

it just makes them civilian, essentially

slate cypress
#

where you're handcuffed

#

thanks

#

and then when it's false, it will return to the original faction?

exotic flax
#

yes

slate cypress
#

ok

exotic flax
#

or better said; enemies will attack again, it won't change sides

slate cypress
#

so to a zeus curator, would they appear as a civilian (purple) or would they still be the faction colour, just voided by enemies

exotic flax
#

I believe purple, but not sure...

hallow mortar
#

Yes, they'd appear purple

#

So what I'm doing is making robot soldiers that are super hard to kill and have witty dialogue lines.
This version of my eventHandler works fine - it plays the lines (hitEvents.sqf) and makes any incoming damage have a value of 0.01.
https://sqfbin.com/hagibafabicehipinaya

Then I tried to make it detect high-calibre weapons and have them inflict more damage.
https://sqfbin.com/ikepegemabujorafelaf
Now I'm in Nested If Hell, dialogue lines still work, but as far as I can tell no damage handling at all is taking place.

#

I have not observed any script errors or RPT errors.

nimble compass
#

Anybody know a emp script

tough abyss
#

Anybody know why

11:33:01 Unit R GraveYard:1 (0x73c36080) - network ID 2:3194
11:33:01  - no person

would be getting spammed in my server RPT? I feel like it probably has to do with a dead AI being moved to another client.

ebon citrus
#

@nimble compass what do you mean with "emp script"

nimble compass
#

Eletro magnitic pulse

ebon citrus
#

yes, but what would you like it to do in-game?

nimble compass
#

Shut off all cars planes and infantry electric systems

#

Is what i want it to do

ebon citrus
#

infantry electric systems such as?

#

cars and planes is easy

nimble compass
#

Nvgs gps

ebon citrus
#

you'd have to remove the gps

#

you cant just disable it

young current
#

there are broken/disabled NVGs in Contact DLC

#

those can be swapped to

ebon citrus
#

and to disable planes/cars

young current
#

but only works with vanilla stuff

ebon citrus
#

just get all cars in a radius

#

and disable their engine

warm hedge
#

Also optics

ebon citrus
#

i.e. destroy it

#

btw, names on those?

carmine sand
#

Someone did a EMP script with a EMP mine to place

nimble compass
#

Can tou send me a link off to it

ebon citrus
#

i believe it's an older one

carmine sand
#

An older but functional one. Works for every vehicle also addons not only vanilla

ebon citrus
#

vehicles are not the issue

#

optics and nvg's you can only disable if they have a disabled variant

#

vanilla items should have

#

but modded ones are down to mod author's whims

carmine sand
#

Havent tested for nvg's and such stuff, but thats the emp mine yes.

ebon citrus
#

there was a script aswell

#

but it's like a walk in the park to write a script to disable all engines/turrets in a radius

#

lights are a little funnier

#

but doable

carmine sand
#

For me is only important to disable vehicles and this emp mine is doing the job well

topaz fiber
#

Good evening. For those of you who recognise my name you may know Iโ€™ve been failing for some time to get a simple respawn with gear I had and remove my body script to work on my dedicated server.
I now have it working but not every time. I know that the clean up body works every time from within the playerlocal.sqf.
So at some point either the onplayerkilled or onPlayerRespawn is not working. But it does sometimes.
Any thoughts on why this might be?

ebon citrus
#

would have to see the script

topaz fiber
#

[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;

#

[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;

#

Itโ€™s the only thins I can find that works. Mostly.

ebon citrus
#

so...

#

what exactly is wrong with this script?

topaz fiber
#

We spoke before about โ€˜playerโ€™ not being a great variable

ebon citrus
#

we did?

topaz fiber
#

Errrr. Think so.

#

Unless I dreamed it

ebon citrus
#

what is "inventory_var"

#

you arent using BIS_fnc_loadInventory correctly here

topaz fiber
#

Ok, so I respect that. But why would it work most of the time!?! ๐Ÿคฆโ€โ™‚๏ธ

ebon citrus
#

actually, im not quite sure

#

the biki is using the comma incorrectly

#

so im not quite sure if it's a list or what

#

it's too ambiguous

#

so i can only assume that the second array takes one parameter

#

and i cant say why it worked "most of the time" without seeing the script itself

topaz fiber
#

Thatโ€™s literally it. One line.

ebon citrus
#

that's 2 lines

topaz fiber
#

Save in playerkilled. Load in playerrespawn

ebon citrus
#

so where is this script?

#

ah, ok

topaz fiber
#

Delete body in playerlocal works perfectly every time

#

So something Iโ€™ve written does ๐Ÿ‘

ebon citrus
#

so there is more to it?

#

i cant help you without seeing all that factors into the script

#

sorry

topaz fiber
#

I mean you have. The remove body thing is not an issue. Itโ€™s just the save inventory in killed and load inventory in respawn. There is nothing else.
I appreciate any and all advice. Thanks.

#

At this point Iโ€™m beginning to think itโ€™s not actually possible. ๐Ÿคฃ

ebon citrus
#

it's very much possible

topaz fiber
#

Ha. Youโ€™d think

#

Itโ€™s funny really, Iโ€™ve been trying to make it work for like 2 months ๐Ÿคฃ

#

I have tried and adapted and written everything I have learnt and found online. Nothing works reliably

#

Any sane person would go back to COD

plush breach
#

Hey guys I was wondering if anybody knew how exactly I can use a trigger to activate a distant custom sound effect.

#

I've been using playSound3D[filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset] but haven't been able to get it to work.

young current
#

maybe its too far away to be heard

plush breach
#

maybe however, when trying to put it right next to my testing ai it doesn't work

#

I've double checked my custom config for the sound in description.ext, i've also double checked the trigger, so I believe it may be something in the actually playSound3D line itself

young current
#

try playing some vanilla sound then

plush breach
#

so far i've tried this

plush breach
#

oh damn thanks killzone

humble bridge
#

Can someone explain me how lifeState works?
Is there a distance above which it's not syncing anymore for performance reasons (aka optimization)?

lifeState command returns incorrect results for distant players.
Sometimes "lifeState somebody" might return "HEALTHY" though the player is in fact "DEAD" or "INCAPACITATED", and vice versa.
And the command starts returning the correct result only after you approach (approximately) to the distance of visibility or some closer.

humble bridge
#

this is what I was thinking

winter rose
#

The server should know though (โ€ฆI suppose?)

humble bridge
#

but is there a distance or what are the conditions for this not to be synced anymore

#

fixed value? if yes, what the value

still forum
#

no fixed value. the error is configurable in server config

#

IMO life state should be important tho ๐Ÿค”

humble bridge
#

what would be the solution to "fix" this?

still forum
#

run code on server

#

server should know

humble bridge
#

because I've seen other missions not having this problem, but I think they're using some heavy methods to avoid this

still forum
#

orientation is sent every frame? wuht

#

that seems as un-important as position ๐Ÿค”

humble bridge
#

wouldn't say so

#

because when you're observing other players on map to direct them to take something or explaining where enemy is etc, it's very useful to see where they're look at, to correct/guide them

still forum
#

looks like they chose to send numbers every framr but arrays and strings only if close enough
orientation is array

#

Direction is array

#

no

#

the script command calculates a bearing number from the direction vector.
The engine doesn't have a bearing.

faint oasis
#

hi, how to get the player camera ?

winter rose
#

hi, cameraOn to get the object on which the camera is, or
positionCameraToWorld to get the camera current position

faint oasis
#

oh ok thx i will try

faint oasis
#

@winter rose the "positionCameraToWorld" doesn't get the current camera position you need to put a position so how to get the "camera object" or the camera position ?

winter rose
#

[0,0,0] to get the camera pos I suppose

faint oasis
#

@winter rose yes it work but how to do the same thing of the spectate zeus cam ? because when you are in the zeus you can press "Numpad Enter" on the selected units and you see his camera view ? so how to do the same thing of the "Zeus Spec Cam" or the spectator cam in multiplayer ?

winter rose
#

hah, give more details first ๐Ÿ˜›

I think you have curatorCamera commands around

faint oasis
#

oh ok thx i will try but not now

#

so thx

waxen tendon
#
/* some code that has _param1 */
_thing1 = [_param1] spawn {
    params ["_param1"];
    _thingToUseLater = _param1 call function1
};
/* some code that uses _thingToUseLater */

i feel like i am missing a very simple thing here but, how do i use _thingToUseLater outside the _thing1 block?
revision 2:

/* some code that has _param1 */
thingToUseLater = objNull;
_thing1 = [_param1] spawn {
    params ["_param1"];
    thingToUseLater = _param1 call function1
};
/* some code that uses _thingToUseLater */
winter rose
#

set it as a global variable

#

also, _param1 call function1 will not work because of scope change

#

@waxen tendon โ†‘

waxen tendon
#

thanks
how about revision 2?

winter rose
#

yep

waxen tendon
#

thanks!

astral dawn
#

the script command calculates a bearing number from the direction vector.
The engine doesn't have a bearing.
even characters? As I understand, their vector up always looks up

fair drum
#

how should I go about adding all units of a side into an array?

#
if (side _x == civilian) then {

    _civilian = _civilian + [_x];
} forEach allUnits;

i have something like this so far, but obviously I'm missing some stuff

#

this is my try so far

astral dawn
#

allunits select {side group _x == WEST}

fair drum
#

well then. i was overthinking this obviously lol

astral dawn
#

Your code is not wrong ๐Ÿค” should have worked

robust hollow
#

then and foreach using the same curly braces

astral dawn
#

did you define private _civilian = [] ?

#

oh yeah ๐Ÿ˜„ his code is wrong, I didn't notice

fair drum
#
_civilian = [];
if (side _x == civilian) then {

    _civilian = _civilian + [_x];
} forEach allUnits;

i think i forgot to define something

astral dawn
#

wait, so it is even more wrong ๐Ÿค”

robust hollow
#
_civilian = [];
{if (side _x == civilian) then {

    _civilian = _civilian + [_x];}
} forEach allUnits;
``` is what u would have needed
#

excuse the formatting

fair drum
#

gotcha

#
params ["_prison"];

private _civilian = allunits select {side group _x == civilian};

{_x addEventHandler [

    "MPKilled",
    {
        params ["_unit","_killer"];

        _killLocation = getPos _killer;
        _killer setPos (getpos _prison);
        hint "Have a timeout for killing too many civilians";

        waitUntil {

            serverTime == serverTime + 120;
        };

        _killer setPos _killLocation;
        hint "Don't kill civilians this time!";
    }
]} forEach _civilian;

so if I have something like this, will the param "_prison" be used by the scope under "MPKIlled"? or do I have to redefine it in there as well

robust hollow
#

yea that wont work

#

also ```
waitUntil {

        serverTime == serverTime + 120;
    };
will never be true
fair drum
#

okay noted. will the _prison param work though?

robust hollow
#

no

#

eventhandlers start a new scope. local variables from the script it was added in arent available.

#

if the code doesnt execute as part of a function, it is a new scope. so event handlers, addactions, spawns, etc.

fair drum
#

mk would placing the _prison param under the scope of the addeventhandler still reference the original arguement outside of the script using [] execVM?

robust hollow
#

how do you mean? like how addaction does it? no.

winter rose
hallow mortar
#

Given that I've verified that _projectile is a valid projectile classname, why would this return an empty array?

_calibre = configProperties [configFile >> "CfgAmmo" >> _projectile >> "caliber"]
#

(I've also verified that the projectile class in question really does have a caliber property defined in cfgAmmo)

warm hedge
#

getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "caliber")

hallow mortar
#

_projectile is already a string classname so I don't need typeOf, but I'll try getNumber

#

I'm curious why configProperties doesn't work, given that this appears to be the exact purpose it's intended for

warm hedge
#

configProperties does work only for "class," not value inside class

#

IIRC so. Kinfa hard to describe the difference tho

hallow mortar
#

I see.

cosmic lichen
#

I have a bunch of scripts which store displays and controls in variables, but I don't use disableSerialization in the scripts. However KK's note says I have to use it. So was something changed at some point? (My scripts work fine btw)

queen cargo
#

Iirc it is only mandatory for saving/restoring
However, you should just change it to non-variable Variant

livid wraith
still forum
#

local probably

cosmic lichen
#

However, you should just change it to non-variable Variant

#

Why that?

queen cargo
#

Because less possible issues arrise then
Accidentially putting a control into a global for example
Or someone does indeed cause Script serialization and thus your Script gets invalidated when deserialized

cosmic lichen
#

First point is not an issue for me since in GUI scripts I very rarely work with global vars.

#

Seconds point. Hmm could happen, but for my UI's not a big deal since everything is reinitialised when the UI is opened again.

#

The downside I guess is that it would be more writing since I need to always grap the control again and again.

#

So to summarize it, since I work in Eden Edtitor where saving is not an option, I can forget about serialisation?

queen cargo
#

I always used a macro for that

#

And the idc defines

jolly jewel
#

Does anyone know how to convert between eden and game rotation?

#

I can sort of do it, until I rotate more than one axis at which points the numbers don't match up at all

winter rose
#

what are you trying to achieve?

jolly jewel
#

I want to convert vectorDirAndUp into the appropriate values so I can set the eden attribute

#

Because the eden values are three numbers between 0 and 360

astral dawn
#

convert bearing to vectorDir?

#

if object always looks up then vectorUp is [0,0,1]

#

vectorDir is
[sin bearing, cos bearing, 0]

jolly jewel
#

It's the other way around, I have the vectorUp and vectorDir, but I want to set the eden attribute for rotation

astral dawn
#

bearing is x atan2 y... or y atan2 x, I can't think about this triangle at this time of day xD

#

Oh I see now, it has three angles in the editor

astral dawn
#

Some command wants string instead of code, how would I convert my {code} to a compatible string the easiest way?

Found a solution:
#define CODE_TO_STRING(code) 0 call {private __codeToStringTemp = str code; __codeToStringTemp select [1, (count __codeToStringTemp)-2];}

#

str {systemChat "hello"} will wrap everything inside {}

_condShow = format["_target = _originalTarget; _eval = %1; [""%2"",""%3"",""%4""] call bis_fnc_holdAction_animationTimerCode; _eval",_condShow,_title,_iconIdle,_hint];
Why would someone write this, why notlikemeow notlikemeowcry

jolly jewel
#
tint_fnc_test = {
private ["_obj","_pitch","_bank","_yaw","_vdir","_vup","_sign"];

_obj = _this;

_vdir = vectorDir _obj;
_vup = vectorUp _obj;
_vcross = _vdir vectorCrossProduct _vup;

_pitch = (_vup#1) atan2 (_vup#2);
_bank = asin (_vup#0);
_yaw = (_vdir#0) atan2 (_vcross#0);

[[360+_pitch] call CBA_fnc_simplifyAngle, [360-_bank] call CBA_fnc_simplifyAngle, [360+_yaw] call CBA_fnc_simplifyAngle];
};```
#

For anyone who is ever stuck with a similar problem, here's a function

still forum
#

use params, use private keyword, not private command

slender schooner
#

i m having a small problem, i figured this fits into this channel as its scripting related
i m trying to use cbchecked on a checkbox, but, i seem to not understand how to actually select the control

#

this is what my take on it is so far
_displayAllPlayers = ctrlChecked 762800;

#

i also tried cbChecked

#

both output "control expected" as error, but i dont seem to get how to get a control....

still forum
#

762800 is a number/scalar, not a control

#

there is a command to get a control by number

#

displayCtrl maybe?

slender schooner
#

okay, gonna look into that

#

i m sorry if my question might be stupid, i m just super tired right now KannaBlob

#

awesome, it works now

#
_whitelist_menu = findDisplay 76111;
_displayAllPlayers = cbChecked (_whitelist_menu displayCtrl 762800);

so, i basically had to first use the finddisplay to find the dialog, and then use displayctrl

astral dawn
#

Where does the game search for stringtable.xml? On wiki it says that it searches mission root, but in my case the xml file is in a subfolder and the game seemed to resolve it anyway.

still forum
#

i guess same folders as config.cpp, meaning every folder

astral dawn
#

Does it search for config.cpp in every folder? ๐Ÿค”

still forum
#

yes, but only at startup when loading mods

astral dawn
#

...all folders in an addon .pbo file, correct?

#

Then it explains why it has resolved the strings for me in my case. Because it has found the stringtable in the addon pbo file, not in the mission file.

still forum
#

ye

half hornet
#

is there a function to check if a key is down? I was going to try the approach of checking if a key is down within an onEachFrame event handler

#

the only problem with this however is it doesnt work with a dialog open ๐Ÿ’”

warm hedge
#

You wanted to do it while a dialog is open?

half hornet
#

yeah essentially i guess what im trying to replicate is something like the 3den editor in that you have what im assuming is a dialog(?) but can still move the camera around

#

making a kind of RTS prototype

warm hedge
#

Then probably (on)keyDown UIEH?

half hornet
#

the only issue with that though is i need it

#

to be oneachframe because that event handler doesnt seem as responsive to holding down keys, etc

#

and if i have it in my OnEachFrame event handler then i can lerp the camera movement

#

if that makes any sense im probably just not picturing this correctly right now

#

i think i might have an idea though

still forum
exotic flax
warm hedge
#

Heyyyyy

#

This is something!

astral dawn
#

Yes please

exotic flax
#

has global effect
So now all we have to figure out which time it took ๐Ÿคฃ

restive leaf
#

Can we get a dateUTC function as well so we don't have to convert it ourselves please? ๐Ÿ˜‰

exotic flax
#

you'll need to convert it anyway, because dateUTC would return [2020, 7, 7], which still isn't a valid date ๐Ÿ˜‰

still forum
#

it is already date?

restive leaf
#

LOL... We also would need a timezone function returning a new config entry from the map's CfgWorlds... What a pandora's box Dedmen has opened ๐Ÿ™‚

#

Date is the local time, not UTC

still forum
#

non-utc version is local time

restive leaf
#

Description for date explicitely says "Returns the current local in-game date."

still forum
#

Ah I see. No.

restive leaf
#

๐Ÿคฃ That took longer than I expected...

digital hollow
#

Fancy watch you got there with 2 readouts

winter rose
#
private _hour = currentSystemTime select 3;
if (_hour > 22 || _hour < 8) exitWith { hintC "Go to bed!"; };
slender schooner
#

currentSystemTime doesnt exist

warm hedge
#

If with function that to do like [9] call BIS_fnc_currentTimezoneTime it's really handy

#

Because he just made it

slender schooner
#

hm

slender schooner
#

just saw it, yea

winter rose
#

I also imagine Dedmen being "okay, here's my to-do listโ€ฆ oh hey, which command did I miss last time? let's do that instead"

warm hedge
#

I honestly can't wait to test next Dev-Branch

surreal anvil
#

Hi guys, me again! Quick question: is there a way to make a user added action be at the top of the list of available actions on an object when you use the scroll wheel? For instance, a vehicle.

#

It's a holdAction in this case

winter rose
#

the priority parameter does that yes ๐Ÿ™‚

surreal anvil
#

Ah, nice. Is it descending or ascending priority? As in, is a 1 higher on the priority than a 10, or is it the other way around?

winter rose
#

bigger = higher

surreal anvil
#

Thanks! ๐Ÿ˜„

sonic thicket
#

I'm too lazy to upload this somewhere and do stuff with it but if anyone would like to have a script that replaces ravage zombies on spawn with ryan zombies ( a mixture of different ones with set ratio's ) + a script that adds "screamers" that spawn extra zombies in feel free to ping me here and ill share it here

#

just got into arma scripting since last week but I've done some scripting before so its been relatively easy to pick it all up ๐Ÿ™‚

#

now all i need is a melee mod/script that does not activate the "Fired" event or whatever event ryanzombies/ravage listen for

still forum
winter rose
#

oooh ms

#

ms as precise as diag_tickTime I presume ๐Ÿ™‚

still forum
warm hedge
#

Overkill!

still forum
#

only 100ns resolution

spark turret
#

is there a way on how to tell "how good a car can go through offroad terrain"? a friend made stronger camera shake for offroad driving to encourage staying on roads but a city car shouldnt have the same wobble as a Humvee.
looking for an easy way to automatically assign wobbling factors.

winter rose
#

maybe check for dirt adherence coef in config?

#

@spark turret โ†‘

spark turret
#

Ill check that out thanks

astral dawn
#

Next: datetime SQF basic type which supports comparison

winter rose
#

Dedmen left the chat

sonic thicket
#

Hey guys, I'm currently enhancing a zombie scenario and am trying to add a listener to whenever a unit gets damaged.

Everything works like a charm but for some reason out of all the following eventhandlers the "Dammaged" fires most frequently, yet not every time a unit is hit by a zombie.

Is there a way to lower the damage treshold on which the eventhandler activates?

Player addEventHandler ["HandleDamage", {systemChat "StartNow1"; }];
Player addEventHandler ["Hit", {systemChat "StartNow2"; }];
Player addEventHandler ["HitPart", {systemChat "StartNow3"; }];
Player addEventHandler ["FiredNear", {systemChat "StartNow4"; }];
Player addEventHandler ["Fired", {systemChat "StartNow5"; }];
Player addEventHandler ["EpeContactStart", {systemChat "StartNow6"; }];
Player addEventHandler ["Dammaged", {systemChat "StartNow7"; }];
exotic flax
#

HandleDamage is the one you need to increase/decrease damage

sonic thicket
#

the issue is that that one rarely even fires

exotic flax
#

getting hit doesn't mean getting damaged ๐Ÿ˜‰

sonic thicket
#

well.. here's a example: ๐Ÿ˜›

#

ah cant upload png

exotic flax
#

and since you talk about zombies, which means modded gameplay, it also might be an issue of the mod you use

sonic thicket
#

i feel like that is the case

#

I think the mod uses some sort of silent damage script then

half hornet
#

im not completely sure though

exotic flax
#

well, the issue is in the mods (and I see enough stuff in that screenshot which I wouldn't trust), because HandleDamage is the only way to modify damage (and not only registering it)

sonic thicket
#

yeah, but i've used more then just that handler:

Player addEventHandler ["HandleDamage", {systemChat "StartNow1"; }];
Player addEventHandler ["Hit", {systemChat "StartNow2"; }];
Player addEventHandler ["HitPart", {systemChat "StartNow3"; }];
Player addEventHandler ["FiredNear", {systemChat "StartNow4"; }];
Player addEventHandler ["Fired", {systemChat "StartNow5"; }];
Player addEventHandler ["EpeContactStart", {systemChat "StartNow6"; }];
Player addEventHandler ["Dammaged", {systemChat "StartNow7"; }];

The dammage one makes sense but the weird thing here is....

  1. the dammage event triggers so the game knows about the damage, and if it knows about the damage, shouldnt the other events trigger too?
#

currently the only thing I can use is the fact that the character screams every time it gets hit, so soundplayed is my best bet then to trigger every time a person gets hit. The downside is that I will need to find the nearby entity that caused the sound to trigger and then execute the whole underlaying script

exotic flax
#

or check which mods is breaking the EH's...

#

and remove that mod ๐Ÿคทโ€โ™‚๏ธ

sonic thicket
#

That is definitely ryanzombies itself, it works perfectly with ravage haha

half hornet
#

yeah i'd try to avoid that work around if i could tbh, might be something to do with how the zombies deal damage? unsure

sonic thicket
#

I even tried upping the zombie damage but then they knock me out in 1 hit

half hornet
#

I kind of want to test this but just to be sure

#

the zombies are ryans zombies and thats really the only mod you have on?

sonic thicket
#

Not the only mod I have on, I'll try testing it with only ravage & ryan

half hornet
#

in terms of like the enemies

sonic thicket
#

im using the ravage as framework and ryan as actual zombies

half hornet
#

gotcha okay

sonic thicket
#

best of both ๐Ÿ™‚

exotic flax
#

not if it breaks the game ๐Ÿคทโ€โ™‚๏ธ

sonic thicket
#

haha true, the ravage zombies are so dull though but heck it got a nice system with the bandits and all

exotic flax
#

I'm not sure if mapContentFriendly=1; in the server profile also applies to arty computers, otherwise I don't think it will show any players/AI/etc.

digital hollow
#

At that point just give them Zeus with only the fire support modules ._.

exotic flax
#

or have a real player giving coordinates and making sure the rounds are on target ๐Ÿคทโ€โ™‚๏ธ

winter rose
half monolith
#

i apologize ((

half hornet
#

@sonic thicket from what i can see it looks like its how ryan zombies works thats making the event handler not fire

still forum
#

@astral dawn

Next: datetime SQF basic type which supports comparison
I thought about it, but you can make script functions to do that so no

astral dawn
#

Yeah agree

winter rose
#

@still forum if we provided functions, could they be implemented?

still forum
#

Integrated into BIS_fnc I think so, for that talk to BIS_fnc_KK

half hornet
astral dawn
#

I already see how I implement sorting of saved games by their system date and write a function to compare datetimes ๐Ÿ˜„

sonic thicket
#

That is quite annoying, really wanted to add in screamer type of zombies they scream when they hit players and only certain type of zombies do that so you need to kill them before they get close

#

What i need is an event to trigger whenever the ryanzombs hit someeone basically

half hornet
#

there still might be a solution somewhere but im trying to think how you'd go about it

sonic thicket
#

the roundabout on player screams event seems like the only way ๐Ÿ˜›

#

it might be quite buggy though but I can live with a random nearest zombie screaming instead of the actual screamer screaming

#

Oh wait i can filter that too

#

search nearest zombie that is a certain type ( screamers are selected on type that have white clothing )

#

Thanks a ton for testing that for me haha, you were a hell of a lot faster then me ( I was still sitting in arma3 launcher ) ๐Ÿ˜›

half monolith
#

I'm not sure if mapContentFriendly=1; in the server profile also applies to arty computers, otherwise I don't think it will show any players/AI/etc.
@exotic flax
well the first option is off the table. it is a faster paced pvp mission in project argo, in a very small area, comically small for mortars at all, but its a "fun" game where people just want to collect kills. (project argo doesnt allow change the profile)
this also leaves the second option off the table. i can open zeus in argo myself, but it doesnt have full functionality. im hoping there is an idd i can find. the game is also in arma , its almost a cross between gun game for its speed and koh for the one sector objective.

exotic flax
#

Project Argo also doesn't allow mods afaik

#

and this is an Arma Discord, not Project Argo ๐Ÿ˜‰

half hornet
#

@sonic thicket no problem! it would seem that ryans zombies is so weirdly made that even disabling damage on a unit, you can still be killed by zombies lol

sonic thicket
#

XD that is weird indeed lol

half monolith
#

Project Argo also doesn't allow mods afaik
@exotic flax
im not making a mod... project argo is just a cut down arma. i cant say for sure but maybe 80 % of the functions exist, some edited. it has an editor. the same mission wouldnt also exist in arma if that was the case. it just happens to be it sees more play in argo.

exotic flax
#

It's a free and extremely limited version of the Arma 3 engine, and the editor only exists to make new missions and not make fully scripted stuff like in Arma 3.
And afaik are there PA like missions for Arma 3 (small scale PVP), just not that common since Arma 3 can do much more.

#

If everything that's possible in Arma 3 would be possible in PA, than no one would buy the game anymore

half monolith
#

its not a dispute. the mission already exists with hundreds of hours of play

void ivy
#

Is there any way for mods to have custom mappings to analog axis controls similar to CBA keybinds works?

exotic flax
#

@void ivy you can use CBA as a dependency and use their system

#

@half monolith well, you won't find much help on this Discord since all the solutions we have are for Arma 3 which won't work for Project Argo...

void ivy
#

@exotic flax I wasn't aware those gave access to controllers, let alone their analog axes. Is there something special there or am I just missing it?

exotic flax
half monolith
#

@half monolith well, you won't find much help on this Discord since all the solutions we have are for Arma 3 which won't work for Project Argo...
@exotic flax this is also in a3 in the same format literally copied and pasted over. so from here on out im trying to find the idd in a3๐Ÿ™„
i have two fully scripted servers in project argo. for years. some missions direct ports. think of it as the same as a2- a3.

sonic thicket
#

@half hornet Haha, even soundplayed does not trigger XD Now the next best thing would be a "while" script, ugh or a on fire bound to player. If you want i can ping you with the solution to this issue, although it be a very, very roundabout one. Ill also probably will give up once I need to resort to while loops

silver mauve
#

how do i increase the max ammo in the ghost hawk mini guns?

winter rose
#

You can add magazines @silver mauve

silver mauve
#

how do i do that?

fair drum
#

best way to create a map border with kill zone for MP? I was thinking about doing a trigger set to activate when any player isn't present which then kills the player but I'm unsure how to implement it in a MP fashion. do triggers placed in the editor typically run local or global? cause I see an option for server only.

exotic flax
#

createTrigger is global, but you can make it local (3rd param)

winter rose
#

@fair drum they run locally - it would be better if you made your checks server-side though

fair drum
#

i was wanting to use something simple like player but if it was serverside that should be null. I don't have a need for security as its not an open server and its just a mission.

exotic flax
#

and I would make 2 areas; a "soft border" which gives a warning to the player and a "hard border" which will kill or damage the player (eg. 10% per second)

half hornet
#

@sonic thicket maybe animation event handlers then? not sure

sonic thicket
#

If it's got a unique animation when a player is hit then yes

#

ill try that

#

its gonna be a bit vague though as it will trigger when the zombie animates but misses

#

It feels kinda hacky and vague, when scripting I usually script for server environments so i kind of want it to be clear when something is happening. However as I've only been playing with my brothers as I started playing arma since 2 weeks i could make an exception to this rule.

I've learned scripting because it allows me to do anything i can possibly think of (and is within the limits of the game engine) so i will have a hard time accepting something that is half baked ๐Ÿ˜›

#

But! ill figure it out and that is what makes scripting fun, the feel of accomplishment ๐Ÿ˜„

exotic flax
#

Arma is actually pretty predictable when it comes to scripting, or at least can be explained when it's not.
And the sky is the limit, it just depends on how well you know the engine and how far you're willing to go develop ๐Ÿ˜‰

sonic thicket
#

damn ryan zombies is a weird mod, whatever hits me doesnt seems to exist XD

#

gives null errors haha

#

lets see what anim does

#

Arma3 is pretty straightforward but I feel as if the library could be a bit bigger

obsidian violet
#

So after alot of searching around I cannot find a good answer.
Is there a way to add sfx sounds to the arma 3 module "Play Sound"?

I have looked into the module itself but do not quite get it.

fn_moduleSFX.sqf

_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;

if (_activated) then {

    _sound = "";
    _soundSource = objnull;
    while {!isnull _logic} do {
        waituntil {
            _soundSource setpos position _logic;
            sleep 0.1;
            ((_logic getvariable ["RscAttributeSound",""]) != _sound)
            ||
            isnull _logic
        };
        if (isnull _logic) exitwith {};

        _sound = _logic getvariable ["RscAttributeSound",""];
        deletevehicle _soundSource;
        _soundSource = createsoundsource [_sound,position _logic,[],0];
    };
    deletevehicle _soundSource;
};

I believe I need to attach the sound to the RscAttributeSound but I have no clue what Im looking at here.
When I search for the Rscattributesound all I get is that this is the "menu" that the curator sees.
Question is how do I add a custom sound to this list?
I know it gotta be possible somehow since I can confirm the mod plp_containers adds one.

Any clues?

Thank you!

exotic flax
#

Arma3 is pretty straightforward but I feel as if the library could be a bit bigger
@sonic thicket
There are 8000+ commands and functions in Arma 3 (vanilla), and a lot more can be added through mods (especially CBA which adds a lot of useful stuff).
I don't know any game engine which is that extensive without mods/plugins/whatever, while still being compatible with itself and other creations.

sonic thicket
#

the events seem lacking though ๐Ÿ˜›

exotic flax
#

no, just incorrectly used

#

and like I said; CBA adds a lot extra stuff, including new events

sonic thicket
#

Hmm i see, i think one could even make its own events so there isnt really a limit to it

#

just gained a bit of info on that, I do use CBA though

exotic flax
#

some events are handled by the engine, but technically you can make events from everything

sonic thicket
#

Yeah, that is on a whole new level though ๐Ÿ˜›

#

It shouldnt be hard though, whenever a function is called { add listener }

jade saddle
#

does any one know how to make a mod

#

for animation like smk in arma2

exotic flax
#

for animation work; #arma3_animation
for modding in general; search the forums and wiki for more information, or Google for tutorials

restive leaf
#

A lot of people here would be able to... including the original authors. If they haven't then it is fairly unlikely to happen now I would have said...

half hornet
still forum
#

mouseX*screenResolutionX = pixel coord

#

I'd say

half hornet
#

I tried that because i thought that was it initially too, but the bounds of the MouseX variable in my case are like -0.712121 to 1.7096 which is super weird

still forum
#

ah

#

bug on that was fixed in next update

#

if you have different render resolution

#

not 100%

half hornet
#

oh weird, it says mine its 100%

#

let me try something if its this

#

oh nevermind i thought maybe it was maybe something to do with my multiple monitor setup or something

still forum
#

could be yeah

#

0-1 is probably center monitor

sonic thicket
#

I have been searching for a way to check if a string contains a set of words and while they activate if it is a 100% match it doesnt activates when it is a partly match.
To put it in script ( and possibly easier to understand )

_zombietype = Ryan;
if (_zombietype in "RyanZombieB_Soldier_05_f" || _zombietype in "RyanZombie31" || _zombietype in "RyanZombie29") then { systemChat "Ryan in string"; }

However "in" does not seems to work in this case, is there anything that would work?

still forum
#

_zombietype find "Ryan" != -1

sonic thicket
#

thanks ๐Ÿ™‚

sonic thicket
#

it seems that the _variable1 find _variable2 != -1; needs to have a shorter variable 2 then a variable 1. Solution to this is to use count and save the biggest count in variable1

#

Im enjoying myself, scripting again after what is probably a year or more

still forum
#

yes

#

it finds text in _variable1

#

if text is longer than whats in _variable1, it can never find it

#

just use the command correctly.
y find x
find x inside y

sonic thicket
#

Yeah, im not sure why I did that in the first place

tiny shard
#

Any guess how can I print on screen "It's mandatory to choose SL slot" if some player doesn't choose SL slot? The problem: when I use on Condition !alive _slSlot nothing happens in-game because probably the _slSlot doesn't exist to be dead. The message bellow works only when I choose the _slSlot hehehe but I need totally the opposite way.

Condition:
!(_slSlot isEqualTo objNull);

On Act:
Hint "It's mandatory to choose SL slot."

astral dawn
#

If you say that your condition works for a situation, then the opposite of this condition will work for the lack of that situation ๐Ÿคท

#

so removing the logical inversion ! should work

#

also you can just write isnull something instead of something isequalto objnull

tiny shard
#

Condition:
isNull _slSlot;

It didn't work.

Condition:
(_slSlot isEqualTo objNull);

It didn't work.

astral dawn
#

variables starting with _ are always local variables

#

maybe the game searches for a local variable?

tiny shard
#

I'm writing _slSlot just here. In the true I'm using "devTeamSL"

astral dawn
#

you should verify with your debug console, what does devTeamSL return

#

is it nil or nul?

tiny shard
#

you should verify with your debug console, what does devTeamSL return
@astral dawn how can I do it? "Verify by debug console...?

astral dawn
#

yes, with debug console ๐Ÿค”

tiny shard
#

Sorry @astral dawn, I never has used the debug console, so I am not sure what you recommended me to do.

astral dawn
#

then you should learn how to use it, before trying to mess with the code

#

you can access it if you launch your mission in the editor and press escape

#

It just runs whatever sqf code you type into it
you type 1+2, push local execute, it returns 3
you type random 3, push the button, it returns a random number... you see?

tiny shard
#

let me try... wait.

astral dawn
#

I actually don't know how to solve your problem but I am rather giving you information about how to solve it ๐Ÿ˜„

tiny shard
#

Ok, gotcha, but what do you recommend me to try right now on debug console?

#

return devTeamSL

#

nothings happened hehehe

astral dawn
#

try
devTeamSL
then try
isNil {devTeamSL}
then try
isNull devTeamSL

#

there is no return statement in SQF

#

value of last statement is the return value

tiny shard
#

isNil {devTeamSL} = TRUE

astral dawn
#

๐Ÿค”

#

ok, then you can use that to test your condition ๐Ÿคท

tiny shard
#

ok

astral dawn
#

so does it work?

tiny shard
#

nope. I am waiting a friend of mine who can look that closer. Hey @astral dawn, thanks for recommendation about debug. I do believe is the best way I first of all understand that tool. Cheers.

flat elbow
#
aaa = cursorObject getVariable "Ship CIWS";
{aaa set [3, false]} forEach aaa;
hint aaa select 0 select 3; => true
#

mmh something isn't right

#

but i don't get what, it seems ok

#

on a second thought i think that's because i am foreaching the content on the object itself and that's why, if it proves true i'd shame myself

fair drum
#

how do i prevent the spawn "menuPosition" from showing all AI units as part as high command

#

I don't want the high command icons to show for players

mighty cargo
#

Can anyone help me with this? I've been trying to get 3rd person to only work when in vehicles, but cant seem to find a working script. I've tried searching it in google but nothing has popped up thusfar.

fair drum
#

if you know how to script you can use cameraView and switchCamera to make something.

hallow mortar
#

@mighty cargo an engine difficulty setting for this is being added soon. It's currently on dev branch.

mighty cargo
#

@hallow mortar Do we know when it would come out on official branch?

hallow mortar
#

Most likely whenever the next update is. I would expect within the next month or two since they'll want to implement the winners from that contest thing, but nothing has been announced.

mighty cargo
#

Ok

tough abyss
#

im curious how to find out what display ID the camera has, if once created. (for cutscene purposes). findDisplayยดs commands dont get me further;-=(

winter rose
#

โ€ฆsorry? cameras don't have displaysโ€ฆ?

#

you mean, the currently open displays?

faint oasis
#

hi, i have a question ? the "setDriveOnPath" command work only for vehicle or it can work for plane and unit ?

winter rose
#

units, I don't believe so, maybe planes - try and thou shalt see
if you have new data, I'll add that to the wiki

faint oasis
#

@winter rose ok thx btw i want to create a script who change the camera vision of the player so how can i do that ? because i want to create a script who can change the normal vision to the thermal vision or night vision same on an LVN.

winter rose
#

(NVG* ^^)
if it is for the player, you can only add him an NVG/thermal and use it

if it is a cinematic camera, you can use e.g camUseNVG or setCamUseTI

faint oasis
#

yes but i want to use nvg or thermal without a nvg

#

i have found that : player action ["nvGoggles", player]; and it work if you don't have "NVG"

#

but how to enable the "TI" ?

winter rose
#

itโ€ฆ works? surprising

#

add a second line maybe, I really don't know

faint oasis
#

@winter rose no it doesn't work

winter rose
#

i have found that : player action ["nvGoggles", player]; and it work if you don't have "NVG"
so this ^ work or doesn't? @faint oasis

faint oasis
#

yes that's work but if i add 2 lines i can't get the thermal vision he stay on NVG but for NVG it work

winter rose
#

maybe "tiGoggles", but I don't guarantee anything ๐Ÿ˜…

faint oasis
#

@winter rose very good but i have already tested and it doesn't work xD