#arma3_scripting

1 messages ยท Page 366 of 1

simple solstice
#

no clue about GUI and all their funny stuff

#

and thanks @little eagle for that, performance will be useful for UI as I want it to be onEachFrame

#
class RscPicture
{
 access = 0;
 type = CT_STATIC;
 idc = -1;
 style = 48;//ST_PICTURE
 colorBackground[] = {0,0,0,0};
 colorText[] = {1,1,1,1};
 font = "TahomaB";
 sizeEx = 0;
 lineSpacing = 0;
 text = "";
 fixedWidth = 0;
 shadow = 0;
};
class dialog
{
 class controls
 {
  class Picture: RscPicture
  {
   text = "#(argb,8,8,3)color(1,1,1,1)";
   or
   text = "mypicture.paa";
   x = 0.46;
   y = 0.63;
   w = 0.08;
   h = 0.1;
   colorText[] = {0.4,0.6745,0.2784,1.0};// whatever gives you a thrill 
  };
 };
};
``` this example from BIKI is good?
slender halo
#
class RscPicture;
class health: RscPicture {
#

is it in a mission or in a mod ?

simple solstice
#

mission

slender halo
#

so you exported base classes with Ctrl + P (or something like that) then imported it in your config ?

simple solstice
#

noo

slender halo
#

ok, let met start Arma

simple solstice
#

found them and they worked ๐Ÿ˜…

#
class RscPicture
{
    deletable = 0;
    fade = 0;
    colorBackground[] = 
    {
        0,
        0,
        0,
        0
    };
    colorText[] = 
    {
        1,
        1,
        1,
        1
    };
    access = 0;
    type = 0;
    idc = -1;
    style = 48;
    font = "TahomaB";
    sizeEx = 0;
    lineSpacing = 0;
    text = "";
    fixedWidth = 0;
    tooltipColorText[] = 
    {
        1,
        1,
        1,
        1
    };
    tooltipColorBox[] = 
    {
        1,
        1,
        1,
        1
    };
    tooltipColorShade[] = 
    {
        0,
        0,
        0,
        0.65
    };
    shadow = 0;
    x = 0;
    y = 0;
    w = 0.2;
    h = 0.15;
};
``` I think this is the base one for RscPicture
slender halo
#

yes

#

you now have to inherite you health class with this one

little eagle
#

You could've just copy pasted them from the ingame config viewer.

simple solstice
#

And the only thing I need to leave is x, y, w, h, text, idc, size?

#

in the class health

slender halo
#

basically yes

#

all the rest is inherited

simple solstice
#

ok, thank you everyone

#

and then i just need to have _message = "health1.paa";

slender halo
#

if health1.paa is in your mission root, yes

simple solstice
#

and ctrlSetText it

#

to the dialog

#

ok, got it

warm gorge
#

Does anyone know how well setTimeMultiplier works? Not sure what to use for a time and weather system. I know people use this, skipTime and setDate but yeah unsure

simple solstice
#

it just accelerates time

warm gorge
#

But it would still provide a smooth time system if you wanted to use it for different speeds at day and ni ght etc

simple solstice
#

yes, its smooth

#

you can use an FSM/loop

#

to set a different time acc for night/day

#

and it will be smooth

scarlet spoke
little eagle
#

Just send it everywhere?

#

That's so much cleaner though.

#

Oh wow, one variable will surely kill it. Does you mission have an intro image?

#

Does the HC fire initPlayerServer?

#

Either that or PlayerConnected then.

#

Send them to the HC via PlayerConnected.

#

Assuming that fires for the hc. The event passes the id

#

The cleanest way is to send it everywhere. Otherwise, iterate through all groups and variables on PlayerConnected for the HC.

#

You can't use ids as remote exec targets before the client connected.

little eagle
#

If you do it like this, then the variable will not be on the HC if it connects later.

#

That's why you'd need a PlayerConnected thing.

#

And then something like this for simplicity;

ai_clients = [2];

//PlayerConnected if HC
ai_clients pushBack _id

_grp setVariable ['QS_AI_GRP',TRUE,ai_clients];
#

Let C++ land figure out if the HC's are still there and how many etc.

astral tendon
#

@cloud thunder do you have a example for workshop mods?

warm gorge
#

@tough abyss Cheers for the info. Yeah im currently using setDate with weather commands and they dont seem to work well together. It just breaks all the weather transitions etc. Which is why im keen on using setTimeMultiplier

zenith totem
#

@little eagle Would that actually work if a HC joined after setVariable was used

#

If the HC dies or that is run prior to HC connect, it might not work

little eagle
#

You'd need to iterate through all variables and groups in the OPC eventhandler too as I already mentioned.

zenith totem
#

Ah, just read up, I only looked at the last message

little eagle
#

This is why I said that it's probably better to just send them everywhere and have the JIP stack handle connecting HC's

zenith totem
#

I'd imagine there's not too many groups, it would probably be detremental to performance (at connect) to handle it like that, I'd take a few ms on the JIP queue lol

waxen tide
#

i was just wondering, while writing pretty generic functions for an arma mission, was there ever an attempt of a public repo for such functions in the scripting community? people like to write "frameworks" for doing things but those are mostly doing too much or not enough anyways.

still forum
#

CBA.

waxen tide
#

butt

still forum
#

?

waxen tide
#

i was thinking broader

#

and more like something where you pick out a single SQF file because you need it instead of installing a mod

still forum
#

CBA.

indigo snow
#

what about functions that would require other functions?

#

wouldnt really work, thats why people group them into frameworks

#

or CBA

still forum
#

you can just download anything from CBA that you want. And put it into your mission file

waxen tide
#

yes but cba has a limited scope, i was thinking broader, and more mission specific.

indigo snow
#

maybe an example would help?

waxen tide
#

i noticed that most scripters that script stuff for missions re-implement things hundreds of other people already implemented which is stupid.

#

well mostly around spawning entities in certain patterns and solving the issues around it. i had to write a large script to spawn the uss freedom locally in MP, wrote something to spawn compositions from the editor dynamically in the mission, a whole bunch of scripts to place units in buildings ... all pretty generic stuff any mission maker would maybe like to re-use. you can find "examples" on the internet but its mostly just code sniplets that break quickly in real world usage, outdated stuff and nothing that really has been turned into a reliable, generic function.

peak plover
#

Hello, what did I miss?

queen cargo
#

What you talk about is what the bis functions should provide at best
A base framework
And in the end a reason to use try catch and throw

Nobody ever Rly attempted something like that before and probably nobody ever will

waxen tide
#

noo not really a framework at all

#

just tiny little lego blocks to use

indigo snow
#

Thats how most people would define a framework

waxen tide
#

its not my fault you guys suck at defining stuff.

#

i probably have like 6 different scripts from 6 different people in 6 different missions on my HDD that spawn a damn mine field in a mission.

#

something that screams "fnc plz" in my mind.

#

shuts up and goes back to his editor

zenith totem
#

And they all go about the task differently with slightly different results, some fit one situation while others fit better for other situations

#

There are a few BIS_ functions that are useful but a lot of them aren't documented very well at all

#

And some that are written without any thought about how they'll impact the scheduler

scenic shard
#

Im still trying to get my script from yesterday to work. The new soldiers appear fine at the "tempSpawn" marker but never gets moved. this is used in a script called from expression field in the respawn module.

I get no errors.

for [{private _i = 0}, {_i < _cargoSeats}, {_i = _i + 1}] do {
    sleep 0.2;
    _man = "fow_s_us_rifleman" createVehicle getMarkerPos "tempSpawn";
    _man moveInCargo _newBoat; //does not work
};```
tough abyss
#

createUnit/createagent & you may also need to add a waituntil isn't null check after creating the ai.

zenith totem
#

I presume you're respawning boats

still forum
#

add a sleep 0.1 after the createVehicle of the unit

#

or just move that sleep 0.2 down a line

zenith totem
#

Don't do that

peak plover
#

also it's good practice to create stuff at 0,0,0 and then move to vehicle or position

zenith totem
#

You'll freeze whereever the code is running for that amount of time

peak plover
#

If I remember correctly, creating at 0,0,0 is a lot faster

still forum
#

๐Ÿ˜„

waxen tide
#

creating stuff that can explode at 0,0,0 might not always be a good idea.

still forum
#

@waxen tide Riflemans don't explode... usually..

waxen tide
#

hold my beer.

peak plover
#

Create,disable damamge,move to pos,enable damage

still forum
#

@peak plover The units are not moved ot any pos

#

they are moved into the vehicle

tough abyss
#

Just use a sleep or waituntil etc

zenith totem
#

Is the respawn module code not called rather than spawned?

still forum
#

I already answered it.. The problem is that if you call createUnit you can only use moveInCargo on the next frame.

#

We had that same issue a couple days ago

zenith totem
#

@scenic shard Do you set the _newBoat variable at all? Or is that just an excerpt of what's in the box, post your full code in it

still forum
#

Solution is move the sleep between the unit creation and moveInCargo.

tough abyss
#

@still forum i know, plus i answered it aswell. I was just commenting the create at 0,0,0 isn't needed & extra work

still forum
#

@zenith totem We talked about that yesterday. _newBoat is the vehicle that was created by the respawn module.

zenith totem
#

@still forum Sorry I don't have a magical crystal ball that lets me see context lol

still forum
#

I do.

waxen tide
#

dedmen coded his crystalball himself.

scenic shard
#

here is the almost full code, after this i jsut assign some waypoints and other stuff.

if (!isServer) exitWith {};

params ["_newBoat", "_pos"];
    
createVehicleCrew _newBoat;
_newBoat setVehicleAmmo 0;
_grp = group driver _newBoat;


_cargoSeats = _newBoat emptyPositions "cargo";
for [{private _i = 0}, {_i < _cargoSeats}, {_i = _i + 1}] do {
    sleep 0.2;
    _man = "fow_s_us_rifleman" createVehicle getMarkerPos "tempSpawn";
    [_man] joinSilent _grp;
    _man assignAsCargoIndex [_newBoat, _i +1];
    _man moveInCargo _newBoat; //does not work
};```

init.sqf have
```BoatRespawn = compile preprocessfile "AmbientBoatRespawn.sqf";```

module expression:
```[_this select 0, landing3] call BoatRespawn;```
still forum
#

@scenic shard I told you what's wrong and how to fix it.

waxen tide
#

@scenic shard

```sqf
// code
scenic shard
#

trying that now @dedman, hopefully that fixes it. do you know how it comes createVehicleCrew _newBoat; still works?

zenith totem
#

Isn't createUnit the better command here anyway

#

One of the specials:
"CARGO" - The unit will be created in cargo of the group's vehicle, regardless of the passed position. If group has no vehicle or there is no cargo space available, the unit will be placed according to "NONE"

still forum
#

Because createVehicleCrew is something completly different?

zenith totem
#
if (!isServer) exitWith {};

params ["_newBoat", "_pos"];
    
createVehicleCrew _newBoat;
_newBoat setVehicleAmmo 0;
_grp = group driver _newBoat;


_cargoSeats = _newBoat emptyPositions "cargo";
for [{private _i = 0}, {_i < _cargoSeats}, {_i = _i + 1}] do {
    _grp createUnit ["fow_s_us_rifleman",[0,0,0],[],0,"CARGO"];
};
scenic shard
#

moved the sleep command down but got the same result

still forum
#

between createUnit and the moveInCargo

#

also yeah I think you need createUnit to get a AI unit

scenic shard
#

ill try with that instead, they do spawn though. just wont get in the cargo

zenith totem
#

Fixed it, missed out the "CARGO"

#

That createUnit command should create the unit in the group, in the vehicle without having to mess around with manually moving the unit in

scenic shard
#

that worked great, thanks! also seems less resource intense vs createVehicle? i dont even need the sleep and no fps hit

zenith totem
#

Was the game basically freezing for a split second with the version with sleeps?

subtle ore
#

Freezing? wtf?

#

When you sleep in scheduled it shouldn't freeze at all

scenic shard
#

no, without them. whenever the units got spawned (have 6 boats that get filled at game start)

subtle ore
#

unscheduled it'll throw you an error

zenith totem
#

I'm trying to find out if it is scheduled or not for that EVH

#

EVHs usually are unscheduled

still forum
#

Which eventhandler?

subtle ore
#

EH are scheduled

still forum
#

no.

#

Eventhandlers are unscheduled

#

but this is not a eventhandler

peak plover
#

โ˜๐Ÿฟ

zenith totem
#

Yay for arma's inconsitencies

subtle ore
#

What? Since when?

zenith totem
#

Since forever

#

It's why on some missions you lag so much when taking damage from fire

#

Some people try to do way too much with the damage EVH

subtle ore
#

No I'm not talking about Yay for arma's inconsitencies

peak plover
#

I've played non-arma games which lag when you take damage

zenith totem
#

EVHs are unscheduled

#

The code boxes in the editor for events are scheduled (aparantely)

subtle ore
#

doesn't make sense

#

Hm

still forum
#

which events have code boxes in editor?

subtle ore
#

must've been some other type of eh

zenith totem
#

the respawn module it seems from the above stuff

still forum
#

Modules are scripts. Not engine.

#

They are not eventhandlers

#

they are scripts. calling other scripts

#

there is no inconsistency here

zenith totem
#

Generally things are called, unless they're badly done or scheduled is needed

still forum
#

They are called. Call from scheduled environment

zenith totem
#

I suppose it's spawned from the unscheduled EVH for the respawn module to stop issues with shitty code from bad editors

still forum
#

What unscheduled EVH do you mean?

zenith totem
#

The respawn module will be relying on EVHs internally

#

At some point it spawns something, probably just the user's script

waxen tide
#

The format used in configs, such as mission.sqm, is [x,z,y], where z and y are swapped around.

#

wait, what?

still forum
#

That might have changed with EDEN

waxen tide
#

what pos does eden use btw?

zenith totem
#

@still forum I mainly have a bone to pick with needlessly spawned code since arma's scheduler isn't the greatest

still forum
#

@zenith totem RespawnVehicle module uses MPKilled/MPHit/GetOut/GetIn eventhandler. And they have to go into scheduled. Because the vehicle module can have a delay. And you can't wait for delay in unscheduled

#

I cannot confirm that. The scheduler is quite good.

zenith totem
#

Joke of the century there

#

I don't know if it was fixed, but it used to change contexts in the middle of scripts if a different script used a different nameSpace

still forum
#

afaik not fixed. Couldn't reproduce a few months ago though when I tried

#

that's not the schedulers fault actually

zenith totem
#

It's the scripting engine in general, but the scheduler should make sure the right namespace is in use

still forum
#

That's because the current Namespace is not saved inside the script but inside the gamestate.

#

Can easilly be fixed with about half an hour of work

zenith totem
#

But has it been fixed? Probably not

still forum
#

no

zenith totem
#

I don't know what causes it, but the scheduler with mods is horrendous

still forum
#

Cannot confirm that with the Mods I'm running.

zenith totem
#

Close to a second script delays sometimes after the games been running for a while

still forum
#

yup. true

#

But it would make the scheduler alot worse if they would "fix" that

zenith totem
#

Even longer when I did milsim with that set of mods for some reason

#

The things is, I know that no more scripts were being run with those missions

#

It's something in the engine at least

still forum
#

get profiling build and check

zenith totem
#

I kept track of running SQF scripts

still forum
#

it tells you exactly what scripts the scheduler executed in the last frame

#

and how long each one took

zenith totem
#

With the milsim set of mods, it would occasionally clear in a pop and be perfectly fine

queen cargo
#

Sounds like a lot of magic
Uninformed magic

Scheduler is completely fine as long as you do not fuck up
They are virtual threads in the end...
Spawn threads in any other language and your whole program will blow up too
You have to take care of them like you would do to your own child

still forum
#

You can't blame BI for Mods authors that do shit they shouldn't do

zenith totem
#

True

#

There's an engine part to my problems and probably mod author part to my problems

still forum
#

We also had some bad Mods.. So I just fixed them. Problem solved

zenith totem
#

Where I have complete control over what's running (AL), everything stays butter smooth with only minor general slowdown over time

#

Also, BIS's ambient animation function is garbage

#

I rewrote it for better performance because that thing spawns a script per unit

queen cargo
#

Not any clue what ppl talking about with mayor slowdowns
I used to run missions over weeks without changing the mission or restarting... If your shit slows down over time you fucked up
It is not the engines fault that you have to write good code

#

And to note: a lot of that stuff bis added as function is indeed garbage

zenith totem
#

Restart the client and it's fine despite almost the same stuff running

#

In hindsight it may not be the scheduler itself, but something engine side can fuck over the scheduler

queen cargo
#

Just like those "language fault" problems...
See... Computers do what you tell them to do and not what you want them to do

#

Identify what is the root of the problem and fix it

zenith totem
#

Arma

#

Arma is the root of the problem lol

#

Just a thought, how does dynamicSimulation work, is that scripts

#

That may be a common factor

queen cargo
#

Obviously... Whole arma community always only can cry out loud and blame arma for any fault
Download performance build and search for yourself
You cause problems because of bad code

still forum
#

You can't create FPS problems with scheduled scripts

queen cargo
#

Unless the game starts stockpiling ram while you do nothing, it is your fault

peak plover
#

Yeah you can @still forum

#

saveprofilenamespace in a while loop in scheduled

queen cargo
#

You can @still forum
Object creation will cause those

still forum
#

scheduled scripts run 3ms at max

#

Unless you have a single heavy command in there

#

you can't.

zenith totem
#

Wasn't that the per script limit

queen cargo
#

Basically everything that takes longer than a brief moment can have impact
That is why you are not supposed to use certain commands

still forum
#

No it wasn't.

zenith totem
#

I don't know why but 50ms pops to the mind

queen cargo
#

However, there is no need for those fps heavy scheduled scripts

still forum
#

50ms == 20 fps

queen cargo
#

Dat

still forum
#

Don't know where you got that number from

zenith totem
#

Either way, that's part of why I hate overuse of spawn

still forum
#

overuseing spawn will prevent you from killing FPS. And now don't come with that saveProfileNamespace or createVehicle.
unscheduled won't make that any better

zenith totem
#

When you fill the scheduler, i.e. be bohemia with their ambient animation function or a mod doing shitty things, it can take a long time to get back to your script

still forum
#

But you are alot safer in scheduled than unscheduled

#

If you need very reliable timing then you need unscheduled yes.
But scheduled scripts doing exactly what they were made to do. Is not a bad thing

#

But please never tell a beginner to go unscheduled.

zenith totem
#

I'm not telling beginners to go scheduled, it's just knowing when to schedule and when to not

#

Or to just be aware of the damn thing in the first place

little oxide
#

Any way to return the number of Eventhandler added to a display ?

cosmic kettle
#

@little oxide AFAIK there is none. Upon creation, I store EVH return in a var.

little oxide
#

I want to know, if adding a real EVH to Eden Display or hardcoded to engine ๐Ÿ˜ฐ @cosmic kettle

astral tendon
#

the "player setUnitTrait ["Medic",false];" does not remove the Medic trait of the unit

#

what i am doing wrong?

cosmic kettle
#

But that's for an object. Don't know if this works for displays. I'm sure someone in here will know.

little oxide
#

This is what I had in mind before asking the question, thanks for the link @cosmic kettle

cosmic kettle
#

No problem, good luck!
@astral tendon it should work. Are you sure it's being executed then? Verify with getUnitTrait

astral tendon
#

i did

#

it does work in SP

#

but not in MP

#

the second player still got the trait

cosmic kettle
#

Executed on local?

astral tendon
#

i put those on a trigger

cosmic kettle
#

The command needs to be executed where the unit is local iirc.

astral tendon
#

how i do that?

simple solstice
#

remoteexec

#

look it up on wiki

#

and post the code you think that will work

#

learn yourself ๐Ÿ˜Š

still forum
#

@little oxide You can retrieve the number of EH's added via script with a trick.. But that won't show you config EH's
The trick is the BIF link that you already got

astral tendon
#

[] remoteExec (player setUnitTrait ["Medic",false];)

#

like this?

simple solstice
#

have you seen examples?

astral tendon
#

yes

agile fiber
#

Hey guys (and girls) i have a weired issues .. i am running a bunch of mixed mods an when testing both locally and on a dedicated server everything worked .. now on a full server players are suddenly unable to get in a vehicles driver .. also moveInDriver and player action ["getInDriver", cursorTarget] is NOT working while player moveInAny cursorTarget puts the player in the driver seat .. any ideas ? (sry to interrupt your discussion)

simple solstice
#

so how did you came up with such a solution

astral tendon
#

Example 6:

simple solstice
#

runs on each connected client

#

see example 9

#

and where the parameters are put

still forum
#

@agile fiber vehicle locked maybe?

agile fiber
#

no all open

#

i can get into the passenger seats all fine

cosmic kettle
#

Are all of those mixed mods legit? People like to mess around with borrowers, that's why.

agile fiber
#

yes they are 100% legit, bohemia approved, payed for and everything you can possibly do ๐Ÿ˜ƒ

cosmic kettle
#

Try checking if the vehicles aren't classed as DLC.

#

Wild guess though.

simple solstice
#

still can moveindriver

agile fiber
#

moveindriver is not working

simple solstice
#

with dlc

#

vehicles, so thats not the case

agile fiber
#

spawning the vehicle you can get in .. sometimes one time sometimes 10 times and at some point it just stops

#

fullCrew vehicle is empty

cosmic kettle
#

Haven't tested, so @simple solstice is probably right.

agile fiber
#

the issue appears with all kinds of vehicles from different mods

astral tendon
#

i also have another problem, one of my players are invunerable

winged sphinx
#

Moss_targers"shooting range" ,

#

Working in Eden test, not working on server

little oxide
#

Thanks @still forum

astral tendon
#

if (isServer) then {this SetObjectTextureGlobal [0,"images\briefing.paa"];};

#

this still not working for a player that join in the server

#

gives a error showing a path to my computer

spark sun
#

Hello, I am trying to get a random pos from a center [0,0,0] to a direction (_dir) with an amplitude angle of (40ยฐ)
and radius 200. here the code I wrote to handle this :
[0,0,0] getPos [200 * sqrt random 1, ((random [_dir - 20 , _dir, _dir + 20]) + 360) mod 360];
Is it the best solution ?

indigo snow
#

maybe

#

but what do you mean with amplitude angle?

#

ah i think i see what you mean

spark sun
#

plus or minus the _dir

indigo snow
#

[0,0,0] getPos [200, _dir - 20 + random 40]

spark sun
#

yes better because the random is no more gaussian

indigo snow
#
params ["_pos","_r","_dir","_amp"];
_pos getPos [_r*sqrt(random 1), _dir - 0.5*_amp + random _amp]
#

depends what better means in this case - distribution or execution time

spark sun
#

but the results could be negative and I need a value between 0 and 360

indigo snow
#

im pretty sure getPos handles that just fine

spark sun
#

let me check

indigo snow
#

i improved it a bit, btw

#

I assume scaling _r with sqrt([0 .. 1]) was to better space out the points in the distribution space?

spark sun
#

so yes I your last suggestion

indigo snow
#

whats it for?

spark sun
#

Ask to civilians to move in a direction but with some random

queen cargo
#

@zenith totem pretty much nobody knows when to go scheduled and when not to go scheduled...
I highly doubt you know

astral tendon
#

if ((!isPlayer player2) or (isnil "player2")) then {
this moveInGunner car2;
}

#

what i did wrong?

still forum
#

you first check something on that object. before you check if it even exists.

#

What could you be doing wrong

#

You first write an essay. And after writing it you check if you even have a pen in your hand

astral tendon
#

this "((!isPlayer player2) or (isnil "player2"))"

#

is give me true

#

but he does not do this

#

then {
this moveInGunner car2;

indigo snow
#

what is this ? where do you put this code?

astral tendon
#

on a IA init

indigo snow
#

thats way too early

still forum
#

You check if player2 is a player.. and then you do something with this ... Don't you want to do something with player2?

indigo snow
#

by the time that runs, player2 might not even be created yet

astral tendon
#

player 2 is a slot

indigo snow
#

what i think is happening is that dude runs that code before player2 is created on mission init. so at mission init, the condition will be false, but after, it will be true

astral tendon
#

is there a way to i put a delay on it?

#

or maybe just trow that on a trigger?

indigo snow
#

sure, theres lots of waiting commands

#

a trigger kind of feels like a waste

astral tendon
#

do you got some waiting command in hand?

indigo snow
#

waves hand sleep,uiSleep, waitUntil

#

thats all three

astral tendon
#
  • slaps face * yeah thanks.
indigo snow
#

this would typically be something to handle in initServer.sqf or something like that

astral tendon
#

well...

#

((!isPlayer player2) or (isnil "player2"))

#

this does not give me any value in MP

#

the player2 slot is empty

still forum
#

You did completly ignore what I told you

astral tendon
#

isnil does not do that?

still forum
#

Again.
You are writing an essay with your pen. And after that you check if you even have a pen and notice you don't have one and the entire 20 page essay you just wrote is just empty pages

#

You should check isNil BEFORE you use it.

#

not after it

astral tendon
#

reverting it?

still forum
#

?

#

Swap them

astral tendon
#

((isnil "player2") or (!isPlayer player2))

#

still, no value

still forum
#

better.

#

yep. still wrong. But that's a specialty of SQF that I can now explain

#

or will evaluate both sides of it

#

it evaluates isPlayer. but player2 is undefined so it errors

#

to fix that use {} instead of () on the right side of the or

#

don't use {} on the left side of or!

astral tendon
#

thats funny

#

now is give me a value

#

((isnil "player2") or {!isPlayer player2})

still forum
#

No. that's not funny.

#

You fixed the script. So now it works.
That is to be expected.

astral tendon
#

because i have a trigger with this that works

#

((player1 in car1) or (player1 in car2) or (player1 in car3) or (player1 in car4) or (player1 in heli1) or (player1 in heli2) or (!alive player1) or (isnil "player1"))

still forum
#

Yes..

#

because player1 exists.

#

so that doesn't error

#

If player1 does not exist this will throw script errors. And the trigger will not trigger. As expected

little eagle
#

I was catching up and it was so frustrating to see waitUntil {isNull being suggested after createVehicle. That's pointless, because the thing will never be null. Sometimes I wonder...

astral tendon
#

its funny, is the player that joins on a playable characer actually BE the AI?

#

because when my friend kills me its apears the name of the AI

scenic shard
#

Not sure what you mean, but I can say that your friend is not an AI.

little eagle
#

Are you really sure though?

scenic shard
#

I guess he could be one of those fancy robots from Westworld :p

astral tendon
#

its happens today, he is executing AI related scipts i made and when he kills me the name that apears is a AI name

tough abyss
#

Is this apart of RHS class files?

#

"LOP_TKA_Infantry_Officer" ?

little eagle
#

LOP Leights OPFOR Pack ?

subtle ore
#

Quick question here, I can't slip any if statements more than this in the switch statement :

#define MAIN_DISP (findDisplay 46)
#define TAB 15
#define GEAR (findDisplay 602)
if(local player) then 
{
    MAIN_DISP displayAddEventHandler["KeyDown",
    {
        _keyOver = false;
        params["_display","_key","_shift","_ctrl","_alt"];
        switch(_key) do 
        {
            case TAB : {
            hint "TAB!";
            if(!_shift) then 
                {player action["Gear",player]; _keyOver = true;};
            };
    

        };
_keyOver
    }];
};
#

I understand it's sloppy, first draft. But if I add:

if(!isNull GEAR) then 
{

};
#

in between the tab case and after the shift check, it doesn't seem to continue on

little eagle
#
#include "\a3\ui_f\hpp\defineDIKCodes.inc"

DIK_TAB

instead of redefining it?
Dunno what's wrong with the if, but my guess is, that the inventory display simply isn't open yet after action Gear. You play the animation first and findDisplay is kinda bugged where you need to wait a frame for new displays to appear in the array.

tough abyss
#

Is there a way you could run a script assignment to the file?

subtle ore
#

Okay, gotcha. Yeah I didn't really know the path to the DIKCodes, so I wanted to do something quick and dirty before going any further

tough abyss
#

To see if it's actually existing?

subtle ore
#

Thanks Commy

astral tendon
#

if (player3 in med1) then {moveOut player3};

#

there is something wrong here, the code still executes even if player3 is not in med1

#

if (player3 in med1) still gives false

tough abyss
#

Check the types?

little eagle
#

Is there a way you could run a script assignment to the file?
๐Ÿค” What?

astral tendon
#

what i did wrong?

little eagle
#

Dunno, lgtm.

#

Maybe you're looking in the wrong place and thiis is actually correct?

astral tendon
#

but that code still aplies even if i am not in med1

#

and moveOut player3 on any vehicle he is in

tough abyss
#

Check if the include file exists?

astral tendon
#

how?

tough abyss
#

String = configName config

#

I think

astral tendon
#

well, Med1 is a helicopter

#

and Player 3 is me

tough abyss
#

vehicle player == Med1

#

Medi is a helicopter not player

#

You need the same type to compare the values.

little eagle
#

but that code still aplies even if i am not in med1
The code applies if player3 is in med1. Doesn't have to be your avatar specifically.

astral tendon
#

what?

little eagle
#

player3 doesn't have to be your avatar for this to report true.

astral tendon
#

what if I am the player3? since i selected that playabe unit

little eagle
#

Doesn't matter at all. Changes nothing.

astral tendon
#

im afraid becasue this is insde of a waypoint init

#

is like this

#

once the helicopter lands

#

if (player3 in med1) then {moveOut player3};

#

i dont wanna the player3 to be ejected from other vehicle that is not the med1

little eagle
#

Are you sure this is because of this code and not because your squad leader is an AI and orders you to get out?

astral tendon
#

yes, i am executing this in a solo squad

#

also i having a trouble with this command

#

((player1 in med1) or (player2 in med1) or (player3 in med1) or (player4 in med1))

#

it works in SP but does not work in MP

little eagle
#

You do realize that you can't enter vehicles if your squad leader is an AI and doesn't want you to?

#

Kicks you out, has nothing to do with any scripts.

astral tendon
#

i am alone in the group

#

i already make sure of that

zenith totem
#

Does anyone know a way to set which panels can be used (i.e. Whitelist slingload and GPS

little eagle
#

If you're using CBA, then you can disable them one by one using this:

class Extended_DisplayLoad_EventHandlers {
    class RscCustomInfoMiniMap {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoCrew {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoTransportFeedDriver {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoTransportFeedPrimaryGunner {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoTransportFeedCommander {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoTransportFeedMissile {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoSensors {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoMineDetect {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoUAVFeed {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
    class RscCustomInfoSlingLoad {
        commy_disableRightPanel = "(_this select 0) closeDisplay 0";
    };
};

Otherwise good luck.

lavish hamlet
#

I need a push in the right direction.... i need to give players and addaction on other players with lifeState = "DEAD","DEAD-RESPAWN","INCAPACITATED" im guessing one way of doing it would be somekind of cursorTarget but im think it would be more efficient to get the server to add the action on the players meeting the criteria..

robust hollow
#

the easiest thing would be to add the action to every player with the condition something like cursortarget iskindof "man" && {lifestate cursortarget in ["DEAD","DEAD-RESPAWN","INCAPACITATED"]}

little eagle
#

CAManBase not Man

#

Unless you want this to work on snakes and rabbits.

zenith totem
#

@little eagle I want to do it in an unmodded mission

little eagle
#

: )

zenith totem
#

I figured I'm shit out of luck a few days ago, but thought I'd ask, just in case lol

chilly hull
#

I'm trying to do something that should be very simple, but I can't seem to find the right way to do it.
I want dead players to enter the EG spectator, with no hovering bird, and without any of the post processing effects that can occur when you take damage and die (including those caused by BIS revive system).

#

I can get everything except I can't get rid of the bird.

scenic shard
#

do you have respawn = 1 ?

copper raven
#

change respawn mode

#

or get rid of it completely

scenic shard
#

yea, that was my thought. otherwise the bird should be the player object so you could maybe use hideObject on it to make it invisible

chilly hull
#

On which machines does onPlayerRespawn get executed?

#

oh, wait, it can only be the machine of the respawning player, or else my scripts wouldn't be working the way they currently are anyways

#

for now I have it remoteExec over to the server to hideObjectGlobal the bird. I just hope there is never enough network delay to get birds popping in and out of existance.

dim notch
#

@chilly hull did you change to respawn = 1 in description.ext as they advised above?

#

In Arma 3 respawn = 1 doesn't spawn the bird for whatever reason, even though that option is literally called "BIRD"

#

Actually they probably didn't advise that above but the opposite, but that's how it goes in Arma 3 anyway

dim notch
#

Those don't really help with the problem, because they're probably using respawn = 4 which always spawns the seagull

#

Respawn = 1 works the best with custom spectator modes

#

if you don't want BASE or INSTANT that is

little eagle
#

What?

dim notch
#

That's just how the behaviour is, if you're using "GROUP"/4 (which would be useful if you want to have JIP but don't want to use the respawn options in "BASE"/"INSTANT") and there are no units when you die, the game always spawns a seagull even if you have some sort of a custom spectator mode enabled

#

"BIRD"/1 doesn't actually spawn a bird in A3 so it works best as the best alternative to "GROUP" with custom spectator modes

little eagle
#

OK, yes- But why would it be GROUP ?

dim notch
#

I want dead players to enter the EG spectator, with no hovering bird I assumed he's trying GROUP, because I don't think seagulls happen on any other respawn mode

#

SIDE is broken and I don't think BASE or INSTANT can spawn them?

little eagle
#

Just use INSTANT. There should be no bird.

dim notch
#

INSTANT with no respawn tickets or?

little eagle
#

0, so infinite

#

Or just leave it blank.

tough abyss
#

How do I check if a player currently has a waypoint placed on the map?

little eagle
#
count waypoints player > 1

???

tough abyss
#

Thanks @little eagle.

#

@little eagle - slight issue, it stays at 1 after I delete the WP.

little eagle
#

Yes, there is always one waypoint where you're standing. The whole thing is weird. Hence > 1

#

torque

tough abyss
#

@little eagle - yeah but I it stays at 1 when I place a WP ๐Ÿ˜•

#

With (Shift + LMB).

little eagle
#

Oh, that thing is not a waypoint waypoint.

tough abyss
#

Anyway to check if that is placed or not?

little eagle
#

Hmm, can't remember anything.

#

Idk, it should work on all PhysX things, no? And grenades are PhysX, which is why they fly through thin walls in A3.

tough abyss
#

Basically I've this, but icon created with drawIcon3D stays forever, even after the little black dot WP dot on the map is deleted. ```SQF
#include "script_component.hpp"

disableSerialization;

if (hasInterface) then {
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;

_mapControl ctrlAddEventHandler ["MouseMoving", {
    GVAR(mapCustomMark) = "custom_mark" in (ctrlMapMouseOver (_this select 0));
}];

addMissionEventHandler ["MapSingleClick", {
    params ["_units", "_pos", "_alt", "_shift"]; // Thanks BIS
    if (_shift) then {
        GVAR(markerLocation) = _pos;
    };
}];

_mapDisplay displayAddEventHandler ["KeyDown", {
    if (!isNil QGVAR(mapCustomMark) && {GVAR(mapCustomMark)} && {(_this select 1) == 211}) then {
        GVAR(markerLocation) = nil;
    };
}];

addMissionEventHandler ["Draw3D", {
    if (!isNil QGVAR(markerLocation)) then {
        drawIcon3D [
            "\A3\ui_f\data\igui\cfg\cursors\customMark_ca.paa",
            [1, 1, 1, 0.6],
            [GVAR(markerLocation) select 0, GVAR(markerLocation) select 1, GVAR(markerLocation) select 2],
            1.1,
            1.3,
            0,
            "",
            0,
            0,
            "TahomaB",
            "",
            false
        ];
    };
}];

};

little eagle
#

// Thanks BIS

#

๐Ÿ‘

#

It's not a marker and it's not an actual waypoint. Idk if it has any API in SQF.

#

There was a time where you could block this thing with the onMapSingleClick stacked eventhandler, but that has been broken. So now you have to use onMapSingleClick for your mission potentially breaking all kinds of mods and mission scripts that haven't updated to addMissionEventHandler or want to block something themselves.

#

Besides making grenades spin, no.

#

Maybe some destruction scripts.

#

>My Tiger has caps for the guided AT missiles and those could make use of some random torque to not always fall the same.

#

The grenades spin in vanilla, but advanced throwing they're always up.

#

Adv throwing is not my component, so I let the others do it. Destruction and fire effects would be the main application for torque and force I can think of.

#

Good sfx make a game. ๐Ÿ‘Œ

tough abyss
#

@little eagle - so there no way to delete the icon when the WP's delete on the map?

little eagle
#

I can't think of anything.

tough abyss
#

Ok, thanks anyway ๐Ÿ˜ƒ

little eagle
#

It's not even a control. It's probably drawn with internal magic like the crosshair and the action menu etc.

tough abyss
#

Most likely, I haven't found any traces of it in the config viewer or functions browser.

little eagle
#
onMapSingleClick {true}

to block, but you do overwrite other things potentially (nothing in ACE)

tough abyss
#

@tough abyss - pinging Banned Inc.

little eagle
#

People don't use physX though, So it shouldn't work on them. I don't think the game can even rotate people.

tough abyss
little eagle
#

Rotate around X and Y that is.

#

Yup, force and torque work on grenades.

#

And don't on persons.

#

True. I thought you mean throwing people around.

#

You can already set the velocity though. Dunno how force really adds anything new.

#

I guess it makes it proportional to the mass.

winged sphinx
#

@little eagle I got a script working in Eden test for muli and not working on server

#

@tough abyss you can help too ๐Ÿ˜ƒ

little eagle
#

I may know the answer.

winged sphinx
#

plz help

little eagle
#

...

winged sphinx
#

hmm?

little eagle
#

๐Ÿ‘
๐Ÿ”ฎ

winged sphinx
#

oh, rip

#

alright, here is what I got.. the script I'm using is Moss_targets"shooting range"
working in Eden multiplayer test, and not working on server. Any ideas ?

little eagle
#

No, how is that script executed?

winged sphinx
little eagle
#

But how did you integrate this into your mission?

winged sphinx
#

I tried the test mission he provided

little eagle
#

I guess it only works in SP.

winged sphinx
#

I copied the script folder to my mission, worked once

#

and didn't work again

#

it did work once on multi

little eagle
#

Maybe there's a script error in your mission. Check the RPT file.

winged sphinx
#

First time I tried on server it worked and later after, it's not working anymore.
I thought I did something wrong, I tried the mission he provided for the script. not working.

#

"I won't be working on this project, probably ever again." -mossarelli

#

Is there any similar project to this ?

little eagle
#

Maybe there's a script error in your mission. Check the RPT file.

winged sphinx
#

18:27:37 Mission Moss_Targets.Stratis: Missing 'description.ext::Header'

#

this is the descroption.ext
allowFunctionsRecompile = 0; //Turn this off when the script works before you use in in a multiplayer environment. Prevents hackers from recompiling the functions.

class CfgFunctions
{
#include "RifleTargets\cfgfunctions.hpp"
};

little eagle
#

Nothing wrong with that I think.

winged sphinx
#

I will try to test it with out anymods

#

No mods, template mission

little eagle
#

Well, I guess you have to make sure to synch all signs and targets to the logic.

winged sphinx
#

He did that in his template mission

little eagle
#

But it says error, so maybe you forgot one.

winged sphinx
#

So, the mission file I used came from the script maker, nothing edited by me, and here is how it looks in editor,
https://steamuserimages-a.akamaihd.net/ugc/906770848470209830/ACA8FF03D39768435939504629D7844D9926429E/
As you can see the logics are synced, and here the unsynced logic
https://steamuserimages-a.akamaihd.net/ugc/906770848470210751/52F760950554CCFDA013C839ED6C0C5A4B6E8733/
And here, working on eden test for multi
https://steamuserimages-a.akamaihd.net/ugc/906770848470211017/E03C138DDC49B3581944278AE78F972D00738322/

little eagle
#

Maybe this mission is just broken? Or it's not supposed to be used in MP?

winged sphinx
#

What confuses me is, if broken why work in Eden? Why did it work before on server?
And it's to be used in MP for clans he said,
"A lot of groups and clans out there don't even have working targets to shoot at other than improvised pop up scripts. Thus during my time in my old community I tasked myself to create a proper target system with real score based on accuracy." -moss

simple solstice
#

@winged sphinx that rpt doesn't work

#

search for description in the rpt

#

and copy paste the results here

winged sphinx
#

12:56:39 Mission Moss_Targets.Stratis: Missing 'description.ext::Header'

simple solstice
#

anything else other than that?

winged sphinx
#

12:48:12 - adapter description : NVIDIA GeForce GTX 970

simple solstice
#

ok, thanks. then there is nothing wrong w/ description.ext

winged sphinx
#

So, what is wrong ?!

simple solstice
#

post the full RPT

#

the link you posted doesnt work

winged sphinx
#

I will get you another report, one sec

simple solstice
#
12:51:09   Error position: <select _foreachindex) in ["RscDisplayDeb>
12:51:09   Error Zero divisor
12:51:09 File A3\functions_f\Debug\fn_errorMsg.sqf [BIS_fnc_errorMsg], line 29
12:51:09 Error in expression <le ["gui_classes",[]]);
{
if ((_classes select _foreachindex) in ["RscDisplayDeb>
winged sphinx
simple solstice
#

same errors

#

maybe something calling this function is faulty

winged sphinx
#

First report, server running profiling_x64
Second report, server running arma3server_x64

simple solstice
#

doesnt matter

winged sphinx
#

I just don't know, why is it working in eden and not working on server

simple solstice
#

is server selfhosted?

#

or on dedi

winged sphinx
#

dedi

#

I can give u ip, if u wanna try

simple solstice
#

the only thing I see in the RPT is the error I posted

#

cant help futher ;/

winged sphinx
#

What does it mean? I'm not that good :/

#

Also that error repated it self for 18 times in the same time frame

#

13:18:37

little eagle
#

That mission is probably broken. It's from 2015 after all.

winged sphinx
#

LOL

#

I found the solution

#

omg

#

@simple solstice , @little eagle any of u guys downloaded the missions ?

little eagle
#

It's a mission, no.

winged sphinx
#

mb, alright

#

So doesn't matter what you do, you need to join the server, the error will come, Hit ok then go back to lobby

#

And gg

#

@little eagle @simple solstice Thank you for your help. ๐Ÿ˜ƒ

little eagle
#

I'm almost certain that this mission never worked in MP.

winged sphinx
#

It's working now, that's why when we started. I told you it was just working

#

I didn't know that I loaded the script that way

simple solstice
#

anyone have a grey screen effect?

#

to make the screen monochromatic

#

cant find it on the wiki and anything related on google is about crashes

simple solstice
#

im on this apge

still forum
#

Color correction maybe

#

That is atleast the correct place to look at

simple solstice
#

I know but I cant seem to make the screen turn black and white

#

trying and trying ๐Ÿ˜ฆ

#
["BlackAndWhite", 0, false] call BIS_fnc_setPPeffectTemplate;
``` found it
astral tendon
#

is there a command to decrese the time to the medic to revive?

little eagle
#

No.

astral tendon
#

i want to make it faster than 3x

waxen tide
#

vanilla medic system?

#

isn't there a setting in the eden editor ?

astral tendon
#

yes, but is locked to 3x

#

also

#

Do that ability to revive 3 times faster as a medic only works if the unit is already set as a medic?

#

becasue, i made a script that once you get a medickit (not first aid kit) you became medic

#

the player that get the kit is supouse to revie 3x faster

gusty aurora
#

this might not be the right channel but does anyone know where i can find the bullet-hitting-ground effects in the a3 folder?

little eagle
#

a3_data_f is a good place to start for generic stuff like that.

grand berry
#

Is there any way to force VIV for vehicles that have too big a bounding box for the carrier vehicle?

tough abyss
#

does anyone still have

#

odol web converter

#

i need it to learn models on making weapons

tough abyss
#

anyone happen to be familiar with this spamming error? sqf 22:19:02 Error: Sound volume expression: engineOn*(1-asphalt)*(1-camPos)*(latSlipDrive 0.8[0.1, 0.4])*(Speed 0.8[2, 15]) 22:19:02 Error in expression <engineOn*(1-asphalt)*(1-camPos)*(latSlipDrive 0.8[-0.1, -0.4])*(Speed 0.8> 22:19:02 Error position: <latSlipDrive 0.8[-0.1, -0.4])*(Speed 0.8> 22:19:02 Error Generic error in expression

Using quite a lot of mods on the server. The only problem I have recurring is that my ArmA 3 'crashes' on 'receiving mission data' and only unfreezes when the server kicks me for no response. Somehow got the feeling it's got to do with the error as I've reinstalled the game and it still persists

waxen tide
#

@tough abyss there are lots and lots of errors in missions, mods and even arma itself that spam the logfiles. you should find someone who can play on the server just fine, and check if his log has the same error. if that is the case, you can probably ignore it and it is not your issue.

tough abyss
#

Aight thanks, thought it'd be due to the new RHS update as a lot from AFRF seems to be returning errors

waxen tide
#

it is not only RHS, many mods do that. you can try to verify your game files, steam will verify the mods, too

#

if you got them from workshop

cloud thunder
#

Is there a way to have a line break in diag_log output once or right before the next element in a printed array exceeds the 1044 character limit? diag_log text format ["Men List: %1", _menList]; I'd rather not print a line for each element if possible.

tough abyss
#

Use a logging extension, there are afew for arma

cloud thunder
#

Ok I'll try it, Thank you.

deft owl
#
        texture = __EVAL((__FILE__ select [0, count __FILE__ - 15]) + "a\vikingmain31.paa";

after exporting of my .pbo all .paa's couldn't get finde :/ dont know how to fix it

robust hollow
#

does the texture path above match the actual path?

#

(after its processed)

deft owl
#

y

queen cargo
#

@cloud thunder alternative is to write a function breaking the string into parts

#

Using count, select etc you can get stuff split up

subtle ore
#

Stall speed? @tough abyss

#

red in rpm is what makes me think so ๐Ÿค”

little eagle
#

@deft owl The part after + needs to be part of __EVAL.

#

@tough abyss RedRPM is a threshold for the sound simulation part of the engine. There is no way to set/get the max RPM, because - surprise - PhysX is hot garbage.

still forum
#

@tough abyss you don't. Also wrong channel. Google "Breaking Point github" Or use Arma 3 samples.

deft owl
#

@little eagle fixed it, #armaisabitch. used the pbo mangaer now and it worked

cloud thunder
#

ty

astral tendon
#

Guys, many thanks for help me with scripts, my work is done.

polar folio
#

damn dude. that mod list...
don't get me wrong, all good mods, but still.

subtle ore
#

Yeah i was just about to say the same thing. Try and cut down on em unless they are specifically used to showcase something

astral tendon
#

i did my best to remove unnecessary stuff, sadly i actually need all those to reach my goal.

#

i put 3den Enhanced because it seens like mission bugs out with out it.

tough abyss
#

eden mods shouldn't affect the actual mission tbh :S

scenic shard
#

gz on release! Feels like some of the mods add kinda the same assets and the mission would probably be fine even without for example a huge arsenal of weapons. but I haven't actually looked what you use from each mod so it might not be the case. Not a big deal, but users tend to shy away from missions that need many mods they dont have. (at least in my group)

In the description you tell users not to save, which is fine. but then you could just as well disable saving all together if you dont want to support it. https://community.bistudio.com/wiki/enableSaving

The desync issues you mention could probably be fixed by waiting until all players have loaded the mission before you do whatever it is you do, but that is just a guess.

astral tendon
#

Thanks for the code, i will update the mission soon.

tough abyss
#

How do i do this process @still forum

#

Using breakpoint

still forum
#

what? Are you asking me how to google and click the first result?

tough abyss
#

Yes

#

When i open it on oxyygen2

#

it dotn work

#

"unable to load file"

#

@still forum

still forum
#

Did you download the whole repository as zip file?

tough abyss
#

yes

still forum
#

Don't. Download the files manually. Zip download is broken for unknown reason

tough abyss
#

oh

#

ok

#

great

#

the acog

#

just leaves

#

a box

still forum
#

Click my link and try it.....

#

stop spamming please

subtle ore
still forum
#

yup.. That's what happens when idiots doublepost

subtle ore
#

Someone needs to make a discord bot for double posting monitor.

#

So that spastic children can't go crazy

peak plover
#

is there a chance that player returns null in postinit ?

little eagle
#

headless client, dedicated server?

peak plover
#

For a player

#

I'm like why do people use sqf waitUntil {!isNull player};

subtle ore
#

Uhhh. No? Player is still alive during loading screen iirc.

peak plover
#

or that stupid one sqf player == player

#

Okay, good. I'll just not use those ๐Ÿ˜„

subtle ore
#

Wtf ?!? 0_0 player == player

peak plover
#

Yeah ๐Ÿ˜‚

indigo snow
#

returns false for objNull

little eagle
#
    //--- Call postInit functions once player is present
    _functions_listPostInit spawn 
    {
...
        //--- After JIP, units cannot be initialized during the loading screen
        if !(isserver) then
        {
            endloadingscreen;
            waituntil{!isnull cameraon && {getClientState != "MISSION RECEIVED" && {getClientState != "GAME LOADED"}}};

            ["bis_fnc_initFunctions"] call bis_fnc_startLoadingScreen;
        };
...
        //--- Execute automatic scripts
        if (!is3DEN) then 
        {
            if (isserver) then {
                [] execvm "initServer.sqf";
                "initServer.sqf" call bis_fnc_logFormat;
            };

            //--- Run mission scripts
            if !(isDedicated) then {
                [player,didJIP] execvm "initPlayerLocal.sqf";
                [[[player,didJIP],"initPlayerServer.sqf"],"bis_fnc_execvm",false,false] call bis_fnc_mp;
                "initPlayerLocal.sqf" call bis_fnc_logFormat;
                "initPlayerServer.sqf" call bis_fnc_logFormat;
            };
            0.90 call bis_fnc_progressloadingscreen;

            //--- Call postInit functions
            _fnc_scriptname = "postInit";
            {
                {
                    _time = diag_ticktime;
                    [_x,didJIP] call {
                        private ["_didJIP","_time"];
                        ["postInit",_this select 1] call (missionnamespace getvariable (_this select 0))
                    };
                    ["%1 (%2 ms)",_x,(diag_ticktime - _time) * 1000] call bis_fnc_logFormat;
                } foreach _x;
            } foreach _this;
            1.0 call bis_fnc_progressloadingscreen;
        };
...
    };
peak plover
#
objNull == objNull```
little eagle
#

I had to cut out some stuff.

#

Note:

waituntil{!isnull cameraon
#

And the postInit is afterwards.

#
player == player

is the retarded way of writing:

!isNull player

And people keep using it because they're people.

indigo snow
#

but it might be faster

#

๐Ÿ˜›

peak plover
#

both useless. just postinit and $$$

little eagle
#

but it might be faster
Yes, but it isn't and even if it were by a tiny margin, it looks stupid and evidently makes people flinch.

#

Most that use it don't even know what it does.

peak plover
#

time > 0 is bad as well, according to wiki comments, it can take seconds to sync with server

little eagle
#

Have you ever checked if it actually synches at all?

peak plover
#

Have not checked but I have faith that it does

little eagle
#

ahaha

peak plover
#

Should sync when connecting

jaunty zephyr
#

agh. I'm fiddling with the old camera ( "camera" camCreate _pos ) b/c it knows how to inertia. โ€“โ€“ my problem: it quits anytime I right-click. Is there any way to prevent this?

peak plover
#

Don't right click?

jaunty zephyr
#

:P

#

(adding mouse down handler to display46 and returning true doesnt do anything)

scenic shard
#

time never syncs, serverTime does

peak plover
#

They've lied

little eagle
#

Discord has bad compression. ๐Ÿ˜ฆ

peak plover
#

So confirmed for sync

little eagle
#

Yes, but it diverges pretty hard as time goes on.

#

Because it works in the simulation time and that depends on the FPS etc.

meager granite
#

I use player == player because it looks symmetrical and I might have an OCD

subtle ore
#

What about diag_tickTime?

little eagle
#

tick time uses the machine clock, but it starts at game start, not mission start and therefore breaks savegames too.

subtle ore
#

๐Ÿค”

peak plover
#
_var = objNull;
(_var == _var)//true
_var = unit_1;
(_var == _var)//true
little eagle
#

The machine clock should be good enough to have a synched time over multiple hours as long as your pc isn't broken or something.

peak plover
#

replace _var with player

little eagle
#

But the time command certainly isn't.

meager granite
#

null is not equal to null

subtle ore
#

I think KK said something about how diag_tickTime also becomes inaccurate over time

peak plover
#

whoaa ?๐Ÿ˜ฒ

little eagle
#

configNull == configNull
is true

meager granite
#

objNull == objNull => false
objNull isEqualTo objNull => true

little eagle
#

objNull isEqualTo objNull => true

#

ok

meager granite
#

(messed up copy-pasting)

peak plover
#

oh my good

meager granite
#

Really? Null config is equal to null config? Never tried that.

little eagle
#

Try it.

meager granite
#

I wonder if nothing is equal to nothing

subtle ore
#

:scream:

little eagle
#

nil == nil
is
nil

meager granite
#

nothing, not nil

little eagle
#

Because everything with nil as arg is nil

peak plover
#

call compile "" isEqualto call compile ""

meager granite
#

You probably couldn't even compare nothing ot anything though, i'll check

little eagle
#

nothing is just a nil with null pointer type. My statement is more general.

meager granite
#

Yeah, you can't compare nothing with ==

still forum
#

@subtle ore diag_tickTime is literally tied to system time. It doesn't get more accurate. But yes it is bound to floating point precision so it get's inaccurate

subtle ore
#

@still forum Yes, hence over time

meager granite
#

Error ==: Type Nothing, expected Number,String,Not a Number,Object,Side,Group,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location

little eagle
#

Yep, tick time is as good as you can get imo. Even better than working with network delays for many hours of uptime.

#

Never tried if sleep mode breaks it though

still forum
#

@subtle ore in 24 hours it is inaccurate by 1.5ms

#

I wouldn't call that inaccurate at all ๐Ÿ˜„

subtle ore
#

A very very very very long time Dedmen. ๐Ÿ˜‰

peak plover
#

Real time is inaccurate as well

little eagle
#

What "nothing" did you use?

peak plover
#

Your clocks are lying to you

subtle ore
#

Nigel wtf

meager granite
#

The nothing type

subtle ore
#

My brain

little eagle
#

Repro?

meager granite
#

There is just a single way to get it and its completely useless

#

addMissionEventHandler ["Draw3D", {nothingvar = _this}]

#

Draw3D puts this nothing type variable into _this for some reason

#

The only place in entire game

peak plover
#

Earth loses some ms every day. Should've used param, maybe then our time would not be out of sync.

little eagle
#

Ah, I see.

meager granite
#

Tick time becomes unreliable when calculating per frame deltas over few hours of game running

peak plover
#

Most games last <5 hours anyway..

meager granite
#

If you have decent FPS, deltas become 0

#

I've been asking for diag_deltaTime for a while now

subtle ore
#

Either way, it's as good as it gets.

peak plover
#

Well

little eagle
#

I'm at ~1000 seconds now and the server is already 2 seconds behind in time and 0.3 s ahead in relative tickTime / CBA_missionTime.

peak plover
#

It's good

subtle ore
#

As it gets

still forum
#

I actually just built a hack to dump the frame delta times ๐Ÿ˜„

meager granite
#

I remember time being absolutely unreliable in network environment, the more freezes and FPS jumps you had, the more it differed from other clients and server

little eagle
#

Yep.

still forum
#

diag_deltaTime would only tell you the time since last frame start or end. That won't help much if you need exact time in the current frame. not just current framestart relative to last frame start

subtle ore
#

Why exactly would there be a delay though in time reads on the server pc? (Over network)

meager granite
#

I think time is only synced on connect and then calculated locally

#

serverTime gets synced with server constantly iirc

little eagle
#

Because time is updated relative to how the simulated time progresses.

subtle ore
#

Right, but what about getting times from a db or something?

meager granite
#

@still forum Can diag_tickTime even return different values within single frame? I guess it should?

subtle ore
#

I understand why time wouldn't work

still forum
#

yes

little eagle
#

A db has just a number, idk.

still forum
#

diag_tickTime calls directly through to getSystemTime

tough abyss
#

@peak plover - always use param.

peak plover
#

It's fine the way it is. The player does not even need it's own time.... If you want somethign to happen the same time on every client, just use remoteExec on the server

meager granite
#

Then we need two commands to measure time, start and end of measurement

peak plover
#

playerTime serverTime missionTime Just sync the missionTime when connecting and everything else can run independently

#

I wonder how do other newer games do this... if it all

tough abyss
#

@peak plover - off topic, are you a woman?

subtle ore
#

๐Ÿ˜‚

little eagle
#

Make how CBA_missionTime operates a native command : (

peak plover
#

Yeah, because nigel is a womans name :D
@little eagle intercept?

subtle ore
#

Who knows, Nigel could very well be a womans name ๐Ÿค”

tough abyss
#

@peak plover - you've a woman in your profile picture ๐Ÿคท

little eagle
#

And I'm carrying a sword and shield all the time irl.

tough abyss
#

Assumed it's you.

subtle ore
#

Neviothr, i am actually a twig. That is me in my profile picture, a small tree.

#

Commy has to defend himself against savage Americans

tough abyss
#

I'm not surprised in the least, Commy.

#

Believe it or not but I do actually wear an ACH and a balaclava when it's cold out.

subtle ore
#

Heheheh

#

Hunched over like that?

#

๐Ÿ˜‚

tough abyss
#

Ahh, that quote's gonna bite me down the road.

#

You saw nothing!

#

Anyway, back to nilTime = ๐Ÿฆ„ or whatever.

subtle ore
#

I have it all! Here in me noggin.

tough abyss
#

You forget a thousand things every day, make sure this is one of them.

subtle ore
#

This one i will make sure sticks around

#

Won't go nil at the end of the day

tough abyss
#

Can time even be nil?

little eagle
#

No.

subtle ore
#

We don't know that

#

We as humans made 'time' because we had no control over it

#

And it is our means of control now

#

And srructure

peak plover
#

time is a concept entirely made up by human

#

It only exists in humanity

subtle ore
#

Yep, definitely.

little eagle
#

?

#

The SQF command can never be nil unless your game is borked.

tough abyss
#

:joy:

little eagle
#

And actual time is whatever you want it to be. Question is if that still describes reality.

subtle ore
#

Commy....you missed it

peak plover
#

Cosmic rays hit the byte containg time, turned it gay nil

little eagle
#

Possible.

subtle ore
#

Woah

peak plover
#

I had a comment escape the other day, all I did was restart my game and it was fixed...

tough abyss
#

TIL unicorn poop is called cosmic ray.

#

(because unicorns poop rainbow rays).

subtle ore
#

What is the cool kid slang TIL for anyboe?

#

Unicorns don't have COSMIC rays though

tough abyss
#

Today I Learned.

meager granite
#

๐Ÿค”

subtle ore
#

๐Ÿค”

tough abyss
subtle ore
#

๐Ÿ‘ฝ ๐Ÿšฌ

little eagle
#

And this is on an empty mission.

peak plover
#

Yeah...

subtle ore
#

Wow, so i can imagine how innacurate it would be on a large mission

little eagle
#

It's really bad.

peak plover
#

Yeah, a public server which restarts twice a day...

#

Like the zombie modes

#

or life modes

#

Must have like hours of mismatch

subtle ore
#

Yep

peak plover
#

I just assume they restart whenever they crash

#

200 players... jeeez

subtle ore
#

Especially on the crappy ass life servers

tough abyss
#

implying there are good ones.

subtle ore
#

Must've been crawling at the bottom for both client and server fps

peak plover
#

Only good life server is an offline life server

tough abyss
#

:thumbsup:

subtle ore
#

HA

#

well said

tame portal
#

@subtle ore They are actually running just fine

subtle ore
#

@tame portal don't tell me, that you're a lifer right?

#

Cover the windows!

#

Nail the planks!

tame portal
#

I don't play any gamemodes

subtle ore
#

Lock the door!

#

Keep the lifers away!

tame portal
#

For that amount of players, they are actually still in an OK area when it comes to performance

subtle ore
#

Nonsense

tulip cloud
#

when it comes to UI. What is the best position type for supporting different aspect:ratios and resolutions?

peak plover
#

safezoneW and safezoneH, that's fullscreen

#

alwaya

still forum
#

Don't spam @errant birch

peak plover
still forum
#

He is not recruiting really

peak plover
#

hiring help, kinda the same thing

still forum
#

If you don't know how a chat works.. You really shouldn't be here

peak plover
#

common misconception

still forum
#

But some people think before they speak out.

simple solstice
#

First of all go the the altis life discord as it's more specific to your problem.

#

Second of all you propably haven't even read the documentation or instruction if you get that error

#

I guess you don't even know a database is for your mission

subtle ore
#

Figures a lifer decides to spam the discord

tough abyss
#

Database? You mean external thumb drive?

subtle ore
#

Even decided to spam in creators recruiting. Like wtf? Do you have eyes?

peak plover
#

picture of weird jesus?

tulip cloud
#

When creating an interface is it best practice to have the entire interface in a class and use actions to make elements show/hide or split the interface into groups of classes and hide/show entire ui classes?

#

I hate working with arma ui system but I'm forcing myself to learn it

peak plover
#

I've done all versions of that and ended up making templates of the most used things and then I use functions to create those.
I find spliotting everything in logical groups very helpful as well

#

Having everything in one class is worst. Splitting it up, even a bit is better in the long run

tulip cloud
#

to what extent do you break it down. for instance if I click a button and it brings up a sub-menu that then changes the window....would you put the sub-menu with the parent button or have all 3 as separate classes?

peak plover
#

Since I would use sub menus in more than one place

#

And buttons as well

#

I made a function that creates a button which has a sub menu

tulip cloud
#

got it. sounds smarts enough.

peak plover
#

    _dropList = [
        "Respawn Player",
        [0,1.3,5,1],
        {
            private _array = [];
            private _nil = {
                private _value = _x;
                private _name = name _value;
                private _toolTip = ('Respawn '  +  _name);
                _value = str _value;
                _array pushBack [_name,_value,_toolTip];
                false
            } count PLAYERLIST;
            _array
        },
        {[_this] call respawn_fnc_respawn}
    ] call menus_fnc_dropList;
#

Very flexible, but I don't ahve to make classes for everything, (yay)

subtle ore
#

Yay

peak plover
#

Anyone know from the top of their head if video can be resized and made transparent?

subtle ore
#

In ogv?

peak plover
#

Yes

subtle ore
#

Maybe when you're editing in the video. But arma will just see the background as white

peak plover
#

hmm... will overlays work?

#

As in, like a hud element_

subtle ore
#

I have no clue. Anything like that of videos and arma is some sort of workaround.

#

Doubt you'd be able to do transparency at all

peak plover
#

๐Ÿ˜ข

little eagle
#

Opening the VA mission just gave me a script error.

peak plover
#

va?

subtle ore
#

Virtual Arsenal

cold pebble
#

Leaving the VA gives me a script error too lol

subtle ore
#

Well, I guess I'll just put that up on the feedback tracker if no one else is going to ๐Ÿ‘€

rancid ruin
#

is there really no event handler for detecting when the player changes their weapon?

#

how can I achieve that?

little eagle
#

mods?

rancid ruin
#

no mods

little eagle
#

EachFrame mission event checking it every frame

subtle ore
#

WeaponState?

tulip cloud
#

Warning Message: Resource playerMenu not found

description.ext

    #include "defines.hpp"
    #include "dialogs.hpp"

dialogs.hpp

class playerMenu {
    idd = 9999;
    movingEnabled = false;

    class controls {

What am I missing?

little eagle
#

currentWeapon ? Seems to be what you want.

#

cutRsc needs it in class RscInGameUi

#

(may have botched the name, never use cut)

tulip cloud
#

?

little eagle
#

You're using cutRsc, right?

tulip cloud
#

no

little eagle
#

What then?

tulip cloud
#

for what?

little eagle
#

Creating playerMenu.

#

Just a config does nothing.

tulip cloud
#

I have like 0.5% experience with gui. Took me 7 hours just to get to where I'm at today.

little eagle
#

Well, you do understand that any ui has to be created at some point, right? ctrlCreate, createDisplay, cutRsc etc.

tulip cloud
#

I try using createDialog "playerMenu"; and that is when I get the error

little eagle
#

Mission?

#

Or Addon?

tulip cloud
#

mission

little eagle
#

Check the missions config (description.ext) in the ingame config viewer.

#

And check that playerMenu is a base class at config root level.

#

Meaning not inside another class.

tulip cloud
#

its in a class

#

class MissionCFGMain

little eagle
#

That doesn't work then.

#

It has to be a class in mission or addon root (dunno about campaign)

tulip cloud
#

ok I'll mess with that and see where I get.

#

would I be able to do createDialog "MissionCFGMain:playerMenu"?

little eagle
#

No.

#

Too advanced. Remember this game is from '97.

tulip cloud
#

though if I was writing in intercept then I should be able to that way right?

little eagle
#

No, just change your config already.

tulip cloud
#

lol, thanks commy

little eagle
#

yw

tulip cloud
#

creating a dialog from a button action = "createDialog "dialogName""; How do you properly do that?

#

just an escape character?

robust hollow
#

action = "createDialog 'dialogName'"; or action = "createDialog ""dialogName""";

tulip cloud
#

I'm using """ I'll try ' looks cleaner

tulip cloud
#

Opening a second dialog is overwriting the one under it. Do I need to recreate the entire dialog each time I open a new dialog?

peak plover
#

use createDisplay instead of createDialog to have one on top

scarlet spoke
#

Is it possible to start a variable name with a number when declaring it in the sourcecode (therefore not with setVariable)?

#
3testVar = 5;```
little eagle
#

No, but how is setVariable not source code?

winged sphinx
#

_FlagClass = "Flag_US_F";
This one call from the game file, how I implment a flag pole from the mission file it self ?

little eagle
#

You cannot add CfgVehicles classes with the mission config (description.ext). But you can change the flag texture of an already existing flag class with one script command.

winged sphinx
#

What command please ?
and can I call that in the other script init.sqf ?

little eagle
#

It's appropriately named.

tulip cloud
#

doThis.sqf

_ctrl = (findDisplay 100000) displayCtrl 100200; 
_ctrl ctrlSetEventHandler ["onMouseButtonClick","diag_log _this"];

ListBox

idc = 100200;
onMouseButtonClick = "_this = [[lbText [100200,(lbCurSel 100200)]]] execVM 'doThis.sqf';";
#

_ctrl works fine for everything else but having issues changing the onMouseButtonClick It doesn't appear to be properly modifying the list

little eagle
#

Remove the "on" for the SQF version.

#

โ—

grand berry
#

Is there a way to disable collision between physx objects since disableCollisionWith doesn't work?

little eagle
#

No.

grand berry
#

Shame, thanks.

astral tendon
#

if ((getSuppression civ1) >= 0.5) then {civ1 playActionnow (selectRandom ["gestureYesestureNo","gestureYes","Crouch","FastB"]);};

#

were do i put that when i need it to keeping running?

subtle ore
little eagle
#

gestureYesestureNo
๐Ÿค”

subtle ore
#

๐Ÿ˜‚

little eagle
#

Civ is a woman?!

#

Who thought putting alt tabbing and autocomplete on the same key* was a good idea...

subtle ore
#

๐Ÿค”

astral tendon
#

iknow...

subtle ore
#

Which?

#

Discord?

little eagle
#

Arma

vagrant badge
#

no womens in arma i dont see any

subtle ore
#

Didn't realize arma had auto complete. This is with something like the debug console right?

#

๐Ÿ˜‚ no womens? Oh god my sides hurt, this is too good

#

No womens guys, Arma will finitely be incomplete

astral tendon
#

lol

#

well, that script is when a unit is supressed, do a animation to kinda simulate fear

#

sadly, you cant supresses Civs, so RIP

#

but i will let this to enemys

subtle ore
#

There are anims for panicking

peak plover
#

sure there are

astral tendon
#

yes, but it bugs it

#

he dont get out of the animation

#

i want it to panic for 3 seconds and then back to normal

subtle ore
#

Switch move will put the anim in first qeue so that there is zero transition, and sleep it for 3 seconds and switch move it to a nil value

austere granite
#

Anyone aware of somethign changed for ctrlCombo types?... i had a dropdown menu that worked perfectly fine before

#

but now it doesn't trigger at all anymore

#
        _dropDown ctrlSetEventHandler ['LBSelChanged', format ["systemChat 'test';"];
        _dropDown ctrlSetEventHandler ['MouseButtonClick', format ["systemChat 'click';"]];
#

worked a version ago

#

Click works. LBSelChanged does not

little eagle
#

Tried add instead of set?

austere granite
#

(Also ignore the typo in that)

#

Same thing @little eagle

#

Also when selecting.... it doesn't actually update the thing

astral tendon
#

ah, nevermind that, i tink i am gonna put it on a trigger

austere granite
#

Strangest thing is somewhere else i also have a lbselChanged with the same ctrlCombo and that one does work

#

config is the same.

subtle ore
#

@astral tendon sinful triggers are

astral tendon
#

i know

#

but i love they

subtle ore
#

Meh

astral tendon
#

if ((getSuppression civ1) >= 0.99) then {civ1 playActionnow (selectRandom ["gestureNo","gestureYes","Crouch","FastB"])};

#

how i make civ1 be any unit? like this script work to all units

subtle ore
#

That's what good ol scripts and functions are good for. You can pass anything into them and utilize the units @astral tendon

astral tendon
#

well, i did a .sqf

#

called fear.sqf

#

on the init.sqf i put {[_x] execVM "fear.sqf"} forEach allUnits;

subtle ore
#

Use params. Inside fear.sqf