#arma3_scripting

1 messages ยท Page 749 of 1

south gale
#

Thanks

#

If someone can hop in VC with me this is getting out of hand, none of my scripts are working

coarse dragon
#

How would I get a battleship to fire on a area of the map?

quasi sedge
coarse dragon
#

Oh.. its that easy?

quasi sedge
next meteor
#

Hey, I am currently trying to make a RHS-SU-25 make a bombing run on a designated target (by waypoints).
Current script is this forceWeaponFire ["rhs_weap_fab250", "LoalAltitude"];
Looked the weapon type up and added the one which was shown on the list. Under Mode (firing mode) there is just a "this. Might this a problem with "LoalAltitude"? Why doesnt it work with "this" then?

#

Currently thinking of maybe switching the pylons somehow to vanilla bombs and use the base script I found, but would there the addMagazineTurret or smth like that work?

copper raven
coarse dragon
#

Why does !alive work

#

Well.. not work

distant oyster
#

it does

coarse dragon
#

Yet it don't

fair drum
open fractal
#

How does preloadObject work? I don't see an indicator for locality on the wiki page, or really an explanation of how it functions.

fair drum
#

i would treat that as a local command

open fractal
#

I'm having a hard time figuring out if it's a setting for the object or for the machine rendering it

bitter jewel
#

after a player takes control of a unit, the units face gets swapped to the players face. is the data about which was the units old original face completely discarded, or does that information still live somewhere during the mission?

lyric copper
#

Does anyone know what are the common culprits for BIS_fnc_init being evaluated to false and causing BIS_fnc_preload to timeout? Created a new MP Type module and starting to loose the plot.

Symptoms:

  1. Connect to server and play mission - no problem here; server and clients preload <300ms
  2. Complete mission or issue #restart server command
  3. Mission starts. Server preload finishes <300ms. Client preload times out at >20000ms - only load screen active is BIS_fnc_preload but BIS_fnc_init check returns false throughout preloading

edit:
no (custom) functions running in the preinit or postinit phases. Only 1 module placed running a custom function - module function is spawned. No script errors in the RPT

little raptor
#

What you ask is not related to regex at all. regex is used to find a pattern in text.
maker types are defined in config

little raptor
#

in mission.sqm
oh right meowsweats
well type is used for many other stuff, not just markers, so you still need to check the config, or dataType in mission.sqm
but anyway, the regex is:

type *= *"(\w+)"

if there are no spaces before and after = you can just write:

(?<=type=")\w+?(?=")

which won't highlight the type=" part

hasty current
#

If a unit has allowDamage set to false, are there any event handlers relating to a unit being hit that still get called? I want to make a unit that runs away if hit but cannot be killed/actually damaged. I tried Hit, but it seems it didn't work

copper raven
#

tho it's probably the same story

little raptor
#

there are some weird cases that handleDamage can't handle tho meowsweats

#

damage from projectiles and other external sources should be ok

hasty current
#

Will that work with ACE, though?

little raptor
#

dunno. iirc no meowsweats

#

but you better test

copper raven
hasty current
#

I mean I did try it earlier and it didn't work, but I'll try again in case I did something wrong

little raptor
little raptor
#

I remember that ACE had a weird damage bug despite the fact that I had disabled damage

#

I think it was passing the damage from handleDamage thonk
if so it should work then

hasty current
#

Here's hoping ๐Ÿคž

little raptor
hasty current
pearl night
#

Hello,
what would be the script to play the mission completed ending cinematic on the server without actually ending the mission?
I want the player to know the mission is over so they can disconnect, but I want to save their loadouts so I need the mission to keep running.

winter rose
#

(Mr Kain, let me tell you I appreciate your legacy)

pearl night
# winter rose you can end the mission _and_ execute a script?

An oldtimer, eh? Nobody remembers the game these days. ๐Ÿ™‚

Anyhow, I'm not good at scripting, I need to export them manually. I'v tried the export mission.sqm in the zeus, but it won't export players loadouts, only AI. Is there a script to export players loadouts?

winter rose
#

well how do you want them? is stored in your user profile ok?

pearl night
winter rose
#

okay, now I see ๐Ÿ™‚
you could save the loadouts in e.g profileNamespace (saves even after restart) or uiNamespace (lost after game shuts down) or "just" the clipboard

#
profileNamespace setVariable [
  format ["KAIN_%1_%2", missionName, systemTimeUTC],
  allPlayers apply { [name _x, getPlayerUID _x, getUnitLoadout _x] };
];
```something like this
pearl night
winter rose
#

@little raptor do better plz

little raptor
winter rose
#

well what about the case where a player disconnects?
server-side

#

he manually runs the script at the end of the mission

format ["KAIN_%1_%2", missionName, systemTimeUTC]
```can be replaced by```sqf
format ["KAIN_%1_end", missionName]
```ofc
little raptor
#

yeah that's what I meant

pearl night
#

Guys, I'm not following. ๐Ÿ™‚

#

Give me something foolproof. ๐Ÿ™‚

little raptor
# winter rose <@!360154905148653568> _do better plz_

if I were doing it I'd be using a hashmap on the server, with [uid, loadOut] pairs. I'd update this HM with every time someone disconnects. (tho not sure if the loadout can even be fetched then?)
once the mission ends (using MPEnded EH), I'd save the hashmap to profile namespace...

so yeah it's a long answer and I'm not in the mood meowsweats

pearl night
#

I can just execute it manually before the mission ends. And I just need the loadouts of surviving players that are still connected.

little raptor
pearl night
#

Ok, I will try it out. Thanks.

bitter jewel
#

can i turn a units string representation back into a reference to the unit

little raptor
#

you can use a hashmap for example
or use setVehicleVarName and assign unit to that var

_unit setVehicleVarName "varName";
missionNamespace setVariable ["varName", _unit];

//get:
missionNamespace getVariable [str _unit, objNull];
#

but ofc you better avoid this whole nonsense meowsweats

bitter jewel
little raptor
bitter jewel
#

normally i wouldnt but currently i am trying to collect any number of 3den entites in the editor, based on their attributes, and store them somewhere to be processed after the game has started

#

i am trying to avoid giving them variable names

#

they have their string representation in the editor tough, so i was wondering if i could use that

little raptor
bitter jewel
#

well then i can forget that route

#

thanks anyways

crude vigil
# bitter jewel normally i wouldnt but currently i am trying to collect any number of 3den entit...

Why dont you just use layers for that, it is easier to split your stuff into layers then you can access these layers' objects using these commands:
https://community.bistudio.com/wiki/get3DENLayerEntities for 3DEN
https://community.bistudio.com/wiki/getMissionLayerEntities for Mission (watch out, server only)

Plus, it is more productive, you can easily add/remove any object easily from related layers in case of change is needed.

bitter jewel
#

thanks

bitter jewel
#

can i write a macro where i get an element from an array

#

since # means quote

#

oh right i forgot the about select command

acoustic abyss
#

I'm trying to use the ED-1 Science drone ( "B_UGV_02_Science_F") as a prop. Small problem: when set to a simple object, a permanent light is created. How do I delete this light?

winter rose
#

maybe through animation I'd wager

acoustic abyss
#

Intriguing! How do you mean?

winter rose
acoustic abyss
#

Thanks. We'll investigate ๐Ÿ‘ฉโ€๐Ÿ”ฌ

acoustic abyss
#

Does animateSource have an effect on simple objects?

compact maple
#

If I expect a hashmap in params, is it correct?

private _buildings         = param [0, [], [[]]];
winter rose
#

no

#
private _defaultHashMap = createHashMap;
params [
  ["_buildings", _defaultHashMap, [_defaultHashMap]]
];
compact maple
#

Thanks ! ๐Ÿ™‚

late parrot
#

Is there anyway to add 2 actions to one interaction?

#
 this addAction ["Interact", {systemChat (selectRandom   
[ "Text1", "Text2", "Text3", "Text4" ]) 
["task1","SUCCEEDED"] call BIS_fnc_taskSetState},   
nil, 1.5, true, true, "", "alive _originalTarget", 4, false, "", ""];```
crude vigil
late parrot
#

Yeah I mean whats the proper format to get 2 actions under an interaction

crude vigil
#

What do you want to do exactly?

late parrot
#

Have the system chat display a random text along with task being set to succeeded

#

If I through a && it will run but will give a debug message

crude vigil
#

Simply end your first line with ;

late parrot
#

So if I wanted to add more to an interact I'd just end each param with a ;?

#

and here I was doing the most.

crude vigil
#

not each param but each statement or each time you use a command(to simplify), you need to end that line with ;

late parrot
#

I appreciate it

crude vigil
winter rose
#

@pearl night wazzup

#
profileNamespace setVariable [
  format ["KAIN_%1_%2_end", missionName],
  allPlayers apply { [name _x, getPlayerUID _x, getUnitLoadout _x] };
];
```but this won't create a file at all
it will store data in your user profile
#

you can get it using getVariable

pearl night
winter rose
#
profileNamespace getVariable "KAIN_theMissionName_end";```
#

of course replace theMissionName with what missionName was at the time

pearl night
winter rose
#

I would say yes

#

but this will only get the var, you have to do something out of it

pearl night
winter rose
#

no

#

what you want to do should ideally be scripted in-mission, either that or give your players access to an Arsenal really

pearl night
# crude vigil Are you asking about this?

Well, basically, I'm hosting a mission on my dedicated server. The mission is zeused by me. I want to carry over players equipment in between missions, so they start a new mission with the equipment they had on themselves at the end of the previous mission.

I wanted to export them by hand, but now I'm trying to make through the variable.

crude vigil
#

I understand

#

you cannot do it through variable though.

winter rose
#

using player UID and array correspondence

#

but meh

crude vigil
#

oh well servernamespace is a thing right

#

I forget that..

#

altho I never got to use it...

winter rose
#

profileNamespace no? because serverNamespace will disappear as soon as the mission exits iirc

crude vigil
#

profileNamespace is not a suitable thing for such operations, a player can cheat with it.

pearl night
#

Too bad that the Export Mission SQF module exports only AI and not the players.

crude vigil
#

hmm, he ll store all loadouts to his profile... Mmmmmhhhh...

crude vigil
crude vigil
loud jay
#

In 15 minutes, the winning team will be the winner

#

I want a script that defines a combat zone between two teams, and whoever controls the combat zone within 15 minutes will be the winning team

winter rose
#

ok
how do you approach the issue?

loud birch
#

idk if this is the right channel to spit ball but

#

it'd be cool if there was a way via sqf to change the sky colour

#

afaik stuff like that is defined in CfgWorlds which I know can someone be fiddled with via scripting

somber radish
#

Anyone got a template lying around for making a mod. (I have read all I can come across). However I cannot get it to work. All I need is a "minimum Viable example".

#

It is literally just a FSM file but I want it in the "Mod-format" so it can be uploaded to Steam-workshop". Kinda like the Smarter tanks FSM.

crude vigil
somber radish
#

It doesnt work

#

I mean it is packed and signed

#

The image loads

#

However on mission-init nothing happens

crude vigil
#

so you say you got a fsm file and how is it being initiated?

somber radish
crude vigil
#

what does FSM contain?

somber radish
#
/*init.sqf*/

//[450, true, true] call DCO_Fnc_Vehicle;
sleep 1;
[450, true, true] execFSM "Functions/Fn_VehicleFSM.fsm";
hint "DCO_Vehicle_FSM has loaded dudes and dudettes";
#

Oh it is a big file

#

It does work fine when placed in a mission

#

and initiated from init.sqf

crude vigil
#

is that all that is in this file?

somber radish
#

The Vehicle.fsm file contains about 5k lines

crude vigil
#

How do you understand it does not work?

#

no hint?

somber radish
#

Yeah, it should give a sys-chat saying "FSM loaded"

#

And plenty stuff in the RPT file

#

but nothing

crude vigil
#

Config wise, you do not define a file for functions to be read from, thats the first thing. You need a file for init.sqf to be found.

somber radish
#

Config.cpp:

class CfgPatches
{
    class MyAddon
    {
        // Meta information for editor
        name = "DCO Vehicle FSM";
        author = "Tally";

        // Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game. Note: was disabled on purpose some time late into Arma 2: OA.
        requiredVersion = 1.60;
        // Required addons, used for setting load order.
        // When any of the addons is missing, pop-up warning will appear when launching the game.
        requiredAddons[] = { "A3_Functions_F" };
        // List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
        units[] = {};
        // List of weapons (CfgWeapons classes) contained in the addon.
        weapons[] = {};
    };
};
#include "cfgFunctions.hpp"
crude vigil
#

no you need to target the function's file (ie. fn_init.sqf within init class)
or even better target the parent class with the folder fn_init.sqf is in

#

#include "cfgFunctions.hpp" just copy pastes ur cfgFunctions.hpp file into config.cpp and does nothing else.

somber radish
#

something like ```sqf
init = someVarName;

?
crude vigil
#

is the function inside a folder called DCO ?

somber radish
#

DCO is the TAG

crude vigil
#

oh, looks like Im still sleepy.

#

you did not define a Category

somber radish
#

ok, trying again

somber radish
#

OK, so new error popped up

script all/fn_init.sqf not found
#

this is the path:

\functions\all
#

and there I do have the file

#

even tried copying a all folder to the root dir

#

but no luck

crude vigil
somber radish
#
class CfgPatches
{
    class MyAddon
    {
        // Meta information for editor
        name = "DCO Vehicle FSM";
        author = "Tally";

        // Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game. Note: was disabled on purpose some time late into Arma 2: OA.
        requiredVersion = 1.60;
        // Required addons, used for setting load order.
        // When any of the addons is missing, pop-up warning will appear when launching the game.
        requiredAddons[] = { "A3_Functions_F" };
        // List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
        units[] = {};
        // List of weapons (CfgWeapons classes) contained in the addon.
        weapons[] = {};
    };
};
#include "cfgFunctions.hpp"

cfgFunctions:

class CfgFunctions
{
    class DCO
    {
        class all     {

                        class init
                            {
                                postInit    = 1;
                            };

                        class VehicleFSM
                            {
                                ext            = ".fsm";
                            };
                    };
    };
};```
crude vigil
#

So the file path from root should be... all/init.sqf

#

not functions/all/init.sqf

#

You are working on config now, not description.ext

#

If you want it to stay as functions/all/init.sqf
you need to utilize file attribute...

somber radish
#

I tried copying a all folder to the root dir

#

What if I just DM you a zip-file containing the project

#

?

#

Kinda hard to explain stuff without being able to send screenshots etc

crude vigil
#

Just utilize the file attribute and be done with it, it is better anyways in the long run. Just type in the directory you want and it will be done.

somber radish
#

ok

#

Found the issue

#

path

#

the folder is the name of the .pbo file

high vigil
#

Any one have idea on this, using this via "Addaction" to Halo AI

#
private _target= _this select 0;
private _crew = fullCrew[_target, "cargo"];
{
  _x spawn {   
    params ["_trooper"];
      if (local _trooper) then {
        unassignvehicle _trooper;
        moveout _trooper;
        waituntil {sleep 0.5; isNull objectParent _trooper && getPosAtl _trooper select 2 < 100 || !(alive _trooper)};
        if !(alive _trooper) exitWith {};
        private _position = getPosATL _trooper;
        private _para = "Steerable_Parachute_F" createVehicle _position;
        _para setPosATL _position;
        _trooper moveInDriver _para;
      };
    };
    sleep 1;
} forEach _crew;
#

issue is when you eject like 50 ai server goes to like 25 fps while eject is happening

#

if you have no idea just try not to post useless information (that some one might take for good advise )

frail vault
#

i am trying to make an init script that deletes everything in a certain area
so i am trying to use the deleteAT and inAreaArray together, but its just giving me errors, any ideas?

little raptor
frail vault
#

ah, that does explain why its not working not doing what i want it to haha

little raptor
#

The error is because you're using them wrong syntax-wise
That's different from "not working"

little raptor
#

You have to add sleep between each ejection

high vigil
little raptor
high vigil
#

lol i wrote it

frail vault
frail vault
#

actually that's i what i am trying atm. the problem is i need to delete everything in the given area, so
i am trying to use deleteVehicle with inAreaArray as of now actually

copper raven
#

so? if you fill the gaps correctly it should work

frail vault
#

i am just asking if he had any suggestions
and if not i am going to keep working at it
the problem is, i dont know how to fill the gap
which is what i am attempting to do

copper raven
#

what do you have currently?

#

it might be better to just run one of the commands that return nearest objects instead of inAreaArray

little raptor
frail vault
#

well i am doing

this addaction["Delete Vehicles", {vehicle forEach vehicle inAreaArray ["targetAO", 50, 50, 0, false, -1]; deleteVehicle vehicle;}];```
little raptor
#

did you look at the wiki examples?

#

actually it's not just the forEach. your inAreaArray is wrong as well

little raptor
tough abyss
#

anyone have some tips for getting into arma scripting composition and public zues not server side? i already know quite a bit just looking for ways to learn more

still forum
#

u all doin good scripts, keep on keeping on

shrewd hedge
#

@little raptor Is there anyway to change MG 42's ammo amount, like change 50 to 1500 rounds? I tried "setAmmo" script like this one: solder1 setAmmo [fow_w_mg42_deployed_high_ger_heer,1500]; but it does not work.

little raptor
#

why do you ping me?

#
 solder1 setAmmo ["fow_w_mg42_deployed_high_ger_heer",1500];
shrewd hedge
#

cause you are the best, I think

little raptor
shrewd hedge
#

ok, I see

shrewd hedge
mental prairie
#

does BIS_fnc_playVideo have to be executed on each client?

little raptor
shrewd hedge
#

typo?

little raptor
#

you've written solder1 instead of soldier1

shrewd hedge
#

oh, i will try again

#

no, not working,

#

I tried to use this: "
unit setAmmo [weaponOrMuzzle, count]"

little raptor
shrewd hedge
#

i use FOW

#

in editor, when I put mouth on MG42 (static type), then it showed up

little raptor
#

wait. are you talking about static weapons?

#

or soldiers?

shrewd hedge
#

it is a static mg42 with a soldier

little raptor
#

what you just said is the name of the vehicle

shrewd hedge
#

oh...

little raptor
# shrewd hedge oh...

you can do something like this:

weapons staticWpn apply {
  staticWpn setAmmo [_x, 1500];
}
shrewd hedge
#

still does not work, I put this line in init of MG42(static type) also in the gunner, but it still does not work

little raptor
shrewd hedge
#

oh, I see

#

then I can only add magasines

coarse dragon
#

Can triggeracivated and alive house. Be in the same trigger?

little raptor
coarse dragon
#

I'm doing a task. One is to blowup a house. And then 2nd one is to escape.

So was wondering if the one trigger can have both of them commands init for the condition

little raptor
#

this && !alive house

coarse dragon
#

Triggeractivated task1 && !alive house;

vernal mural
#

What is the difference between #lightreflector and #lightpoint ? The first one appeared on the wiki recently, and is only mentionned for setLightConePars and setLightVolumeShape commands

still forum
#

Reflector is directional

vernal mural
#

As setLightConePars takes a local argument and has local effect, I'd assume a reflector has to be spawned locally too ?

vernal mural
#

I have this on my screen right now

#

but it does not mention the reflector

#

I just wanted to lift any doubt

#

a reflector is a classic old lightpoint, but directionnal

winter rose
#

yes
this tutorial could be updated to reflect the #lightreflector introduction

coarse dragon
#

If I want a ship to fire at a area on the map. Do I need to put the name of the weapons in the script

cyan dust
#

Good day. I'm researching the revive system, could you share the values of

bis_revive_ppColor
bis_revive_ppVig
bis_revive_ppBlur

?
If I understand it right, they are not global variables, but macro defined in 'defines.inc' ๐Ÿค”

little raptor
#

Afaik they are global vars

#

If they're written like that they're most likely not macros
macros are typically written in uppercase only

cyan dust
#

Thanks, got it

coarse dragon
#

Me want boatie to fire.
Nothing works

little raptor
#

what boat?
typically you have to give them a target, then make them fire using fireAtTarget, or doTarget and doFire

coarse dragon
#

A ww2 battle ship to bombard a town

sick dune
#

quick question: does the playVideo function allow for the video to be played in the field of view of all players?

#

most of the examples of it involve it being played on a screen.

#

I need it to be more of a cutscene.

coarse dragon
#

fireAtTarget ["LIB_UK_ARMY", "groundtarget"]; how wrong is this?

little raptor
little raptor
#

size: Array - (Optional, default [safeZoneX, safeZoneY, safeZoneW, safeZoneH])

sick dune
#

Excellent! The guide wasn't entirely clear on the default.

little raptor
#

that's fullscreen

sick dune
#

does it just start playing automatically, or is there a way to get it to fade to black, fade back in?

little raptor
sick dune
#

I do not, as I am big dumb-dumb noob figuring this out as I go

#

but thank you for assisting

little raptor
sick dune
#

ah, I'll have to do something to try to get it to do so, then.

coarse dragon
#

i cannot get the hang of this stuff

sick dune
#

thaaaaat'll do it.

open fractal
#

you could put it all together in a .sqf file and then execvm it on every machine

#

at least that's what my pea brain would do

sick dune
#

excellent, now I can do it in game rather than trying to get all of them to play a youtube video kekw

open fractal
#

oh dear

sick dune
#

all of this is because my play group is a bunch of morons and I'm trying to idiot proof it for them

#

big case of herding cats

open fractal
#

if it's the group i'm thinking of I believe I've seen a couple documentaries

coarse dragon
#

fireAtTarget [groundtarget,"LIB_UK_ARMY"];

little raptor
little raptor
#

also you're missing the left arg (sourceVehicle)

#

and I don't know where you got the LIB_UK_ARMY from, but I'm 99% sure that's not a weapon/muzzle name. if you don't know it just don't include it. it's optional

coarse dragon
#

name of the tank i made immotral

little raptor
#

my_ship is name of the ship

#

and you should not write something like this in init, if that's what you're doing

coarse dragon
#

the conditions better?

little raptor
#

what condition?

coarse dragon
#

ok, where is best place to write it

little raptor
#

ยฏ_(ใƒ„)_/ยฏ

#

just use doTarget and doFire instead. I doubt you'll be able to use this command properly

#
my_ship doTarget immortal;
my_ship doFire immortal;
#

if you want to try it in object init replace my_ship with this
if that doesn't work try in anywhere but init (e.g. trigger activation)

#

if that still doesn't work your ship may not be able to target/fire at all

coarse dragon
#

Na it's being picky about the firing angle and stuff

#

Thanks for the help anyway

coarse dragon
#

Leo?

#

!alive house; && triggeractivated task1compeleted; am i this crap at this notlikemeowcry

neat karma
#

Is it possible to add and enable zeus for #adminLogged at runtime, by running server-side code from the start menu?

coarse dragon
#

I done two separate triggers and it works lol thanks

patent lava
#

i'm having an issue using BIS_fnc_unitPlay, hopefully someone can find the error or the sqf gods show me the error the moment i post it

#
#include "..\data\alphaFlightPath.sqf";
#include "..\data\bravoFlightPath.sqf";
//#include "..\data\charlieFlightPath.sqf";

private _helis = [
    [alphaHeli, _alphaFlightPath],
    [bravoHeli, _bravoFlightPath]
    //[charlieHeli, _charlieFlightPath]
];

{
    [_x # 0, _x # 1] spawn {
        params ["_obj", "_data"];

        _obj engineOn true;

        [_obj, _data, [], true] spawn BIS_fnc_unitPlay;

        waitUntil { isTouchingGround _obj };

        sleep 3;

        _obj engineOn false;
    };
} forEach _helis;
#

this is my code, the ...FlightPath.sqf files contain the private variable _...FlightPath that have the unit capture data

#

problem: bravo is doing the alpha flight path

#

yes, the capture data is not the same

#

they follow the same path with like a second delay

#

the gods have spoken, i recorded alpha's flight path while i thought i was recording bravo's ๐Ÿ˜ญ

tired delta
#

Hello guys, is it possible to stop players from joining your server with different branches?

#

Like the Profiling branch

dusk gust
# tired delta Hello guys, is it possible to stop players from joining your server with differe...

Could use
https://community.bistudio.com/wiki/productVersion

Though it says "Stable" if its profiling/performance builds, you can probably check the build index and check if its beyond a certain number. May have conflicts with actual arma updates though.

Something like this (Not Tested)

// Run on server init
serverVersion = productVersion;
publicVariable "serverVersion";

// Run on client
if (productVersion # 2 == serverVersion # 2 && productVersion # 3 > serverVersion # 3)then{
  //Probably not on default build
};
#

They actually fixed it, disregard.
Can just check productVersion # 4 == "Stable"

peak pond
#

Hi, any way to access a debug console while at the Arma 3 main menu?

dusk gust
winter rose
#

mods perhaps

peak pond
#

Ok, I'll make a mod, thanks

sullen imp
#

got a question, could someone point me in the direction of a repair and rearm script, you know where they drive onto a like heli pad lookin square and it re arms?

#

im a noob to this lol

tough abyss
sullen imp
#

like a re arm, repair type thing

#

i modded dayz for years, trying my hand at arma now lol

little raptor
# sullen imp immediately

you can simply use a trigger for that if you're making a mission. use something like this in the trigger activation code:

{_x setDamage 0; _x setFuel 1} forEach thisList;
sullen imp
#

thats exactly what im doing making a mission, so i can just add that on the heli pad or whatever item i wanna use?

#

so repair would be setrepair?

little raptor
#

there's no setRepair. setDamage is for repair

so i can just add that on the heli pad
no. you make a trigger around the helipad and use the code in there

sullen imp
#

ok, i got ya, is there a good website that has a list of these scripts

little raptor
sullen imp
#

lmao perfect thank you man so much

#

i do want to learn it

opaque jungle
#

Simple question but maybe not an easy answer

#

Is there an effective way to block off entry into a certain area that effects some players and not others?

#

I basically want to make a somewhat interactive and visual weapon and kit select at the start of an op by having "room of guns" but limited to different classes.

#

essentially I don't want the medic being able to run into the room filled with sniper rifles or every rifleman magically having an LMG and such

#

I know I COULD restrict each item individually but I was hoping for a way of just making a barrier based on what role is selected that way I could modify the contents of a room without having to add checks on each item there

#

more specifically I am intending to set these up in shipping containers with one end open so that I could in theory just block off one end with whatever barrier I can

little raptor
#

don't remember its class name

#

but it's probably under VR objects

opaque jungle
#

Simple enough to check if someone is in slot "Alpha 1-1 Autorifleman", "Alpha 1-2 Autorifleman" etc to make said object appear/disappear as needed?

little raptor
#

you could do that too yes

opaque jungle
#

I'm entirely new to scripting is the problem but I'll start digging into it

little raptor
# opaque jungle I'm entirely new to scripting is the problem but I'll start digging into it

you can put something like this in the player inits (change per role):

this setVariable ["unitRole", "medic"];

and then make an initPlayerLocal.sqf file in the mission root, and add this:

params ["_player"];
switch (_player getVariable ["unitRole", ""]) do {
   case("medic") : {
      barrier1 hideObject true; //remove barrier
   };
}

adjust roles and variable names (in that script only barrier1, don't change other vars) before using the script

opaque jungle
#

Seems like makes enough sense

acoustic abyss
graceful kelp
#

rather specific, so this is more of a hope and a prayer.
does anyone know how to get a return on the current hellfire trajectory mode on ace hellfires

thorny swift
thorny swift
#

Give me one sec

#

I'm new to all of this

little raptor
thorny swift
#

Well basically I don't understand how much the weights impact things in the config file. My understanding was that it went up to 1 (being 100 percent chance of something spawning?) and then 0.50 would be fifty percent or something like that, but obviously in the example the guy who made the script uses numbers such as 10, 4, 5 etc.

little raptor
#

weights don't have to add up to 1, or be 1

#

if you want to convert those numbers to percentages, first sum them all, then divide all of them by the sum

#

that gives the "chance" of spawning each item

#

but you don't need that anyway

thorny swift
#

I see, thank you for clarifying

little raptor
#

it's more like a mental calculation
e,g, if FAK is 10, but medikit is 1, the chance of getting a medikit vs FAK is 1 to 10

thorny swift
#

That's a much better way of thinking about it

#

That makes sense to my little old head

#

Thanks a lot mate

little raptor
#

np

acoustic abyss
#

My coop mission has a Support Requester (CAS) module. In order to make it interesting for all the players, I'd like to give each one a go when it is used.

Right now I've got a simple expression that picks the first player:

[] spawn {
    if ( isMultiplayer ) then {
                _modCAS synchronizeObjectsAdd [(selectRandom (allplayers arrayIntersect units _playergroup))];
                              };
    }; 

How would I repeat this after the CAS run has been completed? Is there a way to return a variable?

kindred zephyr
acoustic abyss
acoustic abyss
acoustic abyss
#

Right, eg publicVariableServer . I'd like this rotation to repeat, once all the players have had a go. Might be a pain to make it JIP, now I think about it ๐Ÿ˜ฌ

tough parrot
#

how do you jump to config entry starting from an object typeOf instead of configFile root?

dusk gust
tough abyss
#

how would i put a pause in between animations? i am thinking using the sleep command but don't think i can use it on an individual unit

dusk gust
tough abyss
#

i plan on using it in public zues im pretty new to incorporating animation commands i believe that would need to be in a file correct?

#

wait no it wouldnt i read through a bit more

#

ill see

somber radish
#

Anyone here got some experience using CBA? I am looking to add some checkBoxes / sliders in eden editor. I just need a hint / script whatever I can reverse engineer to get started

#

The purpose is to change some values on a mod

#

switch it on / off etc

tough abyss
dusk gust
#

Theres no space in _unitswitchMove - _unit switchMove

tough parrot
#

my mod requires checking at runtime whether a vehicle or man has a weapon with a particular property

dusk gust
# tough parrot more like _type >> "stuff" there is a config >> name command in wiki but the de...

As far as I know, theres no way to just pull the config of an object, unless you specify which config to look in.

Most people will use something like

switch true do {
  case(isClass (configFile >> "CfgMagazines" >> _className)): {};
  case(isClass (configFile >> "CfgWeapons" >> _className)):{};
  case(isClass (configFile >> "CfgVehicles" >> _className)):{};
  case(isClass (configFile >> "CfgGlasses" >> _className)):{};
};

Could also use the third syntax of https://community.bistudio.com/wiki/isKindOf

#

To differentiate

tough abyss
dusk gust
#

So you would have to spawn the script that you have the sleep in

tough abyss
#

just the ui sleep or the whole script?

dusk gust
#

I would say the entire script

tough abyss
#

ok thanks a lot im learning a lot

tough abyss
#

how would i make all players in a plane forcibly eject and deploy parachutes upon the plane reaching a certain waypoint?

#

I understand the line im looking for is [something] spawn BIS_fnc_PlaneEjection;

#

i dont know what the 'something' is supposed to be (the plane or the waypoint) and how id use this command

winter rose
tough abyss
#

bugger. not sure what the right command would be then.

winter rose
#

action ["eject", theVehicle]
with an unassignVehicle of some sort

winter rose
tough abyss
winter rose
#

no, it's a general script - you have to define vehicle and units to eject

tough abyss
#

got it

#

where would i place it tho?

#

sorry if thats a stupid question, complete newbie to arma scripting

kindred zephyr
# tough abyss where would i place it tho?

the "on activation" field is ok. You need to fill in the gaps on lou's code.

_groupToEject - Has to be the group name going to eject
_vehicle - Has to be the plane from the units will eject.

tough abyss
winter rose
#

then wrap it with if isServer { ... } as OnActivation field is run globally

kindred zephyr
#

^

tough abyss
#

"error generic error in expression"

#

it kicks me out but not any AI in my group

#

though i dont really need it to work for AI just other players

little raptor
tough abyss
winter rose
little raptor
#

traitor ๐Ÿ˜ 

little raptor
copper raven
little raptor
#

did you define them?

#

and yeah meowthis

digital wasp
#

hey, i've been struggling with my mission. i have 2 things i want to do - 3 tasks that require you to destroy a building 92 of them are spawned, 1 is default) and i need a car that will drive to the last known patrol's position which i imagine to be a 10-15 second timer that writes down the location of a car and then the move waypoint is placed on those coordinates. while i can google the first thing, getting last known coordinates and driving to them was a struggle for me

little raptor
tough abyss
#

dont know what that means - how do i spawn it

little raptor
#

last known coordinates
which coords?

#

last known patrol's position
which patrol?

digital wasp
#

i need a car to drive to the last known position of another car. i came up with this:

_lastKnownPos = getpos aicar1

which will check for the last position every 15 seconds and then if trigger is activated then

_aisquad2 move _lastKnownPos
digital wasp
digital wasp
#

opfor

#

im pretty bad at coding so if i have mistakes - please forgive me

little raptor
#

does it not work rn?

digital wasp
#

well, i dont know what modules to use and how to make it correctly. i need a module that checks the position every 15 seconds if the group is alive (like they will tell their position on radio), i think it's gonna be a trigger that has a condition of game logic present ```sqf
!alive aisquad1

and on activation
 ```sqf
_lastKnownPos = getpos aicar1
``` (or ASLtoAGL) and the other one is a trigger that activates when the group is dead and it will have ```sqf
_aisquad2 move _lastKnownPos
#

correct?

tough abyss
#

sorry to interrupt any way to stop ai randomly turning when doing animations? ive checked the animations in animation viewer and they dont turn right at all

kindred zephyr
tough abyss
#

any way to make that start and then stop when animation's done?

little raptor
#

this means all units are dead

units aisquad1 findIf {alive _x} < 0
digital wasp
little raptor
#

no

tough abyss
little raptor
#

how many animations do you have?

#

how do you play them?

tough abyss
#

wait 1 ill get the script

#

[this] spawn {
params ["_unit"];
_unit switchMove "GetIn_Vertical_Unarmed";
Sleep 3;
_unit switchMove "ChopperLight_L_In_H"
};

kindred zephyr
little raptor
kindred zephyr
#

Question: In laser attachments (in general, any custom attachment that can emit a laser), is there a way command wise to get the origin of the laser without having to manually setpositions relative to the player?

little raptor
#

no

loud python
#

Ahoy! Quick question

#

when I just moveOut a bunch of units in a helicopter, the helicopter will attempt to pick them back up instead of continuing

#

any simple way to prevent that? or will I have to figure out something with waypoints?

little raptor
loud python
#

unassignVehicle _x; moveOut _x still does the same thing

little raptor
#

what about leaveVehicle?

loud python
#

will try that next

#

nope, helicopter still landing

little raptor
#

who do you move out?

loud python
#

one second

#
[vehicle this] spawn {
  group (crew param[0] select 2) leaveVehicle param[0];
  {moveout _x; sleep 1;} forEach units group (crew param[0] select 2)
}

This happens on waypoint activation, with a flying taru that has a bunch of paratroopers riding along

#

the select 2 is just a magic number because pilot+copilot+1 gets me first passenger

#
[vehicle this] spawn { {unassignVehicle _x; moveout _x; sleep 1;} forEach units group (crew param[0] select 2) }

This didn't work either (with or without the unassignVehicle)

#

and what happens is that the helicopter just stops and lands and the paratroopers get back in the helicopter, when I actually want it to just continue and the paratroopers to do their thing

little raptor
# loud python ```sqf [vehicle this] spawn { group (crew param[0] select 2) leaveVehicle para...

first of all, why do you do param [0]? just use a single params ["_veh"]
second of all, your code is running schd. so the leader can order his units back into the vehicle. you must unassign them all at once (tho not 100% sure if it will work):

params ["_veh"];
_1stCargo = fullCrew [_veh, "cargo"]#0#0;
isNil {
  group _1stCargo leaveVehicle _veh;
  units _1stCargo apply {unassignVehicle _x};
}; 
{moveout _x; sleep 1;} forEach units _1stCargo;
tough abyss
#

Is there anyone way to force a ai aircraft to drop bombs then rtb and despawn with rhs?

errant fiber
#

Is there a way for mission debriefing to show after mission end in a Persistent dedicated server? After testing, if persistence is off, debriefing shows. Is there any scripts or code I need in order for the debriefing to show or is this not possible with a persistent server?

errant fiber
little raptor
#

select 0 select 0

loud python
#

oh, didn't know you could use # instead of select xD

little raptor
#

they're not exactly identical

#

# has higher precedence than select. and # is only for selecting an index from the array, unlike select that does multiple things

#

but it does the same thing

loud python
#

tells me it doesn't know _1stCargo

little raptor
#

then your unit wasn't in the cargo seat

little raptor
#

not sure which one you used

#

the older one had an error. _1stCargo wasn't defined in the outer scope

loud python
#

I don't get it

#

it says undefined variable in expression, but it should be in scope though

little raptor
loud python
#

*sigh* if only arma had console.log...

little raptor
#

it has diag_log and systemChat ๐Ÿ˜›

loud python
#

ah...

#

I actually just remembered

#

it's not "cargo" but "gunner"

#

so yea, fullCrew with "cargo" returned empty array so that didn't work

#

dunno how arma thinks "undefined variable" is a helpful description of what happened, but oh well ๐Ÿ˜…

#

...aaand the code runs now

#

and the helicopter still waits and does nothing

#

but the infantry at least doesn't care about the helicopter anymore, so I guess it's half a win

little raptor
loud python
#

I mean, there is no rest of my code

#

other than the _ = spawn {} surrounding the whole thing

little raptor
#

then how's the heli supposed to move? thonk

loud python
#

waypoints

little raptor
#

and how does it land?

loud python
#

this is just an empty scenario with one player and the heli

#

it's not supposed to land, just continue and move off-map

#

I can add code to despawn it or something once I get the basics to work

little raptor
#

you just kick those poor units out in the middle of the air? ๐Ÿคฃ

loud python
#

yes

little raptor
#

how many waypoints have you added?

loud python
#

two

little raptor
#

is the second one far enough from the 1st one?

loud python
#

about two or three km, yes

little raptor
loud python
#

yep

#
[vehicle this] spawn {
params ["_veh"];
private _1stCargo = fullCrew [_veh, "gunner"]#0#0;
isNil { 
  group _1stCargo leaveVehicle _veh; 
  units _1stCargo apply {unassignVehicle _x}; 
};
{moveout _x; sleep 1;} forEach units _1stCargo;
}

That's the current code

little raptor
#

makes no sense to me why it doesn't work thonk

#

maybe readd the waypoint?

loud python
#

I'm pretty sure the helicopter still has it stuck in his head that he wants to pick the infantry back up

little raptor
#
[vehicle this] spawn {
  params ["_veh"];
  private _1stCargo = fullCrew [_veh, "gunner"]#0#0;
  isNil { 
    group _1stCargo leaveVehicle _veh; 
    units _1stCargo apply {unassignVehicle _x}; 
  };
  group _veh addWaypoint [blablaPos, -1];
  {moveout _x; sleep 1;} forEach units _1stCargo;
  
}
little raptor
winter rose
#

[vehicle this] is vehicle group, so no good

#

vehicle leader this perhaps

#

waaait.
this is the leader in Condition - is it as well in OnActivation?

loud python
#

WAT

#

I just added a variable name to the pilot

#

waypoints group pilot is giving me [] now

#

but right after starting the mission

#

when it very clearly still has a waypoint

#

but the pilot is in his own group with the copilot, and that's the group with the waypoints

little raptor
loud python
#

nope

#

as you can see, pilot has the variable name and the waypoints

little raptor
loud python
#

AAAAAAAAAH

#

never mind

#

I'm dumb

#

this one was 100% my fault

little raptor
#

but anyway you're using the group, so shouldn't matter

loud python
#

I had this in my console watch list: deleteWaypoint [group (crew taru select 0), 0]

#

okay got rid of that, back to debugging

#

This is the waypoint list before dropping infantry:
[[O Alpha 1-1,0],[O Alpha 1-1,1],[O Alpha 1-1,2]]

#

ah, and it stays the exact same afterwards

little raptor
#

what's the waypoint type and condition?

loud python
#

[0,1,2] apply {waypointType [group pilot, _x]}: ["MOVE","MOVE","MOVE"]

little raptor
#

in 3den

loud python
#

didn't change them

#

so they're just the default true

little raptor
#

is your heli too high? (more than 200-300m)

loud python
#

Airport personnel reported no smell of weed

#

the waypoint does change as well

#

currentWaypoint group pilot is 1 at mission start and then changes to 2 when the paratroops drop

little raptor
#

AI have (had) a bug at high altitudes

#

they can't complete waypoints

loud python
#

nah, they're at a few hundred meters max

#

then the helicopter actually lowers to like 100m or so

#

and then it just hovers there

#

oh well, gotta go so I'll leave it at this and see if I can figure it out some other day

#

@little raptor Thanks for the help though ๐Ÿ˜„

#

(if anybody knows an obvious answer, please ping me)

mental prairie
#

can I use remoteExec on execVM

distant oyster
#

yes

winter rose
#

I shall allow it.

hollow plaza
#

Is there any place where I can see all the holdAction idle icon names and the icons themselves? I remember that previously in https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd I could open up the list and it'd also show the icons themselves, which made it significantly easier to choose the most fitting one for a custom holdAction.

#

Currently it seems that the list only shows the names, even though I'm 90% certain it used to also show the icons previously.

hollow plaza
somber radish
#

Anybody got experience using CBA_Settings?

#

I am trying to set up some check-boxes and sliders to define variable values in Eden-editor

#

So far I am having no luck

#

the basic error I get is:

Error Missing {
18:05:56 File vehicleFSM\functions\fn_init.sqf..., line 193
18:05:56 Error in expression < Fall back to default value.", TO_STRING(_value), _setting]] call CBA_fnc_log;
_>
18:05:56   Error position: <(_value), _setting]] call CBA_fnc_log;
_>
18:05:56   Error Missing ]
18:05:56 File vehicleFSM\fnc_init.sqf..., line 177
18:05:56 Error in expression < Fall back to default value.", TO_STRING(_value), _setting]] call CBA_fnc_log;
_>
18:05:56   Error position: <(_value), _setting]] call CBA_fnc_log;
_>
copper raven
#

looks like you have an undefined macro

digital wasp
#

how do i make a trigger to fire when a buidling (custom, added to the map) is destroyed?

vernal venture
#

I can't seem to find it- the difference between stamina and fatigue with disableStamina and disableFatigue?

little raptor
#

the only diff was in setStamina and setFatigue. fatigue is in range 0-1. stamina is overall stamina (affected by loadout)

vernal venture
#

I was hoping to disable the stamina bar and allow unlimited sprinting, but also still force people to respect weight caps.

digital wasp
#

oof, alright, i'll try my best

digital wasp
#

also, is !alive going to work on buildings?

little raptor
#

yes and yes

digital wasp
#

so i can just ```sqf
!alive buidling;
Not present

tough parrot
digital wasp
#

huh?

tough parrot
#

"Check if given vehicle/person/building is alive (i.e. not dead or destroyed). "

digital wasp
#

wrong reply?

tough parrot
#

ya

digital wasp
#

okay

tough parrot
#

for alive

little raptor
humble harbor
#

hi everyone, I'm trying to make a function that accepts a vehicle as an argument and marks on the map the position of its laser.
The lasertarget command does not work for me because I want it to work even when no specific target is being pointed at.
The closest I can get to how I want it to work is by using getPilotcameraTarget which always returns a position. The problem is that it works great for jets but not for drones, since they both have a pilot camera and a gunner camera, and the laser shoots from the gunner turret.
I also tried with a "Fired" eventHandler but the game does not treat the laser beam as a projectile, so I cannot get its position that way.
Any suggestions?

little raptor
#

if not, selectionVectorDirAndUp

humble harbor
#

and then do some weird line intersection stuff?

little raptor
#

yeah

humble harbor
#

oh boy

#

linear algebra always comes back to bite me in the ass

little raptor
#

what? there are commands for that

tough parrot
humble harbor
#

thank you I'll give it a shot

tough parrot
#

if using weaponDirection i guess you would also need the selectionPosition of the weapon muzzle converted to world space as the begin point

digital wasp
#

how do i delete 2 objects via trigger?

little raptor
#

if more, use a forEach loop

digital wasp
#

does it have to be vehicle? i got confused and that's why i asked

little raptor
#

no. vehicle = object in Arma terms

digital wasp
#

okay, thanks

humble harbor
little raptor
humble harbor
acoustic abyss
#

Do the commands enableEnvironment and fadeEnvironment affect sounds created by createSoundSource ?

desert sable
#

Would anyone have an idea as to why my triggers only fire if the player walks inside them, and jumps/climbs within it?

tough abyss
desert sable
tough abyss
#

does the trigger not work if they jump? im guessing with a mod

desert sable
tough abyss
#

maybe make the z higher vertically and double check it is completely on the ground

desert sable
tough abyss
#

from memory triggers attach themselves to the ground like a helipad and then work up a bit maybe going on an object changes the z to be into the trigger

desert sable
tough abyss
#

that would make sense then

#

it could also be that the z co ordinate is the only place the trigger activates like if the z coordinate is 50 the player has to be at 50m high

#

both of those make sense to me so try them both

desert sable
#

I'll try that, thanks!

tough abyss
#

no problem

leaden haven
#

I am trying to set up an RHS version of Domination, how do I use this?

#
#ifdef __RHS__

How do I force it to use RHS things?

#

I mean, how do I define this to make Altis Domination load as RHS? Thanks.

copper raven
#

define the macro somewhere in some main configuration file(id assume it has one)

digital wasp
#

if i want a trigger that fires when a does not equal 1, ill do ```sqf
a != 1;

cosmic lichen
#

Yes

tough abyss
#

is there any way to change objects size not using setobjectscale? i want to try make a small tank

cosmic lichen
#

No, setObjectScale is your only choice

winter rose
#

or you could make everything else bigger by setObjectScale

tough abyss
#

now im thinking of making a huron sized hummingbird with tiny people hanging off the side

humble harbor
#

does deleting a keyvalue pair in a HashMap while iterating with a foreach cause undefined behavior or is it safe?

little raptor
digital wasp
#

it's a radiostation that needs to be destroyed, so when it's destroyed a becomes 1, and i need to have a trigger that calls for backup if the team is dead and radiostation is up

little raptor
#

you know WHEN it's gonna happen

#

so using a trigger is a waste

#

it's like you're the one with the key to a house and you know only you can open it, but you always visit the house every minute to see: is it open yet?

#

well if you opened it it's open. if not it's closed...

#

if you don't know what I'm talking about:
let's say you do this in one trigger:

a = 2;

and then in another trigger you're checking:

a != 1

which does some code

just put the code under that a = 2 in the first trigger meowsweats

digital wasp
#

yeah that's not how i set it up

#

so, i have 2 triggers, 1 for destroying radio and the second one for backup that has to meet 2 conditions: 1 is team is dead and the second one is radio is up and running, and radio trigger sets a to 1. so i need to check if a != 1

little raptor
#

ok

somber radish
#

Quick question, where do I define dependencies for mods?

#

I got a FSM mod that relies on a couple of CBA functions

crude vigil
somber radish
somber radish
#

For all the answers you gave me the last few days trying to conver the FSM into a mod

somber radish
#

Any way to check if you are actually in a mission (not main-menu or editor)?

#

I want to use it as a condition to initiate a function, that should otherwise not be initiated

somber radish
#

It still initiates at main-menu

somber radish
#

nice

acoustic abyss
#

I am curious-

My (coop) missions are scripted with about 30 different triggers. Triggers for branching objective outcomes (destruction vs completing addAction). Triggers for music. Triggers for EndMission. This costs performance for server and client. I figured at least the triggers controlling branching outcomes could be handled by a server executed FSM.

There's a thread on the BI forums praising FSM, but not giving any concrete examples. The campaign scenarios use a missionflow.fsm . And ~15 other FSMs. But I couldn't find how they were executed (eg there were no execFSM commands in any files, nothing in description.ext).

Does anyone use FSM files in their multiplayer missions, or can link me to an example ?

little raptor
#

I figured at least the triggers controlling branching outcomes could be handled by a server executed FSM
you can just create the triggers dynamically
Triggers for branching objective outcomes (destruction vs completing addAction)
these don't need triggers

#

also FSM doesn't have any perf advantage over plain SQF

ivory lake
#

missionFlow.fsm auto executes if it exists iirc

#

the main advantage for fsm is the visualisation aspect

#

for the mission designer I mean

patent goblet
#

Does anyone use FSM files in their multiplayer missions, or can link me to an example ?
Good examples would be missions in coop-campaign Apex protocol by BI
a3\missions_f_exp\campaign\missions

compact maple
#

Hi, is there any tool I can use to pack a pbo in cli?

little raptor
#

tho I think A3 Tools has a command line version too thonk

compact maple
#

Right thanks!

coarse dragon
#

Can a trigger with alivecheck be synced with a end scenario?

winter rose
#

sure, why not

coarse dragon
#

How would I do that? Do I need triggeractivated too?

winter rose
#

you can put a BIS_fnc_endMission call in the OnActivation field

coarse dragon
#

!alivecheck "me"; in the condition aswell?

#

@winter rose is that right ?

little raptor
coarse dragon
#

Help? ๐Ÿ˜ฌ

fair drum
winter rose
coarse dragon
#

Want the mission to end when I die

acoustic abyss
fair drum
#

in mp you can create an eventhandler for "killed" which will avoid using triggers and scheduled

coarse dragon
#

If I get out of the city alive. For the mission to end aswell

winter rose
coarse dragon
#

Thanks

humble harbor
#

The following is a "Fired" event handler function. The issue I'm having is not being able to setVariable to the _payload (the projectile of the event handler). After setting the variable, doing "allVariables _payload" returns an empty array.
What am I doing wrong?

private _fn_onPayloadSent = {
    private _unit = param[0];
    private _payload = param[6];

    if (getNumber (configOf _payload >> "laserLock") == 1) then 
    {
        _payload setVariable ["originPos", position _payload];
        _unit getVariable "tracedPayloads" pushBack _payload;
    };
};
fair drum
#

start with the line you want to work, then start adding in around it

humble harbor
#

I'm sure the projectiles are being pushed in the array at the second line

distant oyster
#

are you sure that the projectile still exists and is not objNull?

humble harbor
#

I am

fair drum
#

so in my little test I just did, it looks like you can't give variables to projectiles

humble harbor
#

yup, can confirm ๐Ÿ˜ฆ

fair drum
#

even though it counts as an "object", a projectile/ammo is not a valid subtype

#

to get around this (probably not wise), you can actually just use a different name space and set an array that you can grab later

#
missionNamespace setVariable ["my_projectile_1", [_projectile, "myValue"]];
humble harbor
tidal ferry
#

Question

#

When I delete an object in Zeus

#

And/or it dies

#

Does it become objNull?

#

Well sorry, specifically if I delete it

#

Or does it just... cease to exist?

#

Working on a script that I want to attach to an object, but commit die when the host object is deleted

winter rose
#

it gets removed, so it does not "become" anything

#

the variable that was pointing to it becomes objNull though

tidal ferry
#

So should I use !alive, isNil or isNull?

#

Hmm okay

#

I'll try isNull then

winter rose
#

isNull (alive returns false for objNull)

tidal ferry
#

Is there anywhere I can access a full list of human memory points? I.e. head, shoudler, legs etc

digital wasp
#

is htere a way to change object type with a script

tidal ferry
#

In a little bit of a rush ATM

tidal ferry
#

LEGENDARY, thanks!

winter rose
coarse dragon
#

Hey un I have an AI spawn point down. But when it gets to the manpower limit its giving me a error. Doesn't break it. But its annoying having the errors on the screen

digital wasp
little raptor
#

you have to delete the object and create new one

digital wasp
#

sadge

coarse dragon
#

3 sectors then the Spawn Ai. And 3 Spawnpoints.
Manpower is 100.
Every 15 secs. Mostly infantry

little raptor
#

did you sync everything properly?

coarse dragon
#

Yea it all works. Just an annoying error when the limit is reached

cosmic lichen
#

Posting the error here might help

coarse dragon
#

I ain't typing that whole thing out

cosmic lichen
#

Check the rpt file

little raptor
#

but it's hard to tell which one you did wrong

coarse dragon
#

Would having the wrong values at a certain spawn point cause it?

The total only came upto 90% On one of them

little raptor
#

dunno. maybe

#

copy your module setup in an empty mission (use vanilla maps, preferably VR) and DM me. I'll take a look

coarse dragon
#

I'll test it out 1st see if I get it again

#

Seems grand now

#

Other than my game seems to have bugged out now. Yaay

#

Gun wouldn't fire. Then ran now I'm dead with no menus and stuck here.

tepid vigil
#

Is there any significant difference in functionality or performance between hashmaps and CBA namespaces?

little raptor
#

idk what CBA namespaces use

#

iirc they used a helper object and did setVariable on it

#

if so they are a lot different in functionality too

#

anyway, there's no point in using scripted stuff when there's native engine support for something

cosmic lichen
#

Don't they use locations as namespaces?

distant oyster
#

yes they do

hollow thistle
#

locations or simple object, depends if local or global.

#

object might be better for network as you can publish only one "key", with hash map you need to send the whole thing over the network.

half sphinx
#

I've got an issue using

player setDamage 0;

If someone has sway after being shot their scope will be stuck on a different place on the screen than the standard middle when I use setDamage. I don't know how to fix it...

little raptor
humble harbor
#

why does
_obj setVariable ["myvar",nil]
not remove "myvar" from allVariables _obj?

cerulean cloak
#

How would I go about getting the pos for where a bullet landed? I'm not bothered if it's a bit slow or inefficient as long as it works

humble harbor
cerulean cloak
little raptor
#

for now... ๐Ÿ˜‰
it's riddled with errors

humble harbor
little raptor
# humble harbor tell me I'm learning

well

  1. you don't use Fired EH with "soldiers". you should use FiredMan
  2. you should never use a "waiting" while loop without some form of suspension (sleep or uiSleep). rn your while is wasting the scheduler's time and executing multiple times per frame, yet the bullet cannot change in one frame, obviously.
  3. you shouldn't use scheduled environment in such places in the first place, due to scheduler limitations. if for some reason there are multiple scripts running, the interval between "scheduler visits" to your script keeps getting longer, and the error gets large
little raptor
humble harbor
little raptor
#

and like I said, there's no guarantee your script runs every frame

fair drum
#

you're not guaranteed any amount of sleep time, it depends on the scheduler's load

little raptor
#

it's scheduled

humble harbor
little raptor
#

well in technical terms it is removed

#

but the identifier is not. the variable will simply be bound to no value

cerulean cloak
fair drum
#

every time you fire, that's going to fire. with some of the mgs in the game, you just spawned a TON of individual scheduled instances

cerulean cloak
fair drum
#

well you can't test something if you just made the game a slideshow for potentially a long amount of time...

humble harbor
#

maybe he wants to fire a couple of bullets, give him a break ๐Ÿ˜„

little raptor
#

the game won't become a slideshow tho...
the scheduler does... thonk

cerulean cloak
#

But if it's writing to a global variable won't the second shot overwrite it?

humble harbor
#

use a hashmap

little raptor
humble harbor
#

i know, use an artificial id

little raptor
humble harbor
#

global hashmap, assign artificial id to every bullet once fired, push the position to the hashmap using the id as key

little raptor
#

wat? why use "artifical id"? just use the hash value

humble harbor
#

oh that's nice I didn't know that

cerulean cloak
#

So if I just tacked the pos on each loop that won't really be of any use

still forum
#

#AmmoEventHandlersForPresident

little raptor
# cerulean cloak Not really sure how to do that in this case. It's writing to the global every lo...
projectiles = [];
onEachFrame {
  private _deleted = false;
  {
    _x params ["_projectile", "_lastPos"];
    if (alive _projectile) then { //update pos
      _x set [1, getPosWorld _projectile];
    } else {
      //do whatever you want here with _lastPos, for example
      systemChat format ["projectile %1's last pos: %2", _projectile, _lastPos];
      //
      projectiles set [_forEachIndex, 0];
      _deleted = true;
    };
  } forEach projectiles;
  if (_deleted) then {projectiles = projectiles - [0];};
};
_soldier addEventHandler [
    "FiredMan",
    {
        projectiles pushBack [param[6], getPosWorld param[6]];
    }
]
#

this is a slightly better version of that script

little raptor
#

normally it's the first thing I mention... ๐Ÿ˜…

humble harbor
#

omg please forgive my 2am brain ๐Ÿ˜„

little raptor
#

so do you know what I'm talking about?

#

I noticed that in another one of your scripts too

humble harbor
#

I mean I know there's the whole ATL, AGL, ASL and whatever, is that it?

little raptor
#

yeah

humble harbor
#

yeah I forgot about a lot of things, I started programming for the first time with this game like 8 or 9 years ago

#

sweet memories : ')

desert sable
#

Anyone know a script that I can use to move an object across a plane at a certain speed?

tight cloak
desert sable
acoustic abyss
desert sable
#

Thx!

acoustic abyss
#

Works in dedicated. Very smooth sailing. But the object hath wonky physics. ๐Ÿ ware.

dim crow
#

I need some help. I am trying to create artillery that works with a trigger and fire mission. It works but all the artillery just fires at the fire mission point. How can I spread the artillery fire to target all the vehicles in the tigger area,??

#

I think this involvesscripting

acoustic abyss
#

You'll need to set up triggers and get the (shell transit) timing right. Which you can easily rehearse in Eden if you know where the enemies/players are beforehand.

dim crow
#

Ok thanks

copper raven
violet gull
#

Code in MPKilled EH vs Killed EH operates similar to remoteExec, correct?

violet gull
#

Disregard, appears to be correct according to wiki.

#

Killed eventHandler code is local, MPKilled basically remoteExecs to all.

zinc loom
#

hi guys im working on this:

but it doesnt work

class CfgVehicles {
class Rope;
class RopeRabbit : Rope {
maxRelLenght = 1.1;
maxExtraLenght = 20;
springFactor = 0.5; // higher == less stretchy rope
segmentType = "RopeSegmentRabbit";
torqueFactor = 0.5;
dampingFactor[] = {1.0,2.5,1.0};
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};

class CfgNonAIVehicles {
class RopeSegmentRabbit {
scope = 2;
displayName = "";
simulation = "ropesegment";
autocenter = 0;
animated = 0;
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};
Note: Lenght is purposely misspellt for some unknown reason.

So an example for using the above custom rope definition with the ropeCreate command:

// ropeCreate[fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd, ropeType];
myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10, ["", [0,0,-1]], ["", [0,0,-1]], "RopeRabbit"];

#

i dont know how to insert it in the vr i guess

#

it says bad vehicle type

#

oh i see the creator is here, dedmen wrote this i think somewhere

distant oyster
#

also:

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
zinc loom
#

!code test

distant oyster
#

no you have to type what the bot says

zinc loom
#
class CfgVehicles {
    class Rope;
    class RopeRabbit : Rope {
        maxRelLenght = 1.1;
        maxExtraLenght = 20;
        springFactor = 0.5; // higher == less stretchy rope
        segmentType = "RopeSegmentRabbit";
        torqueFactor = 0.5;
        dampingFactor[] = {1.0,2.5,1.0};
        model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
    };
};

class CfgNonAIVehicles {
    class RopeSegmentRabbit {
        scope = 2;
        displayName = "";
        simulation = "ropesegment";
        autocenter = 0;
        animated = 0;
        model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
    };
};
#
myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10, ["", [0,0,-1]], ["", [0,0,-1]], "RopeRabbit"];
#

the first 2 classes i tried description.ext ...

distant oyster
#

you can't declare vehicles in description.ext

zinc loom
#

ok #include "blah.h"

#

and using it ?

#

where do i declare them ?

distant oyster
#

#include is just a preprocessor, it will still end up in description.ext

#

you would have to create a mod to add new vehicles to the game

zinc loom
#

using mod in my VR ?

distant oyster
#

what do you mean?

zinc loom
#

i want to use this roperabbit ... could u explain me how to do it, or how to learn how to do it ?

distant oyster
#

i have no experience with ropes, but I do know that you can't create a CfgVehicles class on a mission level. You would have to mod the game, aka create an addon/mod

neat karma
#

I'm trying to create a Zeus curator for #adminLogged at runtime.

this outputs no errors but it's not working

private _moduleGroup = createGroup sideLogic; 
"ModuleCurator_F" createUnit [ 
 getPosATL player, 
 _moduleGroup, 
 "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];" 
];
_moduleGroup setGroupOwner adminLogged

I'm not even sure if this is possible but it would be extremely useful if you could enhance/ fix workshop missions on the fly

copper raven
#

no, that won't work\

#

try adding this setVariable ['owner', '#adminLogged', true] in the init

neat karma
#

holy shit it actually works

private _moduleGroup = createGroup sideLogic; 
"ModuleCurator_F" createUnit [ 
 getPosATL player, 
 _moduleGroup, 
 "this setVariable ['owner', '#adminLogged', true];this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];" 
];
#

thanks dude

humble harbor
#

is there a way to resize the ingame exeption message popup?

winter rose
#

not afaik

quasi rover
#

If I don't remove a given Event Handler that was added with addEventHandler, what effect on the server?

winter rose
#

it will rise by 1ยฐC

prime fox
#

Hey guys quick question.

Struggling with quite a basic script but really can't get it to work. Basically I have a task where I want the player to pick up the backpack and once the player has, for the task to succeed. Anyone know the script to do it? Thanks ๐Ÿ™‚

open fractal
#

you make the condition that the player is carrying the backpack

prime fox
open fractal
#

So just put it on in the editor and type backpack player in the debug console

#

and itโ€™ll give you the classname

#

backpack player == โ€œbackpack_classname_in_quotesโ€

#

= is to assign a variable, == is to compare values

#

you can also use this if youโ€™re comfortable with event handlers

copper raven
humble harbor
#

hi everyone, can anyone tell me how I can check if a bomb is currently locked onto a target or if it's just freefalling?

humble harbor
undone dew
#
["Car", "init", {

    clearWeaponCargoGlobal (_this select 0);
    clearMagazineCargoGlobal (_this select 0);
    clearItemCargoGlobal (_this select 0);
     (_this select 0) setVehicleAmmo 0.45;
    [
        (_this select 0),                                            // Object the action is attached to
        "Claim this Vehicle",                                        // Title of the action
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Idle icon shown on screen
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Progress icon shown on screen
        "(alive player) && !dialog && player distance _target < 8",                        // Condition for the action to be shown
        "_caller distance _target < 8",                        // Condition for the action to progress
        {},                                                    // Code executed when action starts
        {},                                                    // Code executed on every progress tick
        {[(_this select 0)] call HG_fnc_setOwner},                // Code executed on completion
        {},                                                    // Code executed on interrupted
        [],                                                    // Arguments passed to the scripts as _this select 3
        0,                                                    // Action duration in seconds
        0,                                                    // Priority
        true,                                                // Remove on completion
        false                                                // Show in unconscious state
    ] remoteExec ["BIS_fnc_holdActionAdd", 0, true];    // MP compatible implementation

}] call CBA_fnc_addClassEventHandler;
little raptor
#

what did you expect it to return then?

#

target = object

humble harbor
#

a laser position would have been great

undone dew
#

Can anyone help me figure out why this isn't working? It uses a CBA event handler to try to add an action to a vehicle when it spawns, the other commands (clearWeaponCargo and such) are working but it won't add the action in mulitplayer

little raptor
#

the laser target is an object too

humble harbor
#

the more you know...๐Ÿค”

undone dew
#

yes, it works in SP but does not in a dedicated

#

I also tried remoteexec with addAction instead of BIS_fnc_holdActionAdd but had the same issue

little raptor
undone dew
#

i'm looking closer at the condition

copper raven
misty osprey
#

anyone know how to create laser targets with a script I have this code

   if (_side == West) then {_LaserType = "LaserTargetW"; _LaserBaseType = "LaserTargetWBase";};
   if (_side == East) then {_LaserType = "LaserTargetE"; _LaserBaseType = "LaserTargetEBase";};
   
   _LaserObject = _laserType createVehicle _LasePos;
   _BaseObject = _LaserBaseType createVehicle _LasePos;
   _laserObject attachto [_BaseObject, [0,0,0]];

but I can't lock onto the laser target with my plane

copper raven
#

try reveal them

copper raven
undone dew
#

k, how does InitPost work?

copper raven
#

it executes after all the other init event handlers

oblique olive
#

hello, do I just have to add this line to init.sqf to activate the option? null = [this] execVM "R3F_LOG\USER_FUNCT\do_not_lose_it.sqf";

copper raven
#

well, no one will be able to tell what that script does

#

unless you tell us

#

if you put it in init.sqf it will run on every machine, do you want that?

oblique olive
#

sorry it's for r3f logistic to be able to recover the cases when the vehicle is destroyed

copper raven
#

since it does something with this, it tells me that it's supposed to be in some init field

misty osprey
oblique olive
#

yes I searched in the files but I can't find where to add this

#

he also talks about it on page 9

misty osprey
#

it looks like it goes in the objects init field in the editor

copper raven
#

there are the report sensor commands, should try those

next arrow
#

How do i write configs. I just want to add a simple cube

little raptor
#

There is only one required parameter to call the script : the reference to the object to not lose. If
called in the mission editor's initialization line, this reference is the keyword this

oblique olive
#

thank you for your response Leopard20 but where should I add this line?

#

nul = [CargoNet_01_box_F, "cargo_pos"] execVM "R3F_LOG\USER_FUNCT\do_not_lose_it.sqf";

#

set to "cargo_pos" to unload the object around the destroyed cargo

little raptor
little raptor
#

do you not know what it is?

oblique olive
#

ok thank you i will look again in the files

copper raven
misty osprey
#

its working now thanks for helping

sharp stag
#

How would I go about counting how many ai on my team die. Then being able l to spawn that many ai back into the game when I'm at a FOB.

winter rose
sharp stag
#

How would I go about the first option?

winter rose
#

e.g event handlers

sharp stag
#

Lastly, how can I add a addAction to every object in the mission with a certain class name

#

Because the objects are added in part way through mission by anothr mod

winter rose
#

addAction, forEach and allMissionObjects

distant oyster
tidal ferry
#

Hey question

#

Does this still work?

boreal parcel
#

Hey guys, does anyone know if it is possible to make certain components of vehicles (Engine/Turret/Gun) take no damage or instantly repair?

We are using ace and planning on an operation using hmmvvs however aces vehicle damage model a few updates back fucked them so russians firing 7.62 take out the engine and turret in like 1-2 shots.

fair drum
boreal parcel
#

ahhh I cant remember off of the top of my head, but I want to say RHS? Let me check

fair drum
boreal parcel
#

yeah

fair drum
#

i personally for ease, would just make a new handle damage event handler and add the health back when struck by a 7.62 weapon

boreal parcel
#

Hmm gotcha, thats what I was looking into, just wanted to check. Well ill get into that tomorrow, its 2 am here. Thanks for the info

lofty rain
#

Any way to make object detectable with mine detector? Using Ace.

open fractal
#

why does my ai helicopter keep lifting off despite writing ```sqf
FB_HELI_PILOT disableAI "all";

winter rose
#

mods or wrong target most likely

open fractal
#

I deleted the copilot to be sure

#

the pilot just does not care

#

It's an RHS helicopter if that makes any difference

#

but the waypoint is transport unload, he keeps doing his passengers dirty and lifting off lol

winter rose
open fractal
#

that's the pilot

#

FB_HELI is the helicopter

#

I've also tried driver FB_HELI

winter rose
#

otherwise try in an empty VR mission in vanilla and compare

#

not "with vanilla units", in vanilla - without mods loaded

open fractal
#

I'll try disableAI for the pilot in vanilla later