#arma3_scripting

1 messages · Page 687 of 1

valid abyss
#

Is there anyway to make this work without ace?

if (hasInterface) then {

    [] call grad_fortifications_fnc_addVehicleInteractions;
    private _moduleRoot = [] call grad_fortifications_fnc_getModuleRoot;
    private _action = ["grad_fortifications_mainBuildAction", "Fortifications", _moduleRoot + "\data\sandbags.paa", {
        [grad_fortifications_fnc_loadFortDialog,[_this select 0, _this select 1]] call CBA_fnc_execNextFrame
    },{
        params ["","_unit"]; 
        isNull (objectParent _unit) &&
        {count ((_unit getVariable ["grad_fortifications_myFortsHash",[[],0] call CBA_fnc_hashCreate]) select 1) > 0} &&
        {!(_unit getVariable ["grad_fortifications_isPlacing", false])}
    }] call ace_interact_menu_fnc_createAction;

    ["CAManBase",1,["ACE_SelfActions","ACE_Equipment"],_action,true] call ace_interact_menu_fnc_addActionToClass;
};

little raptor
valid abyss
#

How do i syntax highlight?
It's supposed to open a dialog.

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
valid abyss
#

Thank you

little raptor
#

if you want to you can use vanilla actions

#

or whatever other way you want

valid abyss
#

I'm setting it up so it can use CBA's keybinding.

#

But I'm not sure how to do it.

valid abyss
#

Alright thank you.

#

I know [grad_fortifications_fnc_loadFortDialog,[_this select 0, _this select 1]] call CBA_fnc_execNextFrame creates the dialog but i don't know what the 2 params are.

little raptor
#

The simplest action is just a condition and statement. The code to these are passed [_target, _player, _actionParams]. _player is ace_player; _target is the object being interacted with; and the 3rd argument is the optional action parameters (default []).

grim wing
#
for "_i" from 0 to random 4 do {
    _type = ["Hen_random_F","Rabbit_F","Goat_random_F","Sheep_random_F"] call BIS_fnc_selectRandom; //Animal select array
    _unit = _eastGrp createUnit [_type, _pos, [], 1, "NONE"];
    _unit setVariable ["BIS_fnc_animalBehaviour_disable", true];
    _unit setSpeaker "NoVoice";
    _unit disableAI "FSM";
    _unit disableAI "AIMINGERROR";
    _unit disableAI "SUPPRESSION";
    _unit disableAI "AUTOTARGET";
    _unit disableAI "TARGET";
    _unit setCombatMode "BLUE";
    _unit setBehaviour "CARELESS";
};

Can anyone tell me why that the goats and sheep are invisible for other player but not myself?

little raptor
grim wing
#

what should I use then?

little raptor
#

createAgent

grim wing
#

can I still give them a task?

#

like [_eastGrp, _pos, 250] call BIS_fnc_taskPatrol;

little raptor
#

not sure about tasks

grim wing
#

I tried with createAgent and its not spawning them

tidal ferry
#

Hey, question, anyone know who Larrow is?

#

Wanted to ask for permission to convert one of his scripts for our modpack, but I'm having trouble finding the original post (and thus licensing) for the script since I received it from a friend for a mission file

spark sun
#

Some animals are only visible where there are local

tidal ferry
spark sun
turbid remnant
#

hi guys, see, how can I use the bot that gives me the scripts?

#

podrían ayudarme, no speak in english

#

thanks

turbid remnant
#

I need help please

spark turret
#

You cant download scripts here. This is an FAQ channel

slender beacon
#

I need help with my log script, I changed a few lines and now I'm getting a blank error. Can I get help?

slender beacon
#

scratch that

#

redid

broken forge
#

Anyone know why bis_fnc_kbtell doesn't work in a dedicated server environment? It works in sp, or when I host it myself, but not on a dedicated server

fluid wolf
#

Does anyone know why Isnull throws an unknown variable in expression for the classname of the object I'm trying to determine instead of just returning false???

late jacinth
#

can somone please help? How do I make a vehicle a medical unit? I am spawning B_Heli_Transport_01_F but I want it to be a medivac chopper.....

warm hedge
#

There isn't in vanilla

late jacinth
#

I have some mods, is there a specific for medivac?'

warm hedge
#

Maybe maybe not. IDK

late jacinth
#

so, there is an option in the editor to make a vehicle a medical vehicle. So, that's the code that I need to find if anyone happens to know. thx

warm hedge
#

Is there?

#

I never think so. Medevac is a medevac vehicle, not something can be converted from others with a script

tardy oriole
#

Anyone happen to know how to retexture a helmet in a mission file?

brazen lagoon
#

dont think you can

#

helmets aren't objects i think

#

when does performance become a problem with triggers? can I have ~120 trigger areas on a map and will that be fine for performance?

trim wagon
#

Hey, I'm having trouble with this script inside a larger filestructure, just want to get an idea of what I should be trying or where I should be looking.

On mission launch
"Error Params: Type String, expected Array
File %filepath%\fn_createVirtualDepot.sqf, line 1"

params [
    ["_depot",objNull,[objNull]]
    ,["_classTypes",["All"],[[]]]
    ,["_sideID",-1,[0,""]]
    ,["_repair",true,[false]]
    ,["_rearm",true,[false]]
    ,["_refuel",true,[false]]
    ,["_linkID","",[""]]
];

if (_sideID isEqualType "") then {
    _sideID = ["sideID",_sideID] call MPSF_fnc_getCfgFaction;
};

["initLogic",[_depot,_classTypes,_sideID,[_repair,_rearm,_refuel],_linkID]] spawn { sleep 1; _this call MPSF_fnc_virtualDepot};```

I'm pretty sure params has an array attached to it, unless im overlooking something. Any ideas about what I should check?
ornate quest
#

Anyone know why when i try to systemChat a missionNamespace variable all i get is "Namespace"? The variable is updated every 2 seconds

ornate quest
#

missionNamespace setVariable ["#EM_Values​", TargetSigsArray]; for the spectrum device. TargetSigsArray is a valid array

#

Whenever i try to see if EM_Values is being set all i'm getting is "NameSpace"

#

Had this issue awhile ago when trying to use the spectrum device and couldn't get it working at all

fair drum
#

whats your systemChat line?

ornate quest
#

systemChat str missionNamespace getVariable "#EM_Values";

fair drum
ornate quest
fair drum
fair drum
#

did you start the game with contact loaded?

#

cause I know if you don't, it can mess things up since they use that new dlc method for contact

ornate quest
#

No but i'll give that a try

fair drum
#

DLC tab, checkmark contact, hit play

ornate quest
#

if that works i'll be really mad NGL

#

Spent hours debugging code

fair drum
#

lol. i had issues before like this because I wanted to use the blank ammo from contact, but didn't have contact loaded so the magazine didn't exist in CfgMagazines

twilit scarab
#

Is SetMissileTarget new?

#

Does it work for the VLS cruise missiles?

trim wagon
fair drum
trim wagon
#

gotcha

fair drum
#

for VLS

twilit scarab
#

Does that work?

#

Ive been trying to get the VLS to shoot at a target on its own or shoot at something the players is lasing but never been able to

fair drum
#

yes, use reportRemoteTarget for that

twilit scarab
#

How does it work im not much of a scripter

fair drum
#

you use createVehicle to create a "LaserTargetE" or "LaserTargetW" and use attachTo to attach that vehicle to the unit you want tracked. you then use reportRemoteTarget to show that laser target to the team that has the VLS. the VLS should automatically toast it

twilit scarab
#

Damn

#

Hopefully I can make this work that sounds sick

#

Is there a way to like "disguise" your squad from the enemy for a certain amount of time

ornate quest
craggy lagoon
#

Using the boat rack on the USS Liberty to launch and recover boats. I create a custom inventory in the boat, but when I launch the boat it is reverted back to default inventory. So it seems that Arma is just deleting the boat on the ship and spawning a new one in the water when launched. Is there a way that I could have it remember my inventory?

fair drum
noble flint
#

Can someone guide me to the modding section?

twilit scarab
#

Thank you

spark turret
#

You probably dont need 120 triggers that evaluate on every frame. Write you own ones with slower loops

proven charm
#

why doesnt this code work for zeus cam? curatorCamera camSetPos (getpos (vehicles # 0)); curatorCamera camCommit 0;

#

it doesnt do anything

winter rose
#

try setPosASL getPosASL directly

proven charm
#

guess I'll just use that then, ty

#

there's something strange though with my cam script, calling it too many times causes the camera controls to freeze

willow hound
#

Define "too many times" meowtrash

proven charm
brazen lagoon
#

@spark turret right. so something that evaluates every second or so. problem is most of them are gonna be pretty large, since they're gonna be on most civilian areas

fair drum
spark turret
#

then you can also use markers, cutting out the possibility that the trigger still updates his array every frame

brazen lagoon
#

yeah i was considering just making a bunch of markers and then running player in area

#

might just do that seems simpler overall

frigid shell
#

I heard something about doomsday rounds for a certain shotgun is only available in scripting or something???

spark turret
# brazen lagoon might just do that seems simpler overall

the thing is: its possible that the trigger still checks his area (which is probably performance intensive) every frame, no matter if you use him or not.
so a marker doesnt do that by default, therefor you control when it checks -> control the performance

winter rose
spark turret
#

ah now thats good news!

#

@brazen lagoon

brazen lagoon
#

@spark turret yeah I will probably create markers and then run a check every second client side

winter rose
#

or triggers with setTriggerInterval 😊

spark turret
#

didnt know about the trigger interval, thats honestly a gamechanger

#

especially for fast setup, simple stuff like "player in area play hint"

#

how does trigger countdown work with different intervalls? still the same?

winter rose
#

I would guess

fluid wolf
#

Am I dumb? I keep getting a CTD because this file cant find this .SQF

Am I missing something in there that should be present?

#include "..\includes\Startingpositions.sqf"

distant oyster
fluid wolf
#

missionfolder\includes\Startingposition.sqf

#

I've double checked the spelling to make sure I'm not making a spelling error somewhere and its identical as far as I can tell

distant oyster
#

and whats the location of the file from where you are including?

fluid wolf
#

missionfolder base directory

daring nova
#

the path that is trying to find is not in your mission directory

distant oyster
#

then it's #include "includes\Startingpositions.sqf"

daring nova
#

../ moves down one directory

fluid wolf
#

...AH. ok

#

thaaat would make sense

winter rose
#

up* ^^

broken forge
#

Will this pass the name of my _object param to the other functions? sqf [screen0, ["Start Briefing", "scripts\startSlideShow.sqf", [], -1, false, false, ""]] remoteExec ["addAction", 0]; ```sqf
SOGStartSlideShow = {
params ["_object", "SOGSlideArray"];
slideIndex = 0;
slides = count SOGSlideArray;

_object removeAction SOG1;
_object removeAction SOG2;
_object removeAction SOG3;

SOG1 = _object addAction ["Next Slide", {["_object"] call SOGNextSlide;}, [], 99, false, false, ""];
SOG2 = _object addAction ["Previous Slide", {["_object"] call SOGPreviousSlide;}, [], 98, false, false, ""];
SOG3 = _object addAction ["End", {["_object"] call SOGEndSlideShow;}, [], -99, false, false, ""];

};

still forum
#

no

#

pass it through addActions args

#

or grab it from _this in your action code, you have the object in there

broken forge
#

I'm getting this error in the log: [[_object, [0, _slide]], "SOG_setObjectTex> 14:31:45 Error position: <_object, [0, _slide]], "SOG_setObjectTex> 14:31:45 Error Undefined variable in expression: _object 14:31:45 File SOG\SOG_Functions_F\Briefing\scripts\briefing.sqf..., line 28 14:31:45 Error in expression <[_object] call SOGNextSlide;> 14:31:45 Error position: <_object] call SOGNextSlide;> 14:31:45 Error Undefined variable in expression: _object 14:31:57 Error in expression <e = SOGSlideArray select slideIndex;
Which is pointing to my SOGNextSlide Function: ```sqf
SOGNextSlide = {
params ["_object"];
if (slideIndex >= (slides -1)) then {slideIndex = 0};
slideIndex = (slideIndex +1);
_slide = SOGSlideArray select slideIndex;

[[_object, [0, _slide]], "SOG_setObjectTextureGlobal", true, true] call BIS_fnc_mp;

};

#

@still forum How would I go about grabbing it from _this in my action code?

still forum
#

_target is what you want

cosmic lichen
#

Bis_fnc_mp....what year is it?😄

broken forge
#

@cosmic lichen I'm trying to convert an old script that I found on the forums and use it as a function. I was thinking the same thing, lol, I haven't dove into that yet, just trying to get this to work then convert it.

#

@still forum So my addAction would look like this then? ```sqf
SOG1 = _object addAction ["Next Slide", {["_object"] call SOGNextSlide;}, [_this select 0;], 99, false, false, ""];

still forum
#

There's 3 examples on that page on how to do it

#

all of them include params

cosmic lichen
#

🤣

#

;] also syntax error

broken forge
#

I'm not following, this is a bit over my head atm. This is what I've gathered, and it doesn't make any sense to me: ```sqf
SOG1 = _object addAction ["Next Slide", { params ["_object"] call SOGNextSlide;}, [_this select 0], 99, false, false, ""];

still forum
#

I'm not good at explaining things. Better wait for someone to step in who's better at that

broken forge
#

@still forum How would you write that addAction? I'm more a visual learner for specific examples with what I'm trying to do

spark turret
#

any help getting a helo to land at my helipad? right now im giving him a waypoint exactly there, with completetion radius 5, but it autocompletes at around 50m.
Then, if close, i give _helo land "LAND"

#

but since the wp completes to early, its not precise.

#

for what?

broken forge
#

There's a helipad (invisible) that you could use to get the helo to land exactly on your helipad

spark turret
#

just found out through google, that _helo land "x" allows giving variable names.
why is that not documented in the biki?
@winter rose

spark turret
broken forge
#

You can find the Helipad (Invisible) under the props tab, in signs > helipads

spark turret
#

you can pass the vehicleVarName of an object as the rightarg into "land" command. but its not documented on the biki

#

biki just says you can choose from 4 enums

winter rose
#

I didn't know that, and I will definitely have to check if it's true

spark turret
#

it throws an error, but the helo does land there 😛

winter rose
#

(and it's not the vehicleVarName, it's the variable name)

winter rose
#

did you try:

Placing 3 helipads, heliA, heliB, heliC

and make the heli land "heliC" and see if it does land at that specific one and not at the closest one?

spark turret
#

yeah, it does choose the correct one

#

ah wait

winter rose
#

👀

spark turret
#

yeah he does seem to choose the correct one i think

winter rose
#

…"I think" ?

#

anyway, error = not the proper way = undocumented
maaaybe worth a note eventually perhaps, but that's about it

#

So you have your answer 😄

spark turret
#

well, is there a way to have a heli land precisely without using that way?

#

bc if not, its the only way to quite an important feature

winter rose
#

move then land yes

spark turret
#

sorry i dont follow

#

move wp and then the land "LAND" feature?

winter rose
#

make the helicopter move, then stop, then create an invisible H, then issue a land order

#

that's what for the invisible Hs are

spark turret
#

i have a visible one, but my problem is that the WP completes to early, ~50m away from it

#

even tho i set completion radius to 5

winter rose
#

that's completion radius for aircraft yes
Add a timer to it, it should solve the issue

spark turret
#

huh okay, ill try that. is that a cheesy way or just making sure he reaches the WP before it can complete to early?

winter rose
#

it starts the countdown instead of completing it right away; but during that time the helicopter will still try and get closer

spark turret
#

nice-o that worked. just as cheesy as the error generating land command tho 😄

#

thanks lou 👍

#

btw, another complaint: in the waypoint description, the "hook" one is described as "ai is basically incapable of picking out the correct one if you got a bunch close to eachother". that problem goes away if set the waypoint to the exact position, or even attach it to your crate

winter rose
still forum
#

If it works but throws error we should fix that.
It shouldn't action if it's erroring and it's shouldn't error if it's correct

winter rose
spark turret
spark turret
#

okay, i take back what i said

#

im working on a dynamic system that queues airlift transports. no way i could record a helo landing for that

winter rose
#

I guessed it was dynamic, so I admit I trolled a bit 😉

broken forge
#

Would this be the correct way to pass the object variable? ```sqf
SOGStartSlideShow = {
params ["_object", "SOGSlideArray"];
slideIndex = 0;
slides = count SOGSlideArray;

_object removeAction SOG1;
_object removeAction SOG2;
_object removeAction SOG3;

SOG1 = [_object, ["Next Slide", {["_object"] call SOGNextSlide}, [], 99, false, false, ""]] remoteExecCall ["addAction"];
SOG2 = [_object, ["Previous Slide", {["_object"] call SOGPreviousSlide}, [], 98, false, false, ""]] remoteExecCall ["addAction"];
SOG3 = [_object, ["End", {["_object"] call SOGEndSlideShow}, [], -99, false, false, ""]] remoteExecCall ["addAction"];

};

SOGNextSlide = {
    params ["_object"];
    _object = (_this select 3) select 0;

    if (slideIndex >= (slides -1)) then {slideIndex = 0};
    slideIndex = (slideIndex +1);
    _slide = SOGSlideArray select slideIndex;

    [[_object, [0, _slide]], "SOG_setObjectTextureGlobal", true, true] call BIS_fnc_mp;
};
```
winter rose
#

Optional questions:
1/ why do you prefix your variables SOG?
2/ why do you create variables you never use?

#

(also, no: see the params wiki page - use underscores!)

broken forge
#

I'm not sure why I keep prefixing my variables I went ahead and removed the prefix. I just switched the params to use underscores, and I'm not sure what you mean by variables that I don't use

fluid wolf
#

Anyone know if respawn type is able to be changed mid-mission? I want to switch it to spectator only after a certain point.

broken forge
#

I went ahead and replaced this code ```sqf
[[_object, [0, _slide]], "SOG_setObjectTextureGlobal", true, true] call BIS_fnc_mp;

_object setObjectTextureGlobal [0, _slide];
```
willow hound
#

The code in the addAction script parameter can not access _object, the variable does not exist in that scope. Use _this # 0 instead.

#
params ["_object"];
_object = (_this select 3) select 0;
```This does not make sense...
winter rose
#

many things are wrong, but I am already in bed (I'm) afraid

willow hound
fluid wolf
#

Got it. Alright.

#

Just curious if it was a thing I could do

tough abyss
#

Hi, I'm trying in pain to launch Arma (I mean without A3 launcher) through an GUI C# application with -noLauncher application setting but it doesn't work.
Does anyone have an idea ?
Thanks

#

I'm using steam://rungameid/107410 as process start info

#

it is working with absolute path

broken forge
#

@willow hound So my addAction would look like this: ```sqf
SOG1 = [_object, ["Next Slide", {[_this select 0] call SOGNextSlide}, [], 99, false, false, ""]] remoteExecCall ["addAction"];

And the Next Slide function would look like this: ```sqf
SOGNextSlide = {
    _object = (_this select 3) select 0;

    if (slideIndex >= (slides -1)) then {slideIndex = 0};
    slideIndex = (slideIndex +1);
    _slide = slideArray select slideIndex;

    _object setObjectTextureGlobal [0, _slide];
};
spark turret
#

Also you should probably move those functions into cfgfunctions

broken forge
#

@spark turret That makes sense as far as the prefixing goes, and I'm writing all of my functions in a pbo which will be loaded up for the server and the clients

cosmic lichen
#

They are still global and could get overwritten

broken forge
#

@cosmic lichen Should I put an underscore in front of them then?

cosmic lichen
#

no

#

JS_fnc_SOGNextSlide

spark turret
#

Pick a prefix that only you use. I use IRN

#

Its for identification

#

And to make sure noone accidentally creates a function of same name
(Arma_fnc_spawnUnit) or similar generic names

cosmic lichen
#

_object = (_this select 3) select 0; Are you sure?

broken forge
#

Oh ok, does this not work the same way? ```sqf
class CfgFunctions {
class SOG {
class Functions {
mode = 2;
jip = 1;

        // To Initialize SOG_FNC_Briefing Function Open Init.sqf or InitServer.sqf & Add [] call SOG_fnc_Briefing;
        class Briefing {
            file = "\SOG\SOG_Functions_F\Briefing\fn_init.sqf";
            description = "Script is Executed From The Init.sqf or InitServer.sqf";
        };
    };
};

};

spark turret
#

Need to change the SOG prefix to your own one. And no need for init file. Cfgfunctions does that automatically

#

And you dont put your init file in there but every function gets its own sqf file

broken forge
#

Then within that SOG_fnc_Briefing Function that I have Sub-Functions, I think that's what they're called. The CfgFunctions are located in the config.cpp for my SOG_Functions pbo

spark turret
#

Dont use SOG, thats preserved by the vietnam dlc

broken forge
#

Ok, I'll change it

broken forge
cosmic lichen
#

_object = (_this select 3) select 0; → params ["_object"];

broken forge
#

So you're saying its the same thing as if I were to just use params["_object"];

cosmic lichen
hollow thistle
spark turret
#

Ah well, it sounds like its official tho

#

I dont name my function "Apex_fnc_uwu" either :P

hollow thistle
#

yeah, you're right ;D

broken forge
#

@cosmic lichen I'm confused, lol, so is this addAction correct? ```sqf
A1 = [_object, ["Next Slide", {[_this select 0] call SOGNextSlide}, [], 99, false, false, ""]] remoteExecCall ["addAction"];

SOGNextSlide = {
    _object = (_this select 3) select 0;

    if (slideIndex >= (slides -1)) then {slideIndex = 0};
    slideIndex = (slideIndex +1);
    _slide = slideArray select slideIndex;

    _object setObjectTextureGlobal [0, _slide];
};
```
cosmic lichen
#

no

#

Why don't you test it

#

Then you will see

broken forge
#

I've been testing and it's not working, I get _object undefined. I have an addAction defined in init.sqf: sqf [] remoteExecCall ["JS_FNC_Briefing"]; [screen0, ["Start Briefing", "scripts\startSlideShow.sqf", [], -1, false, false, ""]] remoteExec ["addAction", 0]; startSlideShow.sqf```sqf
_SlideArray = [
["images\ACE3Medical_Slide01.paa"],
["images\ACE3Medical_Slide02.paa"],
["images\ACE3Medical_Slide03.paa"],
["images\ACE3Medical_Slide04.paa"],
["images\ACE3Medical_Slide05.paa"],
["images\ACE3Medical_Slide06.paa"],
["images\ACE3Medical_Slide07.paa"],
["images\ACE3Medical_Slide08.paa"],
["images\ACE3Medical_Slide09.paa"],
["images\ACE3Medical_Slide10.paa"],
["images\ACE3Medical_Slide11.paa"],
["images\ACE3Medical_Slide12.paa"],
["images\ACE3Medical_Slide13.paa"]
];

[screen01, _SlideArray] remoteExec ["StartSlideShow"];
StartSlideShow Functionsqf
StartSlideShow = {
params ["_object", "_slideArray"];
slideIndex = 0;
slides = count _slideArray;

_object removeAction A1;
_object removeAction A2;
_object removeAction A3;

A1 = [_object, ["Next Slide", {[_this select 0] call NextSlide}, [], 99, false, false, ""]] remoteExecCall ["addAction"];
A2 = [_object, ["Previous Slide", {[_this select 0] call PreviousSlide}, [], 98, false, false, ""]] remoteExecCall ["addAction"];
A3 = [_object, ["End", {[_this select 0] call EndSlideShow}, [], -99, false, false, ""]] remoteExecCall ["addAction"];

};
NextSlide Functionsqf
NextSlide = {
_object = (_this select 3) select 0;

if (slideIndex >= (slides -1)) then {slideIndex = 0};
slideIndex = (slideIndex +1);
_slide = slideArray select slideIndex;

_object setObjectTextureGlobal [0, _slide];

};

quaint ivy
#

Hey, I seem to miss-remember how mission parameters work. If my parameter is

        class AmbientUnits
    {
        title = "Allow ambient units";
        texts[] = {"Yes","No"};
        values[] = {true,false};
        default = true;
    };```
how would I retrieve the boolean value? I thought that `BIS_fnc_getParamValue` is used for this, but apparently that only returns the index of the used value, not the actual value.
#

am I forgetting that values can only be numbers or something?

vapid finch
#

I'm trying to make an option to enable and disable a dynamicText via Addon settings, and got the CBA side down

[
    "IBL_Watermark",
    "CHECKBOX",
    "Watermark",
    "IBL - Utilities"
] call CBA_fnc_addSetting;

XEH_preInit.sqf, but I'm confused on how to implement this into my code to see if the checkbox is checked or not. I know that it's a boolean

vapid finch
#

If you're putting that on just one object, I would just enter a variableName on the object using the ingame menu, then using that in place of _object

#

Say the variableName was "Z1"

    Z1 removeAction A1;
    Z1 removeAction A2;
    Z1 removeAction A3;
#

Or set _object = Z1

broken forge
#

@vapid finch this is what I have in the init.sqf: sqf [screen0, ["Start Briefing", "scripts\startSlideShow.sqf", [], -1, false, false, ""]] remoteExec ["addAction", 0]; This is what I have in the startslideshow.sqf```sqf
SlideArray = [
["images\ACE3Medical_Slide01.paa"],
["images\ACE3Medical_Slide02.paa"],
["images\ACE3Medical_Slide03.paa"],
["images\ACE3Medical_Slide04.paa"],
["images\ACE3Medical_Slide05.paa"],
["images\ACE3Medical_Slide06.paa"],
["images\ACE3Medical_Slide07.paa"],
["images\ACE3Medical_Slide08.paa"],
["images\ACE3Medical_Slide09.paa"],
["images\ACE3Medical_Slide10.paa"],
["images\ACE3Medical_Slide11.paa"],
["images\ACE3Medical_Slide12.paa"],
["images\ACE3Medical_Slide13.paa"]
];

[screen0, SlideArray] remoteExec ["StartSlideShow"];

#

The functions are all packed into an addon, so I'm trying to keep them open to different variable names/object names

vapid finch
#

Correct me if I'm wrong, but shouldn't SlideArray be SOGSlideArray?

#

Not too versed on that

broken forge
#

it should be SlideArray, I forgot to edit that

vapid finch
#

Hm

craggy lagoon
#

I've got this working whenever a player picks up a terninal off the ground but if it's pulled from an inventory it doesn't work. How can I specify a _container to be any item? Thank you in advance!!

player addEventHandler ["Take",  {
    params ["_unit", "_container", "_item"];
    if (_item == "B_UavTerminal") then {
        playSound "Denied";
        execVM "scripts\test.sqf";
    };
}]; 
#

Ok so it does kick off when I pull from inventory. But if it's pulled from Ace Arsenal it doesn't fire off. Any idea on how to get it to also run off Arsenal?

wispy cave
#

How would one go about detecting when someone ejects out of a jet? I want to delete this jet when someone ejects. But obviously not when they just get out and the getout eventhandler doesn't have a param to see if it was a normal getout or if the pilot ejected. (I also need it to work for both vanilla and PF)

spark turret
#

if the jet is in the air, after the getOut EH, its probably an ejection 🙂

wispy cave
#

well, if it's in the air, it'll probably crash and be destroyed, it's more for when someone accidentally (or intentionally) ejects on the ground

spark turret
#

ah

sage dawn
#

you could just do a height check to see if it's on the ground

#

if the Z value is under like 2 or something, it's probably on the ground

#

or do you mean specifically only when they use the ejection seat?

wispy cave
#

yes

sage dawn
#

could maybe also use a height check, if they eject, they're gonna go up in the ejection seat

#

so maybe like, when they get out, wait a second or so and check if their height is about the same as when they got out

#

if they just got out, it'll be roughly the same, if they ejected, it'll be much higher

true frigate
#

can someone help me out with this script ive rewritten to work with my mission?
Its supposed to drop a crate from a C-130, with the variablename C130.

private _obj = createVehicle ["CargoNet_01_box_F", C130, [], 0, "NONE"];   
private _para = createVehicle ["B_parachute_02_F", [0,0,0], [], 0, "FLY"];  
  
_para setDir getDir _obj;  
_para setPos getPos _obj;  
_obj lock false;  
 
_para attachTo [_obj, [0, 0, 1]]; 
 
 _para disableCollisionWith _obj;  
 _obj setVectorUp [0,0,1];
 _obj setVelocity [0,0,0];

the issue is, the parachute doesnt act as a parachute, instead just falling out of the sky like a stone, and im not sure why. It was working perfectly before i attached it in my testing

wispy cave
sage dawn
#

@true frigate try doing the opposite attaching, attach the box to the parachute instead of attaching the parachute to the box

#

I think attaching the parachute makes it lose its parachutiness

true frigate
#

Wouldnt doubt it haha, arma can be a bit fucky at some times

true frigate
sage dawn
#

since the ejection seats are separate vehicles in arma

#

just need to figure out the classname for it

novel delta
#

sorry if this isnt the right place but may anyone know how to get a search light to just kinda do a idle rotation of like 30 degrees?
trying to get the cup search lights to just do a basic rotation for ambiance for a small friend group op

true frigate
true frigate
#

_obj (2,3 and 4) are ammoboxes that when i create them, have an inventory of weapons not suited for my mission, Im trying to use this

clearItemCargo _obj;
clearItemCargo _obj2;
clearItemCargo _obj3;
clearItemCargo _obj4;

But its not working, am I using the wrong command?

winter rose
#

you need to clear items, weapons and magazines too
also global if MP

true frigate
#

Thanks Lou 🙂

little raptor
unreal scroll
#

Need to store AI units tasks/waypoints in some kind of data structure, and restore it by request. Like:

  1. Column is moving to its destination
  2. It has been attacked, stopped and did some defensive actions.
  3. When it's clear, it continues to move to its initial destination.

Does anyone know such working data structure, or is there anything similar in standard scripting?

willow hound
# broken forge I've been testing and it's not working, I get _object undefined. I have an addAc...

_this is a magic variable containing the parameter(s) provided to your code when it was called / spawned (https://community.bistudio.com/wiki/Magic_Variables).

In StartSlideShow you have (I left out the remote execution because it is not important for what I am trying to explain):

_object addAction ["Next Slide", {[_this select 0] call NextSlide}, ...];
```When the player performs that action, `addAction` automatically passes some parameters to the code, so `_this` is an array in that scope (https://community.bistudio.com/wiki/Variables#Scopes). The first element in that array is the object the action was added to (this is documented here: https://community.bistudio.com/wiki/addAction), and that is exactly the object you want to use in `NextSlide`, so you use `select` to grab that one element and you pass it to `NextSlide`: `[_this select 0] call NextSlide`.

Now we arrive in `NextSlide`. In that scope, `_this` is an array again, and that array contains a single object (the one you selected and passed when you called `NextSlide`), and you want that object in a variable.
But the code you use for this does not make any sense:
```sqf
_object = (_this select 3) select 0;
//Same as:
_step1 = _this # 3; //Error: _this only has one element!
_step2 = _step1 # 0; //Error: Even if _step1 worked, the only element in _this is an object, not an array!
_object = _step2;
```Two equivalent options that would work:
```sqf
params ["_object"];
...
_object setObjectTextureGlobal [...];
``````sqf
private _object = _this # 0;
...
_object setObjectTextureGlobal [...];
astral dawn
#

or hashmap

#

or you can use my OOP framework ||if you are as insane as I am||

#

In short, I've solved your problem like this:

  • at each update the (group AI) selects most relevant goal
  • there are two types of goals:
    -- internal, AI might want to do it by itself in any situation, these are mainly defensive goals, or goals for when bots have nothing else to do
    -- external. AI does this goal only when ordered by an upper level AI (like commander or your game mode overall giving orders to bots).
  • defense is internal goal with high priority, movement is external goal with low priority
  • the self-defense has higher priority than 'move' goal, so bots switch to defense goal when attacked
  • when done defending, the defense goal is no longer relevant, and the movement goal is still relevant, so bots switch back to convoy movement behaviour
#

But there are many ways to do AI in video games, there isn't a best way to fit all cases...

broken forge
#

@willow hound Thanks for the explanation, after reading what you wrote and then looking at the links you provided it makes sense now. I've implemented the edits, thanks again. I'm getting a new error now: ``` 6:25:52 Error in expression < slideArray select slideIndex;

_object setObjectTextureGlobal [0, _slide];
};

6:25:52 Error position: <setObjectTextureGlobal [0, _slide];
};

6:25:52 Error Type Array, expected String
6:25:52 File SOG\SOG_Functions_F\Briefing\scripts\briefing.sqf..., line 28
init.sqfsqf
[screen0, ["Start Briefing", "scripts\startSlideShow.sqf", [], -1, false, false, ""]] remoteExec ["addAction", 0];
startSlideShow.sqfsqf
_SlideArray = [
["images\ACE3Medical_Slide01.paa"],
["images\ACE3Medical_Slide02.paa"],
["images\ACE3Medical_Slide03.paa"]
];

[screen0, _SlideArray] remoteExec ["StartSlideShow"];

Both Functions being used: ```sqf
StartSlideShow = {
    params ["_object", "_slideArray"];
    slideIndex = 0;
    slideArray = _slideArray;
    slides = count slideArray;

    _object removeAction 0;

    1 = [_object, ["Next Slide", {[_this select 0] call NextSlide}, [], 99, false, false, ""]] remoteExecCall ["addAction"];
    2 = [_object, ["Previous Slide", {[_this select 0] call PreviousSlide}, [], 98, false, false, ""]] remoteExecCall ["addAction"];
    3 = [_object, ["End", {[_this select 0] call EndSlideShow}, [], -99, false, false, ""]] remoteExecCall ["addAction"];
};

NextSlide = {
    params ["_object"];

    if (slideIndex >= (slides -1)) then {slideIndex = 0};
    slideIndex = (slideIndex +1);
    _slide = slideArray select slideIndex;

    _object setObjectTextureGlobal [0, _slide];
};
astral dawn
cosmic lichen
#

@broken forge The error tells you what's wrong.

#

Your slidesArray contains arrays.

little raptor
astral dawn
broken forge
#

@cosmic lichen I see it now, I feel really dumb at the moment, the slides shouldn't be in arrays themselves, lol

unreal scroll
#

@astral dawn Did you consider something like weight system?
Like calculating weight for each task/target nearby?

tidal ferry
#

Hey, quick question! So functions that are executed at mission start via postInit- the Biki mentions that any long term suspension will halt mission loading until finished, but would that extend to calling/spawning other scheduled functions from within that initial postInit function?

tidal ferry
#

So basically, moving suspended code to new functions would resolve mission times taking a while in the initial postInit function?

little raptor
#

where does it say that?

tidal ferry
#

Pre and Post Init
preInit and postInit attributes are truly powerful ones, as they let you execute your function at the beginning of every mission. Use them with caution!.
preInit are called unscheduled so suspension is not allowed. Parameters passed are [ "preInit" ].
postInit are called scheduled so suspension is allowed but any long term suspension will halt the mission loading until suspension has finished. Parameters passed are [ "postInit", didJIP ].
Any scripting error will prevent the mission from being loaded correctly
Server admins might blacklist your addon if they find out you're using the function for hacking.

#

^From the biki

#

Erm

#

Mods, delete that man

#

:P

little raptor
tidal ferry
#

Sorry sorry, let me clarify

#

Basically, our missions use initPlayerServer, initServer, etc. scripts for mission files, and I'm looking to condense that into a single function in our unit mod that can be activated via description.ext attribute to make it easier for missionmakers

#

Got it working but I'm trying to resolve long mission load times

#

Basically have it so that it'll execute different code for server, HC, player etc.

#

However, currently that code is right in the function

#

I'm considering just making a new function for each segment (server, player, HC etc.) which will be spawned by the initial postInit function on mission load

astral dawn
tidal ferry
#

So basically, it'll be like "if server, then go do server-specific function"

#

Which is what I already have, but I just want to get that out of the postInit and into the scheduler

little raptor
tidal ferry
#

Yeah that's fine by me

#

Like I said, I'll tidy it up and rewrite to unscheduled if I need to

#

It's just that the new function has been drastically increasing loading times and I finally found out why

little raptor
#

if it has no waiting in it (sleep, waitUntil), my advice is to make it fully unscheduled

#

it'll finish faster

tidal ferry
#

Yeah, that's the plan for some of the serverside scripts

#

But some of the player ones are unscheduled since we use suspension for our inventory system

#

We had an indefinite while loop that worked in initPlayerLocal.sqf but froze the game indefinitely in postInit

#

Which was the main culprit

tidal ferry
#

Yeah, basically we have a script that, when activated, saves inventory every 60 seconds or so

#

So yeah, in our specific case we do need a loop

#

But not for everything

#

Like I said, I'll work on tidying it up

#

Thanks for the help!

spark turret
#

you cant call suspending functions and you dont halt the inits flow by spawning suspending code from it

little raptor
#

you cant call suspending functions
not sure what you mean here

spark turret
#

functions which use sleep cant be called.

little raptor
#

they can

spark turret
#

oh hm

little raptor
#

call from scheduled == scheduled

#

call from unscheduled == unscheduled

spark turret
#

hmmm i guess yeah, i just came to that conclusion yesterday bc i tried calling them from unscheduled

#

well then its: you cant call functions using sleep in an environment which doesnt allow suspension

little raptor
#

@tidal ferry you may want to learn the isNil trick

tidal ferry
#

Oh?

spark turret
#

atomic execution?

little raptor
#

it allows you to switch from scheduled to unscheduled environment

little raptor
tidal ferry
#

Oho, where might I learn about this?

little raptor
#

we don't have any multithreading or atomic stuff in sqf

spark turret
#

someone called it atomic once iirc 🤷‍♂️

zenith edge
#

thats what fancy intercept is for :)

little raptor
#

no, sqf is sequential

little raptor
zenith edge
#

yea, mostly just useful for data processing

#

or linking to outside resources

little raptor
#

see the alternative syntax

#

basically, isNil ensures that everything in the code will execute in one frame

tidal ferry
#

Ohhhh I see now

#

Oh wow that's actually really cool

#

So I can use that to skip certain code ahead of the line in scheduled?

little raptor
# tidal ferry So I can use that to skip certain code ahead of the line in scheduled?

not sure what you mean
but I guess this'll make it clearer:
say you want to spawn a vehicle in some random position and move it to a safe pos:

isNil {
  _veh = createVehicle ["bla", [0,0,0]];
  _veh setPosASL _posASL;
}

without isNil, if the vehicle spawns in an unsafe position it'll explode (spawning a vehicle takes over 10 ms, which is way higher than the 3 ms scheduler limit, so setPosASL executes in the next frame)

#

(of course, if the environment is scheduled; you don't need it in unscheduled)

spark turret
#

(bc the above code is allowed to run scheduled, it can take 2 frames, first frame: spawn, collides, 2nd frame: teleport, but already to late)

tidal ferry
#

"without isNil, if the vehicle spawns in an unsafe position it'll explode"

Starsim units hate him because of this one simple trick! :P

#

I kid

#

But yeah no, that seems really helpful actually

#

I'll definitely have a look into trying to implement that

spark turret
#

hm can that thing cause the main thread to be halted?

#

or does it just abort after 3ms

little raptor
little raptor
tidal ferry
#

Sure thing, I'll try to get that in for some of the functions

little raptor
tidal ferry
#

Hey, another silly question

#

But what's the proper terminology for "right argument"? E.g.

[leftarg] function "rightarg" or something to that nature

winter rose
#

kangaroo (another silly answer)

tidal ferry
#

:P

winter rose
#

right-hand argument

tidal ferry
#

Is that the official terminology? Hmm

winter rose
#

"official" idk, technical more or less yeah?

tidal ferry
#

Hmm okay

#

Just trying to figure out the best way to start teaching some people SQF and I want to make sure I actually get it myself

copper raven
#
unary <right>
<left> binary <right>

hint _right;
_left + _right;
tidal ferry
#

Ohhh, okay

#

So like...
allUnits is nular,
count allUnits is unary, and
{code} forEach allUnits would be binary?

winter rose
#

for respectively allUnits, count and forEach, yes 🙂

tidal ferry
#

Outstanding, okay

winter rose
#

no u!

tidal ferry
#

So... nular doesn't have arguments, so it's moot there

#

Unary has only a right argument, which I guess would just be called the argument?

copper raven
#

usually its referred as right argument

tidal ferry
#

Okay, gotcha

#

So with binary, left args become params and right arguments don't

winter rose
#

yes

[0, "rightArg"] remoteExec ["hint"]; // no
["rightArg"] remoteExec ["hint"]; // yes
copper raven
#

for remoteexec you put argument(s) into an array

#

thats it

#

well for binary into array

#

unary, you can just pass the value directly

tidal ferry
#

Okay, sweet, gotcha

tidal ferry
#

Just trying to figure out the best way to explain it to someone new at sscripting

tidal ferry
#

Yep, already on SQF syntax

#

Only thing I haven't read yet is order of precedence

#

Will do that now

graceful pewter
#

anyone have a working gun range timer and target reset script please? Ideally one that tells you how many targets were hit as well?

grizzled dome
#

Is it possible to make a trigger that plays a video to all players when they aproach it ?

proven charm
spark turret
#

raaah why no indentations

winter rose
proven charm
#

if I comment out setposATL then it wont freeze

tidal ferry
#

Hey, question

#

Is it possible to attach a particle emitter to a body part of a human character?

still forum
#

with the new attachTo bone, yes

tidal ferry
#

Sweet, okay

#

Thanks

spark turret
#

anyone know if its possible to get a reference to a diary record and change its text?
im using it for logging the behaviour of a heli flying suplly missions, and its annoying that its uses this big ass font for date when im only writing in one line

fleet geyser
#
textureList[] =
        {
            "guerilla_01", 1,
            "guerilla_02", 1,
            "guerilla_03", 1,
            "guerilla_04", 1
        };

How can I go about forcing one of these in the "custom init" of a respawning vehicle?
Been banging my head at the wall for about 2 hours now, any help would be appreciated.

spark turret
#

Hows the car respawned? With a module?

fleet geyser
#

Yes - its respawning through the simplex support services transport module (If you are familiar with it)

spark turret
#

No ides. Does the module offer some kind of"run this code on respawn"?

fleet geyser
#

Yes- it has a "custom init code" field that runs when the vehicle is added and respawned, vehicle = _this

spark turret
#

save your list into a global variable:

MyTextureList = ["guerilla_01", 1,
            "guerilla_02", 1,
            "guerilla_03", 1,
            "guerilla_04", 1
];

and then select from there with MyTextureList select 0; f.e.

#

(that format with the string,1 looks off, probably need to do nested arrays)

spark turret
fleet geyser
#
_veh = createVehicle ["vn_b_air_uh1c_03_01",position player,[],0,"NONE"]; 
[ 
 _veh, 
 ["uh1c_20",1],  
 true 
] call BIS_fnc_initVehicle; 
#

All I know is that uh1c_20 is the hiddenselection/texture I need to force it to spawn with .. Appreciate the help, slowly piecing together what I need to do based on your input:)

spark turret
#

np thats what this channel is for

spark turret
#

basically its "create helipad, domove helo, setskill 1, if close: land"

winter rose
#

noice!

spark turret
#

nevermind, it doesnt work when i do it. the heli just hovers near its WP but refuses to go closer

#

FFS

spark turret
#

im trying to get a heli to land at my helipad. but the waypoint autocompletes when the heli is closer than 100m when given the WP, and the heli refuses to go directly to the wp, hovering ~50m away

little raptor
#

yeah

#

iirc using moveTo instead of doMove fixed it?

#

let me check my mod again

spark turret
#

ah ill try that

little raptor
#

like:

doStop _heli;
sleep 0.001;
_heli moveTo _pos;
spark turret
#

alright, will try

little raptor
#

sleep is necessary in this case

#

(at least 1 frame delay)

spark turret
#

lol, the helo now moves to the position but overshoots by far

#

this is very unsatisfying. it worked yesterday 😦

sweet salmon
#

Howdy all, is it possible to do custom wheels?

#

to allow say an aircraft to be able to roll?

#

and follow on, if custom wheels is possible, is it then also possible to prevent them from rolling to simulate a parking brake

spark turret
#

only modding allows that afaik

jade acorn
#

how can I implement post process effects into the mission? do I have to make a separate file with the code or can it be placed inside Description.ext? I'd be grateful for an example too, as biki only shows the code without info how to implement it into a scenario

wicked fulcrum
#

Question regarding performance and enablesimulation: false. So I keep hearing from here and there that if I place many static objects in close proximity I should disable simulation on the objects to increase performance for the players in said area. However I just read on the wiki from 2012: https://community.bistudio.com/wiki/enableSimulation

HomerJohnston: using "this enableSimulation False" on static objects has no effect on a dedicated server's bandwidth usage or FPS (as per current 1.59 Release version).
Krause: re: Homer. Yep. That's because this functionality is now part of the basic arma netcode. Pretty nice :)

Whats the current stance on performance and enableSimulation ? Does it not matter for the dedicated server, but each players local machine might gain performance?

If I build 20+ sandbags or hescos in a square close to each other, do anyone gain performance by having them all as enableSimulation = false or is this placebo ? 😉

sweet salmon
spark turret
sweet salmon
#

what direction would one go to make that happen

winter rose
wicked fulcrum
#

yeah, I'm asking here as I have heard conflicting reports on it, and haven't been able to google me to substantial information about it. And I was not sure if information from 2012 was still relevant today.

Logical I would assume it could improve performance for the individual player as it doesn't do "sim" calculations for said object.

#

But I'll take your answer as it does have an impact and that information from 2012 is outdated besides the network perf. 🙂
Cheers for the answer 🙂

spark turret
#

how do i change locality of an object?
my concern is that a zeus spawns a crate (which will be zeus-local) and then lets a server-local helo airlift it. the helo cant detach it anymore (had that happen before)

willow hound
ocean orchid
#

Say I wanted to create a mission that was centered around a curing sick civilians. How would I go about using the old man sick skin textures on units? I've found and used the hidden setFace for the skins but that doesn't actually show the visual skin changes anywhere. Is there a unitVariable that needs to be set?

ocean orchid
#

Nevermind I've got it sorted. Need to be damaged at the head. So I used setHitPointDamage to set the head to have taken damage, in case anyone else wants to use it as well. Just need to make it so you can't treat their wounds now.

brazen lagoon
#

is there a function that exists for checking in area for multiple markers?

#

like basically checking if an object is in any of a set number of areas

little raptor
#

no

#

you can use a forEach tho

#

or findIf

brazen lagoon
#

yeah just didnt want to duplicate it if it existed

#

@little raptor if there's like, ~130 area markers, how slow do you think it would be to iterate over all of them once a second

#

basically am I going to start running into performance problems with a {_player inarea _x} forEach [marker_array]

little raptor
#

so it's not really slow

brazen lagoon
#

yeah I'm basically just checking if the player is in an area and adding actions if they are

little raptor
#

if it's scheduled you have nothing to worry about

brazen lagoon
#

cool

frosty cairn
#

Hey guys, I need a small bit of assistance.
I need a addAction script that checks for the classnames of two objects, and then if they are there, then it deletes the objects

grim stone
#

Is anyone here know how to set up teamspeak for task force radio(server side)

frosty cairn
#

Rest should work.

grim stone
#

When i load into my server it says it can’t find the server and it doesn’t move me in the TFAR channel

frosty cairn
#

Hm?

#

Send your .rpt file of your server.

shadow knoll
#

what kind of script would i have to write if i want to make a scenario that uses arma 3s base revive system but if you have ace 3 loaded it will detect it and disable arma's revive system?

frosty cairn
#

you dont have to

#

just make sure the incapacitation is off

shadow knoll
#

thanks brotha i will check it out

astral dawn
#

but the code above does it the other way around: if ace medical is disabled, then it initializes the system

broken forge
#

how do I go about removing all actions greater then 0?

winter rose
#

for i from 1 to 10e10 ^^ ?

#

there is allActions or something alike, returning action ids

winter rose
maiden warren
#

Hey, is it possible to count same values in an array?
Example:
_Array = [0,1,2,3,4,5,5,5,6,1,1];
How would I count the same values? In this case 5's and 1's?

#

ps: i know about BIS_fnc_consolidateArray but that's not what I'm after

daring nova
#

do you want to count how many duplicates there are?

maiden warren
#

Yeah

daring nova
#

so for you sample array, the value would be 2

maiden warren
#

Well, two elements, 5 and 1

#

And I would need to count how many of 5's and how many of 1's there are

#

Which in this case would be 3 5's and 3 1's

#

I know I could probably go with something like if(count 5 in _Array >= 1) then ...

#

but that would be needed for all elements in an array right

winter rose
maiden warren
#

Probably but for some reason it's not doing it right

#

Basically, I have an array of elements from which I randomly generate 5 of them. And I need to find how many same values are in those new randomly generated elements which are stored in anoither array

daring nova
#
private _duplicateMap = createHashMapFromArray (_array call BIS_fnc_consolidateArray);
private _fiveCount = _duplicateMap getOrDefault [5, 0]
systemChat str _fiveCount; // 3

this should work, if I understand your problem

#

also if I understand that function

#

if the value doesnt exist, it returns 0 with getOrDefault [5, 0]

maiden warren
#

I'll give it a try

winter rose
#

Noice code btw

daring nova
brazen lagoon
#
    waitUntil {
        sleep 1;
        !(_player inArea _marker)
    };```
#

why does this return a typeerror?

#

<obj> inArea <marker> should return either true or false, so I have no clue why this is happening

brazen lagoon
#

any reason why remoteExec wouldn't work when a function is in CfgRemoteExec?

#

any simple way of figuring out whether two factions are on the same side?

grim stone
#

could anyone help me with KP liberation, im having a issue setting it up on my dedicated server

brazen lagoon
#

@grim stone prob better to ask in #server_admins, maybe the specific chan for your OS

grim stone
#

ill try that, thanks

exotic tinsel
#

so now that armaholic is gone, does anyone have a safe link to pbo manager?

warm hedge
somber radish
somber radish
somber radish
brazen lagoon
#

no i want to know if two factions are on the same side

#

put sqf on the first line in a code block

dense galleon
#

@brazen lagoon well since both of the commands faction and side call for objects on the right side parameter, you cant simply say if (faction is side x), so i would try to find the faction in CfgFactionClasses and check the side there

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
somber radish
#
Hint "Sweet, that was just what I needed, was trying forever to get it right";
winter rose
#

Enjoy, have fun! ^^

somber radish
#

So anyone know of a way I could script in the placing of an object in zeus mode?
Meaning, I'm in zeus mode and I open a dialog where from I select the building I want to place.
ex.

If (HouseA selected) then {"code that allows me to place any object using the zeus 'icon' thingy"};

#

super vague I know

#

Any zeus scripting resources would be great!

#

something like

CuratorDoPlace "houseA"```
frosty cairn
#

Hey guys, I need a small bit of assistance.
I need a addAction script that checks for the classnames of two objects in a trigger, and then if they are there, then it deletes the object(s)

cosmic lichen
#

see addAction, inArea commands

frosty cairn
#

doesn't inArea use objects, i need a string

#

could i convert them somehow or...?

cosmic lichen
#

typeOf _object → classname

frosty cairn
#

ah, okay, cheers

#

so how would I need to write it with if and then
if (typeOf _object inArea trigger1 isEqualTo true) then {deleteVehicle _object};
?

sleek token
#

if (_object inArea trigger1) then { deleteVehicle _object };

frosty cairn
#

ah, and then i need to define _object before, right?

sleek token
#

yes

#

needs to be assigned to an object, i guess in your case a vehicle

#

but how you are trying to do it is a bit odd

frosty cairn
#

_object = ["classname","classname"]; does that work?

#

wait, no it doesn't

#

at least i think

cosmic lichen
#
(vehicles inAreaArray myTrigger) apply 
{
  if (typeOf _x in ["class1", "class_2"]) then 
  {
    deleteVehicle _x;
  }
};
frosty cairn
#

ah, okay.

#

thanks @cosmic lichen and @sleek token

unreal scroll
#

How can I make an AI vehicle driver to face a selected position?

copper raven
unreal scroll
#

No, it works for turret only.

copper raven
#

driver _vehicle doWatch _position does that not work?

little raptor
#

you can also try lookAt

unreal scroll
#

Nope

copper raven
#

what vehicle are you trying it on?

unreal scroll
#

A tank

winter rose
#

is it a single vehicle? or part of a group

#

if single vehicle, you could try setFormDir @unreal scroll

unreal scroll
#

Hm, it doesn't work too.
It is a single vehicle, not a column.

astral dawn
#

I don't think that tanks in arma want to face a specific direction for any purpose except for driving

#

so... domove?

little raptor
copper raven
#

doWatch kinda works but it has super weird behaviour, driver tilts his head towards the position after some time, and then stops watching

#

so not really reliable

winter rose
#

doWatch, doTarget, glanceAt, etc 😄

unreal scroll
#

"doWatch, doTarget, glanceAt, etc"
Nothing from this works.

"do you mean the driver himself, or the vehicle?"
Vehicle of course 🙂

"I don't think that tanks in arma want to face a specific direction for any purpose except for driving
so... domove?"
No, bruteforce 🙂

private _negative = false;
private _dir = _veh getRelDir _instigator;
if (_dir > 180) then {_dir = 360 - _dir; _negative = true};
for "_i" from 0 to (abs(round(_dir)) * 4) do { 
  [{ 
    params ["_veh", "_increment"]; 
    _veh setdir (getDirVisual _veh) + _increment; 
  },[tank, [0.25,-0.25] select _negative], 0.05 + (0.05*_i)] call CBA_fnc_waitAndExecute; 
};

copper raven
#

ah vehicle, i thought the driver

little raptor
#

(I mean the CBA_fnc_waitAndExecute function)

#

also use getDirVisual

unreal scroll
#

"(I mean the CBA_fnc_waitAndExecute function)" - why?

little raptor
astral dawn
#

No, bruteforce 🙂
yes I wanted to suggest that too

unreal scroll
#

@little raptor Can it run in unscheduled?

little raptor
#

yes

unreal scroll
#

And how can I set the delay for turn iterations?

little raptor
#

delay == one frame

copper raven
#

why is that function bad?

unreal scroll
#

But I use WaitUntil exactly for delays 🙂

copper raven
#

it does everything onEachFrame in the background aswell

hollow thistle
#

His method is simple enough and works.

#

with each frame you need to check when to stop etc.

little raptor
#

fair enough

hollow thistle
#

WAE just pushes to the array...

#

and CBA eachFrame takes care of the rest.

little raptor
hollow thistle
#

what you're suggesting might be smoother.

little raptor
copper raven
little raptor
#

also, another problem with using setDir is that it won't work on sloped surfaces

astral dawn
#

🤓

unreal scroll
#

"But it's better to nest it maybe?"
You mean to call it with spawn?

astral dawn
#

and iteration after that: write own tank AI like Leopard 😄

unreal scroll
#

What's wrong with Leo? 🙂

astral dawn
#

I wonder how ugly that animation will look in multiplayer 🤔

astral dawn
astral dawn
astral dawn
little raptor
# unreal scroll "But it's better to nest it maybe?" You mean to call it with spawn?

I mean:

fnc_rotate = {  
    params ["_veh", "_target"]; 
 _diff = _veh getRelDir _target; 
 if (abs(_diff - 180) < 179) then { 
  _veh setDir (getDirVisual _veh + ([-2, 2] select (_diff <= 180))); // * (_diff/180 max 0.25) makes it a bit less robot
  [fnc_rotate, _this, 0.001] call CBA_fnc_waitAndExecute;  
 } else { 
  _veh setDir (_veh getDir _target); 
 } 
}; 
 
[fnc_rotate,[tank, _instigator], 0.001] call CBA_fnc_waitAndExecute; 
#

it's also dynamic

#

so the target can move

unreal scroll
#

@little raptor Thanks. As I understand, the callstack is much less in this case?

little raptor
#

it's pretty much the same

copper raven
#

you iterate less per frame

unreal scroll
#

So what is the difference?

"* (_diff/180 max 0.25) makes it a bit less robot"
0.25 increment and 0.05 time period is enough.

copper raven
#

because you don't push everything at the same time

little raptor
unreal scroll
#

"because you don't push everything at the same time"
If it has no effect on a callstack, so what is the difference? 🙂 It just wait for execution, it doesn't run at the same time.

little raptor
unreal scroll
#

"makes it non-linear (well, for some part)"
Why it should be non-linear? It will lead to different rotations steps in different cases. It is not good.

"2. doesn't depend on FPS"
Why?

little raptor
#

but when you nest it, the next iteration happens in the next frame (or at least I hope it does meowsweats )

copper raven
#

actually, nesting is worse

little raptor
#

how come?

copper raven
#

the array is sorted everytime, so a new call to waitAndExecute means sort again

unreal scroll
#

"If it's faster, it'll look choppy."
No, it looks ok 🤔

hollow thistle
#

CBA_fnc_execNextFrame?

little raptor
#

well that's why I prefer to write my own stuff

copper raven
#

that, or the initial iterative solution blobdoggoshruggoogly

#

i mean, don't get me wrong - this is a decent optimisation actually for the common cases, if i didn't check the source, i'd write it recursively aswell

unreal scroll
#

BTW, interesting - with my implementation the turn looks a bit smoother (with the same values).

little raptor
#

maybe CBA_fnc_execNextFrame would solve it

unreal scroll
#

I still can't get why WaitAndExecute is worse than other methods. Just because of possible different framerates in my situation?

little raptor
#

btw another problem occurs if the user runs at 10 < FPS meowsweats (overlap)

unreal scroll
#

What happens then?

little raptor
#

overlap

#

although maybe it won't be visible meowsweats

#

because it's sorted

unreal scroll
#

"because it's sorted" ?

little raptor
#

oh right nvm. you just increment the dir

#

I thought you did setDir _dir meowsweats

unreal scroll
#

Ok, thank you guys.

cosmic lichen
still forum
#

maybe it has a memory point in the model saying what rot center is

#

or try positionModelToWorld with 0,0,0 which gives you model zero (which doesn't have to be bounding center if model is not autocenter=1)

sage dawn
#

have you checked if it maybe has a built-in animation?

astral dawn
astral dawn
smoky rune
#

Is there any way to spawn bomb as simple object?
these does not work, throws Simple object data are corrupted, class or p3d is required:

["A3\Weapons_F_Sams\Ammo\Bomb_05_F_fly.p3d", getPosWorld player] call BIS_fnc_createSimpleObject;
["BombCluster_03_Ammo_F", getPosASL player] call BIS_fnc_createSimpleObject;
still forum
#

just use the command, not the function?

smoky rune
#

you mean createVehicle?

still forum
#

no

#

createSimpleObject

smoky rune
#

oh, i didn't even knew it existed, brb

#

yeah, it works, thank you

cobalt sorrel
#

Looking to pack a mod but I see alot of similar mods with a texHeader.bin file.
I've read through the texHeaders.bin BIWIKI page, but still at a lose to if I really need it for this mod.

Mod is a simple custom map markers. Anyone advise?

cobalt sorrel
#

How and when? I've packed the addon, put it in the @modfolder and added also a mod.cpp for info. All works, but I don't see a texheader anywhere?

sage dawn
#

you don't need it

#

wait, you mean it isn't in the pbo?

warm coral
#

okay so i have this big and messy init script in the config of a unit

#
RandomAmmoCount = selectRandom [1, 2, 3, 4, 5];
init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear; (_this select 0) addGoggles (selectrandom [ """", ""VSM_beard_2"", ""EF_MSG_BK"", ""immersions_pops_pop0"", ""G_Respirator_blue_F"", ""G_Respirator_white_F"", ""G_Respirator_yellow_F"", ""rhs_scarf"", ""TRYK_bandana_g"", ""CUP_G_WristWatch"", ""G_AirPurifyingRespirator_01_F"", ""CUP_G_GPS"", ""KA_MCU"", ""CUP_G_Scarf_Face_Grn""]); (_this select 0) addHeadgear (selectrandom [ """", ""H_FakeHeadgear"", ""FGN_CauR_Beanie_Black"", ""FGN_CauR_Beanie_Woodland"", ""H_Booniehat_oli"", ""H_Booniehat_khk"", ""H_Booniehat_grn"", ""H_Booniehat_tan"", ""H_Cap_oli"", ""H_Cap_grn"", ""H_Cap_blu"", ""H_Cap_blk"", ""H_Cap_red"", ""H_Cap_tan"", ""H_Cap_usblack"", ""H_Cap_tan_specops_US"", ""H_BandMask_blk""]); (_this select 0) forceAddUniform (selectrandom [ ""CUP_I_B_PMC_Unit_3"", ""CUP_I_B_PMC_Unit_2"", ""LOP_U_PMC_Fatigue_03"", ""LOP_U_PMC_Fatigue_02"", ""rvg_survivor"", ""EF_HM_OD1"", ""EF_HM_B2"", ""EF_HM_SG1"", ""EF_M_jkt1"", ""TRYK_U_B_wh_tan_Rollup_CombatUniform"", ""rvg_survivor_1"", ""rvg_hoodie_red"", ""rvg_hoodie_kabeiroi"", ""TRYK_shirts_DENIM_R"", ""TRYK_U_B_wh_tan_Rollup_CombatUniform"", ""TRYK_U_B_BLK_tan_Rollup_CombatUniform"", ""TRYK_shirts_DENIM_WH"", ""U_C_Poor_1"", ""U_I_G_Story_Protagonist_F"", ""CUP_I_B_PMC_Unit_1"", ""CUP_I_B_PMC_Unit_4""]); (_this select 0) addMagazines ["CUP_5x_22_LR_17_HMR_M", RandomAmmoCount];};";```
#

this is what it looks like

#

something is wrong about it

#

there is an error

#

but i cant find it

#

the game gave me this when i started it up

tough abyss
#

Not sure what channel this goes in but is there a way to scroll wheel spawn in an ammo crate with a custom inventory?
Kind of like the scroll wheel custom loadout spawn but with an ammo crate?

Context:
Want to do resupplies with certain ammo boxes but would like to be able to spawn them in without having to pre-place them in the editor. Can just scroll wheel to the ammo box of choice ex. Rifle ammo, MG ammo, Launcher boxes, medical supplies etc etc

cobalt sorrel
#

hence why im asking how it's made and do I need it.,

vapid finch
#

I'm playing around with say3D, but trying to find a way to limit the duration of the sound, and not delete the object making it

#
_so1 say3D ["Alarm", 200, 1];
_so1 spawn {
    sleep 10;
    deleteVehicle _this;
};

This would just play it for 10 seconds then delete the object making the noise.

_so1 say3D ["Alarm", 200, 1];
_so1 spawn {
    waitUntil {isNull _this};
};

This would play the entire duration of the sound

winter rose
vapid finch
#

I was just listing what I had already done, I'm asking for help with the first one

#

Having a limit on how long without deleteing it at the end

#

Deleting*

#

If I removed the "deleteVehicle _this" then it just keeps playing after 10 seconds

tough abyss
#

Edit anyone know how to set this
FlagPole addAction
[
"Spawn Medical Supplies",
{
createVehicle ["ACE_medicalSupplyCrate_advanced",position FlagPole, [],10,"NONE"];
}
"Spawn Ammo Box",
{
createVehicle ["ACE_Ammo_Box",position FlagPole, [],10,"NONE"];
}
];

So the boxes spawn in with a custom loadout?
Right now its just the default kit works well just need the actual inventory within the crate to be different

vapid finch
#

Ima just do that

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
tough abyss
#

FlagPole addAction
[
    "Spawn Medical Supplies",
    {
        createVehicle ["ACE_medicalSupplyCrate_advanced",position FlagPole, [],5,"NONE"];
    }
    "Spawn Ammo Box",
    {
        createVehicle ["ACE_Ammo_Box",position FlagPole, [],5,"NONE"];
    }
];
#

is there anyway to add a custom loadout to what is spawned in using the createVehicle class?

willow hound
#

You're not using a valid addAction syntax though.

tough abyss
#

What is the correct syntax?

smoky verge
cosmic lichen
#

Yeah I gave up on it. Weird decision were made when modelling that thing.

smoky verge
#

I guess they never planned to make it rotate so didn't bother
shouldn't be hard to fix it but seems like a niche thing

spark turret
#

im trying to run a function in cfgFunctions on missionstart, but "postInit = 1" gives an error saying, "is a mission/campagin funciton, ccant be used"

tough abyss
true frigate
#

Hey can someone help me with this AC-130? Its flying AGL and since the map im playing on is very uneven, it often nosedives and crashes. Im unsure of how to force it to fly ASL, or if i even can

frosty cairn
cosmic lichen
frosty cairn
#

Im not sure how it works.

frosty cairn
#

Be advised, it is an hour long.

true frigate
frosty cairn
#

I need some help. I have a "gun rack" that I made for players to use, so I also want to add the ability to put them back. How can I script it in a way that it looks for a different 3D position if one is "preeocupied" or "used"?
(P.S Im open to do it any other way, this is just the first way that I came up with)
(P.P.S Here is my gun rack:)

#

oh

#

you cant add photos xD

pearl geyser
#

I want to make a player join a group upon the activation of a trigger, which are Radio Alpha, Bravo and Charlie.
The player's character's inside name is 'Player_Char'
The point behind this is to make a combined arms experience by allowing the player to either join a mechanized unit, a paratrooper unit or a spetsnaz group.
What command do I have to put the player inside of the relative squad?

#

[please ping me once you answer so I make sure I notice the reply]

true frigate
#

I meant to remove it from Editor, its supposed to be in scripting

#

forgive me Lou 😄

winter rose
#

agrrrrrr

true frigate
calm badger
#

What command do I use to return the name of the weapons on a vehicle?

#

I found weapons but that returns them in an array and I dunno how to return the contents of an array

#

aside from

_myArray select 0;```
i haven't tried much else
copper raven
#

"how to return the contents of an array", well what do you want to do with it? display it somewhere or what?

calm badger
#

ye preferably display it

copper raven
#

also that command will only return the weapons of the gunner turret

calm badger
#

that's fine

#

i forget if it's possible to display something in the same window that you see the error reports of a script in?

copper raven
#

i don't think so, but you can display it elsewhere

#

hint, systemChat, diag_log etc

calm badger
#

oh yeah as a hint is what i want

copper raven
#

just do hint str weapons this

calm badger
#

worked, thanks!

#

well crap

#

the weapon is gone after i used removeWeapon, but the model's still there

#

there also remains an option to "Store MG3"

patent lava
#

Is there a way to get the halfway position between two positions?

little raptor
patent lava
#
private _halfway = (
  ((getMarkerPos 'a') vectorAdd (getMarkerPos 'b')) vectorMultiply 0.5
);
#

Works like a charm, thanks!

cobalt idol
#
_CK_SPWNV = [CK_DRN1_1,31.25,99,true] remoteExec ["CK_FNC_SPWNV",2];

CK_FNC_SPWNV = {
    params ["_CK_SPWN","_CK_ZOFST","_CK_CASE","_CK_TF"];
//blah blah do cool stuff and dont break
//spawn a vehicle named _vic using createvehicle 
if (_CK_TF) then {
createvehiclecrew _vic;
} else {
  // who cares
};

The above are param I'm passing to a function via an addaction. my question is that for the 4th param

_CK_TF

if nothing is passed will it be assumed true, false, or potentially create an error?

copper raven
#

if nothing is passed it will be nil

#

and your if will do nothing

little raptor
#
params ["_CK_SPWN","_CK_ZOFST","_CK_CASE",["_CK_TF", false]];
cobalt idol
#

Awesome thanks!

somber radish
little raptor
patent lava
#

call me stupid, but i didn't notice the stray underscore in the example meowfacepalm

#

life be like that, struggling with a problem for 20 minutes but find the solution within 1 minute after asking for help

spark turret
#

its called the rubberducking effect

#

once you ask, you have to go over mentally again for phrasing the question correctly, and then get an idea of whats wrong

brave jungle
#

Man does that shit annoy me

winter rose
#

wazzup, besides the ceiling, the rooftop and the sky?

brave jungle
#

👀

#

Not much, just finished my second year of uni so been super quiet around here for a while haha, hopefully the summer has some fun in store before my final year 🤞

#

How about yourself

winter rose
#

I thought you were complaining about a scripting issue

brave jungle
#

Oh cool

#

Yeah I cant use hint

#

How does it work

winter rose
#
hint "hello";
brave jungle
#

saved

#

Can't go off topic in a channel and all that tight

#

Right*

#

🤣

winter rose
tough abyss
#

anyone got a script to make an area where you can spawn a vehicle then edit it's pylons?

copper raven
#

make an area?

somber radish
tough abyss
#

Yup

#

Like some virtual garage shit

somber radish
#

hmm

#

I dont have it on hand

#

But I could give you some pointers

tough abyss
#

Sure

#

Anything helps

somber radish
#

SO for the garage you could use

Createvehicle
#

then

#

place a camera

tough abyss
#

I got literally no knowledge on scripting, I thought you meant pointers on where to find one

somber radish
#

ooooh

tough abyss
#

Lmao

somber radish
#

Sorry then All I could say would be to google it

#

Im guessing it is for a mission

tough abyss
#

Np

#

Training map for people

boreal sun
#

Two question 1: for ace 3 can someone walk me through how to add a fries system to a helicopter that’s not compatible ace has an explanation on there page but it’s all gibberish to me I’m new to this script stuff, and 2: can someone tell me how I can get a helicopter to repeat the “engine failure, hydraulic failure, etc warnings even when it’s not damaged yet. I have a scenario where a chopper gets hit By a rocket but doesn’t get damaged till it’s time to crash land and I’d like the emergency systems to still be blaring as if it is in critical shape but hasn’t quite died yet until the crash landing trigger hits if that makes sense. Thank you for any help anyone can give

spark turret
#

why dont you just make the players invinclible and then kill the main and tail rotor?

#

seems like a rather easy solution with the same outcome

boreal sun
#

Well so my problem is if I’m actually flying it all the bells and whistles go off (i do have the tail rotor killed for a controlled crash landing) but if your in the back being transported all you hear is the explosion outside then start to fall out of the sky no one in the back can hear the alarms go off besides one bell right before you hit the ground so I was trying to add them in myself to get the idea that we got hit and lost power and it’s not just a silent ride down etc. (I’m being nit picky I know I’m on the verge of just settling with an explosion and no alarms)

spark turret
#

huh, i always though everyone can hear the alamr

#

you could off course always just play a warning sound on repeat through a script

boreal sun
#

I would have assumed they could but I keep trying play as character and can’t hear it. And that would be amazing to have if you know how to do it. I know you can add sound through a trigger but I tried getting a trigger to activate a second trigger and so on until the crash but I couldn’t even get the first trigger to activate the second. Then i tried a trigger next to another trigger and so on until touchdown and evidently if they are to close it just doesn’t play any sound 😅 I’m not good at this but I’m trying and learning

spark turret
#

you can play a sound on each players machine with remoteExec.
use playsound. Then you have to find the warning sound, probably in CfGSounds i would assume? Maybe check the heli in the config viewer, with some luck the warning sound is logged there somewhere.

boreal sun
#

Cool I’ll try and see if I can figure it out

spark turret
#

and then you write a simple script like

{
  if (_x in _yourHeloGoesHere) then {
    ["classnameOfSound"] remoteExec ["playSound",owner _x];
} foreach allPlayers

thats not tested, the remoteexec syntax is probably wrong. but it gives an idea of how the code would look like

boreal sun
#

Ok thank you it’s a starting point at the least

#

Wait I think if you have triggers to thin it won’t play I made them thicker and I believe it’s working now 😄

spark turret
#

add this to your triggers activation to make sure it fires:

systemChat "trigger fired!"; diag_log["trigger fired!",_thisList];
boreal sun
#

Oh good idea

#

It appears to be working now. Thank you for your help I wish I could send a video to show you what it looks like it’s perfect now

spark turret
#

upload to youtube or imgur and share link 😄

#

ill trade it for a video of AI pilot finding no joy in his job:

boreal sun
#

That’s hilarious I was legit laughing out loud at that lol

spark turret
#

ah btw, if you want to add the feeling of being hit, check out the camera shake command

#

it can give a nice feeling of the missile impacting.

frosty cairn
#

How do I script an AI to setup a new waypoint when its done with its old one?

spark turret
#

with setWaypointStatements. ideally you make a function which the statement calls. or you run a wrapper script with a loop that checks if the WP is complete

winter rose
frosty cairn
#

@spark turret
_moveOrder setWaypointStatements ["true", "_group addWaypoint [_waypointpos, 0];"];
I wrote it like this, but I know its wrong, I just don't know how.

spark turret
#

your variables are local to your script, the waypoint runs outside of it tho. so it doesnt know what _group and _waypointpos means

frosty cairn
#

Ah I see.

spark turret
#

so you have to give it a global variable or a hardcoded value

frosty cairn
little raptor
#

so the group is :

_group = group this;
frosty cairn
#

and what about _waypointpos?

little raptor
#
_moveOrder setWaypointStatements ["true", format ["group this addWaypoint [%1, 0];", _waypointpos]];
#

note that you can't do this with objects, groups, etc. (only strings, numbers, bools, or arrays of these; basically anything whose stringized form is the same as itself)

frosty cairn
#

hmm, i'll give it a try

frosty cairn
#

and since i dont have it defined globally, won't it not find it and not work?

little raptor
frosty cairn
#

okay, uhm, sorry, im quite new to this, but what does that exactly mean?

little raptor
#

e.g it becomes:

"group this addWaypoint [[1,2,3], 0];"
frosty cairn
#

ah

cyan dust
#

Good day. There is a 'respawn vehicle' module, but I can not find how to enable/disable it from code only when I need it to operate 🤔 Does anyone know?

copper raven
#
{
  [_x, true] call BIS_fnc_moduleRespawnVehicle
} forEach synchronizedObjects _logic;

to deactivate from what i can tell (looking at the function)

#

to reactivate, [_logic, synchronizedObjects _logic, true] call BIS_fnc_moduleRespawnVehicle

noble flint
#

can anyone help me with the basics of starting a Zeus module from scratch

noble flint
#

I'm trying to script a Zeus module

copper raven
#

ahh i thought you were talking about the game master module

copper raven
#

you can either make your own addon

#

or use something like ZEN custom modules

noble flint
#

Nah I need to make my own

#

wait.

#

What exactly do you mean ZEN Custom module?

noble flint
#

Would this be easier to do to learn how to script*

copper raven
#

not sure i understand what you mean

noble flint
#

In the future I want to be making my own mods

copper raven
#

well, like i said, you can use the wrapper ZEN provides, or make your own addon

#

for the addon reference, the link you sent is the one should be looking at

noble flint
#

Alright, how do I start with the ZEN wrapper.

#

Not exactly sure where to start.

copper raven
#

download zen, and just call the function

#

(with your desired arguments)

#

preferably in some init file

snow blade
#

Hey guys. I ran into a problem. I'm running a script with remoteExec through an ammoHit event handler in the config, and the script always fires and goes through most of the lines, but sometimes, it seems to skip some lines. I've gotten maybe 50% results simply by dropping the same explosive multiple times.

The code is below:

Hint "script fired";
_pos1 = (_this select 0) modelToWorld [0,1.5,0];
_pos2 = (_this select 0) modelToWorld [0,3,0];
_pos3 = [(_pos1 select 0), (_pos1 select 1), 0];
_pos4 = [(_pos2 select 0), (_pos2 select 1), 0];
sleep .3;
_charge1 = createVehicle ["SGT_Bangalore_2sec_Far_Remote_Ammo", _pos3];
sleep .05;
_charge1 SetDamage 1;
sleep .3;
_charge2 = createVehicle ["SGT_Bangalore_2sec_Far_Remote_Ammo", _pos4];
sleep .05;
_charge2 SetDamage 1;
Hint "script finished";```
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
snow blade
#

And I have no idea why it only creates the explosions sometimes, when I reliably get the debug hints every time.

winter rose
#

also you can't sleep directly into the EH

snow blade
#

No, this is a function that is spawned by the EH.

dim terrace
#

hint format["script fired %1",_this]; check if pos/input is valid

little raptor
winter rose
#

also please use params ^^

naive ruin
#

how would i make waves of enimies

winter rose
#

createGroup, createUnit, BIS_fnc_spawnGroup, depends 🙂

naive ruin
#

so it would be createUnit then the variable name ?

#

im new to map editor

winter rose
naive ruin
#

thankyou

past wagon
#

I can put a ! in front of isEqualTo, right?

!isEqualTo
copper raven
#

no, you've been told multiple times that's not how it works

past wagon
#

ok

copper raven
inland valve
#

is there a difference between unitcapture & unitplay VS unitcapturesimple & unitplaysimple? the forums seem identical

shadow knoll
#

so im trying to have players start a scenario off with nothing but regular combat fatigues sincfe they will have an arsenal to gear up with. I used the editor to strip the units of all their gear (except for the fatigues ofcourse) and im also using the menuposition respawn template and i think that is making my units spawn with their full kit. How do i make my units spawn with nothing but their combat uniform?

inland valve
#

@little raptor ok thanks!

little raptor
inland valve
#

incidentally is there any way to capture animation data for vehicles?

#

...?

little raptor
#

not vectorDir and vectorUp

#

so it's only useful if the unit is moving on a flat surface, and doesn't pitch/roll

inland valve
#

ok, thats important for me thanks! ...too bad about the animdata

cyan dust
#

Good day. Must be a simple question but for some reason I can not find the answer - there must be a command to remove all items from vehicle inventory, right? 🤔

little raptor
#

but there are multiple ones you can use

#

depending what you want to remove

cyan dust
#

Everything

#

Except for it's own weapon magazines, of course

little raptor
#

🤔
why aren't there any commands to remove a single item? meowsweats

cyan dust
cyan dust
winter rose
little raptor
little raptor
past wagon
#

and use initPlayerLocal.sqf and onPlayerRespawn.sqf

winter rose
noble flint
#

what does private_example mean

past wagon
#

is there a scripting command or BIS function that takes a value in seconds and returns an array in the format [hours, minutes, seconds]?

copper raven
noble flint
#

I'm getting an error

#
private _enemySide = opfor;                                        // definition of the enemy side
private _enemies = allUnits select { side _x == _enemySide; };    // selection of all enemy units from allUnits
{
    _x unlinkItem hmd _x;                                        // removal of each unit's hmd
} forEach _enemies;                                                // code is to be executed for each enemy
] call zen_custom_modules_fnc_register
#

Says line 2 in debug

past wagon
noble flint
#

I'm trying to understand this

copper raven
noble flint
#

For Zen?

#

Wrapper

copper raven
#

syntax

noble flint
#

How do I fix that syntax

copper raven
#

wrap 3rd argument into {}

noble flint
#

How/Why does it need to be wrapped

copper raven
#

also allUnits select { side _x == _enemySide; } > units _enemySide

copper raven
#

i'm not going to explain sqf grammar to you, an array cannot have plain statements

#
[123, private _a = 5] // bad
[123, {private _a = 5}] // good
noble flint
#

See that makes sense

#

Do I wrap that second line?

#

Into the third

#

I'm pretty bad

{private _enemySide = opfor;                                     // definition of the enemy side
private _enemies = units_enemySide; }    // selection of all enemy units from allUnits
{
    _x unlinkItem hmd _x;                                        // removal of each unit's hmd
} forEach _enemies;                                                // code is to be executed for each enemy
] call zen_custom_modules_fnc_register
copper raven
#
private _enemySide = opfor;                                        // definition of the enemy side
private _enemies = allUnits select { side _x == _enemySide; };    // selection of all enemy units from allUnits
{
    _x unlinkItem hmd _x;                                        // removal of each unit's hmd
} forEach _enemies;

this part

noble flint
#

Oh ..

#

I wrap all that

#
private _enemies = units_enemySide;     // selection of all enemy units from allUnits
{
    _x unlinkItem hmd _x;                                        // removal of each unit's hmd
} forEach _enemies;}```
#

Woah no error now!

#

I learned something new today

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
winter rose
#

add this to today's booty 😄

noble flint
#
{private _enemySide = opfor;            // definition of the enemy side
private _enemies = units_enemySide;     // selection of all enemy units from allUnits
{
    _x unlinkItem hmd _x;               // removal of each unit's hmd
} forEach _enemies;}
#

That's pretty cool

#

I should probably switch off notepad++ right?

#

Unfortunately the function is not working

#

Intended output it does not do anything

winter rose
#

PS: you wrote units_side, missing a space I believe

noble flint
#

Where did I write that?

#

units_enemySide

copper raven
#

units _enemySide

#

with a whitespace

noble flint
#

Gotcha.

#

Oh ..

#

I see that now.

copper raven
noble flint
#

What does _x mean

winter rose
#

it's the variable that aims at the currently iterated item

#
{ _x setDamage 1 } forEach allUnits
noble flint
#

Ok so I'm reading the wiki

#

trying to learn

#
["Custom Modules", "Remove NVG",
{alive cursorTarget _x unlinkItem hmd}                     // targets cursor to unlink NVGs
] call zen_custom_modules_fnc_register
#

This is wrong for sure right

#

You know what let me run that in the game first

#

Alright what am I doing wrong here

winter rose
#

… let's start with what you are doing right!

noble flint
#

LOL

winter rose
#

what is this alive cursorTarget thing? 🙂

noble flint
#

A target that is alive.

winter rose
#

hmmm negative
it is a check to see if the target under the cursor is alive

#

it returns true or false 🙂

noble flint
#

Thats it?