#arma3_scripting

1 messages · Page 605 of 1

still forum
#

Correct, but atleast thats a incentive for them to come out and ask, and be educated

#

instead just sticking with the first thing they see working, and turning that into a SQF tutorial or publishing it for others to learn from

hallow mortar
#

If your scripting language deliberately tries to trip people up so they have to go looking for help, that's a bad design philosophy IMO. But perhaps we have different perspectives.

still forum
#

yeah thats what I was told too when the == fix was made and I complained about it

spark turret
#

Well sqf is awful is almost every aspect (except the commumity docu) so theres that

still forum
#

the syntax itself is beautifully easy, the implemented commands ontop of it are not

#

And the performance 👀
but I have some fixes on that front

exotic flax
#

it just doesn't follow the standards which any other language has... which makes it a pain for new and old devs

#

but what to expect from a 20 year old language...

spark turret
#

Btw is arma physics using double to store data? I have come across unitys float point problem where the floats that store the physx values only allow for a 6km radius with precise values and then they loose precision => things wobble.
Was wondering how arma avoids that

still forum
spark turret
#

Oh cool they also (maybe) do origin shift! I ll have to look into that, especially how that works in MP

still forum
#

As I said, I don't know if Arma uses that for physx

#

Arma in general atleast doesn't

#

Don't know why unity is 6km.. floating point is exact to the cm till about 260km

#

and to the mm till about 16km

spark turret
#

Yeah but you can notice wobble at around 10km on stuff like computer screens and small details. So 6 is to play it safe

still forum
#

yeah sub-mm wobble, but things in Arma don't need to be that exact

torpid quartz
#

Hey pox gave me this code yesterday to store points in time

startTime = time;
endTime = time - startTime;

how would i get "endtime" to print in something like this?

titleText ["<t color='#FFFFFF' size='2'>endtime would go here</t><br/>", "PLAIN", 5, true, true];
still forum
#

titleText [format["<t color='#FFFFFF' size='2'>%1</t><br/>", endTime], "PLAIN", 5, true, true];

warm hedge
#
titleText ["<t color='#FFFFFF' size='2'>" + str endTime + "</t><br/>", "PLAIN", 5, true, true];```Or maybe like this. Don't know which is wiser in performance terms
torpid quartz
#

I was using just this, let me test those real quick

hint str endtime;

still forum
#

mine better perf

torpid quartz
#

yeah they both work fine, thanks for the help.

fair drum
#

so I have this:

if (local this) then { [this, "SIT2", "NONE"] call BIS_fnc_ambientAnim; };

on a single blufor's init section in the editor. BUT,

opfor's units are doing the sit as well and it doesn't make sense. green units and civs are not doing the sit thankfully. could "this" be messing up?

#

and blufor's unit doesnt do the sit

#

not sure why its doing this...

winter rose
#

you have another issue somewhere else @fair drum.

fair drum
#

yeah it looks like I do... cause i removed the line and its doing it still for those units...

torpid quartz
#

I'm moving an object using setPos, however the object is getting moved above a slope (since it's spawning ontop of a building, otherwise i'd use a random start with a marker), resulting in it spawning tilted each time, like tilted 35 degrees up. I'm running OBJ2 setVectorDir [0,0,0]; on another trigger 3 seconds afterwards but it doesn't seem to be doing anything ( assume the object is rotating to match the slope it's on top of so 0,0,0 won't effect it). any ideas on how to get this object to level out?

winter rose
#

@torpid quartz obj2 setDir getDir obj2

#

or obj2 setVectorUp [0,0,1];

torpid quartz
#

I should run this after it get's moved right? I was triying _obj setVectorUp [0,0,1]; and no dice, i'll give the first one a go.

EDIT: having another object somewhere else and then referencing it with obj2 setDir getDir obj2 works.

So OBJ2 setDir getDir refOBJ2

digital hollow
#

In Zeus, with a single unit in its own group, it's possible to select either the unit or the group, shown by different highlighting in the Edit entities list.
However, curatorSelected returns the same [[_unit], [_group],[],[]] in both cases. Is there something else that contains the "highlighted entity"?
Or the mouse-over entity

carmine sand
#

is this the right way to let the init eventhandler to execute? since i did the pbo with the pboproject the script isnt working anymore. init = "(_this select 0) execVM '\tg_defense\nod\scripts\LaserAutoEmerge.sqf'";

hallow mortar
#

The init eventHandler can't be used in scripts and is only for use in an object's config

carmine sand
#

yes its in the config eventhandlers init

hallow mortar
#

ExecVM sometimes requires you to store the script handle (i.e. _handle = [] execVM ...). I don't know if the init EH is one of those places.

#

For questions about config things, though, you're probably better off in #arma3_config

still forum
#

No you don't need to store the handle. That has absolutely nothing to do with execVM

#

I'd say check the path, check RPT, add diag_log and just figure out where your problem is @carmine sand

tough abyss
#

Hi guys I have a script to capture hideouts. I have 3 hideouts in total. I want to make a weapon shop which you can only access if you have captured the 3rd hideout. Not the first or second. The third. Here is the weapon shop array format.

/*
*    ARRAY FORMAT:
*        0: STRING (Classname): Item Classname
*        1: STRING (Description): Description of item
*        2: SCALAR (Buy price): Cost of item
*        3: STRING (Conditions): Same as above conditions string
*        4: STRING (Nickname): Nickname that will appear purely in the shop dialog
*/```
I think I will have to make it a condition. SO the condition is to have captured the 3rd hideout but Im really not sure how to do so
Here’s the script https://sqfbin.com/soxoteqijuzakitujuso
#

Just so everyone knows I’m just tryna have fun on Altis life not modded haha

exotic flax
#

The variables of the hideouts are gang_flag_1, gang_flag_2 and gang_flag_3, however they are never used other than checking the distance (which seems to be unrelated to the object in _hideout). This makes stuff a lot harder, especially for knowing which one is which from the outside.

#

Although you should be able to simply check

(gang_flag_3 getVariable ["gangOwner", grpNull]) isEqualTo (group player)
#

In short; the script is terrible (what would you expect from a L*fe mission/mod), but the solution is simple

tough abyss
#

Haha that’s true most life scripts are garbage. Ok so is the solution (gang_flag_3 getVariable [“gangOwner”, grpNu]) isEqualTo (group player)? So if I put that in the condition it should work right?

exotic flax
#

with grpNull yes

#

unless there is some other magic happening

tough abyss
#

My bad I misspelled. Anyways thank you so much Grezvany13 I appreciate it. I will test this tomorrow it’s getting a little late for me 02:18AM haha. Thanks man!

fair drum
#

is it easy to add background noise like how namalsk has the kids playing the background? will it be dependent on player's music volume?

exotic flax
#

You can use createSoundSource to place some sounds in specific areas (volume is defined in config) which loops till killed.
However all audio can still be controlled by the player through volume settings

fair drum
#

say I have playable units in a plane for a 20 man MP team. the plane is also controlled by a playable unit. they land, they get out. what would I do to get the non selected playable units out of the vehicle in case of a JIP?

#

hopefully i got my idea across

exotic flax
#

the group leader can simply order the AI to get out of the vehicle

#

or you can have a script which kicks out all players when the pilot gets out

fair drum
#

no, these units would not "exist" if not selected by a player is what I'm getting at

#

so 20 open slots, with 20 units placed in the plane. 12 players show up with 4 late coming

#

those 4 late coming, say the plane gets destroyed, would spawn where if that entity is gone

exotic flax
#

Do you use Respawn Templates?
Because in that case simply remove the respawn point from the vehicle and place a new one elsewhere

fair drum
#

I use some respawn templates, but I do not use loadout templates. I rely on using what the unit has when placed in the editor and modified by me, then "save loadout" on death is selected to keep them with that loadout

#

there will be a respawn position placed on the ground that will unlock when they land

#

there is no respawn position before that landing. they just have their initial spawn from that "unit" placement

exotic flax
#

I would have respawn positions always enabled (so also on join) and have the vehicle as the only spawn location.
Because otherwise JIP players can't spawn at all it the units are dead / not available

#

and if you only enable "MenuPosition" than they can't do anything else than selecting a position (so no role/loadouts)

#

Although, and I'm not sure if you already tested it, it might be possible that the players can spawn normally even when the vehicle is destroyed. Either at the location of the (destroyed) plane, or at [0,0,0] as a default location

fair drum
#

I have not, I'm just in theory mode atm while I work out an idea to see if its viable at my level of coding

digital hollow
#

Is there anything for checking whether a point is in a boundingbox?

warm hedge
#

inArea?

fair drum
#

any way I can take the cfgRespawnInventory and not have to copy paste things multiple times? or is it pretty much required?

        items[] = {
            "ACE_EarPlugs",
            "ACE_morphine",
            "ACE_epinephrine",
            "ACE_tourniquet",
            "ACE_EntrenchingTool",
            "ACE_MapTools",
            "Laserbatteries"
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_fieldDressing",
            "ACE_elasticBandage",
            "ACE_elasticBandage",
            "ACE_elasticBandage",
            "ACE_packingBandage",
            "ACE_packingBandage",
            "ACE_packingBandage",
            "ACE_quikclot",
            "ACE_quikclot"
fair drum
#

also, is there a way to define which items go in which containers using CfgRespawnInventory?

spark turret
#

If you want to get a list of items used by a unit or multiple units, the ace framework gives a tiny script for that.

#

The script gets every item used by the units, intended to create limited ace arsenals

fair drum
#

well i'm looking to use the MenuInventory template because every time I enable arsenal, even if its limited, players take FOREVER and they do something stupid with it. so I just don't do arsenal at all.

tough abyss
#

Is there a script which will have airplanes flying through the map on Altis ? Or can I do something like that on my mission?

winter rose
#

you want ambient planes?

#

there is BIS_fnc_ambientPlanes iirc @tough abyss

tough abyss
#

Damn that can only be used in single player according to the BI wiki

winter rose
#

Ah yes (I rewrote it recently)

#

you can either place planes and give them random waypoints, or script this yes

#

You can open BIS_fnc_ambientPlanes and get inspiration/fix it for MP

jaunty zephyr
#

interesting. i've got a PFH running that gives me the distance of a unit to its next waypoint, and for units on foot (!) the distance does not update on each frame, but only every idk 3-6 frames, resulting in a resolution of 20cm to 60cm tinfoil

#

why is that

#

aah... does it only know the position where the current animation started ?

winter rose
#

PFH… Public Fariable Handler?

jaunty zephyr
#

:P per frame handler

winter rose
#

@jaunty zephyr getPos or getPosVisual?

jaunty zephyr
#

_unit distance _waypointPosition ... i guess that would be getPos on the unit? 🤔

west grove
#

dang it, i'm using (["GUI", "BCG_RGB"] call BIS_fnc_displayColorGet) call BIS_fnc_colorRGBtoHTML to get the current menu color, but now i found out that the color used in hints to highlight keys, etc. is much brighter ... but i can't figure out why exactly it is brighter

winter rose
#

@jaunty zephyr getPosATLVisual distance _waypointATLposition

jaunty zephyr
#

@winter rose aah you're right. visual updates every frame.

#

man that feels so wrong on a basic level

winter rose
#

of course I'm right!

#

But yeah easily forgotten ^^

#

(that I am right, and the visual thing)

tough abyss
#

Ok thanks Lou

spark turret
#

if i run addMissionEventhandler from an init, it will get run on each client for every player joining right?

#

whats the best way to avoid adding multiple eh on each JIP etc. RN i just set a variable upon EH creation and check that before adding.

coarse sedge
#

hey i am very new to this and was wondering if anyone could help me out with spawning ai groups into player groups, at the moment i have (_ ai [getMarkerPos "aispawn", WEST, ["className","className"],[],[],[],[],[],180] call BIS_fnc_spawnGroup, [ai] join (group player); ) and it spawns ai to the map and places one into my group but not all how do i get all ai that spawn from the (call BIS_fnc_spawnGroup) command to join a player group any help would be much appreciated.

spark turret
#

@coarse sedge the bis_fnc_spawnGroup returns the created group. join uses units. so you have to make each unit from the group join the playergroup

#

use the command "units", and "foreach".

hallow mortar
#

@spark turret use if (isServer) then { or initServer.sqf

#

Also you don't need forEach in that join problem since join accepts an array

spark turret
#

ah true

hallow mortar
#

(units _ai) join (group player)

spark turret
#

isServer doesnt solve the problem. the EH has to be added locally, but only once

hallow mortar
#

initPlayerLocal.sqf, or remoteExec with JIP true from a server-only location

coarse sedge
#

@hallow mortar @spark turret thank you very much for the help got it

hallow mortar
#

if (isServer) then { [...] remoteExec ["addMissionEventHandler",0,true]};

spark turret
#

that kinda cancels itself 😄

#

if on server, run on all clients?

#

and init is re-run on JIP so it would run again, also on the server

hallow mortar
#

@spark turret no, if on server the server tells the other clients to run it. It is a crucial difference since init is re-run by the JIP client, not by every client

#

Putting something server-only in init.sqf is about the same as putting something in initServer.sqf. you could do that if you prefer.

spark turret
#

ah cool

#

but then the JIP player doesnt get the EH

hallow mortar
#

They do, since the remoteExec includes the JIP true flag - the server sends the command to JIP clients as well

#

An alternative approach, depending on the EH you want to use, would be to add the EH only on the server, and have its effects broadcast with remoteExec

tough abyss
#
 this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}] 
``` Any ideas as to why this simple EH not working in the init field of any unit?
winter rose
#

setVehicleAmmoDef maybe

#

@tough abyss ↑

tough abyss
#

Thanks, I realized I was using the wrong command. Needed setAmmo not setVehicleAmmo.

#

From what I've gathered though the setVehicleAmmo command is supposed to work for infantry units as well. So really not sure what's going on here. ¯_(ツ)_/¯

#

Ah okay it's not working for the weapon the unit has. So it's a mod issue.

#

Works fine with vanilla weapons.

winter rose
#

try to always mention mods on scripting questions in the future @tough abyss

spark turret
#

is there an eventhandler for spanwing zeus units?

spark turret
#

cooll thx

tough abyss
#

how did i mess up this mission param
arsenalrestricteditems[] = {"rhs_weapon_ak104"};
says im missing a ; But there is one there. Looked at the wiki for the basic understanding of how its suppose to look, the only thing different is a class

exotic flax
#

can you show the full description.ext?

#

because it's most likely an error somewhere else

tough abyss
#

yes

#

wait

#

to be clear

#

Thats suppose to go into an .ext and not an sqf?

exotic flax
#

it MUST have that name with correct extension, otherwise it won't be used at all

#

technically it's a config file, not a script

tough abyss
#

the error cleared up when I changed it to ext but now it just dosnt work

#

I may be going about what im doing the wrong way in general, not sure

exotic flax
#

so this is your complete description.ext file?

tough abyss
#

Yes

#

its for warlords, perhaps it has some other way of dealing with arsenal stuff? I do recall seeing something like BIS_WL_MortarBackpacks restricting backpacks specifically. Maybe there is something similar for the arsenal weapons

exotic flax
#

I only know about WLAIRequisitonBlacklist, but that's for buying units/vehicles

#

btw... what happens when you add on top of that file:

author         = "YOUR NAME";
onLoadName     = "MISSION NAME";
onLoadMission  = "MISSION DESCRIPTION";

class Header
{
    gameType = "Warlords";    // Game type
    minPlayers =  1;    // minimum number of players the mission supports
    maxPlayers = 10;    // maximum number of players the mission supports
};
tough abyss
#

shows in the loading screen the your name mission name etc
regarding the weapon nothing

exotic flax
#

but it still doesn't load?

tough abyss
#

you mean the mission? yes it loads

#

before and after that

#

thonk this stuff complicated

exotic flax
#

well, to limit stuff in regular arsenal you need to arsenalRestrictedItems[]

#

no idea how WL works

tough abyss
#

I guess back to digging through the a3 files again 😦

#

hopefully my answer will lie there, although I doubt it. as I cant imagine weapons disabled on official servers

#

mine dispensers are not enabled though, so maybe that will help... somehow

#
    BIS_fnc_arsenal_data set [3, BIS_WL_factionAppropriateUniforms];
    BIS_fnc_arsenal_data set [5, (BIS_fnc_arsenal_data select 5) - BIS_WL_mortarBackpacks];
    BIS_fnc_arsenal_data set [23, (BIS_fnc_arsenal_data select 23) - ["APERSMineDispenser_Mag"]];
    BIS_WL_arsenalSetupDone = TRUE;
};```
this may be what im looking for... l
proven heath
#

would this be the proper channel to discuss mod scripting or?

exotic flax
#

According to channel description yes.

tough abyss
#

Grez would you happen to have any idea what the value 23 means

proven heath
#

wonderful! anyone have experience with adding items to the ace medical menu?
i made ibuprophen/tylenol and everything works, except it wont show in the medical menu itself

#

and if you mean the
[23,
is usually the number of that item, so to me it looks like 23 apers mines mags in the arsenal for use

#

but im also jumping in late and could be totally wrong

exotic flax
#

BIS_fnc_arsenal_data is an array (not function afaik) containing all items in the arsenal

proven heath
#

ahhhhhhhhhhhh

exotic flax
#

no.23 is just the 23th value in that array

proven heath
#

gotcha gotcha, ill read up on arrays and try to help, if you run into an ace dev mind sending them my way?

spark turret
#

hey ho, someone got a quick tip on how to disable all thermal visions in am mission?

#

it often is too overpowered

tough abyss
#

I wonder what happened to the other 20 values then. either way ill try adding a 24th one and see what happens

exotic flax
#

@tough abyss all "numbers" are used and mean different items... eg pistols, rifles, launchers, ammo, headgear, etc

tough abyss
#

🤔 so would I need to go through the grand config viewer to find their assigned number?

spark turret
#

@tough abyss can you edge out yur problem again for me?

exotic flax
spark turret
#

cool Grez, i will try that out

tough abyss
#

@spark turret trying to disable weapons through warlords arsenal.

#

it seems like I need to find all the numbers of the weapons I want to remove to make this script work.

spark turret
#

certain weapon types?

#

or certain weapons`?

tough abyss
#

some specific weapons and launchers

spark turret
#

ah okay

#

not an ace arsenal?

tough abyss
#

nope

exotic flax
#

ok, this is the default array for Arsenal:

[
   [primaryweapon _center call bis_fnc_baseWeapon], // IDC_RSCDISPLAYARSENAL_TAB_PRIMARYWEAPON
   [secondaryweapon _center call bis_fnc_baseWeapon], // IDC_RSCDISPLAYARSENAL_TAB_SECONDARYWEAPON
   [handgunweapon _center call bis_fnc_baseWeapon], // IDC_RSCDISPLAYARSENAL_TAB_HANDGUN
   [uniform _center], // IDC_RSCDISPLAYARSENAL_TAB_UNIFORM
   [vest _center], // IDC_RSCDISPLAYARSENAL_TAB_VEST
   [backpack _center], // IDC_RSCDISPLAYARSENAL_TAB_BACKPACK
   [headgear _center], // IDC_RSCDISPLAYARSENAL_TAB_HEADGEAR
   [goggles _center], // IDC_RSCDISPLAYARSENAL_TAB_GOGGLES
   [hmd _center], // IDC_RSCDISPLAYARSENAL_TAB_NVGS
   [binocular _center], // IDC_RSCDISPLAYARSENAL_TAB_BINOCULARS
   [], // IDC_RSCDISPLAYARSENAL_TAB_MAP
   [], // IDC_RSCDISPLAYARSENAL_TAB_GPS
   [], // IDC_RSCDISPLAYARSENAL_TAB_RADIO
   [], // IDC_RSCDISPLAYARSENAL_TAB_COMPASS
   [], // IDC_RSCDISPLAYARSENAL_TAB_WATCH
   [face _center], // IDC_RSCDISPLAYARSENAL_TAB_FACE
   [speaker _center], // IDC_RSCDISPLAYARSENAL_TAB_VOICE
   [_center call _fnc_getUnitInsignia], // IDC_RSCDISPLAYARSENAL_TAB_INSIGNIA
   [], // IDC_RSCDISPLAYARSENAL_TAB_ITEMOPTIC
   [], // IDC_RSCDISPLAYARSENAL_TAB_ITEMACC
   [], // IDC_RSCDISPLAYARSENAL_TAB_ITEMMUZZLE
   [], // IDC_RSCDISPLAYARSENAL_TAB_ITEMBIPOD
   [], // IDC_RSCDISPLAYARSENAL_TAB_CARGOMAG
   [], // IDC_RSCDISPLAYARSENAL_TAB_CARGOMAGALL
   [], // IDC_RSCDISPLAYARSENAL_TAB_CARGOTHROW
   [], // IDC_RSCDISPLAYARSENAL_TAB_CARGOPUT
   [] // IDC_RSCDISPLAYARSENAL_TAB_CARGOMISC
];
#

so 0 = primary, 1 = secondary, 3 = pistol, etc.

tough abyss
#

ah so I misunderstood it. ill change it to 0 see what happens

proven heath
#

i had been going through that to make the item itself @exotic flax but im having a hard time finding where in all those files it includes allowed items for the menu

exotic flax
#

all classes in class ACE_Medical_Treatment_Actions {} are actions processed by ACE Medical, even when you have that class in your own mod

proven heath
#

hmmmmmmmmmmmmm i need to check my spelling then cus it should be patching into that class

#
//cfg vehicles
class IbuprophenItem: Item_Base_F 
    {
        scope = 2;
        scopeCurator = 2;
        displayName = "Ibuprophen";
        author = "Mark";
        vehicleClass = "Items";
        class TransportItems 
        {
            item_xx(Ibuprophen,1);
        };
    };
//cfgweapons
class Ibuprophen: ACE_ItemCore
    {
        scope = 2;
        author = "Mark";
        displayName = "Ibuprophen";
        picture = "\z\ace\addons\medical_treatment\ui\morphine_ca.paa";
        model = "\z\ace\addons\medical_treatment\data\morphine.p3d";
        descriptionShort = "Drink some water and Rest";
        descriptionUse = "use instead of morphine";
        class ItemInfo: CBA_MiscItem_ItemInfo
        {
            mass = 0.1;
        };
    };
still forum
#

MEU_Ibuprophen

Ibuprophen

One is not like the other

proven heath
#

oh lmao, dropped that, dont worry thats fixed

#

was gonna name it after a unit, decided not to, have run it with that still matching an it still doesnt show up in the med menu

still forum
#

everything should have a tag/prefix though

proven heath
#

hm ill have to think of a custom one for myself

#
#define _ARMA_

class ACE_medical_treatment_actions
{
    class Ibuprophen: FieldDressing
    {
        displayName = "Ibuprophen";
        displayNameProgress = "$STR_ace_medical_treatment_Injecting_Morphine";
        icon = "\z\ace\addons\medical_gui\ui\auto_injector.paa";
        allowedSelections[] = {"LeftArm","RightArm","LeftLeg","RightLeg"};
        category = "medication";
        items[] = {"Ibuprophen"};
        condition = "";
        treatmentTime = 3;
        callbackSuccess = "ace_medical_treatment_fnc_medication";
        animationMedic = "AinvPknlMstpSnonWnonDnon_medic1";
        sounds[] = {{"z\ace\addons\medical_treatment\sounds\Inject.ogg",1,1,50}};
        litter[] = {{"ACE_MedicalLitter_morphine"}};
    };
    class Medication
    {
        painReduce = 0;
        hrIncreaseLow[] = {0,0};
        hrIncreaseNormal[] = {0,0};
        hrIncreaseHigh[] = {0,0};
        timeInSystem = 120;
        timeTillMaxEffect = 30;
        maxDose = 4;
        onOverDose = "";
        viscosityChange = 0;
        class Ibuprophen
        {
            painReduce = 0.4;
            hrIncreaseLow[] = {0};
            hrIncreaseNormal[] = {0};
            hrIncreaseHigh[] = {0};
            timeInSystem = 3000;
            timeTillMaxEffect = 45;
            maxDose = 12;
            incompatibleMedication[] = {};
            viscosityChange = -5;
        };
    };
};
spark turret
#

you can register your own tag

proven heath
#

and theres my custom treatments hpp

#

i tried to have it use the same definitions ace morph for most everything so its not a point of failure

#

except for the actual effect and time

spark turret
#

at least there was some kind of arma website for regisitering your own tag

#

like, 2 years ago

exotic flax
#

that already died during Arma 2...

spark turret
#

oh lol

still forum
#

class Medication
that class isn't a class inside there

tough abyss
#

still not working, no error

    BIS_fnc_arsenal_data set [3, BIS_WL_factionAppropriateUniforms];
    BIS_fnc_arsenal_data set [5, (BIS_fnc_arsenal_data select 5) - BIS_WL_mortarBackpacks];
    BIS_fnc_arsenal_data set [0, (BIS_fnc_arsenal_data select 0) - ["rhs_weapon_ak104"]];
    BIS_fnc_arsenal_data set [23, (BIS_fnc_arsenal_data select 23) - ["APERSMineDispenser_Mag"]];
    BIS_WL_arsenalSetupDone = TRUE;```
    this looks correct
    
    maybe theres something further  in the files im missing here
proven heath
#

ahhhh i see what you mean, i dont know why i thought thatd work combining those classes

#

ok so what needs to go in ACE_medical_treatment_actions
cus its looking like what i have there actually belongs in
class GVAR

#

or does that all need to be contained?

exotic flax
#

GVAR is a macro (aka function which prints out the full name)

#

@tough abyss where did you add that script? and did you define BIS_WL_arsenalEnabled, BIS_fnc_arsenal_data and BIS_WL_arsenalSetupDone

proven heath
#

ok i know little to nothing about macros

#

_xx is the only macro i kinda am able to use

tough abyss
#

@exotic flax to fn_wlClientinit.sqf and no I did not, ill do that now IG

#

and I hope im not completely overwriting files with this, just the parts I edit

#

defining that completely broke the mission lol

#

all sectors but one disappeared

#

oh 💩 i just noticed something

#

APERSMineDispenser_Mag

#

mag

#

Not the actual classname for the mine dispenser

exotic flax
#

ok try this:

_null = ["Preload"] call BIS_fnc_arsenal;
BIS_fnc_arsenal_data set [0, (BIS_fnc_arsenal_data  select 0) - ["rhs_weapon_ak104"]];
#

and make sure it runs on init

#

should technically work for any mission with Arsenal

tough abyss
#

no luck.

#

Still find it interesting how for the apers mine dispenser classname isnt actually in that, but only the magazine. and that BIS_WLBackpacks is a container of backpacks

proven heath
#

i fixed all the pointed out issues and still nothing, back to digging, if anyones bored and finds some kinda "allowed medications" file or soemthing of the like lemme know lol

exotic flax
#

looking at how KAM is handling it it's exactly the same as I described

proven heath
#

this is my new treatment file

#define _ARMA_

class ACE_Medical_Treatment_Actions
{
    class MEU_Ibuprophen: FieldDressing
    {
        displayName = "Ibuprophen";
        displayNameProgress = "$STR_ace_medical_treatment_Injecting_Morphine";
        icon = "\z\ace\addons\medical_gui\ui\auto_injector.paa";
        allowedSelections[] = {"LeftArm","RightArm","LeftLeg","RightLeg"};
        category = "medication";
        items[] = {"MEU_Ibuprophen"};
        condition = "";
        treatmentTime = 3;
        callbackSuccess = "ace_medical_treatment_fnc_medication";
        animationMedic = "AinvPknlMstpSnonWnonDnon_medic1";
        sounds[] = {{"z\ace\addons\medical_treatment\sounds\Inject.ogg",1,1,50}};
        litter[] = {{"ACE_MedicalLitter_morphine"}};
    };
    
};
class ACE_Medical_Treatment
{
    class Medication
    {
       painReduce = 0;
       hrIncreaseLow[] = {0,0};
       hrIncreaseNormal[] = {0,0};
       hrIncreaseHigh[] = {0,0};
       timeInSystem = 120;
        timeTillMaxEffect = 30;
        maxDose = 4;
       onOverDose = "";
       viscosityChange = 0;
        class MEU_Ibuprophen
        {
            painReduce = 0.4;
            hrIncreaseLow[] = {0};
            hrIncreaseNormal[] = {0};
            hrIncreaseHigh[] = {0};
            timeInSystem = 3000;
            timeTillMaxEffect = 45;
            maxDose = 12;
            incompatibleMedication[] = {};
            viscosityChange = -5;
        };
    };
};
#

return of the prefixs

#

could i be missing imports

still forum
#

oh

#

yeah

#

FieldDressing one

proven heath
#

ooooooooooooooooooo yea thanks for catching that

#

should i import these ace classes as well or will it patch as long as it loads last?

exotic flax
#

add class FieldDressing; to make sure it's available (class inheritance)
and yes, you need to make sure ACE is in your requiredAddons array

proven heath
#

gotcha, time to see if that does it

proven heath
#

still nope, gonna try inheriting off morphine more directrly

proven heath
#

i was tryna make something funny now im down a rabbit hole

tough abyss
#

@exotic flax i see the issue now, I tried what you sent again, and i noticed that it seems with RHS when I place the weapon in eden on the floor, it has a different classname than in the arsenal

#

in arsenal its rhs_weap_ak104
in eden -> objects its rhs_weapon_ak104

#

sad days I guess, no more copying and pasting from find in asset browser

tiny wadi
#

Any idea how eden editor draws solid planes on the ground when previewing an objects bounding box? Is that all hard-coded or can that be replicated via script

hallow mortar
fair drum
#

nvm I'm dumb

finite jackal
fair drum
#

yes it ran on every client. and I just looked at the command and it says to run it globally, not locally on every client

#

so i would want remoteExec ["globalChat",2];

#

because remoteExec ["globalChat",0]; would do a message for the server and a repeat message for every client

#

i think...

#

well no... 2 wouldn't work either cause then it stays only on server... idk... the combos i've tried either produce duplicates of messages, or none at all

astral dawn
#

remoteexec 0 will execute it on every computer

#

on server and all clients

#

globalchat has local effectso that's the way to run it

#

but I don't know, I supposed that perhaps the event which triggered the remoteExec got executed on each client itself already

tiny wadi
#

The bottom plane that is highlighted

fair drum
#

that could have been it Sparker. I had a single sqf file like

blah blah blah

params ["_dialog"];

switch _dialog do {

    case "truckFound" : {

        hq say2D ["truckfound1",20000,1];
        [hq,"There must have been some sort of battle here. Look, 5.56mm magazines on the ground. NATO?"] remoteExec ["globalchat",-2];
        sleep 8;
        hq say2D ["truckfound2",20000,1];
        [hq,"Look, there is some sort of fire off in the distance to the North East... Let's check it out."] remoteExec ["globalChat",-2];
    };
    
    case "insurgentFound" : {

        hq say2D ["insurgentfound",20000,1];
        [hq,"ChDKZ here? I thought we got rid of those guys years ago!"] remoteExec ["globalchat",-2];
    };

blah blah more

and was calling it in the editor triggers so I guess it was run locally on everyone as well... Guess I need to think about that as well

hallow mortar
#

Editor triggers have a useful "server only" checkbox in their attributes

astral dawn
#

Never really worked with triggers, sorry can't help. I prefer to write pure SQF blobcloseenjoy blobcloseenjoy blobcloseenjoy

fair drum
#

i wish i could do that but currently I need a little bit visual as well

hallow mortar
#

What's up with making a unit play a voice sound that can be heard 20km away? Also once this is server-only you'll need to remoteExec that, say2D has local effect

fair drum
#

I wanted to make sure everyone on the map could hear them and I didn't want them bound to a specific unit. They were in vehicles and I know say3d can be wonky inside of vehicles so I just used 2D instead

hallow mortar
#

say2D is still subject to distance-based and environmental attenuation. Try using playSound with the parameter to make it sound like a radio message.

fair drum
#

mk noted. I found out also that I had to use globalChat because sideRadio/sideChat text gets muted by TFAR.

tough abyss
#

Any really experienced modders/scripters for hire?

#

Will need mods such as air raid siren in specific area and bombs being dropped there for 5 minutes every hour

winter rose
tough abyss
#

Would it be possible for AI to be attracted towards gunfire
start moving to gunfire slowly and cautiously

winter rose
#

firedNear EH for distances < 70m
Otherwise, Fired EH on everyone and move a specific group there

tough abyss
#

How does selecting a faction work? Do you just select it before being deployed?

spark turret
#

@tough abyss you can place stuff in the editor and copy paste their classnames from there.
(Get yourself eden enhanced)
You can select all the stuff, right click and theres an option to log the class names. Really helpful

tough abyss
#

@spark turret thanks but my issue rn comes from one of the classnames not existing in eden but in RHS configs

#

rhs_weap_ak74mr_1p87 is in the configs but for one of the infantry but not actually in arsenal/editor

#

I want to know how they took the optic and attached it to the weapon in the config(the optic used is at the end of that classname)

#

i didnt clarify that before I will now in the post

coarse sedge
#

hey can anyone tell me how to set the direction when using ("className" createVehicle [0,0,0] ) ???

winter rose
#

setDir?

#

@coarse sedge

"className" createVehicle [0,0,0]; // returns a vehicle

("className" createVehicle [0,0,0]) setDir random 360; // does the trick
coarse sedge
#

thanks heaps im new and having trouble finding what im looking for sometimes

winter rose
#

hi new, I'm dad!
the channel is here for help, anytime 😉

torpid quartz
#

this addAction ["Add Medic Trait", {player setUnitTrait ["Medic",true]}];

this addAction ["Remove Medic Trait", {player setUnitTrait ["Medic",false]}];

Not able to use arma at the moment but does this look like it would work?

winter rose
#

yep

tough abyss
#

I'm running into a problem where script running from initPlayerLocal.sqf is not starting fast enough in a local server environment.

[] spawn
{
        cutText ["", "BLACK FADED", 999];
            0.1 fadeSound 0; 
};

When the mission leaves map screen the post processing effects do not start for 1-2 seconds after being loaded in. Will I* have to execute this via the init.sqf instead to hit the scheduler faster or?

#

Running it from init.sqf works fine. Not gonna work for JIP but doesn't matter in my case.

winter rose
#

init.sqf does work for JIP @tough abyss

#

(as it is run for everyone)

spark turret
#

im running multiple "event handlers" parallel to eachother, is that the correct way to do it?:

    _CompleteTask = {
        waitUntil {    //wait until player is in plane
            sleep 1;
            _goOn = (vehicle _player == _plane);
            _goOn
        };
        _taskname = _this select 0;
        _player = _this select 1;
        [_taskname,"SUCCEEDED"] call BIS_fnc_taskSetState; //then set task to completed
    };
    [_taskname,_player] call _CompleteTask;
winter rose
#

no xD

spark turret
#

😦 but it works

#

enlighten me pls

winter rose
#

this ^ is not an Event Handler? 🤔

spark turret
#

yeah i know i didnt know what else to call it

#

it works kind of like an event handler. wait until something specific happens, then do this code

winter rose
#

isn't this simpler?

waitUntil { sleep 1; vehicle _player == _plane };
[_taskname,"SUCCEEDED"] call BIS_fnc_taskSetState;
spark turret
#

yeah but im running it for 4 players that all have a task like that in one central script that handles all tasks

#

so i cant suspend the whole script to wait until the first guy got in the plane

#

and then tell the second guy to do the same

winter rose
#

yet this is what you are doing with call here

spark turret
#

its not running parallel?

winter rose
#

nope

spark turret
#

"waits for it to finish and return" ah whoop

#

better read the description. so whats the correct way?

winter rose
#

you want this task to complete only when everyone is boarded, correct?

spark turret
#

no, for each player when he boards, independent from the others

winter rose
#

how did you create each task then?

spark turret
#

a foreach loop


_planes = missionNamespace getVariable ["planes",[]];
_players = allPlayers;
hint "playertasks running";
{
    _plane = _planes select _foreachIndex;
    _player = _x;
    _taskName = "getIn" + str _foreachIndex;
    [_player, [_taskname], ["Get in the plane and take off", "Get in the plane", "airfield"], _plane ,"ASSIGNED", 0, true] call BIS_fnc_taskCreate;
    _CompleteTask = {
        waitUntil {    //wait until player is in plane
            sleep 1;
            _goOn = (vehicle _player == _plane);
            _goOn
        };
        _taskname = _this select 0;
        _player = _this select 1;
        [_taskname,"SUCCEEDED"] call BIS_fnc_taskSetState; //then set task to completed
    };
    [_taskname,_player] call _CompleteTask;
    
} foreach _players;

#

each player gets a task for himself to board his plane

winter rose
#

then use spawn _CompleteTask

#

but then the "take off" part is not correct /nitpick

spark turret
#

ah and thats paralell

#

i know

winter rose
#

scripting-wise yes, it's parallel

spark turret
#

cool, i knew i had done it in the past but i couldnt remeber which function

#

ill be back soon, getting into tasks

#

is it possible that waituntil just checks the condition first and then runs the code in it the first time?

winter rose
#

…wat?

spark turret
#

ah that wasnt the problem. i had an undefined var.

winter rose
#

waitUntil will run code in loop until it returns true

yes, code with -showScriptErrors - saves lives

coarse sedge
#

hey another one of my rookie questions, im trying to set height, direction and position of an object on spawn but i can only get the object to do 2 thing ie position & height ("className" createVehicle [0,0] setPosATL [0,0,0];) or position & direction ("className" createVehicle [0,0] setDir 360;) but im trying to do something like this ("className" createVehicle [0,0] setPosATL [0,0,0]; setDir 360;) were am i going wrong?

winter rose
#

@coarse sedge multiline will save you:

private _vehicle = "className" createVehicle [0,0];
_vehicle setPosATL [0,0,0];
_vehicle setDir 0;
#

bonus: more readable

coarse sedge
#

thankyou very much @winter rose

left pine
#

anyone remember the # commands that playback splash screen with little re-loading?

#

as i remember it feels like #squarsh or some like that

winter rose
#

I might need more precision than that though :3

plain patio
#

i wanna try and block AI from buying things like sector scans and teleports but i don't know how to do that? is anyone able to give me a hand? as i'm making a warlords mission

spark turret
#

does that work? ```sqf
_idx = round ((random 1) * count enemies); //get random index

there is no further description for random x
#

(i dont want to use select random bc i also delete that array pos)

winter rose
#

it does

spark turret
#

lol why in the world would nearTargets return random objects?

winter rose
#

like?

spark turret
#

like a toolbox

winter rose
#

them sneaky toolboxes 👀

spark turret
#

it seems to get all objects?

#

hm now that i think about it, maybe its not so bad to have objects also in there, and have them assigned a danger value

#

i want to test if _unit is defined, i used isNil, but it throws an error if its defined.

#

and isNull would throw an error if undefined right?

winter rose
#

show code

spark turret
#
    _enemies = _unit nearTargets 500;
    _enemies = _enemies select {(_unit knowsAbout (_x select 4)) > 0 && _x select 2 == EAST}; //get all opfor that the blufor unit knows knowsAbout


    if (count _enemies > 3) then {
        _revealX = random [3,5,10];    //number to reveal
        for "_i" from 1 to _revealX do {    //reveal a bunch of enemies by marking them with smoke
            if (count _enemies > 0) then {
                _idx = round ((random 1) * count _enemies);    //get random index
                _enemy = _enemies select _idx select 4;
                _enemies deleteAt _idx;
                if (!isNil _enemy) then {

                    _pos = getPos _enemy;
                    _smoker = "SmokeShellRed" createVehicle position _enemy;
                    hint str _enemy;
                    sleep 2;
                };

            };
        };
    };
#

i have the problem that sometimes _unit is undefined, idk why tho

winter rose
#

isNil takes a string or Code

#

_enemy = _enemies select _idx select 4;
use selectRandom

spark turret
#

then ill have to find the index by searching the array

winter rose
#

your issue is coming from _idx.

spark turret
#

yeah im quite sure you re right

#

oh i know. count enemies != index of last array position

winter rose
#

_idx = round ((random 1) * count _enemies);

_idx = floor random count _enemies;
spark turret
#

count enemies - 1 == index of last array pos

#

ah yeah or like that

west sand
#

Does anyone have experience with trying to get Keyframe Animations to work on a dedicated server / multiplayer environment? I've rigged up animation on a prop object, but the movement is delayed or the animation skips many of its frames.

I'm under the impression it's because the server is unable to sync with the spam of object position updates in an MP scenario, as the animation works fine in single player / local multiplayer preview.

waxen tendon
#

any documentation for functions.hpp?

#
class mission {
    tag = "ms";
    class scripts {
        file = "scripts\";
        class patrols {
            file = "scripts\patrols.sqf"
        };
        class laptop {
            file = "scripts\laptop.sqf";
            postInit = 1;
        };
    };
};```
laptop is postInit, it runs when on sp but not on mp, why would that be?
tough abyss
#

Hi guys I have this script here (https://sqfbin.com/soxoteqijuzakitujuso) and this is how it works. SO theres 3 hideouts and you can capture them and that works just fine. But I want to make it so once you have captured one hideout you get $2500 for each gang member and the money gets deposited into your bank account every 10 minutes. And if you have captured the other hideouts too you also receive the money for those hideouts.The cash variable is alcash and the bank money variable is albank. Would anyone have any suggestions on what I should do? Bear in mind I don't do any type of coding at all. Thank you!

surreal peak
#

@tough abyss whats the issue?

#

also might be worth sharing script_macro.hpp

tough abyss
#

Ok i will share it but the issue is I don't know how to make it so the players get paid $2500 for each capture point every ten minutes

spark turret
#

Make a counter for all gang members killed and use that to multiply the pay. Then have a loop add to the bank var with a 10min sleep timer

tough abyss
#

I do not understand a thing you just said 😂 but how do I go about doing such thing?

exotic flax
#

Sorry to say but...

Bear in mind I don't do any type of coding at all. Thank you!
Neither will we 😉

spark turret
#

Mhm maybe start with something simpler like spawning a car or sth to get into sqf

tough abyss
#

Ok I understand what you mean I just wanted to see if anyone had any scripts they were happy to share or something that was public and ready to use. Sorry if I sounded like i was making orders or smthng haha

spark turret
#

There usually are never any out if the box solution to arma, Especially if you want to modify another script

tough abyss
#

Ah ok. Thank you

spark turret
#

Is it a single player mission?

tough abyss
#

No it is a multiplayer mission

spark turret
#

Hm how does money get deposited into the bank account?

#

I need to see the bank script

#

Ah its in the hpp. Yeah i dont know anything about that. Sorry

tough abyss
#

its in sqf

#

Thats the deposit script if anyone wants to take a look

exotic flax
#

ok, I suggest to learn SQF first, because that function is used to display the UI, not to handle deposits

#

second; you might get more (and better) help when asking the devs of the framework

spark turret
#

(Or you look through the files until you find a line that deposits money and copy paste that in the hideout capture)
But yeah, without sqf knowledge you wont get far and wont habe fun

fair drum
#

So currently I have a respawn position module with 1 trigger on it to activate that respawn position. if I add another trigger, will that deactivate the respawn position module?

#

or would i use deleteMarker

spark turret
#

Hm idk about the triggerd but you can have multiple respawns, the player can then choose.
So it wont necessarily deactive the first one

fair drum
#

just looking to delete the first one after a trigger

spark turret
#

Ah, well just kill the marker. Dont think it ll do harm. Dont quote me tho

exotic flax
#

you'll need BIS_fnc_removeRespawnPosition

fair drum
#

copy that

exotic flax
#

because the marker itself is just a marker, nothing else

fair drum
#

does not work with respawn position module in editor

#

returns true with no change

#

nvm

spark turret
#

Hm but if i use the respawn_west markers, their respawn position updates as the marker is moved. I thought that indicates the respawn is directly tied to the marker and not stored somewhere else

fair drum
#

id had to be 0

#

since it was the first one that was created

#

guess the question is, how do I pull the id from various locations if I didn't know the order they were spawned in with the respawn position module

exotic flax
fair drum
#

what part would I change on that?

exotic flax
#

wherever/whenever you want to remove a respawn location

fair drum
#

throws an expression error at getvariable

exotic flax
#

_logic must be the variable you gave the module, so if you named it first_respawn, you need to have the line _logic = first_respawn; (without quotes)

fair drum
#

yup was the quotes that got me.

#

sounded like you wanted a string

fair drum
#

whats the command that creates a text box on the screen that you have to click okay to move past?

winter rose
#

hintC

fair drum
#

displays an attractive hint... oooh ( ͡° ͜ʖ ͡°)

winter rose
#

There is also a BIS_fnc that shows a confirmation window, but I don't know it off the top of my head though

exotic flax
#

BIS_fnc_guiMessage ?

winter rose
#

Thanks! @fair drum ^

exotic flax
#

well, assignedTarget is aL (local argument), so I assume it's the same for getAttackTarget

fair drum
#

better to use fnc_endmissionserver or just fnc_endmission and remote exec it?

#

for mp

winter rose
#

@fair drum endMissionServer remoteExecs endMission, so same difference ^^

fair drum
#

how would i do something like

_target = (getmarkerpos _marker) + randomAmountOfRadiusDeviation
#

cause i know the return is [x,y,0] but if I do [x,y,0] + [100,100,0] i'd actually get [x,y,0,100,100,0] i believe

robust hollow
astral dawn
#

Still looking for solutions to quickly check if given object is a tree.
Maybe a list of tree model names? I wonder where can I get it this list dynamicly for any map.

#

Are trees stored in config somewhere? Maybe I could parse config file?

fair drum
#

@robust hollow in the context of artillery hitting that target, will that random 360 apply to all rounds, or change every shot?

Context (script in progress):

params ["_group","_marker","_rounds","_time"];

if (local _group) then {

    while {true} do {

        _ammo = getArtilleryAmmo [

            vehicle ((units _group) select 0)
        ] select 0;
        _target = (getMarkerPos _marker) getpos [random 100,random 360];

        {_x addMagazineTurret [_ammo,0,1]} forEach units _group;
        {_x doArtilleryFire [_target, _ammo, _rounds]} forEach units _group;
        sleep _time;
    };
};
robust hollow
#

it should apply to all rounds in that iteration of the while loop

fair drum
#

i guess i could implement some sort of for argument to do it each round?

robust hollow
#

you can simply move the getpos to inside the foreach loop. then it would be random for every round

fair drum
#

Internet went down but now on my phone... Can you do a for loop inside of a while loop?

robust hollow
#

yes

orchid stone
#

Hey guys - I think this is the right channel. So I've been toying with scripting for a little while, and have functionality I would like to package into a mod. Does anyone have any resources they can share regarding development flows when creating a mod.... "rapidly". Currently, my understanding is.... when I pack up the PBO, I need to reload the entire client to unpack the addon again at startup. Basically, my question is, how the heck do I edit scripts in my addon during run time. I thought I was on to something with symlinks, but the PBO is locked by the arma client.

#

Basically, i just want to be able to modify a script and recompile it at runtime -_-

robust hollow
#

you’d use filepatching. im sure there is an explanation of it on the wiki, but i cant find it right now.

orchid stone
#

thats a word i haven't found and will add that to my google searches. thanks friend 🙂

warm hedge
#

how the heck do I edit scripts in my addon during run time
My answer is try not to edit your MOD scripts (functions?) via modifying MOD, but do it in-game, in-editor

orchid stone
#

ya sorry, they are functions.

#

setup as functions i mean

#

i'll look into that as well

warm hedge
#

CfgFunctions entry right?

orchid stone
#

well... they functions run and do what i want them to do start to finish

#

my ultimate goal here is to have a streamlined process to modify the scripts in vscode, recompile in game, and test the changes

#

not a perfect system, but nice for ironing out some basic syntax issues

warm hedge
#

You can't recompile existed CfgFunctions functions in-game because anti-cheating, not to break the game, or whatever AFAIK

orchid stone
warm hedge
#

Ah well. I think I forgot this because never tried that

orchid stone
#

maybe my core idea is wrong then. i figured a question about how to quickly edit a mod would be met with "like this you idiot...." 😆

warm hedge
#

I'm not a wiser man so I only do modify the MOD every each time when apply the change, while finalizing ¯_(ツ)_/¯

orchid stone
#

and that involves reloading your entire environment right? client + server?

warm hedge
#

I really don't know about Multiplayer things. Depends on what the function does and scope, that's a yes I guess

orchid stone
#

ok haha, maybe i should be asking this question instead....

#

is there a way to test an addon with packing it into a PBO.. lol

warm hedge
#

test an addon
What do you mean?

orchid stone
#

load the contents of my addon, into arma, without packing the contents of that addon into a PBO

robust hollow
#

in editor or with filepatching. editor is fine for testing scripts in most cases.

orchid stone
#

ok so i found some info on filepatching. that actually looks like what i need "File patching is the ability for the engine to load local scripts and other files to override versions in packed addons.".

robust hollow
orchid stone
#

I'm new here...

warm hedge
#

Mmm this is the article that I didn't even knew

orchid stone
#

is it ok to say i love you?

#

lol... thanks @robust hollow

fair drum
#

I have an group of units that are in vehicles. How would I go about using setvehicle ammo...

So far I have
{_x setvehicleammo 1} foreach units _group but it doesn't work because it needs a vehicle name. I've tried nesting forEaches but I keep screwing it up.

winter rose
#

@fair drum setVehicleAmmoDef might be what you want

fair drum
#

simpler than what I just found...

        private _veh = [];

        {
            if (
                !(vehicle _x isKindOf "man")
            ) then {
                _veh = _veh + [vehicle _x]
            };
        } forEach units _group;

        {_x setVehicleAmmo 1} forEach _veh;
winter rose
#

huh - yeah. Don't use that.

fair drum
#

well the above works, but when I use {_x setVehicleAmmoDef 1} forEach units _group instead, it does not work.

winter rose
#

What you want:

  • refill soldiers ammo? or
  • refill vehicle(s) ammo
fair drum
#

refill the vehicles' ammo

winter rose
#

then use my code, with vehicle _x

#
{ _x setVehicleAmmoDef 1 } foreach (units _group select { not isNull objectParent _x } apply { vehicle _x });
fair drum
#

0_o

{(vehicle _x) setVehicleAmmo 1} forEach units _group; looks to work

#

let me try to break down your code, I know I can learn something from it

#

so...

units _group select { not isNull objectParent _x } is selecting anything the unit is attached to or in? then you are applying vehicle to the object parent?

winter rose
#

it is selecting every unit that is in a vehicle

winter rose
#

{(vehicle _x) setVehicleAmmo 1} forEach units _group;
it works, but will also refill on-foot soldiers.

{ _x setVehicleAmmoDef 1 } foreach (units _group select { not isNull objectParent _x } apply { vehicle _x });
```can be broken down as:
private _units = units _group;
private _inVehicleUnits = _units select { not isNull objectParent _x };
//same thing as
private _inVehicleUnits = _units select { vehicle _x != _x };

_vehicles = _inVehicleUnits apply { vehicle _x };
fair drum
#

okay that helps with understanding when written that way

winter rose
#

intermediate variables are better for understanding than one-liners, true

never forget that you write code for humans, not for machines 😉

still forum
#

@tough abyss find out. I don't know if AI distributes the attackTarget over network, I'd assume no.

spark moon
#

Hey! Can anyone help me to understand if there is a way to catch a moment between player is outside a vehicle and player inside it. I'm talking about that animation of getting inside. If i use (vehicle player) on this moment it returns player. Basically if i allow a player to do something when he is not in a vehicle, he still will be able to do this action upon the animation of getting inside a vehicle. But technically speaking, he is already inside (but still can be easily killed)

winter rose
#

the player is not in a vehicle until the animation of getin is over afaik
as for not in a vehicle on getout, IDK

spark moon
#

Ok. So how to catch this animation or this status?

young current
#

No there's 2 types of getIns

#

One that is character centric where move in happens at the end and one that is vehicle centric where move in happens first, then animation plays

#

Precise get in is the latter and happens the same way evert time. Like climbing into jets cockpit

#

The other one is just played on characters position

wispy cave
#

[QEGVAR(medical,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage, _damageSelectionArray]] call CBA_fnc_localEvent; That's a line of code from ace medical. Do I understand it correctly that I can add a CBA event listener on whatever QEGVAR(medical,woundReceived) gets translated to and I'll have access to all those params in that EH?

spark moon
#

@young current this is how it works. True. But how to catch the process when it starts but the player is outside a vehicle?

young current
#

You probably cant

#

GetIn eventhandler is probs only thing related to that

#

And maybe comparing the phase of the animation

copper raven
spark moon
#

When a player get in some vehicles, he is standing still but hatches are opening. So cannot get the phase of animation 😦

winter rose
#

there is no out-of-the-box "isGettingIn/Out" scripting command though

spark moon
#

@winter rose I understand it. Is there any workaround or some algorithm to catch the moment?

#

Just any thing to work with

copper raven
spark moon
#

@young current getIn or getInMan EH's are firing after a player is already inside 😦

#

@copper raven to catch getIn action menu pressed? Nice idea, thanks

copper raven
#

it will probably be enough, as getin has to always be ran through action menu iirc(no direct keybind for it). Some actions like manual fire toggle can be executed through a keybind at which point it'll bypass that event handler, but for getin it should be fine

spark moon
#

And to put a time stamp in the variable (time + 10 - for example) when action is called. Then I'll be able to check if current Time or serverTime value is bigger than time stamp in the variable. Right?

winter rose
#

you could grab the anim and use animationChanged EH?

spark moon
#

Using these handlers: "GetInDriver" "GetInPilot" "GetInTurret" "GetInCargo"

#

@winter rose can't use it. In some cases character animation doesn't change. The player stands still when hatch is opening, and then animation of the character begins

winter rose
#

I thought this immobile thing was part of the get in animation itself 😦

spark moon
#

I was comparing animations via animationState but didn't tried EH tbh. Will check it now

#

@winter rose me too! 😩

#

Sad, but both AnimChanged and AnimStateChanged are firing when player is inside

#

Or those EH's even doesn't fire on getIn but fires on getOut

#

And to put a time stamp in the variable (time + 10 - for example) when action is called. Then I'll be able to check if current Time or serverTime value is bigger than time stamp in the variable. Right?
This works nice

spark turret
#

the player is not in a vehicle until the animation of getin is over afaik
as for not in a vehicle on getout, IDK
@winter rose
my get IN Jet "eventhandler" uses ?(vehicle player == _plane) and it returns true as soon as you start the animation

winter rose
#

yep, as HG stated above it depends on the animation type

digital hollow
#

is there a delete version of append or pushBack? or is _arr = _arr - [_element] good enough?

lost copper
#

Maybe that?

digital hollow
#

You'd have to use that with find

#

I guess it's incorrect to say "delete version of..." since those two just add to the end.

still forum
#

if you want to delete from end you can resize 😄

#

You'd have to use that with find
yeah if you don't know the index, you have to iterate the array first to find where the element is.

arr - [element]
copies the whole array, so depending on the size of the array it could be bad, it also iterates the whole array.

lost copper
#

You can use select with ex.6

still forum
#

select with code will be much slower than both find and arr-[element]

lost copper
#

Yes, you are right, Dedmen

digital hollow
#

Ah. ty

wispy cave
#

is there an EH for closing the arsenal in ace? The documentation doesn't list one but I found that's no guaranty for there not being one

wispy cave
#

thanks

still forum
#

ace_arsenal_displayClosed

spark turret
#

I dont think i have seen a method like array - element that doesnt use or requires finding the elements index.
I guess sone just have it built into the remove method.

autumn swift
#

Is unsafeCVL still a thing in description.ext? And if it still exists, whats the difference between disabling cvl via that VS via the CfgDisasbledCommands ?

still forum
#

currently disabled

#

unsafeCVL doesn't completely disable CVL, it only disables CVL for vehicle types tht are dangerous.
For example static objects are fine (I think) Tanks and guns are not

ebon citrus
#

@spark turret arrayintersect

#

I dont think i have seen a method like array - element that doesnt use or requires finding the elements index.
I guess sone just have it built into the remove method.
@spark turret

winter rose
#

@still forum lights and particle emitters too I guess; emptyDetectors (triggers) maybe? (though it can be dangerous)

spark turret
#

hm thats not necessarily better

ebon citrus
#

it does what you wanted, what's your point?

spark turret
#

yeah you re right

still forum
#

How does it? Its something completely different?

ebon citrus
#

just needs a little bit more fiddle

spark turret
#

you can use arrayIntersect to filter out elements you dont want, i guess its good for dooing a lot of elements at once

still forum
#

I don't think lights are blocked. Haven't looked at it in a while

ebon citrus
#

you cant delete an element from array without knowing its index unless you want to delete all matching elements of an array

spark turret
#

findAt would need a loop

still forum
#

you can use arrayIntersect to filter out elements you dont want
how? it removes duplicates but besides that?

autumn swift
#

@still forum interesting, is there a list of all the unsafe objects? My issue is that I wanna disable CVL as its used by script kiddies to spawn explosions, however I still want to use that command for my own scripts

still forum
#

unsafeCVL is currently not a thing so that won't help you, Don't think there is a list posted anywhere

spark turret
#

ive seen it in the ace arsenal wiki.
like you intersect the arrays of 2 loadouts and only add stuff that does not intersect

autumn swift
#

Ah ok, thanks!

spark turret
#

private _items = allUnits apply {getUnitLoadout _x};
_items = str _items splitString "[]," joinString ",";
_items = parseSimpleArray ("[" + _items + "]");
_items = _items arrayIntersect _items select {_x isEqualType "" && {_x != ""}};
copyToClipboard str _items;
#

i was kinda wrong

ebon citrus
#

it needs some mental gymnastics, but it's entirely possible

still forum
#

ah it only returns commons, so you only need to filter one side, or do a whitelist kinda thing

spark turret
#

but also kinda right

ebon citrus
#

i still dont see how it would be better or necessary

spark turret
#

well its like 1 line instead of a loop

ebon citrus
#

findat is good enough

#

findif*

still forum
#

findAt is not a thing btw

spark turret
#

findOut

ebon citrus
#

time for NCA_fnc_findAt

spark turret
#

jsut so i udnerstand correctly, this part filters out all non-strings and empty strings?
_items = _items arrayIntersect _items select {_x isEqualType "" && {_x != ""}};

but it does not prevent stuff represtended more than once?

ebon citrus
#

finds element and deletes all members of it in an array

#

example [_array, _element] call NCA_fnc_findAt; deletes all occurances of _element in _array and returns edited _array

#

feels like something i would use, so im just going to add it to my toolkit

#

bad naming, but jsut because Dedmen said it doesnt exist, ima use it

spark turret
#

so kind of like arrayIntersect but return the other half, the one that doesnt intersect

ebon citrus
#

just less mental gymnastics

#

im feeling lazy

#

"i could make a function out of this"

spark turret
#

time to find out how to make ai talk over radio

#

is there a list of radio text from cfg radio?

winter rose
#

configFile >> CfgRadio

spark turret
#

cool, time to go to the editor then

#

hm how do i open cfg radio in the editor

winter rose
#

Eden → ` → config viewer

spark turret
#

i dont see any cfg radio there

winter rose
#

at the root

#

configFile >> CfgRadio

spark turret
#

ah there it is

#

thanks

#

is there a way to listen to it?

winter rose
#

player sideRadio "theRadioSound"

spark turret
#

so i would have to run that for every single radio message ingame...

#

alright:
[west, "Base"] sideRadio configName selectRandom ("true" configClasses (configFile >> "CfgRadio"));
selectRandom implies that this: " ("true" configClasses (configFile >> "CfgRadio"));" is an array that holds the classname to every single radio message available?

#

ah, no its the path to there.

#

okay i will do whats called a pro supporter move. ill make a video of every single message with its classname displayed and put that on youtube.

#

so other lazy f* ers like me dont have to do the same thing again

#

is there a way to tell if the radio message is over?

serene ridge
#

Hey, wondering if anyone can help me with a respawn issue I'm having on a multiplayer mission? I'm trying to set it so everyone starts where they're set in the editor but still has access to custom respawn points once the mission has started, any help is much appreciated thank you.

ebon citrus
#

@serene ridge
inside description.ext

respawnOnStart = -1;

serene ridge
#

Do I need to make my own description.ext file for that then?

ebon citrus
#

inside the mission folder, yes

serene ridge
#

Okay, thank you!

spark turret
#

Ugh 400 radio sounds

serene ridge
#

Follow up question: will that only work after the mission's been exported or will I be able to use that while testing via the editor?

ebon citrus
#

works in the editor too

#

remember that the editor default environment is singleplayer

#

the multiplayer is hosted multiplayer

#

so the host is the server too

serene ridge
#

Just tried it and it didn't work, do I need to fill the entirety of the description.ext out like it's shown on the wiki or will just the one line work?

ebon citrus
#

what do you mean "it didnt work"?

winter rose
#

@serene ridge you can test respawn in the editor starting an MP editor session

ebon citrus
#

and no, you dont need to

#

remember that the editor default environment is singleplayer

serene ridge
#

That's what I'm doing, I'm testing the mission in multiplayer, spawn as a character and get taken back to the respawn screen

ebon citrus
#

at the start of the mission?

winter rose
#

…mods?

serene ridge
#

start of the mission, yes

#

ACE, dependencies, ACRE2

ebon citrus
#

remember that changes to description are loaded only when you back out into the editor

#

is your description.ext named exactly that?

#

and it's in the mission-folder?

#

in the root of the mission folder*

winter rose
#

beware of description.ext**.txt**

serene ridge
#

oh my god I put it in the wrong mission folder WHOOPS

#

That

ebon citrus
#

make sure windows explorer is set to show extensions

serene ridge
#

will be why

#

No I just put it in a different mission than the one I'm trying it on

#

Yeah funnily it worked when I put it in the right folder 🤓

#

thanks again!

ebon citrus
#

Yeah funnily it worked when I put it in the right folder 🤓
@serene ridge it has a tendency to do that 🔨

spark turret
#

how do i get the objects vector up?

unreal scroll
#

I want to write the function to extract elements from lists in list (sometimes bad things happens, and I can get such things in scripts, like [group1, [group2, group2], group4, unit1] etc).

OT_fnc_ExtractFromArray = {
    params [["_list", [], [[]]], "_params"];
    private _homogeneous = [];
    {
        if (typename _x isEqualto _params) then {
            _homogeneous pushback _x;
        } else {
            if (_x isEqualType []) then {
                private _element = [_x,_params] call OT_fnc_ExtractFromArray;
                if (!(_element isEqualTo []) && (typename _element isEqualto _params)) then {
                    _homogeneous append _element;
                };
            };
        };
    } foreach _list;

_homogeneous
};

But it doesn't work as intended.
I.e., I call
[[3,6,[5,2,0],1],"SCALAR"] call OT_fnc_ExtractFromArray
and it returns [3,6,1], while the _element is correct ([5,2,0]). Seems like it is failed on append _element. What I'm doing wrong?

ebon citrus
#

what do you mean? the rotation of the object or the vector parallel with the z-axis in the object's local(relative?) space?

#

private _element = [_x,_params] call OT_fnc_ExtractFromArray;

#

function is not defined

#

or variable is not defined, rather

#

not 100% on that, since i've never tried calling a function from within itself

#

well, a variable from within itself

#

have you tried debugging it with simple systemchat commands

#

to see if it ever even runs?

#

like make the script print the parameters it's passed

#

start debugging from there

#

check back with your findings

#

also

#

append takes an array

#

_Array append [variable];

#

like so

winter rose
#

@spark turret …vectorUp?

ebon citrus
#

that's probably your issue

winter rose
#

@unreal scroll language, edit your profanity out now.

ebon citrus
#

so your _element here is a scalar and not an array

unreal scroll
#

"function is not defined"
See above, it is defined.

"or variable is not defined, rather"
Params variable is defined, see above.
As I said, the _element variable, taken from inside the block, is ok, it is [5,2,0], the _homogeneous veriable at this iteration is [3,6]

"append takes an array"
Of course it take an array. The function returns an array.

#

"language, edit your profanity out now."
?

ebon citrus
#
if (!(_element isEqualTo []) && (typename _element isEqualto _params)) then {
                    _homogeneous append _element;
                };```
winter rose
#

s word.

ebon citrus
#

youre passing append a not-array

#

not an array

#

you need to pass it an array

#

_homogeneous append [_element];

#
Syntax:
array1 append array2
Parameters:
array1: Array
array2: Array```
#

that was a little bit insultive, but i'll take it. It's hot in here too 😅

#

im just suggesting a fix here, it's up to you if you want to try it or not

#

also, what montana said

#

edit the profanity out of the original question

unreal scroll
#

Can you read the function? Look at it again. It is pushback for element, and append for arrray.

ebon citrus
#

!(_element isEqualTo [])

unreal scroll
#

if (typename _x isEqualto _params) --> _homogeneous pushback _x;

ebon citrus
#

yes

#
if (!(_element isEqualTo []) && (typename _element isEqualto _params)) then {
                    _homogeneous append _element;
                };```
#

this part here

#

youre trying to append a non-array

#

both of the parameters of append NEED to be arrays

#

here you are checking that it is NOT an array: !(_element isEqualTo [])

#

so we can assume that _element is not an array when the code comes to the append

#

so you must wrap it in an array

#

[_element]

#

or use pushback

#

you got me?

still forum
unreal scroll
#

"so we can assume that _element is not an array when the code comes to the append"
No, we assume that it is not an empty list

#

It CAN be an array

still forum
#

here you are checking that it is NOT an array: !(_element isEqualTo [])
He's not.

#

He's checking that its not an empty array.

#

Which btw you don't need to do, append with empty array just does nothing

ebon citrus
#

oh yeah, youre right

#

i messed up isequalto with something else

#

my bad

still forum
#

What I'm doing wrong?

Why don't you just check? add diag_log's to every step and.. check what you are doing wrong

ebon citrus
still forum
#

isEqualType

ebon citrus
#

wait

#

arrays are not scalars

unreal scroll
#

Fixed it.

    params [["_list", [], [[]]], "_params"];
    private _homogeneous = [];
    {
        if (typename _x isEqualto _params) then {
            _homogeneous pushback _x;
        } else {
            if (_x isEqualType []) then {
                private _element = [_x,_params] call OT_fnc_ExtractFromArray;
                if (!(_element isEqualTo []) && {(_element isEqualType []) && {!((_element findif {typename _x isEqualto _params}) isEqualTo -1)}}) then {
                    _homogeneous append _element;
                };
            };
        };
    } foreach _list;

_homogeneous```

There was a simple mistake: (typename _element isEqualto _params) for array will never be true.
ebon citrus
#

(!(_element isEqualTo []) && (typename _element isEqualto _params)) if _element is always an array as returned by the function

#

you will never have a true of this

#

mmh, just what i thought

#

usually you can easily debug these kinds of issues with some systemchat and check if the codfe is ever entering the specific parts

#

and then you can see where it stops

unreal scroll
#

Thanks for repeating me :)
I'm using hints to show the steps, but it is a good idea too.

Btw, I can't understand what Lou Montana meant. Or it was just a joke?

still forum
#

whatever lou meant is already fixed

#

hint is a bad idea if you have more than one, because the later hint will just hide the previous one

ebon citrus
#

@still forum it's not

#

not fixed*

still forum
#

Ah no

#

@unreal scroll first message, first line. Profanity. #rules

unreal scroll
#

Aaa... Ok, fixed ))

ebon citrus
#

@unreal scroll didnt repeat what you said

#

but your issue was solved, no?

unreal scroll
#

Yes, it works as intended.

ebon citrus
#

it's not elegant, but it works, so meh. whatever floats your boat

#

also, good luck with it!

unreal scroll
#

If you have a better idea for for re-assembling list elements in one - you can share, of course. I would be grateful.
NB: In russian "profan" is the person who knows a few, and makes a stupid mistakes, so, not knowing this word, I was a bit confused at the very beginning - I was thinking "What is so terrible in my code?" )) Some sort of misunderstanding.

still forum
#

theres a better way to de-nest arrays if they only contain numbers

#

but you passing datatype I assume thats not the case

unreal scroll
#

It can contains unint/groups, this is why I needed it. Before the battle I add all attacking groups into one list, but in battles, if the leader was killed, there could be some mess with groups, and final script, which adds units to base garrison, sometimes fail... A long story, and I understand that it is much better to rewrite all scripts to avoid it, but yet another check is good in any case, I think.

queen cargo
#

🤔
What is the output of theese two SQF expressions:

private _arr = [1,2,3];
diag_log ({
  _arr pushBack _x + 1;
  true
} count _arr);```
```sqf
private _arr = [1,2,0];
diag_log ({
  _arr set [_x, _x + 1];
  diag_log _x;
  true
} count _arr);```
winter rose
#

diag_log returns Nothing though?

storm radish
#

having trouble with getting a script to loop more than twice

#

while {alive crash2} do {
crash2 switchMove "Acts_Rifle_Operations_Right";
waitUntil {animationState crash2 != "Acts_Rifle_Operations_Right"};
};

queen cargo
#

argh ... youre right @winter rose 😅
tiny mistake Fixed

tall hull
#

can someone help me out with setting a server up? im new to scripting and online doesnt have much stuff about how to do it

ebon citrus
#

im not sure if youre looking for help in setting up a server or looking for people to create content for you, considering that you asked this in the #arma3_scripting

exotic flax
#

the wiki in general is a minimum requirement if you want to do some #arma3_scripting

tall hull
#

im actually looking for help to understand how armas scripting works and some help is not bad as well haha

im not sure if youre looking for help in setting up a server or looking for people to create content for you, considering that you asked this in the #arma3_scripting
@ebon citrus

#

also thanks @ebon citrus and @exotic flax for the help

ebon citrus
#

people here are usually more than happy to help, but we all come in many colours and some brighter than others. None of us here are gods (exceptions apply)

exotic flax
#

Google is the only God out there

#

and BIKI, his bastard son

hybrid pier
#

Hello everybody,

wanted to ask if someone knows or has a script. With which you can delete destroyed vehicles and spawn again in the same position. As often as possible. But only vehicles that have something in the init list. Say you would like to create a shooting range on a server where the vehicles can also be destroyed. Thank you in advance for your support.

exotic flax
#

so basically "if destroyed, respawn in position, with init script"

hybrid pier
#

yes

waxen tendon
#
fnc_randomPointOnLand = {
    xpos = random[_xl,(_xl+((_xh-_xl)/2)),_xh];
    ypos = random[_yl,(_yl+((_yh-_yl)/2)),_yh];
    if !(surfaceIsWater([xpos,ypos])) then {
        [xpos,ypos];
    } else {
        fnc_randomPointOnLand
    };
};

would this work? i am unsure about the recursion part

exotic flax
#
  1. the X and Y values are not defined in the function
  2. only the last line can be returned, so use a variable to return
waxen tendon
#

yeah xl,xh,yl,yh are defined elsewhere

exotic flax
#

they need to be defined INSIDE the function

waxen tendon
#

yeah, just noticed that, they will be passed via params

#

and what do you mean only last line can be returned?

exotic flax
#

@hybrid pier you most likely need to use the Killed EH, and run the "init" script manually after creating a new vehicle

hybrid pier
#

okay

exotic flax
#
fnc_randomPointOnLand = {
    params ["_xl", "_xh", "_yl", "_yh"];
    private _return = [];
    _xpos = random[_xl,(_xl+((_xh-_xl)/2)),_xh];
    _ypos = random[_yl,(_yl+((_yh-_yl)/2)),_yh];
    if !(surfaceIsWater([_xpos,_ypos])) then {
        _return = [_xpos, _ypos];
    } else {
        _return = [something?] call fnc_randomPointOnLand;
    };
    _return; // only last line gets returned
};
waxen tendon
#

right

#

thanks!

hybrid pier
#

and how do i tell the script if the particular vehicle is destroyed it will be replaced. how does the script know which vehicles are meant?

exotic flax
#

simply attach the EH to the vehicle

hybrid pier
#

EH?

hybrid pier
#

oh 😦

exotic flax
#

@waxen tendon you might want to look at BIS_fnc_findSafePos and selectBestPlaces, which allow you to find a safe position with some specific rules

hybrid pier
#

@exotic flax Thanks for goog Work

#

*good

exotic flax
#

I just spend way too much time on the wiki 😛

hybrid pier
#

😄

#

The goal is to build a really cool shooting range on the public server. I am also looking for a script with which I can move targets back and forth.

waxen tendon
#

thanks a lot for those functions, really hard to find them with names like that @exotic flax

exotic flax
hybrid pier
#

tanks 🙂

#

*h

hybrid pier
#

@exotic flax have a quastion

exotic flax
#

I might have the answer

hybrid pier
#

I have mounted a bell on the shooting range that can be used with a mouse wheel. but on the server you can only use them once and then not anymore. it always works in the editor. do you have a solution?

exotic flax
#

sounds like a locality issue (meaning the server only runs on the server or editor, but not on clients connected to the server)

hybrid pier
#

sry am a noob and not so smart. is there a way to fix it?

exotic flax
#

most likely a problem in the addAction or the script that it calls

hybrid pier
#

i have a problem with the rail script

exotic flax
#

the examples in that script are wrong 😉

#
null = [RL_2,8,0,12,[3,-1,0,-1,objNull]] execVM "scripts\initTargetRail.sqf"; 

you need to add an extra , (comma) before the [ inside the array

hybrid pier
#

?

exotic flax
#

null = [RL_2,8,0,12 -->, <--[3,-1,0,-1,objNull]] execVM "scripts\initTargetRail.sqf";

hybrid pier
#

and than work the script?

exotic flax
#

it should, although I don't have a working test version of it

hybrid pier
#

I hope it works

#

you are from german or?

exotic flax
#

no, but I'm living in Germany for 5 years now 😉

hybrid pier
#

cool xD

#

wie gefällt es dir in Deutschland?

exotic flax
#

Nicht schlecht, obwohl die Sprache im Vergleich zu Niederländisch zu schwer ist ;)
although let's keep it English to follow the #rules

hybrid pier
#

friends? then can we also write private messages?

exotic flax
#

and I really dislike my German keyboard 😛

hybrid pier
#

okay, I saw the ILBE Assault Pack - Rewrite. sau cool 🙂 I wrote it with Satcom. The problem is, we use TFAR and wanted to build a radio bridge with the Satcom and it didn't work. do you have to pay attention to what? unfortunately there are no instructions how best to use it

exotic flax
#

The SATCOM only enhanced the range of the person(s) close to it, it doesn't fake a satellite connection (due to limitations on how TFAR works). So even when 2 people use it and are within range, it will still take in account terrain etc.

hybrid pier
#

so it doesn't really help?

the rail script does not work always get an error message when connecting to the server.

exotic flax
#

did you add the script in the mission?

hybrid pier
#

yes

#

yes I see a problem in the script on the page says moveTargetRailExt.sqf

and the server looks for moveTargetRail.sqf

exotic flax
#

I just noticed the same in a simple test mission, and making some small changes does fix it

hybrid pier
#

okay and which ones? I think I have to write something in init.sqf right?

#

can you send me the right file where it works?

exotic flax
#

mine are too modified for my needs (paths etc are different)

#

but I just went over all the file names and made them match with the actual files

hybrid pier
#

😦

#

Thanks anyway for your help. I delete it now because I can't get it to work

fair drum
#

whats the command to create the little score/ticket boxes at the top right of the screen?

exotic flax
#

I don't believe there's a command/function for that

torpid quartz
#

I've seen there is ways to white or black list items from the a virtual arsenal, but is there a way to disable an entire category? Like just remove all weapons?

#

Actually found this

dontRemove = []; //Fill with the odd class names you do not want removed
{
    _types = _x;
    {
        if !( _x in dontRemove ) then {
            
            _info = _x call BIS_fnc_itemType;
            _info params[ "_type", "_subType" ];
            
            switch ( _type ) do {
                case "Mine" : {
                    _types set [ _forEachIndex, objNull ];
                };
            };
            
            switch ( _subType ) do {
                case "MissileLauncher";
                case "RocketLauncher";
                case "LaserDesignator";
                case "Binocular" : {
                    _types set [ _forEachIndex, objNull ];
                };
            };
        };
        
    }forEach +_types;
    _types = _types - [ objNull ];
    BIS_fnc_arsenal_data set [ _forEachIndex, _types ];
}forEach +BIS_fnc_arsenal_data;

[ "AmmoboxInit", [ this, true ] ] call BIS_fnc_arsenal;```
#

Hmm. I don't think I should have done that on mobile lol

#

Though I want to ask can I do this but also white list certain items too? Like remove all medical items but leave bandages and morphine?

hallow mortar
#

Start your code block with ```sqf

#

and end it with ```

#

that will fix your formatting

torpid quartz
#

ok fixed the formatting lol, had to copy and paste again because mobile didn't contain all the spaces.

So there this is dontRemove = []; in this code, but i want to also just disable 3 or 4 items in certain categories, is there any way this could be modified to do so? Or something I could stick between the rest of the code and the [ "AmmoboxInit", [ this, true ] ] call BIS_fnc_arsenal; to do so?

fair drum
#

My players have 2 respawn tickets each and I want to add a ticket every objective they complete, even to units that have no more respawns... I don't think this works. What else could I try? Must be separate from side pool (which will always be 0)

{[_x,1] call BIS_fnc_respawnTickets} forEach playableUnits;
#

Maybe this?

[[player,1],BIS_fnc_respawnTickets] remoteExec ["call",-2,true];
torpid quartz
#

thinking
[ammobox,["B_Parachute"],true] call BIS_fnc_removeVirtualBackpackCargo;
if i slap it in before the last line, i'll give it a try later.

tardy sonnet
#

Having issues with this script I made (custom asset list for Warlords) not even sure if it's a script lmao but it's been working up until this morning and the Opfor units decided not to show up in the menu for purchase, is there any fix for this? The script is 800 lines long so I've placed it in a pastebin. https://pastebin.com/BPg2MH1K

winter rose
#

thank you for this chat's consideration ^^

spark turret
#

Is there a way to tell if a radio message is still playing or already over?

#

That would help immensly

#

Or the length of a sound. Anything the helps coordinate

winter rose
#

nope - but the Conversation system

#

in the next patch, playSound will return the sound-emitting object, you can check when it is objNull meaning it has filled its purpose

spark turret
#

any chance that will be expanded to the radio commands as well?
like sideRadio etc

winter rose
#

so far no good, but perhaps 🐮

spark turret
#

meh

winter rose
#

you can still make a ticket, you will get your answer - anyway, it's not for right now

spark turret
#

i mean im happy that the radios are being queued instead of overlapping, but im trying to "debug" them, aka list them with an index and the corresponding text/classname etc.
and i just have the whole array play but theres no way to tell which one is currently playing

#

where would i make that

still forum
#

not planned for radio commands, didn't look at that, and now might be a bit late if you need it soon 😄

spark turret
#

i can wait

#
    // since Arma 3 v1.99.146480
        _source = playSound "Alarm";     //play the sound
        _source spawn         //why spawn?
        {
            waitUntil {isNull _this};    //wait until _source was deleted(?)
            hint "Finished!";
        };

can someone explain why spawn is used?

#

so it runs parallel and doesnt suspend the whole script? or another reason?

ebon citrus
#

Probably because it's in unscheduled space

unreal scroll
#

Yes, seems like the author just wanted the hint to be showed independently. Only scheduled environment (where you comes using spawn) supports suspend. Basically you should avoid using spawn for complex scripts, as you're entering the parallel programming. It is not so simple. But for such tasks as above - why not? But I would prefer to use CBA WaitUntilAndExecute

ebon citrus
#

You need to have the waituntil in scheduled space

#

That's why spawn

spark turret
#

alright so the sound returns true for isNull _sound while you can still hear it playing.

#

am i doing something wrong or is arma being arma?

winter rose
#

are you using the latest devbranch ?

spark turret
#

im on 1.99/1.98

#

bc thats what the clan uses

winter rose
#

I don't know what you mean; can you post your actual version?

spark turret
#

also it seems that just some sounds are falsely returned as isNull

warm hedge
#

Just use productVersion to get version

spark turret
#

["Arma 3","Arma3",198,146379,"Stable",true,"Windows","x64"]

warm hedge
#

Then your game isn't in Dev-Branch, return value for playSound isn't implemented yet

unreal scroll
#

You can use simple workaround - just sleep for total length of the sound

warm hedge
#

Or wait until next stable update

winter rose
spark turret
#

yeah im using the other example now where it selects the nearestObject soundsourceoncar as the sound source

unreal scroll
#

@winter rose ??

spark turret
#

it still seems to be quite random which ones are displaying the correct length and which ones arent

winter rose
#

there is no way at the moment to get the sound length @unreal scroll
(his request)

Ir0nsight wants to avoid manual processing

unreal scroll
#

"there is no way at the moment to get the sound length"
Hm... Every sound file has its own sound length, or in A3 it is not so simple for playing sounds? (not speaking of IR0NSIGHT issue, just curious)

winter rose
#

Every sound file has its own sound length
?

#

every sound has a length, but there is no way to get this value by scripting

unreal scroll
#

So? I can calculate the overall time, and set it as delay. It is a manual way, but it will works.

warm hedge
#

Yes that's the way?

spark turret
#

i did exactly that, more often than not it claims the length is like 0.01242541 seconds

#

while the sound is playing at far longer

winter rose
#

diiid you use the latest devbranch?

spark turret
#

no

#

and i wont 😄

winter rose
#

then the playSound trick won't work ¯_(ツ)_/¯

spark turret
#

it does partly with ```sqf
playSound "Alarm";
hint "Started!";
[] spawn
{
_sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";
waitUntil {isNull _sound};
hint "Finished!";
};

#

so far i can tell that with that all oldman sounds are broken

unreal scroll
#

"more often than not it claims the length is like 0.01242541 seconds"
Just use the real world clock. You don't need 1/10 s accuracy, right?

spark turret
#

[["oldman_ambient_dialogues_015_am_syndikat_dialogue_a_AMBCIVILIAN_6",0.138977,0]]

#

thats what arma claims is the length of this audio.

still forum
#

I don't know what you mean; can you post your actual version?
There is no actual version because we are on custom dev build

spark turret
#

im special 🤷‍♂️

spark turret
#

can i play sounds from this config part?:
playSound and sideRadio for the "classnames" do not work
bearing255[] = {"RadioProtocolENG\Normal\DirectionCompass2\bearing255.ogg"};
configfile >> "RadioProtocolENG" >> "Words" >> "bearing255"

winter rose
#

yep, it's neither in CfgSounds or CfgRadio

#

you can use the Conversations system to use them though

spark turret
#

so are the sound files bound to scroll wheel action menus?

#

or can i by script force them to be said/played?
Bc this doesnt work
player kbTell [
BIS_HQ, // to
"Airstrike", // topic
"AirstrikeRequest", // sentence
["Team", {}, "Anvil", ["Anvil"]], // argument 1
["Location", {}, "Strelka", ["Strelka"]], // argument 2
true];

#

hm wait thats for arma 2

winter rose
#

kbTell needs a .bikb declaration @spark turret

spark turret
#

that means?

winter rose
spark turret
#

and that bikb file has to be created for each mission?

#

and it holds the defined sentences with corresponding sound file paths

winter rose
#

a bikb has to be referenced if you want to use kb commands - shared between missions or not, no difference.

spark turret
#

now if it have:
text = "%team requesting close air support at grid %location ";
(from the conversations example)
how does it know how to pronounce the parameters (team and location)?

player kbTell [
    BIS_HQ,                                        // to
    "Airstrike",                                // topic
    "AirstrikeRequest",                            // sentence
    ["Team", {}, "Anvil", ["Anvil"]],            // argument 1
    ["Location", {}, "Strelka", ["Strelka"]]    // argument 2
];
winter rose
#

it takes its words from the radio protocol words

spark turret
#

so do you have to define each word with a file path in the bikb or can you use already existing radio protocl words?

winter rose
#

Words are already defined
But you have to define the sentence itself

spark turret
#

okay. so i can create sentences in the bikb with parameters and feed existing words to the parameters:
and if i want custom sounds in there i have to give file paths

winter rose
#

Yep

spark turret
#

alright lets try that

#

okay so i have a conversation.bikb that says

class Sentences
{
    class AirstrikeRequest 
    {
        // %team and %location will be replaced by the game engine with according values
        text = "%team requesting close air support at grid %location ";

        // available words are defined in config > RadioProtocol > Words
        speech[] = { %Team, RequestingCloseAirSupportAtGrid, %Location };

        class Arguments 
        {
            class Team { type = "simple"; };        // refers to %Team, first element of speech[]
            // "RequestingCloseAirSupportAtGrid" is part of Radio Protocol
            class Location { type = "simple"; };    // refers to %Location, last element of speech[]
        };
    };
};

class Arguments {};
class Special {};
startWithVocal[] = { hour };
startWithConsonant[] = { europe, university };

and i have this in my description.ext:
class CfgSentences
{
class MissionName
{
class Event1
{
file = "Conversation.bikb";
#include "Conversation.bikb" // avoids a double declaration
};
};
};
and then i call the air support with an CAS.sqf executed in SP with

player kbTell [
    dude_01,                                        // to
    "Airstrike",                                // topic
    "AirstrikeRequest",                            // sentence
    ["Team", {}, "Anvil", ["Anvil"]],            // argument 1
    ["Location", {}, "Strelka", ["Strelka"]]    // argument 2
];

(dude_01 is standing right next to me)

but nothing happens

#

do i have to do something else first? like add a topic or sth?

#

ahhh i had to do player kbAddTopic ["Airstrike", "Conversation.bikb"];
and now it shows up in the sidechat

winter rose
#

kbAddTopic yes

spark turret
#

but no sounds.

#

i thought the built in words have sounds already?

#

i changed the speech[] to
speech[] = {"RadioProtocolENG\Normal\DirectionCompass2\bearing255.ogg"};
but its still not giving any sounds.

#

im getting closer to another profanity warning 😠

ebon citrus
#

filled with rage and frustration, i began debugging

spark turret
#

Theres nothing to debug bc theres no error

night crescent
#

@winter rose @warm hedge I would like to load the vehicles multiple times in the Mission does it work with attach to ?

winter rose
#

if you script it, yes

night crescent
#

So does the script use ViV ? Or is it something different ?

warm hedge
#

Either?

#

No idea what your goal is

night crescent
#

Make non comparable ViV Vehicles comparable

#

As an example 3BAF Landrover loadable to an RHS C130

#

Rhs c130 support ViV

#

But the 3baf Landrover doesn’t support the feuture

warm hedge
#

It must be bigger than the cargo space

winter rose
#

a vehicle that goes inside another only needs to be of the good size
ViV "storage" is defined in the holder

#

@spark turret speech[] = { bearing255 };

night crescent
#

Yeah but it’s didn’t work with 6x6 ATV aswell its smaller than the buggy from rhs and it’s not fitting because it doesn’t have die ViV symbol in the display

spark turret
#

ah okay so i got him to say "front!" lol thats a start

#

i will refrain from describing the conversation system in my own words in regards to the rules about profanity.

#

now i got this config file which holds all availavble (vanilla probably) words:
configfile >> "RadioProtocolENG" >> "Words"
its has the subclasses of
["Normal","CombatEngage","NormalContact","CombatContact","Stealth","Combat","NormalEngage","NormalWatch","NormalTarget","StealthEngage","StealthWatch"]
and i want all words in these subclasses.
for the sideRadio classes i used this to get an array of all classes in the parent:
_pathArray = ("true" configClasses (configfile >> "RadioProtocolENG" >> "Words"));
and then used configName for each to get the class name.
but if it do that for the
radioprotocolENG words it says the array is 0 length

#

although the words each are their own class if i understand correctly, example:
configfile >> "RadioProtocolENG" >> "Words" >> "Normal" >> "Advance"

winter rose
#

isArray, isClass ?

spark turret
#

yeah i didnt read the error corretly

spark turret
#

okay i got the airstrike one to say all the words i input to it. I created my own sentence class but it doesnt work anymore

winter rose
#

magic ¯_(ツ)_/¯

spark turret
#

okay.... so topic and sentence have to be different strings

winter rose
#

oh, do they?

#

if so I can update the doc

spark turret
#

no wait

#

now it works again in the old, not working condition. magic indeed

#

lol arma conversation contains "Thanos"

queen cargo
#

Can someone please test this:

switch (1) do
{
  private _case = case 1;
  case 2: { systemChat "empty"; };
  switch (2) do
  {
      _case: { systemChat "colon takes left argument"; };
  };
  default { systemChat "colon takes MAGIC variable"; };
};```
winter rose
#

"empty"

queen cargo
#

wut

#

ohh

#

mhh

#

?sqf switch (1) do { private _case = case 1; switch (2) do { case 2: { systemChat "empty"; }; _case: { systemChat "colon takes left argument"; }; }; default { systemChat "colon takes MAGIC variable"; }; };

winter rose
#

the latter

#

MAGIC

still forum
#

should be default

queen cargo
winter rose
#

error missing ;

#

MAGIC again

queen cargo
#

kk

#

thanks

still forum
#

the switch magic variable is privated to inner scope indeed

winter rose
#

it better be for a good thing X39!

still forum
#

Actually 🤔
Should print empty and magic?

winter rose
#

ah yes, both

#

I took it for a previous output

#

I confirm both @queen cargo

queen cargo
#

it obviously is for a good thing

#

SQF-VM

winter rose
#

while I'm having fun doing a QTE function here 😄

slate cypress
#

Is it possible to have a condition for the mission intro text?

queen cargo
#
private _arr_expected = [9,9,9];
private _arr = [1,0,1];
systemChat str (_arr apply { _arr set [_x, 0]; 9 });

result of this?

still forum
#

_arr is 0,0,0 apply return is 9,9,9

#

ah no

#

_arr is 0, 0, 1

queen cargo
#
private _arr = [1,2,3];
systemChat count (_arr apply { _arr set [_x, _x + 1]; _x });```is this also growing up to array max?
winter rose
#

it crashed my game, so yes 😄

spark turret
#

is there a good way to get all vehicles in a group?

#

other than foreach unit group do get vehicle, pushback to array, delete doubles?

slate cypress
#

When you use driver vehicle, does it return objNull when there is currently no driver?

winter rose
#

@slate cypress objNull yes

slate cypress
#

Ah

#

In that case, how can I make my trigger see an object variable?

winter rose
#

…?

slate cypress
#

I have a vehicle with a variable "leadVehicle". I have a trigger which needs to be able to see "leadVehicle" variable.

winter rose
#

then use leadVehicle?

slate cypress
#

I have but the code isn't working. I'll send.

winter rose
#

@spark turret there is assignedVehicle but no groupVehicles

slate cypress
#

This is my condition.

#
operator = driver leadVehicle;
operator != objNull;
#

This should return true when a player or any unit is inside the vehicle driver seat.

#

It is returning true when the seat is empty.

winter rose
#

nope, == & != cannot compare null objects

#

use isNull

slate cypress
#

Ah

#

Thanks works now

#

Also do you know how to cause the mission intro text to appear with a condition?

#

If possible, I'd like it to appear at a trigger

winter rose
#

the mission intro text?

spark turret
#

does that order a unit to do fire support or spawn mortars from thin air?:
BIS_fnc_fireSupport

slate cypress
#

It is called "Intro Text" under General settings within the Editor.

#

It causes an animated text to appear showing the mission name

#

There's no condition field though so I'm wondering if it is even possible to enable it with a condition

slate cypress
#

Oh might be

wispy cave
#

Is there an event that triggers when the vanilla arsenal is closed? Or is using inGameUISetEventHandler on action and checking for the arsenal action the only way?

astral dawn
#

Arsenal is an entirely scripted thing. So it used scripted event handlers.

wispy cave
#

thanks

slate cypress
#

Thanks

queen cargo
#
_arr = [1,2,3];
_nested = [_arr];
_copy = +_nested;
(_copy select 0) set [2, 1];
systemChat str [_nested, _copy]

``` What is this outputting?
winter rose
#

stahp breaking mah computerrrz!1!

#

I would say the array copy is not a deep copy; starting the game now

#

123, 121

#

wow, it's a deep copy 🙃 @queen cargo

queen cargo
#

bamboozle

astral dawn
#

stahp breaking mah computerrrz!1!
All these examples nullify arguments like we can't add this command because then someone can crash your game in MP' -if someone wants to crash the game, it can be done already with many ways if that person can remote-execute code on your computer 🤣

winter rose
#

if

queen cargo
#

showed some already "by accident" (or more because i did not yet installed arma on new disk)

winter rose
#

yeah the array-apply-set directly run from the console, didn't like it 😄

astral dawn
#

if
that's right, in ideal case you won't expose a critical system command to remoteExec just like you would not expose call, spawn, or these array manipulations, so there is no difference.

winter rose
#
private _arr_expected = [9,9,9];
private _arr = [1,0,1];
systemChat str (_arr apply { _arr set [_x, 0]; 9 });

result of this?
9 9 9@queen cargo

#
private _arr = [1,2,3];
systemChat count (_arr apply { _arr set [_x, _x + 1]; _x });```is this also growing up to array max?

yeah, even if spawned, boom to Windows

spark turret
#

All these examples nullify arguments like we can't add this command because then someone can crash your game in MP' -if someone wants to crash the game, it can be done already with many ways if that person can remote-execute code on your computer 🤣
@astral dawn yeah just make a loop outputting 5 hints a second. itll kill your fps down to a complete freeze.

#

bonus points if the receiving player gets the hint audio bing at 5times / seconds

astral dawn
#

I have seen enough things like - what if I do something specific within a UI event handler, boom my game crashes to desktop

#

Hopefully I have forgotten what exactly I did

spark turret
#

i managed to bluescreen my pc yesterday with arma testing. i hope it wasnt arma lol

#

imagine yielding such power..