#arma3_scripting

1 messages ยท Page 385 of 1

real vessel
#

@tough abyss Thanks, I am paranoid. Far too many years as a C++ dev has taught me never to underestimate when a race condition will come back to bite you.

little eagle
#

@loud python Annoying to tag you.
Try:

waitUntil {!isNil "bis_fnc_init"};

I had to install the ExtractPbo thing first to look up if there was something like that.

loud python
#

@little eagle Can't you just write @Darkwii...? it should work in theory

little eagle
#

Dark_Pillow_Of_Love is the only name. I have the browser version of discord.

#

Is it supposed to be a rectangle or am I missing a font?

loud python
#

it's supposed to be a cuneiform DIล 

#

When I write @ Darkwii I get myself...

little eagle
#

Looks like that default char that happens when you don't have the font.

#
        //--- MissionNamespace init
        missionnamespace setvariable ["bis_fnc_init",true];

        if !(isserver) then
        {
            ["bis_fnc_initFunctions"] call bis_fnc_endLoadingScreen;
        };

This is what initFunctions.sqf looks like, so maybe this works.

loud python
#

no luck, doesn't work

#

๐Ÿ˜ญ

little eagle
#

Waits forever?

loud python
#

doesn't wait

#

well, maybe I did something wrong?

little eagle
#

Are in currently in SP or MP?

loud python
#

wait, does execVM start stuff in parallel?

#

MP

#

in other words, can I waitUntil in execVM

little eagle
#

Yes.

loud python
#

hmmm...

#
if (isNil "intro") then {
    waitUntil {!isNil "bis_fnc_init"};

    cutText ["", "BLACK FADED", 10, true];
    sleep 2;
    0 = ["30 minutos antes...", -1, -1, 3, 3] call BIS_fnc_dynamicText;
    sleep 3;
    cutText ["", "BLACK IN", 10, true];

    0 = ["Aeropuerto Babylon", "Oeste de Altis"] call BIS_fnc_infoText;

    sleep 5;
    playMusic "LeadTrack02_F_Mark";

    intro = true;
};
#

doesn't work

#

though I should probably waitUntil after fading to black to avoid flashing the mission before it turns black, but that doesn't change the problem

#

hmmm...

#

can I control the player during the loading screen?

#

maybe I could wait for that?

little eagle
#

Tried giving a layer id to the cutText, so the million of shitty BI feedback scripts don't interfere with yours?

loud python
#

I don't really think that's the problem

#

it's a matter of timing

little eagle
#

Just write

#

"mission_intro_layer" cutText

#

For both.

tough abyss
#

:/

#

someone tagged me

loud python
#

what was the command to find out if the player has control?

little eagle
#

There is none.

loud python
#

@tough abyss that was me, sorry

#

I tried writing @darkwii... and it automatically tagged you

#

commy2 really?

#

wasn't there a way to keep the player from doing thgings?

#

and another one to query if that's on or off?

little eagle
#

Yes. Why don't you try to give them a layer id^^

loud python
#

I can do that

#

but I don't expect it to work

little eagle
#

I'm searching for something else. Maybe the progress bar display is of help.

#

meanwhile.

loud python
#

doesn't work

#

the script still starts during the loading screen

little eagle
#

Which means the music starts to play after ~7 seconds, right?

loud python
#

the music starts just after the loading screen is gone

#

and I can hear the clicking sound of the infoText during the loading screen

little eagle
#
waitUntil {count BIS_fnc_startLoadingScreen_ids == 0};
#

Based on this part of BIS_fnc_endLoadingScreen:

    if (_id in _ids) then {
        _ids = _ids - [_id];
        missionnamespace setvariable ["BIS_fnc_startLoadingScreen_ids",_ids];
loud python
#

still doesn't work

#

ah

#

it probably triggers BEFORE the loading screen

little eagle
#

Might be.

loud python
#

thus waituntil never happens

#

sleep 0.1?

little eagle
#

waitUntil {count BIS_fnc_startLoadingScreen_ids > 0};
waitUntil {count BIS_fnc_startLoadingScreen_ids == 0};
Hope the scheduler doesn't fuck you over.

loud python
#

trying that

#

nope

#

doesn't work

little eagle
#

Waits forever?

loud python
#

#FML

#

doesn't wait

#

just starts instantly

little eagle
#

Huh?

loud python
#

yes

#

I don't get how it works either

little eagle
#

I hate scheduled scripting.

loud python
#

I'll try commenting out the playMusic to see that the script is properly saved and updated

#

really though

#

there was a way to remove player control

little eagle
#

Local hosted MP or are you a dedicated client?

loud python
#

that much I clearly remember

#

trying on local MP

#

but in the end it will run on dedicated

little eagle
#

userInputDisabled

still forum
#

could it be that the var is nil?

little eagle
#

Then scheduler would error. Check the RPT.

#

By default (if custom resource is not provided) startLoadingScreen will use "RscDisplayNotFreeze" resource. If you are using custom resource (could be also defined in description.ext), the >following resource's controls are supported by the engine:

loud python
#

f***

#

my

#

life

little eagle
#
waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}};
waitUntil {isNull {uiNamespace getVariable "RscDisplayLoading"}};
#

Sadly multiple controls displays use that variable, so this might break the second time you play a mission in a session^^

loud python
#

throws an error xD

#

isNull expects an object

#

add a call before {}?

little eagle
#
waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}};
waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
#

oops

loud python
#

doesn't work either ๐Ÿ˜ญ

little eagle
#

Can you repost the code?

loud python
#
if (isNil "intro") then {
    cutText ["", "BLACK FADED", 10, true];
    waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}};
    waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")};
    waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};

    sleep 2;
    0 = ["30 minutos antes...", -1, -1, 3, 3] call BIS_fnc_dynamicText;
    sleep 3;
    cutText ["", "BLACK IN", 10, true];

    0 = ["Aeropuerto Babylon", "Oeste de Altis"] call BIS_fnc_infoText;

    sleep 5;
    playMusic "LeadTrack02_F_Mark";

    intro = true;
};
#

that's what I'm trying now

little eagle
#

And that STILL plays the infoText sound during the loading screen?

loud python
#

yes

#

it starts the moment the player unit comes into existance

#

and doesn't wait for anything

#

and I'm constantly commenting in and out the playMusic line to make sure it's not a caching problem

#

hmmm...

#

I haz an idea

#
    ...
    bis_fnc_init=false
    cutText ["", "BLACK FADED", 10, true];
    waitUntil {!isNil {bis_fnc_init} and bis_fnc_init}
    ...
still forum
#

where does bis_fnc_init come from ? How does it magically become true?

#

Why do you check isNil although you've just set that variable to non-nil

little eagle
#

initFunctions.sqf

loud python
#

yeah, I noticed I can remove the isNil

little eagle
#

It's either nil or true

still forum
#

yeah.. I don't think a function will ever become true...

#

Also.. Don't you want to detect loading screens? I don't see how this would help

little eagle
#

It's not a function. They are just retarded.

loud python
#

it's a variable that is set to true at the end of a function

#

thus it tells me that the function as terminated

still forum
#

You can never be sure that the last loading screen is over. because any mod can open a loading screen at any time.

loud python
#

then that counts as the mod altering your gameplay experience xD

still forum
#

I also tried a lot to detect that..
We have a double loading screen of which the second one sometimes never exits

loud python
#

there's a warning box in the first loading screen for that

little eagle
#

That's what I begin to think. The loading screen from initFunctions is not the same as the one after the briefing.

still forum
#

I guess...

#

You could use something like XEH to detect when the loading screen display closes.

#

Then start your script which first sleeps for a couple seconds

little eagle
#

Which one is it though?

still forum
#

if another loading screen opens terminate your script and relaunch it when it closes again

#

RscDisplayNotFreeze / RscDisplayLoading/ ... Gimme a couple min

little eagle
#

Yeah, the loading screen from initFunction is the one that throws you in the briefing.

#

And after the briefing, another one happens, but BIS_fnc_init is long set to true at that point.

#

Probably hard coded that part.

loud python
#

I love arma

#

they could have thrown in a handy variable like loadingScreenActive

#

I mean, it would seem like a common use case xD

still forum
#

RscDisplayNotFreeze is the default

little eagle
#

They all use the same variable sadly, dedmen.

#

RscDisplayLoading

still forum
#

findDisplay

little eagle
#

Only works for dialogs.

still forum
#

CBA XEH

little eagle
#

I'm 99 this is a display on #46

#

Wouldn't help here, Dedmen. Since they all share the same variable.

#

And what if they reuse this display?

#

Oh, whataboutthis

still forum
#

You can make your own variable with Load/unload XEH

little eagle
#
waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}};
waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")};
waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
#

This waits for 2 loading screens^^

loud python
#

I'll see if that works

little eagle
#

The third line has the wrong {} again

loud python
#

!isNull wants object, not code ๐Ÿ˜›

little eagle
#

The third line has the wrong {} again

loud python
#

yeah I know xD

#

with the power of vim

#

that's just f{r(f}r)

#

aaand... it works not

#

dammit

still forum
#

Make a while loop

loud python
#

?

still forum
#

Start your script like I said earlier with a couple seconds sleep at the start.
When a loading screen pops up terminate your script. wait till loading screen closes and then back to start

#

That way your script basically automatically stops when a loading screen pops up

little eagle
#
0 spawn {
waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}}; 
waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")}; 
systemChat str 0;

waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")}; 
waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};

systemChat str 1;
};

This prints 0 in the briefing and 1 in the mission for me.

#

I added your code to this and the only thing that doesn't work is the blackout.

#

The rest works.

loud python
#

the worst part is

#

I remember having found a way that triggers when the loading screen is over

#

but I wasn't happy with how it triggered just a bit late, and thus the player could see the character for a split second

#

but I don't remember what it was ๐Ÿ˜ข

still forum
#

Btw there is a function to check if Display is enabled. meaning false when loading screen.
That's 4 lines of code to expose that as a SQF function

little eagle
#
0 spawn {

    waitUntil {!isNil {uiNamespace getVariable "RscDisplayLoading"}}; 
    waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")}; 
    systemChat str 0;

    waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")}; 
    waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};

    systemChat str 1;

    "mission" cutText ["", "BLACK FADED", 10, true];

    sleep 2; 
    0 = ["30 minutos antes...", -1, -1, 3, 3] call BIS_fnc_dynamicText; 
    sleep 3; 
    "mission" cutText ["", "BLACK IN", 10, true]; 
 
    0 = ["Aeropuerto Babylon", "Oeste de Altis"] call BIS_fnc_infoText; 
 
    sleep 5; 
    playMusic "LeadTrack02_F_Mark";
};

This works for me as MP host. Will be working on client after dinner.

still forum
#

Just so you can imagine how lazy BI is

loud python
#

I wonder...

#

if input isn't disabled during the loading screen...

#

what else is keeping the player from moving?

still forum
#

Are you sure input isn't disabled?

loud python
#

yes

#

pretty sure

still forum
#

IMO it should be

loud python
#

I did waitUntil disabled; waitUntil !disabled

#

and it froze foreber

still forum
#

you mean the inputEnabled script command thing?

loud python
#

yes

#
waitUntil {userInputDisabled};
waitUntil {!userInputDisabled};
still forum
#

That's a different thing

loud python
#

is it?

still forum
#

There are multiple things that can disable input

#

that's just one of them

loud python
#

what are the others?>

#

BTW. I just can't imagine nobody else has ever had this problem before me...

still forum
#

nothing you can access from sqf

loud python
#

yay

still forum
#

I and my missionmaker have it.. But.. We didn't want to go into that so he just put a 60s sleep infront of his script

#

and that works good enough

loud python
#

maybe

#

but I don't like that kind of solution

#

on a really slow PC it would still not be enough, and on most good gaming PCs that would just be 55 seconds black screen

still forum
#

Also we have hacks.. So we can just do

bool isDisplayEnabled() {
return *((bool*) (world + 0x1AE5));
}

and then just use that func to reliably detect when loading screens are over. But that won't help you much I guess

loud python
#

so in the end, there's just no way to reliably figure out when a loading screen is open?

still forum
#

Well you can use my method from earlier. combined with what commy does

loud python
#

otherwise I could just do a while loop that sleeps 0.1s, breaks if no loading screen is open and waits until it closes otherwise

still forum
#

reading the RscDisplayLoading variable seems to work

#

that's somewhat what I said earlier

loud python
#

is it?

#

I'll try that then

#

does sqf have post-test-loops?

still forum
#
0 spawn {
    while {true} {
        _yourScript = [] spawn {Sleep 5; < your music script stuff here>};
        waitUntil {(!isNil {uiNamespace getVariable "RscDisplayLoading"}) || scriptDone _yourScript}; 
        if (scriptDone _yourScript) exitWith {}; //Our script is done running and no loading screen interrupted.
       
        //Oh noes a loading screen
        terminate _yourScript; //Stop our script from running
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")}; //Wait till loading screen is over
    };
};
#

like that

#

If a loading screen pops up before the 5 second sleep is over your script will be killed before it did anything. and will be restarted when loading screen ended

#

Ofcause if there is a 5second space between loading screens your music can start just before another loading screen starts.. So this is again no 100% solution

loud python
#

Don't get me wrong, overall I think BIS are absolutely great, but sometimes... SOMETIMES...

#

for me it's okay if there's a 0.5s pause between loading screens

#

if a mod adds a loading screen after that, bad luck

#

the mod breaks the mission

#
    sleep 0.1;
    while {!isNull(uiNamespace getVariable "RscDisplayLoading")} do {
        waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")};
        sleep 0.1;
    };
#

should that work?

still forum
#

no

loud python
#

no?

still forum
#

while true.. waitUntil true

#

waitUntil true doesn't make sense

loud python
#

ah, dammit

#

yeah, that second ! shouldn't be there xD

still forum
#

That might work if the second loading screen opens 0.1 seconds after the first

#

Why not just my solution?

loud python
#

it's more convoluted with all the spawning and stuff xD

#

if I can do it good old imperative style, then I will

little eagle
#

OK, what I posted before does work for a MP Host, a MP client JIP, but not a MP client at the start of the mission.

still forum
#

you can just waitUntil either loading screen opens or 5 seconds of time go past without a loading screen interupting.

little eagle
#

Apparently there is a third loading bar.

still forum
#

If a loading screen interrupted then wait till it closes and repeat.
If 5 seconds passed then exit the loop and run your script

#

My solution without extra spawning

little eagle
#

The same applies probably to a dedicated Server connected MP client

loud python
#

that's basically my solution

#

basically

#

I just did it in a simpler way

#

wait for a while

#

if there's a loading screen open, wait until it closes

#

wait for another while and repeat

still forum
#
_timeOver = false;
    while {!_timeOver} {
        _startTime = diag_tickTime;
        waitUntil {(!isNil {uiNamespace getVariable "RscDisplayLoading"}) || (diag_tickTime - _startTime) > 5}; 
        if ((diag_tickTime - _startTime) > 5) exitWith {_timeOver = true; true}; //No loading screen interrupted so we can exec now.
       
        //Oh noes a loading screen
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")}; //Wait till loading screen is over
    };
#

Something like that.. I guess that should work

loud python
#

I pretty much copied your solution with different code

still forum
#

if no loading screen happened in the last 5 seconds then your code will execute

little eagle
#

But dedmen, the briefing can take minutes.

still forum
#

You can detect that though with...

loud python
#

initPlayerLocal.sqf executes after the briefing

#

if by briefing you mean the same thing as I xD

still forum
little eagle
#

getClientStateNumber >= 10

#

So a single

#
waitUntil {getClientStateNumber >= 10 && {isNull (uiNamespace getVariable "RscDisplayLoading")}}};
#

?

still forum
#

That will wait past briefing and the first loading screen

little eagle
#

There is only one past briefing. Before briefing there are 1 or 2.

still forum
#

could put that above my while loop if briefing is a concern

#

Mods can cause multiple ones though

little eagle
#

I haven't encountered one after the briefing.

loud python
#

I will try overkill and combine both solutions

if (isNil "intro") then {
    cutText ["", "BLACK FADED", 10, true];

    waitUntil {getClientStateNumber >= 10 && {isNull (uiNamespace getVariable "RscDisplayLoading")}}}; 
    sleep 0.5;
    while {!isNull(uiNamespace getVariable "RscDisplayLoading")} do {
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
        sleep 0.5;
    };

    sleep 2;
    0 = ["30 minutos antes...", -1, -1, 3, 3] call BIS_fnc_dynamicText;
    sleep 3;
    cutText ["", "BLACK IN", 10, true];

    0 = ["Aeropuerto Babylon", "Oeste de Altis"] call BIS_fnc_infoText;

    sleep 5;
    playMusic "AmbientTrack01a_F";

    intro = true;
};
#

let's see if that works

still forum
#

Why don't you just use my solution?

#

I give you something that works and you ignore it. Why do I even bother

little eagle
#

But dedmen, your's... How does it handle the brieing?

still forum
#

initPlayerLocal.sqf executes after the briefing

little eagle
#

Really?

still forum
#

He said that himself. So I assume he runs his code in there and he is sure that it runs after briefing

loud python
#

look, it's nice to have something that works in case this doesn't

#

but at this point I feel like I need to try my solution until either it works or I just find out it can't work at all

still forum
#

Your script is gambling that the loading screen happens after 0.5 seconds. Which can work in your testing. But other people with slower computers might take longer

loud python
#

that's not really a problem though

#

I can always change that to 2 or even 5 seconds

#

the thing is, the code doesn't work at all

#

trying with 5 seconds now

little eagle
#

The one you posted has a } too much.

#

waitUntil {getClientStateNumber >= 10 && {isNull (uiNamespace getVariable "RscDisplayLoading")}}};

#

Should only be 2 closing } at the end, not 3

loud python
#

waitUntil {(getClientStateNumber >= 10) && (isNull (uiNamespace getVariable "RscDisplayLoading"))};

#

already changed it to that

#

still doesn't work

#
    sleep 5;
    while {!isNull(uiNamespace getVariable "RscDisplayLoading")} do {
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
        sleep 5;
    };

Why doesn't this work?

#

is there some stupid mistake in that approach?

agile pumice
#

do you even need to put a waituntil inside a while?

#

waituntil runs its own loop

little eagle
#

Idk, it looks weird to me.

#

I got it to work for me.

#

I can upload the mission, mom

agile pumice
#
  // exit loop if the unit gets deleted
  if (isNull _unit) exitWith {true};  // has to return true to continue

  !alive _unit;
};```
loud python
#

I know, it's a loop inside a loop

agile pumice
#

for example

loud python
#

it repeatedly waits until there is no loading screen, waits a while, and checks if there's a new one

#

if there is, it again waits until it's gone

gleaming cedar
#

How do you hide and object but keep the effect when shot"?

little eagle
loud python
#

except it doesn't; it just skips the loop and starts the script while there's still a loading screen

gleaming cedar
#

I want sparks to come off a person when you shoot it

#

So I attached a locker but now when I hide the locker the effects gets removed

little eagle
#

You can't. If you hide it, it can't be shot.

#

No way around that.

loud python
#

what does systemChat str 0 do?

little eagle
#

Debug.

loud python
#

ah, okay

#

hmmm

#

I might add some of that to my script to see what happens xD

little eagle
#

Have you tried this mission on the dedicated? I don't have a dedicated to test, but it works in hosted MP, as client - JIP or not.

#

As well as Host.

winter dune
#

@loud python if I'm not wrong, it will convert the integer into a string and then type that string into the systemChat

still forum
#

@winter dune Scalar/float. There are no integer's in Arma ๐Ÿ˜‰

little eagle
#

Yes, it will do that. It's just how I debug timing. 0,1,2 etc. in chat.

winter dune
#

@still forum ๐Ÿ‘Œ

little eagle
#

0 is an integer (whole number) no matter what you hackers say.

loud python
#

integer != whole number ๐Ÿ˜›

still forum
#

But after it's compiled it is a float ๐Ÿ˜‰

#

Arma sees a 0.0

#

\(0.0)/
If you expect Arma to work with integers you expect that if str _v1 == "8" and str _v2 == "8" that _v1 == _v2 which might not be the case

little eagle
#

Integers include all whole numbers and their negative counterpart
Wow you hackers are weird.

#

Whole numbers ARE all natural numbers plus 0 plus them with negative sign.

#

Z0

#

Whole numbers.

loud python
#

hmmm...

#

the definition I learned is a bit different

#

basically an integral domain

#

but according to wikipedia it's different

#

maybe I was just remembering it wrong

#

but programming integers are not integers then

still forum
#

I don't care about the "real world" definition.
In my brain there are signed/unsigned integers and floats and doubles

loud python
#

well they are, but they are a limited subset of integers

little eagle
#

โ„ค

still forum
#

Well.. integers have limited storage. So not even all natural numbers would fit

loud python
#

nope

#

integers aren't limited storage

still forum
#

in programming there is no unlimited storage tho. everything is limited

loud python
#

C is wrong

little eagle
#

lol

loud python
#

xD

tame portal
#

I agree with Dedmen

loud python
#

I agree with the definition xD

little eagle
#

I disagree with the definition and make up my own,

loud python
#

the integer data type stores integers, but it cannot store all integers

little eagle
#

What about the intro / loading screen. Tried my mission?

tame portal
#

"Integers are bubbles with 20% soap" My definition

loud python
#

word would have been a more fitting name for the data type

#

or even word32 and word64

little eagle
#

Yes, name something that represents a number "word".

still forum
#

word :u

tame portal
#

uWord

still forum
#

How about QWORD or DWORD or OWORD (Octa-word)

tame portal
#

can hold more letters but no uppercase

loud python
little eagle
#

In group theory

#

Aaand ctrl w

loud python
#

group theory can be fun though xD

#

try implementing AES without it

still forum
#

AES? Arma EnScript?

little eagle
#

What about the loading screen : (

#

I want to know if it works.

#

It did for me.

loud python
#

Advanced Encryption Standard

still forum
#

Loading screen :U

loud python
#

Loading screen

tame portal
#

Screw the loading screen, there are more important things to discuss

loud python
#

true

#

we got a bit offtopic

little eagle
#

lol

loud python
#

there's no #offtopic_nerdtalk channel

little eagle
#

This IS that channel.

still forum
#

Let's take a minute of silence to appreciate how wonderful our world is.

#

Ok done. What now?

loud python
#

wait, did we only get a bit offtopic, or ded we get an entire integer offtopic? badum tsss...

#

I'll see myself out...

tame portal
#

Scripting is literally the only channel that goes offtopic so often but it's the only place where its allowed

still forum
#

"allowed"

tame portal
#

Okay lets say its being "ignored by accident"

little eagle
#

The mods are shaking their heads so violently that they can't find the ban button.

loud python
#

xD

still forum
#

So does the loading screen stuff work now?

loud python
#

nope

#

but I have noticed something weird

#

the script ran twice

#

it's in initPlayerLocal.sqf and the player respawn .sqf

#

but I didn't respawn

#

so maybe the player respawn script also runs when the player first spawns?

still forum
#

How else do you want to put him inside if not in a seat?

loud python
#

tie them to the top of the roof, obviously

little eagle
#

so maybe the player respawn script also runs when the player first spawns?
Maybe?

still forum
#

place him somewhere. and them move the vehicle to under him

little eagle
#

Fill the vehicle, drag him, remove the units from the vehicle.

loud python
#

@little eagle for me RscDisplayLoading doesn't work at all

#

can confirm, the respawn script runs when the player appears

little eagle
#

What about the mission I uploaded?

loud python
#

tried that code, didn't work

#

haven't looked at the mission itself, only at the init code

little eagle
#

: /

loud python
#
if (isNil "intro") then {
    intro = true;
    systemChat "Waiting for briefing";
    waitUntil {getClientStateNumber >= 10};

    systemChat "Fading and playing Music";
    cutText ["", "BLACK FADED", 10, true];
    playMusic "AmbientTrack01a_F";

    systemChat "Waiting 5 seconds..>";
    sleep 5;
    systemChat "Is there a loading screen?";
    while {!isNull(uiNamespace getVariable "RscDisplayLoading")} do {
        systemChat "Loading screen, wait until it's gone";
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
        systemChat "Loading screen gone; sleep for 5 seconds";
        sleep 5;
    };
    systemChat "Done waiting, starting intro";

    sleep 2;
    0 = ["30 minutos antes...", -1, -1, 3, 3] call BIS_fnc_dynamicText;
    sleep 3;
    cutText ["", "BLACK IN", 10, true];

    0 = ["Aeropuerto Babylon", "Oeste de Altis"] call BIS_fnc_infoText;

    sleep 5;
};
#

it totally skips the loop

little eagle
#

Because it's null probably.

still forum
#

So there happens to be no loading screen in that one frame you check for a loading screen

loud python
#

I'll try

    while {true} do {
        systemChat "Waiting for Loading Screen";
        waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")};
        systemChat "Waiting for NO Loading Screen";
        waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
    }
#

and see what happens

#

yay

#

the variable is never set

#

it just doesn't work

#

I should have checked that earlier...

#

well, then I guess dedmens solution is out the window too

#

since it also uses that RscDisplayLoading variable

#

Any other ideas?

little eagle
#

Try my mission.

loud python
#

fine

#

but I don't expect it to work

little eagle
#

It doesn't in SP, because clientStateNumber, but it should in MP.

loud python
#

well, let's see

#

eeeh

#

I don't know

#

the loading screen is too short

#

not even a second

#

it might be working, or it might not

#

that's why I'm testing on altis

little eagle
#

Oh, so I should retry on say Statis?

loud python
#

changing to altis

#

it's all in the init field, right?

#

so I can just copy the units into another mission?

#

nope

#

the loading screen is too short

#

probably because the mission is empty

#

and 1 appears in the chat before the loading screen

#

so no, it doesn't work ๐Ÿ˜ญ

#

also I don't need getClientStateNumber because my code runs in onPlayerRespawn.sqf

little eagle
#

I have no idea. I threw it in initPlayerLocal.sqf on a Stratis mission and it works there too.

loud python
#

are you sure?

#

it's not just that the loading screen disappears too soon?

#

in my mission I get about 15 seconds of loading screen

little eagle
#

How could I extend the loading screen?

#

Oh, just a postInit function with a sleep

loud python
#

postInit?

little eagle
#

Works for me even with a massive loading screen.

#

shrug

loud python
#

nope

#

doesn't work

#

it starts the moment I click continue

#

wait, we're talking about the same loading screen, right?

#

the one after the map screen?

little eagle
#

The one after you confirm the briefing by pressing continue.

loud python
#

yes

little eagle
#

I am.

loud python
#

good, for a moment I thought we were talking about different things xD

#

well

#

it doesn't work

little eagle
#

You said RscDisplayLoading is always null during that screen?

loud python
#

yes

#

how are you running the mission?

#

play MP from editor?

little eagle
#

Yes.

loud python
#

is arma trolling me?

#

do I have a typo in the variable name?

#

am I just going insane?

little eagle
#

Idk, I hear people bitching about the loading screen and executing something afterwards a lot.

loud python
#

but BIS doesn't hear them? xD

little eagle
#

I never figured out which display that post briefing loading screen is.

#

Weird that you say RscDisplayLoading is null.

loud python
#

I made sure and copied it from your mission to make sure it wasn't a typo

#

nothing, it still stays null the entire time

#
while {true} do {
    systemChat "Waiting for Loading Screen";
    waitUntil {!isNull (uiNamespace getVariable "RscDisplayLoading")};
    systemChat "Waiting for NO Loading Screen";
    waitUntil {isNull (uiNamespace getVariable "RscDisplayLoading")};
}
#

maybe there's some different solution?

#

can I assign different spawning positions to different units?

#

or groups?

#

that way I could just force respawn on start

little eagle
#

Sides, yes.

loud python
#

no

#

not sides

#

units or groups

little eagle
#

No.

loud python
#

FML

little eagle
#

I'll do some debugging with xeh

#

Log every damn display.

agile pumice
#

well I just tried a waituntil inside a while loop myself for a script I'm writing and I can't get mine to work either XD

#

I should probably throw in a nil check so it doesn't add the EH repeatidly

#

waitUntil {!isNull _vehicle && isNil "EH_worldtoscreen"};

loud python
#

maybe waitUntil inside a while loop just doesn't work?

#

might that be a bug?

agile pumice
#

well I remember it working before

loud python
#

WHAAAAAT?

#

@little eagle now it's working

#

kinda

#

a bit

little eagle
#
22:43:32 Mission LOADING_SCREEN_TEST.VR: Missing 'description.ext::Header'
22:43:32 ["DEBUG",3,["onLoad",[Display #70],"RscDisplayMultiplayerSetup","GUI"]]
22:43:32 XEH: missionNamespace processed [false]
22:43:36 Starting mission:
22:43:36  Mission file: LOADING_SCREEN_TEST
22:43:36  Mission world: VR
22:43:36  Mission directory: C:\Users\Robert\Documents\Arma 3\mpmissions\LOADING_SCREEN_TEST.VR\
22:43:36 ["DEBUG",7,["onLoad",[Display #101],"RscDisplayLoading","3DENDisplaysTemp"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #105],"RscDisplayLoading","3DENDisplaysTemp"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #311],"RscCustomInfoMiniMap","IGUI"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #320],"RscCustomInfoMineDetect","IGUI"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #313],"RscCustomInfoCrew","IGUI"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #315],"RscCustomInfoUAVFeed","IGUI"]]
22:43:39 ["DEBUG",7,["onLoad",[Display #312],"RscCustomInfoSlingLoad","IGUI"]]
22:43:39 No speaker given for 
22:43:39 [3127,817.891,0,"XEH: PreInit started. v3.4.1.170912"]
22:43:39 [3127,818.423,0,"XEH: PreInit finished."]
22:43:40 c:\w\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
22:43:40 [3128,818.994,0,"XEH: PostInit started. MISSIONINIT: missionName=LOADING_SCREEN_TEST, missionVersion=53, worldName=VR, isMultiplayer=true, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
22:43:40 [3128,819.039,0,"CBA_VERSIONING: cba=3.4.1.170912, "]
22:43:40 [3128,819.044,0,"XEH: PostInit finished."]
22:43:40 ["DEBUG",8,["onLoad",[Display #105],"RscDisplayLoading","3DENDisplaysTemp"]]
22:43:41 ["DEBUG",8,["onLoad",[Display #52],"RscDiary","GUI"]]
#

^ before "continue on briefing" button

#
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #303],"RscStanceInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #303],"RscStanceInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onUnload",[Display #52,1],"RscDiary","GUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #46],"RscDisplayMission","GUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #12],"RscDiary","GUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #105],"RscDisplayLoading","3DENDisplaysTemp"]]
22:44:26  Mission id: f28be7ff3a7f081df85295ffebc5000d96b93562
22:44:26 ["DEBUG",10,["onLoad",[Display #105],"RscDisplayLoading","3DENDisplaysTemp"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #300],"RscUnitInfo","IGUI"]]
22:44:26 ["DEBUG",10,["onLoad",[Display #303],"RscStanceInfo","IGUI"]]
#

^ afterwards

#

Sadly it uses idd 105 multiple times. So they do reuse the same resource.

#

10 is the clientStateNumber

agile pumice
#
    while {alive player} do 
    {
        _nearVehicles = nearestObjects [player, ["Car"], 5];
        _vehicle = _nearVehicles param [0, objNull];
        
        waitUntil {!(isNull _vehicle) && (isNil "EH_worldtoscreen")};
        systemChat "adding worldtoscreen EH";
        EH_worldtoscreen = addMissionEventHandler ["Draw3D", {call ed4_vehicles_hud_fnc_worldtoscreen}];
        waitUntil {(isNull _vehicle) && !(isNil "EH_worldtoscreen")};
        systemChat "removing worldtoscreen EH";
        removeMissionEventHandler ["Draw3D",EH_worldtoscreen];
    };
};```
still forum
#

@Whale#5963 Why do you put a link into code so that no one can click it?

agile pumice
#

when I run the code in a sqf file, it doesn't seem to work, but when I run it in debug, I get results

#

I have to execute the code when _vehicle isn't null for it to add the eventhandler

#

if I execute when _vehicle is null, and approach the vehicle, it won't add the eventhandler

loud python
#

test

#

oh

#

discord is back

#

@little eagle are you there?

little eagle
#

Yes.

loud python
#

I found out that, while the script doesn't work as intended, it works if the player presses escape

#

"RscDisplayLoading" stays null until then

#

but when the player presses escape

#

BOOM!

#

It goes to not null and back to null

#

and the intro starts

little eagle
#

lol

loud python
#

yeah

#

it's kinda weird

#

but I'd say that's a dead end

little eagle
#

Sounds like there is another display open?

loud python
#

who knows

#

any idea what else I could test for?

#

userInputDisabled doesn't work

little eagle
#

Not really.

loud python
#

the player unit already exists, so I can't wait for that either

agile pumice
#

strangely, when I remove the eventhandler, the EH doesn't become nil

loud python
#

there has to be a way to detect if there's something covering the screen

still forum
#

If all mods were properly using CBA you could just waitUntil CBA's postInit is done ยฏ_(ใƒ„)_/ยฏ

#

Are you sure findDisplay doesn't work?

loud python
#

if I knew what that was I could tell you xD

#

and you can pretty much assume there are no mods

#

as I said a few times already, if a mod breaks things, then that's that, I only care that it works in vanilla arma

#

@still forum how would you suggest using findDisplay?

still forum
#

findDisplay <IDD of loading screen>

#

if it returns displayNull it didn't find anything

loud python
#

how can I find out the IDD of the loading screen though?

still forum
#

else it found a display with the IDD of the loading screen. Which means there is a loading screen open

#

Check config viewer

#

RscDisplayNotFreeze

#

Or scroll up and check commys log

#

Display 105 and 101 are "RscDisplayLoading"

loud python
#

so I could do

    waitUntil {isNull findDisplay 101};
    waitUntil {isNull findDisplay 105};

?

still forum
#

yea.. think so

loud python
#

doesn't work

still forum
#

But you still have to handel multiple loading screens

loud python
#

nope

#

doesn't work

#

waitUntil {!isNull (findDisplay 105)}; waits forever

still forum
#

in debug console isNull returns true

tough abyss
#

@little eagle - Robert, is it now?

little eagle
#

Ha, that's the name entered by the one that set up this machine first.

noble pond
#

lol

tough abyss
#

Yeah no German is called Robert.

little eagle
#

UAC is disabled anyway.

noble pond
#

im sure security guru's would cringe.

little eagle
#

I don't own anything valuable. The worst that could happen is that someone steals my porn folder.

#

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

#

This machine wasn't used anymore, so I bought it for 50. My other laptop one doesn't have a working screen anymore.

tough abyss
#

I'd ask about the porn but I'm afraid of the answers...

plucky willow
#

what is the correct way to check a boolean value in an if statement?

#

i keep getting an error that says expecting a number, string, object, etc when i have type boolean

#

for reference my current code looks like this

#

if (_bool == false) then { _assignNum = 1 }

agile pumice
#

you can use if !(_bool)

#

or if (bool)

#

don't use == false or == true

plucky willow
#

ah i see, ill give that try

agile pumice
#

basically you're saying if true == true

#

thats not really not how booleans are meant to be intrepreted

still forum
#

You can do true == true it's a legit thing to do. Besides that it doesn't work in SQF.
But true == true returns true.
so there is no reason not to just use the true you already have.

#

if ((((true == true) == true) == true) == true)

#

I wonder how many idiots would do that if BI had implemented == for Bools

plucky willow
#

it works, thanks a lot @agile pumice

agile pumice
#

oh my god Dedmen XD

#

my brain is trying to process that and it hurts

still forum
#

count is no longer the fastest way to iterate arrays ๐Ÿ˜„ #intercept
count myTestArray 10000
{_x} forEach myTestArray 16.6ms
{_x} count myTestArray; 10.75ms
myTestArray iforEach2 {_x} 9.19ms

and I'm not even done yet
You can also nicely see why count > forEach if you have many elements

subtle ore
#

This is, interesting.

agile pumice
#

can anyone see an issue with this?

    while {alive player} do 
    {
        _nearVehicles = nearestObjects [player, ["Car"], 5];
        _vehicle = _nearVehicles param [0, objNull];
        
        waitUntil {!(isNull _vehicle) && (isNil "EH_worldtoscreen")};
        systemChat "adding worldtoscreen EH";
        EH_worldtoscreen = addMissionEventHandler ["Draw3D", {call ed4_vehicles_hud_fnc_worldtoscreen}];
        waitUntil {(isNull _vehicle) && !(isNil "EH_worldtoscreen")};
        systemChat "removing worldtoscreen EH";
        removeMissionEventHandler ["Draw3D",EH_worldtoscreen];
        EH_worldtoscreen = nil;
    };
};```
#

i never get the first systemChat

still forum
#

_vehicle will never become !isNull

#

because you never set it to a different value

#

you have to execute the nearestObjects stuff in your waitUntil

agile pumice
#

so...

    while {alive player} do 
    {
        waitUntil {
            _nearVehicles = nearestObjects [player, ["Car"], 5];
            _vehicle = _nearVehicles param [0, objNull];
            if (!(isNull _vehicle) && (isNil "EH_worldtoscreen")) exitwith {true};
            false
        };
        systemChat "adding worldtoscreen EH";
        EH_worldtoscreen = addMissionEventHandler ["Draw3D", {call ed4_vehicles_hud_fnc_worldtoscreen}];
        waitUntil {
            _nearVehicles = nearestObjects [player, ["Car"], 5];
            _vehicle = _nearVehicles param [0, objNull];
            if ((isNull _vehicle) && !(isNil "EH_worldtoscreen")) exitwith {true};
            false
        };
        systemChat "removing worldtoscreen EH";
        removeMissionEventHandler ["Draw3D",EH_worldtoscreen];
        EH_worldtoscreen = nil;
    };
};```
still forum
#

yes... looks good

agile pumice
#

oh my god it works

#

do you accept nudes?

#

jk

still forum
#

I accept everything

jade abyss
#

๐Ÿ˜

#
waitUntil {
...
...
            if (!(isNull _vehicle) && (isNil "EH_worldtoscreen")) exitwith {true};```
exitWith in waitUntil?
austere granite
#

why not?

#

oh waitUntil uhhh

#

nvm me then, i was reading 'while'

jade abyss
#

Also:
The whole if statement (and the following false can be removed. A simple

waitUntil
{
    BlaBlaCode 1;
    blabla Code2;
    (!(isNull _vehicle) && (isNil "EH_worldtoscreen"))
};

is enough

agile pumice
#

thanks, will fix it up

#

was just going by wiki example

still forum
#

I am building the most frankenstein thing every in Intercept XD
But if it works it will be awesome
I'm building the fastest ARRAY forEach CODE loop ever.
Yes I swapped the arguments ยฏ_(ใƒ„)_/ยฏ

uneven prawn
#

Does anyone know why if you use "setVehicleAmmo 0" or "setVehicleAmmoDef 0" on vehicles with commander turrets it breaks them? I have noticed with tanks that if you use those commands, after you rearm them using "setVehicleAmmo 1" you are not able to rearm the different types of ammo, although you can do it using "setVehicleAmmoDef 1" . The only problem is that if you have anything configured (For example removing some types of weapons on a vehicle, if you use ""setVehicleAmmoDef 1" then whatever you have configured it overrides everything and adds all the ammo/weapons back to the vehicle.

meager granite
#

Vehicles unlike man units leave their empty magazines in the turrets

#

Ammo trucks actually replenish these empty magazines into full ones

#

Running setVehicleAmmo 0 doesn't just make magazines empty, it deletes them completely

#

So then running setVehicleAmmo 1 again or trying using ammo truck doesn't do anything, there is nothing to rearm

#

So its typical scripting commands bedlam, something tells me setVehicleAmmoDef was introduced so you can rearm back after using setVehicleAmmo <1, instead of just fixing setVehicleAmmo to leave empty magazines instead of deleting them (so setVehicleAmmo 0; setVehicleAmmo 1; would work)

hasty violet
#

Does BIS_fnc_taskSetState have to run on each machine, or does it execute globally?

agile pumice
#

strangely my code works for one vehicle but not another ๐Ÿ˜ƒ

sullen dune
#

do trigger timers exec from server time or client time?

subtle ore
#

server iirc

manic sigil
#

Could you, in theory, do createVehicle ["thingy", _x]} forEach [array of position arrays]?

subtle ore
#

yeah?

#
{
    "Cookie" createVehicle _x;
} forEach _coolCookieSpots;
manic sigil
#

Alright. That may be my way in to making premade compositions for official servers. A painful way, but maybe worth it.

#

Hrm... damn, though, it wont inherit direction will it :/

subtle ore
#

Sugar cookies are better than just regular cookies, remember that. You can set the direction or store the direction in a vriable alongisde the position array

#
private _posData = [(yourdirectionvaluehere),[x,y,z]];
manic sigil
#

But then I'd be down to scripting each piece manually, though extracting that data is a lot better than ctrl-c/ctrl-v each piece.

subtle ore
#

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

#

either pre determine the direction for each composition

manic sigil
#

Ill play with it. Even getting the basic layout in position then spinning pieces could be more power than Im expecting.

subtle ore
#

and just place the value

jade imp
#

is the wiki down?

#

the BIstudio one

still forum
#

no. Quite slow tho

jade imp
#

is anyone around willing to help me out with something real quick?

still forum
#

You first need to tell us what that is

jade imp
#

So, I want to make a scroll option on a phone, when you activate,

  1. Deletes the phone
  2. Adds the user to a custom radio channel
  3. Allows access to the map
#

im pretty new to scripting, trying to write up a rough script real quick

still forum
#

on a phone? UI?
Do you already have the phone?

jade imp
#

No, I don't need a UI. I'm thinking like, you scroll "Pick up phone" and then it adds a map to their inventory

#

I could make a UI but I cant do art for the life of me

meager granite
#

@still forum Do you know anything about broken turrets bug? The one where turret never changes locality (and local to all clients at once) so you can fit as many players into same turret as you want.

#

I had a repro for it in A2 but it doesn't work in A3 yet bug is still there.

still forum
#

Nope I don't never heard of it

jade imp
#

thank you

meager granite
#

You probably seen it at least once, like when player flies behind the helicopter while they're in co-pilot seat?

still forum
#

Well sometime when someone is lagging he stays still while helicopter continues moving

still forum
#

Yeah that think I've never seen

subtle ore
#

I'd imagine it's more than just the client's net

#

possibly the output of the server as well

meager granite
#

Been in the game since at least 2012, maybe earlier, still present in A3

#

(Second clip in video is unrelated)

still forum
#

What I did today:
count myTestArray 10000
{_x} forEach myTestArray; 16.94ms
{_x} count myTestArray; 10.75ms
{_x; true} count myTestArray; 18.64ms Gosh count with true is bad... nil and false aren't any better
myTestArray iForEach2 {_x}; 9.27ms <-- Fastest ๐Ÿ˜‰ Hell yeah #Intercept

#

I made a way to iterate through arrays without _forEachIndex and without return value and without counting and forcing you to return booleans

still forum
#

I had to implement my own script instruction to set _x. So I basically reimplemented the = operator.
Without that my function is 15ms (because it includes _x = currentElement) because Arma's = operator checks at runtime at every iteration if the variable name is allowed. So it goes through all script commands and checks if a command with that name exists. Which is ofcause total bullshit because there is no script command at all that starts with _.
And that could also just be done at compileTime.. But BI doesn't care about your performance..

One variable assignment on 10k iterations. Removing that idiotic check gives me a plus of over 5 and a half milliseconds. Which is 1/3rd of the total runtime of that thing.

subtle ore
#

Well, your baby intercpept looks like it'll grow up strong soon

still forum
#

I have done some crazy stuff in Intercept so far...
But writing my own script instructions and essentially writing the SQF equivalent of assembly. That's a bit too crazy...

subtle ore
#

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

jade imp
#

How would I, in addAction, say hideOnUse, but skip all the variables before it?

subtle ore
#

you don't

#

if you wan't to use hideOnUse, use all the default values for the passed paramters before hideOnUse

#
addAction["Cookies",{},nil,1.5,true,true,"","true",15,false,""];
#

all the default params

jade imp
#

alright, thanks

manic sigil
#

So of course Achilles mod already has a function that creates an SQF file that is literally 'create all things in the mission in the exact position and status that you have them in as the editor'... so you can copy paste it and run it.

uneven prawn
#

Anyone seen this?

#

Inventory item with given name: [Binocular] not found

subtle ore
#

@uneven prawn Seems like a normal rpt message, is it critical somehow?

uneven prawn
#

No I just never seen it before

#

So just wondering

#

Going through my RPT to check all the odd dogs ๐Ÿ˜›

subtle ore
#

lol

uneven prawn
#

I have odd errors for days

#

lul

#

I get that same error for Laserdesignator uhm

subtle ore
#

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

uneven prawn
#

Is there any way to track what objects are generating the Error: Object(41 : 335) not found errors?

subtle ore
#

I honestly think they are net objects being deleted and all of a sudden become null somewhere along the line and the rpt throws an error

#

happens when I die in mp

uneven prawn
#

I see

#

I have I think around

#

70.000 lines worth of that

#

lol

subtle ore
#

lol

meager granite
#

Yeah, any turrets

#

I had repro in OA (which isn't even 100%, works after several tries), it doesn't work in A3 but nobody gonna look at OA engine anymore.

meager granite
#

Yes vehicle cannot be fixed once bugged, all JIP players will see it bugged (though it may appear working to players that were in the game before it broke)

#

As for not worrying, I did some unusual manipulations in OA years ago to achieve features I need which resulted in said repro of this bug

#

And I can't avoid this bug without getting rid of the features which pretty much stopped my development in that field.

#

Seeing it more and more often in A3 I wonder why nothing is done about it and so few people know about it.

jaunty zephyr
#

new features sell better than "we fixed that irreproducible bug that few people know about" :>

copper raven
compact maple
#

Hello guys, i dont get this, could you explain it to me ?

if (isNil {(call compile format ["%1",_sp select 0])}) then {

_sp select 0 is a name of a marker.

robust hollow
#

if (name of the marker is not also a variable for an object) then {spawn off marker} else {spawn off object};

#

is basically what thats for, the check is to see if a var for it exists at all but the next step would be spawning off an object cause it exists

compact maple
#

thanks you i got it ๐Ÿ˜ƒ

little eagle
#

Something something commented code.

tough abyss
#

// by commy2

little eagle
#

Are you saying that this comment is not helpful?

tough abyss
#

I would never.

little eagle
#

It basically means: any complains sent to me.

tough abyss
#

"The guy who wrote this is gone, it's running everywhere".

little eagle
#

But I'm still here.

tough abyss
#

Hypothetical future scenario.

little eagle
#

I'm always the last one to leave the room, because I trust nobody to turn off the light and especially the radiator.

tough abyss
#

Lol.

remote monolith
#

hey guys... we try to make a system on our arma life server where you can set up your id card... and you can chose between male and female and also choose a face which your character should get ingame - i know how to set the face with identity and the model with the uniform.... but what i cant figure out right now is the naked model of the player... when the female char takes off the clothes it has a male body in underwear... i saw in the mod config of the female mod the line for the naked uniform is added there.... is there a way to set this manually per script on the player?

inner swallow
#

I don't know if I'll laugh or cry, if the reason that female characters get added to Arma 3 turns out to be Arma Life ๐Ÿ˜„

#

(yeah, yeah I know nothing will be added at this point...)

remote monolith
#

well....do we have to discuss now why we want it done.... or can we just focus on HOW?

#

just forget that i meantioned life...... what would you say if i add it to king of the hill? ^^ or wasteland....

winter dune
#

is your server modded or vanilla?

remote monolith
#

modded

#

wouldnt have female models otherwise

winter dune
#

you should look here, maybe you can find something usefull if you read how it works

remote monolith
#

well.... i know it works when i place the char directly on the map as playable.... and i know how to give a male model the face and uniform of a female... but when you take off the clothes then you still have the male body

#

placing 50/50 of male and female on the map directly wouldnt help i guess.... you could end up as male with female body then when you drop the uniform....

#

must be possible somehow.... epochmod for example had it in a similar way....

winter dune
#

or you can create dedicated slots for female characters

#

if you can't find the solution

remote monolith
#

well....thought about that..... but you know the arma community ^^

#

or better...the players...^^

#

we need to make it bulletproof as possible ^^

still forum
#

@compact maple It's a piece of dumb code that some idiot wrote cause he thought there is no better way
if (isNull (missionNamespace getVariable [_sp select 0, objNull])) then {

craggy dune
#

Hi there, is it possible to overwrite a class for a player? E.g. Player a spawns as "Marksman", but during the missions, he should change to "Medic", is there a way to do that? (Without going back to lobby and change slots)

compact maple
#

@still forum thanks, so this is doing the same thing

still forum
#

@Socondor#8723 define "class"

little eagle
craggy dune
#

@willow quail The Slot you choose when entering the Lobby of the Game. Eg. Squad Alpha -> Marksman

#

@still forum not @willow quail sorry!!

still forum
#

See commy's answer

#

You can't change the slot

craggy dune
#

To bad.

#

can i assign slot in the lobby, when someone enters the Server?

still forum
#

don't think so

craggy dune
#

e.g User XY connecting --> Check DB; User = Medic --> Medic Slot

little eagle
#

No, you can't.

still forum
#

Welllll....

#

You caaaaann......

craggy dune
#

yes?????????

still forum
#

Or.. I could... You probably can't .

craggy dune
#

o.O

remote monolith
#

^^

still forum
#

Just hack all the things.
The server can slot in people. We know that because Admins can slot in people.

craggy dune
#

okay . . .

still forum
#

Answer is still "you can't" though.

craggy dune
#

hack the planet . . . a nice approach . . . but you are right, you (probably) can do it, i can't

still forum
#

And I don't think it's worth the effort.

little eagle
#

You can't reslot the people with SQF period. Of course everything is possible if you change the game itself, but that is not feasible.

craggy dune
#

but wouldn't i be fun though? @still forum . . .

still forum
#

It might be feasable. I know someone that's working on a project.. A serverside API so to say. It can already do alot of awesome stuff but it's private for now

craggy dune
#

all the nice stuff seems to be "private for now" . . . .

still forum
#

You load it like a mod and it gives you the ability to send arbitrary chat messages in any color. Or kick/ban people without battleye RCON...

little eagle
#

It's not private, no one ever made it yet.

still forum
#

Intercept is not private ๐Ÿ˜‰

#

It is made and working

remote monolith
#

when arma4 arrives all this stuff will be forgotten and new will be "private"

still forum
little eagle
#

Nice.

remote monolith
#

teamelan... ๐Ÿ˜ƒ

still forum
#

I already asked him to release some of it's feature publicly.. But.. It's used for a Life server. And you know how life server owners are.

remote monolith
#

and i know how others are to lifeserver owners ^^

still forum
#

Don't you uncensor my censoring

remote monolith
#

its readable

little eagle
#

That's awesome though that intercept enables you to do this.

craggy dune
#

that's not realy censoring . . .

still forum
#

That screenshot is made without intercept. He isn't using it yet... If he would a lot of that stuff would have been alot better though

#

He is btw that guy that found the huge server security issue that caused all #arma3_official_servers to be taken offline for "maintenance" a few months ago. If anyone remembers that

remote monolith
#

you guys seem to be very competent.... have you read my initial question about the fem chars? maybe you guys have any idea about how to do that? or if its even possible...or if im out of luck too

still forum
#

no female characters.

austere granite
#

implying you have a female 'underwear' model

still forum
#

I didn't read it completly. I'll do that

austere granite
#

you would have to create a new unit and use selectPlayer

#

that is your only option here

remote monolith
#

so i create a unit on the fly and put che char on it?

still forum
#

There is no model of a body. Your uniform is your body.
When you switch uniforms you switch your entire body

austere granite
#

The model without uniform is a config entry for the soldier class you are assigned to, which you can only changed by using selectPlayer

#

yes

remote monolith
#

so far so true... but when you take the uniform off you have a naked uniform model... i found that in the mod too,... but i dont know how this can be put on the char...or if even possible

little eagle
#

I don't see how selectPlayer helps here. What's the plan? Prevent female soldiers from switching uniforms?

austere granite
#

the naked uniform model is through through configs

#

No

remote monolith
#

and the naked uniform cant be changed or reassigned by script then?

austere granite
#

He wants that if female units (And they have instant sex change operations)

#

The naked UNIFORM IS your soldier class

#

it's not a uniform you can equip through scripting, so instead you will have to make the player switch soldier classes all together

#

And that sodlierClass will need to have the proper config entry for the 'naked' model

#

(I can't remember what it's called, and to lazy to look it up)

little eagle
#

I don't think that's right. The naked model is a hardcoded uniform and that's always a male body.

austere granite
#

then when someone switches to a female character you will have to switch to a unit class that has a female naked model

#

i'm pretty sure there's a config entry commy

#

in one of the configs thats inherited quite early

little eagle
#

Which entry is it?

#

Do we have a uniformless female model in this scenario?

austere granite
#
private _tempGroup = createGroup _targetSide;
private _newUnit = _tempGroup createUnit [_yourFemaleClass, [-10000, -10000, 50], [], 0, "NONE"];
selectPlayer _newUnit;
#

that's basically the switch

#

but

remote monolith
#

there is a config entry.... like naked_uniform= in the female modfiles

#

but?

austere granite
#
        class VirtualMan_F: Civilian_F
        {
            author = "Bohemia Interactive";
            mapSize = 1;
            _generalMacro = "VirtualMan_F";
            scope = 1;
            scopeCurator = 0;
            isPlayableLogic = 1;
            side = 7;
            sideVirtual = 3;
            displayName = "Virtual Player";
            faction = "Virtual_F";
            vehicleClass = "Virtual";
            model = "\A3\characters_F\Common\invisibleMan.p3d";
            icon = "iconManVirtual";
            role = "Default";
            uniformClass = "";
            nakedUniform = "U_VirtualMan_F";
#

nakedUniform @little eagle

#

no but

little eagle
#

nakedUniform = "U_BasicBody";

austere granite
#

BUT this is arma and i'm not sure if that config entry actually works

little eagle
#

Yeah, found it.

austere granite
#

Also, if it doesn't work, you should make a scripted event, that checks for (uniform player == "") then { player addUniform "nakedFemaleUniform" }

#

as an alternative

#

i mean it's possible either way

remote monolith
#

ok just to clear this up for me now.... what happens with the old unit when i change to the new one?

austere granite
#

nothing, you should delete him

remote monolith
#

alright...

austere granite
#

Also keep in mind that even though some eventhandlers might carry over between respawns, that will not be the case here

#

aka you will need to readd any eventhandlers that you use

little eagle
#

Wouldn't it be easier to just place the naked female class on the map and then addUniform? Or is the gender to be changed mid mission?

austere granite
#

the latter

little eagle
#

Ah, I see.

#

Yeah, that's a problem then.

austere granite
#

problem that's 100% fixeable though, so no worries @remote monolith

remote monolith
#

it is chosen by the player when he sets up his id card...and then it will be loaded every time when you spawn into the game.... if male or female... and since we cant change class afterwards

austere granite
#

basically just set up a female base class that you can switch to

#

put the nakedUniform entry there

#

use selectPlayer and you're all good

remote monolith
#

then switch by selectplayer... and delete the old one...

austere granite
#

yep

#

you can also do your team selection like that for the record

remote monolith
#

alright... i guess i have to try this out then... and see how far i will get

meager granite
#

Speaking of naked uniforms, there are several naked texture versions I always wondered why BI didn't make each unit side have different underwear color

#

So you could tell who's soldier it was after you take their uniform off

#

Did it as a test, fairly few config changes are needed

remote monolith
#

hey.... its arma.... ^^

#

just found these underwear textures too an hour ago...

#

and wondered why i never saw them yet ingame...

meager granite
#

Its BI: Lets spend time and resources making something and then never use it

remote monolith
#

vote for more fancy pants in arma3 ^^

meager granite
remote monolith
#

kavala land of the churches....

tender fossil
#

Does spawning hundreds of AIs in MP environment stress server if they have their simulation disabled?

#

Wasn't there a command that disables them completely?

#

Hey btw Quicksilver, I sent you a friend request, have something in mind

#

I see

#

I'd just like to have hundreds of civilian units standing in random places with no simulation enabled at all

meager granite
#

Best approach would be to delete and create them back by camera position

#

With createVehicleLocal if you don't even want them to move at all

tender fossil
#

I just want the models standing there

#

Nothing else required

#

They're talking to the units

#

So quite close ๐Ÿ˜„

#

For example yes

#

They could have some standing animation enabled if it doesn't stress the server

#

If it does, it's not required

gleaming cedar
#

hey

#

How to open a ramp from a helicopter/plane?

#

In scripting

tender fossil
#

createVehicle with some animation = profit?

#

Hm... What about createVehicleLocal?

#

They don't need to be synced to other clients, they can run locally without server handling it

#

Well, you could just dump them when client DC's

#

Aight

#

Thanks for the tips ๐Ÿ˜ƒ

winter dune
#

is there a way to retexture the night vision googles?

#

goggles*

still forum
winter dune
#

I need to know where can I find its pbo

still forum
winter dune
#

okk

winter dune
#

how can I find what nvg I am using?

#

found it

remote monolith
#

there was something like getmodelinfo.... place it on ground... look at it and execute this in your debugconsole _modelInfo = getModelInfo cursorObject; hint _modelInfo ;

winter dune
#

ok, thanks

little eagle
#

That would give you the model of the ground weapon holder, and that is a rather boring one.

still forum
#

Hah XD Just made a intercept command that can change config values at runtime. This is gonna be so awesome when it's done

little oxide
#

Nice

jaunty zephyr
#

omfg. if this is possibleโ€ฆ everything is possible

still forum
#

Everything has always been possible. It's just not that easy to do ^^

#

Though the new Intercept config stuff is easy to use... And If I add script commands like
(configFile >> "CfgAmmo" >> "stuff" >> "initSpeed") setConfigValue 1200
.. yeah...

jaunty zephyr
#

wait, changing values is one thing

#

could we also add classes?

jade abyss
#

@still forum Changing configs on the fly? e.g. changing Mass on a Vest etc

still forum
#

yup

jade abyss
#

dafuq?

still forum
#

yes theoretically you can also create new stuff. But I don't want to implement that.

jade abyss
#

instant updating or needs reload?

jaunty zephyr
#

๐Ÿ’ฆ

still forum
#

Well the config value is instantly updated

#

but objects in game are parsed from the config at game start and then the values are cached

jaunty zephyr
#

omg there's so many hacks that could vanish

jade abyss
#

So changing the Cfg entry will update the (for example) Vehicle Speed?

still forum
#

so you need to restart mission or do something that causes these cached things to die

jade abyss
#

hmmm

still forum
#

No. Vehicle class would be cached most likely

jade abyss
#

kk

jaunty zephyr
#

ha @jade abyss that's the first use case that comes to my mind also. i'd love to change vehicle speed a bit more depending on the surface

#

:/

jade abyss
#

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

still forum
#

But can change everything instantly that's live-read from config. So every config that's used by scripts. For example UI classes are afaik.
And you can now change config values without game restart and repacking PBO's and without using diag binary on dev branch

cold quartz
still forum
#

If I add creating classes and values you could create custom vehicles on the fly. They are parsed when you call createVehicle

#

All text in Arma is UTF8.

#

Or rather the encoding that the file that sets the strings is

jade abyss
#

The only downside i see: I must be run on every machine (for Weapons for example)

still forum
#

yup

jade abyss
#

And with the stupid BE and DLL Blocking :/

cold quartz
#

Ok, that's what I read. Just wanted to make sure. I'm declaring my method as such: public static void RvExtension(StringBuilder output, int outputSize, [MarshalAs(UnmanagedType.LPStr)] string function) and as a debugging step, I'm immediately dumping that 'function' string to a text file and in the text file writing, I'm specifying UTF-8 but I'm still getting the incorrect characters.

still forum
#

If you want to write to file just write the raw bytes

#

and then read the file as utf8

#

C# is probably doing some weird magic thinking that the input is ASCII char* and you are trying to convert to UTF8

cold quartz
#

I was just writing the file to see what my string was coming in as..as a debugging assist. It's not something I want to do always.

#

Yea, that's exactly what I think is going on. Didn't know if anyone else ran into it.

#

Though I know most extensions are written in C++

plucky willow
#

I want to count all objects within two different trigger areas, anyone know how I can achieve this?

tough abyss
#

How do I get the CfgAmmo class name of the current magazine?

#

If I do currentMagazine player while holding a loaded RPG I don't get R_PG7_F.

still forum
#

configFile >> "CfgMagazines" >> currentMagazine player >> "ammo"

tough abyss
#

@still forum - getting bin\config.bin/CfgMagazines/RPG7_F/ammo.

still forum
#

yeah..

#

getText

tough abyss
#

That did, thanks again.

gleaming cedar
#

Anyone knows how to get drones working with waypoints

astral tendon
#

{moveOut _x} forEach units playersslots;
playersslots is the players group name, this works if called by initServer.sqf or it need to be called by initPlayerLocal.sqf in order to work?

winter dune
#

Im trying to create a NVG script which allows the user to use the NVG without the hmd, the code is this one: player action ["nvGoggles", player]; Now, if I play other actions, the previous actions gets overwritten by the new one, is there a way to prevent this?

candid jay
#

all, is there a way to retrieve the named properties of a p3d from script?

plush cargo
#

is that what you mean?

candid jay
#

no

#

named properties

#

the ones you define in p3d lods

plush cargo
#

ahh i think you need to view it with object builder or something

candid jay
#

i know how to view them ๐Ÿ˜ƒ iโ€™m trying to see if itโ€™s possible to get this info via sqf scripting

jade imp
#

does anyone know how I can make a table a medical facility, so you are able to heal yourself?

#

or with repairs

#

like make it a location you can walk to and heal/repair vehicles?

meager granite
#

_table addAction ["Heal me", {player setDamage 0}]

#

or something like this

astral tendon
#

@Midnight#4592 yes and thats why i am asking

cold quartz
#

Hey, I'm getting good results with this: Encoding.UTF8.GetString(Encoding.Default.GetBytes(function))

#

function being the incoming string from ARMA

#

For anyone that's using a C# extension and running into character encoding issues

lone glade
#

yes, arma 3 uses UTF-8 internally, but you can use UTF-16 too

cold quartz
#

Yep. When I tried to display characters or convert straight to UTF-8, the displayed characters were incorrect. From what I read, .Net strings are UTF-16 by default, so I think there were some issues with the UTF-8 out of ARMA via the Extension and then the conversion to a .net string.

#

Well, the non-ASCII characters were incorrect

plucky willow
#

I'm trying to change the pitch of an object I've spawned down 90 degrees from the default so that its facing the ground

#

I think i would need to modify setVectorDir [0,0,0] to some values

#

but i cannot figure out to what

#

yes it may even require setVectorDirAndUp [[0,0,0],[0,0,0]];

#

but i cannot figure it out, and my trig is terrible

#

i guess my question really is this: for an object facing directly north with no yaw or roll, what change to pitch, yaw, and roll would result in the object facing straight down?

#

too stupid to figure that out but trial and error got me the right answer: [0,0,-1],[0,1,0]

#

luckily my object was a projectile so 90 degree increments worked. I cant even begin to imagine what banking a plane 20 degrees would look like

still forum
#

@cold quartz For extension making go to #arma3_tools they are all there

worldly locust
#

    {
        hint _x;

    } foreach _arrSides;``` This throws an error on the hint about a missing ;. What am I missing?
violet gull
#

format

#

hint format["%1",_arrSides];

#

No need for a forEach

worldly locust
#

@violet gull I need to iterate through the sides, so hence the foreach. I'm just trying to debug why it's not working

violet gull
#

Try systemchat instead

#

If you managed to get that forEach to work with a hint, it'd only show you the last one

#

systemchat will stack in the chat window

#

better for debugging, aside from hint format["%1", _myvariable];

worldly locust
#

OK. noted.

#

Format doesn't work either

violet gull
#

Also I just joined the discord ๐Ÿ•บ๐Ÿผ

#

๐Ÿ’—

#

I copied/pasted your code and it worked in the editor

#

Somewhere else in your code is fucked

lone glade
#

private your var first

still forum
#

wtf guys?
He is complaining about a missing ; and all you have to say is "Do something else" "You probably don't even want what you are doing"
And no stringifying a string won't make it better.
The problem is that @worldly locust We need the full code

worldly locust
#

I just wanted to know what basic fuckup I'm making. Not asking you to wade through other stuff, or critique my performance

still forum
#

The code you posted is correct.

#

My guess is what you posted is not what you are using

worldly locust
#

so the error message i'm being thrown is not related to what it actually says it is then.

still forum
#

Or can you post the full error message maybe?

violet gull
#

I wasn't criticizing, I was stating that somewhere in that same script (but not pasted in discord) is, as I put it, fucked. AKA broken. Additionally, you didn't specify what the error is. Generic error? Missing ;? Undefined variable?

#

Otherwise, the code you pasted DOES work. ๐Ÿ‘๐Ÿผ

lone glade
#

no shit

worldly locust
#

I did say it was a missing ;

#

related to the line I posted.

#

anyway.

still forum
#

This throws an error on the hint about a missing ;
He did say what the error is.
Your answer was No need for a forEach
So no.. All of what you just said besides "the pasted code works" is wrong

lone glade
#

no, you didn't post the full error

#

nor the full code, because if it's only this it should work perfectly fine

violet gull
#

You're right, you know best.

lone glade
#

well, he does

still forum
#

missing ; is enough of an error description in a small piece of code.
But if you don't even show us your real code @worldly locust how should we help?
You successfully removed all errors in your code while making it small enough to post it here.
Don't shrink your code if you have problems. If it's too big to post here just pastebin

lone glade
#

^or gist

worldly locust
#

Thanks Dedmen. I'm used to errors which relate to what they say they do

still forum
#

I'd prefer gist. But not everyone has github account.

The missing ; error actually means what it says.

worldly locust
#
{
    _debug = true;
    _tree = ((findDisplay 15226) displayCtrl (2103)); 
    
    _iRoot =0;
    _arrSides = ["WEST","EAST","GUER","CIV"];
    
    {
    
        //_Profiles = [ALIVE_profileHandler, "getProfilesBySideFull", _x] call ALIVE_fnc_profileHandler;
        //if (_debug) then {
            //_Profiles call ALiVE_fnc_InspectHash;
        //}
        
        //_tree tvAdd [ [], format ["%1", _x]];
        //_tree tvAdd [ [_iRoot], "Virtual"];
        //_tree tvAdd [ [_iRoot], "Spawned"];
        //_iProfiles=0;
        //{
        //    _profile = _x; 
        //    _active = _profile select 2 select 1; //[_profile, "active"] call ALIVE_fnc_hashGet; 
        //    _profileType = _profile select 2 select 6; //[_profile,"type"] call ALIVE_fnc_hashGet; 
        //    if(_profileType=="entity") then {
        //        _iProfiles=_iProfiles+1;
        //        _num = count (_profile select 2 select 11);
        //        if(_active) then { 
        //            _tree tvAdd [ [_iRoot,1], format [ "%1 - %2", _profileType, _num]];
        //        }
        //        else
        //        {
        //            _tree tvAdd [ [_iRoot,0], format [ "%1 - %2", _profileType, _num]];
        //        }
        //    }
        //
        //} foreach (_Profiles select 2);
        //_tree tvSetText [0, format ["%1 - %2",_x, _iProfiles]];
        sidechat format["%1",_x];
        //_iRoot=iRoot+1;
    } foreach _arrSides;
};
still forum
#

And you get the error with it commented out like that?

worldly locust
#

yes

still forum
#

format["%1",_x]; doesn't make any sense btw

worldly locust
#

why?

still forum
#

because _x is already a string

#

the format just does nothing

#

Ah I see the error

worldly locust
#

well that was someone up above's suggestion

still forum
#

The sideChat command you used doesn't exist

little eagle
#

This throws an error on the hint about a missing ;. What am I missing?
Doesn't for me.

lone glade
#

and also you can do block comments like this:

/*
stuff
stuff
stuff
*/
still forum
#

There is no sideChat STRING command.

#

The command is UNIT sideChat STRING you are missing the unit part

#

use systemChat instead. or hint

worldly locust
#

sidechat is my mistake.

#

should have been systemchat

violet gull
worldly locust
#

however it didn't work with hint.

still forum
#

Yeah. That but that does cause a missing ; error

#

That is the error in that script

worldly locust
#

lol.

still forum
#

If you want help about an error in a different script then you need to post that

little eagle
#

Doesn't error for me. The problem must be somewhere else.

worldly locust
#

I doubt it, since the hint went in to debug the original error

still forum
#
rdg_fnc_Load = {
    _debug = true;
    _tree = (findDisplay 15226) displayCtrl 2103; 
    
    _iRoot =0;
    _arrSides = ["WEST","EAST","GUER","CIV"];
    
    {
        systemChat _x;
    } foreach _arrSides;
};

Try this exact code and see if it works

worldly locust
#

yes, it works now. Sidechat was incorrect. I realise that.

#

I've figured out what the original problem was anyway. Nothing to do with fucking missing ;'s on different lines.

still forum
#

What was the problem then?

#

Me too. Fixed.

little eagle
#

As if you don't use excessive parenthesis either.

#

No, they're not.

still forum
#

(((())) <- Dis

#

TIL I guess

little eagle
#

But """blah""" != "blah"