#arma3_scripting

1 messages · Page 672 of 1

winter rose
#

if the missile has the ability to lock on aerial target, that's what I meant

true frigate
#

Ah, my apologies 😄

#

I think there is a script that returns all missiles with locking variables

#

I might run that, see if any work

#
cfgCount = count (configfile >> "CfgAmmo"); 
pasteStr = ""; 
 
for "_x" from 0 to (cfgCount - 1) do { 
 _cfg = (configfile >> "CfgAmmo") select _x; 
 _ammoClassName = configName _cfg; 
 manCtrl = getNumber (configfile >> "CfgAmmo" >> _ammoClassName >> "manualControl"); 
 if (manCtrl > 0) then { 
   pasteStr = pasteStr + _ammoClassName + endl; 
 }; 
}; 
 
copyToClipboard pasteStr;```
this^
#
ammo_Missile_CannonLaunchedBase 
Laserbeam 
M_PG_AT 
M_Scalpel_AT 
M_Scalpel_AT_hidden 
Bo_Air_LGB 
Bo_Air_LGB_hidden 
M_Titan_AT 
M_Titan_AP 
M_Titan_AT_static 
M_Titan_AT_long 
M_Air_AT 
M_Vorona_HE 
UK3CB_Blowpipe_missile 
M_Jian_AT 
M_125mm_cannon_ATGM 
M_120mm_cannon_ATGM 
M_Vorona_HEAT 
``` returns this, so the missile i was using didnt have locking capabilities 😄
#

Okay, i found a lot of explosion marks on the floor, so im assuming whats happening is the missiles are spawning on the floor and getting destroyed instantly

#

so now i need to find how to spawn a missile in mid air

proven charm
#

for air: _disM set [2, 1000];

true frigate
#

Im not sure if its actually possible the way im doing it

#
_disM = [2, 10, 30];  
_missile = createVehicle["Missile_AGM_01_F",_disM,[],0,"CAN_COLLIDE"];     
_tgt = h1;  
[_missile,_tgt] spawn {   
 params ["_missile","_tgt"];   
 sleep 0.1;   
 _missile setMissileTarget _tgt;   
};  ```
digital hollow
#

Try giving it a launch velocity

true frigate
#

I might need to start from scratch because i copied a rough script and edited it

#

the script i copied fires an unguided missile 😦

#

I got it

#

its working

#

hell yes

#

i just started again and it instantly clicked 😄

wet garden
#

hi guys, I was wondering if anyone knew of a way to remove an amount of blood, say 500mL, from a unit (using ACE Advanced Medical)? I am thoroughly confused by ACEs magic. Many Thanks!

true frigate
#

Try adding this to a trigger on Radio Alpha

#

[VARIABLENAMEOFUNIT, 0.5, "body", "bullet"] call ace_medical_fnc_addDamageToUnit;

#

In this, the first part is the variable name you give to the unit you want to injure.
the second is the amount of damage to do, minimum 0 and maximum 1
the third is the limb, "body","head","hand_r","hand_l","leg_r","leg_l", are all the selections
the fourth and final variable is the type of damage, "backblast", "bite", "bullet", "explosive", "falling", "grenade", "punch", "ropeburn", "shell", "stab", "unknown", "vehiclecrash", are all of the available options

wary lichen
#

how to make the player look either down or up?

true frigate
#

Is there a way using scripts to remove the GPS from a player?
EDIT:
Ive tried
player removeItem "ItemGPS";
player removeWeapon "ItemGPS";
player removeItems "ItemGPS";
and it hasnt worked

astral hamlet
#

In trigger On Activation. What I want is to make alphateam stand up (that works) and than spawn red smokes on object bedna, bednaa and bednaaa. However, all I am getting is General error. Can somebody help me?

units alphateam apply {_x setUnitPos "UP";};
"SmokeShellRed" createVehicle bedna;
"SmokeShellRed" createVehicle bednaa;
"SmokeShellRed" createVehicle bednaaa;

edit: working code

units alphateam apply {_x setUnitPos "UP";};
"SmokeShellRed" createVehicle position bedna;
"SmokeShellRed" createVehicle position bednaa;
"SmokeShellRed" createVehicle position bednaaa;

winter rose
true frigate
astral hamlet
#

oh yeah

#

i just realized

#

thanks

true frigate
#

@winter rose youre some kind of genius, any idea how to solve my problem? 😅

winter rose
true frigate
#

😄

winter rose
#

it should be removeWeapon iirc (can confirm in 20 minutes)

true frigate
#

See? genius 😛

#

So player removeWeapon "ItemGPS";?

#

What do ya know, it worked.

#

Absolute legend 😄

winter rose
#

Heh
But apparently you already tried?

true frigate
#

I did, apparently it just needed a little extra push

#

what can i say, arma blobdoggoshruggoogly

winter rose
#

Hehehe - ok @true frigate

true frigate
#

odd fellow

winter rose
#

!issueWarning @tough abyss spam (don't say your name everywhere when not asked, thanks)

true frigate
#

nice burn 😎

desert sable
#

Does anyone know of a way to have a door open by trigger for a building? I have a little rustic cottage that has four doors. I want to open the front door on the front porch, but I have a feeling its going to be a bit more complicated than using the same script for the bargate

winter rose
desert sable
#

Oh? And I'm guessing I can sync a trigger to this module and have it open the door when the trigger fires?

sweet salmon
#

does ARMA3 expose the interia tensor of an object by chance?

winter rose
sweet salmon
#

also known as a rigid body

#

the thing you use the above functions on

winter rose
#

oh they don't expose the "skeleton" (if that's what it is)

sweet salmon
#

hmm...bummer

winter rose
#

what was the idea?

sweet salmon
#

well, i've written a helicopter flight dynamics model from scratch

#

so far the addForce function is working as advertised, but addTorque is not

winter rose
sweet salmon
#

i suppose I should mess with masses in object builder

#

I've done that

#

but it's only applying accurately in a single axis

#

the roll axis

#

pitch and yaw don't respond at all

winter rose
#

oh, weird then.

dreamy kestrel
#

so... I know that the hd_warning map marker is this: \A3\ui_f\data\map\markers\handdrawn\warning_CA.paa.
how do I know what the OPFOR o_support image path is?
or for markers in general, how might I go about identifying their corresponding images?

winter rose
#

a dive in config I believe

dreamy kestrel
#

I am ignorant; where is this please?

#

In the map, I right click, Find in Config Viewer but it does not tell me anything about the marker, never mind possibly an image path

grizzled lagoon
#

Hello i have question with extension extdb 3. I want to select all data in table, i want write this sqf private _query = "SELECT nom.uid FROM belge_identiter "; private _queryResult = [_query,2] call DB_fnc_asyncCall; would that work ?

spring vigil
dreamy kestrel
#

I need to dive into the A3 PBOs? for instance?

spring vigil
#

do you have a p-drive ?

#

with arma 3 unpacked ?

#

I just would use grepwin and search for o_support in A3 under P-drive and checkout the results. I'm assuming you are using mikero tools correct ?

dreamy kestrel
#

again I know how to search content, etc. the question is WHERE, WHAT to unpack, if you please, if one is interested in the map marker image paths.

spring vigil
#

Have you ran arma3P ?

dreamy kestrel
#

okay, well, let me know when you know what to unpack, where to look. THAT is what I need to know. thank you...

sweet salmon
# winter rose oh, weird then.

Yeah, I get great response in roll, and looking at the model config all the weight values around the model are the same, so I would expect pitch and yaw response to be the same as roll

#

But it’s definitely not

#

I get zero to no response in both pitch and yaw...I may just have to go with add force vs add torque, and then just set the force points far enough from center to get the desired response

winter rose
spring vigil
#

if you need help with that, Im more than willing to give you a hand.

brazen lagoon
#

anyone have any pointers on either an existing snow script that works well in vehicles at speed or ideas on how to make this existing one work? I'm using IMW snow, it creates particles and then uses attachTo to attach those particles to the player. The problem is that I can't seem to make this change offset with speed changing.

dreamy kestrel
digital vine
#

Could I get help with a really basic thing, could someone direct me (or even happy to chat) how to create and store SQF scripts for use within the Editor and Dedicated Server.

Been recommended Notepad++ but it does not seem to be able to create SQFs, just SQL as nearest. Can someone point in the right direction. 🙂

Think I now have the basic concept of what I want to do, I just want to tidy it up/make it easier to edit specific components.

Thanks in Advance 🙂

spring vigil
spring vigil
#

ping me if you need any help

digital vine
#

Many thanks both, checking it all out now

dreamy kestrel
#

thanks @spring vigil I think I've crossed at least one hurdle, extracting A3 bits to a project folder to start with

spring vigil
#

No worries, it’s stupid little things like that that take up time.

dreamy kestrel
#

I've got the mikero tools also, but I think the default is poseidon

spring vigil
#

If you go to pm and screenshare I can walk you through it.

dreamy kestrel
#

takes awhile to extract A3, I suppose, time to grab a cup of ☕

spring vigil
#

hahah

sweet salmon
#

Just confirming there’s no way to get or set angular velocity?

solar chasm
#

Amazing. Thanks so much! I see I have a lot of formatting issues as well as some basic programming ones.

In terms of data types spec'd in params, I could find no documentation online about how to spec an array (i.e. in the 3rd data point for that entity) - the biki page just says they're Data Types, and eventually led me to a page that made me try 'ARRAY', 'SCALAR', 'POSITION', or similar ... which of course, didn't work. Is there a page (or a search term I can use) that shows what data types are indicated, and in what way? or are you just using the wrappers ("", {}, etc) to spec?

I had converted pos to ModeltoWorldWorld because I was looking at their two positions w/ debug using getPos and while the x and y seemed correct w getPos, the z for the attached vic was waaaay off after the vic was first positioned. Using ModeltoWorldWorld was my uninformed way of establishing a "pure" measurement.

This worked better! As written, it popped the VIC a couple hundred meters above its attach point - similar to the discrepancy in z coords I mention above. I resorted to a mixed methods:
private _offset = (_VicName modelToWorldWorld [0,0,0]) vectorDiff (plane01 modelToWorldWorld [0,0,0]); Everything is working. Thanks so much for all your help!

dreamy kestrel
#

@sweet salmon by angular velocity you mean velocity in a directional vector?

robust hollow
# solar chasm Amazing. Thanks so much! I see I have a lot of formatting issues as well as so...

for defining permitted data types you write an operator/command that returns it. so if you want to permit a bool, you write true or false or 1==1 if you want to be weird about it. anything that returns the data type you want to permit, but generally you would just write the data type directly, so true,0,[],{},configNull,displayNull etc etc for all the other types

https://community.bistudio.com/wiki/Category:Data_Types

dreamy kestrel
sweet salmon
digital vine
#

@spring vigil Thanks for the help, looks like the extract is going to take quite a while, is it ok if I ping you sometime tomorrow?

dreamy kestrel
spring vigil
#

welcome to you both, feel free to ping anytime.

grizzled lagoon
#

I repost my question : Hello i have question with extension extdb 3. I want to select all data in table, i want write this sqf private _query = "SELECT nom.uid FROM belge_identiter "; private _queryResult = [_query,2] call DB_fnc_asyncCall; would that work ?

fresh wyvern
dreamy kestrel
#

hmm, so not all the PBOs were extracted, missing some key cartography location bits, i.e. loc_Fuelstation, loc_Transmitter, and such.

sweet salmon
#

is there a way to get the model origin coordinates?

#

right now i'm using getCenterOfMass, but everytime it moves, so do all the points relative to it

#

getPos kind of works...

digital hollow
#

Try getPosASL

sweet salmon
#

no joy

#

just gonna add a memory point

#

heh

digital hollow
#

Oh. Then modelToWorld

dusty whale
#

forceWeaponFire doesnt work

#

no matter what i do

#

_unit as the vehicle, or the gunner... no matter what

#

it will not work

#

going into gunner seat of the vehicle and left clicking still fires the gun

#

same for bis_fnc_fire

#

but i need the ability to set the mode

#

the action "SWITCHMAGAZINE" also doesnt work

little raptor
dusty whale
little raptor
dusty whale
#

well, it does but not when the player is the gunner

dusty whale
#

where can i find bis functions under a3?

#

are they named smart?

little raptor
dusty whale
#

ah, yes

#

that's in functions_f

little raptor
#

you can also find it in function viewer

dusty whale
#

thank you

#

the function viewer bugs out more than im comfortable with

little raptor
#

@dusty whale functions_f\Misc\fn_fire.sqf

dusty whale
#

i found it already

#

thank you

void ivy
cosmic lichen
#

There are other function viewers. 🙂

round blade
#

Hey folks, I want to make a script that activates when an AI changes stance from standing to prone or visa versa. What's better for performance: Using a waitUntil or an event handler like AnimDone (and then checking the stance) - or something else entirely ? This would be built in to an addon, so there's the possibility a bunch of units in a mission might have this applied to them

little raptor
round blade
#

activation speed isn't a primary concern - thanks!

little raptor
#

not multiple

round blade
#

ah is there a big performance cost if they compound?

little raptor
#

not performance cost
you'll "hog" the scheduler
so scripts won't run properly

#

just use a single thread
and loop through the units there:

while {true} do {
  {
    //...
  } forEach some_list_of_units;
  sleep 1;
}

of course if what you're doing is fast enough you can still use event handlers.
again a simple check like stance _unit == "prone" won't have any effect even if triggered by hundreds of units at once

#

you can check the performance of your code

#

if it's fast go with event handlers

still forum
#

@dreamy kestrel you don't need a p-drive, I find that way too much hassle for most things.
Google "Arma 3 AiO config" and see the BIForums thread and just download the latest one. Thats the whole Arma config in a single text file, just search for any classname and you'll find it in there with its properties, including markers and their image paths

spring vigil
#

Dedmen, are you using Vscode to open it? If you are how to you get the collapse to work. It always seems like it’s too large and breaks collapse on mine .

little raptor
spring vigil
#

Ok thanks ,
just making sure I didn’t have a setting wrong or making another JV mistake. Collapse works for VS2019.

still forum
spring vigil
#

Good point, only reason I suggested Pdrive with unpacking and using grepwin is I like to read Bi’s sqf and configs, basically any references to what im looking for. But that’s more to do with me not understanding sqf. I’m only 1st year into my CS degree and have a lot to learn.

still forum
#

I prefer DokanPbo, unpacking everything is just too much of a space and time waste

tidal ferry
#

Hey, is there any way to minimize or remove the doppler effect with playSound3D?

buoyant hare
#

Anyone knows how to make the AI use the searchlight of the BRDM (GM)?

tidal ferry
#

I thought playSound isn't directional?

#

Basically I want to play something from an object, but at close range it has this annoying doppler effect which is disproportionate to the object itself

buoyant hare
winter rose
sacred slate
#

some one mind to solve this for me: sethcgroups allgroups side west to player

tidal ferry
severe ravine
#

Would anyone be willing to assist me in setting up loadouts? When spawning I get the spawn selection screen but no options are listed, just loads with default for that role. Here's what I have:

#
[west, "Alpha1"] call BIS_fnc_addRespawnInventory;

//description.ext
class CfgRoles
{
    class Alpha
    {
        displayName = "Heavy Weapons";
        icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa";
    };
};

class CfgRespawnInventory
{
    class Alpha1
    {
        displayName = "Light Machine Gun";
        icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
        role = "Heavy Weapons";

        // Exported from Arsenal by Ben, while in virtual arsenal press CONTROL + SHIFT + C
        uniformClass = "U_B_CombatUniform_mcam_tshirt";
        backpack = "B_AssaultPack_rgr_Medic";
        weapons[] = {"hgun_P07_F","arifle_MX_SW_Black_F","Binocular","Throw","Put"};
        magazines[] = {"16Rnd_9x21_Mag","100Rnd_65x39_caseless_black_mag","16Rnd_9x21_Mag","16Rnd_9x21_Mag","SmokeShell","SmokeShellGreen","SmokeShellBlue","SmokeShellOrange","Chemlight_green","Chemlight_green","100Rnd_65x39_caseless_black_mag"};
        items[] = {"FirstAidKit","Medikit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit","FirstAidKit"};
        linkedItems[] = {"V_PlateCarrierSpec_rgr","H_HelmetB_light_desert","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGogglesB_blk_F"};
    };
};
tidal ferry
#

Question- is it possible to delete simple objects once they're made?

little raptor
#

yes

desert sable
#

Would anyone have an idea as to why a hideGlobal object command with remoteExec isn't working?
[_gift1, true] remoteExec ["hideObjectGlobal", 2]; is what I got here. I tested in debug and put it in an init.sqf and still got nothing.

winter rose
desert sable
#

thanks for the help mate o/

copper raven
severe ravine
copper raven
#

does it still not work with the classname?

severe ravine
brisk relic
#

Would anyone be able to help me make a script that only allows a S-750/R-750 to fire when a target is within a certain range?

copper raven
#

works fine for me with your setup

#

(with the role property properly defined)

severe ravine
severe ravine
#

Okay, I'm getting closer to the issue, initServer.sqf is not being run for some reason. Is there a toggle to prevent its execution? I'm running in multiplayer.

winter rose
#

once, on mission start, on the server

little raptor
#

unless your file is incorrect

winter rose
#

e.g initServer.sqf.txt 👀

little raptor
#

e.g bad name, missing }, etc.

severe ravine
#

It's acting like that (I keep windows showing extensions all the time because I've screwed up the .txt.txt thing so many times).

winter rose
#

@severe ravine any news? 🙂

severe ravine
#

I toggled the multiplayer settings for respawn position and select loadout and it started working flawlessly.

fresh wyvern
#

Anyone who know how to edit the config of a vehicle?

fresh wyvern
#

Thanks.

green solar
#

I just think that if an error was able to generate that view, maybe it can be replicated

winter rose
#

@green solar for the last time, wrong channel.

green solar
#

do I erase? Sorry, sorry if I offended you, did I use google translator?

winter rose
#

for terrain creation issues, use the #arma3_terrain channel - terrain experts are there to help

green solar
#

It is not a question about TERRENOS, thanks anyway

#

TERRAINS

winter rose
green solar
#

srry. regards

#

I try to make a trench

winter rose
#

you want to remove the grass?

green solar
#

no, i want to remove the floor haha

#

just visually

winter rose
green solar
#

I don't think it's possible, but I remembered that terrain error, and I'm thinking about how to replicate it ... I know it's rare and surely impossible

green solar
full swan
#

hello everybody! Can someone confirm that moveTo no longer works with agents? Using code:
(agents #0) moveTo [0,0,0]
will throw error: Generic error in expression.

Using moveTo with units works as expected though...

#

Complete snippet for reproduction:
_unit = createAgent ["O_Soldier_VR_F", [0,0,0], [], 0, "NONE"]; _unit moveTo [0,0,0];

#

command setDestination is not working aswell

#

same error

true frigate
#

how would i do this

#

Remove the GPS and cTab items (i have code for this) for all players

#

I think it would use

    removeWeapon "ItemGPS";
};```
#

But i dont want to use variable names for everyone

finite sail
#

{} foreach allplayers

#

use a loop

full swan
finite sail
#

is GPS a weapon? dont think so

true frigate
#

No but it works with removeWeapon

full swan
#

nope

#

same error

true frigate
#

And if they are in a group, you can try

    _group1 setSpeedMode "FULL";
    _group1 setBehaviourStrong "COMBAT";
    _wp1grp1 = _group1 addWaypoint [0,0];
    _wp1grp1 setWaypointType "MOVE";```
full swan
#

I will try creating the waypoint

#

gimme a sec

true frigate
finite sail
#

{ _x removeweapon "itemGPS"} foreach allplayers

true frigate
#

Thank you 🙂

full swan
#

omg, agents are group-less... 😄

true frigate
#

create the agents like this

finite sail
#

yes

#

good call

true frigate
#
    _group1 createUnit ["NameOfUnit", Pos, [], 25, "NONE"];
    _group1 createUnit ["NameOfUnit", Pos, [], 25, "NONE"];
    _group1 createUnit ["NameOfUnit", Pos, [], 25, "NONE"];
#

@full swan

full swan
#

those aren't agents

#

those are units

true frigate
#

ah my bad, i assumed you meant units called agents

full swan
#

nope 😄 actual agents using createAgent

true frigate
#

you can still group them

full swan
#

An agent does not have a group or leader

true frigate
#

hmm, thats odd

#

mind if i ask why youre using agents instead of units? they dont react when fired at

full swan
#

it's arcadeish horde survival - agents are not so resource-hungry as units when there is a lot of them. And I don't need them to shoot back 🙂

true frigate
#

Alright 🙂

full swan
#

I was able to spawn 300 agents with approx. 20 fps drop - the same amount of units made the game unplayable

true frigate
#

jeesus

#

agents are useful 😄

#

It could simply be it needs a remote execution

full swan
#

yeah, but hell to work with now

#

I am launching it in singleplayer environment

true frigate
#

because yesterday the sleep command returned a generic error for me

#

no i mean

full swan
#

the commands just stopped working

true frigate
#

execution from a script

#

sorry

full swan
#

even examples from BIKI are not working anymore (regarding agents)

true frigate
#

_agent spawn {
_this moveTo getPosATL player;
};

#

try running this

#

see if moveTo works

full swan
#

not working

#

already tried

#

same error

true frigate
#

have you tried running any through sqf files?

full swan
#

doesn't matter

#

when it's not working in the debug console, it won't work anywhere

copper raven
#

just play around with velocity

full swan
#

because it's an unscheduled environment

#

if you want to use sleep command in debug console, you need to use it in scheduled environment using [] spawn {sleep 1;};

true frigate
#

sorry then, not sure how i can help you out :/

full swan
#

15+ years of scripting in arma engine will teach you a lot of things (even the hard way) 😄 😄

#

yeah I think someone f* something up in the engine since the last update

true frigate
#

I found a reddit thread where someone had it working using this

while {true}do { 
_randomPos = position player; 
{agent _x doMove _randomPos; sleep 1;} forEach agents; 
}};```
but if youve already found it
#

then im just repeating information youve already seen 😄

full swan
#

the issue is that the command itself doesn't like the agent object

#

it consumes regular units just fine

#

but give it an agent and it complains

#

yeah, I just tested an old mission I made two years ago - which uses agents. It's not working there aswell now

true frigate
#

thats a shame 😦

full swan
#

yup, confirmed

#

22:19:12 Error in expression <(agents #0) setDestination [ [4000,4000,0], 'L> 22:19:12 Error position: <setDestination [ [4000,4000,0], 'L> 22:19:12 Error setdestination: Type Team member, expected Object

#

RPT logs

winter rose
#
agents // returns Team Members
#

so use```sqf
agent (agents select 0) setDestination [4000, 4000, 0];

#

@full swan better?

#

(and, I know, it's illogical that agents actually returns Team Members)

finite sail
#

ive got 360 agents... all of them <NULL - team member>

#

in mission right now

full swan
#

it returns the same thing??

#

okay it doesn't

#

let me try using the agent command then 🤔

finite sail
#

agents select anything returns generic error in expression for me

#

they are all null

full swan
#

I'll be damned...... It works using the agent command...

winter rose
full swan
#

But they had to change it somehow recently, because I always used agents without "the" agent command

winter rose
#

my guess is that you used agent direct references

full swan
#

yeah, as I said before ... 15+ years of experience and I am still baffled many times

#

well I was using it now aswell - directly the output of createAgent command and it still didn't work

winter rose
#

AFAIK, that command was introduced in A2, the whole Team/TeamMember/Agent thing was never implemented as they wanted, and all commands are as they were introduced

full swan
#

and my old work which worked alright when finished long time ago stopped working just now

#

so they HAD to change something

winter rose
#

createAgent returns an object, sooo it should work

#

otherwise, MAGIC

full swan
#

I will pray tonight for a new engine in the next title 😦 this is just pure trolling now

winter rose
#

or you are exhausted beyond recognition and mixed up all your test results 🙃 don't drink and code, sleep then code 🙂

finite sail
#

dont drink and code... crazy talk

winter rose
finite sail
#

tldr

#

busy drinking

true frigate
#

With a doWatch command for a tank to fire at a target, do i put the doWatch on the tank object or the gunner inside the vehicle?

#
while {_rounds>0} do { 
    tankG doWatch (getPos target);
    sleep 1;
    tank fire ((weapons tank) select 0);
    _rounds = _rounds - 1; 
    sleep 5;
};``` im using this script, which tank is the tank (duh) and tankG is the gunner of the vehicle
#

idek where its aiming

heady quiver
#
    _objective = 'rhsgref_ins_gaz66_ammo' createVehicle getPos _rndLocation;
    _group = createVehicleCrew _objective;

Does anyone know how i can fill vehicle slots with AI 🤔 ?

winter rose
#

Yes.

heady quiver
#

Oke..

#

How 😄 ?

#
    _unit = "CUP_O_INS_Soldier_AK74" createUnit [getPos _objective, _group];
    _unit assignAsCargo _objective;

This adds the unit right next to the created vehicle. but the vehicles start driving and ai not doing shit.

winter rose
#

BIS_fnc_spawnVehicle?

#

Ah wait, you want to fill it with cargo right?

#

use fullCrew(?) to get empty seats and create units for them

heady quiver
#

Well with the createVehicleCrew i get the driver, but there is still a spot left next to him.

heady quiver
winter rose
#

Not now, I am under the blankets 😄

heady quiver
#

i see

#

soo..

#

Actually, i just need 1 unit in the passenger.

#

[screenToWorld [0.5,0.5], east, ['CUP_O_Datsun_PK', 'CUP_O_Hilux_DSHKM_CHDKZ'], [], [], [], 0, false] call BIS_fnc_spawnGroup

is there a way to not spawn 2 vehicles right on top of eachother lol

heady quiver
#

Ill try again tomorrow ,everyone sleeping 😄

desert sable
#

Anyone know of a way to dynamically change time? My idea is that I want to have the player to pass through a trigger while riding a helo, and have it change the time after going through a black screen so they don't see the sky freak out and freeze for a moment before it changes.

heady quiver
#

fadeout for everyone, show some title, skipTime, fadeIn ?

desert sable
heady quiver
#

Yea

#

skipTime only on server tho

desert sable
#

wdym?

cosmic lichen
#

BIS_fnc_setDate is what you are looking for

desert sable
cosmic lichen
#

yes

#

check the biki

desert sable
cosmic lichen
#

yw 🙂

desert sable
#

Out of curiosity, when you use the following:

0 setOvercast 1; 
0 setRain 1;

Does it allow for the weather to slowly change and start raining?

cosmic lichen
#

Read the doc 🙂

keen folio
#

Does anyone know how to eliminate the voting screen for the mission as soon as you load into say a dedicated server I want to pretty much as soon as I load into the server be already loaded into a default mission only to use to select the actual mission file via in the default map useing #missions command

robust hollow
potent depot
#

Hey everyone, got a question about an approach to a problem.
I wish to detect when a player is swimming in a fashion similar to a EH. I know this is possible to be able to do so via the animation EH but it seems that that would be something that would be firing too often as it will continually be firing anytime a player moves (not too sure about any potential performance issue for users as a result). Alternative could be to use a waitUntil with a delay but that is something I would like to avoid if possible.

So the question stands, anyone know if there is an alternative viable method aside from these two that is viable? If not the alternate question would be which of the two would be better potentially better from a performance side?

ivory lake
#

apart from the animation eventhandler the only alternatives would be a loop i believe, using like surfaceIswater / underwater etc

hushed tendon
#

If I'm using a keydown EH will that only run when the unit that it is attached to hits the specific key in a MP scenario? Especially if that unit is AI being remoted by zeus?

robust hollow
hushed tendon
final storm
#

Is there any command to check if a player is leaning left or right?

final storm
#

Thanks

final storm
#

Using this instead

(abs (player worldToModel eyePos player select 0) > 0.16)
#

im not sure if different player models will break it or not

dusty whale
#

is there a method to convert world pos ton 8-grid coordinates?

#

mapGridPosition only does 6-grid

warm swallow
#

could anyone give me a basic rundown of the major differences between single and multiplayer scripting?

#

for example would this work player playAction

little raptor
final storm
#

I only really care if the person is standing or crouching so it shouldnt be an issue

little raptor
little raptor
little raptor
#

you have to also consider things from a different perspective
"if I do X will it also affect other computers? if so how? do I want them to be affected?"
you have to refer to each command and check their locality

for example, let's consider the command player that you mentioned
who is the player? in a multiplayer game there are multiple players of course.

warm swallow
#

@little raptor thank you, how do i specifiy in sqf the player that is doing the tihng

little raptor
# warm swallow <@!360154905148653568> thank you, how do i specifiy in sqf the player that is do...

like I said you have to read the wiki page for every command to learn their behavior in MP. Some you can learn simply by looking at the Effect and Argument icons at the top of the page. For some you'll have to read the wiki page more carefully:
https://community.bistudio.com/wiki/player

In MP player is different on each computer and on dedicated server it is objNull by default
simply put, whichever computer you execute the command on gives you the player unit on that computer

warm swallow
#

ok

little raptor
#

(and the way you execute a command remotely is remoteExec)

warm swallow
#

ah ty

#

@little raptor i guess i should ask then, how am i supposed to check WHO uses an addAction command in mulitplayer

#

this is my script so far

#

removeAllActions gen1; player playMove "Acts_carFixingWheel"; sleep 15; scoreSurvivor = (scoreSurvivor + 1); hintSilent str scoreSurvivor; if (scoreSurvivor >= 5) then {survivorsWin = true;};

little raptor
#

check the wiki

nocturne canopy
#

anyone aware of a way to make AI drag their wounded rather than just ignoring them.
I've seen it once while playing Antistasi, but haven't been able to replicate it since using ace3.

little raptor
nocturne canopy
#

Fair enough. I'll pull my build of antistasi apart and see if I can find the script used to initiate it.

#

Cheers Leopard

cyan dust
#

Good day. How to include the defines that are located in another (not sub) folder? 🤔

#include "adminMenuDefines.h" //<= Located in the same folder
#include "userInfoDefines.h" //<= Located in another folder of the same mission
cyan dust
dusky pier
#

Hello, needed to set unit animation, but can't understand - which command needed for given unit's animation.
switchMove, playAction, playMove etc... Is possible to somehow check (i mean with script) - which command needed for given animation?

little raptor
# dusky pier Hello, needed to set unit animation, but can't understand - which command neede...

depends
playAction allows you to play a certain move without paying attention to the unit state
for example, you can just use playAction "stop", without caring, e.g what weapon the unit has.
the downside is that some animations don't have any linked actions and can't be played like that
playMove allows you to play an exact animation.
switchXXX variants jump to the first frame in that animation, whereas play variants follow the animation connection/interpolation rules.

#

if the animation you want to play cannot be connected from the current animation, playMove won't work and you'll have to use switchMove first.

#

and to check animation use animationState

proven charm
#

is inRangeOfArtillery supposed to return false if target pos is too close?

little raptor
#

yes

proven charm
#

hmmm, it doesnt do that for me..

little raptor
#

then no meowsweats

proven charm
#

lol 🙂

#

maybe a bug?

little raptor
#

I think it only checks the max range

#

not min range

proven charm
#

right

warm hedge
#

Is that a very small mortar?

proven charm
#

it's probably the smallest mortar from unsung mod

little raptor
#

I suppose you can calculate the min range yourself from max range
because artillery rounds have no drag. the equation is linear

warm hedge
#

Maybe so. Try a big one

proven charm
#

@little raptor not sure how

#

I will test a bigger mortar

#

ok I tested with the vanilla B_Mortar_01_F mortar and it gives false on too close range

#

its just the unsung mortar that gives true on too close range

#

and doesn't fire

dusky pier
# little raptor if the animation you want to play cannot be connected from the current animation...

thank you again, all works now 🙂
used simple script for switch command

the_animDo = {

    params [
        ["_anim","",[""]]
    ];

    player switchMove "";

    if (_anim isEqualTo "") exitWith {};

    _prevState = animationState player;
    
    player switchMove _anim;
    player playMove _anim;

    if !((animationState player) isEqualTo _prevState) exitWith {true};

    player switchAction _anim;
    player playAction _anim;

    if !((animationState player) isEqualTo _prevState) exitWith {true};

    false

};
["Acts_Ambient_Cleaning_Nose"] call the_animDo;
heady quiver
#
_position = screenToWorld[0.5,0.5];
_direction = 180; 

_logic = "Logic" createVehicleLocal _position; 
_logic setDir _direction; 
_logic setVariable ["vehicle",'RHS_A10']; 
_logic setVariable ["type",3]; 
[_logic,nil,true] call BIS_fnc_moduleCAS; 
deleteVehicle _logic;

Found this custom CAS support but getting generic error 🤔

winter rose
#

screenToWorld means you have to aim at some ground, not the sky

heady quiver
#

i am ^^

#

No info about moduleCas on wiki 😦

winter rose
#

ah, you are doing that from the console, right?

#

cannot sleep in a console, use a spawn around all this 🙂

#

the |#| tells you where the issue is encountered

heady quiver
#

well... the sleep part isnt my code.

#

its arma moduleCas

winter rose
#

yep

winter rose
heady quiver
#

aah.

dusky pier
little raptor
#

and this part makes no sense:

player switchMove _anim;
player playMove _anim;

if !((animationState player) isEqualTo _prevState) exitWith {true};

player switchAction _anim;
player playAction _anim;

if !((animationState player) isEqualTo _prevState) exitWith {true};
dusky pier
#

i used initial switchMove - to disable animations with ```sqf
[""] call the_animDo;

about: 
```sqf
player switchMove _anim;
player playMove _anim;

i though - i need to switch first and after - play, cuz with that - all animations is play's for me

dusky pier
#

is enough - switch (no needed to play)?

little raptor
# dusky pier is enough - switch (no needed to play)?

no that part is correct, as I already said before (it should be playMoveNow tho)

... playMove won't work and you'll have to use switchMove first.
what I mean is the if !((animationState player) isEqualTo _prevState) exitWith {true}; part

#

and why is it duplicated

#

actually now that I looked more closely you're using switchAction

dusky pier
#

little bit changed

the_animDo = {

    params [
        ["_anim","",[""]]
    ];

    player switchMove "";

    if (_anim isEqualTo "") exitWith {};

    _prevState = animationState player;

    player playActionNow _anim;

    if !((animationState player) isEqualTo _prevState) exitWith {true};

    player playMoveNow _anim;

    if !((animationState player) isEqualTo _prevState) exitWith {true};

    player switchMove _anim;

    false

};
["AmovPercMstpSnonWnonDnon_Salute"] call the_animDo;
little raptor
#

just change playXXX to playXXXNow

#

in your older script

dusky pier
heady quiver
#
_missile = createVehicle ["M_Vorona_HE",(player modelToWorld [0,0,100]),[],0,"CAN_COLLIDE"]; 
_missile setMissileTargetPos getPos cursorObject;

How can i change the direction of the missile 🤔

#

its only going where i want it to go when im looking at the direction from where he is heading

little raptor
#

setVectorDIr alone can work too

#

if up is [0,0,1]

heady quiver
#

🤔

#
FNC_casMissile = {
    _sendPos = getPos cursorObject;
    if(_sendPos isEqualTo [0,0,0]) then {
        m_sendPos = screenToWorld[0.5,0.5];
    }
    _missile = createVehicle ["M_Jian_AT",(player modelToWorld [200,0,200]),[],0,"CAN_COLLIDE"]; 
    _missile setMissileTargetPos getPos cursorObject;
};

How can i make it that when i call the missile it comes from behind me to the object or pos im looking at 🤔

#

vectorDir you said but not sure how meowsweats

winter rose
thin current
#

Hey guys, I am a pretty large noob at scripting. I have am looking at having a specific loadout force everytime a player connects to the mission, or dies/respawns. I think I found the correct "script" https://community.bistudio.com/wiki/setUnitLoadout but I am unsure where to put it exactly.

Like I would love just for a specific uniform and headgear, nothing else.

#

Oh hi Lou 🙂

heady quiver
#

i copied it woops

little raptor
heady quiver
#

Approx 300 meters.

little raptor
#

definitely not a good idea

heady quiver
#

Why :D?

little raptor
#

there's no guarantee about abstacles

#

what if it hits a mountain?

#

or some other object?

heady quiver
#

true but thats why i want it also fly high

#

😄

#

i mean what i got works..

little raptor
thin current
#

IF (idiot == me) THEN {have smart person tell me something that I could figure out if I didn't look to literal into things and actually developed real skills on the computer instead of just playing oldschool runescape for like 10 years};

Did I do that right?

heady quiver
#

its coming from my side (Right)

#

i think.

little raptor
#

yeah

#

right

little raptor
heady quiver
#

Nothing wrong with ORS.

little raptor
#

wat?

heady quiver
#

_missile = createVehicle ["M_Jian_AT",(player modelToWorld [0,-100,150]),[],0,"CAN_COLLIDE"]; btw this seems to work.

little raptor
heady quiver
#

😮

#

wtf xDDD at the last split second it acts like magnet and shoots the other way.

#

(at impact)

heady quiver
#

Mmm weird, works now.

#

Can it be because im using a AT missile?

#

trying to correct itself or something

little raptor
#

I have no idea what you're talking about meowsweats

heady quiver
#

I know, ill show you. 1 sec

winter rose
#

setMissileTargetPos might not be able to target a pos?

#

(for this kind of missile)

heady quiver
little raptor
#

try AGL

#
FNC_casMissile = {
    _sendPos = if (isNull cursorObject) then {AGLtoASL screenToWorld [0.5,0.5]} else {aimPos cursorObject};
    _spawnPos = player modelToWorldWorld [0,-200,200];
    _missile = createVehicle ["M_Jian_AT", ASLtoAGL _spawnPos, [], 0,"CAN_COLLIDE"]; 
    _missile setMissileTargetPos ASLtoAGL _sendPos;
    _missile setVectorDir (_spawnPos vectorFromTo _sendPos);
};
heady quiver
#

Yea that seems to do it.

#

That was funny tho

#

Thanks 😄

#

is there also a way of limiting the speed of the missile?

little raptor
#

so no

#

altho missiles are always self propelled meowsweats

heady quiver
#

Oh well dont worry about it.

#

ill keep it like this 😄

heady quiver
#
    [_vehicle, player] spawn {
        while{true} do {
            params['_vehicle', 'player'];
            sleep 5;
            systemChat 'Checking distance..';
            systemChat format['%1', _vehicle distance player];
            if(_vehicle distance player < 1500) then {
                  systemChat 'Jet is closer then 1500';
                  _vehicle limitSpeed 1500;
                  _vehicle move [12274.5,29203.9,0]; // Move jet outside map
                  false;
              };
        };
    };

why is this while not working 🤔

#

nvm

distant oyster
heady quiver
#

ah oke ty

thin current
#

So I got to the point where I was able to create a loadout upon loading into the mission, but struggling with having it apply it upon respawn.

#

I know that the simplest would be to set the loadout as a unit variable (with setVariable) then calling that loadout on respawn. I honestly can not figure out how to do it. I know I have to place something in the onPlayerRespawn.sqf, and if I am reading this right I have to set something in the init of the playable slot.

little raptor
#

first of all how do you decide which unit gets a certain loadout?

thin current
finite sail
#

covers it nicely

#

I was pretty sure I asked the same question and got a full and comprehensive answer from Larrow, but can't find it right now

thin current
#

[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; wouldn't this just save the loadout in its current state the player has when he dies?

#

and this [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; would force the loadout that was saved?

finite sail
#

the trick is to save the loadout as he closes the arsenal

thin current
#

Not what I am aiming for unfortunately :/

#

Regardless what the player has at death, my goal is to have him respawn with JUST a uniform and JUST a headger.

finite sail
#

OH, I see

thin current
#

Because ACE arsenal is utilized for gearing up.

thin current
thin current
#

@finite sail This is what I needed.
In initPlayerLocal.sqf put
player setVariable ["TAG_LoadoutStart", getUnitLoadout player];
In onPlayerRespawn.sqf put
player setUnitLoadout (player getVariable ["TAG_LoadoutStart", []]);

finite sail
#

using a predefined loadout, yes

heady quiver
#

[[getPos _objective, 16, 29, 3, 0, 20, 0] call BIS_fnc_findSafePos, 180, "CUP_O_Hilux_DSHKM_CHDKZ", _group] call BIS_fnc_spawnVehicle;

how do i get the vehicle from this so i can empty it 🤔

cosmic lichen
#

@heady quiver Read the doc

heady quiver
#

yes sir

#

_createdVehicle1 = _result1 select 0;

#

ty

#

x)

potent depot
quasi sedge
#
[missionNamespace, "arsenalClosed", {
    profileNamespace setVariable ["Saved_Loadout",getUnitLoadout player];
    hint "Selected gear saved!"
    }] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{

        0 = [_this select 0] spawn {
        
            params [["_player",objNull,[objNull]]];
                waitUntil {sleep .2; alive _player};
                _player setUnitLoadout (profileNamespace getVariable ["Saved_Loadout",[]]);
                
        };
}];```
#

how to rewrite it to save loadout in profile, so everytime player join this mission he doesn't have to use arsenal again?

finite sail
#

doesnt that work?

winter rose
wind hedge
#

I am using that, but I need a way to identify when a headshot is a true headshot or just a collateral...

#

because I do a "headshot multiplier" and the multiplier is firing even for chest shots...

#

@spark sun Yeah I am doing something a lot simpler because I can't afford to do a custom UI around it.

cosmic lichen
#

This is how I detect head shots

wind hedge
#

@cosmic lichen Thank you R3vo! A life saver as always

#
          params ['_unit', '_selection', '_damage', '', '', '_hitIndex'];\
            if (_handleDamage < 0.1 || {!alive _unit || {lifeState _unit isEqualTo 'INCAPACITATED'}}) exitWith {0};
#

where is _handleDamage defined? @cosmic lichen

cosmic lichen
#

uhhh I think this is meant to be called "_damage" notlikemeow

#

Always good to have another set of eyes going over the code.

#

But it has never thrown an error meowhuh

winter rose
#

doesnt unscheduled throw an error on undefined variable?

cosmic lichen
#

It should at least log something to the .rpt

#

Need to check that at some point

little raptor
cosmic lichen
#

Yep, right.

winter rose
#

ah, good ol' OFP.

cosmic lichen
#

It's fixed now anyway

wind hedge
#

A single run of the damagedEH can only have one _selection right? It just fires several times for each "colateral"

cosmic lichen
#

yes

lilac heath
#

hi, does anyone know if it is possible to know the current "flight phase" of the missile? (initial, seeking, locked, lost)

hushed tendon
#

Script in the init of vehicle. Sound still won't stop.

Music = {
car_1 addAction ["Play 'Rule the World'", { 
removeAllActions car_1;
soundSource = "HeliHEmpty" createVehicle getPosATL car_1;
soundSource attachTo [car_1, [0, 0, 1]];  
car_1 say3D ["everybodywantstoruletheworld",50,1]; 

car_1 addAction ["Stop Music", {
soundSource setDamage 1;
removeAllActions car_1;
call Music;}]; 
}];

car_1 addAction ["Play 'Buck Rogers'", { 
removeAllActions car_1;
soundSource = "HeliHEmpty" createVehicle getPosATL car_1; 
soundSource attachTo [car_1, [0, 0, 1]];  
car_1 say3D ["buckrogers",50,1]; 

car_1 addAction ["Stop Music", {
deleteVehicle soundSource;
removeAllActions car_1;
call Music;}]; 
}];

car_1 addAction ["Play 'Blurry'", { 
removeAllActions car_1;
soundSource = "HeliHEmpty" createVehicle getPosATL car_1; 
soundSource attachTo [car_1, [0, 0, 1]];  
car_1 say3D ["Blurry",50,1]; 

car_1 addAction ["Stop Music", {
deleteVehicle soundSource;
removeAllActions car_1;
call Music;}]; 
}];

}; 
call Music;
distant oyster
sweet salmon
#

quick question: i've noticed that my object is saying it's 0.25m below ground level....what in object builder would be driving that?

desert sable
#

would anyone happen to know why triggers will only sometimes fire? I keep testing my mission file in SP and half the time the triggers work and half the time they don't do jack

desert sable
# winter rose code issue or saturated CPU

Given that my PC sounds like an angry beehive, I'm gonna go with CPU. If it's crapping out on my PC but the code is still right, it should be fine for others when I publish the mission, right?

winter rose
#

if there is no other issue I am going to go out on a limb and say "yes"

desert sable
#

Cool, thanks!

winter rose
#

unless the code itself takes ages, of course

sweet salmon
#

also, is 'addForce' disabled when AFM is enabled?

warm swallow
#

Does anyone know if it is possible to allow an eventhandler for when a player goes down. I'm trying to make it so that as soon as one player does enough damage to the player to die, they instead turn invincible and go into a downed state, instead of just dying

hushed tendon
#

Run an EH when player is shot. You then check the health of the player, if they are below the threshold make them invincible/civilian/downed animation.

#

Prob an addAction to get them back up too

lilac heath
lilac heath
copper raven
#

for certain ammos yeah(e.g heatseekers), works fine for missiles LOAL for example

lilac heath
#

Ok I will check it then, thx.

fleet geyser
#

Was toying with the idea of making a mod for switching between Helicopter weapons through ACE Self Interact, instead of cycling through 17 rocket salvos ..
Is such a mod possible, seeing as it has not been done already?

little raptor
#

but it's not convenient

#

you're better off using the 12345 keys meowsweats

fleet geyser
#

@little raptor No clue how it never even occurred to me - to try the numbered keys while flying 🤯

little raptor
#

but after you remove those it should be good

naive osprey
#

is there a way to post and get json data from a rest api?

still forum
naive osprey
#

alright, i don't mind using an extension, if one exists for this purpose, or do i have to code one myself?

still forum
#

I think I saw a REST extension somewhere

naive osprey
#

this one maybe!

naive osprey
#

actually, anyone have experience with compiling extensions in c++ with gcc? example on the bohemia wiki does not load out of the box...

distant oyster
#

yeah:

//--- Get a remote player as an example
_remotePlayer = (allPlayers select {_x != player}) param [0, objNull];
//--- Set a global variable for the remote player
[missionNamespace, ["testvar", 1234]] remoteExec ["setVariable", _remotePlayer];
little raptor
#

So instead of doing:

remoteExec ["MyScript.sqf", _myTarget];
that's not even valid

#

and I'm just pointing it out so that no one thinks it's valid
some people might be new to scripting and they might "learn" things based on what we discuss here, so...

digital vine
#

Right, quick question for you all here, when using setUnitLoadout in a script, is there any way to have a randomised choice of more than asset.
For example the uniform slot currently reads:

   player setUnitLoadout [ //Set Player Loadout Using ACE Arsenal Export Function
    ["CUP_arifle_M4A3_CCO_Laser", //Primary Weapon
        "", //Primary Weapon Barrel Attachement
        "CUP_acc_ANPEQ_2_Black_top", //Weapon Attachment
        "CUP_optic_CompM2_low", //Primary Weapon Optic
        ["CUP_30Rnd_556x45_Stanag", 30], //Primary Weapon Magazine, Ammo Count 
        [], //Primary Weapon GL Magazine, Ammo Count
        ""], //Primary Weapon Bipod Attachment  
    ["", //Launcher Weapon
        "", //Launcher Weapon Barrel Attachement
        "", //Launcher Attachment
        "", //Launcher Weapon Optic
        [""], //Launcher Weapon Magazine, Ammo Count 
        [], 
        ""], //Launcher Weapon Bipod Attachment  
    ["", //Secondary Weapon
        "", //Secondary Weapon Barrel Attachement
        "", //Secondary Attachment
        "", //Secondary Weapon Optic
        [""], //Secondary Weapon Magazine, Ammo Count 
        [], 
        ""], //Secondary Weapon Bipod Attachment
    //Inventory --> 
    //Syntax (Items = ["Item Name", No. of Items]), (Magazines = ["Mag Name", No. of Mags, No. Rounds in Mags])
    ["CUP_U_B_USArmy_ACU_Gloves_UCP", //Uniform ID
        [["FirstAidKit", 1], ["CUP_30Rnd_556x45_Stanag", 3, 30], ["SmokeShell", 1, 1]]], //Uniform Contents
ETC.......................

Is there a possibility to have several uniforms it will randomly select, whilst leaving the rest of the Loadout unchanged?

winter rose
#

selectRandom

digital vine
#

Many thank yous

tough abyss
#

are there any ways to keep track of groups even if some get deleted? storing info in the group variable doesn't work since if a group is deleted then the variable becomes null and all info is lost

little raptor
#

what do you mean keep track of?

tough abyss
#

bad wording, let me try again

#

i meant i want to augment groups with additional data, but storing that data in each of the group variables doesn't work, since i want to keep the augmented data even for deleted groups

copper raven
#

create some unique id for each group and use a hashmap with desired data

tough abyss
#

is serverTime a good choice for id's?

little raptor
copper raven
#

i usually use a variable, and increment it everytime

tough abyss
#

right thats simpler

torpid pewter
#

I'm making some weather parameters for a mission but I'm a little stuck on one part. I have a switch case that looks like this:

case 1: {
        setwind [0,0,true];
    };
    case 2: {
        setwind [1,1,true];
    };

And it works but the first two values in the array determine the wind direction and it does that by switching to negative values. Within each switch case I'd like to have multiple arrays it can switch between so something like this:

    case 1: {
        setwind [0,0,true];
    };
    case 2: {
        setwind [1,1,true]; OR setwind [-1,-1,true]; OR setwind [0,1,true];
    };

However I know that doesn't work, but I'm not sure how to achieve the effect I'm going for. For my purposes adding more switch cases won't work since each case corresponds to a parameter in the lobby and I only want exactly how many I need.

little raptor
#

@torpid pewter ```sqf
setwind selectRandom [[1,1,true], [-1,-1,true], [0,1,true]];

torpid pewter
#

ah perfect i knew there was a simple solution to this, thank you.

tidal ferry
#

Question- can you use setVariable on markers?

winter rose
#

no

tidal ferry
#

Sweet, thanks

winter rose
#

markers are not objects 😉

tidal ferry
#

Sounds good 😉 Thanks for the help

winter rose
#

now what are you baking…

tidal ferry
#

Oh, me?

winter rose
#

no, the guy behind! 😄

tidal ferry
#

oof, was gonna say 😂

tidal ferry
#

Is there any way to make a marker (or other map entity) that executes code when you click it?

still forum
#

onMapSingleClick eventhandler, check where player clicked, see if theres a marker under the click

tidal ferry
#

Sweet, thanks, I'll try that

tidal ferry
#

What's the command to get an array item's index?

#

E.g. if I have an array of

[marker1,marker2,marker3]

And know I want the index that marker3 is in, how would I get that?

copper raven
tidal ferry
#

Yep that was what I was looking for, thanks @copper raven!

#

Next question, is it possible to apply a texture to an area marker?

tidal ferry
leaden haven
#

How can I get this to work properly? I am trying to get this to exclude players. Thanks.

(allMissionObjects "") - entities [player];
little raptor
#

(player is not a classname meowsweats )

leaden haven
#

Thank you.

fair drum
#

can you remote exec a function creation on a client? or would you just make the function variable public?

little raptor
exotic tinsel
#

Is it possible for me to get item information like item0 position from a composition class before spawning it? I preinit the class. if so can some one point me in the direction of some links to do so.

#

nvm found it

wind hedge
#

a version of this:

#

{deleteVehicle _x} forEach nearestObjects [player, ["all"], 200]

#

But that only deletes editor placed objects?

winter rose
#

yeah, what about it?

little raptor
fair drum
dusty whale
#

is there a cba support discord somewhere?

#

or any support forum for CBA?

#

or anywhere where you can report bugs

cold mica
#

Yes, they have a github

dusty whale
#

oh, the bug is listed under known issues

#

fair enough

#

does this mean that keybinds needs to be initialized pre-mission init?

#

because the parameters, such as replace default function, are not working

#

i bound a key to F, and set the override to True, but it still registers the F for switching firemode

#

oh, i ahve to use this

#

If _downCode returns true, block all further actions bound to this key, including base game actions

#

that solves it

past wagon
#

if a unit dies, can I still use getLoadout on them while they are dead?

#

@ me

manic sigil
#

So I have getreldir, the heading between my player and a target.

What I need is to transform that number such that I have a percentage that goes up to 100% (or 1.00 or whatever) when that getreldir is at 90.

I had this script a long time ago, but I've lost it since :c

manic sigil
#

Yes, that would bring it to 100% when at a 90 degree angle... but 200% when it's directly behind me :/

#

There was some clever twist that I was clued into, those years ago, and I can't for the life of me remember it T_T

#

... holy poop this discord has messages from 2016

#

Ugh, I'm talking about the problem but not posting the problem

#

Past me, as ever, disappoints.

winter rose
#

well, you only mentiioned 90° :p

winter rose
manic sigil
#

Wishful thinking.

But I'm still trying to solve the same problem; recreating Take On Helicopter's BIS_fnc_WPAngle

#

Hrn... may be able to use the parabolic arc that Cptnnick clued me into five years ago

#

What a time to be alive

#

Cripes, I was trying to build this mission when Apex first launched as a 'showboat around Tanoa' thing T_T

warm swallow
#

can anyone please tell me how to detect any player for unit on a given side, i was using p1 but that doesn't work for multiple units and then I used player but that doesn't work well in multiplayer...?

removeAllActions gen1; p1 playMove "Acts_carFixingWheel"; sleep 15; scoreSurvivor = (scoreSurvivor + 1); hintSilent str scoreSurvivor && "generators repaired"; if (scoreSurvivor >= 5) then {survivorsWin = true;};

warm swallow
#

i don't think thats what im trying to do :/

#

i already have an animation that plays when the player does the addAction

#

I just need to know how to reference any given play (on blufor) but at the same time not reference every player, because then the animation would play and all players would enter the animation

#

as far as im aware

manic sigil
#

Huh, I forgot that addAction also does _caller

#

The lines you provided above is the script portion of the addAction, correct?

warm swallow
#

yea

manic sigil
#

You should be able to replace 'p1' with '_caller'

warm swallow
#

p1 switchPlay "Acts_carFixingWheel"; sleep 15;

#

other script

#

OK GOT IT TYSM

manic sigil
#

Ah, finally got it T_T I don't think it's what I did before, but it's working.

warm swallow
#

wdym

#

is it not _caller

manic sigil
#
vector = -(5/2500)*((vehicle player getreldir target)-90)^2+5; //makes a decent arc towards the right
vector = (vector/5)*100; //converts to percentile
vector = vector max 0; // trims negatives
vector = ceil vector; //rounds up
 hintsilent format ["Dir: %1",vector]
warm swallow
#

ope

manic sigil
#

Sorry, talking about my thing :p

#

You could also try replacing p1 with _this select 1

#

Supposed to be the same thing... I'm thinking _caller is for if you're passing the caller to a .sqf file, but I'm not exactly a master at this >n>;;

#

Or it may always need to be in the context of an external .sqf

warm swallow
#

removeAllActions gen1; _caller playMove "Acts_carFixingWheel"; sleep 15; scoreSurvivor = (scoreSurvivor + 1); titleText ["scoreSurvivor && "generators repaired."], "PLAIN DOWN", 2]; if (scoreSurvivor >= 5) then {survivorsWin = true;};

this worked, however when I introduced title text instead of a str silentHint, I get the error Type text epected array?

#

cant remember the first may've been string

#

@manic sigil

manic sigil
#
titleText ["scoreSurvivor && "generators repaired."], "PLAIN DOWN", 2]; 

You have some copied icons in there, it's getting bugged. Are you trying to have it project the score and number of generators repaired?

warm swallow
#

correct

manic sigil
#

Alright, that's going to take some format work.

warm swallow
#

also wdym copies icons

#

i thought i had the formattign down...

manic sigil
#

I'm being braindead, you have some execess "'s and ]'s

warm swallow
#

scoreSurvivor is basically the number of generators repaird

#

so

manic sigil
#
titleText ["scoreSurvivor && generators repaired.", "PLAIN DOWN", 2]; 

will get you "scoreSurvivor && generators repaired" to show at the bottom of the screen... which while pretty, isn't informative.

warm swallow
#

ah

#

titleText [scoreSurvivor && "generators repaired."], "PLAIN DOWN", 2];

#

is this fixed?

#

wait

manic sigil
#

Not quite :p

warm swallow
#

titleText [scoreSurvivor && "generators repaired.", "PLAIN DOWN", 2];

#

... right?

manic sigil
#

format ["words %1",variableToAppearAt%1]

#
titleText [format ["Score: %1",scoreSurvivor],"PLAIN DOWN", 2];
warm swallow
#

😮

warm swallow
manic sigil
#

I was assuming scoreSurvivor was the variable you wanted to project, you can replace that with whatever variable you want to have in the title text line

warm swallow
#

do i need the %

#

1

manic sigil
#

Yeah, that's the anchor for where the variable gets placed and turned into a string.

#

%1, %2, %n onwards.

warm swallow
#

ah

manic sigil
#

format ["Score: %1 Players Remaining: %2",scoreSurvivor,count allUnits]

warm swallow
#

hmmm

#

could you help me a tiny bit more, im not quite understanding your example code 100%

#

titleText [format ["Score: %1",scoreSurvivor],"PLAIN DOWN", 2];

#

can i replace Score with scoreSurvivor

final storm
#

what do you want the text to say?

warm swallow
#

and can i do && "generators repaired". after

#

"X number of generators repaired"

#

with x being amount, but in title text at bottom of spring

#

screen

final storm
manic sigil
#

Do you have the number of generators repaired stored as a variable?

warm swallow
#

yes. that is scoreSurvivor

#

each time they repair a geneator a script runs thats scoreSurvivor + 1

final storm
#
titleText [format ["%1 generators repaired",scoreSurvivor],"PLAIN DOWN", 1];
#

that

warm swallow
#

ill try now tysm

manic sigil
#

Yeah, the section in quotes in just text, the %n gets replaced with a variable.

final storm
#
removeAllActions gen1;
player playMove "Acts_carFixingWheel";
sleep 15;
scoreSurvivor = scoreSurvivor + 1;
titleText [format ["%1 generators repaired",scoreSurvivor],"PLAIN DOWN", 1];
if (scoreSurvivor >= 5) then {survivorsWin = true;};
#

dbd?

warm swallow
#

oop also uhh @manic sigil _caller doesnt do anything :/

manic sigil
#

My only problem with that setup is that, once you run the action, it's a done deal - even if you get shot, the generator is repaired.

warm swallow
#

@final storm something small im making to try to get into scripting, i dont want to be a noob scripter anymoer :/

#

@manic sigil dbd

manic sigil
#
_this select 1 playMove "Acts_carFixingWheel";
warm swallow
#

also @final storm got a missing bracket error

#

removeAllActions gen1;
_this playMove "Acts_carFixingWheel";
sleep 15;
scoreSurvivor = (scoreSurvivor + 1);
titleText [format ["scoreSurvivor,"%1 generators repaired"],"PLAIN DOWN", 2];
if (scoreSurvivor >= 5) then {survivorsWin = true;};

#

current code

final storm
#

from what i sent theres nothing wrong with it

manic sigil
#

_this select 1

#

not just _this

warm swallow
#

huh

#

got it

manic sigil
#

_this would return an array of objects, specifically [gen1, playerActivatingAction, theActionID, additionalArguments]

#

select 1 would direct it to the second item in the array, the unit activating the action.

warm swallow
#

ty for explanation!

#

[format ["scoreSurvivor,"%1 generators repaired"],"PLAIN DOWN", 2];

is the [ before format supposed to be there

final storm
#

yes

#

titleText take an array

warm swallow
#

hmm

manic sigil
#

Ah, you %1 is leaking

warm swallow
#

huh?

manic sigil
#
[format ["%1 generators repaired",scoreSurvivor],"PLAIN DOWN", 2];
#

Format["string",variable]

warm swallow
#

so i cant have x generators repaired instead? :p

manic sigil
#

%1 generators repaired would give you the scoreSurvivor in %1 position.

warm swallow
#

could you format it with the code for example?

manic sigil
#

As above

warm swallow
#

ohhhhh

copper raven
#

format ["your name is %1", name player] // possible output: "your name is John"
format ["%1", 123] // always "123"
hope it makes sense

manic sigil
#

Yup. Format doesn't care where %1 ends up, that's where it'll put the variable you call after the string.

warm swallow
#

i seee

#

"PLAIN DOWN", 2]; is 2 the size of the font?

#

sorry to ask again, but would this work

#

titleText [format ["<t color='#ff0000' size='5'>"%1 generators repaired",scoreSurvivor </t><br/>", "PLAIN DOWN" , -2, true, true];

manic sigil
#

Only one way to find out.

warm swallow
#

facts

#

it says a bracket is missing again

#

right by the generator and the 1% again...?

manic sigil
#

"<t color='#ff0000' size='5'>%1

#

Remove the quote before %1, it's reading the start of the string from <t, but processing that all as how-to-color-and-size code.

#

The additional " makes it think the string stops there, and it's throwing a fit

warm swallow
#

titleText [format ["<t color='#ff0000' size='5'>%1 generators repaired",scoreSurvivor </t><br/>", "PLAIN DOWN" , -2, true, true];

#

ill try tat

#

oop now invalid number

#

at </t><br/>

manic sigil
#

generators repaired </t><br/>",scoreSurvivor

warm swallow
#

what does </t><br/> do

manic sigil
#

/t ends the color and size formatting

warm swallow
#

can i just delete it then?

manic sigil
#

/br breaks the line; in the example page, it adds a line of asterisks, in your case, it's doing nothing.

sacred slate
#

how do i do: _mygroup = group _this; <- _this is in a init of a unit field

manic sigil
#

I'd keep the /t for neatness sake/can't recall if it'll work otherwise.

#

But the /br you can remove.

warm swallow
#

so just </t>

manic sigil
manic sigil
#
titleText [format ["<t color='#ff0000' size='5'>%1 generators repaired </t>",scoreSurvivor, "PLAIN DOWN" , -2, true, true];
robust tiger
manic sigil
warm swallow
#

missing bracket reeeee

#

do u know where

manic sigil
#

after scoreSurvivor

sacred slate
#

thx

warm swallow
#

IT WORKSSSS thanks so much for your help bro @manic sigil

#

ill make sure to credit you

manic sigil
#

Well, 'optimally' in that arc... you get what I mean

warm swallow
#

@manic sigil if i have a like BLACK IN script, should I put it in each charracters init file, or the mission init file...?

manic sigil
#

That one you may need another person to chime in on, multiplayer scripting isnt my strong suit x_x

buoyant hare
#

Is it possible to have BIS_fnc_holdActionAdd as a repeatable turn on\turn off action for e.g. a switch?

little raptor
#

are you coding for MP or SP?

buoyant hare
#

@little raptor how would I accomplish that?
Is for an MP mission

little raptor
#

you need a function that removes the old action and adds a new one: (let's call it my_fnc_addAction)

params ["_target", ["_turnOn", true]];

[_target, missionNamespace getVariable ["my_switch_action_id", -1]] call BIS_fnc_holdActionRemove;

if (_turnOn) then {
  my_switch_action_id = [_target, "Switch On"..., { //completion code
    params ["_target"];
    [_target, false] remoteExec ["my_fnc_addAction", 0];
  },...] call BIS_fnc_holdActionAdd;
} else {
  my_switch_action_id = [_target, "Switch Off" ..., {//completion code
    params ["_target"];
    [_target, true] remoteExec ["my_fnc_addAction", 0];
  },...] call BIS_fnc_holdActionAdd;
}
#

this has to be remoteExeced for everyone

#

or you can just call it in initPlayerLocal.sqf (if it has to be there at startup, but note that the switch state is not synced and you have to add it yourself if that's what you want to use)

buoyant hare
#

@little raptor Cheers big ears!
Unfortunately I'm not that savvy with the sqf coding. Where would I put the code above? I have this in the init field of the object acting as a switch box.

[
switch_box,
"Turn off the Lighthouse's beacon", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{private _lighthouse = nearestObjects [player, ["Land_LightHouse_F"], 50]; 
{ [_x, false] remoteExecCall ["BIS_fnc_switchLamp",0,true]; } forEach _lighthouse;
playSound3D ["a3\sounds_f\sfx\special_sfx\sparkles_wreck_3.wss", player];
_target animateSource ["switchposition",1];
_target animateSource ["switchlight",0];
LightHouseVar = true;
publicVariable "LightHouseVar";},
{},
[],
1,
0,
true,
false
] call BIS_fnc_holdActionAdd;
little raptor
#

in that code I've named the function my_fnc_addAction but you can change it to whatever you want

#

add or replace the completion code as I showed you in that code
and don't forget to save the action id (my_switch_action_id =)

buoyant hare
#

@little raptor Will try it out, thanks for the help!

little raptor
buoyant hare
#

Because it's not JIP-compatible?

little raptor
#

no because it gets executed for every connecting client

#

you'll get duplicate actions

buoyant hare
#

Ah ok. Will avoid it then!

manic sigil
winter rose
#

init fields are executed by every connecting PC

manic sigil
#

I dont think I can stress enough how little I understand MP architecture >_<

Okay, so Init is global, each connecting PC would run it again for every PC connected, leading to multiplying effects.

But initplayerlocal is local, it is still run by every PC but wont affect other PCs, right?

winter rose
#

ok:
1/ reset your knowledge
2/ listen 😄

little raptor
winter rose
#

init fields are executed, initPlayerLocal.sqf is executed

if the code inside any of them has a global effect, then it happens to everyone

little raptor
#

p1 connects -> init for p1
p2 connects -> init for p1 and p2
p3 connects -> init for p1 and p2 and p3

little raptor
#

wat?

winter rose
#

if you place [] spawn { sleep 2; hint "Hello there"; };, only the connecting player will have it

#

not everyone again

#

if you use setDamage however, since it has a global effect, everyone will see the damage done

#

@manic sigil when a player connects, his computer will run init fields code, and initPlayerLocal.sqf . if there is code with global effect in it, others will see its effect of course

manic sigil
#

Ahh, okay. So as Leopard said, the cascading effect, but only if you put something global in the init field?

little raptor
winter rose
winter rose
#

and nobody complained about my missions yet 😄

little raptor
#

they're perfectly fine

winter rose
#

people putting this setDamage 0.5 in it for example

little raptor
#

so?

winter rose
#

you start, oh you are injured! then heal yourself
then someone connects, and oh you are injured again

little raptor
winter rose
#

I vote for the second option? 😅

little raptor
#

so init field == initPLayerLocal

winter rose
#

yup, nothing more about its evilness

#

were it like

p3 connects -> init for p1 and p2 and p3
it would be a joyful and awful mess 😄

manic sigil
#

So in that scenario, where would be the best place to execute set dammage to have it be a one-off?

little raptor
#

initServer

dusky pier
#

Wait, initPlayerlocal is getting started when every new player connected? ( i mean - for everyone )?

little raptor
#

no

#

just for the connecting client

#

but if what you execute has global effect then yeah for everyone

dusky pier
#

Ah, understand

little raptor
#

@winter rose or maybe this confused me?

Object initialisation fields are called Applies To All

#

I don't know what it was tbh

dusky pier
#

I thought - init ( object ) script - run only on host ( client / server where is created )

winter rose
winter rose
#

you can filter with if (isServer) then {} but it's a pinch ugly (but safe)

dusky pier
#

Understand

hoary halo
#

Hey guys, how would I do to delete all units except the player inside of a trigger ?

fair drum
dusty whale
#

can i use params in foreach?

pliant stream
#

why not. _x params ["_a", "_b"]

dusty whale
#

fair enough

#

cheers

warm blaze
#

How to optimize arsenal menu loading with huge amount of inventory it has ?

#

it takes 3-5 seconds sometimes to finish loading...

warm hedge
#

No, unless you rewrite it

little raptor
warm blaze
#

where can I find it ?

little raptor
#

it's part of ACE meowsweats

warm blaze
#

any other options instead of ACE arsenal usage ?

little raptor
#

You can make a new one like POLPOX said

warm blaze
#

I am re-writing it but can't find logic that is responcible for loading of items in gear groups

winter rose
warm blaze
#

shall it be run each time a player loads arsenal ?

winter rose
#

you run it once on mission init, it should be enough

warm blaze
#

let me try it out, thanks

little raptor
warm swallow
cosmic lichen
#

@warm swallow It is written in the doc you linked meowhuh

warm swallow
#

im confused as to what it means. Does it mean like the distance at which the addAction appears on the object?? @cosmic lichen

cosmic lichen
#

Yes

#

exactly that

warm swallow
#

so if i want the player to be right next to the object, I should set the radius to something like 15?

cosmic lichen
#

It depends on the object

warm swallow
#

this addAction [ "Repair Generator", { ["gen\gen1.sqf"]; }, nil, 1.5, true, true, "", "true", // _target, _this, _originalTarget 15, false, "", "" ];

#

is this the correct format. I copied an example from the biki and tried to convert my code to this

cosmic lichen
#

{
["gen\gen1.sqf"];
}

"gen\gen1.sqf"

warm swallow
#

so no {}?

#

or []

#

`"Repair Generator",

["gen\gen1.sqf"];
,`
cosmic lichen
#

no {} and no []

warm swallow
#

[ "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", "" ];

#

@cosmic lichen also how do i post my code with syntax highliting like some people do?

cosmic lichen
#

check the pinned messages

warm swallow
#

'''[
"Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
];'''

#

''' [
"Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
]; '''

#

' ' '[
"Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
]; ' ' '

#

@cosmic lichen ?

cosmic lichen
#

?

warm swallow
#

what character is it

cosmic lichen
#

`

warm swallow
#
    "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
]; ```
#

😮

cosmic lichen
#

missing the sqf

warm swallow
#
[
    "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
]; ```
#
    "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
];```
cosmic lichen
#

(3times)sqf [ "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", "" ]; (3times)

warm swallow
#
[
    "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
]; 
#

ayyy

#

rty

#

also im getting error expected array type code

#

on ^

little raptor
#

(I'm not sure what that is tho)

fair drum
#

the error is his code line

copper narwhal
#

hey again fellows, i was wondering has anyone ever been able to delay the startup time of a helicopter or car while also playing a sound in the interim between engine being turned on and the actual startup of the vehicle occuring?

fair drum
#

nvm I didn't know you could just do a path to a file instead of execVM or compiling that file

copper narwhal
# little raptor not possible with scripting

ah i see 😦 any idea where i could start looking on how to do it through modding? or is it just not possible at all. perhaps something with thrustdelay in the vehicle config 🤔

fair drum
#

Do you just want to skip the speed up time on mission start?

copper narwhal
fair drum
warm swallow
#

@little raptor can you help me format this? it says encountered a isntead of = idk what that means

copper narwhal
warm swallow
#
this addAction
[
    ["Repair Generator", "gen\gen1.sqf"], nil, 1.5, true, true, "", "true", 15, false, "", ""
];
cosmic lichen
#

[ ?

warm swallow
little raptor
copper narwhal
warm swallow
fair drum
warm swallow
#

would it be {} instead?

little raptor
#

no

#
this addAction
[
    "Repair Generator", "gen\gen1.sqf", nil, 1.5, true, true, "", "true", 15, false, "", ""
];
warm swallow
#

ill try that

copper narwhal
fair drum
#

the "engine" event handler is a global argument so it doesn't have to be local. just evaluate it on the server, then remoteExec a sound push to all the clients and the engineOn command to the owner of the vehicle.

#

let me see if i can figure out something. it will be goofy but it might work haha

copper narwhal
fair drum
#

so... here's my rough draft for you. I might get a facepalm from leo...

//Run whole file on every machine

tag_engineCycle_heli = {

    params ["_vehicle"];

    if (!canSuspend) exitWith {_this spawn tag_engineCycle_heli};

    _vehicle engineOn false;
    playSound3D [getMissionPath "turbineSound.ogg", _vehicle, false, [0,0,0], 5, 1, 300, 0]; //Global Arguement and Effect
    sleep 5; //However long the turbine sound is when you want rotors to spin
    _vehicle engineOn true;
};

vehicleNameHere addEventHandler [

    "Engine",
    {
        if !(isServer) exitWith {};
        params ["_vehicle", "_engineState"];
        private _count = _vehicle getVariable ["count", 0];

        if (_count % 2 == 0) then {
            [_vehicle] remoteExec ["tag_engineCycle_heli", _vehicle];
        };

        _count = _count + 1;
        _vehicle setVariable ["count", _count];
    }
];
little raptor
fair drum
#

yeah but if its in a init, it should add it to the server too right?

#

oh i see

#

derppppppp

#

back to the drawing board

little raptor
#

and your event handler has the potential to loop forver

fair drum
#

yeah i was trying to be cheeky with a modulo. is it a definite loop or potential if someone spam clicks engine controls?

little raptor
copper narwhal
#

just so i can learn a lil bit, is the potential to loop forever because the if is never given something to stop it?

little raptor
little raptor
#

in other words let's say the sequence starts
1 2 3 4 5 engine on
woops turned off again meowsweats

#

that wasn't a loop meowsweats
it was

copper narwhal
#

sure!

fair drum
#

yeah I think thats what I was trying to do with the modulo and count. since the count would tick up on the engine turning on the first time, it would fire the function which would cause it to tick the second time, but wouldn't fire the function cause its an odd number, but I forgot to take into account the third engine firing during the function which would cause it to cycle again.

#

i think i can work around it by having a bool variable when the turbine sound is going on that can prevent the event handler from doing anything until its done with some additional conditions