#arma3_scripting

1 messages Β· Page 367 of 1

astral tendon
#

inside fear.sqf if ((getSuppression _x) >= 0.99) then {_x playActionnow (selectRandom ["gestureNo","gestureYes","Crouch","FastB"])};

simple solstice
#

@Roque_THE_GAMER to execute it on many units forEach could be used

subtle ore
#
Params["_myCivyDude"];
#

You have to assign them in order by the way

#

Using params at least

#

_x is a special variable for allUnits , the fear.sqf doesn't understand what that is

astral tendon
#

sorry, how would i do that?

subtle ore
#

like i said, params will assign your passed variables

simple solstice
#

when you [] call/spawn

#

you can pass arguments in the []

subtle ore
#

Yep

#

Never execVM btw unless you need a script handle

#

Which spawn already does

simple solstice
#

which are received and set by the params

subtle ore
#

So execVM is useless

#

Yep, what Katekarin said

simple solstice
#

to be honest I don't know how you made your mission work without using arguments

#

well it's possible but tedious

austere granite
#

global var everything πŸ˜„

subtle ore
#

Seems like he's been using triggers for a majority of it all

#

😱 @Adanteh#0761

simple solstice
#

aren't triggers just loops

astral tendon
#

yes, otherwise i would put a new trigger to every singe unit

subtle ore
#

The trigger conditions are yeah

simple solstice
#

don't put too much triggers.

subtle ore
#

Getting used to sqf will save you time

#

And perf

simple solstice
#

yup

astral tendon
#

i am just not that smart

subtle ore
#

Don't have to be. Just muscle through some of the quirks of sqf and you'll be fkne

#

It's mainly just understanding the commands

#

The biki is now your bible. I wish they had printed versions of that shit, or printable at least

#

Going to each biki command page and having to print each would be annoying and a waste of toner and paper

astral tendon
#

nevermind that, it way too hard for me.

cosmic kettle
#

@astral tendon a friend of mine is carpenter and learned in about 2-3 days of combined lessons. You can if you want to, it ain't that hard.

subtle ore
#

Oh wait for ARMA 4 C++ object orientated scripting. Wohoo

austere granite
#

By not taking a day or two to teach yourself the basics of normal SQF usage, you actually make it a lot harder for yourself πŸ˜„

subtle ore
#

Yep

cosmic kettle
#
  • the things you'll learn are worth it, even if it is the logical side of things.
austere granite
#

Because you have to do everything in an unconvential way you run into weird issues that you would not have otherwise

queen cargo
#

Because you do not understand, you run into weird issues you would not have otherwise

slim verge
#

@astral tendon
I am a gas fitter, i learnt how to code about 14 years ago when OFP was released and I wanted to make my own missions
I spent a week reading through all the scripting posts I could find just to understand what is and isn't possible in the scripting language that Arma uses.
Coding for arma is made up of 4 basic elements
Logic (Typicaally most things have 3 possible states, Everything is either On, Off or doesnt exist, true, false, nul) so when you code you have to code in such a way that you take into consideration all the possibilities
Syntax (This is the hardest bit for new coders, its here where everyone struggles initially)
Timing (There is pre init, time 0 and post init, some code has to be run at certain times, before other code is run, in simple terms you cant build a wall if the foundation isnt set and you can't lay bricks if you havent carried them to the wall first etc)
Locality (Some code has to be run on certain nodes (Machines like client, server etc) dependant on where the object is that you are referring too, the comref details this very well)

scenic shard
#

speaking of triggers, how resource intense are they? Did not realize they where just loops running in the background, always assumed they were converted to some kind of event for me.

any metric like x amount triggers is roughly -y fps or something?

slim verge
#

My first mission was a ctf called riverdance. I spent in excess of 100 hours of headache coding making that mission and when it was released, it had a lot more functionality than other missions of the same type made by my peers . It was also popular..
So if your attitude is "Its too hard", then you are making an excuse for not trying rather than digging in and getting stuck into it
Try very very basic stuff
Learn how the comref is laid out and understand the syntax
Also learn how to debug, that is, learn how to return values in a way you can see them, or check a script has gotten to a certain point, this is fundamental to understanding and developing code>
And just for folks like you, i even made a tutorial up about it, it should be simple to follow and will get you started....
Link.... https://forums.bistudio.com/forums/topic/166233-zeu-debugging-tutorial-foundation-template/

timber ridge
#

hey guys, what are the best tutorials or (in general) practices for getting good with A3's displays? is there anything anyone getting started should be particularly noted about that'll save tons of time later?
thanks!

queen cargo
#

Biki

#

Better: bi sim wiki

slim verge
#

Triggers check their condition every 0.5 seconds

timber ridge
#

thanks, @queen cargo , but I'm aware of those already and it doesn't help much to receive an advice as general as yours. I'm looking for something more specific.

scenic shard
#

@timber ridge then google your specific question, somone has likely asked before πŸ˜ƒ

slim verge
#

@timber ridge useage or hereditary and #define for common values, such as multipiers etc

timber ridge
#

seems like a pretty nice beginning.

#

it's even an entire series of tutorials.

scenic shard
#

@slim verge thx!

timber ridge
#

@scenic shard thing is, Arma community needs a platform like Stack overflow very much where voting for questions and answers is functional and when you're getting started with something new, you can just search by a tag and sort for the most upvoted questions.

slim verge
#

you also need to be aware that the gui can look different on different screen sizes unless you code that intoi the gui, fairly easy to do

timber ridge
#

BI forums don't help much in this case as many of the examples there may even date back to A2:CO days when found in the google results.

slim verge
#

BI and the 21st century, your having a laugh πŸ˜ƒ

scenic shard
#

that would be cool, but I wonder how active it would really be

slim verge
#

well arma survives on the moddability, so there is quite a strong following there, nothing stopping someone creating a stack overflow type forum somewhere

little eagle
#

I laughed when you said part of this game is logic.

timber ridge
#

anything at least closely resembling SO would be a huge step forward for the scripting communtiy and retainance of knowledge

slim verge
#

i meant a logical mind, eg folks will automatically try to open a door before walking through it, code doesnt think

little eagle
#

"SO"?

#

I understand it, but it was funny to me.

timber ridge
#

@little eagle Stack overflow.

subtle ore
#

DEEP MIND ?

little eagle
#

A forum where every question gets their thread and possibly an answer.

scenic shard
#

we need a new language, that knows your intent

little eagle
#

There are multiple of these. Sub on the BIF, /r/armadev. But they all get cluttered by the same questions over and over again and frankly low quality answers.

timber ridge
#

IMHO, voting is exactly the thing that may motivate people to post informative and at least properly spelled answers that will probably get accepted by the OP and won't confuse people.

#

Atm, when you're browsing BIF, there's almost no apparent indication of an answer or any helpful post at all. You just see a mess of text cluttered around and some votes being exchanged between the folks.

#

Also, a requirement for every question to have at least 4 tags is pretty ok compared to having none (BI forum threads).

#

Helps a lot when searching around for stuff.

slim verge
#

thats because stackoverflow is not a discussion forum, BI forums are

timber ridge
#

I'm not talking about BIF in general, obviously, just the editing / scripting / configs subforums.

little eagle
#

It would be nice if the wiki was at least complete. By that I mean listing all the quirks of all the commands.

slim verge
#

stackoverflow is more of a Q&A site

little eagle
#

Like those C++ guides.

slim verge
#

the wiki does in a lot of cases explain the oddities, funnily though those oddities are added by the wiki users, such as you and me, so the anmswer to that, is when you find an oddity add it to the talk page

timber ridge
#

I see no reaason why BIS couldn't make a SO-like QA website for SQF and Arma editing, configs in general. It's just a matter of effort put in as it'd help the community a lot when spreading knowledge.

#

A QA subforums could be even be perfectly integrated into the current BIF.

slim verge
#

if BI see an economic gain for that maybe they woulkd

slim verge
#

dont forget they are a business and businesses dont like spending money unless its really necessary, they rather spoend your pension fund instead

little eagle
#

I recently started collecting some of my answers in this chat as gists, but it's a short list and it's mostly just the code snippets without explanation.

timber ridge
#

@little eagle good one, but I think BIWiki has generally improved a lot in the past 2 years, thanks to numerous contributions of people like killzone_kid and others.

little eagle
#

True.

queen cargo
little eagle
#

^^

queen cargo
#

personally enjoy that one more when i know where to look fore due to more explaining
the one you posted is better for browsing

astral tendon
#

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
[]spawn {
while {true} do {
if ((damage healed) < 0.2) then {healed call BIS_fnc_ambientAnim__terminate};
sleep 1.00;
};
};

#

this command works

queen cargo
#

but it shows the problem we face in SQF
how to present the data to the programme

little eagle
astral tendon
#

but i wanna trow that command on any init of any unit

#

if i swap civ1 to this it does not work

timber ridge
#

@little eagle would you be interested in a repo or even a separate website for SQF gists?

astral tendon
#

what i need to change?

slim verge
#

all units have a variabloe called allunits
{... do something...}foreach Allunits;

frail zephyr
#

healed -> this if you want it on the init.

queen cargo
#

@timber ridge probably useless due to the fact that it simply is not needed

#

would be a pile of junk after a week or so

#

unless heavily moderated

little eagle
#

I really like the Github markdown. And so far it's not too many that they'd need their own website. Sounds like a hassle to maintain one.

timber ridge
#

@queen cargo I'd largely disagree. You can always ensure qualty when accepting/declining PRs.

queen cargo
#

You: You can always ensure qualty when accepting/declining PRs.
Me: unless heavily moderated

slim verge
#

however that really should be run on a hit or damaged eventhandler which is trigger on the event hit or damaged

timber ridge
#

@queen cargo well, i don't know what's your point, but of course it'd be have to be moderated , common sense there πŸ˜ƒ

scenic shard
#

while {true} do it is always a bad idea to use true as condition. you want to break out of the loop eventually

queen cargo
#

in regards of commands help, SQF-VM can serve for that purpose
the help__ command output is prety useful when used in the unary variant
can easily be printed then

however ... SQF-VM is not supporting all commands yet

slim verge
#

what he means is.... alwsys stay clear of a continous loop, as this constantly takes up resources.... so if you want to run codew when a unit is damaged, hit, then run that code via a hot or damaged event handler which is automativc ally triggered when that event occurs

#

excuse my typos fat fingers small keyboard

indigo snow
queen cargo
#

@timber ridge we talk about a sort-of pastebin with the possibility to search for snippets easily

  1. every snipped would need to be checked against correctness (testcases etc. need to be created)
  2. every snipped would need to have description and header perfectly clear for everybody
  3. tags or something like that would be required too for easy finding with keywords

all that would need to be done and checked by moderators

little eagle
#

Nice.

#

//--- Terrain Builder coorinate system starts at 200000 for some reason
lmao

queen cargo
#

for me that looks heavily like 3den utilizes opengl coordinates Oo

indigo snow
#

@slender halo ^^

slim verge
#

so you would add an event handler to each unit and tyhat event handler code would run.... if ((damage healed) < 0.2) then {healed call BIS_fnc_ambientAnim__terminate};

timber ridge
#

@queen cargo i completely agree, storng moderation, test cases etc. would be ideal for the best quality possible, but that's a long way to go, at first it'd be nice just to have easily foundable and visible examples, sortable, categorized by [something], etc.

#

after that, sure, you can always iterate to the next level (whatever that may be).

queen cargo
#

the moment you drop those requirements, you loose the quality

#

start like that, and you will have a pile of junk you have to fix

timber ridge
#

but the thing is, SQF communtiy don't have quality anyways, so a wise choice would probably be just to improve on that gradually and experiment with stuff and find enough collaborators within time

indigo snow
#

no quality πŸ˜†

timber ridge
#

I mean, why not just compile a list of gists from the results of a large dataset from a SQF QA site (choosing accepted answers in Q threads)?

#

that'd simply be a start.

indigo snow
#

Its a scripting language for a game, not a language for programming :P

queen cargo
#

lemme repeat: start with bad quality and you will leave those bad-quality stuff in there for ever

timber ridge
#

@indigo snow well, let's hope Enscript will make Arma scripting more of a lang ;D

astral tendon
#

Terox thanks for the help

#

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
[]spawn {
while {true} do {
if ((damage healed) < 0.2) then {healed call BIS_fnc_ambientAnim__terminate};
};
};
healed = this

little eagle
#

Such a site would probably devolve into endless discussions about whether or not you should use { in a new line and that you should replace all forEach with count etc.

astral tendon
#

that one works

#

i just need to trow that on a init of any unit

subtle ore
#

notlikethis

astral tendon
#

why?

indigo snow
#

That wont work

#

Only one unit will be healed

#

You need to pass arguments there

subtle ore
#

Why not get that AIS eh?

astral tendon
#

that true

queen cargo
#

@little eagle good thing here would be: does not matters
those snippets would need to be heavily commented --> reason why using count > forEach would have to be placed into comments

timber ridge
#

@little eagle you mean codestyle discussions?

subtle ore
#

HandleHeal

timber ridge
#

there's a separate site for those πŸ˜„

queen cargo
#

not rly ... stack overflow and thousands of other pages had those discussions already for non-sqf languages

#

it is just like the old discussion space vs tabs

#

you will never find an answer

timber ridge
#

you guys are way too negative about this, nobody hasn't even tried anything like that for Arma / SQF and you're already banishing it to the eternity. that's some exceptional spirit I guess πŸ˜ƒ

queen cargo
#

i do not banish it
i already know what success it would have ...

#

few ppl using it

#

only me (if i create it) moderating it

#

ppl getting angry about me not adding enough info to the snippets and so on

timber ridge
#

that depends, you knowing how something will turn out does not guarantee it'll turn out like that
even BIS could participate in promoting a special QA site for SQFscripting, etc.
any help from them would be gladly accepted.

queen cargo
#

you knowing how something will turn out does not guarantee it'll turn out like that
chances are quite low for any other outcome

#

it is hard to find participants for any project
to keep them interested is even harder if you always have to reject changes they propose
at best: one is the manager not writing any code and you got some code monkeys doing coding for ya

#

manager then only moderates

#

code monkeys write code

timber ridge
#

@queen cargo good points, yeah, but if you keep looking, you may find some knowledgeable and trusted people that could help out, even temporarily since everyone can get busy with RL at any given time and should have resign for a while / forever.

as for managing, sure, it's nice to classify by roles, but why not just let it flow at the beginning and see how much traction it gets? just setup some google analytics on the site and see how it's being used, etc.

then make decisions of what hierarchy is needed, if any. and since it's a non-profit project, no hierarchy should be enforced by default, right?

#

btw, are you saying that without hierarchy setup properly things will fall part quickly and inevitably?

queen cargo
#

talking about: either you get ppl hyped or you cannot fill those positions

#

as you are the one person left with doing all work

peak plover
#

There's tons of people doing shit, unite them if they do the same thing... I bet that's extremely hard 'tho

queen cargo
#

more like impossible
ppl jump on and off projects unless they feel entitled to them
either pay them or youre fucked

#

to pay ppl you need money

timber ridge
#

@peak plover you can say RHS did that to a greatly successful degree.

queen cargo
#

to get money you need to get ppl giving you money

#

you are a modder

#

you wont find ppl giving you money

#

unless those few rare golden eggs suddenly get a large group

peak plover
#

If you want money, then mods is not the place to be.

timber ridge
#

guess that sums up this evening's discussion in terms of community-driven projects etc πŸ˜„

indigo snow
#

@astral tendon

if (isServer) then {
    [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] 

    [this] spawn {
        params ["_unit"];
        waitUntil { (damage _unit) < 0.2 };
       _unit call BIS_fnc_ambientAnim__terminate; 
    };
};
#

if you absolutely must put in in the units init

#

keep in mind you really shouldnt have many of these because this is pretty bad practice

astral tendon
#

it huts perfomacy?

#

also, that one is giving generic error

indigo snow
#

Yea, pretty bad when they stack up. Might be an error, i quickly typed it on my phone.
Something like below is better practice (same error disclaimer)

<initServer.sqf or something>
private _unitsList = [unit1, unit2] + units someGroup; // Two examples to get a list of units
{
    [[_x,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"]
} forEach _unitsList; // Fire this for all units

[_unitsList] spawn { // I'm passing the _unitsList variable into the spawned code
    params ["_unitsList"]; // I'm grabbing the passed variable and naming it _unitsList. I dont have to
    while {true} do { // Neverending loop
        sleep 2; // Some sleep is good or it will tank FPS for sure
        { // Check all units
            if ((damage _x) < 0.2 then {  // Check damage of the current unit were checking
                _unit call BIS_fnc_ambientAnim__terminate; // If condition, call the fnc, and remove unit from the list
                _unitsList = _unitsList - [_x];
            };
        } forEach _unitsList; // Iterates through the list
    };
};
#

Since theres one loop that handles every unit

#

even better would be to use event handlers to detect it getting hit, so you dont need loops

#

Theres many ways of doing it but most of them are pretty bad

astral tendon
#

i just put that on a unit init?

indigo snow
#

(except for the EH)

#

that block, no

#

youd put it in something like initServer.sqf

astral tendon
#

then afther?

indigo snow
#

im sorry? i dont understand

astral tendon
#

just copy and paste that on a initServer.sqf and its done?

indigo snow
#

there might be errors, but yea

#

dont include the part between <>

#

and you need to put the units in _unitsList

#

but instead of just putting it in, take some time to see how its structured

astral tendon
#

so, i still have to specify what unit i want it?

indigo snow
#

yes, i dont know the names of your units or your groups

#

Ive added comments for understanding

#

i havent tested it and its probably pretty bad

astral tendon
#

all i just wanna to do is make a default wounded civilian that can be revived by bluefor

#

and then he will follow the way point to safety

indigo snow
#

sure

#

its more about the structure of the thing

#

using a list of all units and handling it all in one place, instead of infinite loops everywhere

astral tendon
#

so, how to stop a loop?

indigo snow
#

depends on the loop type

#

either a variable that it checks that you set to false, or terminate the thread

peak plover
#
while {isNil "stopLoop"} do {

};
indigo snow
#

but you shouldnt have many running in the first place

#

instead of removing them when done

#

theyll still slow things down while theyre active

astral tendon
#

fo exemple

#

my original problem was this

#

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
[]spawn {
while {true} do {
if ((damage this) < 0.2) then {this call BIS_fnc_ambientAnim__terminate};
sleep 1.00;
};
};

#

the ting is i cannot use "this"

indigo snow
#

indeed

peak plover
#
_handle = [] spawn {
while {true} do {

};
};
//
terminate _handle;
indigo snow
#

you can see how i passed variables in the script bits above

peak plover
#
while {true} do {
if (true) exitWith {}:
};
indigo snow
#
[var1,var2,var3] spawn { // List of vars
    params ["_a","_b","_c"]; // I store them into these. _a = var1, _b = var2, etc
    ... commands where i can use _a, _b and _c ...
};```
astral tendon
#

it would be more easy if i could use "this"

indigo snow
#

its just a name for a variable at that point

#

arma doesnt know what this is

#

there are many units, and you can use this in all their init fields

astral tendon
#

so, how he know what "this" is when i put if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };

indigo snow
#

because that all happens the moment the unit gets spawned in

#

and this is the current unit that gets spawned in

#

its something else as soon as the next unit spawns in

#

and it gets set to nothing when the last object is created

#

(is a way of explaining it)

#

so that loop creates an entirely different bit of code, and that code doesnt know about this anymore, because all the units have already been spawned

#

this isnt how it really works but it might suit as an explanation

astral tendon
#

then, i tink im gonna make it simple

#

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
[]spawn {
while {true} do {
if ((damage civ_1) < 0.2) then {civ_1 call BIS_fnc_ambientAnim__terminate};
sleep 1.00;
};
};

#

like this

#

just give the unit a name like civ_1

#

it works, but now i just need a way to stop the loop

indigo snow
#

try putting this in the init line

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
this addEventHandler ["AnimDone", {
    if (damage (_this select 0) < 0.2 ) then { 
        (_this select 0) call BIS_fnc_ambientAnim__terminate; 
    };
}];
#

it will check the damage every time one loop of the animation finishes

#

theres handleHeal as well

astral tendon
#

generic error

indigo snow
#

forgot a ]

astral tendon
#

nothing happens

#

he still doing the PRONE_INJURED_U1 animation

indigo snow
#

might be a long one

#

try the handleHeal handler instead

delicate lotus
#

I dont get it. ArmA is always giving me this weired error with my custom function.
Function:

/*
    Author: FurtherV

    Description:
    Makes a base indestructible.

    Parameter(s):
    0: POSITION - Array as position
    1: NUMBER - Radius

    Returns:
    NOTHING
*/

_result = params [["_location", [0,0,0], [[]], [2,3]], ["_radius", 100, [2]]];

_buildings = nearestObjects [_location, ["House", "Building"], _radius, true];
{ 
 _x allowDamage false; 
 _x setDamage 0; 
} forEach _buildings;

Code which spawns the function:

[getPos basearea, 500] spawn DEF_fnc_safeBase;

Entry in description.ext:

class CfgFunctions
{
    class DEF
    {
        class SpawnFunctions
        {
            file = "functions";
            class addSpawn {preInit = 1; headerType = 0;};
            class addClass {postInit = 1; headerType = 0;};
            class safeBase {postInit = 1; headerType = 0;};
        };
    };
};

Error:

_result = params [["_location", [0,0,0], [[]], [2,>
21:28:22   Error position: <params [["_location", [0,0,0], [[]], [2,>
21:28:22   Error Params: Type Bool, expected Number
21:28:22 File functions\fn_safeBase.sqf [DEF_fnc_safeBase], line 15
21:28:23  Mission id: a5c3304f76155055fdda3b4334a3bda4177dbc6c
#

Please Help me to find the error

indigo snow
#

the error is not the function

#

its when you call it

delicate lotus
#

But... I never give the function a boolean...

#

I give it a array in format of a position + a number

indigo snow
#

arma is saying you do!

delicate lotus
#

well... arma is clearly lying...

#

it also gives me the same error when I dont spawn / call the function

#

so I dont believe it happens when I call it...

indigo snow
#

ah wait one sec

astral tendon
#

still nothing

indigo snow
#

@delicate lotus you gave it the postInit flag, it gets called in postInit

#

by the function framework itself

#

whyd you put that in there πŸ˜›

scenic shard
#
if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
0 = this addEventHandler ["HandleHeal", {
    _this spawn {
        params ["_injured","_healer"];
        
        _startDamage = damage _injured;
        if (_startDamage > 0) then {
            waitUntil {damage _injured != _startDamage};
            if (damage _injured < 0.2) then {
                //add "get up" animation?
                _injured call BIS_fnc_ambientAnim__terminate;
            };
        };
    };
}];```

not tested but should work @astral tendon
delicate lotus
#

um... because I want to function to work after the mission is initialized

indigo snow
#

of course it will work

#

that flag just tells the game to actually call it during postinit

#

it will exist from before preInit

delicate lotus
#

wow...

#

how dumb am I XD

indigo snow
#

about 3 dumb

delicate lotus
#

other question: what does the header stuff do?

indigo snow
#

headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.

#

if you look at your fnc in the fnc viewer i think it add some lines to it

#

not 100% sure

delicate lotus
#

ah okay

astral tendon
#

@scenic shard it worked! thanks!

indigo snow
#

at least using it for the 0 flag wont have any effect at all

#

nice work @scenic shard

astral tendon
#

is this also perfomace friendly?

indigo snow
#

yes

astral tendon
#

all wonders

scenic shard
#

actually _startDamage is probably always > 0 so you can probably skip that if statement. but yea

indigo snow
#

the game itself will call it when you do the healing action, instead of you constantly checking in a loop

delicate lotus
#

yay no error...
Let me guess, the init stuff and such is for setting up stuff while the game is still loading using given parameters by the engine / game?

indigo snow
#

@scenic shard cookie points if you remove it after the __terminate fnc is called πŸ˜‰

#

@delicate lotus yea but you dont really use those passed values

#

youd use it as e.g. an init.sqf that always loads after everything is created but before the mission starts

scenic shard
#

yea, this is probably a one time thing so the EH could be removed after it fires.
would sqf _injured removeEventHandler ["HandleHeal", _thisEventHandler]; work? havent actually tried removing EHs from within a EH before.

indigo snow
#

it would, yea

scenic shard
#

nice, good to know! then add that line @astral tendon after you terminate the animation and remove the if-statement to optimize it further πŸ˜ƒ

astral tendon
#

how should i add it?

#

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
0 = this addEventHandler ["HandleHeal", {
_this spawn {
params ["_injured","_healer"];

    _startDamage = damage _injured; 
    if (_startDamage > 0) then { 
        waitUntil {damage _injured != _startDamage}; 
        if (damage _injured < 0.2) then { 
            _injured call BIS_fnc_ambientAnim__terminate; 

_injured removeEventHandler ["HandleHeal", _thisEventHandler];
};
};
};
}];

#

like this?

scenic shard
#

yep

astral tendon
#

it gives a error

scenic shard
#

oh, which?

and you can remove if (_startDamage > 0) then {
and it's }; if you like, it's not really needed as you cant heal a unit if its not injured anyway.

astral tendon
#

undefined variable in expression _thiseventhandler

indigo snow
#

awh shame

#

seems it doesnt support it in handeHeal yet

astral tendon
#

texen you mean this?

#

if (_startDamage > 0) then {
waitUntil {damage _injured != _startDamage};

#

what i should remove?

hollow lantern
#

is there a simple way to change the side of the demining drone?

indigo snow
#

oh wait ofc its not defined, theres a spawn in the EH

hollow lantern
#

nvm did the misison.sqm workaround and just changed Civ to WEST

subtle ore
#

@indigo snow pass the vars

indigo snow
#

how

subtle ore
#

Spawn takes the vars, [_coolCookieVaf] spawn {}; . it'll pass everything into an array of vars

#

@cptnnick#7051

indigo snow
#

ok thanks

subtle ore
#

Yeah

indigo snow
#

Yeah

subtle ore
#

Yep

#

Damn, you're no fun :(

scenic shard
#

aah, thx. Learned something new! this should work then @astral tendon

if (isServer) then { [[this,"PRONE_INJURED_U1"],BIS_fnc_ambientAnim] remoteExec ["call"] };
0 = this addEventHandler ["HandleHeal", {

    [_this select 0, _this select 1, _thisEventHandler] spawn {    
        params ["_injured","_healer", "_EH_Handle"];
        _startDamage = damage _injured;
        waitUntil {damage _injured != _startDamage};
        if (damage _injured < 0.2) then {
            //add "get up" anim?
            _injured call BIS_fnc_ambientAnim__terminate;
            _injured removeEventHandler ["HandleHeal", _EH_Handle];
        };
    };
}];```
indigo snow
#

_this pushBack _thisEventHandler; _this spawn ... or (_this + [_thisEventHandler]) spawn ... but thats largely a style thing

#

Saves you typing out all those select's

little eagle
#

Why not remove the eh immediately?

#

This could loop forever if the scheduler suspends at the wrong time?

wooden tinsel
#

For reference of the above, side group x is considered a workaround, but doesn't always return properly.

jade abyss
#

@hasty violet

_side = side group _AI;```
indigo snow
#

If its too long ago, you might have to setVar the side at mission start

slender halo
#

iirc ia become civilan on death

#

so what cptnnick said

indigo snow
#

Did you read my earlier ping, zgmrvn?

#

We solved the export thing i think

slender halo
#

i checked but not tested

slender halo
#

but last time it turned out to be an issue with how TB reads data

#

will test it

scenic shard
#

@indigo snow neat, yea that looks better.
@little eagle that makes sense, also if the player is shot during the healing animation or interrupted some other way we are still potentially stuck in the loop until the unit is healed.

maybe the best would be to add a timeout condition to the waitUntil as well and just re-add the eh and break if it takes too long

tough abyss
#

looks pretty much like your initial finding to invert the pitch bank values @slender halo

#

which turned out to only work in certain rotation combinations

young current
#

TB import needs overhaul.

abstract shuttle
#

Good evening at all! You might know the Arma-internal spectator camera... We got the problem that players are able to control the AI player they are currently spectating after they pressed the spacebutton or the enterbutton on the numblock... Does anyone know how to disable this? πŸ˜ƒ

queen cargo
#

in case anybody ever brings up SQF is inconsistent ... i will directly send you over to create a simple window with JavaFX where you got a menubar with a simple quit item and a button in the middle ...

#

getChildren() getItems() getMenus()

#

those are the ones you will need then

#

all doing the same

#

but different for each control

austere granite
#

Arma is very consistent there

#

Because it doesn't have a command like that all together

#

Outside of config lookups there isn't a way to tell which children a controlgroupsctrl has, so if you use ctrlCreate you'd have to manually keep a list

queen cargo
#

apply vs count those are SQFs inconsistencies

#

inconsistency has nothing to do with that particular feature

little eagle
#

All I want is ARRAY forEach CODE.

royal abyss
#

is there a good sorted kind of wiki for arma 3 scripters ?

#

thats the best so far right?

subtle ore
#

@royal abyss Yeah...? What exactly are you looking for?

royal abyss
#

i just want to sneak and sniff around what could be done in arma πŸ˜„

#

and im always searching for "the best" performance

#

also suuuper interesting

royal abyss
#

@subtle ore is there a "attachTo" where it doesnt act frozen?

subtle ore
#

@royal abyss No, it's disabled collision and "acts frozen" otherwise you'd be running around with a piece of collision material bound to induce lag

royal abyss
#

hmm...

#

so there is nothing like a "joint"

#

hmmmm

subtle ore
#

well you can attach it to a player's memory point

#

like "spine3"

royal abyss
#

yeah i saw that with killzone kids ragdoll he did that to add weight to the spine

subtle ore
#

yeah, artifically setting physical properties, then setting mass, deleting, allowing for player to slop over

royal abyss
#

but for vehicles?

subtle ore
#

attachTo with vehicles you mean?

#

if you are attempting ViV , then it's already been a thing since Apex of last year

royal abyss
#

yeah but with a joint function

subtle ore
#

You aren't really going to achieve something like that in arma's current state.

#

Sure why not

royal abyss
#

sadly we cant play around to much πŸ˜„

#

because even if we would start to work with extensions /dlls battleeye would punch us in the nuts πŸ˜„

#

as soon as it goes clientside

royal abyss
#

is it possible to get DayZΒ΄s car shifting into A3?

queen cargo
#

Car shifting?

royal abyss
#

yeah

#

in DayZ Standalone its a thing

little eagle
#

yeah i saw that with killzone kids ragdoll he did that to add weight to the spine
No, that is not at all what happened in that script.

queen cargo
#

What you mean by car shifting? @royal abyss

little eagle
#

Gear stick?!

queen cargo
#

Response to me @little eagle?

little eagle
#

Yee, I have the same question.

queen cargo
#

And if yes, Dayz utilizes manual gear shifting?

little eagle
#

I really really doubt that.

queen cargo
#

Looks like it is a thing

#

Personally never got far enough to get a vehicle together

little eagle
#

You can't get this in A3 then. Question answered.

queen cargo
#

You can with limitspeed

little eagle
#

That's very different.

queen cargo
#

He asked if it is possible

#

It is

royal abyss
#

interesting

little eagle
#

No it's not.

queen cargo
#

Never said it would be nice

royal abyss
#

like ace speed limiter?

little eagle
#

limiting the speed is totally different from shifting gears.

queen cargo
#

I know
But it is the best way to reassemble the behavior

royal abyss
#

setvelocity maybe?

little eagle
#

That's horribly off though.

#

No, it's not possible to do in A3.

queen cargo
#

If one also would make smart usage of setvelocity it could get better...
But in any case
Nothing for rookies

little eagle
#

You can't pull this off.

royal abyss
little eagle
#

That is not at all how shifting gears works.

queen cargo
#

Would now say gonna prove you wrong.. But tbh... Not that bored

royal abyss
#

guys chill πŸ˜ƒ

little eagle
#

You could do a hackjob and call it "shifting gears", but it wouldn't be what you advertise it as

#

Why is it so difficult for people to accept that some things are impossible?

#

It's not possible period.

queen cargo
#

Obviously it would not
Question was to archive the effects of it in arma

little eagle
#

Missing API.

#

You can't get the effects in A3 with SQF without major changes to the engine and API.

#

Back to this:

#

yeah i saw that with killzone kids ragdoll he did that to add weight to the spine

queen cargo
#

And unless the velocity script commands and limit speed is not working, it would be possible

little eagle
#

This is completely wrong.

royal abyss
#

commy2 i only sayed that he used it to ad weight to the spine but not that it is how his script works but it was about something completly diffrent read up everything to be clear πŸ˜ƒ

little eagle
#

attachTo doesn't "add weight". I fact, the attached objects physics are completely ignored.

#

The point of attachTo was to move the collider dummy object into the players body.

royal abyss
#

yeah but u can set mass to it

little eagle
#

If you attach an object, it has no mass dude.

#

And people don't have mass in Arma anyway. They're not part of the physX simulation. Well I guess ragdolls have internal masses, but that is completely different and not possible to influence with attachTo.

#

attachTo is there to have an object collide with the player. That's it. Adding mass to the spine is false information.

royal abyss
#
    if (vehicle player != player) exitWith {};
    private "_rag";
    _rag = "Land_Can_V3_F" createVehicleLocal [0,0,0];
    _rag setMass 1e10;
    _rag attachTo [player, [0,0,0], "Spine3"];
    _rag setVelocity [0,0,6];
    player allowDamage false;
    detach _rag;
    0 = _rag spawn {
        deleteVehicle _this;
        player allowDamage true;
    };```
little eagle
#

spine is just a selection at the very center of the model.

#

Yes, the object is attached there to collide with the player. Your interpretation is completely wrong.

#

I know this script and btw, it doesn't work (reliably).

royal abyss
#

it does for me o.O

little eagle
#

Try it in MP.

royal abyss
#

i do

little eagle
#

Try it while moving

royal abyss
#

thats because player addEventHandler ["AnimStateChanged", { if (_this select 1 == "incapacitated") then { player allowDamage false; player setPosWorld getPosWorld player; player allowDamage true; }; }];

little eagle
#

No, it's because the collision detection doesn't pick it up.

#

That's how the script works. You create a fast moving object inside the player and make it collide with them.

#

Nothing about adding mass to the spine. You could replace this attachTo with setPosX.

#

And the collision detection is very unreliable in MP or when moving and it doesn't even work all the time while just standing.

#

See: > it doesn't work (reliably).

#

emphasis: reliable

#

Unreliable scripts are worthless.

royal abyss
#

Anyone know how to spawn stuff only clientside ?

#

but if its a vehicle and the player enter the vehicle what happens?

#

do the people clientside drive in a car but serverside sit in a invisible car ?

little eagle
#

Yes.

royal abyss
#

lets say i let spawn weapons local if they are in a radius of 50-100 meters and despawn after leaving that would make performance on the server better or?

simple solstice
#

if you are trying to fix performance then that isn't the main issue

royal abyss
#

but it does improve or?

little eagle
#

Rather have worse performance on the server than the clients...

simple solstice
#

yup!

little eagle
#

but it does improve or?
Iron.

still forum
#

Cookie!

royal abyss
#

but normal weapons are server wide in render distance or?

little eagle
#

That made no sense.

simple solstice
#

again.. weapons are not the issue you are having with performance

royal abyss
#

its just if 100 poeple runn around and 1000 items getting spawned because they are in towns and thats worse for the server and every single person why not let the weapons and loot spawn only on close distance clientside

little eagle
#

Well, you don't know how many weapons there are

royal abyss
#

we dont have any performance issius atm one of our users has a GTX 1080 and I7 and has 60-70 fps on the server

little eagle
#

You'll not solve this by offloading the work to the clients.

royal abyss
#

even i have 30-40 fps with a AMD fx 8350 and a HD 7850 (both 5 years old)

simple solstice
#

so

#

what are you trying to fix

royal abyss
#

not to fix but to improve

simple solstice
#

well offloading to clients won't improve

royal abyss
#

maybe it does because Singleplayer performance is always better then multiplayer so then less the server has to handle then more it will improve on the client side cant realy describe that

little eagle
#

than*

royal abyss
#

delete it on players disconnect / death /

#

or it gets deleted anyway because nobody is close to it

little eagle
#

This sounds like a good idea if you want to have it optimized to me.

still forum
#

only spawning loot locally could be good though.. A player will only know about his loot.. not the stuff in next town

#

That openLoot solution sounds way better

little eagle
#

Simple objects should be even smoother though.

#

Don't need to create them on the fly.

royal abyss
#

hmh

little eagle
#

Yep.

royal abyss
#

but i was making a deathmatch once and got very bad performance from placing a "few" ammoboxes

#

but there was nothing else

#

just a empty map ammoboxes and the playerspawns

indigo snow
#

yea not the ammo boxes

royal abyss
#

but it was even in the editor realy bad

indigo snow
#

but that wasnt being caused by some ammo boxes

royal abyss
#

it was like ~40-50 ammo boxxes filled with all weapons

#

and clothing

indigo snow
#

the amount of contents dont matter

royal abyss
#

hmm...

indigo snow
#

and 40-50 boxes is less bad for server resources than that many players / ai

peak plover
#

~40-50 ammo boxxes
Whoa

indigo snow
#

theyre just a pretty simple object, some simulation and an inventory

royal abyss
#

there was no scripts or ai at this point and i was the only player

indigo snow
#

lol you can choose not to accept what were saying

#

but its not caused by the ammo boxes

royal abyss
#

fps gone from 50+ to 2-5 in editor ? πŸ˜„

#

good question.... <_<

#

few months

peak plover
#

Something is probably wrong

#

Oh yeah, fuck that bug

royal abyss
#

it was x64 but also got other problems like naked trees on tanoa

indigo snow
#

have you considered your pc / arma install is fucked? πŸ˜›

peak plover
#

cma_x64 is actually faster than default allocator πŸ˜„

still forum
#

3 fps and naked trees and low quality models is 3FPS bug

#

which still isn't fixed btw.

peak plover
#

That's a mem leak, right?

still forum
#

no it's not really a mem leak.

#

And yeah x64 kinda burried it

peak plover
#

I've got 8gigs of ram, it uses all of it. It sucks

still forum
#

3fps bug is Arma's "memory emergency mode"

#

like.. Oh god I'm out of memory! Leave the ship! Throw everything out we can!
So it switches to extremly low poly models and textures... But still doesn't clear any Ram like it really should

peak plover
#

does fluysh not work?

#

flush

#

64 bit rapes ram

still forum
#

BI focused on fixing the cause for the memory emergency event. Instead of just fixing the memory emergency mode.. It should throw everything out of Ram. Then it will have enough free memory again and slowly load stuff back

#

instead.. It says "Throw everything out!" And the guy responsible for throwing stuff out is just laying in his chair and sleeping

peak plover
#

Can you edit a bit in the .exe to fix that ? πŸ˜„

still forum
#

no

peak plover
#

That's why πŸ˜„

still forum
#

Never took a look at how that part works

royal abyss
#

is there something to get "around" triggers

still forum
#

eventhandlers

#

depends on what your triggers do

peak plover
#

Any scripting tricks to fix frames/ram?

still forum
#

no

peak plover
#

they got view distance commmand

#

But I wish they had scenecomplexcity

royal abyss
#

also something to handle players renderdistance

peak plover
#

setobjetviewdistance [OBJECT,SHADOW]

royal abyss
#

because if someone 20-40 km farts every player "sees" that

inland condor
#

Hello, I want to edit function of the spectator button (on the new respawn screen) can you point me to the right direction ? I suppose it would be tha same as editing functions of menu buttons, but did not find anything on that either.

peak plover
#

ui_f.pbo

inland condor
#

Something more, scripting for dummies level ?

peak plover
#

you might find the respawn menu in there

#

Not sure...

#

I'd start by looking for it in the game files

queen cargo
#

@inland condor depends on what you mean by "edit"

still forum
#

That button is probably a config eventhandler.. you won't do much on that via scripting

little eagle
#

hide the button, replace with your own.

astral tendon
#

Acts_UnconsciousStandUp_part1

#

how do i make a unit play this animation?

#

he does not move afther the animation finished

cold pebble
#

Do the same thing, but with "" instead of your previous animation

#

That'll fix ya

tough abyss
#

Is there a way to check for the existence of a script in a defined location and if it's not there shut down the server?

subtle ore
#

@tough abyss commands like execVM and spawn return script handlers, which you can use commands like scriptDone with and i believe you can check if it is running

astral tendon
#

civ_1 setFormDir (civ_1 getDir player);

#

this command makes the unit look at the player

#

but what about if there is 2 players?

tough abyss
#

@subtle ore how would I specify a script

subtle ore
#

@tough abyss filter it.

{
If(_x select 0 == "cookieHandler") then {
//Code
};
} forEach diag_activeSQFScripts;
#

@astral tendon in sp, the player is only the unit where you have selected as player, in mp it's any player that is local when executing the script

astral tendon
#

in this case

little oxide
subtle ore
#

@little oxide absolutely no point. Diag_activeSQFScripts already returns the script name

#

scriptName:Β StringΒ - function or filename. Custom name can be set withΒ scriptName

#

scriptName would be for readability if anything in this case.

little oxide
#

No dude, it returns something like this : [["<spawn>","",true,1]] when you spawning a script

#

Pls read the wiki before tell me something πŸ’©

subtle ore
#

Hey, chill out

#

I must be mistaken

astral tendon
#

if (isServer) then { [[this, selectRandom ["PRONE_INJURED_U1", "SIT_LOW_U", "PRONE_INJURED"],"ASIS"],BIS_fnc_ambientAnim] remoteExec ["call"] };
0 = this addEventHandler ["HandleHeal", {

[_this select 0, _this select 1, _thisEventHandler] spawn {     
    params ["_injured","_healer", "_EH_Handle"]; 
    _startDamage = damage _injured; 
    waitUntil {damage _injured != _startDamage}; 
    if (damage _injured < 0.2) then {
        _injured switchMove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon";

Sleep 1;
_injured call BIS_fnc_ambientAnim__terminate;
Sleep 1;
_injured setFormDir (_injured getDir player);
Sleep 2;
_injured switchMove "Acts_CivilTalking_2";
Sleep 4;
_injured call BIS_fnc_ambientAnim__terminate;
_injured removeEventHandler ["HandleHeal", _EH_Handle];
};
};
}];

#

the civilian will turn around and talk to the player

subtle ore
#

Roque please use the formatting with discord

deft zealot
#

Use code tags pls

astral tendon
#

how?

tough abyss
#

Wait sow how am I doing this?

subtle ore
#

Back ticks

deft zealot
#

` not '

subtle ore
#

Not quotes

astral tendon
#
0 = this addEventHandler ["HandleHeal", { 
 
    [_this select 0, _this select 1, _thisEventHandler] spawn {     
        params ["_injured","_healer", "_EH_Handle"]; 
        _startDamage = damage _injured; 
        waitUntil {damage _injured != _startDamage}; 
        if (damage _injured < 0.2) then {
            _injured switchMove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon";
Sleep 1;
            _injured call BIS_fnc_ambientAnim__terminate; 
Sleep 1;
_injured setFormDir (_injured getDir player);
Sleep 2;
            _injured switchMove "Acts_CivilTalking_2";
Sleep 4;
            _injured call BIS_fnc_ambientAnim__terminate; 
            _injured removeEventHandler ["HandleHeal", _EH_Handle]; 
        }; 
    }; 
}];```
subtle ore
#

You can also syntax highlight it

little oxide
#

@tough abyss You want only need to find if the script exist inside a location ?

tough abyss
#

Yes

subtle ore
#
Hint "works!";
astral tendon
#

is this case, the civilian will turn around to the player that triggered the addEventHandler ?

little oxide
subtle ore
#

HealSoldier action will move the player to the injured, so you can use that instead

astral tendon
#

i want to make this a little cinematic

#

the player heals the civilian, gets up, and thank him

tough abyss
#

How would it work on a dedicated?

astral tendon
#

and in some cases he will give a piece of info

subtle ore
#

@tough abyss you don't. Kk's method is based on creating controls, which has to have a display to make them on and a dedicated server has none

#

Including hc's

#

@astral tendon so what's the issue?

astral tendon
#

nothing really, i just wanna know how that works.

#

the code it self works

indigo snow
#

Instead of player use _healer

subtle ore
#

Okay, well. From what it looks like. The script checks if it's running on server, remotely executes the unconcious anim so that all players can see it. Then adds an event handler to execute code when the unit is healed. Checks to make sure the unit is above 0.2 in damage or it waits until. Hence the spawn.

#

Then moves the unit to the upright position, sleeps, looks at the player (setFormDir) and plays the civ talking anim

indigo snow
#

_injured setFormDir (_injured getDir _healer)

subtle ore
#

Yeah healer will be more accurate

#

And will allow for mp compatibility

#

Because it doesn't look like this is executed local to the player

indigo snow
#

Its where the injured is local

#

Which would be server

subtle ore
#

Right, exactly.

astral tendon
#

good call, that works

slim verge
#

writing code to return every magazine on a unit.... how do i return the current magazine loaded into a secondary weapon if it isnt the current weapon ?

indigo snow
#

Check their weaponItems? You can add magazines with that, maybe get them too.

#

primaryWeaponItems and its variants

subtle ore
#

Well primaryWeaponMagazine, and secondaryWeapon variants are good too

still forum
subtle ore
#

😱

#

How dare you dedmen

#

Guesses?

still forum
#

I don't know.. It just came over me

subtle ore
#

Woah

indigo snow
#

Divine scriptervention

subtle ore
#

Hah πŸ˜‚

slim verge
#

thx for the feedback, i'll use weaponsitems, can grabn all muzzles from primary with that too, thx again

subtle ore
#

Also works fairly well

slim verge
#

why cant they just have an Allitems unit, Allmagazines unit etc instead of having top piece it all together

still forum
#

Yeah.. I wonder why we can't just have that

subtle ore
#

Well yes. "Medkit" in (items player)

slim verge
#

that doesnt do it all, stop being clever πŸ˜ƒ

still forum
#

Well these don't seem to return magazine

subtle ore
#

Waddya got these things bookmarked?

still forum
#

I can press CTRL+F

subtle ore
#

weaponSrate does πŸ˜‰

slim verge
#

there are a lot of ways to return the equipment a unit has but none of them do it well and completely

subtle ore
#

Hey that's cheating! @still forum

#

@slim verge You're either in it for one or get the lacking of another. 🀷

slim verge
#

weaponitems is not that good, instead of adding the second muzzle mag into the mag array (select 4) it adds another array as select 5, screwing things up from being nice n tidy, f****** BIS

#

and weaponstate doesnt cycle through all the possible muzzles, they have to be defined for each muzzle,

#

so you have to cycle through all the subarrays for weaponitems checking if the sub element is an array to catch all of them

austere granite
#

: there are a lot of ways to return the equipment a unit has but none of them do it well and completely

#

that 😦

still forum
#

getUnitLoadout contains everything

slim verge
#

thats true but its not final therefore not to be rel;ied on yet

#

i did look at that then decided against

still forum
#

It is in that exact same non final state since it was added

slim verge
#

i havent checked it but, if u were to add a weapoon to the backjpack, how would that return it, doesnt state it in the wiki

#

just another inconsistency to code in and there is also an issue using ACRE, TFAR objects

jade abyss
#

how would that return it, doesnt state it in the wiki
diag_log it? Use the .rpt + setUnitLoadout to put it in? No clue where the Prob is

tough abyss
#

Really a shame setunitloadout etc doesn't work on vehicles/containers

jade abyss
#

Yep

#

*coughremovingSingleItemsFromAVehicle/Containercough*

tough abyss
#

Haven't seen you in a while, @jade abyss. How have you been?

jade abyss
#

scratching my butt most of the time.

#

digging for some oil (nose)

tough abyss
#

πŸ‘ πŸ˜‚

queen cargo
#

You missed a lot of good stuff @jade abyss

wooden tinsel
#

πŸ€”

jade abyss
#

If it's about Arma and scripting, i doubt it πŸ˜‚

astral tendon
#

removing map objects that will not be part of the mission does increse perfomacy?

tough abyss
jade abyss
#

Yeah

tough abyss
#

you could have a fake unit taking the item from the cargo

#

or even a logic

jade abyss
#

Yep

#

But:
Another Unit/logic is there
not directly
Anim is used

tough abyss
#

not sure what you mean ^^

jade abyss
#

I assume you talk about the singleItem removal from a Veh/Container?

tough abyss
#

yes

jade abyss
#

As i mentioned before: Another Unit/Logic is needed (or needs to be created), blablabla, long story short: Just another Workaround (again)

tough abyss
#

yea, like usual arma scripting πŸ˜„

jade abyss
#

^^

inland condor
#

this is nice...

#

how does that even happen ?

subtle ore
#

Β―_(ツ)_/Β―

inland condor
#

like is the assignment one way...

#

I am just amazed right now...

#

I am waiting for arma to give me if(1=2)=false;if(2=1)=ture

warm gorge
#

Is it possible to check if a unit has fully unholstered a gun? Say for example you have a pistol out, then you switch to a primary weapon but I want to be able to detect if theyve fully switched to the new weapon

timber ridge
rancid ruin
#

what's a good way to get an AI unit to stay inside a building, at a window, facing outside?

timber ridge
#

@tough abyss it'd be actually nice to have some AI specific scrpt commands like searchForClosestWindow, closestDoor, etc. to which you could listen and then provide specific behavior or animations for the AI simulate after he found "it"

timber ridge
#

@tough abyss hahha, well, there was some refactoring for the AI, namely the driving, but that brought in new problems we haven't seen before and still yet to be fixed
in some cases, driving in OFP (a 2001 game...) is better than in A3, espeically when it comes to convoys and vehicles following each other

#

some say OFP's AI was "too simple", "too inflexible" etc. but who gives a shit when it works as expected and provides you with good results? f.e., simply arrives at a waypoint when being issued one as a convoy... πŸ˜„

little eagle
#

@inland condor

how does that even happen ?
You made the mistake thinking that vehicle var names are unique. Multiple objects can have the vehicle var name "master_5", but the global variable master_5 can only refer to one object. The editor name field sets the vehicle var name and the global variable. But during gameplay, more objects can take the same vehicle var name and the object assigned to the global variable with the identifier being equivalent to the vehicle var name can change. One example is simply respawning. Both corpse and new body hare the same vehicle var name, but the variable can only refer to one of them.

getAssignedCuratorLogic getAssignedCuratorUnit master_5_zeus

This ^ for example will report master_5_zeus correctly, because you don't lose information by relying on vehicle var names.

fluid radish
#

I'm trying to creat Zeus modules via script - I have an array of player UIDs and am creating a module for each one, with the module's owner parameter set via setVariable. It seems to work "sometimes" - it worked the first few times but it appears I've just broken something. Can someone take a look? https://gist.github.com/anonymous/ee1b4a3143058bd842070feae9559b2f

#

The modules appear to have been created based on the .rpt file, but I can't enter Zeus anymore

simple solstice
#

I guess placing eden logics is not a solution for you?

#

manually and setting their owner

fluid radish
#

I was hoping to automate zeus setup for all of my unit's missions via script, rather than updating the modules manually for each mission

simple solstice
#

the only possible solution I can think of is adding JIP to setVariables

#

but it's just a wild guess

fluid radish
#

Changed line 47 to: _curatorModule setVariable["owner", _x, true];

#

Still not able to enter Zeus

#

I guess one thing i left out is that there are a bunch of "No speaker given for" messages between my diag_log calls

#

I always ignored those errors whenever they came up tho, not sure if they matter now

cunning nebula
#

@AGENT_STEELMEAT#4476 i prefer spawning curators directly instead of using the module

cunning nebula
#

just good old createVehicle

#

with "curator_f"

#
zeusuids = [000, 000, 000, ....];

addZeusEH = addMissionEventHandler ["PlayerConnected", {
    params ["_id","_uid","_name","_jip","_owner"];
    private ["_cur"];
    if !(_uid in zeusuids) exitWith {};
    waitUntil {
        sleep 1;
        ({_uid isEqualTo getPlayerUID _x} count allPlayers) > 0
    };

    _player = allPlayers select {_uid isEqualTo getPlayerUID _x};
    _cur = "curator_f" createVehicle [0,0,0];
    _cur addCuratorAddons activatedAddons;
    _player assignCurator _cur;
    _cur addCuratorEditableObjects [allMissionObjects "all",false];
    _player setVariable ["cur",_cur,true];

}];
removeZeusEH = addMissionEventHandler ["HandleDisconnect", {
    params ["_unit","_id","_uid","_name"];
    deleteVehicle (_unit getVariable ["cur",objNull];)
}];
#

yup, much easier to work with the curator object directly

little eagle
#

I'll make a gist out of this and I will not credit you.

cunning nebula
#

if that pleases you, go ahead

queen cargo
#

@cunning nebula use
```sqf
...
```
next time for proper highlighting πŸ˜ƒ

cunning nebula
#

uuuh, fancy

queen cargo
#

if you think thats fancy, wait until sqf-vm gets support for those commands you just used there @cunning nebula

halcyon crypt
#

hehe can't wait to run ALiVE in sqf-vm 😜

queen cargo
#

callExtension is what i want to implement next
soooo ... thats gonna work actually

#

right now i have to do actual job related stuff

#

afterwards i implement the callExtension stuff

halcyon crypt
#

in case it's somewhat a reply to me, ALiVE only uses extensions to communicate with our server which isn't mandatory ^^

queen cargo
#

it was @halcyon crypt

#

and in any case, you always can raise github issues for things next to implement
otherwise i will just do it "nach gutdΓΌnken"

tough abyss
#

When I use helicopter1 action ["lightOn", helicopter1]; to turn an AI helicopter lights on, they turn on and then immediatly turn off, is there a way to keep them on?

halcyon crypt
#

AI needs to be in CARELESS, SAFE or AWARE (not sure about this one) mode to keep their lights on

tough abyss
#

He is on safe right now, I'll try aware

halcyon crypt
#

for ground vehicles anyway

#

that probably forces it

tough abyss
#

aware won't work

#

setPilotLight is only for ground vehicles? .-. it says pilot

halcyon crypt
#

no the ground vehicles comment and the link aren't related to each other πŸ˜„

tough abyss
#

isLightOn helicopter1; in the watch field returns true although there are no lights .-.

#

oh nvm now it returns false

little eagle
#

Fixed: Mine Detector could be placed in the launcher slot

#

Now I'm sad.

peak plover
#

😦

astral tendon
#

the IA dont wanna cross my bridge, is there a way to fix it?

subtle ore
#

Quiksilver and SuicideKing could tell you all about it Roque πŸ˜‰

astral tendon
#

Rip

#

alternatively, is there a way to make IA ignore objects?

subtle ore
#

FSMS

astral tendon
#

so this disableAI "FSM";?

#

dont really work

#

the AI still wanna dodge the object

subtle ore
#

🀦

#

Make a FSM class.

little eagle
#

And how is that supposed to help?

subtle ore
#

It really doesn't

#

but I guess that's really the only way to force their ass over a bridge

astral tendon
#

i imagine how they make on the DLC a buldozer APC drive over a roadblock

subtle ore
#

possible

little eagle
#

that's really the only way to force their ass over a bridge

#

how?

subtle ore
#

Good example is VCOM AI, all FSM scripts.

#

Over bridges

#

move in cars

#

use guns

#

etc

astral tendon
#

OMG

#

I FIND IT

subtle ore
#

?

astral tendon
#

setDriveOnPath makes they ignore anything on the way

subtle ore
#

🀣

astral tendon
#

they just drive foward

#

what is the infantry version of it?

little eagle
#

I think you have some pretty big misconceptions about what a FSM does.

subtle ore
#

Find a Bridge - > Move around it

#

Conditions correct?

little eagle
#

Have you ever opened a FSM from Arma?

subtle ore
#

Yes I have

little eagle
#

How would you implement "move around it" and why does this have to be done in a FSM?

subtle ore
#

doesn't have to be in FSM

#

if it won't go over, then it might as well go around the bridge

little eagle
#

Yes, in fact, the FSM would make it more complicated than it has to be. While offering nothing.

subtle ore
#

Sure.

little eagle
#

Why did you suggest it then?

subtle ore
#

Good question

little eagle
#

πŸ˜ƒ

#

We'll leave it at that πŸ‘Œ

subtle ore
#

πŸ‘Œ

astral tendon
#

then, you guys know the infanrty version of the setDriveOnPath ?

little eagle
#

There's none.

timber ridge
#

@astral tendon @little eagle Play an animation on AI and execute the same anim with a EH AnimDone for X times or while measuring the distance to your destination and terminating the anim loop when distance is less than Y?

#

ofc, this is just for making AI walk straight and ignore any surroundings. that's all you can do with a forced anim. ( I suppose )

cunning nebula
#

How about setVelocity :P. Like those boosters on a pinball machine.

#

or check if any players are looking at the bridge and if not, simply teleport the AI across. πŸ˜ƒ

#

there is an unlimited amount of silly solutions

#

just no proper one

tough abyss
#

BIS_fnc_unitPlay/Capture?

cunning nebula
#

I guess just making them walk straight withing the boundaries of the bridge should be enough. Like Inleso said.

#

hmm maybe if we write a function to force-move a soldier from point a to point b in a straight line

#

perhaps with some interruptions to let them look around or a few other animations mixed in

#

could be good enough

astral tendon
#

how do i get the muzzle name?

little eagle
#

Ingame config viewer.

#

CfgVehicles

#

muzzles[] array. May be located in the turrets/turretX subclass for turret slots.

#

This is better with an example...

#
class CfgVehicles {
    class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
        class Turrets: Turrets {
            class MainTurret: MainTurret {
                weapons[] = {
                    "autocannon_40mm_CTWS",
                    "LMG_M200_body"
                };
class CfgWeapons {
    class autocannon_40mm_CTWS: autocannon_Base_F {
        muzzles[] = {
            "HE",
            "AP"
        };
#

B_APC_Wheeled_01_cannon_F/Turrets/MainTurret -> weapons[] "autocannon_40mm_CTWS" -> CfgWeapons -> muzzles[] "HE"

astral tendon
#

jesus crist, the conig view is a mess

little eagle
#

Yes, but don't complain to me about this.

grizzled spindle
#

Anyone know if the ondisconnectevent fires on loosing connection and alt f4ing?

#

handleDisconnect*

meager granite
#

It triggers for everything, including going back to lobby

grizzled spindle
#

awesome

#

so even client not responding?

meager granite
#

Its server event, it doesn't matter how client left the game, even if they smashed their PC with a hammer

#

If client left, it will fire

grizzled spindle
#

hahaha Okay mate thanks

rotund cypress
#

@grizzled spindle no it will not fire before they leave and no, this will not solve any of your problems.

#

Only thing it's useful for is keeping logs, doing shit that keeps track of players and notifying others when they leave. Not for interacting with their player data etc.

cunning nebula
#

handleDisconnect is more useful for most these things

astral tendon
#

this setskill ["general",0.01];

#

i can put a number bellow 0.1 or even 0 and still counts?

grizzled spindle
#

@rotund cypress Its for removing containers from the house. Using the uid which is passed by the event to query the db to get their containers to delete em

rotund cypress
#

I suppose it's an alright event for that purpose.

meager granite
#

@grizzled spindle HandleDisconnect supposed to handle player unit depending on event returned value, be careful not to get unexpected result like player unit turning into AI

astral tendon
#

is there a command to make a AI turn out?

#

i found it

#

TankOne action ["TurnIn", TankOne];

subtle ore
#

@astral tendon

player action ["TurnOut", vehicle player];

πŸ™„

astral tendon
#

this action ["TurnOut", technogun_1]

#

πŸ€”

subtle ore
#

🀦

astral tendon
#

i just put that on the unit init and works

subtle ore
#

but the unit init? Why?

zenith totem
#

Is it possible to selectively share tasks using the shared objectives system? Or am I going to end up basically re-writing it

astral tendon
#

why not?

winged narwhal
#

Looking for a admin script that can zeus and bans/kicks or even IP bans.

#

Dose anyone know of a script that can do that?

tough abyss
#

@winged narwhal Not that I know of,

#

you can't get the IP of a player.

#

Intercepting IP's would require a DLL

winged narwhal
#

I know theres a script out there th blocks players from rejoining after baning

robust hollow
#

thats called being banned?

#

u can ban a playerid with servercommand if thats the kind of thing ur after.

tough abyss
#

BE handles banning

winged narwhal
#

BE?

little eagle
#

Battle eye. [sic]

winged narwhal
#

ok

tough abyss
#

hmmm

#
    case 0: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\useBlacklist.sqf";};
    case 1: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\custom.sqf";};
    case 2: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\killahpotatoes.sqf";};
    case 3: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf.sqf";};
    case 4: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf_ace.sqf";};
    case 5: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf_ace_acre.sqf";};
    case 6: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\3cbBAF.sqf";};
    default {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\useBlacklist.sqf";};
#

Terrible @little eagle

#

Wouldn't it be easier to just wrap it into 1 function.

#

?

little eagle
#

Yes, that's indeed terrible.

#

Idk, not enough context.

tough abyss
#

diag_log "Initializing arsenal presets [START]";
[] call compileFinal preprocessFileLineNumbers "scripts\client\misc\init_markers.sqf";
switch (KP_liberation_arsenal) do {
    case 0: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\useBlacklist.sqf";};
    case 1: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\custom.sqf";};
    case 2: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\killahpotatoes.sqf";};
    case 3: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf.sqf";};
    case 4: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf_ace.sqf";};
    case 5: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\rhsusaf_ace_acre.sqf";};
    case 6: {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\3cbBAF.sqf";};
    default {[] call compileFinal preprocessFileLineNumbers "arsenal_presets\useBlacklist.sqf";};
};
diag_log "Initializing arsenal presets [END]";

diag_log "Initializing markers and UI manager [START]";
if ( typeOf player == "VirtualSpectator_F" ) exitWith {
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\empty_vehicles_marker.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\fob_markers.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\group_icons.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\hostile_groups.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\sector_manager.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\markers\spot_timer.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\misc\synchronise_vars.sqf";
    [] spawn compileFinal preprocessFileLineNumbers "scripts\client\ui\ui_manager.sqf";
};
#

This is the init_client.sqf

#

Hang on.

#

I'll pastebin it

#

Long ago I did change a function in I&A which was used to generate missions from

#

[] execVM "some mission" to

#

_handle = [] spawn (missionNameSpace getVariable "mission_type")

#

where mission type was defined by GG_fnc_missionName1, etc

#

mission_type = ["GG_fnc_mission1","GG_fnc_mission2"];

#

etc

#

Then just compiled the strings

#

To work as a dynamic script

little eagle
#

At least replace the compileFinal with compile or something.

#

All I see is patterns and a wall of text. At least it uses ofpec tags.

tough abyss
#

I know exactly how to change that easily.

#

["preset name"] select index == preset

#

then just feed that into the compileFinal ProcessFileLineNumbers;

#

This way it only needs to process a single index

#

Not an entire switch

little eagle
#

I agree with this conceptually, but in contrast to other members of this channel, I think that optimizing something so minor like this after the fact is pretty pointless. I guess you can still do it because you want to learn? If so then go ahead and try what works best for you.

tough abyss
#
    preset_choice = ["arsenal_presets\useBlacklist.sqf",
                                     "arsenal_presets\custom.sqf",
                                     "arsenal_presets\killahpotatoes.sqf",
                                     "arsenal_presets\rhsusaf.sqf",
                                     "arsenal_presets\rhsusaf_ace.sqf",
                                     "arsenal_presets\rhsusaf_ace_acre.sqf",
                                     "arsenal_presets\3cbBAF.sqf",
                                     "arsenal_presets\useBlacklist.sqf"];

get_preset = [] call (compileFinal preprocessFileLineNumbers  (preset_choice select KP_liberation_arsenal));
#

No more switch

#

Preset choice is run once

#

@little eagle

#

Now it doesn't have to search through each line

little eagle
#

Yes, the formatting sucks now though. And it should be a local variable. And use compile...

tough abyss
#

Yeah

#

better ?

#

@little eagle formatting sucks because of discord

little eagle
#

No, the formatting sucks, because it does

#
private _preset = [
    "arsenal_presets\useBlacklist.sqf",
    "arsenal_presets\custom.sqf",
    "arsenal_presets\killahpotatoes.sqf",
    "arsenal_presets\rhsusaf.sqf",
    "arsenal_presets\rhsusaf_ace.sqf",
    "arsenal_presets\rhsusaf_ace_acre.sqf",
    "arsenal_presets\3cbBAF.sqf",
    "arsenal_presets\useBlacklist.sqf"
];

[] call compile preprocessFileLineNumbers (_preset select KP_liberation_arsenal);

There. It makes it so much more readable for so little effort.

tough abyss
#

Use a for loop?

little eagle
#

No, that has nothing to do with formatting. Formatting is just how you apply spaces and newlines to your file.

tough abyss
#

Thats what the pastebin had commy

little eagle
#

No, the whitespace is vastly improved and I reduced it somewhat.

tough abyss
#

How much white space should I use at most?

little eagle
#

Uhm, as much as needed and as little as possible?

#

Okay, question. You do see the difference between:

    preset_choice = ["arsenal_presets\useBlacklist.sqf",
                                     "arsenal_presets\custom.sqf",
                                     "arsenal_presets\killahpotatoes.sqf",
                                     "arsenal_presets\rhsusaf.sqf",
                                     "arsenal_presets\rhsusaf_ace.sqf",
                                     "arsenal_presets\rhsusaf_ace_acre.sqf",
                                     "arsenal_presets\3cbBAF.sqf",
                                     "arsenal_presets\useBlacklist.sqf"];

and:

private _preset = [
    "arsenal_presets\useBlacklist.sqf",
    "arsenal_presets\custom.sqf",
    "arsenal_presets\killahpotatoes.sqf",
    "arsenal_presets\rhsusaf.sqf",
    "arsenal_presets\rhsusaf_ace.sqf",
    "arsenal_presets\rhsusaf_ace_acre.sqf",
    "arsenal_presets\3cbBAF.sqf",
    "arsenal_presets\useBlacklist.sqf"
];

Right? And I don't mean the variable name or the private.

#

And which one is nicer to work with?

tough abyss
#

Might have been atoms fault?

little eagle
#

Do you understand what I mean by "formatting"? Because I'm not sure you do or if I can explain it to you any differently.

tough abyss
#

The amount of indentation and alignment also known as style in C?

little eagle
#

Yes. And there is no attempt at aligning in your example.

tough abyss
#

Thought I did ohhh, oops...

#

Out of alignment with the top.

#

Duely noted.

little eagle
#

You're still asleep or something? ^^

tough abyss
#

No. pastebin didn't preserve the tabs...

#

Β―_(ツ)_/Β―

#

Double check next time.

little eagle
#

Tabs are bad.

tough abyss
#

use spaces?

#

I can reconfigure ATOM to use 4 spaces to 1 tab

#

or more

little eagle
#

You can use spaces and it'll align in any program / on github / in any chat and for every user.

#

Until the day comes everyone can agree with one tab size: spaces > tabs.

tough abyss
#

How many spaces?

little eagle
#

For SQF? 4

#

It depends on the langue and how many indentation layers you can expect.

tough abyss
#

Alright tab-width set to 4

#

Default was 2

#

Nearly isolated the error

little eagle
#

Now also make it auto replace them with 4 spaces.

tough abyss
#

Tab width == 4 spaces

#

Error has been isolated to 5 script calls

little eagle
#

In ST3 it's called "Indent using Spaces" and it replaces any key press of Tab with 4 spaces instead of the tab char.

tough abyss
#

yeah thats what it is set to

#

Tab Length: Number of spaces used to represent a tab

#

4

#

Default 2

still forum
#

@tough abyss That script looks like some idiot got told that call compile preprocessFileLineNumbers is better than execVM... And then he heard elsewhere that compileFinal is more secure.. So that asshat of an Idiot assumend combining them both and replacing all his execVM's would make his scripts better

little eagle
#

Agreed ^.

tough abyss
#

VBS recommends using call compile preprocessfilelinenumbers over execVM

#

Officially isolated the error to 1 file

little eagle
#
yeah thats what it is set to
Tab Length: Number of spaces used to represent a tab
4
Default 2

That is not what I'm talking about.

#

There's a difference between how long your editor makes a tab and if it replaces the character entirely.

still forum
#

exactly.. So why are you using compileFinal if it tells you to use compile?

#

Also.. Instead of all that crap... use CfgFunctions for all your functions.. and just call the function.

tough abyss
#

Not my code @still forum this is a popular mission.

#

I am free to re-write it if I want to though.

#

It's MIT Licensed

#

Somewhere in here is the error

still forum
#

re-write it properly then.. If you already start with it

#

Btw in this case.. If the script is called once.. ExecVM is just fine

#

What is the error?

#

I just read all messages again I cannot find a mention of an error

tough abyss
#

Nope I've found the actual file

#

Thats causing it

#

Bad conversion: bool

#

Over and over

little eagle
#

I know what it is.

#
    "
       if ( isText( _x >> 'Item' ) ) then {
           _virtualItems pushback _configName;
       };
   " configClasses _this;
#

This reports the array index from pushBack, but configClasses expects a boolean.

tough abyss
#

This is why rengineering the wheel can be a good thing..

little eagle
#
{
    if ( isText ( _x >> 'Item' ) ) then {
        _virtualItems pushback _configName;
    };
} forEach ("true" configClasses _this);

This is the proper way. I guess they're trying to save looping through the array once... But they're probably wasting more time with the write to file operation of the error than they save...

#

_virtualItems append ("isText (_x >> 'Item')" configClasses _this);

There. Perfect, no error and faster.

tough abyss
#

replace _fnc_linkedItems with that?

#

in it's body?

little eagle
#

No, replace what I posted from the code with what I posted last.

#

And do the same for the other loop. Can't be arsed to do it myself.

peak plover
#

Any way to stop lights from flickering?

#

As in, I want 100 lights, but only 10 emit light at a time

little eagle
#

2 letters

peak plover
#

;'(

#

I don't think lights cause any performance issues, because they don't even cast shadows

#

lighjts flicker like crazy 😦

tough abyss
#

@little eagle This stuff is alien to me never worked with traversing configFiles

little eagle
#

My favourites. : )

tough abyss
#

I mean I know they're a tree data structure

#

Just never had to work with them.

#

They look kind of messy.

little eagle
#

And the scripting around them is full of pitfalls. Could write a short book about all the quirks and issues.

cunning nebula
#

@peak plover I think lights have a hardcoded limit or something

#

but I don't think you'd normally need 100 of them

peak plover
#

They flicker in normal towns, ultra should have no limit, it should be ULTRA

queen cargo
#

@little eagle talking about configs and shitty interactions some commands have?

#

eg. that select cannot get inherited properties?

#

just like count wont count inherited

still forum
#

If you know how the backend works then that behaviour is logical.

#

a config class has a list of entries and a pointer to it's parent..

#

ofcause count only goes through list of entries. and ofcause select does the same

queen cargo
#

thing is more: there is no special command to get the count including hirarchy

#

and i also just wanted to give some examples πŸ˜„

quartz coyote
#

Hello does anyone know if this works for a synched timer solution ?

TimeServer < Param select 0

#

Or TimeServer < 10000 what ever lol

queen cargo
quartz coyote
#

The Biki isn't clear on how TimeServer works

still forum
#

Never heard of TimeServer

tame portal
#

@quartz coyote did you mean serverTime?

still forum
#

and Param select 0 is also not really correct syntax

tame portal
#

@quartz coyote serverTime returns the amount of seconds since the server application started and loaded everything necessary to run

#

It doesn't reset when the server changes the missionfile that is being played

quartz coyote
#

Yes sorry for the syntax I'm at work @compact current @still forum .

#

Ok so it can't be used like this.

#

I'm actually using time < (match duration time chosen by admin)

#

But at the end on mission, some players have 15s ahead or late from others

#

I'm trying to synch all this

still forum
#

You can store the serverTime at missionStart from serverside and pvar it to the clients I guess

#

but the serverTime wiki page says there might be problems with that

#

Or..

#

you just run the script on the server instead of the clients

#

the server only has one clock

quartz coyote
#

Mmmh... I've put a while {time < 10000} do {
sleep 1;
};
In the initServer.sqf.
If I but and [] execVM "outro.sqf" after that will it executives the Outro for all players at the same time or is execVM only for local execution ?

robust hollow
#

local

#

its the same as call or spawn

#

you can remoteexec the execvm

quartz coyote
#

Could you give me the syntax ? No trace of it on the BIKI

#

I mean to remoteexec a execvm

robust hollow
#

"outro.sqf" remoteexec ['execvm',-2]

quartz coyote
#

Awesome ! Thanks a lot

still forum
#
while {time < 10000} do { sleep 1; }; 

I don't think I ever saw a piece of code that brain-limited

sleep 10000;

Your script runs right at missionStart anyway.

quartz coyote
#

I put 10000 as an example dude. I'm at work and on my phone I don't have all the data in mind. No brain limited in here. Only no can't do situation. Bye.

still forum
#

the 10000 has nothing to do with this. And you seem to have known that sleep takes the number of seconds to wait.. As you just wrote that in your code.

queen cargo
#
private _tmp = 10000 - time;
if(_tmp > 0) then { sleep _tmp; };
still forum
#

why _tmp? Also you don't need >0 check. sleep ignores <=0

quartz coyote
#

In my situation, I replace 10000 by a user or admin chosen data. Selected from the user params at mission lobby.

still forum
#

Doesn't change what I said. As I said. the 10000 is not the problem

cold pebble
#

He's saying, a while loop to check time and then sleep is stoopid

#

Which; it kinda is

quartz coyote
#

So you suggest I but a
Sleep (user defined time);

still forum
#

exactly

queen cargo
#

was not sure about that @still forum
thats why πŸ˜„

quartz coyote
#

That would delete a loop I understand

queen cargo
#

could also have resulted in script warning stuff like sleep -1

#

never used negative values in there ...

still forum
#

You know how long you have to sleep for.. When you go to bed at night. you set your alarm clock to wake you up in 8 hours...
Setting your alarm clock to wake you up in 5 minutes so you can check the clock.. notice it's not time yet.. and then go to sleep to be woken up again in 5 minutes and repeat that till the 8 hours are over.
That's just idiotic.

queen cargo
#

sleep (MY_SPECIAL_VALUE - time)