#arma3_scripting

1 messages ยท Page 210 of 1

bold rivet
#

I want to make an anti troll kinda thing since I saw a lot of people crashing drones into friendly helis. I will take a look at handle damage, appriciate the help

errant iron
#

hmm, that's not something i've tested with my safezone system yet, let me see how that goes

bold rivet
#

Im gonna try to combine it with UAVControl command

#

I will see how it goes

errant iron
#

this is the logic i used, if you're curious: sqf _vehicle addEventHandler ["HandleDamage", {call { params ["_unit", "", "", "", "", "_hitIndex"]; if (!call WHF_fnc_isFriendlyFire) exitWith {}; if (_hitIndex >= 0) then {_unit getHitIndex _hitIndex} else {damage _unit} }}]; sqf // fn_isFriendlyFire.sqf params ["_unit", "", "", "_source", "", "", "_instigator"]; private _sideA = side group _unit; // with blufor default for empty vics private _sideB = side group _instigator; _sideA isEqualTo _sideB

bold rivet
#

Yeah, you prolly wont be able to stop people from doing that, but I at least want to get their name. Because the problem you have is that you dont even know who controlled the drone

#

Im trying to do that with UavControl right now, and it does work to some extend, but I have to use a while loop for every drone to check if someone is using it, and thats not optimal I would say

errant iron
#

hmm, printing _instigator simply returned null the entire time, but _source appeared to contain the drone object on some calls, and using UAVControl on that briefly gave me the player unit

bold rivet
#

If you use the UAVControll inside the handle damage EH and you crash it, it did show the name? Cuz the problem I had was that since the drone died, it did not show who was conencted to it

errant iron
#

ergh, sometimes it reported the name but usually aggressive crashes showed nothing: sqf _this addEventHandler ["HandleDamage", { params ["", "", "", "_source", "", "", "_instigator"]; if (isNull _instigator) then {_instigator = UAVControl vehicle _source # 0}; if (isNull _instigator) then {_instigator = _source}; if (isPlayer _instigator) then {[name _instigator] remoteExec ["systemChat"]}; }];

bold rivet
#

How do I do the sqf code highlight thing again?

errant iron
#

perhaps it's because the drone dies first and the player is disconnected from it, then the wreck destroys the aircraft afterwards?

#

```sqf
```

bold rivet
#
[] spawn {

    while {alive this} do {
        _peopleConnectedToUAV = UAVControl this;
        _uavSlot1Name = name (_peopleConnectedToUAV select 0);
        _uavSlot1Role = _peopleConnectedToUAV select 1;
        
        _uavSlot2Name = name (_peopleConnectedToUAV select 2);
        _uavSlot2Role = _peopleConnectedToUAV select 3;
        
        if (_uavSlot1Role != "") then {
            systemChat format ["%1 is using a drone as %2", _uavSlot1Name, _uavSlot1Role];
            if (_uavSlot2Role != "") then {
                systemChat format ["%1 is using a drone as %2", _uavSlot2Name, _uavSlot2Role]; 
            };
        };
        sleep 1;
    };
};
#

It shows a name as soon as you enter driver or gunner, but its a while loop

#

:/

#

I assume having a ton of while loops constantly run on drones cant be healthy for a server, or its performance rather

errant iron
#

i might have got it, if you attribute the UAV controller when they first take control of it, you can use it as a fallback for when the drone is destroyed and the controller loses connection: ```sqf
addMissionEventHandler ["PlayerViewChanged", {
params ["_unit", "", "", "", "", "_uav"];
systemChat format ["view changed, unit: %1, uav: %2", name _unit, typeOf _uav];
_uav setVariable ["TGC_uav_controller", _unit, true];
}];

_this addEventHandler ["HandleDamage", {
params ["", "", "", "_source", "", "", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _source # 0};
if (isNull _instigator) then {_instigator = _source};
_instigator = _instigator getVariable ["TGC_uav_controller", _instigator];
if (isPlayer _instigator) then {[name _instigator] remoteExec ["systemChat"]};
}];```

bold rivet
#

Oh that looks good

#

Yeah imma give that a try

#

Thank you a lot !

errant iron
#

i assume PlayerViewChanged is local so you should add that on all clients

#

the handledamage is def local, so you'd do the same too

bold rivet
#

yeah, im gonna play arround with it alittle and see how it works

errant iron
#

hmm, sometimes it detects it correctly, other times it doesn't still...

#

printing source shows it sometimes thinks it's the aircraft itself that's doing the damage, rather than the drone wreck

#

but that's mostly when i crash into the body of the heli, hitting the rotor instead is more reliable at attributing the damage to the drone

bold rivet
#

So I made this now, and I guess this could work. If I add a killed eventhandler to it now and the drone killed itself, then I would count that as crash and save the variable in diag_log / .rtp file


if (!isNil "randomEHidk") then {
    removeMissionEventHandler ["PlayerViewChanged", randomEHidk];
};

randomEHidk = addMissionEventHandler ["PlayerViewChanged", {
    params ["_oldUnit", "_newUnit", "_vehicleIn", "_oldCameraOn", "_newCameraOn", "_uav"];


    [_uav] spawn {
        _uav = _this select 0;
        if (!isNull _uav) then {
            _peopleConnectedToUAV = UAVControl _uav;
            _uavSlot1Name = name (_peopleConnectedToUAV select 0);
            _uavSlot1Role = _peopleConnectedToUAV select 1;
            
            _uavSlot2Name = name (_peopleConnectedToUAV select 2);
            _uavSlot2Role = _peopleConnectedToUAV select 3;
            
            if (_uavSlot1Role != "") then {
                systemChat format ["%1 is using a drone as %2", _uavSlot1Name, _uavSlot1Role];
                _uav setVariable ["lastRegisterdSlot1User", _uavSlot1Name, true];
                if (_uavSlot2Role != "") then {
                    systemChat format ["%1 is using a drone as %2", _uavSlot2Name, _uavSlot2Role]; 
                    _uav setVariable ["lastRegisterdSlot2User", _uavSlot2Name, true];
                };
            };
        };
    };
}];
cobalt path
#

I was always a stranger to remoteexec, my question is how do I remote exec
mflamp1 switchLight "ON";?
Would it be smth like?
["mflamp1","ON"] remoteExec ["switchLight", 0,true];

hushed turtle
#

mflamp1 without quotes

cobalt path
#

THX!

eternal ingot
#

Can anyone help me with a chat.sqf file not working on trigger Activaiton? 2 files work,But the last 2 dont,Even tho the coding is right,If you want more info DM`S are open ๐Ÿ™‚

pallid palm
#

chat.sqf file ?

eternal ingot
#

so for dialogue is what i mean

#

with voice acting

pallid palm
#

oh hmmm

latent ridge
#

what does the code look like exactly for the execution bit (trigger side)

eternal ingot
#

like i know the stuff for it,But its just really weird how its not working for specific BIKB (Dialogue file)

eternal ingot
#

i have tried different activation types but will not trigger 4 me

latent ridge
#

all of your scripts are the exact same execution?

pallid palm
#

whats with the null = in there

latent ridge
pallid palm
#

just do [] execVM " .sqf";

eternal ingot
#

ya i just prefer to do it with nul in there because thats how i started off with doing it

pallid palm
#

well that is way out dated

latent ridge
#

that could possibly be part of the issue as its outdated

eternal ingot
#

will i remove all nul so?

pallid palm
#

don't keep doing things just because thats the way you always did it

eternal ingot
#

and put [] execVM "chat.sqf";

latent ridge
eternal ingot
#

alright ill try now

pallid palm
#

that null stuff was from way way back when the game did not work right yet: its just left over stuff no need to use it any more

granite sky
#

Dammaged is global argument, unlike all the other damage handlers. So it has its uses.

pallid palm
#

yes i was confused by that for some time also damage and dammage are 2 diff things

eternal ingot
#

ya nah still isnt working

#

i can send the code if you want

pallid palm
#

that would help

#

ill collor it for you

eternal ingot
#

wait what? colour

pallid palm
#
class Sentences
{
    class 3_Q_Line_5
    {
        text = ""
        speech[] = { "\chat\t5.ogg" };
        class Arguments {};
        actor = "Q";
    };

    class 3_WW_Line_6
    {
        text = ""
        speech[] = { "\chat\t6.ogg" };
        class Arguments {};
        actor = "WW";
    };

    class 3_Q_Line_7
    {
        text = ""
        speech[] = { "\chat\t7.ogg" };
        class Arguments {};
        actor = "Q";
    };
};

class Arguments {};
class Special {};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};



class CfgSentences
{
  class ConversationsAtBase
  {
     class 1
     {
        file = "1.bikb";
        #include "1.bikb"
     };
     class 2
     {
        file = "2.bikb";
        #include "2.bikb"
     };
     class 3
     {
        file = "3.bikb";
        #include "3.bikb"
     };
     class 4
     {
        file = "4.bikb";
        #include "4.bikb"
     };
  }; 
};
eternal ingot
#

oh thats cool

#

how do i do that?

pallid palm
#

rgr that m8

eternal ingot
#

rgr = ?

pallid palm
#

looks nice right

eternal ingot
#

ya it does

pallid palm
#

you know how to do that right

eternal ingot
#

nah

pallid palm
#

its easy

#

some one can text it to you

#

i cant seem to text it it right

eternal ingot
#

ok but what does rgr stand for?

pallid palm
#

roger

#

roger willco

eternal ingot
#

should have just said that

pallid palm
#

lol 0k

#

so lets get to fixing the script if it even needs fixed

eternal ingot
#

also the trigger is BluFor Not present,And there is blufor in it

pallid palm
#

i see hmmm

#

i don't see ant thing wrong hmmmm

#

with the script but im not the best

eternal ingot
#

like its weird,Its the same as the other 2 that work just different words and number like t6,t7,t8 etc

#

so annoying

pallid palm
#

hmmmm

#

yes maybe some one else can help us

#

let me keep looking at it more

latent ridge
#

put a hint at the end of the script see if its firing at all, could be a error within the script but Arma aint tossin anything about it

pallid palm
#

are the WW and Q correct

eternal ingot
#

hint as in hint "(Put words wanted to be said here)";

latent ridge
#

ye

pallid palm
#

"ok its getting to here" remoteExec ["hint", 0];

latent ridge
eternal ingot
#

alright so where do u want me to put it again?

pallid palm
#

at the end

eternal ingot
#

its on the zargabad map,Could that be a problem by chance?

pallid palm
#

just inside the scope

eternal ingot
#

im not good at this stuff ur saying no clue what the scope is eh

pallid palm
#

inside the last };

eternal ingot
#

startWithConsonant[] = {europe, university "hint hi how are ya"}; like that

hallow mortar
#

Do not do that

pallid palm
#

ok

eternal ingot
#

ill try that two secs

hallow mortar
#

That's config, not SQF script. You can't put SQF code like hint in there, except as expressions in config attributes.

pallid palm
#

w8 kikko is here we are saved

eternal ingot
#

kikko is the guy with N id assume

pallid palm
#

yes hes the best ever

eternal ingot
#

ya i see the tags or whatever

#

DLC and stuff

pallid palm
#

hes like the best guy for anything Arma

eternal ingot
#

and could the map Zargabad be a problem?

hallow mortar
#

The map shouldn't be an issue

pallid palm
#

and there is others as well but i think hes the best

hallow mortar
#

Give me a second, I don't use the Sentences system often so I'm just reading through it and seeing what's up

hallow mortar
eternal ingot
#

i remember trying to this same thing on a spearhead 1944 DLC map,But wouldnt work even for the first one so ya

flint topaz
#

Nah Nikko stinks ๐Ÿ˜‹

pallid palm
#

lol hahahahahaah lol

eternal ingot
#

so is N like a bohemia coder or what?

hallow mortar
#

Can you lay out for me how your code is set up in terms of files?

  • what is in the "chat.sqf" files you're executing?
  • where is your class Sentences ... config placed?
  • where is your class CfgSentences ... config placed?
hallow mortar
pallid palm
#

thats a vet collour yes hes great

eternal ingot
#

class CfgSentences
{
class ConversationsAtBase
{
class 1
{
file = "1.bikb";
#include "1.bikb"
};
class 2
{
file = "2.bikb";
#include "2.bikb"
};
class 3
{
file = "3.bikb";
#include "3.bikb"
};
class 4
{
file = "4.bikb";
#include "4.bikb"
};
};
};

Description.ext scotty colour plz?

pallid palm
#

meaning a vet of the game like really good guy

eternal ingot
#

["4", "ConversationsAtBase"] call bis_fnc_kbtell; this is a chat4.sqf file

pallid palm
#

Kikko can show you how to do that

eternal ingot
#

perfect

hallow mortar
#

For SQF code, replace cpp with sqf

eternal ingot
#

so at the start put the cpp? and ... at the end

hallow mortar
#

It's ` not .

eternal ingot
#

swap class CfgSentences with ccp?

hallow mortar
#

On my keyboard it's in the top left, but I dunno what shape yours is so it could be anywhere.

pallid palm
#

just copy what he put there

hallow mortar
eternal ingot
#

sorry i dont know what ur on about?

hallow mortar
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
pallid palm
#

you see now ?

eternal ingot
#

honestly nah,This is confusing me

pallid palm
#

copy what nikko put there

eternal ingot
#

can you not just do the code and add ur twist to it

hallow mortar
eternal ingot
#

oh for the colour?

#

i thought u were on about the coding for the script

pallid palm
#

yes for the collour

eternal ingot
#

let me try there

#

hi,Hello,Oi```
#

ahhhh right

pallid palm
#

woohoo yes ๐Ÿ™‚

hallow mortar
#

Remember, it's sqf for SQF code, and cpp for config

eternal ingot
#

so i put sqf instead of cpp when im trying to show the code?

#

shit didnt mean to do that

latent ridge
#

dont do what I do sometimes by accident and put a space after the sqf part lol

pallid palm
#

yes like cpp for the description.ext code

eternal ingot
#

ok so what do i do now with that error?

hallow mortar
# eternal ingot so i put ```sqf instead of ```cpp when im trying to show the code?

If it's SQF code, like with commands and stuff, that goes in an Editor field or an SQF file, you use sqf to tell Discord that's the language it needs to highlight for.
If it's config (has class and stuff, goes in description.ext), use cpp to tell Discord to think of it as C++ (it's not C++ but the syntax is close enough to work)

hallow mortar
eternal ingot
#

ya

#

ill send it all onto you if you want

#

its all in the same mission folder

#

nothing seperate

pallid palm
#

cool

#

can you show a pic of the mission folder tree

hallow mortar
#

You said 2 instances work and 2 don't. Which are which?

eternal ingot
#

so i have 4 bikb,4 chat.sqf,And a description.ext,Chat1.sqf and 2 work,3 and 4 dont

pallid palm
#

oh nice

hallow mortar
#

Can I see the exact contents of 3.bikb or 4.bikb, and the contents of chat3.sqf or chat4.sqf, please?

#

Also the attributes of whichever trigger is supposed to execute them

pallid palm
#

why is there no ( .ext ) at the end of the Description.ext

hallow mortar
eternal ingot
#

i cant colour it

latent ridge
#
ccc class Sentences
{
    class 3_Q_Line_5
    {
        text = ""
        speech[] = { "\chat\t5.ogg" };
        class Arguments {};
        actor = "Q";
    };

        class 3_N_Line_6
    {
        text = ""
        speech[] = { "\chat\t6.ogg" };
        class Arguments {};
        actor = "N";
    };

        class 3_Q_Line_7
    {
        text = ""
        speech[] = { "\chat\t7.ogg" };
        class Arguments {};
        actor = "Q";
    };
};

class Arguments {};
class Special {};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};...
eternal ingot
#

the three symbols black out and cant do it,Weird

hallow mortar
#

You must use ```cpp at the start and ``` at the end. You can't use ... instead.

#

They will appear a darker grey once Discord detects them, it's showing you it's detected them and will use code formatting. Like how it previews the italics if you type _text_.

eternal ingot
#

nah.Wont work,Blacks out and it skips a line instead of texting

pallid palm
#

๐Ÿ™

eternal ingot
#

cpp ["3", "ConversationsAtBase"] call bis_fnc_kbtell;

#

there we go

hallow mortar
#

Except for that being SQF, so use sqf. cpp is for config.

eternal ingot
#

??

pallid palm
#

just like Guardian was saying ๐Ÿ™‚

hallow mortar
#

Oh, hang on. Add a line break after sqf and before the actual code

latent ridge
#

press Shift+Enter

hallow mortar
#

I always forget

pallid palm
#

oh man so close ๐Ÿ™‚

latent ridge
#

sqf

{insert code here}

eternal ingot
#

anyways u know what it says

#

sqf ["3", "ConversationsAtBase"] call bis_fnc_kbtell;

latent ridge
#

after you type the sqf part hit Shift+Enter to make a new line then past your code

pallid palm
#

i always show it this way

#

```cpp
// your code here
```

latent ridge
#

that works too lol

hallow mortar
#

Well anyway, I don't see anything specifically wrong with what's posted so far. It all looks roughly right. The next thing to check would be the triggers themselves.

pallid palm
#

,,, ๐Ÿ™‚

eternal ingot
#

so sqf is for what? cpp is for?

hallow mortar
#

As I said a moment ago, SQF is for SQF code - executable code that you're putting in Editor code fields and in .sqf files

pallid palm
#

sqf is for sqf and cpp is for like config stuff

hallow mortar
#

CPP is for config, with class and such, which you're putting in description.ext

eternal ingot
#

right,Thanks

#

the triggers are right tho,Its Blufor - not present,Kill all of the enemys in the area = [] execVM "chat3.sqf";

#

and the next one chat4.sqf ofc

pallid palm
#

no = sign

hallow mortar
#

This isn't a criticism of you, more of a tip for troubleshooting: "it's right" isn't a substitute for the actual configuration. If everything was right, we wouldn't be troubleshooting :P

hallow mortar
# eternal ingot the triggers are right tho,Its Blufor - not present,Kill all of the enemys in th...

If you have that = in the actual code execution field, remove it.
What you had before was null = [] execVM ...
What that did was take the Script Handle, returned by execVM, and save it to a variable called null. The = sign is used for assigning values to variables. Doing this used to be necessary due to a bug in the Editor, but it's been fixed for years. So you don't need null, and you don't need = either because you're no longer assigning a value to any variable.

#

Doing null = [] execVM ... wouldn't actually break your script, it's just pointless. But having a lone = hanging out there would break it, because that's not valid syntax and it would confuse the game.

pallid palm
#

in the onActiveation of the trigger put

"Kill all of the enemys in the area" remoteExec ["hint", 0];
[] execVM "chat3.sqf";
eternal ingot
#

so [] execVM "chat2.sqf"; e.g.

hallow mortar
eternal ingot
#

i dont use hints unless absolutely necessary tbh

#

ok ill try that now

hallow mortar
#

There are more efficient ways of doing this, but we'll stick with this now, at least until we get it working like this, because it will work.

pallid palm
#

then remove the hint

hallow mortar
# eternal ingot ok ill try that now

If you try that and it still doesn't work, the next thing to check is whether the trigger is actually activating. Use a systemChat "trigger activated!" or something in its On Activation field to prove it. If the trigger activates but your script doesn't run, then the problem is with your script; if the trigger doesn't activate, then the problem is with the trigger.

pallid palm
#

i think he should have blufor presant maybe

eternal ingot
#

but if blurfor is present in the trigger it will just complete the task as the start of the mission no?

pallid palm
#

task what task you said nothing about a task ?

hallow mortar
#

Let's just take this step by step. Ideally, the steps I'm suggesting.

pallid palm
#

copy that

#

so 1 last thing does the trigger cover the whole map ?

#

or a small area

eternal ingot
#

alright so the code came up from N,So ya i think its the script but u said it was right so?

pallid palm
#

well it does look correct to me

#

so tell more about the trigger how big is it and are blufor in the trigger at start of mission

hallow mortar
#

Oh I see a potential problem. It's a classic too

hallow mortar
pallid palm
#

copy

eternal ingot
#

so its a custom size,Fits the people i want in it and yes their in in at the start of the mission

pallid palm
#

copy that

hallow mortar
#

In your .bikb files the text attribute is missing a ; at the end

eternal ingot
#

they have it

#

like that right?

#

and the ones that work dont have it either

pallid palm
#

he said in the .bikb files

eternal ingot
#

shit srry 2 secs

#
text = ""````
#

then i have the words in the quotes

#

no ;

hallow mortar
#

Yes, there should be a ; after the closing quote

eternal ingot
#

but the others work?

#

without it also

hallow mortar
#

It's possible the game might be able to recover from it in some cases, but going without it is not how it's supposed to be done. It's wrong. There can be consequences. You should fix it.

eternal ingot
#

ill try that now

pallid palm
#

thats because the script gets so far and the game says oh no no way ๐Ÿ™‚

azure portal
#

Possibly not the right spot for this, but does anyone know of a way to stop players from loading in prone when at altitude?

pallid palm
#

depends on how hight you want them i think

eternal ingot
#
so it says the path file - 3.bikb,Line 4: Config End of line encountered after Captain,Roadblock clear,Moving to next objective; (Words i have in there@```
azure portal
eternal ingot
#

are they in the plane or flying object?

hallow mortar
eternal ingot
#

and the game just quit when the trigger was completed

pallid palm
#

maybe you can use ```sqf
_player playMove "Stand";

eternal ingot
#
class 3_Q_Line_5
    {
        text = "Capatin,Roadblock clear,Moving to next objective;
        speech[] = { "\chat\t5.ogg" };
        class Arguments {};
        actor = "Q";
    };```
hallow mortar
eternal ingot
#

oh fuck,Let me try again ๐Ÿ™

azure portal
eternal ingot
#

standing but are they in the object? like a seat for example

pallid palm
#

and when they jump out they go into skydiving mode ?

#

is that what your saying

azure portal
#

Hold on, I'll screenshot it

#

Just standing, not in a seat or anything. Idea is to open up the back when they're ready and jump out to skydive

pallid palm
#

so the plane is floting on the water ? like

azure portal
#

The plane is on a concrete pier piece floating 8km in the air

pallid palm
#

ahhh ok

hallow mortar
eternal ingot
#

ya,Still not working even when corrected

pallid palm
#

8 m should not put you into freefall mode

hallow mortar
pallid palm
#

oh shit ok lol my bad lol ๐Ÿ™‚

hallow mortar
#

Look I appreciate you're trying to help, but the first step to having a helpful response is actually reading what the other person wrote

pallid palm
#

yes yes thx for giving me hell i like it ๐Ÿ™‚ it only makes me better ๐Ÿ™‚

hallow mortar
pallid palm
#

how the hell did i miss that dam ๐Ÿ™

#

so this is a Halo jump em i right

azure portal
#

Does this look obviously wrong to anyone? Arma hasn't thrown a flag just from putting it into the init so far, about to test but wanted another set of eyes

[this, 8000] spawn {
    params ["_unit", "_altitude"];
    _unit setUnitFreeFallHeight _altitude;
    waitUntil { time > 1};
    _unit setUnitFreeFallHeight -1;
};
eternal ingot
#

how do ZIP it? i have never done that b4

pallid palm
#

right click on it

hallow mortar
#

Unless you're on Windows 11 and they've hidden it somewhere else, because Microsoft's decided they hate the context menu this time around. It might be in the Share tab at the top when you have the folder selected.

eternal ingot
#

ya nah i got it gimme a sec

azure portal
hallow mortar
pallid palm
#

nice

azure portal
#

Thanks fellas for reminding me of setUnitFreeFallHeight ๐Ÿ™‚

pallid palm
#

was Nikko i didnt do any thing but get in the way ๐Ÿ™‚

hallow mortar
pallid palm
#

oh oops

eternal ingot
#

right so i have the folder how to send it?

hallow mortar
#

rightclick on my name > message > drag the zip onto the message field > send

eternal ingot
#

i dont have nitro

hallow mortar
#

If it's big enough to need Nitro to send it, you should remove the audio files first

eternal ingot
#

ya i took em out

hallow mortar
#

the hell is in your mission

pallid palm
#

right click on Nikko's name then click on message

eternal ingot
pallid palm
#

oh shit w8 what

eternal ingot
#

thats all of it ther

#

like 40kb no?

hallow mortar
eternal ingot
#

i have 2 songs in there

#

4,790 KB

6,710 KB

hallow mortar
#

Songs are chonky and I don't need them. Take them out

eternal ingot
#

2 secs

#

and there might be a long delay between some tasks,Just wait like about 20-40 seconds for some,But its 3 minutes for the start so

pallid palm
#

hes not going to run the mission hes going to look at the files

eternal ingot
#

oh,Well if he wants too,There you go

hallow mortar
#

Thanks. I'll look at this. It might take a minute so stay cool.

pallid palm
#

lol back in Arma 3 Alpha i had this guy came in my server and he put all of us way up at like 30,000 m and we were stuck in freefall mode

pallid palm
#

i had to kick him and restart the server

#

yes

#

we even hit the ground and did not die but stayed in freefall mode

#

it was bad lol

#

i didnt have battle eye on so now i always do ๐Ÿ™‚

eternal ingot
#

is multiplayer good with arma 3?

pallid palm
#

hell yeah if you script correctly

eternal ingot
#

i played it once but i think it was just friends pissing about with zeus

pallid palm
#

well i dont use zeus i make my own missions from scrach

#

i think i made like 1000 missions by now

#

you know after playing for 10,000 hrs you want to make your own missions ๐Ÿ™‚

#

w8 letme see brb

#

make that 10,080 hrs woohoo ๐Ÿ™‚

#

lol

#

as a matter of fact i was just talking about the very 1st mission i made in Arma 3 last night in Gen Chat

#

it was fun

#

well i really started way back in OFP that was fun to but Arma is way way way better

#

i was talking to this 1 guy he has 23,000 hrs in Arma 3 i was like wow Awsome ๐Ÿ™‚

#

but tbh my missions would be lame with out guys like Nikko and others

#

them guys are Awsome and thx all you Awsome guys for helping me make my missions so Awsome ๐Ÿ™‚

latent ridge
#

So, I do have one small question about my script; I've added comments to each line to explain what I thought. however I am trying to get a object (like a statue) to "face" the players without leaning the object. However; I believe I messed something up since Arma is complaining about line 65 (which is the following part)

private _azimuth = _fgt getDir _nearestplayer;

I'm still kinda learning how to work with distance and arrays so any help would be great! this is suppose to loop which is already set up because my audio effect works as intended, just this block/section is where I am super stuck lol

if (count _players >0) then{ // Counts how many players are in the 
    // Check for Nearest Player
    private _nearestPlayer = objNull; // Variable nearestPlayer now represents Empty
    private _nearestDistance = 3001; // Variable nearestDistance now represents Max Distance of 3001 Meters
        
    if (_nearestPlayer != fgt) then{ // Variable nearestPlayer is checked to make sure its not FGT
    private _nearestPlayer = player distance fgt; // Variable _nearestPlayer now represents players distance from fgt
            
    if (_nearestPlayer <_nearestDistance) then{ // if the nearestPlayer is less than the nearestDistance
        private _azimuth = _fgt getDir _nearestplayer; // gets the direction of nearest player    
        _fgt setDir _azimuth; // sets the fgt to "face" the nearest player
    };
  };
};

if needed; I can copy/paste the whole Loop part of .sqf file lol

pallid palm
#

what do u mean by without leaning the object ?

hallow mortar
#

Since you've done this, after that point _nearestPlayer contains a number (the distance). You cannot use getDir on a number.

latent ridge
pallid palm
#

oh lol ok

#

what about fgt setDir getDir Player; or somthing like that

latent ridge
pallid palm
#

true that

latent ridge
#

but again; that logic now saying it out loud is kinda stupid lol

hallow mortar
#

Your usage of private is fine, what's not fine is changing the variable to be something else and then using it as if it still contained the original thing.

#

You can change variables to contain different things after defining them, there's no technical limitation on it, but you then have to remember that and treat them appropriately.

pallid palm
#

i just say in my head what i want to happed and then i make the script while im saying it in my head ๐Ÿ™‚

latent ridge
#

of course; so my question about that part is; could the private variable be called whatever? like private dingdong = [x,y,z]

hallow mortar
#

Well, private is used only for local scope variables, not global scope variables (global variables are inherently incompatible with the concept of a private variable), so it must start with a _. But otherwise yes.

latent ridge
#

well everything in this .sqf (those goes for 99% of all my .sqf's) wont talk to one another so private is fine
-# I think?

pallid palm
#

esample of local scope var's

private ["_fgt","_azimuth","_more","_here","_lol"];
``` ๐Ÿ™‚
hallow mortar
#

Yes. In fact, the majority of the time you define a local variable in any script, you're going to want it to be private. It's almost always the right choice.

#

(Actually, most of the time it won't cause a problem if it isn't, but it's better to be safe and there's no downside to doing so)

latent ridge
#

ok, I think I understand, so I should rename the

private _nearestPlayer = _player distance _fgt;

Also does the player and fgt need the _ too? cause rn they dont

hallow mortar
#

Really depends what you're doing.
You might want to reference the global variable fgt if it's an object's Editor variable name. On the other hand, if you've dynamically acquired a reference to it within this script, it's probably better to keep it as a local variable so you don't conflict with other scripts. (If you do use global vars, it's recommended to give them a more unique prefix to avoid collisions with other scripts and mods.)
player isn't a variable, it's a command that returns the player object on the current machine. So that one really really depends. If you need the return from that command...you have to use that command.

pallid palm
#

with out the underscore: its a global variable frt

latent ridge
#

ok so I should make sure fgt doesnt have the underscore as it is a object in the editor itself correct?

hallow mortar
old owl
#

I am always pretty anal about assigning private to my variables but also realistically in most cases doesn't matter. Only event it will really matter is if you call code with a variable of the same name then all of a sudden you're dealing with a really unfortunate to find bug. I tend to be anal about it because for me there really is not any reason not to use it. Except for maybe on frame event handlers where you want to save performance, even then though that is where syntax 2 of private comes in clutch

latent ridge
pallid palm
#

this may help some

#
//Server Run
if (!isServer) exitWith {};

//private local var
private ["_mrk","_vtype"];

//_mrk
_mrk = selectRandom ["Sub0","Sub1","Sub2","Sub3","Sub4"];

//SDV  is a global var
_vtype = "O_SDV_01_F";
SDV = createVehicle [_vtype, (getMarkerPos _mrk), [], 0, "NONE"];
SDV setDir 180;

//Submarine is global var
Submarine = "Submarine_01_F" createVehicle position SDV;
Submarine attachTo [SDV, [4.45, 0, 1]];
Submarine setDir 180;
latent ridge
old owl
#

NikkoJT is correct in everything he's been saying

#

I tend to generally use that syntax 99% of the time. If there is a bunch and performance is a concern, I'll tend to toss them in a private list like so:

private ["_var1", "_var2", "_var3", "_etc"];
hallow mortar
latent ridge
#

gotcha; well I mean the audio works so I'll just keep using what I got anyway (at the start of the entire .sqf I have private _fgt = fgt; anyway so either way you guys mention works lol)

old owl
latent ridge
#

does its cause confusion a bit? maybe but I'll get that sorted (kinda rushing with this script a little bc the op im doing is this Saturday and this part is taking a lot longer than i thought)

latent ridge
old owl
#

Also another reason why I was saying private doesn't really matter- although I tend to always use it out of best practice and readability

pallid palm
#

private does matter imho

#

like Nikko said if you don't use private then some mods and scripts could get corn fused ๐Ÿ™‚

old owl
#

I mean just varies on what you are using it for. If you had a bunch of Draw3D running on every frame, you wouldn't want to impact performance by using private a bunch

pallid palm
#

oh yeah i agree with that yes

pallid palm
#

why not just make the thing look at the leader ๐Ÿ™‚

#

lol

latent ridge
pallid palm
#

copy that m8

latent ridge
#

ok, I have returned lol, so I found a thing called "nearestObject" is that a outdated way of locating a player closest to an object?

warm hedge
#

I have no idea what or why is outdated. You want the player object, among of any players?

#

There is no command to do it automatically. Several commands combined will achieve it

latent ridge
granite sky
#

nearestObject is max 50m so it'd not normally useful for that.

latent ridge
#

yeah I read more into it and saw that literally seconds after sending that message. I was like well crap that aint gonna work lol

granite sky
#

nearestObjects can do it, although it's a bit expensive because it'll sort the lot. Otherwise you first get a list of players and then find the closest one of those.

latent ridge
#

yeah nah I need a distance of 3k meters lol

granite sky
#

There is actually no good way to do this in SQF but there are several bad ways.

latent ridge
#

let alone create one

granite sky
#

I mean there really should be a command that'll find the nearest of an array of objects, but there isn't.

latent ridge
#

ah yeah, I gotta take performance into account as I host the server and play on the same computer (local host)

granite sky
#

Fastest current method is this monstrosity:

private _distances = _objects apply { _x distance _pos };
_objects select (_distances find selectMin _distances);
warm hedge
#

Didn't thought of that find usage

latent ridge
#

so if I understand correctly;
distances = 3000m
_objects = the object im wanting the 3k to start at(?)
_x = player

warm hedge
#

No
distance is a command to get the distance between
_objects is the objects to find
_pos is the position of the object

granite sky
#

In this case _objects would be allPlayers or similar.

#

While _pos would be your "object" or the ATL position of it.

#

If you only care about closest in 2d then use distance2d instead.

#

playableUnits is probably better than allPlayers unless you want it to look at corpses.

#

You can prefilter down to players within 3km or not. Whether that's optimal depends on your mission.

#

If that 3km matters then it's probably best to prefilter.

warm hedge
#

I don't think that makes the process significantly faster tho

granite sky
#

It does if there's one player in radius and 99 out.

#

playableUnits inAreaArray [_pos, 3000, 3000]; anyway

latent ridge
#

ok so it would be this right?

private _distance2d = playableUnits apply { _x distance _fgt };
playableUnits select (_distance2d find selectMin _distance2d};

yeah I'll use playable units (I dont want my object focusing on a dead corpse lol.

warm hedge
#

Why you write _distance2d?

latent ridge
#

I dont need 3d, just 2d

warm hedge
#

No that is not he mean

latent ridge
#

oh gotcha

granite sky
#

distance and distance2d are the commands inside the apply.

#

_distances is just a variable name.

latent ridge
#

oooohhhh

warm hedge
#

_distances or _distance2d or _distanvekdodkshsocodjjwkdokvjdjkvk make no difference

#

Just your readability and preference

latent ridge
#

ok I gotchu, again, just trying to understand hence why I'm askin and showing my thought proccess lol

warm hedge
#

No need to clarify that. Everyone is here for that purpos

granite sky
#
private _nearPlayers = playableUnits inAreaArray [_fgt, 3000, 3000];
private _distances = _nearPlayers apply { _x distance2d _fgt };
private _nearestPlayer = _nearPlayers select (_distances find selectMin _distances};
#

If it's possible that there are no near players then you should handle that case.

#

Can be done neatly with call/exitwith like this:

private _nearestPlayer = call {
  private _nearPlayers = playableUnits inAreaArray [_fgt, 3000, 3000];
  if (_nearPlayers isEqualTo []) exitWith {objNull};
  private _distances = _nearPlayers apply { _x distance2d _fgt };
  _nearPlayers select (_distances find selectMin _distances};
};
latent ridge
#

sorry for the late reply lol

latent ridge
#

if so that is fine

granite sky
#

It's not terrible, written like that.

#

It should just be a lot better.

#

The apply part is pretty fast because of simpleVM.

latent ridge
granite sky
#

It's a thing Dedmen wrote that optimises some short loops.

latent ridge
#

gotcha

granite sky
#

So if you can rewrite an algorithm from one larger loop to two short ones it's often much faster.

latent ridge
#

oh so I shouldn't wrap everything into one loop? (give me a moment and I'll show what I currently got)

granite sky
#

The more obvious way to do nearest-object is something like this, but it's very slow because there's no way (at not least not that I've figured) to use simpleVM with it:

private _nearObject = objNull;
private _nearDist = 1e6;
{
  private _dist = _pos distance _x;
  if (_dist < _nearDist) then {
    _nearObject = _x;
    _nearDist = _dist;
  };
} forEach _objects;
#

Note that for what you're doing it's probably not a concern anyway.

#

you gotta know how often your code is being executed.

latent ridge
#

base line 10 seconds but it has a random +20 so its a 10-20 seconds... I plan to raise it later once I get it working to like 30-50 seconds

granite sky
#

yeah don't worry about it.

#

SQF is slow but it's not that slow.

latent ridge
granite sky
#

assuming your logic is correct, sure. It's just organisation.

latent ridge
#

additionally; here my probably very incomplete and nonsense script lol

while {alive fgt} do {
    private _randomSound = selectRandom _sounds;
    private _players = playableUnits;
    // hint format ["Voltage Tower playing: %1.ogg", _randomSound]; 

    playSound3D [
        getMissionPath format ["audio\%1.ogg", _randomSound],
        fgt,
        false,
        getPosASL fgt,
        5,
        1,
        3000
    ];
    
    private _nearPlayers = playableUnits inAreaArray [_fgt, 3000, 3000];
    if (count _players >0) then{ // Counts how many players are in the 
        // Check for Nearest Player
        private _distances = _nearPlayers apply { _x distance2d _fgt };
        private _nearestPlayer = _nearPlayers select (_distance find selectMin _distance);
        private _azimuth = _fgt getDir _nearestPlayer
        
        _fgt setDir _azimuth;
        
    };

    sleep (10 + random 20);  // waits 30โ€“50 seconds before next play
};
granite sky
#

yeah that's no good, you need to move the nearPlayers calc before the check.

latent ridge
#

wait I just realized

granite sky
#

Otherwise _nearPlayers could be empty even if _players isn't, and then bad things happen

latent ridge
#

yeah I was about to say... should I move all the private variables to where the private _randomSound is? so its at the start of the script

granite sky
#

Nah, keep them local where you can.

#

Style thing really, but if you keep the scope of a variable as small as possible then it makes it easier to read.

latent ridge
#

I mean, if its a "preferance" thing; I'd like to keep all the private variables stuff at the top so its easier for me to find them like how I got the private randomsound and players

#

but if that'll cause issues I'll move them as I need if that makes sense?

granite sky
#

Well, a lot of those vars can't have a legitimate value unless there are nearby players.

latent ridge
#

yeah so I should keep all those where they are but move the _nearPlayers before the if (count) check correct?

latent ridge
#

something of that sort? (maybe? lol)

granite sky
#

yes

latent ridge
#

sweet; now I just gotta figure out the whole _fgt setDir _azimuth; part

pallid palm
#

holy shit: i just made a Bad Ass Script where the Enemy select a random player from all the player group: and Attack you like Mad Dogs: WoW i stumbled on to something cool ๐Ÿ™‚ lol the "ghost" in the Mach. ๐Ÿ™‚

#

i got the idea from Lou hes Awsome

#

talk about a all out Rush lol wow

#

no disableing anything just good fun scripting ๐Ÿ™‚

#

the enemy attack so fast and hard: i can hardly kill a 6 enemy group ๐Ÿ™‚

#

of corse you can ajust the amount of Enemy in the group in the Params

#

holy shit them Enemy are Bas Ass mama jammers lol ๐Ÿ™‚ also what's really cool is the script keeps checking to see how many players are alive so they get included in the random player check

#

i even went in a house and tried to hide and they came in the house and Attacked me like mad dogs ๐Ÿ™‚

#

and they were nade-ing and shooting the hole time Wow

#

the script is only 22 lines

#

if you don't count the spaces and the comment out lines

#

the 1 time i got close to 2 objectives and both enemy groups from both objectives Attacked me also: holy moly that was intense.

#

the Attack player script: gets exec-ed from the enemy group script:

#

i had to fall back like 6 times just to live tho it all ๐Ÿ™‚

#

i was like Runnnn lol ๐Ÿ™‚

#

God i love Arma 3 woohoo

#

i cant w8 to host that missions and see how people deal with that ๐Ÿ™‚

#

max amount of respawns is 30 on a 10 player mission

#

but you can change that in the params also ๐Ÿ™‚

#
//Params
class Params
{
    class Respawn
    {//0
        title = "Respawn";
        values[] = { 0,10,11,15,20,30 };
        texts[] = 
        {
            "infinite Respawns",
            "10 Total Respawns",
            "Team Respawn",
            "15 Total Respawns",
            "20 Total Respawns",
            "30 Total Respawns"
        };
        default= 30;
        code = "";
    };
};
#

i like Team Respawn the Best: cuz when you die you go into Spectating mode till the last player dies and then we all respawn ๐Ÿ™‚

#

its more like real to me: you can only view blufor side when your dead:

#

but you better turn the Ai off so you dont have to w8 for they to die ๐Ÿ™‚

#

but sometimes you may want that so well you know

pallid palm
#

also i have this smooth Transition when you die from black schreen to spectating mode: and also on respawn: its cool i like it-------------------------------------------------------------------

indigo snow
#

funnily enough i remember someone a while ago trying to solve race conditions

odd kraken
#

i'm having an error that ive been stuck on for the past 4 hours, i need some help as im not good with scripting.

when a trigger is activated for a healthbar script for wbks, this shows up.
to explain the process, what im doing is

Spawn smasher with createunit, and give it the variable name of "IA"

Then a sleep goes off, where the full healthbar script is initiated. so far, it's not working and anytime i try to make it work, it either just stays static and doesn't progress/go down and doesn't go away once the boss is dead, I know the script works because the exact same one works with someone else, as i just copied it from them.

errant iron
# odd kraken i'm having an error that ive been stuck on for the past 4 hours, i need some hel...

trigger activation/conditions run in unscheduled environment, basically meaning your scripts are expected to run in a single frame, so they forbid sleeping inside them - you need to spawn your healthbar part in scheduled environment so it's allowed to run in the background, e.g. ```sqf
_unit = _group createUnit [...];
_unit spawn {
// in this block, _this = _unit
// (but you can keep using your IA variable too)
sleep 2;
systemChat format ["%1 has spawned!", name _this];
};

odd kraken
# errant iron trigger activation/conditions run in unscheduled environment, basically meaning ...
sqf 
if(isServer) then { 
a2 = createGroup east; 
"WBK_SpecialZombie_Smasher_Acid_3" createUnit [position a1, a2, "IA = this"]; 
}; 

IA spawn { 
       sleep 2; 
    systemChat format ["%1 has spawned!", IA _this]; 
}; 

[IA,""WBK_SynthHP"","Iradiated abomination] spawn { 
 if (isServer) exitWith {}; 
 params ["_unit","_param","_name"]; 
 _TB_Health_PIC = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", 20004];  
 _TB_Health_PIC ctrlSetPosition [0.319531 * safezoneW + safezoneX, 0.00500001 * safezoneH + safezoneY,0.0360937 * safezoneW,0.066 * safezoneH];  
 _TB_Health_PIC ctrlSetTextColor [1, 0.05, 0, 0.8];  
 _TB_Health_PIC ctrlSetText "\a3\ui_f\data\IGUI\Cfg\Revive\overlayIcons\f100_ca.paa"; 
 _TB_Health_PIC ctrlCommit 0;  
    _ctrlBackground_Health = findDisplay 46 ctrlCreate ["RscBackground", 20001]; 
    _ctrlBackground_Health ctrlSetPosition [0.355625 * safezoneW + safezoneX, 0.016 * safezoneH + safezoneY, 0.299062 * safezoneW, 0.044 * safezoneH];    
    _ctrlBackground_Health ctrlSetBackgroundColor [0.2, 0.2, 0.2, 0.3];    
    _ctrlBackground_Health ctrlEnable false;    
    _ctrlBackground_Health ctrlCommit 0; 
    _TB_Health_bar = findDisplay 46 ctrlCreate ["RscProgress", 20002]; 
    _TB_Health_bar ctrlSetPosition [0.360781 * safezoneW + safezoneX, 0.027 * safezoneH + safezoneY, 0.28875 * safezoneW, 0.022 * safezoneH];  
    _TB_Health_bar ctrlSetTextColor [1, 0.15, 0, 0.8]; 
    _TB_Health_bar progressSetPosition 1; 
    _TB_Health_bar ctrlCommit 0;  
    _TB_Health_HUD = findDisplay 46 ctrlCreate ["RscStructuredText", 20003]; 
    _TB_Health_HUD ctrlSetPosition [0.402031 * safezoneW + safezoneX, 0.0245 * safezoneH + safezoneY, 0.211406 * safezoneW, 0.025 * safezoneH]; 
    _TB_Health_HUD ctrlCommit 0; 
    _TB_Health_HUD ctrlSetStructuredText parseText format["<t color='#F7E8E8' align='center' size='1.1' font = 'PuristaMedium'>%1</t>",_name]; 
    _actFr = [{ 
        _array = _this select 0; 
        _mutant = _array select 0; 
        _param = _array select 1; 
        _hud = _array select 2; 
        _paramInitial = _array select 3; 
        _WBK_TB_paramHealthBarToShow =  (_mutant getVariable _param) / _paramInitial; 
        if !(alive _mutant) exitWith {_hud progressSetPosition 0;}; 
        _hud progressSetPosition _WBK_TB_paramHealthBarToShow; 
    }, 0.1, [_unit, _param,_TB_Health_bar, _unit getVariable _param]] call CBA_fnc_addPerFrameHandler; 
    waitUntil {!alive _unit}; 
 _TB_Health_PIC ctrlSetTextColor [1, 1, 1, 1];  
 _TB_Health_bar progressSetPosition 0; 
    [_actFr] call CBA_fnc_removePerFrameHandler; 
 { 
  _ctrl = (findDisplay 46) displayCtrl _x; 
  _ctrl ctrlSetFade 1; 
  _ctrl ctrlCommit 6; 
 } forEach [20001,20002,20003,20004]; 
 uiSleep 8; 
    ctrlDelete ((findDisplay 46) displayCtrl 20001); 
    ctrlDelete ((findDisplay 46) displayCtrl 20002); 
    ctrlDelete ((findDisplay 46) displayCtrl 20003); 
 ctrlDelete ((findDisplay 46) displayCtrl 20004); 
};```

so something like this?
errant iron
#

IA _this is a syntax error and the quotes are unclosed around the boss name, but otherwise ye you've got the idea

#

note that two separate spawn blocks will run at the same time, so sleeping in one block doesn't hold up other blocks

#

if you want the delay to apply to the healthbar part, you need to sleep inside that block specifically, e.g. sqf [IA, "WBK_SynthHP", "Irradiated Abomination"] spawn { sleep 2; ... };

pallid palm
#

@odd kraken and it might help if you collour the text to m8

#

```sqf
// your code here
```

#

that white text heart's my eye's lol ๐Ÿ™‚

odd kraken
#

ok?

#

i tried and it didn't work

pallid palm
#

copy and past that then remove all the \\

odd kraken
pallid palm
#

so you can see collour text

odd kraken
#

and the collurd text will do what exactly

pallid palm
#

help people read it better

#

and help you faster

odd kraken
#

i gotcha, fair enough

pallid palm
#

thats a roger m8

#

most times if people see that white code they say omg ouch ๐Ÿ™‚

#

took me some time to get it right also but you will get it right soon

odd kraken
#
[] spawn 
{ 
 if (isServer) then  
 { 
  a2 = createGroup east;  
  "WBK_SpecialZombie_Smasher_Acid_3" createUnit [position a1, a2, "IA = this"];  
 }; 
  
 waitUntil {!isNull IA}; 
  
 sleep 1; 
  
 waitUntil { !isNull findDisplay 46 }; 
 _para_HPBar1 = findDisplay 46 ctrlCreate ["RscProgress", -1];     
 _para_HPBar1 ctrlSetPosition [0.2 * safezoneW + safezoneX, 0.05 * safezoneH + safezoneY, 0.6* safezoneW, 0.011* safezoneH];      
 _para_HPBar1 progressSetPosition 1; 
 _para_HPBar1 ctrlSetTextColor [0.1,0.1,0.1,0.8];   
 _para_HPBar1 ctrlShow true;         
 _para_HPBar1 ctrlCommit 0;         
  
 _para_HPBar2 = findDisplay 46 ctrlCreate ["RscProgress", -1];       
 _para_HPBar2 ctrlSetPosition [0.2 * safezoneW + safezoneX, 0.05 * safezoneH + safezoneY, 0.6* safezoneW, 0.011* safezoneH];   
 _para_HPBar2 progressSetPosition 1; 
 _para_HPBar2 ctrlSetTextColor [0,1,0,0.9];    
 _para_HPBar2 ctrlShow true;      
 _para_HPBar2 ctrlCommit 0;           
  
 _para_Name = findDisplay 46 ctrlCreate ["RscStructuredText", -1];          
 _para_Name ctrlSetPosition [0.45 * safezoneW + safezoneX, 0.02 * safezoneH + safezoneY, 0.1* safezoneW, 0.09 * safezoneH];   
 _para_Name ctrlSetTextColor [1, 0, 0, 1];   
 _para_Name ctrlSetFont "puristaMedium";   
 _para_Name ctrlSetStructuredText parseText format ["<t align='center' size='1.3' shadow='2'> ????? </t>"];     
 _para_Name ctrlShow true;  
 _para_Name ctrlCommit 0;   
  
 _para_maxHP = IA getVariable ["WBK_SynthHP", 0];  
  
 while {true} do    
 {    
  _para_currentHP = IA getVariable ["WBK_SynthHP", 0];  
  _para_progress = linearConversion [0, _para_maxHP, _para_currentHP, 0, 1, true];    
  _para_HPBar2 progressSetPosition _para_progress;    
  
  if (damage IA >= 1) then  
  {  
   IA setVariable ["WBK_SynthHP", 0];  
   _para_HPBar2 progressSetPosition 0;  
  
   ctrlDelete _para_HPBar1;  
   ctrlDelete _para_HPBar2;  
   ctrlDelete _para_Name;  
   break;  
  };  
  sleep 0.01;   
playMusic "SoldatsMusicSong93";
 }; 
};

So a really talented scripter made this,(i only added the play music part) but this seems to not work in a dedicated server, any reason for this?

winter rose
odd kraken
#

oh, what would work then?

finite bone
#

What are you trying to achieve (or more importantly, where are you running this)?

odd kraken
#

it spawns a smasher from webknights zombies and creatures mod, where a a boss health bar get put up on the screen

#

and im running this on a host havoc server in a innit of a hold action, which worked in eden, but not in mp

pallid palm
#

hay @odd kraken you got the text collour woohoo good job m8

cosmic lichen
#

otherwise the code wrapped in isServerwill not execute as the holdAction code only runs on the client who activated the action

odd kraken
#

how would i remote exec it?

cosmic lichen
paper drift
#

I want to make planned artillery support for the mission

#

help

winter rose
#

help delivered ใƒŽ( ยบ _ ยบใƒŽ)

paper drift
#

โค๏ธ

sharp stag
#

Not sure if this is the best chat to ask this on, but looking for someone to help me put together a server with mods? Willing to pay if we can agree on a price. Ive tried to do it on my own but im not super experienced and have had to alter the name of every single mod for it to work, on top of that my internet isn't super fast so uploading the modpack has taken days ๐Ÿ˜…

pallid palm
#

not allowd to pay

#

but you can buy them a beer ๐Ÿ™‚

finite bone
sharp stag
sharp stag
sharp stag
pallid palm
#

Hello All: Can i do this: or How would i do this:

#
SDV setCenterOfMass selectRandom [ "[[2,0,-1], 12]", "[[-2,0,-1], 12]" ];
winter rose
#

without the quotes

pallid palm
#

oh really nice

winter rose
#

actually```sqf
SDV setCenterOfMass [[selectRandom [2, -2],0,-1], 12];

pallid palm
#

oh cool Awsome man thax Lou

#

man thats So Cool Woohoo ๐Ÿ™‚

pallid palm
#

OMG @winter rose that works So Awsome: Woohoo THX man

#

now it looks so real woohoo

obtuse depot
#

hello script chat

#

does anyone have examples of the cadet popup code being executed on spawning into a multiplayer mission

latent ridge
granite sky
#

You had a typo there. nearestPlayer is missing the underscore.

#

Earlier version was missing a semicolon.

obtuse depot
pallid palm
#

@obtuse depot about the spawning into a MP mission: i Guess the placement of the HintC: would be the bees Knees: on that ๐Ÿ™‚

#
// MP mission
// most likely in the initPlayerLocal.sqf
if (!isServer && isNull player) then 
{
    waitUntil { not isNull player };
    "Your message" remoteExec ["hintC", 0]; // 0 means all clients
};

//or
//=============================================================
"Your message" remoteExec ["hintC", 0]; // 0 means all clients

//or
//==============================================================
//Displaying a hint to a specific group of players:
// Assuming   'USMC'   is the name of a specific group
{
    "Your message for the group" remoteExec ["hintC", _x];
} forEach units USMC;

//can use:===================================================
"Your message for the group" remoteExec ["hintC", USMC];
mortal folio
#

Is there a way to temporarily hide the vanilla heal action?

#

I could handleHeal and just make it do nothing but i dont want the players to be confused

warm hedge
#

Remove FAK from the inventory that is. I don't believe there is a way other than that

warm hedge
#

Speaking of, removing Engine-defined actions would be a niche idea

#

Oh wait, one thing. Try showHUD if it is acceptable to hide all actions

mortal folio
ivory lake
#

can be kinda done via config iirc

#

but dont think there's a clean scripted way

obtuse depot
sullen marsh
#

LOCKING M8

#

Or atomic operations

tribal crane
#

Send queue update commands to the server and have the server do the actual updates.

tulip ridge
#

That's pretty sad to go out of your way to do that

teal drum
#

Which 3den attribute and which value do I apply to AI units to disable their Wake-Up Dynamic Simulation attribute via SQF?

#

ignoreByDynSimulGrid is the attribute I see in my mission.sqm file on a unit I manually uncheck that attribute on, but applying that via SQF doesn't seem to have an effect.

obtuse depot
teal drum
#

Oh. select 1 is iterating over the groups...

Got it to work:

{
  {
    private _isPlayable = (_x get3DENAttribute "ControlMP") select 0;
    if !(_isPlayable) then {
      _x set3DENAttribute ["addToDynSimGrid", 1];
    };
  } forEach (units _x);
} foreach (all3DENEntities select 1);
winter rose
obtuse depot
#

diabolical...

winter rose
obtuse depot
#

ngl it's a bit of both

#

๐Ÿ˜ญ

tulip ridge
#

This is about their mod causing CTDs for people, and then telling people to go touch grass when people got annoyed because its a holiday

obtuse depot
#

lol
updated the mod and then it broke and we fixed it

#

it is what it is

winter rose
#

yyyyyyeah, don't CTD people ๐Ÿ‘€ (on purpose)

obtuse depot
#

was a dumb binarize error bc temp folder needed to be cleaned lmao

molten wyvern
#

holy copium

granite sky
drowsy geyser
winter rose
drowsy geyser
#

Thanks, i need to read about dedicated server stuff

granite sky
#

As far as I can tell, you could just change the first then to exitWith and it'd probably work.

#

That'd break localhost though, so better to add if (!hasInterface) exitWith {}; afterwards.

#

Everything except the createUnit looks like client-only stuff.

obtuse depot
austere granite
#

Does anyone know how you can color items in a treeview? Eden does it for the entity lists, but using parseText with <t color='blabla'> doesn't work

small perch
#

I want to add a hold action for an object that only shows up for the Zeus, how can I do that? I know the hold action part but i do not know how to check if the unit that is looking has the right Variable Name

stable dune
torn stream
#

what situation would cause a server to not pass (isServer) ? several scripts that use an If(IsServer) don't go through in this particular server

warm hedge
#

You sure it is the only about isServer? Or any other commands?

torn stream
#

unsure, the script was supposed to add an eventHandler that was within isServer condition, i had to swap to true, now another script that also uses that is not running, as if whatever is inside isServer doesn't go through

#

it was a switch case in the thing i mentioned but still nvm i just checked it is a ifelse

errant jasper
#

which event type?

torn stream
#

ok, correction:
it is an isServer within an eventHandler, which makes me think it will always be false, so changing subject, what causes it to be true?

torn stream
errant jasper
#

The server adding the event too would be the only reason for it to be true inside the handler.

#

It is a config based event XEH event handler ?

torn stream
#

The eventhandler is added using CBA's Extended event handler

#

I changed it from this

#

to this:

#

nothing within (isServer) was going through, which i may believe is because it is within an eventHandler, but the main issue our unit was having was that it worked in other servers from groups we played with, what made our server be different?

#

and now we're having issues with a couple more scripts doing that

#

and the main issue is the (isServer) not going through, i wanted to figure out what causes it, it's just our server, other servers, hosted, singeplayer, all of them work, just our main server doesn't

errant jasper
#

Long time since I used XEH, but I don't see why the event handler wouldn't be added on all machines including the server.
This probably still applies from BIKI

The event will not fire if the shooter is not local, even if the target itself is local.

#

So if you, a non-hosting player, shoots, the event will only trigger on your machine, so isServer is false.

torn stream
#

The server is being hosted using faster (dedicated essentially)

errant jasper
#

Yeah, so all machines have the HitPart event handler would be my guess. But only run on the machine local to the shooter. So it would fail for human players on a dedicated server, but work fine SP/Editor.

torn stream
#

i would have to check but it works on other units servers, i assume them to be dedicated aswell

granite sky
#

I would recommend restarting your logic with the assumption that isServer is not the problem.

#

Maybe something like filepatching causing your server not to be running the code you think it's running.

tulip ridge
# torn stream to this:

What's your goal here? I recognize that code (the people who wrote it didn't understand it) and have spent my own time fixing it for my own group

torn stream
#

this is just one example

formal stirrup
#

Either way the new one has some left over variables from the old method if that is what you refer to

#

Or is that not the tank one

tulip ridge
#

It's not

#

Code's still pretty bad either way

formal stirrup
#

fuuuuuuck

#

schizo posted for no reason then GG

#

Not sure why they didnt have me remake the other one when I did the tank tbh

tulip ridge
#

Because they don't know what's bad

#

I've told them the exact issues with lots of their stuff, which still has not been fixed. I gave up
I've just been rewriting the scripts for their stuff in our unit mod

formal stirrup
#

fair enough

real tartan
#

so there is this animation where unit is redirecting vehicles to side road

Acts_ShowingTheRightWay_in
Acts_ShowingTheRightWay_loop
Acts_ShowingTheRightWay_out

is there an opposite animation to redirect to other side ?

granite sky
#

Now if you only cared about this code working for enemies shooting at players then it might appear to work on a server that wasn't using headless clients.

warm hedge
#

All animations that are accessible in Animations Viewer are the all animations available in game

#

Which means, you know, you can't find the left variant

#

Unless you use Marshall animations and call it a day

split ruin
#

I got error in this, its simple trigger to delete some mission objects

deltrg = createTrigger ["EmptyDetector", uberPos, true];
deltrg setTriggerArea [50, 50, 0, false, 30];
deltrg setTriggerActivation ["NONE", "NONE", false]; //<- here 
deltrg setTriggerStatements ["triggerActivated wintrg or triggerActivated failtrg or triggerActivated failtrg2",
"
deleteVehicle failtrg;
deleteVehicle failtrg2;
deleteVehicle wintrg;
deleteVehicle hvtbuilding;
deleteVehicleCrew hvtveh;
deleteVehicle hvtveh;
", ""];
deltrg setTriggerTimeout [60, 60, 60, false];

wtf ?

cosmic lichen
#

Why on earth would you use a trigger for that

#
waitUntil 
{
    sleep 0.5;
    triggerActivated wintrg or 
    triggerActivated failtrg or 
    triggerActivated failtrg2
};

deleteVehicle failtrg;
deleteVehicle failtrg2;
deleteVehicle wintrg;
deleteVehicle hvtbuilding;
deleteVehicleCrew hvtveh;
deleteVehicle hvtveh;
split ruin
#

i tested and its not deleting the objects ... ๐Ÿ˜”

cosmic lichen
#

What did you do?

#

Add some debug printing

split ruin
#

I just put what your code at the end of the mission script

cosmic lichen
#
0 spawn 
{
  sleep 60;
  deleteVehicle failtrg;
  deleteVehicle failtrg2;
  deleteVehicle wintrg;
  deleteVehicle hvtbuilding;
  deleteVehicleCrew hvtveh;
  deleteVehicle hvtveh;
};

You could also put that code into the activation field of wintrg failtrg and failtrg2

#

and call it a day

split ruin
#

this is the first I did but I need some time between completing mission objective and deleting the objects because I don't want everything to disappear immediately in the players face

cosmic lichen
#

see above

split ruin
#

@cosmic lichen Its working! That's really clever to add spawn into win trigger statements, thank you.

finite bone
warm hedge
#

Is this a scripting question or in-game control question?

split ruin
#

is there any way to make this command to work in MP (respawn = 5)? Or any way to spawn switch-able units? Its working fine only with units spawned in editor.

addSwitchableUnit _unit;

edit: if somebody wonders selectPlayer is the holy grail ๐Ÿค˜

finite bone
warm hedge
#

So you say inputAction "SetTeamRed" is the command in question?

finite bone
#

Yes

warm hedge
#

It worked pretty fine to me

split ruin
#

what will happen if two players switch simultaneously to same unit with selectPlayer command? ๐Ÿซฃ

cosmic lichen
#

nothing happens simultaneously

#

one is always first

#

2nd one will probably fail silently

mortal folio
#

what's the command to make a vehicle a medical tent/vehicle? can't seem to be able to find it

#

i.e so you get the "treat at" option

cosmic lichen
#

There is no command for it.

#

It's config property

mortal folio
#

ah, gotcha

cosmic lichen
#

However, that's easy to script

mortal folio
digital torrent
#

I am having a issue that the below code, when deployed in a zeus environment/multiplayer, the "custom action" is being trigerred when i am not looking at scp173. Eg. if i dont look at it, but the other player does, the custom action is still being activate when it shouldnt.

anyone know why? i dont think i need to put a remote exec but it is not working.

My quick hint check also seem working by properly returning the names of the player that is looking at scp173.

spawn {

....
_scp173View = false;
if (time - _lastTeleportTime > _teleportCooldown) then {
    private _menInRange = (_scp173 nearEntities [["Man", "LandVehicle", "Air", "Ship"], 100]) select {side _x in [east, west]};

private _viewers = _menInRange select {
                !(worldToScreen ASLToAGL getPosASL _scp173 isEqualTo [])
            };
            _scp173View = (count _viewers > 0);

 if (_scp173View) then {
                private _viewerNames = _viewers apply {name _x};
                hint format ["SCP-173 is being watched by:\n%1", _viewerNames joinString "\n"];
            };

if (!_scp173View && {count _menInRange > 0}) then { "Custom action"};

errant jasper
#
  • On a given machine, viewers are all those in range, if the local player is looking. So if A, B, C are close, then it will be [A, B, C] if the local player is looking, otherwise none, []. On a dedicated server I would imagine none.

  • The only way for a custom action to trigger is there are people close, and the local player is not looking.

  • For the dedicated server machine it would pretty much trigger all the time anyone is close.

  • For a, possibly, hosting player-machine, the custom action would only trigger if looking away and someone is close.

#

But basically this: _viewers = _menInRange select {!(worldToScreen ASLToAGL getPosASL _scp173 isEqualTo []) does not do what you expect it to. It is all nearby, if player is looking at it, otherwise none.

digital torrent
#

how can i change it that it is not just local player looking (aka me) but any player looking.

#

bc i though in the _meninrange select, i thought it would only select people that is also looking at it. and not just me

errant jasper
#

Well, it is not clear whether your use of nearEntities is meant to only apply to players or not. worldToScreen is meaningless for an AI, or unmanned vehicle.

#

worldToScreen cannot go look at some other players screen, or an "AI's screen".

digital torrent
#

ohhhh, i didnt know that worldtoScreen cannot go look at other players screen. so that why

#

is there a command that does it? or it dont exist in arma?

errant jasper
#

I don't believe there is a command like that. There is aimedAtTarget, but that is only for aiming. There are lineIntersect commands, but they just check whether there is an unobstructed line.

#

If you only need it to work for players the current scheme is fine. You could run the script on all machines and have

private _isClose = (vehicle player) distance _scp173 < 100;
private _entityOnScreen = !(worldToScreen ASLToAGL getPosASL _scp173 isEqualTo[]);
if (_isClose && !_entityOnScreen) then {
   // Trigger custom action appropriately here in MP
};
digital torrent
#

when i dont look at it*

errant jasper
#

Ah, I saw you want not looking at it, editing.

digital torrent
#

maybe i am getting confused but i think "player" do not work in multiplayer no?

I am a bit loss on why your code would work compared to the original. Your code seems to be focus if player (inthis case, in multiplayer, i dont think it work. But assuming it does, it would likely be me only) is within 100M and i dont see scp, then do "action".

If i want any players to be looking, your code dont seems to work.

Maybe i am understanding something wrong.

errant jasper
#

I see you want no-one at all is viewing when close. That is a tough cookie over a multiplayer connection.

digital torrent
#

yes, i want if no one at all is looking at scp in multiplayer within 100 meter, then scp can trigger the action

#

it best if it also incorporate ai but atleast the players

errant jasper
#

Well for AI you have to come up with some way of "seeing" that is not screenToWorld, because AI don't have a screen.

#

How often do you want to trigger? Because the only feasibly way would be to transmit each players _entityOnScreen on the server to perform a global check there.

digital torrent
#

i would want the check to be at each second.

#

less than that , it would kill frames. so at least 1 second up to maybe 5 second at most

errant jasper
#

So you could toggle player setVariable ["IS_SCP_ON_SCREEN", _entityOnScreen, true] all the time (or optimize whether closer than 100m or not).

digital torrent
#

what ever is easier

errant jasper
#

Then the server would do the check across all players based on that info.

#

No you can do a worldToScreen every frame if you want without noticing it. The problem is the network traffic is reliable, so it might cause trouble if sent too much.

digital torrent
#

i never deal with setting variable and custom check on other player's side.
I solely did some general remooteExec per the BIS website. how would you do to deploy that?
I cant really visualite how to code it

errant jasper
#

So something like this would run on all player machines:

if (hasInterface) then {
    [_scp173] spawn {
        params ["_entity"];
        while {true} {
            sleep 0.5;
            private _isClose = (vehicle player) distance _entity < 100;
            private _prevValue = player getVariable ["IS_SCP_ON_SCREEN", false];
            private _isOnScreen = !(worldToScreen ASLToAGL getPosASL _entity isEqualTo[]);

            private _shouldUpdate = (not _isClose && _prevValue) || (_isClose && (_prevValue != _isOnScreen));
            if (_shouldUpdate) then {
                private _newValue = if (not _isClose) then { false } else { _isOnScreen };
                player setVariable ["SCP173_ON_SCREEN", _newValue, true];
            };
        };
    };
};

This would update twice a second if the player is looking or not. To optimize network traffic we only send if status changed AND we are close. If we leave we set it to false.

#

The server would do something like this:

if (isServer) then {
    [_scp173] spawn {
        params ["_entity"];
        while {true} {
            sleep 0.5;
            private _closePlayers = allPlayers select {vehicle _x distance _entity < 100};
            private _NumWatching = _closePlayers count {_x getVariable ["IS_SCP_ON_SCREEN", false]};
            if (count _closePlayers > 0 && _NumWatching == 0) then {
                // Handle custom action
            };
        }
    };
};
granite sky
errant jasper
#

So basically on each player we store in the player-objects variable space in IS_SCP_ON_SCREEN whether or not the entity is close and on their screen. The server regularly checks for close players and reads these entries to know if the remote player is looking or not.

digital torrent
#

ok i have a good idea now. just curious but isnt _scp173 undefined on the server side. My old code used to be code tied to a specifc created scp173. Would you code still work if i am placing multiple scp173?

errant jasper
#

Well I don't know where you got _scp173 from in your original script.
Well it would work fine, you would need to spawn both handling scripts multiple times and use unique name for the setVariable name.

#

So:

[_scp173, "IS_SCP_NUM_1_ON_SCREEN"] spawn {
   params ["_entity", "_varName"];
   //.......
   private _prevValue = player getVariable [_varName, false];
   // ......
   player setVariable [_varName, _newValue, true];
//.....

And similar for the server handler.

digital torrent
#

Also, let says that the scp173 is killed and i want to kill the player's side check. how would i go from sending a info from server to player to stop it. given a constant running of the code on player side will slow them down.

errant jasper
#

Then you would spawn with:

[_scp173_1, "IS_SCP_NUM_1_ON_SCREEN"] spawn // ....
[_scp173_2, "IS_SCP_NUM_2_ON_SCREEN"] spawn // ....
[_scp173_3, "IS_SCP_NUM_3_ON_SCREEN"] spawn // ....
errant jasper
digital torrent
#

it is that simple lol? i thought it was some complicated code haha. ok i think i have a good understanding now.

#

Thank you so much Muzzle!

errant jasper
#

You're welcome

#

Also if you get it working, you may want to try changing player setVariable [_varName, _newValue, true]; to player setVariable [_varName, _newValue, [2, clientOwner]]; to avoid having the server forward the data to all other clients, since they don't need to act on it.

#

So instead of 20 clients updating, forcing the server to send 20*19 updates out to the other clients, it just receives those 20 updates only.

dim token
#

Thanks for the answers earlier. I am going to experiment with server-side updates. I'm not aware of any way to enforce locking in SQF, so mutating shared state seems particularly brittle.

indigo snow
#

pushBack is atomic so a queue would do well enough

pallid palm
#

hello all: can i remoteExec this on the server some how ```sqf
[] spawn SFA_fnc_INS_ChopperHoldFinish;

#

this gets (run or spawned) from within the 1st chopper script

hushed turtle
#
[] remoteExec [ "SFA_fnc_INS_ChopperHoldFinish", 2 ];
pallid palm
#

oh cool wow nice m8

#

ahhh yeah Awsome thx @hushed turtle

#

you just made my day

pallid palm
#

@hushed turtle hmmm it does not seem to work correctly

#

Error position: <โ€œSFA_fnc_INS_ChopperFinishโ€œ, 2];

granite sky
#

The quotes look suspicious in discord.

#

yeah those are not programming quotes.

pallid palm
#

so i should use " "

#

or ' '

cosmic lichen
#

both works

pallid palm
#

oh ok i'll try it

hushed turtle
pallid palm
#

woohoo it works Awsome thx all ๐Ÿ™‚

#

thx so much guys i mean really happy now woohoo @granite sky @cosmic lichen @hushed turtle

#

all you guys just made me the happy-est guy in the World ๐Ÿ™‚

dim token
#

What would be the best way to remove values from that array without reassignment , since I'm passing the reference in to child functions

#

I'm really trying to avoid just making it a global variable for sanity reasons

indigo snow
#

deleteAt modifies the original array instead of returning a copy

dim token
#

Great thanks.

finite sail
#

morning chaps ๐Ÿ™‚
I have a variable in the main scope of my script. If I import it into a while loop further down, I understand the variable is privated in the loop

#

does that mean the value is or isn't changed in the main scope?

pastel pier
#

How do i get the variable name of a group? Like the group is called ei_0 but it returns Alpha 2-2. I want to do something like ((str ei_0) splitString "_""")#0 != "ei";

winter rose
willow hound
# finite sail morning chaps ๐Ÿ™‚ I have a variable in the main scope of my script. If I import i...

Not sure what you mean by importing a variable into a loop, there is no need (or mechanism) for that. You can just use existing variables in loops (see _a in the example below). You can also define new private variables in loops; the scope of such variables is tied to the loop and they become undefined after the loop (see _b in the example below).
Run the following code (e.g. through the debug console in the Editor) and observe its output:

private _a = 0;
systemChat format ["Starting with _a = %1", _a];

while {_a < 3} do {
  private _b = 42;
  _a = _a + 1;
  systemChat format ["_a = %1 and _b = %2", _a, _b];
};

systemChat format ["Finished with _a = %1 and _b = %2", _a, _b];
systemChat format ["isNil _a: %1", isNil "_a"];
systemChat format ["isNil _b: %1", isNil "_b"];
finite sail
#

I misunderstood my own code ๐Ÿ™‚

#

the variable is privated in bottom scope, then I attempted to use it in a spawn snippet that was inside a loop, because I've only been doing this for 20 years and still learning ๐Ÿ™‚

#

rather than messing around with importing, I just converted it to a global

split ruin
#

global variable is "visible" in loop and everywhere actually ...

willow hound
#

spawn always creates a new scope. To access data from the surrounding code, you have to pass it in as an argument.

private _a = 0;
private _b = 3;

while {_a < 3} do {
  _a = _a + 1;
  _b = _b - 1;

  [_a] spawn { //Provide _a as an argument to the spawned code.
    params ["_a"]; //Could also use a different variable name instead of "_a".
    systemChat format ["_a = %1 and _b = %2", _a, _b]; //_b is undefined here.
  };
};

systemChat format ["Finished with _a = %1 and _b = %2", _a, _b];
```Example 3 on https://community.bistudio.com/wiki/spawn illustrates this too.
cyan dust
#

Good day. I'm trying to understand - one of the UIs I use in mission created with createDialog does not prevent players from using VoN, however all the rest are notlikemeow
Is it a known issue? We really struggle with need to close UI in order to say something.

UPD: I see that non-blocking display has idd = -1 in its description, but all the others have assigned values, is that what makes all the difference?

Offtop:
IDD_EDIT_BRIEFING // TODO: Has to be checked by Pete! 138
Did Pete check it? ๐Ÿ˜†

dire star
#

Did i write anything wrong bc my music wont play?
["CUP_A2OA_Iron_Mountain", 60] remoteExec ["playMusic", 0];

hushed turtle
#

It thinks the string is left side argument, but playMusic has them both on right

#

Use array in array like [[]]

dire star
#

ty, works now

copper plinth
#

What is the name of the variable that stores the object quality settings?

hallow mortar
sharp grotto
#

Sounds like a question a cheater would ask pikachusurprised
And by looking at his linked steam account, I am pretty sure that's the reason.
Edit: Yup banned for Cheating in Arma 3 on the Infistar Antihack meowfacepalm

copper plinth
hallow mortar
#

Most client video settings cannot be force-set. They have performance and accessibility implications, so it's up to users to pick the one that works for them.
setTerrainGrid, setViewDistance, and setObjectViewDistance are about all that can be changed by script.

copper plinth
#
private _videoOptions = getVideoOptions;
private _objQuality = _videoOptions select 3;
private _hasViolations = (
  _objQuality in ["Ultra", "Extreme"] ||
);

smt like this ?

hallow mortar
#

No. getVideoOptions returns a Hashmap, not an Array. You can't use select on it because the contents aren't stored in order. You need to use get.

copper plinth
#

Thanks

copper plinth
#

@hallow mortar Can I lock Heli flight model to standart only for all clients ?

hallow mortar
copper plinth
hallow mortar
#

The documentation says that parameter enforces the setting. If you think it's not enforced, you can easily test it yourself.

next prairie
#

How hard is it to port over a2 vehicles

indigo snow
#

its at least 3 hard

#

maybe 4

fading gorge
#

for reference, how hard is diamond?

indigo snow
#

10 of course, according to Mohs'

#

real answer: It involves quite a bit of work, knowledge of the arma engine and the assorted tools

#

theres some guides on the forum

hushed turtle
#

On dedicated server with headless clients. Does server spread workload automatically by changing locality of AI units or does this has to be scripted?

tame mica
#

Hey hey, I was wondering if anybody knew how to do a script that adds a visual health bar, sorta like a boss healthbar from like a souls game into Arma 3, I know SCP - Darkwoods did make a boss healthbar, I was just wondering if anybody knew how to recreate it?

urban bluff
cyan dust
errant jasper
# urban bluff What makes you use "private" in spawned code? It literally makes nothing except ...

I think private affects code readability exactly zero point zero zero percent. But it does prevent overwriting variables in outer scope when code gets moved around and shift scopes. This wasn't for me, and 98% of my personal scripting doesn't live in spawn, so my habits mostly adapted to general callable code.

As for the second point, you are right _isClose && _isOnScreen is equivalent expression. This was code on a saturday evening that I didn't personally need, so I didn't spend time simplifying it. The logic merely followed my imperative train of thought at the time in which the condition was basically whether to "reset" to false-and-away state. (Edit: actually I had this unnecessary notion initially that I wanted to skip the screen check if the player was far away, and didn't clean up the conditions after opting not to)

But yeah you could remove _shouldUpdate too and simplify it all to:

_isObserver = _isClose && _isOnScreen;
if (_isObserver != _prevValue) then {
    player setVariable ["SCP173_ON_SCREEN", _isObserver, [2, clientOwner]];
};
finite bone
willow hound
# urban bluff What makes you use "private" in spawned code? It literally makes nothing except ...

What makes you use "private" in spawned code? It literally makes nothing except for making the code harder to read.

  • Consistency
  • No need to think if you always make all local variables private
  • No risk of breaking things by copy-pasting or by refactoring the code (e.g. by removing spawn)
  • Easy to see where variables are declared for the first time: I see private, I know that there is a new variable (not a reassigned one) and I know for sure what its scope is
#

private essentially becomes the "I want to declare a new (local) variable" keyword (like const / let in TypeScript / JavaScript or var / val in Scala), and life is simplified.

hushed turtle
#

Yeah, I always use private just because it's easy to see where I'm declaring my variables. I wish there was some keyword for globals too.

cyan dust
errant jasper
#

In a decade of sqf I can only remember a single time where I set multiple private variables in my top level function, and then accessed (read) them in further down in called functions. And this required care on my side but was safe for callers because my top level declared them private. But zero times have I ever wanted to write such dynamically scoped variable further down. And private ensures that never actually happens, even by accident.

cyan dust
hushed turtle
errant jasper
#

I didn't measure myself though, and doesn't really matter

cyan dust
#

That way you will see exactly what global vars are used here and what to expect from them

hushed turtle
errant jasper
#

I assume you preProcess your files so assuming you don't need a variable named global you COULD (not saying you should) do this:

#define global 

global TAG_myGlobalVar = 42;
hushed turtle
#

That's actually good idea

thin fox
pallid palm
#

imho

//Private and Global are different
Private  _variables =  whateveriwant;
// Global variable
someVar
//Global means the variable is in the global scope.
//Such as mission variables, variables on an object, etc.

//Private is only for local variables,
//i.e. variables that start with an underscore

//Variables that begin with an underscore are local variables,
//meaning they are only defined in that scope
someVar = 1; // global variable
_someVar = 1; // local variable
//All local variables have to start with an underscore

//For example:
params ["someVar"]; // Error: invalid local variable name

//hint is local, meaning A hint would only be displayed on the machine where it was run
``` ๐Ÿ™‚
drowsy geyser
#

why does this not work, it just prints 'any'

p1 addEventHandler ["hitPart",  
{ 
    params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_instigator"]; 
    systemChat format ["projectile type: %1", _projectile]; 
}];
willow hound
drowsy geyser
#

No im using the first one and only want to know which type of _projectile/_ammo hit the _target

hushed turtle
#

Looks like you need to do (_this select 0) params... to get the first hit part

#

Looks like less than 3 parts got hit, so that would explain why third element in _this wasn't defined.

stuck cobalt
#

@cptnnick I pretty much said the same thing in the other channel. That's funny lol

drowsy geyser
#

Im trying do differentiate between the different ammo types meaning: bulletbase,grenadebase,rocketbase etc.

hushed turtle
#

Yeah, _this in this context is an array of arrays, but you only need first subarray - I doubt ammo is gonna be different between hit parts

drowsy geyser
#

rgr, i will try it later, thank you

pallid palm
#

hay guys: Everything is working so Great: thx so much: all you great guys: You know who you Are: Woohoo: to many to Name

#

i freeking love this Arma 3 ๐Ÿ™‚

#

i just completed a mission i made where you must attack this HQ and kill all there and Download info form a LabTop on the location of the fuelDepo: (that spawns at Random Locations) and there's Tanks there and MG trucks and Ememy: and ofcorse you must expload the fuel ๐Ÿ™‚ for mission win ๐Ÿ™‚

#

huge explotion on the fuel and smoke and fire Woohoo ๐Ÿ™‚

delicate tangle
#

Will this work as a file path for cfgfunctions: โ€œScripts & Functions\AIโ€

Will Arma take the spaces and & symbol for file paths?

winter rose
#

perhaps; try and see
I would recommend using Functions like everyone else

pallid palm
#

oh and thx @ Lou for helping me with this ```sqf
SDV setCenterOfMass [[selectRandom [2, -1], 0, -1], 100];

#

im feeling very thankful today ๐Ÿ™‚

#

you might be woundering whats the big Deal with Setting the mass on a littel old SDV: ๐Ÿ™‚ ```sqf
//Submarine attachTo SDV
Submarine = "Submarine_01_F" createVehicle position SDV;
Submarine attachTo [SDV, [4.45, 0, 1]];
Submarine setDir 180;

#

WooHoo

drowsy geyser
#

Is there specific reason that hitpart eh fires regardless if damage is turned off and hit eh not?

pallid palm
#

i'm not sure it might be a paradox ๐Ÿ™‚

drowsy geyser
drowsy geyser
pallid palm
#

i have some knowledge just not about hitparts: i was just jokeing in the last post m8

drowsy geyser
#

All fine i didn't mean you

pallid palm
#

copy that m8

#

maybe you could try ```sqf
addMissionEventHandler

addMissionEventHandler ["hitPart",

hushed turtle
hallow mortar
# drowsy geyser Would really want to know why if someone with more knowledge can answer please

hit can also fail to fire if the target has damage enabled, but the hit does very little damage.
I think they happen at different points in the hit process and monitor different events. hit apparently has a threshold for damage being done, while hitPart occurs earlier, before it's decided whether damage is being done.
But this is all engine code within Arma's horrifyingly complex and inconsistent damage system, so you'd probably need a dev to give a complete answer.

drowsy geyser
pallid palm
#

so i was right it is a paradox ๐Ÿ™‚

#

paradox is a statement or situation that seems self-contradictory or opposed to common sense, yet may prove to be true ๐Ÿ™‚

errant jasper
#

Well I can make the following speculations for why:

  • Note the description for allowDamage says it does not transfer when unit moves locality despite being a global command.
  • Combined with isDamageAllowed which states that for non-local objects the results is always false
    The following is of course all speculation based on reasoning of the data that is visible to us from the engine. We might conclude that possible allowDamage is only known properly on the machine the object is local to which is why other machines just get false. Now let us look at event handlers:
  • "Hit" requires the object is local and will not fire if allowDamage is false, which make sense from a damage perspective since only the machine local to the object knows allowDamage is false or not.
  • "HitPart" only works on the shooter. If you ever played on severly lagging server you know the shooter's view takes priority. Other game engines might have the server "rollback in time" so see where the hit is. But here the shooter is authoritative in what he hits. But assuming again above the shooter might not have accurate information on whether allowDamage is true or not for the target. So it just runs always.

There is also the argument that if someone is interested in the data in "HitPart" they may have other reasons than damage, so not running the handler here breaks that.

  • The major disagreement with my hypothesis is that "MPHit", from BIKI at least, does distribute the event handler and also incldues the note about allowDamage being a deciding factor. But that would seem to imply non-local machines do have accurate info about allowDamage so why would isDamageAllowed return false for those? And why wouldn't allowDamage not then follow an object that changes locality?

Anyway, that was it for my speculative Ted Talk.

pallid palm
#

so i was right it is a paradox ๐Ÿ™‚ ๐Ÿ™‚

#

lol just having fun ๐Ÿ™‚

#

ok Awsome people i can't w8 to get back from Golfing: to learn more stuff Woohoo: see you m8s

finite bone
#

Does BIS_fnc_curatorHint allow structured text to be passed?

winter rose
#

the wiki page says nothing about it, so ๐Ÿฎ perhaps

dark viper
#

hey guys do groups go null if every unit gets deleted or removed from the group? don't wanna run into a reference error? I'm new to arma 3 but I assume so

hallow mortar
#

The group can be auto-deleted when empty, but the exact timing is not guaranteed. Unless a script actually does deleteGroup on it, there's an element of "when the engine feels like it"

hushed turtle
#

Will group var be undefined or grpNull?

dark viper
#

^^ Yeah what can I do to check it during runtime? Oh and one more thing I'm gonna use groups as a keys in a hashMap but it is an unsupported type. The wiki gives a workaround by using hashValue group to create a key. Group value won't ever be changed during runtime as any side effect? ( i don't know how it responds to deleting and adding units) I'm assuming it keeps the same reference value the entire time unless it ever gets destroyed

willow hound
#

If all units from the group are deleted, the group is simply empty (not grpNull). Also, from https://community.bistudio.com/wiki/deleteGroup:

In Arma 3 when the last unit leaves a group, the group gets automatically deleted. Manually deleting all units from a group, however, does not automatically delete the empty group.

dark viper
#

Gotcha makes sense

#

the wiki say it uses netId for group hashValue, this is automatic unique identifer from the engine I don't need to worry about it changing ever?

#

and thanks for your help guys ๐Ÿ‘

willow hound
# hushed turtle Will group var be undefined or grpNull?

When the group is deleted, the variable value should become grpNull. You can test this by running the following code (e.g. in the debug console in the Editor):

private _g = createGroup blufor;
deleteGroup _g;
systemChat format ["isNull _g: %1", isNull _g];
little raptor
stable dune
dark viper
fleet sand
#

Quick question how would i detect explosion on a object ?

hallow mortar
#

explosion event handler?

fleet sand
blissful current
#

I've been messing around with [testBoat, 60] spawn BIS_fnc_unitCapture; since boats in Arma 3 can't seem to drive in a straight line near land masses.

It seems to record location data and the playback function works okay with some caveats; Some animations from the boat aren't included (water jets) and there is no engine noise since I guess it's technically off.

Any ideas on how get it to make some noise so it at leasts sounds convincing enough that it is actually driving?

winter rose
blissful current
winter rose
#

that's about it yeah

blissful current
#

I guess I could do a say3d since I think that follows the sound source. Then record the sounds it makes when I record with BIS_fnc_unitCapture.

winter rose
#

(by mouth)
("VROOHOOOOOHOOOOOOOOM")

blissful current
#

extra immersive! ๐Ÿซก

blissful current
#

@little raptor
I am trying to loop an animation in the way you suggested a couple of weeks ago. The issue I am having with the EH method is that it fires multiple times (even though the wiki says it shouldn't for AnimDone). This means that the animation starts over rapidly, making it look jittery/glitchy.

testUnit addEventHandler ["AnimDone", {  
 params ["_unit", "_anim"]; 
 systemChat "mainFired"; 
 
 [_unit, _anim] spawn {  
  params ["_unit", "_anim"];  
  sleep 5;  
  if (alive _unit && _anim == "HubSittingChairUA_move1") then {
  systemChat "animationfired";
    [_unit, "HubSittingChairUA_move1"] remoteExec ["switchMove", 0]; 
    [_unit, "HubSittingChairUA_move1"] remoteExec ["playMoveNow", 0];
  };    
 }; 
}];
#

I fires more than the screenshot. Possibly up to 20 times.

granite sky
#

The double remoteExec is probably wrong because it doesn't guarantee execution order. Those commands aren't documented well enough for me to say what's actually correct.

#

All sorts of waffle about "good practice" and things that may or may not work. No actual description of how the animation system works.

winter rose
granite sky
#

remoteExecCall does. remoteExec just puts them in the scheduler queue. IIRC they usually run in reverse order.

#

Oh, I guess these are commands so they should get remoteExecCall behaviour. Kinda hard to prove either way.

hallow mortar
#

remoteExec is supposed to have guaranteed execution order live. The remoteExec JIP queue, however, may not be in order

blissful current
#

I'm guessing that knowledge of the animation system is not commonplace and is made worse by the passage of time. Maybe it's a situation of there is only one or two people knowledgeable at Bohemia on it anymore.

dark viper
#

I shouldn't expect scripted combatBehaviour or behaviour values to stay if I don't disable the FSM right?

#

idk what the AI does if its disabled, will they even shoot or move? Do they just act normally according to whatever their behaviour is set to?

winter rose
granite sky
#

IIRC "AUTOCOMBAT" handles all the safe/aware/combat switching so you can just disable that and otherwise they'll act normally for their behaviour.

winter rose
dark viper
#

im trying to but forgot how to do it in script

winter rose
#

disableAI

dark viper
#

the bohemia wiki is a maze of links that aren't connected well imo

winter rose
#

from there you have categories you can use

dark viper
#

thats what i was looking for

#

yeah I have seen this page before and couldn't find it purposely looking for it

#

๐Ÿคท

granite sky
#

yeah normal for wiki :P

#

Sometimes it helps to remember an "adjacent" command.

winter rose
#

just sayin' :p (I can take the flak though ๐Ÿ˜„)

dark viper
granite sky
#

The search requires you to remember what it starts with, at least.

#

Could do with a semi-modern search that can handle partials.

winter rose
#

fair, but also searching for "disable" is not so far fetched here ๐Ÿ˜„
but yeah, MediaWikiโ€ฆ

warm hedge
quaint oyster
#

Can someone please remind me, its driving me nuts and google with its new AI search is making it hard to find the actual answer.

What is the command to print into the console to log stuff? I cannot for the life of me remember.

warm hedge
#

diag_log?

quaint oyster
little raptor
# blissful current <@360154905148653568> I am trying to loop an animation in the way you suggested...

ok a few tips:

  1. instead of remoteExec, a. add the EH to where the unit is local, or b. add it everywhere and do early return using if (!local _unit) , or c. handle its locality change; all are better options than remoteExec. I'd say adding it everywhere is the safest option but if you know locality won't change you can just add it to the local computer.

  2. no need for switchMove+playMoveNow; just use the 2nd switchMove syntax, which is also less jittery if you set the blend factor to 0:

_unit switchMove ["HubSittingChairUA_move1", 0, 0, false];
// or its remoteExec form, but not needed if you do tip # 1
[_unit, ["HubSittingChairUA_move1", 0, 0, false]] remoteExec ["switchMove", 0]; 
  1. instead of "AnimDone" EH, use "AnimStateChanged". "AnimDone" was a bit buggy last I checked it.

So it just becomes:

testUnit addEventHandler ["AnimStateChanged", {  
 params ["_unit", "_anim"]; 
 systemChat "mainFired"; 
 if (alive _unit && _anim != "HubSittingChairUA_move1") then {
    _unit switchMove ["HubSittingChairUA_move1", 0, 0, false];
 };
}];
// start the anim
testUnit switchMove ["HubSittingChairUA_move1", 0, 0, false];
  1. you can use _unit disableAI "ANIM" which will prevent them from changing animation so often. (but the EH will take care of it anyway)
#

you can make it into a function and reuse it:
(I also added it to biki)

// TAG_fnc_loopAnim
params ["_unit", "_anim"];

// remove old EH
_unit removeEventHandler ["AnimStateChanged", _unit getVariable ["TAG_AnimStateChangedEH", -1]];

private _EH = -1;
// if anim is empty, just stop looping
if (_anim != "") then
{
    _EH = _unit addEventHandler ["AnimStateChanged", {  
        params ["_unit", "_anim"]; 
        systemChat "mainFired";
        private _loopedAnim = _unit getVariable ["TAG_LoopedAnim", ""];
        if (alive _unit && _anim != _loopedAnim) then {
            _unit switchMove [_loopedAnim, 0, 0, false];
        };
    }];
};

_unit setVariable ["TAG_AnimStateChangedEH", _EH];
_unit setVariable ["TAG_LoopedAnim", _anim];

// start the anim
_unit switchMove [_anim, 0, 0, false];
// start looping
[testUnit, "HubSittingChairUA_move1"] call TAG_fnc_loopAnim;

// stop looping
[testUnit, ""] call TAG_fnc_loopAnim;
agile pumice
#

Is it possible to get c# code into arma3?

#

or can I only use c++ with intercept?

queen cargo
#

you also can use OOS to generate SQF code @agile pumice
it is also a C-stylish lang

#

however, still in ALPHA ๐Ÿ˜ƒ

#

but looking forward to reach BETA state soon

agile pumice
#

thats not really what I meant haha

#

I have a C# library that I want to run in arma3

#

not that I want to turn my sqf code into C#

#

c# doesnt work with call extension does it?

#

think I answered my own question

finite bone
#

How can I determine if curator has switched vision mode to nightvision / thermal? inputAction "curatorNightvision" > 0 does not work neither nightVision and cameraVisionMode

zealous solstice
#

yes c# work

cosmic lichen
#

Have you tried to check the vision mode of the curator camera?

hallow mortar
finite bone
#

I tried currentVisionMode curatorCamera and it returns 0 even when its nightmision

finite bone
#

Just flashlight and nightvision

hallow mortar
#

Try using a User Action Event Handler instead

finite bone
#

Yea thats what I was thinking - keydown even handler. But its strange that these inputactions are not being recognized

hallow mortar
#

User Action event handlers and KeyDown event handlers aren't the same thing

finite bone
dark viper
#

anyway to create waypoints without adding it to a group? can only find the way of creating waypoints by addWaypoint, I don't see something like a generic createWaypoint

I'd like to define some waypoints in advance (like a group of move commands together could be thought of as a custom route) and then add them to potentially multiple different groups at different times depending on other logic

hallow mortar
dark viper
#

thats what i figured i would have to do

agile pumice
#

would have been great if the link I shared was a little more elaborate

jade tendon
#

Gday all,
how can i force a player controlled vehicle in a position with scriptiing until the rest of the script has run then "release" the vehicle at the end of the script?

drowsy geyser
hallow mortar
#

You could also attach the vehicle to something

thin fox
#

attach idea is brilliant

jade tendon
#
["Aligning vehicle with repair bay"] remoteExec ["hint", (driver _veh)];
    _veh setPos (getpos _nHeliPad);
    _veh attachTo [_nHeliPad,[0,0,0]];

//Detach
detach _nHeliPad;

Something like this?
Sry, dont now how to do the sqf coding is discord

agile pumice
#

nothing about params or anything lol

tulip ridge
#

```sqf
```

blissful current
# little raptor you can make it into a function and reuse it: (I also added it to biki) ```sqf /...

Thanks for the tips, Leopard! I played around with your function for quite a bit tonight; however, I was not able to get your function to work as it is written on the BIKI. The unit will play the animation that you pass to it when you call the function; however, it will not loop. It only plays it once.

So I started modifying your function to see what would happen. I found a couple of interesting things:

  • Some animations will loop with your function while others won't. The sitting animation you have listed on the BIKI won't loop, but I tried some others, like a push-up and vehicle repair animation that do loop.
  • That sitting animation, you have on the BIKI will loop if you change the EH from AnimStateChanged to AnimDone, as well as change your if conditon from alive _unit && _anim != _loopedAnim to alive _unit. Though there is an awkward moment where the unit stands after the animation plays and abruptly sits again mid-standing animation. I was able to fix this by reverting to the first syntax of switchMove.

After messing around with the function, I switched over to tackling the jittery issue I have with my current script. I used a locality check like you suggested, but it did not fix the jitter. My current thinking is that since AnimDone "Triggered for all animation states in a sequence.", what is happening is that because the EH fires multiple times, my switchMove within the EH gets run just as many times as well. Thus causing the jitter at the beginning of the animation loop.

After further testing, the jitter seems to be caused by my adding a sleep in between the animations. The length of the jitter is directly proportional to the length of the sleep. Is there a way I can add a pause between the animation loop without sleep? Some of these animations are quite short so they look weird if you dont add a little break in between them.

thin fox
#

are you still trying to make AI sit on that beach chair? ๐Ÿ˜ฎ

blissful current
#

Hahaha, yes! I think I'm about 20 hours deep at this point. I really should move on, but when I get frustrated, I tend to dig my heels in. But I'm still learning other things with it. I picked up a better understanding of variables and functions by messing with Leopard's function, so it's not all wasted time.

thin fox
#

even for simple commands or functions

blissful current
#

I hear that. I'm nearing completion of the major mechanics in the mission and I'm not looking forward to seeing what breaks when I test it on the dedicated server!

hallow mortar
#

Also, attachTo will automatically move the attached object anyway, so you don't need to manually change its position first at all

jade tendon
hallow mortar
#

Well, detach _heli

#

If your script is a repair script then it must have a reference to the helicopter to work with, so it's as simple as making detach the last thing it does

tough abyss
#

Whats params got todo with callExtension

jade tendon
#

i think i figured out why it wasn't working
I was setting the detach command in the wrong place

stable dune
#

Same result with one backslash
```sqf
//I only used one backslash
```
๐Ÿ˜Ž

agile pumice
#

I want to know how to accept params in the dll class

tough abyss
#

arma callExtension, you give it a string, it returns a string

#

its up to you to code it to parse the string

agile pumice
#

but its just returning an empty string

brazen sparrow
#

sorry for not being more elaborate ๐Ÿ˜›

keen crag
#

I need to apply settings for some mods on the server, I tried in init.sqf, I tried in the server mod, but they don't apply, can you tell me where to enter these settings or what to do?

Example of settings:

hatg_setting_building = true;
hatg_setting_complex_detection = true;
hatg_setting_cooldown = 10;
hatg_setting_debug = false;

warm hedge
#

We don't know what are they. Is that a particular something for a particular Mod?

keen crag
warm hedge
#

Which tells you that instructions?

agile pumice
#

not too sure with how to handle that in the string builder

keen crag
#

I set up the mod in arma, through the add-ons settings, and then exported them.

#

But I dont know how to apply them to the server, the methods I have tried do not work.

next gust
pallid palm
#

oh nice @stable dune

#

so then like this then Woohoo ๐Ÿ™‚
```sqf
// Copy text on all this and remove all the ( back slashes = \ ) and your code goes here
```

#

thx m8: lol i need help so i can help ๐Ÿ™‚

pallid palm
#

```cpp
// and for Description.ext type code or settings code
// Copy text on all this and remove all the ( back slashes = \ ) and your code goes here
```

thin fox
pallid palm
#

you can also do diff colors like this

- private _scotty = _this select 0;
- private _scotty2 = _this select 1;

+ params ["_scotty", "_scotty2"];
errant jasper
#

Guess your got a promotion. Congratz, Corporal.

dark viper
#

is there a way to increase the spacing for a group of units in a formation? IE follow the wedge pattern but increase the distance between each unit

shut carbon
dark viper
#

what if you made a custom formation then

#

i assume thats possible

round hazel
#

Hey folks, bit of a queer one for you. I have this setup for which a player can enter into a trigger, and by looking through their camera (Or coming out of their camera) objects in a specified layer are revealed to them. As you can see, this work in singleplayer (First clip) but when running on a dedicated server, the 'Jumpscare' sfx works but the objects are not revealed. Everything I've read points to this working, and I'm rather confused. Any help is greatly appreciated!

#

[Working through stuff on the debug menu, the player is given the value of "ghostCabin" in their "ghostLocation" variable, as intended. I believe therefore it may be something to do with the code in which I unhide the objects, in initPlayerLocal

granite sky
#

There are a lot of layers here. Figure out whether the code at the end is running first.

round hazel
#

Do you mean the 'Optics Switch' event handler? And yes, I'm terrible for writing spaghetti ๐Ÿ˜‚

granite sky
#

EH -> camON -> showGhostObjs

#

stick a couple of diag_logs in showGhostObjs and it should be clear where it's breaking.

#

I don't really get what you're trying to do with this trigger though. It's a global trigger that's using player but it's broadcasting the vars for some reason?

#

It looks like it should still "work" but I don't generally work with triggers.

#

oh wait, getmissionLayerEntities says it's server exec?

#

Not sure why it would be, but that would certainly do it.

copper mauve
#

sorry new to scripting, what is the easiest way to make it so that the "hold action" results in these 3 light generators to turn on?

granite sky
#

Have you used hold actions before?

copper mauve
#

nope

granite sky
#

There aren't really easy or hard options here. Hold actions are just hard :P

copper mauve
#

usually didnt wander into setting up RP stuff besides some light scripting

granite sky
#

It's local effect so I guess you'd need to remoteExec the thing.

dark viper
#

how do you send an AI radio message through script? things they say like "Moving to position" that's part of the base game when you command the AI to do something. I'm looking to trigger that audio with a script

#

I'm looking at CfgRadio and the Conversations system but unsure atm

copper mauve
errant jasper
#

Would also need to JIP secure it if necessary. And then there is the question of whether light are also subject to streaming and then if so whether light state is remembered across (un)loads.