#arma3_scripting

1 messages ยท Page 285 of 1

royal abyss
#

@meager granite How about a script that gets triggert on that "heals" all the fences and walls ?

dusk sage
#

You could repair everything if you wanted to ๐Ÿ˜›

#

Might be slightly odd if you drove over a fence and it repaired into your car though

royal abyss
#

with a sleep of ~30 minutes?

#

would be pretty odd if someone has the bad luck to drive there and it pops back up lol

#

the problem is i want to use the military fences but dont want people to just drive over them i made holes in there to drive in....

meager granite
#

Can you repair destroyed fence?

#

Maybe hideObjectGlobal it and createSimpleObject\createVehicle a new one though

hollow lantern
open tendon
#

anyone ever used ace_slideshow_fnc_createSlideshow ?

tough abyss
#

Really strange, all working ok with checkVisibility functions and now i noticed i'm using ATL position on it... โš 

ionic orchid
#

anyone know if there's a workaround for RscObjects loading with no textures half of the time?

tough abyss
#

performance wise what would be the best way to check if a player is inside a rectangle?

jade abyss
tough abyss
#

Yep ended up using that

jade abyss
#

There is no other (native) alternative i know from.

tough abyss
#

Well I know of a math formula but shit was too long

jade abyss
#

+i guess it would be the same.

cerulean whale
#

Just wondering, is there a command to get the size of an area?

night frigate
cerulean whale
#

Ye, I haven't tested it on areas though. Was just curious

tough abyss
#

How to make an air explosion?

#

I'm using that:

#
_bomb = createVehicle ["Bo_GBU12_LGB_MI10",getPosATL _agnt,[],0,"CAN_COLLIDE"];
_bomb setDamage 2;```
#

But the bomb don't explode.

#

The bomb is spawned in air, this is why i can't trow it on the ground to make it explode.

#

I want it to explode in air.

#

Any help is apreciated.

tough abyss
#

@tough abyss spawn it with createvehicle?

#

I remember this explosion, sadly its too small? ๐Ÿ˜ฆ

#

The situation: if a chooper shot a zomibe, the zombie jumps in the direction of the chooper and explodes

#

explode in air

little eagle
#

_bomb setDamage 2;

#

For when 1 is not enough

tough abyss
#

@little eagle already tried that, don't work even with 2.

little eagle
#

lol of course not. 2 is just wrong

tough abyss
#

at least for "Bo_GBU12_LGB_MI10"

#

With 1 also don't work

jade abyss
#

_bomb setDamage 2; <- lulz ๐Ÿ˜„

#

I mean, it sets it back to 1, but, lulz ๐Ÿ˜„

tough abyss
#

Holly chit.

little eagle
#

Ammo only explodes when it's destroyed if it has this config entry:

#

triggerWhenDestroyed=1;

#

Isn't the case for most ammo and it is not for the GBU

#

therefore the GBU will only explode when it hits the terrain or any other fire geometry

tough abyss
#

@little eagle thanks a lot pal!

little eagle
#

I have also no idea why you use this one. It's the same as Bo_GBU12_LGB, but with another config entry only relevant to when used with a heli.

tough abyss
#

@little eagle, @tough abyss "smallSecondary" works.

#

But the explosion is a bit small.

little eagle
#

Also getPosATL will not work over the sea. It uses AGL. Not that that matters much

tough abyss
#

I will spawn some.

#

Ahh.. Thanks, i will use ASLToAGL getPosASL _agnt

little eagle
#

Yeah, just to be sure it won't cause issues in future.

#

I don't think there is an easy way to script an equivalent to the GBU that is "airburst".

#

Well, without config change.

#

otherwise it's just


    class Bo_GBU12_LGB;
    class commy_Bo_GBU12: Bo_GBU12_LGB {
        triggerWhenDestroyed = 1;
    };
tough abyss
#

I can try to trow the GBU in the agent.

#

Really simple config change!!!

little eagle
#

Yeah, but it won't work in missions.

#

Also I'm not 100% sure if the GBU's simulation type accepts that config entry.

#

But I see no reason why not. It's just a missile.

#

"missile"

indigo snow
#

you could try spawning a small/invisible object with a firegeometry just below it

little eagle
#

spawn the bomb inside it. But I don't know any invisible object with a fire geo. A fire geo will also absorb the damage.

tough abyss
#

There is an heli explosinon that is bigger, "friend" explosion of the "smallSecondary" explosion. I used it in Arma 2.

#

Will just try to find it.

#

It's big enough and explode on spawn.

#

Since smallSecondary explode on spawn (tested it) this bigger one, should too.

#

The two explosions are related to heli explosion.

#

"HelicopterExploBig"!!!!!

little eagle
#

That should do it. I don't think you need setDamage 1 for it. It seems to die on it's own after one second

tough abyss
#

@little eagle yes, tested it in Eden editor, it explode directly.

little eagle
#

timeToLive = 1;
on it.

#

Best config entry name btw. SAGE engine had the same name, so it's the only one I don't have to search for every time. lol

tough abyss
#

timeToCooffee = 1;

#

@little eagle video in 5 minutes!!! ๐Ÿ˜„

bleak schooner
#

Can I select a player via cursorTarget and let the client of this player execute a script?

halcyon crypt
#

sure

#

remoteExec

bleak schooner
#

@halcyon crypt and how?

halcyon crypt
jade abyss
#

I am just waiting for "Can you write this for me?" ๐Ÿ˜„

bleak schooner
#

@jade abyss Can you write if for me?
JK, my script works; thanks @halcyon crypt & @tough abyss

jade abyss
#

๐Ÿ˜„

austere granite
#

The only thing I'll be writing for you is this blank check addressed to myself.

fathom cloud
#

how to enable collision

jade abyss
#

enableCollision

#

oO

fathom cloud
#

hmm

#

while an object is hidden

#

enable collision

jade abyss
#

nope

fathom cloud
#

Is there a way to make my own collision?

civic maple
#

make your own model

fathom cloud
#

so that this stealth script works

#

Can you make a hidden object have collision

#

in any way>

#

?

little eagle
#

You can make a model that has a GEO lod, but no visual LODs.

#

Or rather, one empty visual LOD. Otherwise it crashes.

fathom cloud
#

Im new to this so how is that done?

little eagle
#

Should be so easy that you don't even need a 3D program besides Oxygen2

#

Or you pick a model that can be completely retextured and you give it a fully transparent texture via setObjectTexture

#

The problem with hideObject is, that it also hides the GEO and FIREGEO LODs

#

It's shitty API, like everything else.

fathom cloud
#

Darn you bohemia

jade abyss
#

Nope, its good as it is.

little eagle
#

The object would still have shadows I think.

jade abyss
#

nope

little eagle
#

If you give it a full alpha texture? Sure it would have a shadow.

jade abyss
#

uhm... yeah, that... erm... yeah

fathom cloud
#

hmm im trying to make this as vanilla as possable because im gonna maybe use this in a life server

jade abyss
#

jtg9uiraeb zbte

little eagle
#

Is that your password?

jade abyss
#

Nah, just a tiny Epilepticshock. Happens everytime, when i read "Life Server"

little eagle
#

the PTSD is bad

jade abyss
#

It is. I will never be the old one again.

cerulean whale
#

How would I stop a player respawning with the default respawn menu? I have mucked around with an EVH but it didn't work

fathom cloud
#

How to get oxygen 2

little eagle
#

Steam -> Library -> Tools -> Arma 3 Tools

jade abyss
#

@fathom cloud
Oxygen 2/O2 = Now called "Object Builder"

fathom cloud
#

oh ok

fathom cloud
#

I seem to have an issue with remove uniform can someone point me to the correct syntax?

fathom cloud
#

i see it but its not working

#

i used removegrar player;

#

*uniform

spring dune
#

Guys, my switch stop'd when one of file doesn't exist...

hearty plover
#

I want to control repawn via script, I want people to die -> go to spectator -> respawn on this script call

#

What functions should I be looking at.

#

Also, how will this use / affect onRespawn

hearty plover
#

Dear god why do I even ask this chat questions anymore haha.

spring dune
#

I have one default .paa & 7 optional. If one of them doesn't exist then all switch doesn't work.
How i can make a checker(?) for that?! If one/or all of optional doesn't exists then load default .paa?!

hollow lantern
#

I checked the wiki and the command looks correct but whats wrong with it? comanche addMagzines ["ACE_500Rnd_20mm_shells_Comanche", 2]; ArmA says missing ;

little eagle
#

addMagazines

#

addMagzines

#

idk

#

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

#

Dear god why do I even ask this chat questions anymore haha.
"please script this for me thx"

young current
#

@little eagle has the all seeing eye.

little eagle
#

"gz" hurts my eyes, how do you even pronounce that??

#

I'm pretty sure addMagazines does only work on persons and not on vehicle vehicles.

young current
#

addMagazineTurret then?

hollow lantern
#

hmm I really oversaw that lol

little eagle
#

Yeah, probably this command is needed

#

turret should be [0]

#

You can retrieve the turret path required for the command by entering the vehicle in the correct slot and executing:

hint str (player call CBA_fnc_turretPath);
#

via debug console.

young current
#

or use the watch lines

little eagle
#

sure

young current
#

remembered them myself just recently. x9

little eagle
#

I wish they had the "prev" "next" feature the upper box has.

hollow lantern
#

copyToClipboard (str (assignedVehicleRole player)); hint format ["%1", assignedVehicleRole player]; that works also ^^

little eagle
#

I guess for debugging, but in actual code it will break if you're not the group leader.

#

Because your assigned role is whatever the group leader wants and not what you actually are.

hollow lantern
#

I wouldn't use that command anywhere else lol

spring dune
#

if (((_uniformClass) select 3)=="ucp") then
{
_patch = "\test_decoration\optional" + (squad_name_array select 0) + "" + "OCP" + ".paa";
or
_patch = "\test_decoration\optional" + (_squad_name_array select 0) + ".paa";
};

#

How exactly i need to wright that OR?

cerulean whale
#

|| @spring dune

#

Wait

#

do you mean to select a random one?

arctic igloo
#

@spring dune nested if else or you can use a switch true statement if I understand your question properly otherwise I have no idea what you mean by using an or there as you aren't checking for some other condition on when to include OCP

#

https://community.bistudio.com/wiki/switch_do
Assuming you are looking for two seperate instances instead of an if else

switch true do {
    case (((_uniformClass) select 3)=="ucp"): {
        _patch = "\test_decoration\optional" + (_squad_name_array select 0) + "" + "OCP" + ".paa";
    };
    case (((_uniformClass) select 3)=="whatever"): {
        _patch = "\test_decoration\optional" + (_squad_name_array select 0) + ".paa"; 
    };
};
spring dune
#

@cerulean whale if first one doesn't exist then load second which exists...

#

@arctic igloo
nested if else always shows same error ("missing ) ")

#
if (!_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa") then {
 _patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";
} else {
 _patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa"
};```
arctic igloo
#

oh I semi understand now

#

I think killzone kid did something to check if a file exist

spring dune
#

He did

spring dune
#

I saw it, but i'm not sure how to use it

arctic igloo
#

so

#

like this

#
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa";
if !(_patch call KK_fnc_fileExists) then {
  _patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
};
cerulean whale
#

@arctic igloo , in that switch why don't you do switch (_uniformClass) do It would save you having to write the statement each time

#

you could just write the condition

arctic igloo
#

@cerulean whale I condensed it in the second example but left it as is for the first so it was transalted exactly to how he did it, regardless of whether it was right or not

#

as you can see in the example statement i cut it down to just one if instead of an if else as well

cerulean whale
#

ye

arctic igloo
#

@viral rain let me know if that works for you

#

keep in mind you have to add the code for that fileexist function so you can throw it in your init file

KK_fnc_fileExists = {
    private ["_ctrl", "_fileExists"];
    disableSerialization;
    _ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
    _ctrl htmlLoad _this;
    _fileExists = ctrlHTMLLoaded _ctrl;
    ctrlDelete _ctrl;
    _fileExists
};
spring dune
#

The old one switch which doesn't work if one of the .paa doesn't exist in folder...

arctic igloo
#

well that makes sense

spring dune
#

)))

arctic igloo
#

because you arent backing out if you enter one of the ifs

#

so its just never set up

#

what you could do instead is set the variable to the default by default

#

above the switch statement just do

 _patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";
spring dune
#

why above?

arctic igloo
#

because you have to init the variable at the top most scope

#

and also it removes the need for your default

spring dune
#

Yup, i got that thing.

arctic igloo
#

as the patch only changes in cases where you do have the paa

spring dune
#

It's totally stop works if one of them not present. ๐Ÿ˜ƒ

arctic igloo
#

what do you mean

spring dune
#

If one file not presented in folder it won't load default or some...

arctic igloo
#

did you do what i said and put the default line at the very top?

#

did you put this above the switch statement?

#

_patch = "\test_decoration\insignia" + (_squad_name_array select 0) + ".paa";

spring dune
#

Will try both in next few minutes. )

arctic igloo
#

i seem to have a little trouble understanding you at times so just tell me if im not understanding so i can better explain

#

the reason im telling you to init it as that is there are a lot of cases where you wont end up with a _patch because you are going into a switch statement and then into some if statements but there is not a definitive else to default the patch variable

#

and i think you are confusing that as it will mean that the block is supposed to exit and still go to the default

#

which just doesnt happen

#

@candid harbor

_patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";

switch ((_uniformClass) select 2) do
{
    case "emr" ; case "msv" ; case "vdv" : // RU: EMR
    {
        if (((_uniformClass) select 3) in ["patchless","emr"]) then
        {
            _patch = "\test_decoration\optional\" + (_squad_name_array select 0) + "_" + "EMR" + ".paa";
        };
    };
};

if !(_patch call KK_fnc_fileExists) then {
  _patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
};
spring dune
#

Or something broken, or default above cases doesn't help

arctic igloo
#

well that seems to be what would work for your intended purpose but your default really shouldn't rely on a dynamic name and instead be one you know 100 percent will exist

jade abyss
#
  _patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";```
dafuq? ^^
arctic igloo
#

he is generating the names dynamically

jade abyss
#

Format

arctic igloo
#

oh yeah

#

but its not a big deal

#

fixing the main issue is more important first

jade abyss
#
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
--->
_patch = format["\test\decoration\optional\%1_.paa",(_squad_name_array select 0)];```
Less confusing/cleaner(/faster)
arctic igloo
#

yeah thats fine but dont worry about that after you get it working

#

then you can make it all pretty, clean, and fixed up perfectly

jade abyss
#

systemchat everything, then compare the names with the files, where is the prob right now?

arctic igloo
#

im honestly not sure

#

it should work just fine as of now until he spits out some debug info or tells me something useful ill have no idea

#

my guess is he has the naming wrong or path wrong or just doesnt have a default that exist

jade abyss
#
yeah thats fine but dont worry about that after you get it working```
Thats... not true. Those multiple " can be a reason (like: Missing one of the ", because you used 20.000 in on line)
#

+Again: systemchat every line, to find out, where it stops/what the output is.

arctic igloo
#

yes but you are obessing about using format when string concatenation works fine

spring dune
#

Searching for it. )

jade abyss
#

Do what you want, i don't care

arctic igloo
#

then why make a big deal about it if you dont care?

#

@oak compass well let me know but i agree with dscha just systemchat/diag_log it all and find where its screwing up

jade abyss
#

Who is making a big deal? oO

#

You know what: whatever. hf.

arctic igloo
#

@jade abyss why is your name famliar to me btw i feel like i remember you from somewhere

spring dune
#

@arctic igloo Ok

#

I tested first thing, when default above cases... Got error "UCP.paa" not found and just loaded rest. That's good because only one of them didn't load.

#

The bad thing in what i want to replace it with default if not found. )

#

So.

#

Trying 2nd suggestion now

arctic igloo
#

try this

#

_patch = "\test_decoration\optional\" + (_squad_name_array select 0) + ".paa";

switch (_uniform) do
{
    case "emr":
    {
        _patch = "\test_decoration\optional\" + (_squad_name_array select 0) + "_" + "EMR" + ".paa";
    };
};

if !(_patch call _KK_fnc_fileExists) then {
  _patch = "\test\decoration\optional\default.paa";
};
#

add a default.paa that is just a generic icon and that way it will always load something

spring dune
#

But...

#

Hmm... It will be load default first & then switch it to other if exists?

arctic igloo
#

yes

spring dune
#

Tricky. ๐Ÿ˜ƒ

arctic igloo
#

starts with your dynamic default

#

then checks special conditions

#

and if it finds one or doesnt it checks to see if that file exsit

#

if not then it just loads your generic one

#

your other way could cause issues because even that default might not exist

spring dune
#

But it's double load yeah?

arctic igloo
#

in what way

spring dune
#

Or not... It will be load default first and then go to special or it will check whole .sqf first and then load .paa?

arctic igloo
#

it doesnt load the paa until you call the load image command

#

it just sets a string ot the path

#

at the very end you load it

#

so its not an issue

spring dune
#

Ok, testing.

#

Prev. result

#

UCP was deleted.

leaden knoll
#

Hi guys, sometimes zeus will stop working when switching admins or just because arma. Would just executing the following in the console resolve the issue? unassignCurator zeus_1; player assignCurator zeus_1; where zeus_1 is the name Game Master module

thin pine
#

I'm probably late to find out but apparently A3 v1.67 will increase the arma limit of max groups from 144 to 288 ๐Ÿ˜ฎ

meager granite
#

Why would you ever need more than 144 groups per side? ๐Ÿค”

jade abyss
#

@meager granite I assume "Life"r need it.

thin pine
#

One other example; Zombies, lobbies & zeus. I've experienced that I couldn't spawn in any more of my zombies with Zeus, even though I deleted those that were dead (empty groups are supposed to be removed after a minute, but that didn't happen for some reason). I'd then have to deleteGroup _x on allGroups in console to clear it up and be able to spawn moar zombries. Happened a couple times.

jade abyss
#

Yeah, right. Totaly forgot them.

meager granite
#

Why do you need groups for zombies?

#

Why not create zombies with createAgent?

thin pine
#

Zeus cant spawn agents directly

meager granite
#

Can't you change it with addon?

#

Never looked into how Zeus is made, probably you can update it in zombies addon.

little eagle
#

Modding Zeus is such a mess. : (

#

createUnit

#

Want me to look up the line?

#

It's createUnit

#

?

late quest
#

Just a quick question. Doing some GUI stuff. With structured text, you can use HREF's to launch external links. I've basically got a button on my GUI where I would like it to link it to a page onButtonClick

#

Any idea on how to do this?

tough abyss
#

Hey Guys, The Mod RyanZombies, is it working with an Alits Life Framework? I want Altis Life with Zombies

bleak schooner
#

@tough abyss Regarding the cursortarget in remoteexec: When I run the script on a local server it works fine. But when I run it on a dedicated server the script is executed on my client and on the client I got via cursortarget. Any ideo how to fix this?

tough abyss
#

Or Tanoa Life sry

thin pine
#

@tough abyss its a standalone mod. you could integrate it anywhere

tough abyss
#

But how? Do i need to code an full mod like exilez or can i copy exilez ?

#

The Thing is how do i spawn them?

thin pine
#

just like you'd spawn any other ai

tough abyss
#

@tough abyss standalone meaning it has no dependencies meaning you can run it any wherr

#

Meaning no need for changes

#

lol but is it like an trigger or what?

#

sry

#

got it working, im just too dumb to read

tough abyss
#

hey guys is there a way e.g. init field for a zeus not initialise on mission start but rather when the slot connected to it becomes taken by a player so that zeus doesn't stop working once that player leaves or the mission starts without someone in the player slot connected to Zeus

little eagle
#

Probably yes.

#

...

tough abyss
#

so if one starts a mission on dedicated server ( -autoinit), with a Zeus Game Master module linked to a player slot, the Zeus module becomes unresponsive to users as they are only able to ping zeus and not enter it while in the player slot that is connected to this Zeus module

#

I am wondering if there is a way to only link the player slot and Zeus Game Master module after a player has actually taken the player slot connected to Zeus

#

another thing is that if the player that is in the zeus slot leaves the server and another tries to take his place, the same problem occurs as mentioned above

#

that better @tough abyss ?

#

and how exactly does that work ๐Ÿ˜…

#

I have a slot accessed by anyone who is assigned mission leader during the special operations

#

got the same thing set up

shadow sapphire
#

Could anyone help me understand how to do a keydown event?

indigo snow
#

myEH_ID = (findDisplay 46) displayAddEventHandler ["KeyDown", {_this call myCodeOrSomething}];

shadow sapphire
#

Right, but how do I tell it which key I want to use? That's the part I'm confused on is that.... I don't understand the code there, I guess.

indigo snow
#

ah, theyre these

shadow sapphire
#

But I don't see any key codes in your line up there.

indigo snow
#

oh no it registers every key

#

you'll need to filter yourself

shadow sapphire
#

How?

#

That's the question, really.

#

How do I make a certain key trigger the event? That's how I should have phrased it.

tough abyss
#

@tough abyss your method doesn't suffer from the problem I described?

indigo snow
tough abyss
#

hm guess that is the main problem then

#

cause I need it linked to a slot ๐Ÿ˜›

shadow sapphire
#

@indigo snow, thanks!

#

That was what I needed!

jade abyss
#

@shadow sapphire In the Searchbar (TopRight) :
in: #scripting keyDown
Sa-Matra just pasted one example yesterday

shadow sapphire
#

@jade abyss, thanks!

#

Hey, so here's a different take on it, what if instead of a specific key 100% of the time, I want it tied to an assigned key? Like, every time a player changes to combat pace, I want to trigger an event or some such thing.

jade abyss
#

what?

shadow sapphire
#

So, if I wanted to spawn a balloon every time a player pressed the crouch key, but they weren't using the default control scheme, how could I make that happen?

indigo snow
#

actionKeys "crouch"

shadow sapphire
#

I could do actionKeys "vault" or actionKeys "sprint" or whatever? I'll google it.

indigo snow
shadow sapphire
#

Friggin. Awesome.

jade abyss
#

Example:

_ctrl         = param [0];
_button     = param [1];
_BtnShift     = param [2];
_BtnCtrl     = param [3];
_BtnAlt     = param [4];

_ButtonDisabled = false;
_BD = {_ButtonDisabled = true;};

_getKeys =
{
    _Arr = [];
    {
        _Btns = (actionKeys _x);
        { _Arr pushBackUnique _x; }forEach _Btns;
    }forEach _this;
    _Arr
};

//Buttons: 1-0    Doublecheck needed, because of Re-arranging of the CommandingMenu possible with A3 1.58
//Disable Commanding Menus
_CommandKeys = ["CommandingMenu1","CommandingMenu2","CommandingMenu3","CommandingMenu4","CommandingMenu5","CommandingMenu6","CommandingMenu7","CommandingMenu8","CommandingMenu9","CommandingMenu0"] call _getKeys;
if(_button in _CommandKeys)then{call _BD;};

//TacticalView disabled
if (_button in actionKeys 'TacticalView') then         {call _BD;};

//EOF
_ButtonDisabled
#

Old stuff i did, to disable all btns.

shadow sapphire
#

What is the vault action or action key called?

indigo snow
#

handling some cases is harder though, like double-press keybinds (e.g. 2xv)

jade abyss
#

*updated

shadow sapphire
#

@jade abyss, why would you do that? That's a pretty neat thing, but I am curious as to why you'd do that. Something similar could be useful for me.

jade abyss
#

Why not? I needed it.

shadow sapphire
#

Haha, I see.

dusk sage
#

@jade abyss Don't let commy see those params

jade abyss
#

I disabled F1-12 and 1-0

dusk sage
#

He'll murder you in your sleep

jade abyss
#

I don't give a damn ๐Ÿ˜„

dusk sage
#

gotta spam so it disappears quick

jade abyss
#

blaaahhh

dusk sage
#

๐Ÿ™ƒ

jade abyss
#

It was taken out of a testfile, so i don't give a damn ๐Ÿ˜›

shadow sapphire
#

@jade abyss, that's practically exactly something that would be useful for my community. We don't have any AI being commanded in our sandbox, so we using the command menu for our custom radio script would be much better.

jade abyss
#

gl hf with it.

#

Credits to me, PayPal Links follows later.

#

๐Ÿ˜„

shadow sapphire
#

Well, haha, we generally make our own stuff. The only exception is a mag repack script. Which... eventually I want to replace with our own.

jade abyss
#

*edited again

shadow sapphire
#

I suck at scripting this game, but my developer is a fuckn wizard.

tough abyss
#

well @tough abyss there's no documentation on that xD

little eagle
#

Modules have been broken for JIP players since modules exist.

tough abyss
#

Zeus Game Master shows the exact same problem

#

you can't init the mission without a zeus being present

#

or you break the module

little eagle
#

It has nothing to do with that specific module.

#

It's just that JIP spawned units are never synched to the module.

#

They lose their synch.

#

Not the same as a slot I guess.

#

It can easily be scripted to be linked to a slot tbqh.

#

Maybe I should add a simple checkbox 3den setting in CBA. anyone can hit a checkbox.

#

Typically BI adds the same stuff in the next version whenever I do something like that lol

#

That is NOT the same as a zeus slot mate.

shadow sapphire
#

What is the class name of the "vault" user action?

#

Anyone know? Can't find it on the wiki.

tough abyss
#

@little eagle how would you suggest scripting it?

little eagle
#

probably calling the module.

tough abyss
#

๐Ÿ˜… I'm not that advanced

little eagle
#

@shadow sapphire GetOver

jade abyss
#

@shadow sapphire GetOver[]={57};

shadow sapphire
#

Thanks!!

jade abyss
shadow sapphire
#

Thanks so much, @jade abyss

jade abyss
#

But: Its just an indicator, iirc they don't fit everytime (btw.: "key" must be removed always)

#

Take my example from above

#

add a hint str _button

#

hf

tough abyss
#

I have a set of lines of code that should run everytime a player uses a certain player slot. Can I use the init for this or should I use something else?

#
 {
this assignCurator missionzeus; 
0 = addMissionEventHandler["HandleDisconnect",{unassignCurator missionzeus}];
}; ```
shadow sapphire
#

How might I disableAI for an entire group at once?

scarlet spoke
#

@tough abyss don't name a variable 0... either you want to have a reference to that EH (Then give it a more meaningfull name) or just remove the assignment part... ๐Ÿ˜‰

tough abyss
#

thanks @scarlet spoke I removed it already as it wasn't needed for the script

little eagle
#

@scarlet spoke this is to fix the stupid editor from complaining about return values.

scarlet spoke
#

Oh I thought it was in a normal script...

#

The editor and it's complains about return values really goes on my nerves sometimes.... Who needs that sh*t?

scarlet spoke
#

Well I guess not all traditions are good ones xD

scarlet spoke
#

Yeah me too ^^

hexed obsidian
#

anyone know how to simulate explosives without having them deal damage I.e. an artillery bombardment w/ out killing off all the AI?

frigid smelt
#

Can someone tell me why the diag_tickTime value is different for every user? Shouldn't that value be the same for everyone because it's server tick time?

ionic orchid
#

from the docs the value is

This command will return time since last client restart as float.
#

so not specifically the server time (which each client slightly drifts away from, from what I've heard)

tough abyss
#

Script for spectate mode switchCamera _unitToSpectate; ๐Ÿ˜„ but how do i get this camera so i can use _cam setCanFov 2 in it?

#

I'm working in a spectator mode that simulate optics zoom.

tough abyss
#

performance wise ive made an ai freezer (disables ai simulation when no player targets found) would it be a good call to hideObjectGlobal it and will it result in any performance increase

hearty plover
#

If I have a player, and is unit is flagged as PLAYER_1 and he dies, and I have a script, that loops, and says if PLAYER_1 is present, and DOESNT CHECK if he is alive, and his body remains in the position to be checked, AFTER he respawns... what should happen.

tough abyss
#

Anyone here who is good with creating dialogs and maybe have a minute to see what's wrong with mine? It seems to be working (not crashing) but for some reason nothing shows up when I call it. I only see mouse cursor but no dialog ๐Ÿ˜ฆ It's a very simple one

jade abyss
#

Check your .rpt

tough abyss
#

.rpt?

jade abyss
#

๐Ÿ˜ฆ

#

RePorT file, Errors etc. are logged in there.

#

#1 Always check your .rpt's, when something is wrong
#2 try to solve it yourselve a few times
#3 Do #2 for about 30min again
#3 Do #3 again
#4 Ask in Discord.

tough abyss
#

@jade abyss I don't think RPT att all tells me anything extra interesting apart from what game itself already informed me when I actually had errors (and fixed them after).

jade abyss
#

Yeah.... gl then.

tough abyss
#

@jade abyss staying quiet would actually be more helpful of you.

jade abyss
#

lmao

#

I gave you the path, you have to go, to find your fkn problem, now you try to smartass me?

#

Check your fkn .rpts, there are errors msgs in there, otherwise your Dialog would pop up

open vigil
#

True, but it's always easiest to check the .rpt

#

Start simple then move on

jade abyss
#

There is something miss-configurated in the dialog, there is a msg inside the rpt, that does NOT pop-up ingame.

#

or missing Configentrys...

#

And: Yes, some of those errors do not pop-up inside arma. They only appear in the .rpt... but hey, what do i know? I just played around with the Dialogs for > 12 Months.

#

Since when?

arctic igloo
#

@tough abyss Just ignore @jade abyss he is just an asshole. He actually got removed from the altislife dev forums for abusing his mod powers by banning me when I told him to either post something useful or don't post at all. Thankfully I got unbanned and replaced him as the moderator though.

I wouldn't mind taking a look at your dialog just upload it and shoot it over

nocturne bluff
#

He is right tho, just look in the rpt

arctic igloo
#

Which the person responded nothing useful showed up in the rpts, instead of just saying "good luck" and then going on a rant I instead offer to spend a few minutes looking over his file.

jade abyss
#

lulz

open vigil
#

@arctic igloo First post here and you're already casting aspersions? Probably not the best way to introduce yourself around here.

arctic igloo
#

@open vigil This isn't my first post here so not sure where you are pulling that one out of but it must be a very dark hole. What I am trying to do is not push off someone that needs help and instead offer real useful assistance instead of talking about how great I am at dialogs and throwing cuss words at him.

open vigil
#

If you've got some strange history with Dscha, I don't care. It doesn't belong here.

arctic igloo
#

@open vigil I agree so we can keep any other messages not related to scripting out of this channel? You easily could have just sent me a PM with your previous message and that one

open vigil
#

Call it Moderator prerogative

tough abyss
#

How to put the current cam in a variable so i can use it with camera functions like _cam setCamFov 2;? I found no function like _cam = currentCam;.

vague hull
#

camera is the player itself by default I think, then any other camera must be create with createCam, which return a camera Object

tough abyss
#

@vague hull thanks!!!!

vague hull
#

just tryout if that works

tough abyss
#

Yes, i will try

#

"In BRPVP you will be able to see your friends camera, with optics zoom and shit!" Donnovan ๐Ÿ˜„

vague hull
#

this could be abused.. a lot

tough abyss
#

Abused?

#

You need to grant access to that.

#

"I grant you access to see my camera".

#

But for sure i'm missing something ๐Ÿ˜„

vague hull
#

yes, but if you can have two players in the same cam with different zoom levels, the looking through objects and stuff like that is going too beginn

tough abyss
#

The fov will allways be the fov of the unit

#

the "conscient" unit

#

player camSetFov 2; don't work.

#

ooops...

#

@vague hull player object don't work as the camera. Have any idea pal? ๐Ÿ˜„

vague hull
#

I assume if you create a camera when you need it and the switch to it, it should work tho

tough abyss
#

Yes, but the camera must be a unit view.

vague hull
#

just create the cam on the eyepos of the other unit

tough abyss
#

and if the unit move?

vague hull
#

then attach it to the head pos of the unit

#

via attachTo

thin pine
#

Does camsetfov on an INTERNAL camera not work?? Try it

tough abyss
#
player camSetFov 0.05;```
#

This don't generate any zoom.

thin pine
#

Probably gonna have to take the long approach senfo mentioned then

halcyon crypt
vague hull
#

just: trigger->camCreate->attachTo HeadPos->camsetFov->dowhatever->camDestroy

halcyon crypt
#

for "inspiration" ^^

vague hull
#

I dont like ACE for that

#

its too "overdone" for someone to get an idead of what it actually does

halcyon crypt
#

first thing that came to mind, there are plenty of others to look at ยฏ_(ใƒ„)_/ยฏ

vague hull
#

yea, just wanna state my opinion there ^^

thin pine
#

ACE with its CBA macros can be a bit challenging for less-experienced scripters to look at. I'd just do some googling if I were you Donnovan

#

I did a bit of that myself and found that pretty much all spectator scripts use player switchcamera "INTERNAL" for their first-person mode.

#

So no secret cigar for you i'm afraid.

nocturne bluff
#

You can use gunner for ironsight

tough abyss
#

Thanks all.

#

@vague hull it worked, but a little bugged since you see player head from inside.

#

I can hide the unit, but its weapon will dissapears? lets see...

vague hull
#

yeah, you just need some good offsets then :)

tough abyss
#

Ah.. i see

#

Will do some try

vague hull
#

just the attach it a bit more ahead

tough abyss
#

Just noticed there is no "floating arms holding a weapon" in Arma 3... what we see is the real model.

vague hull
#

yeah, just the head is "hidden"

tough abyss
#

Errm... camSetFov not working even on camera created with _cam = camCreate _pos;.

#

Let me take a big breath and start again lol

jade abyss
tepid heath
#

gday all

#

does anyone know if there's a method to check if a specific EH has already been added to a unit?

tough abyss
#

@jade abyss oh, no, i will try to use it.

turbid thunder
#

"Just noticed there is no "floating arms holding a weapon" in Arma 3... what we see is the real model." Jup and it makes modding all so easier because everything you see on your body in first person is an accurate representation of how you appear for others without the need of making seperate models for each uniform, though how did you only notice it now? Like, did you never freelpok around noticing you can see almost your entire body with it?

tough abyss
#

yes, indeed, a obvious thing.

#

everything i do in camera not work even with camCommit, probabily my fault since i never worked with then. Thanks for all the help.

#

Will keep trying.

jade abyss
#

Even the example?

tough abyss
#

The example worked.

#

No other way, i will mess with it a bit to get the basics and see if i can do what i want to do.

little eagle
#

its too "overdone" for someone to get an idead of what it actually does
Good practice is the best obfuscation.

#

(or anything that can't be copy pasted really)

tame portal
#

Give I wanted to make a top down view gamemode in ArmA, what would be my best bet to make the camera work properly?

halcyon crypt
#

check the notes at the bottom ๐Ÿ˜ƒ

tame portal
#

Ah sorry I meant more like a Zeus view ^^

#

I want to make a Command and Conquer like gamemode with 2 vs 2 players controlling Ai units, etc.

#

And the only thing I haven't really thought of is the camera

halcyon crypt
#

same notes but rotate the camera until it's the way you like I guess

tame portal
#

It's not meant to be bound to a unit

#

It's really just like the Zeus camera, a free mode cam

#

I thought about using the Zeus cam itself, but that would require to disable all UI elements

#

And somehow force that, disabling all ways to leave it

spark phoenix
#

Just a quick question, I noticed loadFile seems to work on the server. is FilePatching turned on by default?

jade abyss
#

iirc off

vague hull
#

Good practice is the best obfuscation.
Why would you need that in an open source, licenced project tho ยฏ_(ใƒ„)_/ยฏ

little eagle
#

If you fork the master branch, the dev environment is basically set up. But life people can't copy paste lines to insert them into their server.

#

OS does not mean code pile you can draw from for free.

vague hull
#

instead copy two files and the STRG+H until you are happy?
I am sorry.. just no

little eagle
#

It's not a code pile you draw from for free. Sorry. Just Yes.

#

Also it's not actually obfuscation. Reading comprehension ...

tough abyss
#

Aslong as he follows the license for opensource then yes it is

little eagle
#

The amount of life people giving back code to this day is basically zero.

jade abyss
#

1%

#

Okay, 0.5

little eagle
#

Yeah. I'm sure SOMEONE plays life and did something for it.

tame portal
#

@jade abyss noch ein stรผck

jade abyss
#

0,25? (+keep it English, knalltรผte :D)

tame portal
#

:S

#

Okay dad

jade abyss
#

good girl.

tame portal
#

0.25 is about right

#

Im done with life mods aswell, still need to make that camera for my top down Zeus vs Zeus gamemode >-<

#

Do you think Company of Heroes in ArmA would work?

#

I imagine it being fun

jade abyss
#

tbh. i am just waiting for Enfusion, to do something like that. I am not spending any more time in VR, to do it^^

tame portal
#

Ah God damn it discha

jade abyss
#

And in the meantime, i play around in UE4 ๐Ÿ˜„

tame portal
#

That's also my thoughts

vague hull
#

The point is:
obfuscate or encrypt or making it hard to read -> intention: nobody should read it
Why would you publish it then?
Your " But the bad life modders :(" argument is just invalid

tame portal
#

I dont want to make something and then have it be rendered obsolete by the new engine

vague hull
#

And I am not saying I like them

tame portal
#

Well you obfuscate so people don't steal

jade abyss
#

I mean, it won't happen tomorrow or the next 6Months, soo....

tame portal
#

The fact that noone can reads it is sadly the tool to prevent theft

#

If there was a different way to stop theft, people would use it

#

But there isn't

vague hull
#

A proper lawyer would be a tool

tame portal
#

Not everyone can sue someone else

#

It's expensive

jade abyss
#

Even when?

#

What should he do?

tame portal
#

When you sue someone you should be 10000000% certain that you will win

vague hull
#

yeah, if you want to get your rights, sometimes you need to pay for it

#

and if someone "copy and pastes" what is not to be sure about?

tame portal
#

The thing is

#

Obfuscating is cheaper than suing

#

Way cheaper and easier

jade abyss
#

Just makes it harder for 99% of em. Just like everything else. 100% protection is just not possible :/

vague hull
#

true that, yet they are crying about how that doesnt work

tame portal
#

It's a bad side effect that you lock out legit people that might learn from your code, but that's the price your paying

#

*youre

#

@jade abyss okay fine ill do the gamemode then

#

Grrrr

vague hull
#

@tough abyss this

jade abyss
#

gl hf gg no re @tame portal

tame portal
#

You wot m8

#

Oh god

#

I was about to say

#

Jeez you scared me there for a moment

vague hull
#

btw read the last line of the obfuscation entry on wikipedia

#

thats really intresting

jade abyss
#
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipediaยฎ is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.``` that one?
#

๐Ÿ˜„

vague hull
#

not exactly ๐Ÿ˜…

little eagle
#

Well obviously obfuscated code is not source code. You apply a tool for obfuscation on your real source code to modify it. Afterwards it's no longer source code.

#

By definition.

vague hull
#

which then isnt licensed anymore..
that was new to me too

halcyon crypt
#

the binaries are still licensed

#

which is also kind of obfuscated

#

sort of

vague hull
#

in their definition thats something different

halcyon crypt
#

so if I get a GPL library, obfuscate it and link against the obfuscated stuff it's license free? ๐Ÿ˜›

vague hull
#

its ofc only object to the one who created it

#

anything not done by the owner doesnt change the license

halcyon crypt
#

๐Ÿค”

vague hull
#

but if you find a obfuscated project licensed like this, then yeah.. is basically royalty free as of what I understood

open vigil
#

We used to call those"sea lawyers".

woeful void
#

usually licenses will also apply to all 'derivative works' as well, meaning if the source code is licensed, so is the compiled/obfuscated code too under the same license.

#

though usually, it's understood by most courts that the license on software already extends to the compiled code, meaning the phrase 'derivative works' is already implied.

#

i.e. too bad, so sad, you lose.

plucky beacon
#

riperoni your money only

woeful void
#

.. for the next 10 years (in some cases.)

#

it all depends on how aggressive the copyright/license holder wants to pursue it.

plucky beacon
#

What if in 20 years lawyers get up and say "GG no re" when they win

woeful void
#

... I highly doubt it.

plucky beacon
#

but it'd be funny

#

in any case, do you know if remote exec is objectively faster than bis fnc mp?

woeful void
#

not off hand, no... find a bunch of buds, set up a MP map and test it?

dusk sage
#

yes @plucky beacon

#

bis_fnc_mp uses remoteExec itself since RE was released

#

So it is guaranteed to be faster, for obvious reasons

plucky beacon
#

Hmm, I got to update some scripts then

dusk sage
#

One command vs boiler plate SQF and one command

#

๐Ÿ˜›

plucky beacon
#

I haven't used remote exec before, off to the wiki

dusk sage
#

Be careful if you whitelist in CfgRemoteExec, and forget to change some of the bis_fnc_mp, as they will be affected

plucky beacon
#

It's a private server for a group of friends so I should be good

#

Wasn't there a program someone made that compiles sqf files and checks for errors without launching Arma?

dusk sage
#

There is linters*

#

I think intellij has one

#

maybe VSc

#

And squint

plucky beacon
#

I installed it to my VSCode

#

thanks, I didn't know about this

#

It's a shame it doesn't look in the sqm for global variables but we can't get everything I guess

#

I'm surprised that on the entire remoteExec wiki page they don't use an example of execVM

woeful void
#

yea the lack of examples many times is a problem.

plucky beacon
#

I always want to add a couple but my wiki account doesn't work

woeful void
#

I so want to make a way to jam TFAR radio by playing rick Ashley in the youtube channel when there's radio jamming going on...

#

easy solution: switch radio frequency

plucky beacon
#

pfft hahaa, that sounds great

#

probably better off removing the radio

#

because most people I know recognize what freq they were on

woeful void
#

nah, you don't get as many first timers going 'WTF'...

dusk sage
#

@plucky beacon Why does it need to show execVM?

plucky beacon
#

Technically it doesn't need to show anything, but I figured that would be a common use for it

dusk sage
#

You mean with remoteExec (as a command)?

plucky beacon
#

basically this in remoteexec

["BluforVictory.sqf","BIS_fnc_execVM",true,true] call BIS_fnc_MP;
dusk sage
#

why not use execVM instead

#

But either way, it gives you all the information

plucky beacon
#

doesn't call globally

dusk sage
#

neither does BIS_fnc_execVM?

plucky beacon
#

well isn't that what remote exec is for?

dusk sage
#

You can use remoteExec with commands

plucky beacon
#

I should go through BluforVictory.sqf and convert every command to be called through remoteExec?

dusk sage
#

I'm quite lost

#

What you're doing is executing BluforVictory.sqf on every machine

#

you can achieve the same with remoteExec

plucky beacon
#

yes, that's what I'm trying to do

dusk sage
#

I'm just pointing out you don't need to use bis_fnc_execVM

#

You can use the command, execVM

plucky beacon
#
[[],"BluforVictory.sqf"] remoteExec ["execVM",-2,false];
```
#

and I have that empty arguments I know, just seeing how it works.

dusk sage
#

Anyway, all commands are handled the same, so no specific example for execVM needed, but perhaps an example for commands

plucky beacon
#

I wasn't really thinking that far for the examples. just basically thinking "this must be used a lot, I wonder why they chose these examples."

dusk sage
#

Tbh, not sure why you'd ever want to use execVM w/ remoteExec

#

Why not compile it prior to the RE ๐Ÿ˜› ?

plucky beacon
#

you mean have it on a waitUntil or something?

dusk sage
#

I don't understand what you mean

#

You want to execute BluforVictory.sqf

plucky beacon
#

Define "compile it prior"

dusk sage
#

So compile BluforVictory.sqf into a variable, and use it with remoteExec

#

compile...

#

compileFinal, CfgFunctions

#

etc

plucky beacon
#

oh

dusk sage
#

All the same idea

plucky beacon
#

Well I guess I haven't done it before, I've looked at CfgFunctions but not done that.

#

So in classic fashion "one can only work with the tools they know"

dusk sage
#

Well, you don't want to compile it every time you run it, sure if this is once, but still, no reason to

plucky beacon
#

CompileFinal looks like it's designed to return a value though, this is just a null

dusk sage
#

I don't think you quite understand

plucky beacon
#
value = call compile preprocessFile "BluforVictory.sqf";
//Value is null because no return
//Later call
call compile preprocessFile "BluforVictory.sqf";
dusk sage
#

don't call it

#

compile preprocessFile "BluforVictory.sqf";

#

Gives you code

#

When you call it, you're executing it

#

Clearly your file returns null

#
value = compile preprocessFile "BluforVictory.sqf";
//Later call
[] call value;
#

You dont want to compile it every time you call it

plucky beacon
#

oh fml I get it

#

that makes sense

jade abyss
#
myFncWichIsAVarNow = compile preprocessFile "BluforVictory.sqf";
[] call myFncWichIsAVarNow;```
dusk sage
#

compileFinal is the same as compile, but doesn't allow the value to be overwritten

#

like a const

jade abyss
#

same is done with "CfgFunctions"

dusk sage
#

readonly blah

#

And as Dscha said, CfgFunctions is just abstracting this to a config, which is easier to organise

plucky beacon
#

Okay so now that I've established how to get the function and call it, how do I make sure it runs globally

jade abyss
#

(since its beeing called PreInit)

dusk sage
#

So if you have your function (compiled your code, assigned it to a variable)

#

You can use that with remoteExec

plucky beacon
#
remoteExec ["myFncWichIsAVarNow ", targets, JIP];
dusk sage
#

[] remoteExec ["value", targets, jip];

#

yes exactly

plucky beacon
#

gotcha

dusk sage
#

Now you don't have to re compile your file every time you execute it

#

Which is slow

plucky beacon
#

And I can preprocess in the init?

dusk sage
#

Don't compile/preproc yourself, just use CfgFunctions

#

You can, but, there isn't much reason to

jade abyss
#

remoteExec - kinda like Spawn (can be suspended on TargetClient)
remoteExecCall - kinda like Call (can NOT)

plucky beacon
#

You know this solves another problem of mine which is I'm trying to keep an array of the remaining alive players, if I preprocess the script that checks for it I can call it on a killed event handler for each unit

jade abyss
plucky beacon
#

Ya I have a script already written out for it, but it's important it's in an array because I need to count for it

jade abyss
#

?

#

For what?

plucky beacon
#

A notification for "You are the last man"

#

as well as "one enemy left"

jade abyss
#
_AliveCount = {alive _x} count allUnits;
if(_AliveCount <= 1)then{Systemchat "LastManStanding"};
plucky beacon
#
        {
            if    (alive _x) then 
                {
                    if (side _x == East) then {
                     _ActiveEnemies pushBack _x;
                  };
                };
        } forEach allUnits;
                if((count _ActiveEnemies == 1) && (!OneLeft)) then
        {
        code and shit
#

oops

#

sorry edited this for viewing

peak plover
#

Will alive return true for spectators?

plucky beacon
#

no

jade abyss
#
_AliveCount = { (alive _x && side _X == East) } count allUnits;
if(_AliveCount <= 1)then{Systemchat "LastManStanding"};```
plucky beacon
#

lol

#

That's like exactly what I did, the if statements were seperate because I was doing something in between them a while back

#

also if count == 0 it's mission failure

#

Also my code is full of hints and system chats for debugging

#

but I lower the line count once I'm sure everything is working right.

#

I didn't know you could count something using operators though

jade abyss
#

yepyep

#

count reacts more or less to "true" and "false"

#
_cnt = {false} count allUnits; //always _cnt = 0
_cnt = {true} count allUnits; //always _cnt = the amount of players
plucky beacon
#

Now i did encounter one bug where two infantry in a truck count as one unit when using allplayers

jade abyss
#

Check if it is a car/plane/Helicopter/boat/whatever

#
if !(_x isKindOf "Man") then {Magic};
plucky beacon
#

But if the count went from 2 to 1 wouldn't it then be 0 if you check for kindOf?

jade abyss
#

hf finding that out =} I made enough for today ๐Ÿ˜„

plucky beacon
#

Lol!

#

Im just going to use allunits

#

Thanks for helping, definitely improved my optimization game

plucky beacon
#

Boommarked already!

night frigate
#

I feel smarter for having read the above discussion. Thanks. ๐Ÿ˜ƒ

plucky beacon
#

ye! and this recursive function for checking the remaining players on each death is way better than the server checking every second and using a lot of resources

hearty plover
#

Dear lord I am pulling my hair out.

#

Can anyone help me put together a round based respawn system..

plucky beacon
#

watcha got

hearty plover
#

I have been looking everywhere for something like this, and nothin I have looked at seems to do it.

plucky beacon
#

They way I do it is setRespawnTimer

#

hang on

hearty plover
#

How can I then, implement spectator while waiting on a new round?

#

Ie, DIE -> Put in Spectator -> onNewRound -> Respawn

plucky beacon
#

I did a mission with this recently, I start with a respawn timer that's like "9999999" so virtually forever, with respawn type "Base" or "3" then I make a script so that when a condition is triggered, every client runs a script that sets respawn time to "1" for 5 seconds, then sets it back to "9999999"

hearty plover
#

That would work if I didn't want spectator stuff D:

#

Not a bad work around at all.

plucky beacon
#

spectator still works, why not?

hearty plover
#

Oh it does?

plucky beacon
#

are you using EG spectator?

hearty plover
#

Yeah

plucky beacon
#

are you putting them in spectator via script?

hearty plover
#

Don't see any reason not to yet, unless there is something I missed D:

tame portal
#

Question, does anyone know if its possible to force a client to load a world on startup?

hearty plover
#

Not yet no.

plucky beacon
#

@tame portal has to be set through the clients launcher

tame portal
#

I know that, but what if no world is given

#

Is there a way to force a mission to run in the main menu?

plucky beacon
#

it loads an empty ocean

tame portal
#

Well if you dont enter a value it loads Altis or Stratis..

#

Or a different map with mods

still forum
#

yes. There is a startparemter one sec

#

the -world startparameter loads a mission afaik

plucky beacon
#

people have made addons with it, I just forget the command

tame portal
#

Yes, but I need it without the start parameter

#

given the user loads no specific world

still forum
#

gimme a min

#

In config "CfgWorlds" >> "initWorld" is apparently the map name @tame portal

#

you can overwrite that in a Addon config

plucky beacon
#

@hearty plover

Remove the "Spectator" respawn template from your Description.ext

OnPlayerKilled.sqf

["Initialize", 
[player, //unit being initialized
[West], //sides that can be spectated
false, //can AI be viewed
false, //can free camera be used
false, //can 3rd person be used
false, //show focus info widgets
false, //show camera button widgets or not
true, //Show controls helper widget
true, //whether to show header widget
true //Whether to show entities/locations lists
]] call BIS_fnc_EGSpectator;
hint "spectator mode has started";
systemchat "spectator mode has started";

sleep 3;

BIS_DeathBlur ppEffectAdjust [0.0];
BIS_DeathBlur ppEffectCommit 0.0;

OnPlayerRespawn.sqf

["Terminate"] call BIS_fnc_EGSpectator;
hearty plover
#

Your the fucking best around bud, then I could toss in some logic on the on killed to set the respawn timer to the amount of time left in the round + 5 seconds

#

So if you die with 60 seconds left in the round, you respwn in 65.

#

I wonder if I can use the wave setting to help me here as well.

tough abyss
#

@vague hull this is the prototype of the friends spectate: http://pastebin.com/SRfbcaM2 you can run it in the EDEN editor console and it will show you a agent running in circles with a camera above its read following its eyeDirection and that can have zoom in and out.

#

The zoom factor will be stored in the spected player namespace and it will be applyed to the camera.

still forum
#

@tame portal You can also use Missions. Atleast if they are defined in "CfgMissions" But i think also stuff in the Missions folder may work

tame portal
#

Alright will look into it

#

The thing is im making a main menu for a mod

#

and that main menu requires a specific world to be loaded to allow for interactions with it

#

(camera shots, etc.)

plucky beacon
#

Sounds neat

still forum
#

Yep. I think in Arma 2 the background was a mission with a scripted Camera. Changed ofcause in Apex as they somewhat removed that

tame portal
#

Basically Im making the main menu for Desolation Redux and I want character customization in it like in DayZ but that obviously only works with predefined positions ^^

#

In ArmA 3 its the same

#

A dialog that gets opened

#

RscDisplayMain

#

and a mission that runs in the background

#

both can interact with each other

plucky beacon
#

What do people use nowadays for cameras instead of SQS anyway

tame portal
#

createCamera

plucky beacon
#

ah

tame portal
still forum
#

SQF Kappa ๐Ÿ˜„

plucky beacon
#

nah man, hpp

#

I wanna create a better third person camera for fixed wing

#

where it rolls with the plane

#

It's a project for later, but ultimately I want to do it eventually

peak plover
#

Splendid camera for capturing camera positions. Then camCrate in sqf.

#

ohh

#

There's a third person camera mod

turbid thunder
#

Alright I need some scripting related help here. So, I have scripts that make AI mount vehicles on their own and move towards objectives, but somehow, especially after mounting vehicles, the AI simply gets stuck after completing their waypoint while other AI's seem to work just fine.
https://gist.github.com/anonymous/0e7eed06224f6f4cba792e39ede840a2
This is the first script which allows AI's to chase down the player with vehicles. Unfortunatly, spectator mode breaks adding units to arrays because the spectator mode gives every unnamed unit a name, and then it doesn't match the _coparray anymore. Does someone know a good way to give units a var name (like the units "name" field in the editor) via scripting & so that I can keep spawning more and more AI and they all have a unique name?

Next: The AI that refuses to move after mounting vehicles. Especially with my conquest AI https://gist.github.com/anonymous/8c1c9e0885777048bf5f2f21da90d888 I experience the issue that they mount up tanks, roll towards an objective, and then just camp there. Somehow it happens rather frequently that they don't realize that the objective has been captured and they get stuck, while AI's spawn there and take the vehicles there just fine. Infantry also seems to have no issue moving away from captured objectives, but it isn't rare that tanks get stuck at the flag. I would highly appriciate if someone could look through both scripts and figure out why the AI sometimes refuse to drive.

Ping me if someone has an idea so I notice it because it will be a while before I come back online. And yes, I know that the conquest AI script is a giant mess right now because blufor and opfor script parts are seperate which is bullshit but my issue exists in both scripts, probably ยดmoveยด and ยดorderGetInยด don't go so well, because especially with the cop script I can clearly hear them giving the "move to grid XXXXYYYY" talk, yet their vehicle which is in perfect condition just doesnt move :/

peak plover
#

Try making the driver go in last.

#

As in. Before giving the car a waypoint. Move the driver out and in

#

I have the weirdest case of dejavu

little eagle
#

Always set your variables to private when you introduce them.

#

It's only "unnecessary" until that day everything breaks and you're looking through everything to find out why.

#

It makes virtually no difference when using the keyword.

cedar kindle
#

shouldn't it actually help if you have a longer scope chain

#

there's no reason to not use it tho

little eagle
#

If the variable is undefined I guess it could actually speed things up. But it doesn't matter. If you don't use private the variables scope is flagged as undefined-keep-looking.

#

private is about as "unnecessary" as tagging global variables.

turbid thunder
#

@commy2 its not breaking variables, its the AI ignpring a move order i know it recieved. Btw I never really understood the purpose private and why it would matter to have it :/

#

@nigel "out and in" well basically I should try to not mess with their waypoints while they attempt to mount a vehicle? Also moving the dude out and back in doesnt seem to change anything :s

hearty plover
#

@plucky beacon you really put me in the right direction man! Thanks so much!

plucky beacon
#

No problem! Convenient I made a similar mission last week ;)

hearty plover
#

What is the command for Units (player units) similar to canMove

#

Also, does canMove work on players?

cedar kindle
#

well players can always move so it should always report true

#

what do you need?

hearty plover
#

while {ACTION_PHASE} do {

  {  // start of forEach _players

    if (_debug1 isEqualTo false) then {
      systemChat "CHECKING FOR PLAYERS AT ALPHA";
      sleep 0.5;
      _debug1 = true;
    };

    systemChat format["Checking for %1 on Alpha", _x];
    if ((!isNull _x) && (isPlayer _x) && (alive _x)) then {
      systemChat format["%1 is on Alpha", _x];
      // check distance of all players to that of the point.
      if (_x distance (getPos ALPHA_POLE) < CAP_RADIUS) then {

          systemChat "SOMEONE IS ON ALPHA!";
          [_x] call ff_setAlphaFlagStatus;
      }; // if in range of point
    }; // if not null

  } forEach TOTAL_CURRENT_PLAYERS;

  systemChat format["HANDLER LOOP: Alpha Ownership West = %1 | Alpha Ownership East = %2 |", APLHA_OWNERSHIP_WEST, APLHA_OWNERSHIP_EAST];

  sleep CAPTURE_INCR;

};```
#

So, this is my script I use to track players on a capture point.

#

I have a script for each of the three points.

#

I spawn each capture point script seprately.

#

I am getting ALLOT of odd stuff from this.

#

If a player is on the point, and they die, they can no longer capture points, even after respawn.

#

Sometimes, if you kill a player, you can no longer capture a point.

#

Any ideas on what could be causing all of these weird behaviors?

cerulean whale
#

I've been messing around with handleDamage and it seems the values of damage taken and damage player are not actually the same (handleDamage says 0.0184771 and damage player says 0.00346365)

#

Could anyone explain this?

#

Also, is there a way to override ArmA's respawn function (so no respawn, I want to implement my own system) via script? I currently have a handleDamage for 0.99 damage but that clashes with my point in my previous message as well as has no rag doll

jade abyss
#

Because there are 2 different kind of Damages (hitPoints and overall)

#

Don't ask why, it makes no sense at all.

#

For example: Drive with a car against a Tree. Check your OverallDamage and your Hitpoint Damage.

cerulean whale
#

I know hitPoint and overall but why is handleDamage any different to Damage player? does it get executed each time A hitpoint takes damage / for each hitpoint that does?

#

And is there a way to overide that default respawn via script? therefore I can add a custom respawn system?

jade abyss
#

Just don't active the RespawnSystem?

cerulean whale
#

I thought it was default unless disabled?

jade abyss
#

initPlayerLocal.sqf

player addEventHandler ["Respawn",                    {call My_fnc_ToHandleTheRespawn; true} ];```
#

There is respawn, unless you define it in the description or mission

cerulean whale
#

Yes but I want a custom respawn timer script as well... which that is only for onRespawn....

jade abyss
#

Just guess, what i pasted above.

cerulean whale
#

So then if I don't activate the respawn system in description.ext my body will just lay there, correct?

jade abyss
#

Basicly, "custom"-Respawn is just a "I respawn on a remote Island, then creating a Cam somewhere else and startsome fancy UI stuff. When time is over/selection is done: I spawn the previously created Unit to the designated position"

#

@cerulean whale
+You might also need that stuff

player addEventHandler ["killed",                    {call MyTag_fnc_Handle_Killed} ];
MyTag_fnc_Handle_Killed =
{
    _Player = _this select 0;
    _Killer = _this select 1;
    _VehKiller = _this select 2;

    //set up SepctatorCam
    MyTag_OldBody = _Player;
    MyTag_DeathCam  = "CAMERA" camCreate (getPosATL MyTag_OldBody);
    showCinemaBorder TRUE;
    MyTag_DeathCam cameraEffect ["Internal","Back"];
    MyTag_DeathCam camSetTarget MyTag_OldBody;
    MyTag_DeathCam camSetRelPos [0,3,4];
    MyTag_DeathCam camSetFocus [60,0];
    MyTag_DeathCam camSetFOV 0.5;

    MyTag_DeathCam camCommit 0;
    
    [] spawn
    {
        sleep 5;
        camDestroy MyTag_DeathCam;
        systemchat "Cam destroyed";
    };
};

*updated

#

+maybe add this also

(findDisplay 415000) displaySetEventHandler ["KeyDown","if((_this select 1) isEqualTo 1) then {true}"];        //Disable ESC```
cerulean whale
#

I've already got a setup like that for my current system. It's just that I use a stupid handleDamage system that doesn't actually kill the player ๐Ÿ˜›

jade abyss
#

Check your Files, wich kind of Respawn you use

#

iirc, some BI-Respawn stuff has overwritten userAdded EHs

#

(e.g. Description.ext:

respawn = BASE;
//respawnDelay = 4;
respawnDelay = 1;
respawnDialog = 0;
respawnButton = 1;
respawnOnStart = -1;```
Those were my settings. (i also had a "custom"-RespawnMenu)
cerulean whale
#

How would you save the players body to delete afterwards if the script runs after they are already dead?

#

because won't it unassign the player from it?

turbid thunder
#

@hearty plover I have a script that allows capping points aswell. I can share it with you once I'm home so you can take a look at it. Works in a single loop with an infinite amount of capture points depending on how many you wish there to be. Also with marker + respawn on owned flags

hearty plover
#

Nice, thanks man would love a look see.

jade abyss
#

Store the Body in a Variable @cerulean whale

cerulean whale
#

Yes, but after they die won't it unassign the model? @jade abyss

jade abyss
#

Check above - I updated my example.

#

Yes, they will. AFTER the EH Killed was executed.

cerulean whale
#

Ah

turbid thunder
#

@hearty plover Just try to remind me in about 8 hours or so that i dont forget :D

jade abyss
#

Inside that example, you can (for example) get the whole Gear of the dead Person. After he respawned -> Assign it to the new one and deleteVehicle the old body or empty the Corpse.

cerulean whale
#

I assumed it did it before. ๐Ÿ˜› seeing it was as onPlayerKilled, but that makes sense. I'll rig this new system up in an hour or so. ๐Ÿ˜› Still a pain in the ass that there is no disableRespawn optino

#

that would be so useful lol

jade abyss
#

Read what i wrote above

cerulean whale
#

Ye I get it, I just tested it ingame

jade abyss
#

10min ago

cerulean whale
#

ik wat u were talking about

#

but it would be easier if you didn't have to respawn a dummy model in 'debug'

jade abyss
#

You CAN Disable Respawn respawn, soo... your sentence Still a pain in the ass that there is no disableRespawn optino that would be so useful lol
was just wrong ๐Ÿ˜‰

#

hu?

#

Respawn a dummy model in debug for what?

#

<- confused

cerulean whale
#

Yes, but that's in a slightly different context to what I'm meaning

#

don't worry bout it lol

#

Anyway, I need to get off for the night, it's late af already, talk to you lot tomorrow or something lol

#

thanks for the help @jade abyss

jade abyss
#

kk

hearty plover
#

@turbid thunder I will sir, and thanks again.

tough abyss
#

I'm using vectorCrossProduct when dealing with vectors, this make me proud of my self (tear). And have the feeling no one using vectors can left it behind.

#

Just moving my right hand like a retard to know direction of new vector.

#

Ooops sorry for off-topic...

#

You can use it in sequence to reach the vector you want.

civic maple
#

lol

plucky beacon
#

There's one issue I've been meaning to solve for a while now. When making multiplayer missions I sometimes reference playable units using their variable name, but when a player doesn't take that unit it doesn't exist and outputs an error. I've used if (!isNil "unit_name") then {...} before but it's frustrating to go through each unit and do that. Is there a better solution?

little eagle
#

isNil has one L

indigo snow
#

there isnt really a nicer solution. you can missionNamespace getVariable ["unit_name",objNull] too but that plays out mostly the same.

maybe arrayOfExistingUnits = arrayOfUnits arrayIntersect arrayOfUnits

#

i forget how that command handles nil

plucky beacon
#

well part of the problem is Nil only reads strings

little eagle
#

You could:

  • use missionNamespace getVariable like ^
  • define all unit names you use as objNull as default values before doing anything with the variables
  • stop using the scheduled environment
plucky beacon
#

so I can't ask isNil Unit_1 it has to be "Unit_1"

little eagle
#

Why is that a problem?

plucky beacon
#

If using an array of variables

little eagle
#

?

plucky beacon
#

[unit_1,unit_2] can't be asked isNil

halcyon crypt
#

if (isNil (str _x)) then {}

#

in a foreach ๐Ÿ‘

#

no that won't work

#

lol

little eagle
#

lol

#
{
    {
        _x setDamage 1;
    } forEach [unit1, unit2];
} call CBA_fnc_directCall;

this works

plucky beacon
#

what?

#

killing them?

little eagle
#

sure. or whatever else you want to do with them

plucky beacon
#

oh you mean directCall

indigo snow
#

directCall is for executing unscheduled from inside scheduled, right?

little eagle
#

Yeah.

jade abyss
#

So basicly, a []spawn ?

little eagle
#

The other way around, Dscha.

#

But seriously. I'd just define the variables as objNull at the start of the script.

jade abyss
#

uh, kk.

halcyon crypt
#

isNil is unscheduled no matter what? ๐Ÿ˜ฎ

little eagle
#

They made it that way for whatever reason.

halcyon crypt
#

weird

little eagle
#

I guess so you can use.

isNil {_undefined};
plucky beacon
#

is SQF a language supported by discord now too?

#

for code formatting

#
{
    {
        if    (alive _x) then 
        {
            _aliveUnits pushBack _x;
        };
    } forEach _ListOfUnits;
} call CBA_fnc_directCall;
#

I guess so

indigo snow
#

i dont think you can use local vars with directCall, you'd have to use the return value

#
private _aliveUnits = [{_this select {alive _x}},_listOfUnits] call CBA_fnc_directCall;
halcyon crypt
#

or pass _aliveUnits as a reference

indigo snow
#

no i think the way CBA handles it is store it and they have a nonscheduled script elsewhere running the code

#

e.g. in a different scope

halcyon crypt
#

nope

indigo snow
#

ah cool

halcyon crypt
#

it's using isNil to do it's unscheduled business

indigo snow
#

nice shit

plucky beacon
#

now for the final concatenation

        private _activeUnits = [{_this select {alive _x}},_listOfUnits] call CBA_fnc_directCall;
        _aliveUnits = { (alive _x && side _X == West) } count _activeUnits ;
//turned into this...
        private _activeUnits = [{_this select {alive _x && side _X == West}},_listOfUnits] call CBA_fnc_directCall;
                _aliveUnits = count _activeUnits;

this should work?

indigo snow
#

do you need both the list and the count?

#

and do you have _listOfUnits defined?

plucky beacon
#

no, just need the count

indigo snow
#

then just count in directCall

plucky beacon
#

listofunits is defined ya

indigo snow
#
private _aliveCount = {{alive _x && {side _x == west}} count _listOfUnits} call CBA_fnc_directCall;
plucky beacon
#

mm that's a spicy line of code

#

replaces my 14 line mess I made last week

#

Thanks

#

most of my code is commented out versions of worse algorithms

indigo snow
#

its good for learning

plucky beacon
#

I like to keep it like that until I have a 100% working project

#

I'm having this one big where my mission ends right at the beginning 1/5 of the time, I'll have to look into it later.

#

This way of using DirectCall to count though might help

jade abyss
#
cptnnick - Today at 3:46 PM
private _aliveCount = {{alive _x && {side _x == west}} count _listOfUnits} call CBA_fnc_directCall;
(edited)```
Why call directCall?! oO
indigo snow
#

read up

jade abyss
#

Should be more then enough.

_aliveCount = {alive _x && {side _x == west}} count _listOfUnits;
plucky beacon
#

But what about when a variable in _listOfUnits; is nil?

#

null or nil?

#

whats the diffrence

jade abyss
#

Why should it be?

indigo snow
#

it errors in scheduled

#

as soon as it encounters a nil value

little eagle
#

nil - undefined
null - objNull, groupNull, configNull etc.

plucky beacon
#

@jade abyss if a player doesn't take the unit slot in the lobby, the unit doesn't exist

#

puts an error

little eagle
#

grpNull*

jade abyss
#

Uhm, yeah? And?
But you must have at least one guy ingame, so that list should be filled.

plucky beacon
#

So null is just empty not undefined

jade abyss
#

Yep

#

What Commy wrote,
nil = Does not exist
Null = Exists, but empty/nothing assigned

plucky beacon
#

okay

little eagle
#

empty and with a type. objNull is an object. nil could be an object, number, string ...

jade abyss
#

โ˜

little eagle
#

But you must have at least one guy ingame, so that list should be filled.
It would error when any of the _x are undefined. Not if all of them are.

deft zealot
#
if (local _vehicle) then {
    _vehicle setFuel 1;
};

Can locality of the vehicle change between line one and two?

little eagle
#

But you'd need another line like that to even make the array.

#

In scheduled environment, yes

#

In unscheduled environment no

jade abyss
#

Where is _listOfUnits assigned + with what?

plucky beacon
#

so you're saying that as long as one of the units in the list exist the count should still work even with an error. i.e. Leader_1 exists, Leader_2 doesn't, Leader_3 exists, the rest don't. Return count 2.

_BluforUnits = [Leader_1,Leader_2,Leader_3,FTL_1,FTL_2,FTL_3];

_aliveCount = {alive _x && {side _x == west}} count _BluforUnits;
little eagle
#

That would error in scheduled environment if any one of these are undefined

#

It would be fine in unscheduled environent

plucky beacon
#

right that's what I experienced

jade abyss
#

Oh my oO

indigo snow
#

as an aside, arrayIntersect doesnt error in scheduled when it encounters nil. so thats an option too.

little eagle
#

A3 CTF game mode confirmed

indigo snow
#

"because they need it"

plucky beacon
#

I feel like I'm being graded

#

will there be a test?

jade abyss
#

Of course

indigo snow
#

everyone is super judging you RN

plucky beacon
#

I'm embawessed

jade abyss
#

If you fail -> You become a life-Scripter.

plucky beacon
#

NOOOOO

jade abyss
#

muhahahhahahahahahaahaha

little eagle
#

I feel like I'm being graded
That's the point of this channel.

jade abyss
#

@plucky beacon
But still, why don't you just assign the Vars, right at the start like FTL_1 = ObjNull; ?

plucky beacon
#

so you're saying forEach _BluforUnits _x = ObjNull?

little eagle
#

You'd have to do that in preInit to not overwrite them. Or use isNil I guess (and hope the scheduler doesn't screw you over)

plucky beacon
#

I don't know what that would do

jade abyss
#

was just about to write it that one, yeah.

#

preInit not rly needed. Init should be enough (serverSide)

indigo snow
#

your current shit works Nitro dont worry about it too much

jade abyss
#

....

plucky beacon
#

but I wanna be the best @indigo snow !

jade abyss
#

gl

indigo snow
#

there are other ways that arent necessarily better

jade abyss
#

Yep

indigo snow
#

sometimes its fun to discuss them but that doesnt make it work less well

plucky beacon
#

I know but whenever I hear of a way of doing something I haven't heard before I wanna know

jade abyss
#

Some alternatives might be better or worse. Many ways to accomplish your goal + don't mind toooo much about a 0.2-0.3ms difference.

plucky beacon
#

so my first reaction is to ask

#

and I don't know what FTL_3 = ObjNull would do if FTL_3 isNil still

jade abyss
#

wut?

indigo snow
#
_BluforUnits = [Leader_1,Leader_2,Leader_3,FTL_1,FTL_2,FTL_3];
_aliveCount = {alive _x && {side _x == west}} count (_BluforUnits arrayIntersect _BluforUnits);

another way

jade abyss
#

It wouldn't be isNil oO since its a NULL

indigo snow
#

youd overwrite it Nitro, so its whatever it is then

#

(objNull)

plucky beacon
#

Oh I'm sorry

#

it's an assighnment not comparetor

#

right

little eagle
#

You can obviously assign variables that are previously undefined.

#

You just can't use them on the right side of the assignment operator or any other expression sometimes because Arma

jade abyss
#

And thats a sentence, you wil see/hear/think pretty often: "Because: Arma".

plucky beacon
#

Had that first hand, especially whenever trying to get AI to do something specific

deft zealot
#

it might be the same for all playX commands

indigo snow
#

Command doesn't seem to be functional

plucky beacon
#

lol

plucky beacon
#

who does remoteexec reference when referring to targets as 1 or -1