#arma3_scripting

1 messages Β· Page 563 of 1

still forum
#

SQF is a terrible language to learn, its backwards and stupid
its the simplest language I know.
Once you understood how the low level stuff works, the rest comes quite easy.
But basically noone understands...

spice axle
#

python is easier

winter rose
#

easier*

spice axle
#

ah yes

winter rose
#

does the CYCLE waypoint needs a certain distance to the first wp in order to form a "loop" ?
it will take the closest (including "WP 0", which is group's starting point) @hollow lantern

tough abyss
#

alright so im using the vanilla respawn system, and i want to respawn with only 1 available loadout, how can i do that?

#

but for everybody, all the roles, just doesnt change the roles or traits, just what you spawn with

sonic linden
#

Hi,
My problem is i want to remove all items from a backpack in a cargo.
my approche get all backpacks names, delete all BPs from cargo, and add all BPs form name list.
But the new added BP still contains the items that the deleted one had bevor.
Can some one explain me this ?

my test code:

_test = {
    params [["_container", objNull, [objNull]]];
    if (isNull _container) exitWith { systemChat "Cargo isNull"; false };
    systemChat "start";
    _containerBackpacks = (backpackCargo _container);
    sleep 5;
    systemChat "Delete";
    clearBackpackCargoGlobal _container;
    sleep 5;
    systemChat "Add 2 times className Backpack";
    {
        systemChat str(_x); // <- className ( not object )
        _container addBackpackCargoGlobal [_x,2];
        
    } forEach _containerBackpacks;
    systemChat "Done";
};

[cursorTarget] spawn _test;
forest ore
#

@tough abyss
After the skipTime exercise there just earlier, are you now ready to go in the deep end? Here could be something to get you going for respawn loadouts πŸ‘‡πŸΌ
https://www.youtube.com/watch?v=Tmwt2lO2Iv0 ("[How To] Arma 3 - Custom Respawn Loadouts")

mortal nacelle
#

@jade abyss I fixed it πŸ˜‚

#

I was cutrscing in the function

#

🀒

jade abyss
#

At least it works now πŸ‘

mortal nacelle
#

it works to a degree. all my info and what i want is on there, just not the marker (on the cutrsc)

jade abyss
#

As mentioned before: Test with Vanilla Markers (check if they are on the normal Map ("M")), then exchange with yours.
Then you know: It's a marker config thingy.

mortal nacelle
#

Yeah it works on the normal map

#

it follows me around

#

Just not on the cutRsc

jade abyss
#

Do you resize the map or move it around, with a script?

mortal nacelle
#

it is centered to the players location

jade abyss
#

The RscMapControl is... erm... kinda strange. Let's say it this way πŸ˜‘

mortal nacelle
#
    _control = _display displayCtrl 23539;
    _control ctrlMapAnimAdd [0,0.15,getPos player];
    ctrlMapAnimCommit _control;
jade abyss
#

Nothing else? No ctrlSetPosition stuff?

mortal nacelle
#

no

jade abyss
#

Try the zoom further away

#

And check if it's there.

mortal nacelle
#

You mean the marker? I'd see it with my current ZL

tough abyss
#

@forest ore there has to be an easier way..

#

i have like 11 classes in my mission i have to do that for all of them?

forest ore
#

There usually is at least couple of ways to achieve something but without diving head-on it's really difficult to tell what is the best or easiest or shortest way.

tough abyss
#

i think i know a way

winter rose
#

*magic*

tough abyss
#

so the respawn just uses the default loadout of the unit

#

what if i create a custom unit on the orbat creator and equip it with what i want the respawn clothes to be

winter rose
#

orbat creator?

tough abyss
#

from alive

forest ore
#

That's something ALiVE, that ORBAT

winter rose
#

default respawn system would still respawn unit's default weapons

#

(I think)

tough abyss
#

yeah, but i can change the units equipment straight from the orbat thing

#

thing is i dont even know how to spawn the custom units i created

forest ore
#

I'd take a guess this here is for general Arma scripting so not many might be too familiar with how ALiVE ORBAT creator works or how it is possible to spawn custom units made with ORBAT.
If you'd insist on using ORBAT creator then it might be better to look help from ALiVE's forum (http://alivemod.com/forum/) or their Discord (which by the way iiiis??)

tough abyss
#

it just seems like something that should be complicated to do

#

why should it be so hard to edit the respawn loadouts, should be in the respawn module itself

winter rose
#

there is usually a world between what should be and what we have

#

welcome to coding/Arma/coding Arma/Arma coding

#

also maybe this should not be your primary concern during your mission development; you can put it on the todo list and come back to it later

forest ore
tough abyss
#

nah i barely understood it

drowsy axle
#

@tough abyss Once you export the units/factions/whatever from ORBAT, you want to make a mod for your new units.

#

Then reference the class name(s), from within the configs that you have created.

tough abyss
#

Make a mod? Wym?

cold mica
#

With ALIVE, there are things that can be scripted and things that have to be a mod.

Making new factions is a script
Making new groups is a script
Making new units is a mod

The easiest way to create "new units" is to take existing ones but completely change their loadouts. The players would be none the wiser.

tough abyss
#

Alright, so i edit the units loadout, how do the changes go into effect?

cold mica
#

If you were to edit the unit's loadout using arsenal, they will retain the changes and start the mission with the equipment you gave them.

hollow lantern
#

@winter rose fine, I bet this distance however is to long? The marker at the top is the "last" waypoint. The marker at the bottom is the location of the "first" one. https://i.imgur.com/Y7GFs9M.png

tough abyss
#

Damn, alright then thanks man

#

Hey i dont wanna change my factions units tho just incase alive spawns them in with nothing ( i want the loadout to be a jumpsuit with nothing) so i can just take a unit from a dif faction, change the loadout, spawn it in and make him playable and then go into attributes to assign that unit to my faction correct?

winter rose
#

@hollow lantern given A β†’ B β†’ C waypoints - C being the "CYCLE" waypoint
if the B β†’ C distance is the shortest, it will go back to B
if the C β†’ A distance is the shortest, it will loop to A

cold mica
#

Using Alive or no?

hollow lantern
winter rose
#

I don't get it?

hollow lantern
#

my question is if waypoint 4 who is set to CYCLE will connect to 1 or if the distance is to far away

winter rose
#

to 1 yes
no matter the distance, only >the closest<

hollow lantern
#

ah

#

nice, thanks

winter rose
#

if you are not sure, you can still add a normal waypoint on 4, and add a 5th that would be "CYCLE" right on location 1

hollow lantern
#

true, I'm about to test this out with only 4, but other Arma scripting test distracted me LOL

winter rose
#

in Eden, you will see a small line as to which waypoint the Cycle will pick

exotic flax
#

That's why I have a testing VR environment where I can place scripts/stuff I want to test before putting it in a live mission.
This way I know it works on it's own without issues of other stuff being in the way. If it doesn't work in the live mission, it has to be something else that the script/feature I added πŸ˜‰

hollow lantern
#

that's my test mission lul

#

VR is too much void();

opal mulch
#

when you scroll wheel on a targetbootcamphuman_f you can see a scoretable of whos shot it. is there a way to reset that? I can't find anything in the biki and at this point my only course of action is to delete and respawn the object.

winter rose
#

@opal mulch try allVariables theObject on it to see BIS vars

opal mulch
#

thanks

mortal nacelle
#

yo lou, do you know how i could get allMarkers to show on my cutRSC? Everything works great except the markers dont show on it

winter rose
#

Lou*

nope, IDK

#

(not because you didn't capitalise πŸ˜„)
I really don't know much about GUI

mortal nacelle
#

Oh, oky

cunning crown
#

Use ctrlCreate or something along those lines

exotic flax
#

@opal mulch you can most likely do something like

// _target is target object
['resetShootersData', _target] call BIS_fnc_target;
opal mulch
#

I'll try that, thanks a lot!

winter rose
#

oooh

#

who's in charge of the biki?? it should be documented!!1!!eleven

exotic flax
#

Can @winter rose please come to isle 3, can @winter rose please come to isle 3, thank you

winter rose
#

*grumble* always in the middle of my show…

#

ah, no can do - will have to wait for when I am home πŸ˜„

hollow lantern
#

I'd wish Arma would have an SQF debugger. You start a script, set a debug point and can then check values in variables and such

restive leaf
#

Google arma dedmen debugger

still forum
#

I have an sqf debugger Β―_(ツ)_/Β―

winter rose
#

you're not arma πŸ‘€

#

so now we have confirmation @still forum is a software

hollow lantern
#

maybe he is pure energy

#

who knows

restive leaf
#

He's a bot that purges bots...

hollow lantern
#

But thanks for the tip

queen cargo
#

And there also is sqf-vm with a theoretical Debugger

pulsar anchor
sudden yacht
#

Anyway to spawn Radio Transmissions(contact DLC) mid mission say through a trigger? So they dont always appear?

#

Also is it possible to attach that transmission to an object.

still forum
#

And there also is sqf-vm with a theoretical Debugger
sqf-vm's debugger is even less theoretical than the arma one

tawdry harness
#

Anyone know why the waitUntil doesn't work since it seems to instantly activate whatever code is after it

_wp = (group _plane) addWaypoint [_vehicleDropPos, 0];
_wp setWaypointStatements ["true", "_waypointCompleted = true; hint 'Completed';"];

waitUntil {_waypointCompleted isEqualTo true};
winter rose
#

_waypointCompleted is a private variable that only exists in the wapoint's statement @tawdry harness

#
MyGlobalVariable = false;
_wp = (group _plane) addWaypoint [_vehicleDropPos, 0];
_wp setWaypointStatements ["true", "MyGlobalVariable = true; hint 'Completed';"];

waitUntil { MyGlobalVariable };
queen cargo
#

@still forum but way less complete πŸ˜‚ πŸ˜‚

unique sundial
#

debug_console extension is the best debugger

tawdry harness
#

Ahh awesome thanks but now I get Error Generic Error in expression and the error looks to be at the ```sqf
waitUntil {waypointCompleted};

#

@winter rose

winter rose
#

you didn't set it to false before @tawdry harness

tawdry harness
#

I did

#

Aight well I got it working, thanks

#

πŸ‘

mortal nacelle
#

Is there a way to setName of a person in MP?

#

as setName is sp

exotic flax
#

the name of the person is the players name

#

so can't be changed, unless someone changes his/her name

mortal nacelle
#

hmm ok. More of a question directed towards Dedmen (TFR), I have seen some servers changing their teamspeak name when they join a server with tfr automatically.. any idea how to do that?

#

But there tfr name doesn't change to their ingame name (like it usually does), it is predefined by the server

exotic flax
#

That's part of the TS plugin, which takes the in-game name and sets this as the TS name.

#

or better said; the mod takes the name of the player (with profileName), sends this to the mods dll, which in it's turn sends it to the (local) TS plugin, which then modifies the name.

mortal nacelle
#

ok and can i adjust that to for example, just generate a random string of numbers and letters ?#

exotic flax
#

as far as I know that option does not exist

#

which wouldn't make sense either to have different names in-game and in TS

mortal nacelle
#

@still forum can you confirm this? because i have seen it

#

Grez I know it doesn't make sense, but it has a purpose for what I am looking for

runic edge
#

Wouldn't setting the playable unit variable name in the editor works ?

exotic flax
#

no, it's the profile name (for real players)

#

as far as I know

runic edge
#

Damn... So there's no point setting a variable name for playable units ?

exotic flax
#

there is; you need it to reference specific units in scripts

#

it shows that the name send to TS is the profile name

mortal nacelle
#

and name player

#

hmm

exotic flax
#

name player will return profileName in MP for real players

mortal nacelle
#

Couldn't I just change the else statement and add a selectrandom statement above or is that stupid

#

For what I am trying to do

exotic flax
#

in that case you'll need a modified version of TFAR

mortal nacelle
#

Ok I understand now. Thanks for the guidance Grez

tough abyss
#

@cold mica I changed the unit loadout and i spawned the unit in and nothing changed, am i supposed to take the edited config somewhere or something??

ebon citrus
#

Does somebody know if it's possible to detect if the player is in ragdol?

exotic flax
#

if !(alive player) then {}; ?

cold mica
#

@tough abyss What config? Are you spawning in a unit via Alive or editing an already existing unit?

ebon citrus
#

alive doesnt work here, as player will ragdoll for example from cars without dying

#

such a pain this whole ragdoll

winter rose
#

@ebon citrus it's not possible (unless you get selection positions and compare them to "normal" positions but that would be a heck of a hassle)

ebon citrus
#

yeah, i figured as much from my own research. Welp, i guess i cant get ridd of cars driving over players

winter rose
#

what do you mean?

ebon citrus
#

the ragdolling of players after they are driven over by cars is causing issues with my mission

winter rose
#

deleteVehicle

ebon citrus
#

maybe picking up the animationstate

winter rose
#

ah, maybe it's "" indeed

#

there was something like that iirc yes

ebon citrus
#

ragdolled AI atleast has "unconscious" anim state

ivory lake
#

yeah last i checked that was the ragdoll 'animation' but im not sure how reliable it is

ebon citrus
#

so i can pick upo the animationstate and then switchmove

#

do you think switchmove will override "unconscious" ?

#

well, one way to find out

#

shame, doesnt look like it does

winter rose
#

don't get run over
seems to be the most appropriate answer? if it's an AI vehicle, make a check for player's distance, and setVelocity 0?

#

I don't know how much unit stop true/false works on vehicles, but it's a lead

#

@ebon citrus

ebon citrus
#

i guess that could work

#

really super unimersive though

winter rose
#

well, they see someone close to them, they stop

#

not that bad

exotic flax
#

driving over people as well 🀣

winter rose
#

Β―_(ツ)_/Β―

ebon citrus
#

it's not that the players will suffer much from getting driven over, they are in godmode, but they can get stuck in weird places

#

better environment design should be in place, i guess

winter rose
#

you could also add a check for player/any unit's distance in front of the vehicle, so it would be more "realistic" with the driver's field of view

tough abyss
#

@cold mica an already existing unit, i dont really care just tell me what to do to spawn any unit with a custom default loadout lol

exotic flax
#

create a new unit with custom loadout, and then spawn it...

cold mica
#

All I know is that you can spawn a unit in the editor and edit the loadout using the arsenal.

winter rose
exotic flax
#

or make loadout in Arsenal, export with getUnitLoadout and use setUnitLoadout on unit you spawn

tough abyss
#

@exotic flax ive tried like multiple times lmao

exotic flax
#

obviously wrong because it didn't work πŸ˜‰

tough abyss
#

im sorry

#

i ment i tried the orbat thing not the code

#

also where do i put that code

exotic flax
#

how do you spawn the unit?

winter rose
#

re spawn

tough abyss
#

sigh i have no idea what you said earlier

exotic flax
#

editor? script? respawn templates? zeus?

tough abyss
#

or make loadout in Arsenal, export with getUnitLoadout and use setUnitLoadout on unit you spawn

#

export with get unit loadout?

#

???

winter rose
#

! ! !

exotic flax
#

go to the wiki and read the documentation of those functions

#

and no offense... we really try to help you, but we can't explain complex solutions if you don't understand the basics

tough abyss
#

dude i dont code and i can tell this is some backwards shit

#

why isnt it do this when this

exotic flax
#

because Arma

#

and since we have no idea what you want, we also can't give a clear solution

tough abyss
#

i want it to work like antistasi

#

a basic loadout so when you respawn you go to a crate and get your custom loadout

exotic flax
#

... which took a full team with experienced developers to build... and you try to make something similar, alone and without experience

tough abyss
#

nahh man basically

#

this is my problem

#

i spawn the units in which will be the players

#

they spawn in and they make their custom loadout and save it etc

#

and then they respawn and their loadout when they spawn is the default loadout of the unit im using

#

which is immersion breaking

winter rose
#

language, btw

tough abyss
#

so i thought of two ways to fix this, either change the default loadout of the unit itself through orbat or something like what you said

exotic flax
#

I can already think of 4-5 solutions, which all require scripts

cold mica
#

Changing default loadout of the unit through orbat is not the easiest solution.

tough abyss
#

ik its just a workaround so i dont have to script

cold mica
tough abyss
#

i have but that would require to script in every single item

cold mica
#

Oh, that's impossible. You will need to script for something that specific.

tough abyss
#

there has to be a simple script that calls on a pre selected loadout

cold mica
#

Get the mod 3den enhanced and you can copy and paste loadouts.

tough abyss
#

when i export the mission will my friends need to download that mod to play it too?

cold mica
#

No, it is clientside

tough abyss
#

alright ill test this solution

exotic flax
#

but bugged, so could become a dependency...

cold mica
#

I whole-heartedly disagree. I have been using it for nearly two years and have had no issue with it.

exotic flax
#

I already had it a few times that I manually had to remove it from mission.sqm due to some unknown reason

cold mica
#

What were you trying to do with it when it became a dependancy?

winter rose
#

there has to be a simple script that calls on a pre selected loadout

Yes, but you still have to either use a default loadout, or define one πŸ˜„

exotic flax
#

no idea where it came from... probably due to settings or a module which got embedded. Although removing the dependency didn't break a thing

#

or an object which is normally not available

tough abyss
#

@cold mica i got eden enhanced

#

am i able to change a units default loadout?

cold mica
winter rose
#

One more time! πŸ₯³

tough abyss
#

so on player respawn, call this loadout

cold mica
winter rose
#

and addEventHandler "Respawn"

exotic flax
#

onPlayerRespawn.sqf

tough abyss
#

where do i add the eventhandler?

#

the init of the troops?

winter rose
#

@exotic flax not especially, from what I understood there are multiple loadouts for multiple units

tough abyss
#

dude i think im starting to get it

#

its like the laptop thing, basically you go into the mission folder and you name a text folder the thing that will be called when a certain thing gets executed in the game

#

for example i put the skip time thing in my init for the laptop and named the folder skiptime in the mission file

#

and then in the text folder i put in the script that i wanted to happen

#

am i right?

exotic flax
#

if the script is build for that, yes

winter rose
#

Too many things, use stuff sometimes

tough abyss
#

okay i put onPlayerRespawn.sqf in the mission folder what do i do now lmao

exotic flax
#

and start with something simple without the fancy stuff that even hardcore developers have issues with

tough abyss
#

@exotic flax its really not that hard

#

i just dont know how to script

exotic flax
#

if it wasn't hard you would be able to do it...

winter rose
#

@tough abyss this is why we tell you to read to learn

#

please tell me you don't expect us to do all of it

cold mica
exotic flax
#

like... I have 15 years of programming experience, and even I've spend 2 weeks on figuring out how to handle the respawn stuff (with some special sauce)...

tough abyss
#

i looked at that like 12 times i still dont know what to do with that link lol

cold mica
#

You look at the code in it and play with it until you understand

#

Or ask what part specifically confuses you.

exotic flax
#

its really not that hard

i looked at that like 12 times i still dont know what to do with that link lol

...

tough abyss
#

dude in the first moment i thought of an easier way

cold mica
#

The orbat way?

tough abyss
#

like there has to be a better easier way to get that done

#

yeah

cold mica
#

That is not easier, you'd need to package an entire mod for it.

winter rose
#

has to sure! Which one? Tell us

tough abyss
#

i know but still i thought of one xD

#

a workaround

#

im sure i can think of something

winter rose
#

Go ahead, then let us know when you find so I can update the wiki

exotic flax
#

Alive Orbat creator works fine for creating faction mods, but it doesn't magically create everything you want

tough abyss
#

can i add the medic trait to a unit?

exotic flax
#

_unit setUnitTrait ["medic", true];

cold mica
#

Yes, open the attributes of a unit and there will be a checkbox for it.

tough abyss
#

ah there we go

cold mica
#

Both are viable solutions.

tough abyss
#

im going to fix it

#

ill let you know if i figured it out and how

winter rose
#

Wait, they added a checkbox?

exotic flax
#

im we going to fix it

cold mica
#

might be 3den enhanced thing

restive leaf
#

ACE thing isn't it?

cold mica
#

but hawky has it anyways so they will see it any way.

tough abyss
#

@exotic flax idk about we all you did was tell me how hard it was for "an experienced team of coders" to do xD

exotic flax
#

I explained every part of doing yourself, and giving you links to where to find more information... and all you give back is "it's not hard, but I have no idea what you're talking about"

tough abyss
#

you know bill gates once said

winter rose
#

shhhhh you're not Bill Gates

tough abyss
#

if you want something done efficiently, have someone lazy do it, hell find an easy way to do it

#

im the lazy guy here

winter rose
#

Self awareness here

tough abyss
#

im not just smart enough to learnt the code see.. im smart enough that i dont have to..

cold mica
#

just cause a rich guy said it doesn't mean it's true. A lazy person just doesn't get stuff done.

restive leaf
#

Ofc, in the 19 years of OFP and ARMA modding there has never been any other lazy coder...

winter rose
#

geniuses can be lazy
lazy doesn't mean genius πŸ™ƒ

exotic flax
#

Be nice to nerds. Chances are you’ll end up working for one.

#

In the end; read the wiki and learn from there. If something is unclear or gives problems, this Discord will be your best friend.

tough abyss
#

fixed it.

cold mica
#

enlighten us

tough abyss
#

right, so i wanted the guys to spawn with nothing but the crye uniform right

#

and it was based on the default loadout of the unit

#

can i send screenshots here?

cold mica
#

it seems that it is not possible

#

but you can send links to screenies

winter rose
#

no, but you can link to a hoster ninja'd

tough abyss
#

give me a moment

#

soon people

#

ill enlighten you.

cold mica
#

i'm willing to learn

tough abyss
#

on the right you see the slots for me and my friends playable characters

#

the way its supposed to work is they start, they choose their loadouts with the crates and everytime they die they go to a crate and they load their loadout

#

thing is.. whenever they respawned the respawn system would spawn them in with the UNITS original loadout

#

immersion breaking, so i didnt wanna code

#

what i did.. i spawned in a survivor, close enough to the original jumpsuit, and as for the medics and engineers? ill apply those traits to every one of the survivors and name them that

#

praise my awesomeness. i just out bill gatested all of you

exotic tinsel
#

when i set a player to "player setUnconscious true" they lose their group icon, is there a way to turn it back on?

tough abyss
#

@winter rose @cold mica @exotic flax

exotic flax
#

so in the end you didn't get what you want, didn't learn anything, and are still not a multi-billionaire... Well done Bill Gates 🀣

tough abyss
#

i did get what i want

#

when you respawn in you do it with nothing but a jumpsuit, the exact loadout i wanted

#

now i dont even have to code to remove the other original loadout, actually not even a single line of code

exotic flax
#

@exotic tinsel setUnconscious shouldn't change anything other than the animation of the unit. So it shouldn't affect anything else, unless there's another script which is tied to the players state.

austere granite
#

there's a ton of buggy stuff with setUnconscious

exotic tinsel
#

so is there a way to turn the icon back on. i cant find a function call

cold mica
#

lmao, whatever works for you

exotic flax
#

never seen/used it before, so can't tell if this is how it got set initially

austere granite
#

groupIcon is the thing for HC iirc

winter rose
#

^

exotic flax
#

biki doesn't mention that πŸ€”

winter rose
#

shhhhhh the wiki is fiiine

tough abyss
#

im kinda sad nobody noticed how i managed to do what everybody said i couldnt lol

winter rose
#

The smartest way would have been to use "prisoner" unit and add them weapons at the beginning of the mission

exotic flax
#

.... simply placing the unit you want in 3den would have solved that, but you wanted something completely different...
so no... not impressed

winter rose
#

Respawn would have respawned them without weapons

forest ore
#

Hawky Today at 5:09 PM:
"and then they respawn and their loadout when they spawn is the default loadout of the unit im using
which is immersion breaking"

Reading between the few lines here@tough abyss how about this:
in the mission folder create a file called onPlayerKilled.sqf and in that file add the following line: player setVariable ["Saved_Loadout",getUnitLoadout player];

also in the mission folder create a file called onPlayerRespawn.sqf and in that file add the following line: player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

Now the players will spawn with the gear they had when they died

tough abyss
#

nah i dont want them to respawn with the gear they died with too that would kill immersion

exotic flax
#

... it's what you said what you wanted... and now not anymore?

tough abyss
#

? no i wanted it to be one preset loadout

#

which was a jumpsuit and nothing else

forest ore
#

Reading from all what you have written so far I took it that was JUST what you were looking for

winter rose
#

removeAllWeapons unit πŸ˜„

tough abyss
#

but then they would spawn with helmets body armor etc

winter rose
#

removeVest, etc

Anyway you got what you wanted, good

tough abyss
#

damn your not wrong

winter rose
#

you're*

forest ore
#
nahh man basically
this is my problem
i spawn the units in which will be the players
they spawn in and they make their custom loadout and save it etc
and then they respawn and their loadout when they spawn is the default loadout of the unit im using
which is immersion breaking
tough abyss
#

see guys that was the easy way to script it

exotic flax
#
// config A
class Extended_PreInit_EventHandlers {
    class ADDON {
        init = QUOTE(call COMPILE_FILE(framework\XEH_preInit));
        disableModuload = true;
    };
};

// script B
if (isMultiplayer) then {
    [] spawn {
        call EFUNC(code,setRespawnLoadout);
    };
};

// script C
_loadoutNames = ["respawn"] call FUNC(getActiveLoadouts);

if (count _loadoutNames > 0) then {
    _loadoutNames apply {
        [missionNamespace, _x] call BIS_fnc_addRespawnInventory;
    };
};
tough abyss
#

yeah the custom loadout is the jumpsuit with nothing haha

exotic flax
#

THAT is how you use custom loadouts 🀣

winter rose
#

dafak

exotic flax
#

it works with RespawnTemplate, sets insignia based on rank (which is in name of player), sets traits (medic/engi/sniper/etc) based on selected loadout and handles custom loadouts in ACE... oh, and a script to fix the position of items in gear πŸ˜‰

#

but that's all written out in about 15 different scripts

cold mica
#

ngl, all this argument actually gave me new scripts on handling respawn and I am thankful for that.

tough abyss
#

hayyy cmon this wasnt an argument lmao

#

something took you two weeks to figure i out i did it in 3 days without coding a thing haha

#

granted i wanted a default unit that had nothing on him but yeah

exotic flax
#

so much time spend on something that could have been solved in 5 minutes...

cold mica
#

im just glad that it's solved

exotic flax
#

up to the next problem!

cold mica
#

Next problem:

Asmodeus said this as a solution:

in the mission folder create a file called onPlayerKilled.sqf and in that file add the following line: player setVariable ["Saved_Loadout",getUnitLoadout player];

also in the mission folder create a file called onPlayerRespawn.sqf and in that file add the following line: player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

I want to use this. However, I want to getUnitLoadout when they first spawn rather than when they die. How would one do this?

winter rose
#

I would setVariable the unit "originalLoadout"

#

and on respawn, setUnitLoadout (unit getVariable "originalLoadout")

forest ore
#

If it has never been saved before how does one get it? Seems though that Lou is onto something there πŸ™‚

autumn nexus
#

Is there a way to attach a trigger to an object via scripting? I.e. I am trying to attach a trigger to all medical containers that would execute the ACE heal function in a liberation mission

winter rose
#

setVariables are transferred from dead unit to respawned unit afaik

#

@autumn nexus create a trigger and attachTo

forest ore
#

Is when they first spawn here the actual first ever (initial) spawn?

autumn nexus
#

So I would put a trigger down in editor, and then could script said trigger to be attached to any medical container?

winter rose
#

no

#

create a trigger for each box

even though… it seems heavy. what are you trying to achieve?

autumn nexus
#

Are you asking me @winter rose ?

cold mica
#

No, when the player spawns, Asmodeus

winter rose
#

yes

#

@autumn nexus yesss

autumn nexus
#

What I’m trying to do is every time I build a medical container in liberation, there is a trigger in the area around it that invokes the ace heal function

winter rose
#

no, what you are trying to achieve is a heal function everytime you get close to a medical container

#

triggers are not especially involved πŸ˜‰

autumn nexus
#

Ok, well then yes, that’s what I’m trying to figure out lol

winter rose
#

see createTrigger and forEach @autumn nexus

autumn nexus
#

Ok

forest ore
#

Now, I apparently did not understand what @cold mica was trying to convey but I hope Lou's suggestion was already enough πŸ™‚
I mean, what do you want to achieve with "getUnitLoadout when they first spawn rather than when they die"

cold mica
#

It's a common problem so I don't blame you.

#

My desire is simple:
Players begin a mission with an already spawned unit which has a custom loadout. Different units have different loadouts i.e. medic has medic loadout, rifleman has rifleman loadout.

I wish for players to respawn with their exact loadout that they had when they first began the mission in their respective unit.

I also wish to do the above using event scripts.

winter rose
#
unit setVariable ["SAG_loadout", getUnitLoadout unit];

and apply it on respawn (EH)

forest ore
#

And thanks Uncle for taking the time to explain your desire in detail

cold mica
#

Thank you for helping it make a habit.

And thank you Lou for the instructions. Forgive me for not understanding it fully earlier.

I will attempt to play with Lou's suggestion when I get home. I will return here if something goes wrong.

winter rose
#

noooooβ€” *ahem* you're welcome anytime! πŸ˜„

brittle dock
#

So I could use some help with something, I have this:
currentEnemy = [enemySpawnPos, 0, enemyType, groupAlpha] call BIS_fnc_spawnVehicle;
And I need to select the vehicle in the created array, so I tried this:
waitUntil {((_this select 0) !alive currentEnemy) || ((_this select 0) isNull currentEnemy)};
But I get an error when running it, missing ")".

#

First time I'm trying my hands on "_this select 0", never tried getting info from an array before.

winter rose
#
private _myVehicle = currentEnemy select 0
#

currentEnemy is an array, so you "select" its first element

brittle dock
#

Yeah, never knew how to do that though, thank you for the help! πŸ™‚

#

Why use "private" btw? isn't "_" enough?

winter rose
#

not "always"

#

imagine your code being { _myVar = 1; hint str _myVar; }

good, working

#

but if you do

_myVar = 0;
call { _myVar = 1; };
hint str _myVar; // hints 1
brittle dock
#

Yeah, the same as hint "1"

winter rose
#

it's not about this, it's about variable scope πŸ˜„

brittle dock
#

ah I see

#

Thanks! ^^

winter rose
brittle dock
#

Im already there haha!

#

Thank you though πŸ™‚

winter rose
#

πŸ‘

forest ore
#

Is it not possible to ```sqf
waitUntil {visibleMap};

winter rose
#

it is.

#

visibleMap returning a boolean, waitUntil waiting a boolean

grave lotus
#

I'm working on a script snippet to have one AI type ignore others. I'm new and suspect that getting the targets and applying forgetTarget is what I'm looking for. The syntax is still greek πŸ™‚ This is where I am:

#

_protected = ["I_E_Scientist_Unarmed_F","I_E_Scientist_F"];
_aggregation = [_this,"","","",""] targetsAggregate _selected;
{
if (_selected isKindOf _protected) then {

onEachFrame {_zombie forgetTarget _protected};

} forEach allUnits;
#

my target selection doesnt seem to be proper

still forum
#

@mortal nacelle no idea what that "TFR" that you're asking me about is, nor what I have to do with it?

winter rose
#

You could setBehaviour "CARELESS"? @grave lotus

grave lotus
#

Would that work in regard to only the two unit types declared in _protected?

#

ie careless to them, but not others

winter rose
#

not exactly. but if it is a zombie, it doesn't have a gun so you should move it with move commands?

grave lotus
#

the goal would be to have them aggro everyone other than those classes called out in the _protected array.

#

basically making those in the array invisible to the zeds

rustic plover
#

Please tell me a way to find out the list of all killed players by a certain player. Like that list on the debriefing window?

#

I wish there was some kind of vanilla solution. Without handlers

#

I think it's something at engine level, but if anyone knows a command or a variable, it would be cool.

young current
#

you may need to look up how the debrief dialog works in the configs

#

and where it pulls its info from

autumn nexus
#

im still having a hard time figuring out how to attach a trigger area to all objects of one type. I am trying to attach a trigger to all huron medical containers that would execute the ace heal function when a player is within 5 meters

winter rose
#

trigger would heal peeps even if helicopter is flying @autumn nexus

autumn nexus
#

i have it setup in all my missions in a 3x3x3 trigger that only heals folks within that trigger

#

the problem is in liberation, the containers are dynamic where you place them, not necessarily preplaced like in a normal mission @winter rose

mortal nacelle
#

@winter rose Do you know how I can get a variable to store only once? E.g. I am trying to generate a random string everytime someone joins the server, but the function generates an infinite number of strings per person. How would I get it to only generate one and then stop?

winter rose
#

call the function once? @mortal nacelle

#

See allMissionObjects, createTrigger and forEach @autumn nexus

brittle dock
#

Is it possible to make a script with "BIS_fnc_taskCreate" repeat itself to create more tasks but with different objectives depending on the code?

#

I'm wondering since I have no idea if you can duplicate the TaskID

#

I'm trying to make a script that spawns enemies dynamically, assign a task to destroy them, then have the script re-run when enemies are dead, creating a new task etc.

mortal nacelle
#

Hmm @winter rose is there not another way to just set it once?

#

As its in a loop

winter rose
#

forEach?

#

@brittle dock no duplication, but you can always generate a unique one

exotic flax
#
_var = player getVariable ["key", ""];
if (_var isEqualTo "") then {
    _var = "random_string";
    player setVariable ["key", _var];
};

Run this when a player joins and it will only run once.

#

PS. written on mobile so not tested πŸ˜‰

brittle dock
#

How do one make an "elseif" statement in SQF?
Just "else if"?

still forum
#

you don't, without special mods that you won't want to use

#

there is no else if in normal sqf

brittle dock
#

😐

exotic flax
#

if (1 > 0) then { "It's true" } else { "It's false" }; ???

#

but no elseif

#

best solution is using switch

still forum
#

I have elseif :D

if (1 > 0) then {}
elif (1 == 0) then {}
elif {1 < 0} then {} //lazy eval
else {"bonk"}

But I doubt I can pitch that to BI

I also have things like

_bool then {code}
getting rid of the if, not sure what use that really has tho πŸ˜„

exotic flax
#

adding more confusion to new scripters? 🀣

acoustic abyss
#

Heya everyone,
Pardon if I am in the wrong subchannel.
I would like to change the light intensity/brightness of editor objects (eg Land_Camping_Light_F ).
The setLightBrightness and setLightIntensity commands change only light sources, I think.
What scripting command changes the lighting on an object such as this?

exotic flax
#

for normal objects you need to modify the config to change the lights

fallow radish
#

I am looking for a script which will keep my ai group together, example if I decide to do halo jump out of a plane they will jump with me, or if i teleport to another area they will also teleport

#

would also be good if I could enable or disable this function in a menu scroll option

unique sundial
#

best solution is using switch no

#

@still forum what’s it like for performance? Can it beat call + multiple if exitWith

winter rose
#

not according to Code Optimisation

runic edge
#

hello, i got an idea but i dont know if it would work ! Can I put _myLocal = myEdenVar or myEdenVar2 in a sqf

#

to use _mylocal to call either myEdenVar or myEdenVar2

winter rose
#
private _myLocalVar = [globalVar1, globalVar2] select (alive player);
#

@runic edge

runic edge
#

Am i pushing it if i ask you to explain it ?

#

like select (alive player); ??

#

why isnt there a number after select ?

winter rose
#

[value1, value2] select false β†’ will select first value

[value1, value2] select true β†’ will select second value

cunning crown
#

because false and true are counted as 0 and 1 (for the select only)

runic edge
#

oh

#

ok

winter rose
#

β†’β†’β†’ for the select ←←← only ^^

runic edge
#

so your code will select the globalVar1 if the player is dead and globalVar2 if he s alive ?

winter rose
#

yep

runic edge
#

and the private allows you to add two variables in one new ?

winter rose
#

nope, private is to private your variable to this scope

runic edge
#

I'm reading it rn

#

I'm just not sure that i understand what "private your variable to this scope" means

#

like even in english

winter rose
runic edge
#

local variables in a script always has to started with an underscore
In functions you should additionally mark variables as private using the command private

that is weird ^^ but i got it now

still forum
#

@unique sundial

what’s it like for performance? Can it beat call + multiple if exitWith
didn't test.
only real special thing is that it creates a struct that stores if a condition already returned true.
all further elif/else/then are just ignored in that case, but still iterated over.
it should be close to call+exitwith.
I'll test quick

runic edge
#

the reason why private _myLocalVar = [globalVar1, globalVar2] select (alive player); is a fonction is because of the select ?

cunning crown
#

_myLocalVar will be whatever globalVar1 or globalVar2 are, if it's code, it will be code, same for number, string, ...

still forum
#

its not a function

runic edge
#

Not a function ?

#

So why do I need private ? It s written that i should add private if it s a function

#

Where am I missing something ?

cunning crown
#

It s written that i should add private if it s a function
Where do you see that?

still forum
#

you should generally add private to all new local variables you declare

#

to not overwrite any variables with the same name which were declared before yours

runic edge
#

In the variable wiki page bellow the first example

#

Ok so it also works for variables and not only functions ?

still forum
#

private is for variables

#

has NOTHING to do with functions

runic edge
#

Yeah but functions can uses variables right ?

winter rose
#

it is that if NOT used in a function, and you call this function, this call may override variables you set in your script

runic edge
#

Oh ok

#

So what dedmen is saying is that basically you don't know so just add private so you won't get screwed when _ is not enough ?

winter rose
#

yep

#

good practice, private private private

runic edge
#

Now this calls to another question

#

Why not define all variables as public

#

Be sure that they all have different names ?

still forum
#

if they really all have unique names, and you are sure your function will never be called more than once.
Then you can do that, though you'll pay a small performance penalty

runic edge
#

Pay performance penalty

#

Yeah sounds like arma

#

Unique names, I understand

#

But never be called more than one ?

still forum
#

well if your function is called twice, and they use the same variable names. they'll overwrite eachothers variables

runic edge
#

Ah ok got you

#

And that s the main reason there is private variables I guess

still forum
#

local variables yes

runic edge
#

Ok

#

Thanks for the explanations

still forum
#

@unique sundial

if (false) then {1}
elif {false} then {2}
elif {false} then {3}
elif {true} then {4}
else {5}

0.0839ms

call {
if (false) exitWith {1};
if (false) exitWith {2};
if (false) exitWith {3};
if (true) exitWith {4};
5
}

0.0553ms
soo.. not faster currently. Not sure if the perf hit is my fault and if I can fix it πŸ€”
Don't think I can make it much better.
Main problem is that i went the lazy-eval-by-default route, and thus all elseif conditions are code, which need to be called. I think thats the main impact.

#

lol, forget it. non-lazy eval works too πŸ˜„ Haven't touched this in too long.
but that just gets it todwn to 0.0735

unique sundial
#

If then else alone is a bit of a drag

still forum
#

just building the struct is already 0.0627ms
so thats where the perf problem is, I'll doctor around a little

still forum
#

maybe... testing performance with debugger and script profiler loaded doesn't make that much sense πŸ€”
call exitWith from above: 0.0069ms
elif from above 0.0078ms
I wonder if profiler or debugger is the one wrecking my perf..

hollow thistle
#

~10 times slower? that's a lot πŸ˜„

still forum
#

Well I have profiler on full blast, including engine profiling from testing stuff a few days ago :D

only debugger loaded gets them closer together to 0.0081ms and 0.0093ms πŸ˜„

#

profiler loaded on minimal mode
0.0287 for elif
0.0095 for call
why does it impact my stuff more than the call :U

#

profiler says median 7.88us for elif
median 7.87us for call.
The rest is profiler overhead :D
So.. according to profiler they are on-par :U
no idea who to trust now, but I guess TLDR, the perf difference is so small its negligible
So maybe its viable afterall πŸ€”

rustic plover
#

Smith Π’Ρ‡Π΅Ρ€Π°, Π² 22:28
Please tell me a way to find out the list of all killed players by a certain player. Like that list on the debriefing window?
I wish there was some kind of vanilla solution. Without handlers
I think it's something at engine level, but if anyone knows a command or a variable, it would be cool.

HorribleGoat Π’Ρ‡Π΅Ρ€Π°, Π² 22:36
you may need to look up how the debrief dialog works in the configs
and where it pulls its info from
I found a3\ui_f\scripts\GUI\RscDisplayDebriefing.sqf, but i can't see any code about kill list... Does someone know where is it?

still forum
#

I'd assume thats in engine

winter rose
#

^

still forum
#

yep, in engine

rustic plover
#

Is no way to get this list?

still forum
#

aside from recording it yourself, or reading the text out of the debriefing dialog, probably not

rustic plover
#

It’s sad. Thanks guys

compact maple
#

Hi. Is there a way to know if the mouse (cursor) is currently on a dialog ?

still forum
compact maple
#

thanks!

still forum
#

whether on a dialog.. uh..

compact maple
#

I guess there is a way to retrieve x and y position of a dialog ?

#

And his height, width ?

#

found it

tough abyss
young current
#

what vehicle is is?

tough abyss
#

cup datsun, there is enough space in the target vehicle

#

already tried with vanilla vehicles, same thing there, so the fault is likely mine and not ace's

hollow thistle
#

Why box1 as a string?

tough abyss
#

oh wait, that was me trying different stuff when it didnt work the first time, but same result with no " "

young current
#

is your box named box1 and vehicle named veh1

tough abyss
#

yup

#

changed vehicle lock to unlocked, no change either :/

tough abyss
#

apparently the box was standing ever so slightly too far away from the vehicle to be loaded, strangely enough adding a 'true' bool as third param doesn't change anyhting about that opposed to what's described in the wiki entry :I

#

thanks for taking your time guys

young current
#

was it just true or "true" you used?

tough abyss
#

true

#

maybe some other spelling error, now it works

#

nahh, Ive had the vehicle locked still when I tried adding the third param, vehicle has to be unlocked

eternal yoke
#

Does anyone have any idea why keybindings break when I add 219 into the keybinding (Left windows key). Using a switch then case xx: { //code}; but everytime I add 219 it all breaks and no errors at all. Read the code many times over again and there are no issues with the code. Is there something special I need to do with left windows key?

coarse schooner
#

idk but you could go through the ace framework on github and look at how they did it

#

they probably use CBA things actually

still forum
#

they fo

rustic plover
#

aside from recording it yourself, or reading the text out of the debriefing dialog, probably not
Can developers add into game some command which can show all killed objects by player?
Like killedUnitsBy OBJECT

still forum
#

could probably, but... No don't think so

#

that killed recording system thingy is probably not usable enough for such a general command

#

and if you want that, you can just record that data by yourself already

rustic plover
#

Do you think anyone can to make system kill recording better than game developers? :)

still forum
#

yes...

#

addEventhandler is not very hard

rustic plover
#

Ok :)

vernal mural
#

quick question there, I have a custom Eden attribute defined that way :

class GSRI_frigate_attribute_addWeapons {
                displayName="$STR_GSRI_frigate_addWeaponsTitle";
                tooltip="$STR_GSRI_frigate_addWeaponsTooltip";
                property="GSRI_frigate_addWeaponsProperty";
                control="Checkbox";
                expression="_this setVariable ['toto',_value,true]";
                defaultValue="true";
            };

It works just fine in Eden, as the checkbox is properly displayed with the correct name, tooltip and default value. Similarly, displaying the IG config viewer shows that the attribute is correctly added. However, when I run the mission, there is no variable "toto" in the object's namespace. I'm probably missing something very obvious but I can't put my finger on it. Any idea ?

#

Also as my config is properly interpreted I think it's more a scripting issue, but I can move this question to #arma3_config if needed

coarse schooner
grave lotus
#

Is it possible to attachto objects so that they stay locked together in relative posistion if the source object is moved? The stuff on my table needs to move along with table πŸ™‚

young current
#

depends how the things are moved

#

attachTo is not very good for that kind of stuff

#

its pretty basic

grave lotus
#

is there a better function to use?

young current
#

what is it exactly what youre trying to do?

#

and for attaching things, not really

grave lotus
#

I have a moveable table and need the laptop on it to remain connected when the table is moved. right now it stays if table gets translated

#

somehow I need to lock them together as a single entity

exotic flax
#

attachTo will simply attach an object to another, making them unusable, but will stick when the base object is moved.

However there are objects which don't properly work (could be due to missing memory points)

rustic plover
#

@coarse schooner thanks, but I wanna integrate it with ACE spectator. I don't need a kill feed. I have written own script already

grave lotus
#

ill test some more. the 'table' i used was one of the rugged generators... makes sense that it might not have a memory point. ill try a table and see if that helps.

exotic flax
#

it's usually the case with smaller objects, so it could also be the laptop πŸ˜‰

grave lotus
#

when googling for a solution I came across feature requests for grouping objects πŸ™‚ That would be nice πŸ™‚

young current
#

@grave lotus how are you moving the object?

grave lotus
#

I'll need to check how antistasi is handling the HQ object addaction for move. That may be the key.

#

Thanks for that πŸ™‚

exotic tinsel
#

what command is used when a player hits abort on a multiplayer server? im trying to duplicate that effect and i dont want to use endmission or failmission or forceEnd. they dont have the same effect.
i just want to send them back to the lobby.

exotic flax
#

As far as I know (and can find) there's no function which you can simply call to send someone back to the lobby.

restive leaf
#

player setdamage 1?

winter rose
#

maybe with some UI button click

exotic flax
#

I know that KK has a script on his blog which automatically lets the player exit the server completely (and then login on a new server).

exotic tinsel
#

when the player aborts they just see screen with task status. but when you end the mission for them they get a success or fail message and they can navigate to the tasks status screen. how do i get them to task status screen with out the success or fail message and music?

#

or drop a link to point me in the right direction

exotic flax
exotic tinsel
#

rgr, thx mate @exotic flax ill dig in to it

eager prawn
#

Does anyone know of a way to remove grass within a certain area, without using multiple of the pre-included grass cutters to cover it?

#

I have over 10,000 grass cutters in my mission to remove grass in a specific area, and the grass cutter objects seem to be causing a large frame drop (having tested the mission a couple times both with and without grass cutters)

#

It would be easier to set a script to remove all grass within a certain radius, or perhaps within the region of a trigger

exotic flax
#

disable grass completely or make a bigger grass cutter object

eager prawn
#

How could I make a bigger grass cutter object?

#

That's essentially what I'm wondering

exotic tinsel
#

think you can use hide terrain objects in an area of type

eager prawn
#

can you? I could have sworn I tested that

exotic flax
#

grass are not regular objects, but clutter embedded in the terrain

eager prawn
#

Doesn't look like hideObject removes grass

#

(Like Grez said, grass isn't objects)

winter rose
#

@eager prawn create simple objects for grass cutter, will save you tons of perf

eager prawn
#

I have all my grass cutters set as simple objects

exotic flax
#

in short; the ClutterCutter object is a flat plane without textures

eager prawn
#

Still causes a frame drop apparently

still forum
#

@eager prawn can you remind me in about 10 hours? I can probably figure out a bigger grass cutter for you. But might be limited to 50x50m

eager prawn
#

@still forum that'd be great, thanks. Will try to remember πŸ™‚

winter rose
#

obj side limit is 50m?

still forum
#

No. Not really. I don't know how they work, so I don't know what limits there are

#

But 50x50 is minimum that I know should be possible

exotic tinsel
exotic flax
#

The returned surface type is a config name used in the terrain (so the list on that page might might be different on non-vanilla terrains)

#

you can't change the terrain with a simple function

exotic tinsel
#

rgr

#

@eager prawn are you trying to hide all grass? or just in a large area?

eager prawn
#

large area

exotic tinsel
#

what about a loop that says if in area then set player setTerrainGrid x.

#

on all players

#

nvm im dumb

young current
#

10000 objects means youre doing it wrong

#

youll need to make a new terrain if you want that big changes

exotic flax
#

actually... setTerrainGrid might work, although it will look terrible

young current
#

true on both accounts

eager prawn
#

I mean, it works

#

And I'd rather not remake the terrain

young current
#

that massive edits are as far as I know not meant for scenarios

eager prawn
#

I've got 40,000-ish objects total

young current
#

as you have noticed the amount of objects starts to bog it down

eager prawn
#

Yup

young current
#

yea that is a lot

eager prawn
#

Indeed it is

#

That said, it's the easier path to go down compared to making a whole new terrain just to get rid of grass

young current
#

Β―_(ツ)_/Β―

#

unless it makes you lose 20fps

#

how big are the grass cutter objects you have now?

eager prawn
#

the largest ones provided by CUP

young current
#

πŸ˜›

#

no idea how big those are

eager prawn
#

Off the top of my head, seems like maybe a couple meters across

young current
#

ah

exotic flax
#

10x10 if I'm correct

eager prawn
#

10x10 meters?

young current
#

well definitely would be good idea to get yourself bigger ones

#

50x50 at least

#

larger ones might work too

eager prawn
#

If it's 10x10, I definitely don't judge size right in Eden πŸ˜†

#

But yeah, mainly doing it for the airfields

young current
#

would cut few thousand right off the bat

eager prawn
#

Oh easily

#

50x50 would cut off probably 90% of them

#

I got this far by doing packs of 100 grass cutters in a square

#

and then copy pasting them across the area

young current
#

πŸ™ˆ

eager prawn
#

yea

winter rose
#

tb?

patent estuary
winter rose
#

@sonic linden delete dis πŸ”«

grave lotus
#

I'm implementing a killfeed and attempting currently, from addMPEventHandler I'm pulling 'name' and 'distance' from 'killed' - I don't see in the wiki what else I can pull from the eventhandler for meta data. I'd rather use a unit type than the specific unit name. Is there a list of the retuns that I've missed?

cunning crown
#

MpKilled passes the Killer Object as the 2nd argument, you should be able to get all info with that

grave lotus
#

if I say the actual 'typeOf' - that should return the next tier up from name, correct?

winter rose
#

didn't get that?

exotic flax
#

typeOf will return the class name of the object.
If you want to know what kind it is, or if it's inherited from something, you should use isKindOf

winter rose
#

I feigned ignorance so you would type for me!

opal mulch
#

funny! I'm looking into reducing the amount of grass cutters, like Hawkins. I'm planning on using Land_ClutterCutter_large_F and my research is not over. I look forward to seeing Dedmen's response!

still forum
#

AH! Grass cutters

#

noone reminded me

opal mulch
#

oops

still forum
#

thanks for the classnames, makes my work faster

opal mulch
#

you're welcome!

still forum
#

Take a second to appreciate the name "ClutterCutter"

opal mulch
#

this is what I gathered from a google search, this is from 2013:

//null=[objectname,86,45] execvm "cutter.sqf"

_trig = this select 0; 
_xpos = this select 1; 
_ypos = this select 2; 
_start = getpos _trig;

waitUntil {not(isNil "BIS_fnc_init")}; 

for "_x" from -_xpos to  _xpos step 4 do { 
  for "_i" from -_ypos to _ypos step 4 do { 
    _newpos = [ (_start select 0) + _x, (_start select 1) + _i, 0];

    if ( [_trig, _newpos] call BIS_fnc_inTrigger) then {
      null = createVehicle ["Land_ClutterCutter_large_F", 
                 _newpos, [], 0, "can_collide"]; 
    }; 
  }; 
};
still forum
#

omfg, that's actually terribly simple

#

and yes that 50x50 limit that I mentioned is a thing

#

I can make square 50x50m p3d

#

but first need to finish my food

grave lotus
#

Copy that. thanks!

still forum
#

the large one seems to be 10m circle
5m radius

young current
#

πŸ‘Œ

still forum
#

thats atleast the recommended roadway lod limit, maybe bigger works too not sure

opal mulch
#

cool!

vale panther
#

Ok so there is a common thing that I want to be able to do and that is lock down the AI with a bipoded weapon to say like hold down a street. Now I have tried different commands and look at this extensively and csnt find anything on it. So can anyone help?

winter rose
#

doStop myUnit ? @vale panther

vale panther
#

@winter rose the thing I'm really looking for is would tjat deploy their bipod and say shoot 'more actuality' (sorry if miss spelling) I do not know if that is even possible.

winter rose
#

(accurate?)

you can't deploy AI's bipod afaik

arctic quest
#

disallow the player from opening/closing the ramp on the blackfish. how would i do that?

eager prawn
#

@still forum thanks! So just copy the vanilla cluttercutter config, replace the p3d file, and PBO it? Or are you saying actually include this in the mission directory and spawn it?

#

I haven't used createSimpleObject before (outside of the "simple object" tickbox in Eden)

still forum
#

uh.. yeah you could... do a config replace

#

if you wanted to

#

Or are you saying actually include this in the mission directory and spawn it?
that was my idea, but yours would work too

restive leaf
#

Isn't there a problem with p3ds in mission files atm. Or am I misremembering a conversation here

#

For CreateSimpleObject

still forum
#

with sig verrif yes

restive leaf
#

Ah yes, that was it

cold mica
#

I have returned with a new problem. I have several units with the following in their init:
First Unit Init
unit setVariable ["B11_loadout_00", getUnitLoadout unit];
Second Unit Init
unit setVariable ["B11_loadout_01", getUnitLoadout unit];
Third Unit Init
unit setVariable ["B11_loadout_02", getUnitLoadout unit];

The issue: I want every unit to respawn with their appropriate loadout. However, I am not sure how to do this. All I know is I have to use below in onPlayerRespawn.sqf
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

still forum
#

Well your onrespawn looks correct

#

But in your code above you set a variable with a different name

#

Seems like it should be same name?

cold mica
#

It should be different. I saved different loadouts on different variables.

still forum
#

No.. according to what I'm seeing. It should be the same

#

Try using the same. And then be amazed that it's working somewhat. (Should use local check.. but whatevs)

cold mica
#

πŸ€” I shall attempt your suggestion

restive leaf
#

Whatevs?

runic edge
#

Evening guys what's up ?
I m looking at the format page on the wiki and I can't understand the %1 (or any number) !
Is it how you're supposed to call a variable ?

winter rose
#

%1 (and %2, %3 etc) means "take the first argument of the following arguments"

#
format ["%1, %2, %3, %1!", 'A', 3, player];
// returns "A, 3, Hhaine, A!"
runic edge
#

Mhhh ok but then why not use select 0

winter rose
#

…?

runic edge
#

Like I m basically selecting values in an array right ?

winter rose
#

it's faster to format than do ```sqf
hint ('A' + ', ' + str 3 + ', ' + str player + ', ' + 'A' + '!');

#

so yeah, it's element 1, element 2, etc

#

it helps a lot for translations, for example

#
// Stringtable.csv
STR_Hello,Hello %1!,Bonjour %1 !,
``````sqf
hint format [localize "STR_Hello", name player];
restive leaf
#

English only please Lou!

runic edge
#

Okkkk then you store it in an other file and can easily call whatever language you want

winter rose
#

language + parameter yes

runic edge
#

Makes sens !

#

Thank you

restive leaf
#

stringtable.xml normally for languages

winter rose
#

yep (both are still supported in A3)

restive leaf
#

Sorry, missed your csv reference... but going forward the xml format is probably better and more easily read

cold mica
#

I have gotten something wrong, Dedmen. The unit respawns with his original unit's loadout rather than the one in "Saved_Loadout"

still forum
#

U sure on respawn is running? Tried adding a diag log?

#

Made sure that saved loadout is not actually the same as "original loadout"?

cold mica
#

I suspect that it is. I'm testing it out rn

still forum
#

Your code sets the loadout in init, which is what I understand as "original loadout" the one that it spawned with

cold mica
#

onRespawn indeed does get executed. Now I just have to test out if "Saved_Loadout" has the correct items. Is there a way to "print" the contents of a variable?

lost copper
#
print format ["My var: %1", your_var];

For diag_log use:

diag_log your_var;
//or
diag_log format ["My var: %1", your_var];
cold mica
#

Thank you very much, time to delve deeper into these shenanigans of mine.

tame lion
#

Is there any way to determin if a vehicle is safe to spawn at a position before actually using createVehicle?

#

I'm making a feature to choose to spawn planes in random hangars around base, but some of the plane options are bigger than the hangars, and I'd like to not have to write specific exceptions

astral dawn
#

Well I use bounding box and lineIntersects-kind-of-commands for that

#

I guess that would be your choice too

tame lion
#

I figured as much, never used them before so they are a little intimidating to me

astral dawn
#

Although biggest drawback is that bounding boxes are all weird in this game

#

Some are extremely big for some units

restive leaf
#

You could just specify an array of aircraft that do fit and do a selectRandom of those alone

cold mica
#

Alright, after some messing around, I have found out that
unit setVariable ["Saved_Loadout", getUnitLoadout unit];
is not working out well for me.

When I run
diag_log (unit getVariable "Saved_Loadout");
and check RPT, it returns Nothing. This means that I am not setting the variable properly. Where am I doing this wrong?

exotic flax
#

what is unit?

#

is it a local variable? is it a global variable? is it the name of an unit?

cold mica
#

I placed it withit the init of a unit, thus I would assume it is the unit itself.

exotic flax
#

you need to use this

astral dawn
#

It is wrong to assume this. With SQF and Arma it's better never to assume.

cold mica
#

now i realize I should have used this, huh?

#

yeah

#

Thank you, I'll try it out with this

cold mica
#

I have used this in place of unit. It works nearly flawlessly. Now the only issue l have is the following error:

Error in expression <>
  Error position: <>
  Error Local variable in global space

Does anyone know what this error means?

astral dawn
#

What are you doing then?

cold mica
#

This occurs right after respawn.

astral dawn
#

I understand that you run this in the init field: this setVariable ["Saved_Loadout", getUnitLoadout this];, right? But you are also running the logging part?

cold mica
#

The diag_log part?

astral dawn
#

yeah

cold mica
#

I removed it after my first Error in expression After a few restarts of the mission, the error still appears

astral dawn
#

So your diag_log is in the init field as well or where?

#

Can you just show full code please?

cold mica
#

I will show you the full code momentarily.

#

_test <-- This is the name of the unit
init

this setVariable ["Saved_Loadout", getUnitLoadout this];

onPlayerRespawn.sqf

systemChat "Loading Loadout...";
removeAllWeapons player;
removeGoggles player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;

player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
systemChat "Loadout Set!";
astral dawn
#

_test <-- This is the name of the unit
Okay you have your answer then

#

In SQF there is a convention that local variable names start with _

#

When arma reads unit's name field, it sets _test to unit's object handle in missionNamespace. missionNamespace is where arma has non-local variables.

#

And non-local variables don't start with _

#

just rename _test to testUnit or anything

cold mica
#

Understood, I removed the variable name of the unit.

restive leaf
#

Is sqf _thisreally sqf thisin your script, cause it should be the former

cold mica
#

It's inside the init of a unit so I believe it should be this instead of _this, no?

restive leaf
#

No

#

Magic variable

cold mica
#

Well, however it is meant to be, it works with this just fine.

restive leaf
#

Oops... you are correct too and I had my second brain fart today 😭

cold mica
#

(Removing _test fixed the error, btw, thank you Sparker)

brave jungle
#

using selectRandom in a config to get a new image each time, excpet it's the same 3 images out of 7 every time

#

any suggestions on getting more random results

#

__EVAL(selectRandom BACKGROUND_IMAGE);

still forum
#

which config? mod config or description.ext?

brave jungle
#

Mod

still forum
#

you get 3 random images though?

#

but just always one of the 3

#

so the selectrandom is working somewhat?

brave jungle
#

Yeah

#

ye

#

Hol up i'll tell you which, might be a pattern

still forum
#

maybe you're just unlucky with randomness

brave jungle
#

the same with my loading screens (same system) yikers

#

nevermind it's 2 images only

#

2 and 6

#

out of 8

#

every time

#

one or the other

brave jungle
#

can you use functions in a mod config using __EVAL or __EXEC?

cunning crown
#

Probably not, functions are loaded way after the config

brave jungle
#

Thought as much

still forum
#

in a description.ext you can use mod functions defined at preStart in ui/profile Namespace

brave jungle
#

hmm, not sure what else to do about this randomization problem then

still forum
#

depends when the config entry is read, i can imagine loading screen being read after prestart

cunning crown
#

From what I remember of my previous tests it's shown after prestart yeah

tame stream
#

Is there a link anywhere here for the latest AllInOne config

still forum
#

on the BIF forum thread that has all of them

tame stream
#

thx

fleet hazel
#

Guys. How to find out the fps server?

winter rose
#

the server's FPS? @fleet hazel

fleet hazel
#

Yes

#

Server FPS

winter rose
fleet hazel
#

thn

twin steppe
#

Don't know if this should be on scripting or editor_arma3 but I'll try here.

#

I recently tried to export an SQF from a mission I made in the editor but unfortunately it doesn't seem to work. A friend of mine helped me find the issue, a layer that wasn't completed, but the modules in the SQF still don't seem to work. Any idea why that is? Can modules simply not be saved with this process?

#
if (_layer16458) then {
    _item19042 = (group (missionNamespace getvariable ["BIS_functions_mainscope",objnull])) createUnit ["ModuleEffectsPlankton_F",[15231.5,14137.4,68.792],[],0,"CAN_COLLIDE"];
    _this = _item19042;
    _logics pushback _this;
    _logicIDs pushback 19042;
    _this setPosWorld [15231.5,14137.4,0.000335693];
    _this setVectorDirAndUp [[0,1,0],[0,0,1]];
    _this setvariable ["BIS_fnc_initModules_disableAutoActivation",true];
};```
#

This is one of the modules.

cunning crown
#

What do you mean by "still doesn't work"?

still forum
#

modules should be saveable

twin steppe
#

Can anyone guide me to a tutorial of sorts? Honestly I have no idea what I'm doing and these modules won't show up...

#

@cunning crown The modules don't actually appear after I executed the SQF in the debug console. Everything else does though.

cunning crown
#

From to wiki:

Of you want to place a module withΒ createUnit, you have to ensure that the module gets activated automatically by settingΒ BIS_fnc_initModules_disableAutoActivationΒ toΒ false,Β e.g:

twin steppe
#
};```
#

So I should change this, correct?

cunning crown
#

Yeah

twin steppe
#

Awesome. Appreciate the help I'll try it out now.

#

Ah shit. Still doesn't seem to want to show up haha.

cunning crown
#

Also, I don't know if BIS_functions_mainscope is the right thing

twin steppe
#

So that should be changed as well?

#
///////////////////////////////////////////////////////////////////////////////////////////
// Module activations (only once everything is spawned and connected)
if !(isNull _item18813) then {_item18813 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19042) then {_item19042 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19066) then {_item19066 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19067) then {_item19067 setvariable ["BIS_fnc_initModules_activate",true];};
#

Found this further down.

#

I'll see if I change these it will work.

#

Nothing.

still forum
#

I don't know if BIS_functions_mainscope is the right thing
it is

twin steppe
#

I wish I could post the entire thing here with pastebin but it's so big I'd need pro lol

#

Here is the "Logic" section of the SQF where all the modules are though.

vocal spade
#

Sorry to derail but is there a way to determine I am inside the briefing map at the beginning of a mission through code?

still forum
vocal spade
#

Oh! Thanks a lot

twin steppe
#

Bump

winter rose
#

*Boop* your nose

twin steppe
#

😎

worn forge
#

Hi folks, is anyone aware the mechanics for how Arma calculates score? That is to say - it seems to keep track of how many infantry and air/ground vehicles a player has destroyed, and I would like to access that information...

winter rose
#

no can do, but you can build that array yourself with event handlers

worn forge
#

I have done, but it is not accurate. I have a "killed" eventhandler on vehicles, and a player will kill the vehicle, but not receive the appropriate credit for it.

winter rose
#

Β―_(ツ)_/Β―

worn forge
#

ikr

winter rose
#

but nope, no direct access.

worn forge
#

stupid arma is stupid

winter rose
#

no u πŸ˜›

worn forge
#

πŸ™‚

queen cargo
#

What do you mean with not getting credit for it?

#

Attach "MPKilled" to all vehicles and units, add to some array serverside and publicVariable it on changes (most simple setup)

#

a spawned endless loop then can keep some ui updated all the time (with sleep 5 or something among those regions, only needs spawn, sleep, while do and ctrlSetText)

ivory lake
#

mods can/will affect it too

#

especially if they make no attempt to have the game think the person responsible is the one who killed it and just for example, setdamage 1 them

winter rose
#

affect* (verb) vs effect (noun) plz

ivory lake
#

boo its 2 am

#

my grammar is asleep

worn forge
#

Well that's my next avenue, if "Killed" eh is unreliable, I'll have to rely on MPKilled or MPHit, although it's trickier because in MP eventhandlers the code is run on every machine... so I think you have to limit it with if (owner _unit == clientOwner)

ivory lake
#

if killed is unreliable MPkilled is too

worn forge
#

That's my fear. But yet arma score tracking keeps a perfectly accurate record

ivory lake
#

Wait, i thought you said the issue was it wasn't keeping score?

worn forge
#

Oh no, game keeps score fine, if you bring up the score table it's accurate. In a perfect world I would like to find those results in whatever variable arma is using and use that information instead of creating my own variable

ivory lake
#

so whats the issue then? are you saying that even though the person who killed the vehcile receives score for it, in the killed eventhandler it doesn't return them?

worn forge
#

Yep. Player will kill a vehicle (not just mobility kill - it will be destroyed) and the code in the "Killed" EH won't fire, and yet the score table will show them having killed a vehicle

ivory lake
#

I might also suggest this if the numbers are what you're looking for

fervent kettle
#

looking for a script to create a green, toxic looking mist effect for a small area and if possible green puddles too, internet wasnt very helpful yet

worn forge
#

handleScore doesn't tell me what was killed, just the score amount, so I can't work backwards to know what happened

#

But thanks

ivory lake
#

are you running anything like ace?

worn forge
#

nope, vanilla

ivory lake
#

Oh your eventhandler doesnt even fire I missed that part

#

how are you adding it

worn forge
#

The server adds it when the unit gets spawned

ivory lake
#

well the eventhandler is local so if you're expecting the client to see it that's probably your issue, if you're doing it from the server using MPKilled instead is a better option probably

worn forge
#

I'll try it that way, see if it works

#

Thanks for thoughts and advice, peeps.

fervent kettle
#

just found out that alias had a script but it only comes with white fog, hopefully i can change the color somehwhere

ivory lake
#

yeah changing the colour should be 'easy' as far as particle editing goes

#

'''''''easy''''''''

#

green puddles might be a lot harder - there's pond objects in stuff like cup terrains but i dont know how well it goes with spawning them and I don't think it'd be easy to change their colour

fervent kettle
#

its not necesary tho, i`d be happy if i had the green mist xD

austere granite
#

Does attachTo not work for simple objects?

#

Additionally is there a reliable way to attachTo the center of an object? boundingCenter seems to be incorrect

winter rose
#

what about… trying (crazy, I know)

πŸ˜„

austere granite
#

The reason i'm asking.... is because i'm trying and although it attaches properly, it doesn't follow position when moving the target object

winter rose
#

then I suppose the attachTo "places" it, but then simulation doesn't follow (given it is disabled)

vernal mural
#

@austere granite if you are moving your object with setPos* then the attached object will always stay still, with or without simple objects

jade abyss
#

AdantehToday at 6:16 PM
The reason i'm asking.... is because i'm trying and although it attaches properly, it doesn't follow position when moving the target object
No PhysX, no updating of attached Objects :sad:

#

I just found that out, a couple days ago
Constantly spam attachTo, while moving the Object @austere granite

rain spear
#

So I would like to make AI do the custom walk animations but when they do it, using Polpox's artwork supporter, they don't move anywhere, just walk in place. How do I fix this?

austere granite
#

eh, guess I'll just have to do a attachTo on my object i want to "attach" instead. Any idea on the other question Dscha?

jade abyss
#

wich one?

#

center of Obj?

#

erm πŸ€”

#

good q πŸ€”

#

tbh, no. Not rly

austere granite
#

Additionally is there a reliable way to attachTo the center of an object? boundingCenter seems to be incorrect Basically for my mod right now im using drawLine3D, but switching over to a animated model instead

jade abyss
#

BoundingBox would be the way to go, tho

#

But as you mentioned... not rly reliable

austere granite
#

x and y are fine, but the height seems wrong. Also tried offseting with boundingCenter and stuff like that, but can't seem to figure it out

jade abyss
#

And using the bottom, instead of Center?

#

boundingBox, lowest Z coords should be the same with normal model

austere granite
#

you mean bb select 1 select 2 right? yeh thats not it either

#
    (boundingBoxReal _object) params ["_p1", "_p2"];
    _height = (_p2 select 2)-(_p1 select 2);
    _p1 = _p1 vectorAdd _bb_center;
    _p2 = _p2 vectorAdd _bb_center;
    _box attachTo [_object, [0, 0, ((_p2 select 2) - (_p1 select 2)) - _height]];

this seems correct

jade abyss
#

Yeah

#

wait

#
_height = (_p2 select 2)-(_p1 select 2);
((_p2 select 2) - (_p1 select 2)) - _height```
????
austere granite
#

var is replaced in between, just only dropped the lines that matter here

jade abyss
#

Yeah, confuz0rd me.

austere granite
#

ehhhhhhhhhhhhhhhh.... its different for terrain objects, 10/10

jade abyss
#

πŸ˜‚

austere granite
#

_box setPosASL (AGLtoASL (_object modelToWorld [0, 0, _attach_height])); with the same works, and I guess i need to do it in a loop anyway, woohoooooooo

real mango
#

Hi guys πŸ‘‹
I was wondering if you have any idea how to exclude the "XXX was killed by YYY" message from the chat.
I know I could achieve this via difficulty settings but I want to be able to override those, anyone knows if it's even possible?
|| I looked into hiding the chat altogether before realizing that I'm actually going to need it 😏 BIG BRAAAAIIINNN ||

austere granite
#

only possible through difficulty setting

#

you can't edit any of those system messages

runic edge
#

Hello there,
Is there a command to create an intel as createDiaryRecord does for the diary

winter rose
#

create an intel?

runic edge
#

As explained in the link provided by tankbuster, a entry that players can get with an addaction !
It's just a question out of curiosity !

#

The one I think of may come frome Achilles though

#

@finite sail can the function you provided in a standart script ?

finite sail
#

I'm struggling a little with your english, mate. I've never used the function, but it seems that it places an addaction on an object with when used by the player can create a diaryentry

runic edge
#

Can I use it in anyname.sqf ?

finite sail
#

yes

runic edge
#

Ok will try this then ;)

finite sail
#

if youre in a multiplayer environment, you need to run it on the server

#

but i would check to see how that locality os going to work if you're using an adaction

#

as addaction is a local. don't know how this function handles the creation of the addaction in MP

runic edge
#

Mhh I 'll experience localities for the first time then ! Thanks for helping :)

finite sail
#

hehe good luck

#

my motto is, if the script doesnt work and it isnt a typo, it's always locality that's breaking it

#

BTW, please let me know how you get on, I'm planning to use this system myself soon too

#

ooooo wow, blue screen of death.. it's like i'm 20 again

#

good job i haven't just spent best part of a grand on a new pc

#

oh.... wait

winter rose
still forum
#

@astral dawn

At dedicated server I also cheat a bit, and use startLoadingScreen (which increases scheduler limit from 3ms to 50ms) for a while if the queue of threads gets too big.
have you tested that? afaik startLoadingScreen just does nothing on dedicated

runic edge
#

If I have a variable var that is a number str(myvar) returns my variable as a string.
Is there a similar command to input a string and that returns a number ?

still forum
#

parseSimpleArray

exotic flax
still forum
#

or that πŸ˜„

runic edge
#

Ok will try ! Thanks to both of you !

astral dawn
#

@still forum
have you tested that? afaik startLoadingScreen just does nothing on dedicated
Yeah it boosts it to 50ms per frame on dedicated server too, I tested it with a custom script

rustic plover
#

I run game w/ -filePatching, but cannot rebuild my PBOs by MakePBO, it say 'Permission denied'. Did I something wrong?

exotic flax
#

Did you close the game? Otherwise the files are locked since Arma is using them

rustic plover
#

I enabled -filePatching for not doing it

File Patching allows you to change the files in an addon while the game is running, requiring only a restart of the mission. This makes it great for debugging, as it cuts down the time required between tests. Note that this only works with PBOs created using MakePBO, which build.py uses.
It's from ACE wiki

exotic flax
#

It allows you to work on mods without making a pbo first.

Allow the game to load unpacked data.

At least that's how I use it

rustic plover
#

I cannot to run the game without PBO from the official launcher... How are you do it?

exotic flax
#

I have both the pbo and files from the pbo together

still forum
#

you cannot replace pbo's

#

filepatching loads files from game directory in an unpacked state, if they are there

#

so youd want a Arma 3/z/ace/addons/common/XEH_preInit.sqf for example

exotic flax
#

For me it looks like this:

/mods/@my_mod/addons/something.pbo
/mods/@my_mod/addons/something/files
rustic plover
#

okay, thanks

mortal nacelle
#

What is faster, putting code directly into the mission box or having it in a script elsewhere and calling it from the missionbox?

exotic flax
#

mission box?

crude needle
#

Did nameSpace setVariable ["myVar",true,2] ever work in single and multiplayer (server) or am I misremembering?

hollow gate
#

Hello I feel quite stupid as I must be doing something wrong.
I am trying to get the AI to fire at a position on a script while he is in a machine gun turret.

null = {gunner1 dotarget wreck2; sleep 0.5; while {!alive wreck2 and alive gunner1} do {sleep 4; gl action ["doFire",vehicle gunner1,gunner1,0]; }};

No errors or anything but he just stands there doing nothing in the turret.

slim oyster
#

is the wreck vehicle alive?

hollow gate
#

no

#

its an wreck object

slim oyster
#

why does that need to be a condition?

#

to have it not be alive?

hollow gate
#

i suppose it doesnt have to

#

maybe thats whats screwing it up

slim oyster
#
    gunner1 dotarget wreck2; 
    sleep 0.5; 
    while {!(isNull wreck2) && {alive gunner1}} do {
        sleep 4; 
        gl fireAtTarget [wreck2, currentWeapon gl];
    };
};```
#

where are you executing this?

hollow gate
#

for now in the debug console to test

#

the end goal was to have it on an addaction and call it as a script

#

so that I could have multiple men shooting weapons at targets and turn them off again

slim oyster
#

as a script from an addaction you won't need to have a spawn in there, it will run unscheduled already

hollow gate
#

so as an sqf it should look like this?

 gunner1 dotarget wreck2; 
    sleep 0.5; 
    while {!(isNull wreck2) && {alive gunner1}} do {
        sleep 4; 
        gl fireAtTarget [wreck2, currentWeapon gl];
    };
};
slim oyster
#
sleep 0.5; 
while {!(isNull wreck2) && {alive gunner1}} do {
    sleep 4; 
    gl fireAtTarget [wreck2, currentWeapon gl];
};```
#

could try using the doSuppressiveFire command as well

#

revealing wreck to gunner, etc

hollow gate
#

no error so far using your last one wait out

#

arma takes a while to load πŸ˜›

#

huh no errors but he still just sits there

#

wonder if its a line of sight issue? is that a possibility

#

sadly thats not the issue and the doSuppressiveFire did not seem to work

#

I just need him to shoot straight ahead lol

#

hey I got it to work! @slim oyster

#

i placed an invisible unit and he fired at it! πŸ˜„ πŸ˜„ THANK YOU now I just need to make it so it can turn off and and give my unit unlimited ammo and im good, thank you again

#

oh there is a minor issue

#

they stop firing, and both have unlimited ammo or so they should as I putsqf this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] in the init of each unit and the vehicle (the machinegun turret) to be safe

#

so they stop supressing

#

is there a way to make it so the script loops?

hollow gate
#

wtf I had it and then is suddenly stopped working

jade abyss
#

make it 2

#

The Eventhandler should also fire all the time that unit shoots, as long as it doesn't change locality.

drifting copper
#

I am using MacRaes sitting script. Have some chairs down on the carrier though when you use the action it drops you into a sitting pose 5 meters below deck into the water instead of the chair position.

Has anyone found a fix for this? I tried setting a solid object underneath the chairs and also tried setting the axis

young current
#

The script probably uses wrong height