#arma3_scripting
1 messages · Page 605 of 1
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
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.
yeah thats what I was told too when the == fix was made and I complained about it
Well sqf is awful is almost every aspect (except the commumity docu) so theres that
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
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...
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
https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/OriginShift.html
Not sure if Arma uses that.
Positions in Arma are floats, I don't know what physx uses internally
Oh cool they also (maybe) do origin shift! I ll have to look into that, especially how that works in MP
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
Yeah but you can notice wobble at around 10km on stuff like computer screens and small details. So 6 is to play it safe
yeah sub-mm wobble, but things in Arma don't need to be that exact
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];
titleText [format["<t color='#FFFFFF' size='2'>%1</t><br/>", endTime], "PLAIN", 5, true, true];
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
I was using just this, let me test those real quick
hint str endtime;
mine better perf
yeah they both work fine, thanks for the help.
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...
you have another issue somewhere else @fair drum.
yeah it looks like I do... cause i removed the line and its doing it still for those units...
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?
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
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
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'";
The init eventHandler can't be used in scripts and is only for use in an object's config
yes its in the config eventhandlers init
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
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
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
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
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?
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!
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?
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
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
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
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
Do you use Respawn Templates?
Because in that case simply remove the respawn point from the vehicle and place a new one elsewhere
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
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
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
Is there anything for checking whether a point is in a boundingbox?
inArea?
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"
also, is there a way to define which items go in which containers using CfgRespawnInventory?
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
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.
Is there a script which will have airplanes flying through the map on Altis ? Or can I do something like that on my mission?
Damn that can only be used in single player according to the BI wiki
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
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 
why is that
aah... does it only know the position where the current animation started ?
PFH… Public Fariable Handler?
:P per frame handler
@jaunty zephyr getPos or getPosVisual?
_unit distance _waypointPosition ... i guess that would be getPos on the unit? 🤔
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
@jaunty zephyr getPosATLVisual distance _waypointATLposition
@winter rose aah you're right. visual updates every frame.
man that feels so wrong on a basic level
of course I'm right!
But yeah easily forgotten ^^
(that I am right, and the visual thing)
Ok thanks Lou
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.
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.
@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".
@spark turret use if (isServer) then { or initServer.sqf
Also you don't need forEach in that join problem since join accepts an array
ah true
(units _ai) join (group player)
isServer doesnt solve the problem. the EH has to be added locally, but only once
initPlayerLocal.sqf, or remoteExec with JIP true from a server-only location
@hallow mortar @spark turret thank you very much for the help got it
if (isServer) then { [...] remoteExec ["addMissionEventHandler",0,true]};
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
@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.
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
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?
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.
try to always mention mods on scripting questions in the future @tough abyss
is there an eventhandler for spanwing zeus units?
cooll thx
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
can you show the full description.ext?
because it's most likely an error somewhere else
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
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
so this is your complete description.ext file?
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
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
};
shows in the loading screen the your name mission name etc
regarding the weapon nothing
but it still doesn't load?
well, to limit stuff in regular arsenal you need to arsenalRestrictedItems[]
no idea how WL works
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
would this be the proper channel to discuss mod scripting or?
According to channel description yes.
Grez would you happen to have any idea what the value 23 means
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
BIS_fnc_arsenal_data is an array (not function afaik) containing all items in the arsenal
ahhhhhhhhhhhh
no.23 is just the 23th value in that array
gotcha gotcha, ill read up on arrays and try to help, if you run into an ace dev mind sending them my way?
hey ho, someone got a quick tip on how to disable all thermal visions in am mission?
it often is too overpowered
I wonder what happened to the other 20 values then. either way ill try adding a 24th one and see what happens
@proven heath take a look at https://github.com/acemod/ACE3/tree/master/addons/medical_treatment (ACE_Medical_Treatment.hpp and ACE_Medical_Treatment_Actions.hpp)
@tough abyss all "numbers" are used and mean different items... eg pistols, rifles, launchers, ammo, headgear, etc
🤔 so would I need to go through the grand config viewer to find their assigned number?
@tough abyss can you edge out yur problem again for me?
@spark turret did you try https://community.bistudio.com/wiki/disableTIEquipment ?
cool Grez, i will try that out
@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.
some specific weapons and launchers
nope
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.
ah so I misunderstood it. ill change it to 0 see what happens
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
all classes in class ACE_Medical_Treatment_Actions {} are actions processed by ACE Medical, even when you have that class in your own mod
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;
};
};
MEU_Ibuprophen
Ibuprophen
One is not like the other
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
everything should have a tag/prefix though
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;
};
};
};
you can register your own tag
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
at least there was some kind of arma website for regisitering your own tag
like, 2 years ago
that already died during Arma 2...
oh lol
class Medication
that class isn't a class inside there
https://github.com/acemod/ACE3/blob/b2f4b8ea20489df05e366683f6ddf34a2eeb1daf/addons/medical_treatment/ACE_Medical_Treatment.hpp#L557 this class is in a different place
class ACE_medical_treatment
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
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?
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
ok i know little to nothing about macros
_xx is the only macro i kinda am able to use
@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
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
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
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
looking at how KAM is handling it it's exactly the same as I described
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
ooooooooooooooooooo yea thanks for catching that
should i import these ace classes as well or will it patch as long as it loads last?
add class FieldDressing; to make sure it's available (class inheritance)
and yes, you need to make sure ACE is in your requiredAddons array
gotcha, time to see if that does it
still nope, gonna try inheriting off morphine more directrly
i was tryna make something funny now im down a rabbit hole
@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
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
You could try https://community.bistudio.com/wiki/BIS_fnc_drawBoundingBox though I've not used it and don't know if it fills the box sides like that
nvm I'm dumb
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
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
Not quite what I had in mind, here is a screenshot:
https://i.imgur.com/g2fvSe2.png
The bottom plane that is highlighted
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
Editor triggers have a useful "server only" checkbox in their attributes
Never really worked with triggers, sorry can't help. I prefer to write pure SQF

i wish i could do that but currently I need a little bit visual as well
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
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
say2D is still subject to distance-based and environmental attenuation. Try using playSound with the parameter to make it sound like a radio message.
mk noted. I found out also that I had to use globalChat because sideRadio/sideChat text gets muted by TFAR.
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
@tough abyss it's usually #creators_recruiting, but I can do that
Would it be possible for AI to be attracted towards gunfire
start moving to gunfire slowly and cautiously
firedNear EH for distances < 70m
Otherwise, Fired EH on everyone and move a specific group there
How does selecting a faction work? Do you just select it before being deployed?
@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
@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
hey can anyone tell me how to set the direction when using ("className" createVehicle [0,0,0] ) ???
setDir?
@coarse sedge
"className" createVehicle [0,0,0]; // returns a vehicle
("className" createVehicle [0,0,0]) setDir random 360; // does the trick
thanks heaps im new and having trouble finding what im looking for sometimes
hi new, I'm dad!
the channel is here for help, anytime 😉
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?
yep
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.
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;
no xD
this ^ is not an Event Handler? 🤔
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
isn't this simpler?
waitUntil { sleep 1; vehicle _player == _plane };
[_taskname,"SUCCEEDED"] call BIS_fnc_taskSetState;
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
yet this is what you are doing with call here
its not running parallel?
nope
"waits for it to finish and return" ah whoop
better read the description. so whats the correct way?
you want this task to complete only when everyone is boarded, correct?
no, for each player when he boards, independent from the others
how did you create each task then?
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
scripting-wise yes, it's parallel
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?
…wat?
ah that wasnt the problem. i had an undefined var.
waitUntil will run code in loop until it returns true
yes, code with -showScriptErrors - saves lives
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?
@coarse sedge multiline will save you:
private _vehicle = "className" createVehicle [0,0];
_vehicle setPosATL [0,0,0];
_vehicle setDir 0;
bonus: more readable
thankyou very much @winter rose
anyone remember the # commands that playback splash screen with little re-loading?
as i remember it feels like #squarsh or some like that
I might need more precision than that though :3
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
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)
it does
lol why in the world would nearTargets return random objects?
like?
like a toolbox
them sneaky toolboxes 👀
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?
show code
_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
isNil takes a string or Code
_enemy = _enemies select _idx select 4;
use selectRandom
then ill have to find the index by searching the array
your issue is coming from _idx.
yeah im quite sure you re right
oh i know. count enemies != index of last array position
_idx = round ((random 1) * count _enemies);
_idx = floor random count _enemies;
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.
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?
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!
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
Heres script_macro.hpp https://sqfbin.com/nuhabegefuzaxugaquda
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
I do not understand a thing you just said 😂 but how do I go about doing such thing?
Sorry to say but...
Bear in mind I don't do any type of coding at all. Thank you!
Neither will we 😉
Mhm maybe start with something simpler like spawning a car or sth to get into sqf
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
There usually are never any out if the box solution to arma, Especially if you want to modify another script
Ah ok. Thank you
Is it a single player mission?
No it is a multiplayer mission
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
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
(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
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
Hm idk about the triggerd but you can have multiple respawns, the player can then choose.
So it wont necessarily deactive the first one
just looking to delete the first one after a trigger
Ah, well just kill the marker. Dont think it ll do harm. Dont quote me tho
you'll need BIS_fnc_removeRespawnPosition
copy that
because the marker itself is just a marker, nothing else
does not work with respawn position module in editor
returns true with no change
nvm
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
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
in 3den name the Respawn module and use the following:
https://discordapp.com/channels/105462288051380224/105462984087728128/733330343318257685
what part would I change on that?
wherever/whenever you want to remove a respawn location
throws an expression error at getvariable
_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)
whats the command that creates a text box on the screen that you have to click okay to move past?
hintC
displays an attractive hint... oooh ( ͡° ͜ʖ ͡°)
There is also a BIS_fnc that shows a confirmation window, but I don't know it off the top of my head though
BIS_fnc_guiMessage ?
Thanks! @fair drum ^
well, assignedTarget is aL (local argument), so I assume it's the same for getAttackTarget
@fair drum endMissionServer remoteExecs endMission, so same difference ^^
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
either vectorAdd to achieve what you intended with [x,y,0] + [100,100,0]
https://community.bistudio.com/wiki/vectorAdd
_target = (getmarkerpos _marker) vectorAdd [100,100,0];
or getPos alt syntax 2 might be easier if you want a random position based off the marker pos.
https://community.bistudio.com/wiki/getPos
_target = (getmarkerpos _marker) getPos [100,random 360];
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?
@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;
};
};
it should apply to all rounds in that iteration of the while loop
i guess i could implement some sort of for argument to do it each round?
you can simply move the getpos to inside the foreach loop. then it would be random for every round
Internet went down but now on my phone... Can you do a for loop inside of a while loop?
yes
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 -_-
you’d use filepatching. im sure there is an explanation of it on the wiki, but i cant find it right now.
thats a word i haven't found and will add that to my google searches. thanks friend 🙂
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
ya sorry, they are functions.
setup as functions i mean
i'll look into that as well
CfgFunctions entry right?
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
You can't recompile existed CfgFunctions functions in-game because anti-cheating, not to break the game, or whatever AFAIK
i see some documentation that contradicts that, but i'm not sure if it's still valid
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Recompiling
"recompile = 1; // 1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already)"
Ah well. I think I forgot this because never tried that
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...." 😆
I'm not a wiser man so I only do modify the MOD every each time when apply the change, while finalizing ¯_(ツ)_/¯
and that involves reloading your entire environment right? client + server?
I really don't know about Multiplayer things. Depends on what the function does and scope, that's a yes I guess
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
test an addon
What do you mean?
load the contents of my addon, into arma, without packing the contents of that addon into a PBO
in editor or with filepatching. editor is fine for testing scripts in most cases.
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.".
https://community.bistudio.com/wiki/CMA:DevelopmentSetup#Develop_with_unpacked_data
this is the link i was looking for i think
I'm new here...
Mmm this is the article that I didn't even knew
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.
@fair drum setVehicleAmmoDef might be what you want
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;
huh - yeah. Don't use that.
well the above works, but when I use {_x setVehicleAmmoDef 1} forEach units _group instead, it does not work.
What you want:
- refill soldiers ammo? or
- refill vehicle(s) ammo
refill the vehicles' ammo
then use my code, with vehicle _x
{ _x setVehicleAmmoDef 1 } foreach (units _group select { not isNull objectParent _x } apply { vehicle _x });
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?
it is selecting every unit that is in a vehicle
{(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 };
okay that helps with understanding when written that way
intermediate variables are better for understanding than one-liners, true
never forget that you write code for humans, not for machines 😉
@tough abyss find out. I don't know if AI distributes the attackTarget over network, I'd assume no.
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)
the player is not in a vehicle until the animation of getin is over afaik
as for not in a vehicle on getout, IDK
Ok. So how to catch this animation or this status?
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
[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?
@young current this is how it works. True. But how to catch the process when it starts but the player is outside a vehicle?
You probably cant
GetIn eventhandler is probs only thing related to that
And maybe comparing the phase of the animation
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?
correct, https://github.com/CBATeam/CBA_A3/blob/master/addons/main/script_macros_common.hpp#L892, in your case it will expand toace_medical_woundReceived.
When a player get in some vehicles, he is standing still but hatches are opening. So cannot get the phase of animation 😦
there is no out-of-the-box "isGettingIn/Out" scripting command though
@winter rose I understand it. Is there any workaround or some algorithm to catch the moment?
Just any thing to work with
closest you can get is this probably https://community.bistudio.com/wiki/inGameUISetEventHandler
@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
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
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?
you could grab the anim and use animationChanged EH?
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
I thought this immobile thing was part of the get in animation itself 😦
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
the player is not
ina vehicle until the animation of getin is over afaik
as for notina 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
yep, as HG stated above it depends on the animation type
is there a delete version of append or pushBack? or is _arr = _arr - [_element] good enough?
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.
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.
select with code will be much slower than both find and arr-[element]
Yes, you are right, Dedmen
Ah. ty
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
thanks
ace_arsenal_displayClosed
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.
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 ?
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
@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
@still forum lights and particle emitters too I guess; emptyDetectors (triggers) maybe? (though it can be dangerous)
hm thats not necessarily better
it does what you wanted, what's your point?
yeah you re right
How does it? Its something completely different?
just needs a little bit more fiddle
you can use arrayIntersect to filter out elements you dont want, i guess its good for dooing a lot of elements at once
I don't think lights are blocked. Haven't looked at it in a while
you cant delete an element from array without knowing its index unless you want to delete all matching elements of an array
findAt would need a loop
you can use arrayIntersect to filter out elements you dont want
how? it removes duplicates but besides that?
@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
unsafeCVL is currently not a thing so that won't help you, Don't think there is a list posted anywhere
ive seen it in the ace arsenal wiki.
like you intersect the arrays of 2 loadouts and only add stuff that does not intersect
Ah ok, thanks!
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
it needs some mental gymnastics, but it's entirely possible
ah it only returns commons, so you only need to filter one side, or do a whitelist kinda thing
but also kinda right
i still dont see how it would be better or necessary
well its like 1 line instead of a loop
findAt is not a thing btw
findOut
time for NCA_fnc_findAt
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?
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
so kind of like arrayIntersect but return the other half, the one that doesnt intersect
time to find out how to make ai talk over radio
is there a list of radio text from cfg radio?
configFile >> CfgRadio
Eden → ` → config viewer
player sideRadio "theRadioSound"
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?
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.
Do I need to make my own description.ext file for that then?
inside the mission folder, yes
Okay, thank you!
Ugh 400 radio sounds
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?
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
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?
what do you mean "it didnt work"?
@serene ridge you can test respawn in the editor starting an MP editor session
and no, you dont need to
remember that the editor default environment is singleplayer
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
at the start of the mission?
…mods?
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*
beware of description.ext**.txt**
make sure windows explorer is set to show extensions
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!
Yeah funnily it worked when I put it in the right folder 🤓
@serene ridge it has a tendency to do that 🔨
how do i get the objects vector up?
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?
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
@spark turret …vectorUp?
that's probably your issue
@unreal scroll language, edit your profanity out now.
so your _element here is a scalar and not an array
"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."
?
if (!(_element isEqualTo []) && (typename _element isEqualto _params)) then {
_homogeneous append _element;
};```
s word.
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
Can you read the function? Look at it again. It is pushback for element, and append for arrray.
!(_element isEqualTo [])
if (typename _x isEqualto _params) --> _homogeneous pushback _x;
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?


"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
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
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
isEqualType
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.
(!(_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
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?
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
Aaa... Ok, fixed ))
Yes, it works as intended.
it's not elegant, but it works, so meh. whatever floats your boat
also, good luck with it!
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.
theres a better way to de-nest arrays if they only contain numbers
but you passing datatype I assume thats not the case
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.
🤔
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);```
diag_log returns Nothing though?
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"};
};
argh ... youre right @winter rose 😅
tiny mistake Fixed
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
@tall hull >> #server_admins or #creators_recruiting
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
Probably not the best start, but it's a start: https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
the wiki in general is a minimum requirement if you want to do some #arma3_scripting
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
Probably not the best start, but it's a start: https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
@exotic flax ill take a look
also thanks @ebon citrus and @exotic flax for the help
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)
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.
so basically "if destroyed, respawn in position, with init script"
yes
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
- the X and Y values are not defined in the function
- only the last line can be returned, so use a variable to return
yeah xl,xh,yl,yh are defined elsewhere
they need to be defined INSIDE the function
yeah, just noticed that, they will be passed via params
and what do you mean only last line can be returned?
@hybrid pier you most likely need to use the Killed EH, and run the "init" script manually after creating a new vehicle
okay
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
};
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?
simply attach the EH to the vehicle
EH?
oh 😦
@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
I just spend way too much time on the wiki 😛
😄
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.
thanks a lot for those functions, really hard to find them with names like that @exotic flax
@hybrid pier check https://www.gruppe-w.de/forum/viewthread.php?thread_id=2235 (yes is German post, but code is English), which is actually working pretty well
@exotic flax have a quastion
I might have the answer
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?
sounds like a locality issue (meaning the server only runs on the server or editor, but not on clients connected to the server)
sry am a noob and not so smart. is there a way to fix it?
most likely a problem in the addAction or the script that it calls
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
?
null = [RL_2,8,0,12
-->,<--[3,-1,0,-1,objNull]] execVM "scripts\initTargetRail.sqf";
and than work the script?
it should, although I don't have a working test version of it
no, but I'm living in Germany for 5 years now 😉
Nicht schlecht, obwohl die Sprache im Vergleich zu Niederländisch zu schwer ist ;)
although let's keep it English to follow the #rules
friends? then can we also write private messages?
and I really dislike my German keyboard 😛
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
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.
so it doesn't really help?
the rail script does not work always get an error message when connecting to the server.
did you add the script in the mission?
yes
yes I see a problem in the script on the page says moveTargetRailExt.sqf
and the server looks for moveTargetRail.sqf
I just noticed the same in a simple test mission, and making some small changes does fix it
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?
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
whats the command to create the little score/ticket boxes at the top right of the screen?
I don't believe there's a command/function for that
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?
Start your code block with ```sqf
and end it with ```
that will fix your formatting
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?
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];
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.
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
thank you for this chat's consideration ^^
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
nope - but the Conversation system
https://community.bistudio.com/wiki/Conversations#Manual_conversation_example
see kbWasSaid
@spark turret
in the next patch, playSound will return the sound-emitting object, you can check when it is objNull meaning it has filled its purpose
any chance that will be expanded to the radio commands as well?
like sideRadio etc
so far no good, but perhaps 🐮
meh
you can still make a ticket, you will get your answer - anyway, it's not for right now
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
not planned for radio commands, didn't look at that, and now might be a bit late if you need it soon 😄
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?
Probably because it's in unscheduled space
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
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?
are you using the latest devbranch ?
I don't know what you mean; can you post your actual version?
also it seems that just some sounds are falsely returned as isNull
Just use productVersion to get version
["Arma 3","Arma3",198,146379,"Stable",true,"Windows","x64"]
You can use simple workaround - just sleep for total length of the sound
Or wait until next stable update
nope - but the Conversation system
https://discordapp.com/channels/105462288051380224/105462984087728128/735069570473132083
@unreal scroll
yeah im using the other example now where it selects the nearestObject soundsourceoncar as the sound source
@winter rose ??
it still seems to be quite random which ones are displaying the correct length and which ones arent
there is no way at the moment to get the sound length @unreal scroll
(his request)
Ir0nsight wants to avoid manual processing
"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)
Every sound file has its own sound length
?
every sound has a length, but there is no way to get this value by scripting
So? I can calculate the overall time, and set it as delay. It is a manual way, but it will works.
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
diiid you use the latest devbranch?
then the playSound trick won't work ¯_(ツ)_/¯
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
"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?
[["oldman_ambient_dialogues_015_am_syndikat_dialogue_a_AMBCIVILIAN_6",0.138977,0]]
thats what arma claims is the length of this audio.
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
im special 🤷♂️
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"
yep, it's neither in CfgSounds or CfgRadio
you can use the Conversations system to use them though
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
kbTell needs a .bikb declaration @spark turret
that means?
and that bikb file has to be created for each mission?
and it holds the defined sentences with corresponding sound file paths
a bikb has to be referenced if you want to use kb commands - shared between missions or not, no difference.
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
];
it takes its words from the radio protocol words
so do you have to define each word with a file path in the bikb or can you use already existing radio protocl words?
Words are already defined
But you have to define the sentence itself
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
Yep
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
kbAddTopic yes
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 😠
filled with rage and frustration, i began debugging
Theres nothing to debug bc theres no error
@winter rose @warm hedge I would like to load the vehicles multiple times in the Mission does it work with attach to ?
if you script it, yes
So does the script use ViV ? Or is it something different ?
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
It must be bigger than the cargo space
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 };
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
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"
isArray, isClass ?
yeah i didnt read the error corretly
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
magic ¯_(ツ)_/¯
okay.... so topic and sentence have to be different strings
no wait
now it works again in the old, not working condition. magic indeed
lol arma conversation contains "Thanos"
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"; };
};```
"empty"
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"; }; };
should be default
the switch magic variable is privated to inner scope indeed
it better be for a good thing X39!
Actually 🤔
Should print empty and magic?
while I'm having fun doing a QTE function here 😄
Is it possible to have a condition for the mission intro text?
private _arr_expected = [9,9,9];
private _arr = [1,0,1];
systemChat str (_arr apply { _arr set [_x, 0]; 9 });
result of this?
private _arr = [1,2,3];
systemChat count (_arr apply { _arr set [_x, _x + 1]; _x });```is this also growing up to array max?
it crashed my game, so yes 😄
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?
When you use driver vehicle, does it return objNull when there is currently no driver?
@slate cypress objNull yes
…?
I have a vehicle with a variable "leadVehicle". I have a trigger which needs to be able to see "leadVehicle" variable.
then use leadVehicle?
I have but the code isn't working. I'll send.
@spark turret there is assignedVehicle but no groupVehicles
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.
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
the mission intro text?
does that order a unit to do fire support or spawn mortars from thin air?:
BIS_fnc_fireSupport
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
Oh might be
depending on its type you can find it on the wiki:
https://community.bistudio.com/wiki/BIS_fnc_dynamicText
https://community.bistudio.com/wiki/BIS_fnc_infoText
https://community.bistudio.com/wiki/BIS_fnc_textTiles
https://community.bistudio.com/wiki/BIS_fnc_typeText
https://community.bistudio.com/wiki/BIS_fnc_typeText2
https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_SITREP
@slate cypress
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?
@wispy cave Check this:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/ScriptedEventHandlers
Arsenal is an entirely scripted thing. So it used scripted event handlers.
thanks
Thanks
_arr = [1,2,3];
_nested = [_arr];
_copy = +_nested;
(_copy select 0) set [2, 1];
systemChat str [_nested, _copy]
``` What is this outputting?
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
bamboozle
stahp breaking mah computerrrz!1!
All these examples nullify arguments likewe 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 🤣
if
showed some already "by accident" (or more because i did not yet installed arma on new disk)
yeah the array-apply-set directly run from the console, didn't like it 😄
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.
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
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
this stuff complicated