#arma3_scripting

1 messages · Page 291 of 1

shadow sapphire
#

Is that it? Haha, I was just throwing up a guess so that you guys knew kinda what my goal is.

little eagle
#

units requires ONE group and not an array of groups

shadow sapphire
#

I didn't think that my guess example would be even close to right.

little eagle
#

It's not

shadow sapphire
#

Oh! Well, you guys jumped on saying I needed just brackets! Haha

peak plover
#

Is there a better alternative to find? CONTEXT:

if ((typeOf _unit) find "AR") then {_unit superessFor (random 10)};
shadow sapphire
#

Anyway, I see your example @little eagle, I'm going to try to mess with that.

little eagle
#

yo

shadow sapphire
#

?

little eagle
#

Do that.

shadow sapphire
#

Okay! Doing it.

little eagle
#

yo

#

@peak plover

if ("_ar_" in toLower typeOf _unit)

I guess.

#

toLower to make sure it doesn't break when an update or mod changes the capitalization.

jade abyss
#

(Yeah, that stuff happens)

little eagle
#

It does all the time. Ask QS.

shadow sapphire
#

@little eagle, it worked like a charm! Much less script on page now, too!

little eagle
#

Also find reports a number and not a boolean like if expects.

peak plover
#

Yeah, the toLower still has to be split

#
{
    if ((typeOf cursorObject) find "_AR_" > 0) then {
        _x suppressFor (ceil random 10);
    };
}count units _group;
#

Looks the cleanest for now

little eagle
#

Why find when in already reports a boolean?

peak plover
#

value in array

jade abyss
little eagle
#

And your code only works with upper case AR

#

I swear there was a STRING in STRING

#

huh

peak plover
#

O_Soldier_AR_F

little eagle
#

I just woke up btw.

peak plover
#

It will never be lower case

jade abyss
#

Thats why -> toLower

little eagle
#

You don't know what a patch or addon could do, nigel

shadow sapphire
#

Is there any concern with overuse of sleep commands?

peak plover
#

That's a good point

jade abyss
#

So it wouldn't matter if its changed to: aR Ar ar or AR (And again: Yes, that happend before)

little eagle
#

Sleeping sickness

jade abyss
#

Not rly @shadow sapphire

shadow sapphire
#

Do you guys find that you have less jarring clientside framerate drops if you stagger AI spawning?

_G1 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getMarkerPos "M1"), INDEPENDENT, ["I_officer_F","I_officer_F","I_medic_F","I_soldier_UAV_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_M_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G4 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

as opposed to:

_G1 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_G2 = [(getMarkerPos "M1"), INDEPENDENT, ["I_officer_F","I_officer_F","I_medic_F","I_soldier_UAV_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_G3 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_M_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_G4 = [(getMarkerPos "M1"), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_F","I_Soldier_GL_F","I_Soldier_AR_F","I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
little eagle
#

Placebo ?

shadow sapphire
#

I mean, when I've tried the latter, I hear my guys with weaker machines callout "Platoon just spawned in," and shit like that when we are on missions.

#

But since I've staggered it to have just one squad spawn in at a time, I've not heard that anymore.

little eagle
#

Should be tested with a debugger and not with anecdotal evidence like that.

shadow sapphire
#

I think the more gradual frame drop is easier to confuse with normal game performance.

#

Like moving toward a city, or whatever, everyone's frames drop a bit.

#

Instead of one big stutter.

little eagle
#

Is the first code executed in unscheduled environment or what?

shadow sapphire
#

I don't know. The sleep commands work.

#

It's spawned from an SQF.

little eagle
#

Then it's not. I guess the scheduler just sucks at doing it's job.

shadow sapphire
#

Why?

little eagle
#

I mean sure. Maybe. But "this guy didn't seem to notice" is pretty weak evidence.

shadow sapphire
#

Well, it's not one guy. I have a pretty weak machine, too. It's just way more noticeable, without the sleeps, I drop from 60 to 40 all at once with a major freeze frame for probably a quarter of a second.

little eagle
#

Why?
It's supposed to suspend the script when 3ms or something like that are reached, so FPS should stay constant even without sleep commands.

shadow sapphire
#

When I add in the sleeps, the drop is more gradual and I don't get any hard freezes.

#

Suspend the script?

little eagle
#

Get some numbers.

shadow sapphire
#

How do I get numbers?

little eagle
#

Debugger. Idk, be creative with diag_log diag_tickTIme

#

Suspend the script?
The scheduler already suspends the scripts when the execution is taking too long.

shadow sapphire
#

Oh, man... Probably not worth all that. I'm... terrible at this stuff.

#

Oh, well, the script spawns everyone instantly.

little eagle
#

Sorta like virtual sleep commands that an appear everywhere in your script at any time.

shadow sapphire
#

I've never had an issue with that.

#

The script spawns instantly everything on the server. No server slowdown. I just mean my machine and other guys with weak PCs.

peak plover
#

umm

#

This is really wierd,

_unit knowsabout player; //0
_nearestEnemy = _unit findNearestEnemy _unit; //player
_unit knowsAbout _nearestEnemy; //4 
#

Ahhaa! ```sqf
_unit knowsAbout vehicle player; //4

#

Somehow the unit knows about editor places vehicle, behind a hill 500 M away

shadow sapphire
#

Good find!!

jade abyss
#

Arma ¯_(ツ)_/¯

peak plover
#

targetKnowalge also gives false information using findNearestEnemy, however getHideFrom works //[0,0,0]

little eagle
#

Well, you can't really call it "false information".

#

It's just reporting what the game is doing, which might be unintuitive.

peak plover
#

My whole life has been a lie up until this point.

jade abyss
#

Must be a boring life then^^

little eagle
#

Eh. There are exciting lies.

#

Makes them all the more believable.

#

I'd say the likelihood of some piece of information being false is directly proportional to how exciting it is.

shadow sapphire
#

When I use spawnvehicle, what is the easiest way to reference that vehicle to give it waypoints, etc?

shadow sapphire
#

?

peak plover
#
_array params ["_vehicle","_crew","_group"];
mySpawnedVehicleGroup = _group;
shadow sapphire
#

@peak plover, thanks!!

#

I have looked at that wiki page for a while, but I never understood how to refer to the information!

#

@peak plover, it's saying _array params is undefined.

peak plover
#

wops it says sqf_param

shadow sapphire
#

Wait one. That might be wrong.

peak plover
#

9sqf_array

shadow sapphire
#

It doesn't work with sqf_array or sqf_params.

#

Well, it throws errors, anyway.

#

@peak plover, it throws erros with both sqf_array and sqf_params.

peak plover
#

o

shadow sapphire
#
sqf_params = [getMarkerPos "M1", 180, "I_MRAP_03_F", INDEPENDENT] call bis_fnc_spawnvehicle;
_array params ["_vehicle","_crew","_group"];
mySpawnedVehicleGroup = _group;```
#

What have I messed up?

peak plover
#
_array = [getMarkerPos "M1", 180, "I_MRAP_03_F", INDEPENDENT] call bis_fnc_spawnvehicle;
_array params ["_vehicle","_crew","_group"];
mySpawnedVehicleGroup = _group;
#

I fucked up defining array before

#

I defined sqf_array instead

#

In your case, it's defining sqf_params and then later trying to get the info from _array (undefined

shadow sapphire
#

Nice! Okay, it's working now with no errors.

peak plover
#

😜

shadow sapphire
#

Any idea how I can place more crew in a spawned vehicle or should I go back to using createVehicle (which has been much easier to work with for me)?

shadow sapphire
#
[getMarkerPos "M1", 180, "I_MRAP_03_gmg_F", _G1] call bis_fnc_spawnvehicle;```

What is the easiest way to set this to spawn at five meters away from the marker? Anyone know off the top of their head or have a link?
dusk sage
#

Your position (getMarkerPos "M1") is just an array 😃

peak plover
#
((getMarkerPos "M1") getpos [5,(random 360)])
shadow sapphire
#

@dusk sage, is just an array?

peak plover
#

getMarkerPos "M1" //[x,y,z]

#

getMarkerPos "M1" is the same as having [420,69,0] <(the actual marker coordinates) instead

shadow sapphire
#

Ah, neat!

dusk sage
#

I forgot about that getPos alt. syntax

#

That would be a good way to go, if it works

shadow sapphire
#

Is there a way to guarantee a safe position using getpos alternative syntax, @peak plover or @dusk sage?

peak plover
thick ridge
#

Anyone have any ideas for detecting the CUPS train track objects? Was able to use the lineIntersectsWith/lineIntersectsObjs/lineIntersectsSurfaces with the tracks on Tanoa. However, that doesn't seem to work with the CUPS tracks.
There are a couple that get detected if the line intersects the metal rail, however, most can't be detected at all with those methods

jade abyss
#

try terrainObject

thick ridge
#

awesome - thanks for finding that 😃

jade abyss
#

should also work with the Tanoa Tracks

thick ridge
#

do you know off hand if that would also detect tracks placed via the editor?

#

or does it only work for the static objects included in the map?

jade abyss
#

*does work with the Static Tanoa Tracks

#

No clue, are they somewhere in the editor available?

thick ridge
#

search for "rail" under the static objects section

#

I can give it a try in a bit

jade abyss
#

track

#

Nope, won't be found.

thick ridge
#

that's too bad - guess it would have to be a combination of both nearestTerrainObjects and nearestObjects

jade abyss
#

Yep. But nearestTerrainObjects -> Should be first, imo

thick ridge
#

yeah

#

Thanks - will try switching the train code from lineIntersects to those methods

jade abyss
#

gl

shadow sapphire
#

Mother. Fucker. I'm sick of this shit always being so hard.

#
_G1 = createGroup INDEPENDENT;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_MRAP_03_hmg_F"]), 180, "I_MRAP_03_hmg_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_Truck_02_ammo_F"]), 180, "I_Truck_02_ammo_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_MRAP_03_gmg_F"]), 180, "I_MRAP_03_gmg_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_Truck_02_fuel_F"]), 180, "I_Truck_02_fuel_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_MRAP_03_hmg_F"]), 180, "I_MRAP_03_hmg_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_Truck_02_box_F"]), 180, "I_Truck_02_box_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,60,"I_MRAP_03_gmg_F"]), 180, "I_MRAP_03_gmg_F", _G1] call bis_fnc_spawnvehicle;```
#

If I use this, then it always spawns two to three vehicles on top of each other. It's always the same exact two or three, based on how I set the size of the spawn radius.

#

scratch that. I've discovered that by setting the min/max distance to 25/50, I can get five of the seven to self destruct on spawn.

peak plover
#

I reckon it's runny too fast to recoqnise the older vehicles or something.

[] spawn {
    private ["_G1","_spawnPosition","_spawnedVehicles"];
    _spawnedVehicles = [];
    _G1 = createGroup INDEPENDENT;
    _spawnPosition = {((getMarkerPos "M1") findEmptyPosition [20,60,_this])}
    {
        _array = [_x call _spawnPosition, 180, _x, _G1] call bis_fnc_spawnvehicle;
        _array params ["_vehicle","_crew","_group"];
        _spawnedVehicles pushback _array;
        _vehicle allowDamage false;
        sleep 0.1;
        [_vehicle] spawn {sleep 1;_this allowDamage false;};
    }count ["I_MRAP_03_hmg_F","I_Truck_02_ammo_F","I_MRAP_03_gmg_F","I_Truck_02_fuel_F","I_MRAP_03_hmg_F","I_Truck_02_box_F","I_MRAP_03_gmg_F"];
};
#

It's an extremely dirty way of doing it 'tho.

woeful void
#

question: Getting the current list of tasks, client side that a unit has assigned to it, assuming the references to the tasks were already lost. any ideas?

#

nevermind, found it

plucky beacon
#

what's another way I could run a script locally at the beginning of the mission for one unit
init.sqf

if (player == z1) then {
    null=execVM "GUI\spawn_menu.sqf";    
};

this isn't working, in fact it runs the script all the time no matter the unit in SP testing, and not at all during MP testing

jade abyss
#

initPlayerLocal.sqf

plucky beacon
#

mmmm I tried that too, but I didn't test it as thoroughly

#

I honestly can't tell why it's not reliable in the first place

woeful void
#

Is that menu for before they spawn in or after?

plucky beacon
#

it waits for interface

#

That's farther up the sqf

#

imma try the local thing first

#

that did the truck thanks

#

it just wasn't consistent on SP but tested on the dedi and it worked

peak plover
#

Did you try adding a wait?

severe pendant
#

Hey guys, anyone working with the arma 3 revive function? Do you know of any way to check for the "unconscious" state? I'm having a problem with players getting around becoming "unconscious" by relogging. And I want to check for it and put them back at unconscious if they were it before logging off. I suppose using namespace to store it would work?

thin pine
#

lifeState command

little eagle
#

@plucky beacon
CfgFunctions with preInit or postInit flag set to 1 or CBA preInit / postIni XEH.

#

I reckon it's runny too fast to recoqnise the older vehicles or something.
The game is fast enough to recognize the vehicles lol

#

findEmptyPosition just sucks

severe pendant
#

I'm pretty noobish.

#

Trying to learn.

#

Does uiNamespace get cleared in the lobby tho?

little eagle
#

No

#

It get's cleared after a game restart though.

severe pendant
#

Ahh, so they can still avoid it by restarting ARMA.

#

I guess I could be nasty and kill them if they disconnect while unconscious?

little eagle
#

That sounds the easiest tbh.

severe pendant
#

It would suck if you got disconnected for "reasons"

little eagle
#

BI should fix their revive system if it can't even handle relogging. That's embarrassing .

severe pendant
#

Well, as always we have to work around their issues. xD

little eagle
#

Just kill them off when they dc.

woeful void
#

If I remember it right, historically the game started as an army tool, which means the machines that would run it would have all been in one room like a lan party, and 'logging off' had real consequences... like a drill seargent in your face for those shenanigans...

severe pendant
#

So, what do I check for? lifeState? ie. if the player is in a certain lifestate on disconnect, set playerDamage = 1?

woeful void
#

considering that the unit dies when they disconnect... depends on the mission you are setting up. If it would happen where they die and the possibility of reinforcements is there, then dying might not be a bad way to go.

little eagle
#
addMissionEventHandler ["HandleDisconnect", {
    params ["_unit"];

    if (lifeState _unit == "INCAPACITATED") then {
        _unit setDamage 1;
    };
}];
woeful void
#

However if you are making a persistent server, i.e. life or a long term tactical simulatur like dynamic wars.. you have to reappraise that and figure out what works best for your mission/gamemode.

severe pendant
#

I'm running ExileMod

#

Thanks @little eagle

woeful void
#

could also teleport the unit and turn the simulation off for it.. then when they reconnect, teleport back and reenable simulation? Dunno.. just tossing an idea out there. I don't know about exile.

little eagle
#

He said it's Arma 3 Revive. I guess that is not modified by Exile.

#

Otherwise better ask them for details.

severe pendant
#

Exile doesn't support it by default

#

I had to do an ugly "hack" to make it work

little eagle
#

Why not QS?

#

There is only one way to find out.

#

Yes, but now you're making up solutions for problems that don't even exist (yet).

#

How does Exile even handle players relogging? Is AI enabled or does Exile just setPos a new unit to the last position?

severe pendant
#

Uses extDB and stores player data lastPosition and reloads it

peak plover
#

You can save the information about the player on the server and once the client connects, ask for info.

little eagle
#

"reloads it"

#

So create a new unit and setPos it

severe pendant
#

Aye.

little eagle
#

No wonder the unconsciousness thing is handled properly then.

severe pendant
#

Though, my knowledge on the back end is limited. As I said, I'm a noob when it comes to coding.

little eagle
#

The lifeState should be serialized by the database extension thing. I just don't know how to manually knock out a unit in BI Revive (Just setUnconscious ???)

#

Yeah.

#

Pardon?

#

So setUnsconscious is sufficient?

#

To manually knock out a unit and have BI revive work.

#

?

#

The wiki page is garbage.

#

Just kill the unit.

peak plover
#

Hey hey, no need to get violent.

little eagle
#

But they explain nothing.

#

file?

#
#include "defines.inc"
#define DEBUG_LOG        bis_fnc_logFormat

This part is cute. It almost looks like a proper script.

#

SET_STATE(_unit,STATE_INCAPACITATED);
I guess.

#

It probably does a bit more than that.

#

I hope at least. Otherwise ...

#

What is playerVar ?

#

bis_fnc_objectVar
all this fancy new tech

#

KK ?

#

googles neokika

#

Nelson Duarte

#

according to my googlefu

#

we

#

I never found an application for bis_fnc_objectVar

#

Does it work on clients?

#

Yeah, but it seems to be required for bis_fnc_reviveInitRemovePlayer

#

Why does a getter function like bis_fnc_objectVar add a "local" eventhandler? -_-

#

discord

#

There was a wise guy that once said that functions should have no side effects.

#

Like a getter adding a eventhandler

#

Is that why they use
private _object = param [0,objnull,[objnull]];
instead of
params [["_object", objNull, [objNull]];
?

#
// init.sqf
if (/*database says I'm unconscious*/) then {
    private _playerVar = player call bis_fnc_objectVar;
    [_playerVar] spawn bis_fnc_reviveInitRemovePlayer;
};

something like that.

severe pendant
#

Thanks for the pointers guys.

#

I will see if I can make it work.

#

Probably will do a temporary solution in the short run which checks if the player is unconscious on disconnect, and then kill the player if it was in combat at least.

little eagle
#

Just slap it on the server and watch if someone complains.

#

wow

#

Thanks discord for adding that "gif" text.

#

Perfect.

#

I mean he could work on something to store the state in an object variable or in uinamespace

#

But the proper way would be to have the database thing serialize the unconsciousness state.

#

And then use setUnconscious or whatever the way is to trigger BI revive state by script.

#

On the initPlayerLocal or something.

#

But the player object is deleted though. The object vars should be gone then.

peak plover
#

How do I make sure something is atleast 1

#

So I don't divide by zero

little eagle
#

_number > 0

#

?

#

lol

peak plover
#
(((getPosVisual _x) select 2) < (300 / floor((speed _x) / 50)))
little eagle
#

parenthesis hell : (

#
(((getPosVisual _x) select 2) < (300 / (floor((speed _x) max 0.01) / 50)))
#

I guess

peak plover
#

floor speed player / 50 //0.28
So I went nuts

severe pendant
#

Yeah, right now that's a bit over my head.

peak plover
#

thanks Max, is perfect

little eagle
#

Don't say that to him though.

severe pendant
#

But I can do a onPlayerDisconnect check for lifestate.

little eagle
#

That won't work. You need HandleDisconnect

severe pendant
#

OK

little eagle
#

Otherwise you don't have access to the unit of the disconnected player.

severe pendant
#

So I need to add that eventhandler on the initPlayerLocal?

little eagle
#

No, it's a eventhandler that only works on the server and handles all disconnecting players.

severe pendant
#

Oh, alright

#

Can I do a check there for if the player was in combat?

little eagle
#

Define "in combat"

severe pendant
#

Well, Exile has an "in-combat" system, ie if you fire a weapon, or if a weapon is fired in the vicinity of you, you are set as "in combat"

thin pine
#

Find the exile var that is set when in combat

#

Unpack exile

severe pendant
#

I don't want to kill players that disconnect to avoid (for example) falling down some stairs, or stumbling on some #arma rocks, or whatever

#

But definitely kill them if they are in combat

#

(if they disconnect, that is)

little eagle
#

googled "arma exile in combat"
Nothing valueable found

severe pendant
#

ExileClientPlayerIsInCombat

#

Check for that

#

That's the check I do for other things

#

ie. if !(ExileClientPlayerIsInCombat) then {

thin pine
#

It's local to that client huh

severe pendant
#

Yes

#

:/

little eagle
#

That's a bust then. lol

#

They do it with a firedNear eventhandler

thin pine
#

Could try to add one yourself that mimics it but uses a broadcasting setVariable

little eagle
#

And that's how it's reset.

#

No need to I think

#

firedNear already is global iirc. Could everything be handled by the server

#

diag_tickTime doesn't support saving, but I guess the rest of Exile doesn't anyway, so ...

thin pine
#

Accepts global arguments yeah

#

Serversided firedNear is possible

little eagle
#

handleDamage is insert swear word

#

Maybe, please don't ask me. I have PTSD from that thing and the ace medical system rewrite.

dusk sage
#

😄

little eagle
#
//initPlayerServer.sqf
params ["_unit"];

if !(_unit getVariable ["commy_inCombat_init", false]) then {
    _unit setVariable ["commy_inCombat_init", true];

    _unit addEventHandler ["FiredNear", {
        params ["_unit"];
        _unit setVariable ["commy_inCombatTickTime", diag_tickTime];
    }];
};

//initServer.sqf
addMissionEventHandler ["HandleDisconnect", {
    params ["_unit"];

    if (lifeState _unit == "INCAPACITATED" && {_unit call commy_fnc_isInCombat}) then {
        _unit setDamage 1;
    };
}];

commy_fnc_isInCombat = {
    #define COOLDOWN 30

    params ["_unit"];

    diag_tickTime - (_unit getVariable ["commy_inCombatTickTime", -COOLDOWN]) < COOLDOWN  
};
#

maybe this works

thin pine
#

@tough abyss it gets triggered like 15 times per injury for instance.

peak plover
#

What's the usefulness of #define COOLDOWN 30 vs _cooldown = 30;

still forum
#

_cooldown = 30; is a variable assignment. Variable assignments cost performance

little eagle
#

I do it mainly to trigger Dscha.

dusk sage
#

I'm sure we'll live

peak plover
#

Is the performance difference really that good? I've been using _var = blabla;. I'm trying to cut some MS off a script that has to run 1000s of times withing a few seconds

still forum
#

no

dusk sage
#

Negligible

little eagle
#

perfectionism

dusk sage
#

SQF

#

💩

little eagle
#

words

peak plover
#

words

#

words

#

PUNCHLINE

still forum
#

you are trying to cut MS off? Milliseconds? are you saying me that your script that runs thousands of times needs over 1 millisecond to execute?!

little eagle
#

lol, nigel

peak plover
#

It's mostly about how many times, I think around 2500 times took me ~1.5 seconds

still forum
#

eyes twitch

thin pine
#

I read that as trying to cut Microsoft off

peak plover
#

I think this is better than having 2500 seperate scripts for every group 'tho

little eagle
#

It's a magic variable
-> belongs in a macro at the top of the function

dusk sage
#

You're getting < millisecond on your script as is

thin pine
#

You have 2500 groups?

dusk sage
#

If you cut some milliseconds off that, then let me know

#

Because I'd like infinite performance too

peak plover
#

They are cached. So in reality max is still 144

still forum
#

if you have constants. That is variables that never change. You may have a small benefit from putting them into a #define instead of a local variable

thin pine
#

You could start off by perhaps reducing iterations

#

That's a good optimizer

peak plover
#

I normally use this with ~100 - 200 groups. But I wanted to see what would happen if I had a mission with the whole map covered in enemies

dusk sage
#

whole map covered in enemies

#

How many we talking 😄

#

Not gonna need any optimisations when the whole game 💩s

still forum
#

group limit is 144 if you aren't on dev branch

little eagle
#

I can tell you what would happen.

thin pine
#

Arma has stopped working ™

peak plover
#

I've got a activeGroups limit that I can set different for every group. I try to limit the maximum active to around 30. So 30 active...2470 cached (deleted, only array)

#

server fps : 45

little eagle
#

30 groups is different from 144

thin pine
#

No arma session will ever need 2500 cached groups so test your script with realistic values

little eagle
#

30 seems reasonable

peak plover
#

I would like to think if it were spawn mycachescript forEach groups; I would have less than 45 FPS on the server

#

I've got an actual mission with the script where I got 147 groups right now. Bear in mind some of the groups are only 2 men patrols

little eagle
#

What does it do?

#

I think the game craps itself when you have like 2000 scripts running.

peak plover
#

Exactly

#

That's why I only have 1

#

Well 1 for ai managment and 1 for clean up

little eagle
#

And 300, one for each fish in the ocean. Thanks BI

dusk sage
#

Let me get the minigun, brb

little eagle
#

Setting one object namespace variable should be fine, but definitely don't make it a public one.

dusk sage
#

Picked the wrong game

#

0.39 is better than 0.2

little eagle
#

Just set CfgAISkill everything to 1 and use the commands exclusively

#

It's .39 and not .2, because they practiced in secret!

dusk sage
#

Developing A3 must be fun

#

Does it make sense? Nah. Cool.

#

Hey guys check this out, I just implemented this new command, it doesn't do what it's meant to do, hahaha

peak plover
#

AimingAccuracy 0.3-0.4 seems to bee good middleground

#

you need aimingSpeed 0.3 as well

#

hahaa

dusk sage
#

!1!1!!!

peak plover
#

Brilliant

dusk sage
#

140% chance of death

#

not good

peak plover
#

Did you know the setSkill "courage" is responsible for the amount of suppression the AI can withstand?

#

What the fuck?

dusk sage
#

aimingShake 69%, aimingAccuracy 29%

#

Your AI are wacked on something man

#

got the shakes

#

endurance: 0.959843

#

Coke confirmed

peak plover
#

How does it interploate so much for you?

#

Is that a modded unit?

#

"I_soldier_F" "aimingShake" == 0.435 //setSkill 0.8

#

What are you using to draw the skill value?

#

What are your difficulty skill settings?

#

setSkill "aimingAccuracy" 0.5; //skillFinal 0.462362

little eagle
#

Yeah, I think the difficulty setting is part of the interpolation.

severe pendant
#

@little eagle Thanks m8, I'll try your solution.

tough abyss
#

Do publicvariables initiated on server start stay for those who connect, if so how would I read them?

still forum
#

just read them by using the variables. Public Variables will be received and set when joining the server

tough abyss
#

Thanks

frank marsh
#

If using setVectorDirAndUp and setVelocity on every bullet in a fired eventhandler, Does the bullet path get updated/sent over the network twice per shot? Will it cause any performance decrease in MP?

little eagle
#

Pretty sure the bullets are local objects and you have to setVector / setVelicity them on every machine.

#

Will it cause any performance decrease

#

Yes

#

Everything does.

#

Use the profile branch thingy and find out how much.

frank marsh
#

No issue in single player, but how will it affect performance on a server with 2 players vs 60 players. Kind of hard to test

little eagle
#

The only way to find out is the profiler or some other kind of debugging.

#

This doesn't run for AI

frank marsh
#

ok. thanks 😃

meager granite
#

Bullet locality depends on ammo simulation and how it was shot. Player-fired shotBullet projectiles are local to each client

#

Only fired message is sent, then each client processes bullet by themself

little eagle
#

That is why we have to use our own deterministic random number generator to keep sniper bullets synched for spotters.

frank marsh
#

So bullets get adjusted "in flight" locally and the new path is not sent to every client with that overheating script?

little eagle
#

they're adjusted once when fired and not in flight

polar folio
#

is ther any way to control depth of field via script?

plucky beacon
#

should I be running scripts for GUIs in functions?

#

it says waitUntil is an error in general expression

polar folio
#

that just means you are using it in non scheduled environment

#

most likely at least

plucky beacon
#

is that something I change in cfg functions?

#

postinit=1?

polar folio
#

no. you should read up on scheduled vs non-scheduled environment in sqf

#

supsend stuff like sleep and waituntil only works in scheduled

plucky beacon
#
preInit are called unscheduled so suspension is not allowed. Parameters passed are [ "preInit" ].
postInit are called scheduled so suspension is allowed but any long term suspension will halt the mission loading until suspension has finished. Parameters passed are [ "postInit", didJIP ].
polar folio
#

that's a good starting point

#

good. you should still read up on it if you don't know what the difference is

little eagle
#

They put that count vs forEach shit on the wiki 😦

plucky beacon
#

what about it

#

is it wrong?

#

Ya post init didn't work so I guess I have to read up more

polar folio
#

why is that bad?

dusk sage
#

perfection commy perfection!

plucky beacon
#

question: is there any advantage in converting my ui scripts to functions instead of keeping them the way they worked?

polar folio
#

nitro. according to that stuff you posted you were somewhat right but it highly depends on what you make waituntil wait for i guess. either way it's very important to understand the difference anyways. so can't hurt to read it

plucky beacon
#

it's waiting for a boolean

clicked = false;
onMapSingleClick "'east_start' setMarkerPos _pos; clicked=true;"; 
waituntil {clicked};
polar folio
#

so what happens?

plucky beacon
#

imma get a link

polar folio
#

with postinit?

#

maybe try spawning a new thread

little eagle
#

Why don't you put the rest of the code inside the eventhandler

#

also use addMissionEventHandler

plucky beacon
#

this is local?

polar folio
#

right (@commy not at local)

plucky beacon
#

uhhh

little eagle
#

So you don't have to work with a string and have stackable eventhanlers

plucky beacon
#

this isn't for an event handler?

polar folio
#

ONmapsingleclick

#

= event

plucky beacon
#

oh right

#

dur

little eagle
#

onMapSingleClick is an eventhandler

#

But a form that is deprecated

polar folio
#

did they keep those for backwards compat? would be cool to habe them remvoed at some point

little eagle
#

yes for BWC

polar folio
#

although mission EH keeps it from breaking right?

little eagle
#

It makes using it more convenient and does stop it from breaking too.

polar folio
#

so essentially BIS_fncaddstackedEH is kind of pointless, huh? i kind of missed the memo on mission EHs. shoudl probably switch all my BIS_fnc_stacked EHs to those

little eagle
#

It is now.

#

I mean, there is nothing wrong with it, but it's vulnerable of being broken by mods that don't care about compatibility

#

E.g. Exile.

plucky beacon
#
onMapSingleClick "
'east_start' setMarkerPos _pos; 
clicked=true;
'H8erHUD' cutRsc ['default','PLAIN'];
OpforFlag setPos (getMarkerPos 'east_start');
openMap [false, false];
enteredEast = true;
[] call GUI_fnc_SpawnMenu
";

I suppose that works

#

but it's all ugly and turqoise

#

:P

polar folio
#

do what commy said to decrease ugliness adn also make it better

plucky beacon
#

what did he say to not deal with strings?

polar folio
#

yea Exile blocks mission EHs too i think though. or infistar. can't remember

#

missionEH

little eagle
#

You can still remove them all by using removeAllMissionEventHandlers

#

But if someone does that, why bother with it.

plucky beacon
#

hmm

polar folio
#

i think the event name will be without ON. so be aware of that

#

not sure though

polar folio
#

and yea it sucks. but it still makes all the noobs come to my steam page to complain. and i honestly would like them to be able to use stuff without hassle

little eagle
#

Write a letter of complaint.

polar folio
#

do mission EHs survive save game loading? because then it'd require care to avoid spam

little eagle
#

Yes.

polar folio
#

k thx

plucky beacon
#
Dear BI

     scrtipting is hard, plz nerf

love XxScriptingNoobxX
shadow sapphire
#

I'm having lots of trouble understanding keydown event handlers and how to get certain things pushed back appropriately to make a thing happen.

I know that the action keys I need to work with are GetOver and CommandFast (I think that's sprint).

Does anyone know the most efficient way to create an event handler for GetOver+CommandFast keys?

#

I've got a patchwork of shitty script for this already, but it's... just terrible.

tough abyss
#

Is there a method of reading systemChat from the server?

polar folio
#

you mean ask the server for something and make it spell out in systemchat on the client?

tough abyss
#

No like if let's say some admin says something in rcon. I want to read the sentence and trigger the script

dusk sage
#

Nope, sorry

tough abyss
#

Dang

dusk sage
#

If you are handy with a different language, you could whip up a small extension

old basin
#

Is there a way to enable the new Revive system conditionally? I would like my missions to fall back on it should ACE medical not be present.

little eagle
#

@shadow sapphire Those actions don't work properly. You better forget about them and treat them as if they don't exist.

#

@old basin

if (isNil "ACE_Medical") then {
    // no ace medical
};

No idea how to script start the revive system or if it is even possible.

shadow sapphire
#

@little eagle, DRATS!

#

What might I do for the V key and SHIFT key? Just use DIK?

little eagle
#

DIK codes. #include the library to keep your code readable.

#
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
plucky beacon
#

who's dik?

jade abyss
#

brother of cok

plucky beacon
#

nice meme

little eagle
#

I have no idea what DIK means tbh.

#

D? Input Keyboard

#

idk

jade abyss
#

DirectInputKey?

little eagle
#

maybe

#

As opposed to indirect input keys

dusk sage
#

DirectInputKeyboard

#

yep

plucky beacon
#

DirectionalInfractionKnowledge

old basin
#

@little eagle Yeah I know how to check for whether the mods are present, it's the BI Revive thing I'm having problems with

little eagle
#

Sorry, no idea how to start it by script.

old basin
#

Can't find any commands or functions in the BIki to control it

little eagle
#

Was looking at the wiki yesterday and it's nothing on there.

jade abyss
#

"DirectInput Key " is what i found

little eagle
#

It has no SQF commands, it's a scripted solution as far as I can tell.

old basin
#

It was when I last was active like a year+ ago, but I never paid it much mind

#

Oh hey there are functions in the ingame functions viewer for this thing

#

The wiki does not seem to be up to date with these

shadow sapphire
#

Anyone know how I can do a keydown for when 0x2A and 0x2F are pressed simultaneously?

dusk sage
#

If I'm not mistaken, you'll have to release a key to detect the other

little eagle
#

lol
Good luck, DEL-J

#

hahaha

polar folio
#

isn't the problem rather that each single key will trigger the event? i don't think keyDown will block itself like that

dusk sage
#

It's only going to trigger for the one key

#

And when they occurs, the other key is already not known, the EVH has finished execution

shadow sapphire
#

Hmm...

#

Okay, well, shit.

#

Then I'll have to do a fucking velocity check. Irritating!!

#

So, I need a keydown even handler that checks a whole bunch of shit out and then does it's thing based on that. Ugh.

little eagle
#

What are you trying to do?

#

Because if you want to stop people from vaulting, then give up.

dusk sage
#

So, I need a keydown even handler that checks a whole bunch of shit out and then does it's thing based on that. Ugh.

#

Elaborate 😃 ?

plush cargo
#

could have keypress down "v" set a variable to true and keypress up "v" set to false and keypress "x" checks if variable is true then both keys are down

shadow sapphire
#

@little eagle, @dusk sage, I'm trying to make the movement in my sandbox more versatile. I don't want to remove vaulting, but I want to make it where if you are sprinting and hit the vault key, you will jump, if you press vault key when there is a window or wall, based on height, you'll climb through or over it.

#

@plush cargo, that's not a bad idea, but I've seen something similar to what I need done with a velocity check and that seems to work fine. Thank you, though!

plush cargo
#

np 😃

dusk sage
#

Just be careful, if you hold a key down, it'll fire many times

little eagle
#

This is how they jump in ACE. No idea if scripting this is possible.

dusk sage
#

You can simulate a little parabola, but it looks odd

#

Same as what life does, just via setVelocity

#

Same anim as you just linked

polar folio
#

animchanged EH could work too. would need switchmove though without transitions. might get ugly when used with any otehr than a rifle in hands since i think there is only a rifle version fo the jump anim in game

dusk sage
#

yep, it holsters mid flight

unborn elbow
#

Hello,i settet up a wasteland server on chernarus summer.I put the MOD vehicles from CUP in the store to buy,took me many hours bcs im a noob.When i press buy there pop up a messege in the top right "The purchase has been cancelled". I realy dont no what to do can any one help me maybe :/?

polar folio
#

hm i guess you could do some fast selectWeapon stuff. auto select rifle while jumping and select back to what you had right after. shouldn't be noticable with anim EHs. except you will always jump with rifle in hand xD

polar folio
#

does anyone know the path to the default NVG overlay?

little eagle
#

I can look it up.

plucky beacon
#

You know I never even thought about it, you could use the NVG overlay without the green effect to simulate a mask of some kind

little eagle
#

It actually uses a model and not a texture

#

modelOptics="\A3\weapons_f\reticle\optics_night";

polar folio
#

hm. well that model uses a texture then, no?

#

thx. i'll look at it with eliteness

little eagle
#

\a3\weapons_f\Reticle\data\optics_bg_blurred_round_CA.paa

#

Four of these

#

It's only a fourth that is mirrored.

polar folio
#

thx!

little eagle
#

I totally didn't open any binarized models

#

I wouldn't even know how

polar folio
#

k. so how do i rotate a picture? possible?

#

basically need to make a copy of that overlay

little eagle
#

Tbh

#

Just depbo this

#

And edit it with photoshop

polar folio
#

actually i could just create teh ctrl as an object/model one. derp

#

should do the trick

little eagle
#

Never tried that, but sounds interesting.

polar folio
#

although since i'm doing stuff to nvg i might aswell remove that default overlay all together. should be possible, right?

little eagle
#

By editing the config, sure.

polar folio
#

btw. i was thinking. it would be so damn useful to be able to use that addaction hack using the shortcut parameter without having that ghost entry in th scroll menu list. what are the chances of them adding a parameter to addaction to avoid that, if we ask for that?

#

so one could easily create EHs for any mapped action or whatever you call those

little eagle
#

About 0?

dusk sage
#

Don't be optimistic commy

little eagle
#

You're right. If we ask, they'll probably take away the DefaultAction hack we use atm altogether.

polar folio
#

😦

#

any other cool ways people found to hack EHs for those events?

little eagle
#

Throw used to work

#

Then it no longer did

#

;_;

polar folio
#

thx

tough abyss
#

so if i do test = 100; publicVariable "test"; on server side and for every client that connects can i just do hint str test?

#

nvm tested and it worked

little eagle
#

It's great, isn't it?

tough abyss
#

alright ill do missionnamespace

polar folio
#

@tough abyss inside remoteExec though, right?

#

oh wait. nvm. you use global bool

#

nice

plucky beacon
#

What was the alternative to publicVariable? mission namespace or soemthing?

#

I had a long convo with Dscha and someone else and ultimately found out they do the same thing

#

minus some parameters

little eagle
#

missionNamespace setVariable public is essentially the same as publicVariable

#
missionNamespace setVariable ["Test", 127, true];
Test = 127;
publicVariable "Test";

The first one is very slightly faster and a one liner.

plucky beacon
#

yush, thans commy

chilly hull
#

I remember that there was a max execution time for scripts, but I can't seem to find it anywhere.

chilly hull
#

Thanks

tough abyss
#

thanks Dscha for the code optimisation page. never read it.

peak plover
#

It should be pinned!

jade abyss
#

yepyep

#

BUT:
Read the first two parts (especially the 2nd one)!

peak plover
#

True, best way to do it is, achieve what you want to. Once it's done rewrite or improve.

#

Every time I go back on a old script, I feel like I've been so bad and the new one is 2x better

tough abyss
#

recursive loop and you return to it

#

therfore it's never perfect

#

therfore you write it 2x better every single time

#

dah dah dahhhh

peak plover
#

End result is better 'tho. Even

tough abyss
#

But then you notice a performance decrease in coming back

#

see what i did?

peak plover
#

even 'tho it might never be perfect, it's always better

tough abyss
#

no one got the joke 😕

#

i like this thinking

peak plover
#

What gamemodes did you design?

rotund cypress
#

Is there any way to script how hexagons show and on what players they show on?

#

Like is there any commands for setting shit like that? I've been looking like crazy but haven't been able to find anything.

#

Ah alright, but can I use the default hexagons then? I assume no. I've seen it done I think. What I want to do is, remove a hexagon from the group when the target doesnt have a gps. so when he doesnt have a gps, no one in his group can see him

#

ah alright

#

Ye that seems like a good way i guess

thin pine
#

It's like a slightly cleaner version of handleDamage minus the damage processing

turbid thunder
#

@tough abyss so its like hitPart in a way?

flat sphinx
#

Hello. Need help with ejecting players from vehicle in INCAPACITATED lifeState. Example from wiki (moveout) don't work. Any ideas?

civic maple
#

setPos works

#

afaik

flat sphinx
#

Tried. setPos in MP works bad

#

moveout dont work if lifeState INCAPACITATED

#

yeap

civic maple
#

hmm, can you temporarily disable the unconsciousness, do moveOut, and then reenable it?

flat sphinx
#

yes, this method is best atm, but may be someone know more simple and clean 😃

thin pine
#

Delete the vehicle. Jk

plucky beacon
#

with those new damage handlers you could therietically award players who have done the most damage and give other players asissts like most games

thin pine
#

What has changed that you think would make that so much easier? @plucky beacon

plucky beacon
#

Read quicksilver's comment up above, you can measure how much damage is caused by a unit and it's projectile

thin pine
#

This was already possible with handleDamage tho

peak plover
#

That could be used to add the dink sound games like battlefield,counter strike and cod are using when you headshot someone with a helmet, to appeal to the mainstream audiences

#

Also hitmarkers and hit indicators.

plucky beacon
#

imma make them hitmarkers now

#

also, can make diffrent ones for headshots

peak plover
#

Have a square one for vehicles

plucky beacon
#

imma start with people first

peak plover
#

Make them only show when a certain amount of damage is done, that way when you shoot a pistol at a tank, you won't get it, but if you shoot a .50 at a car you do.

plucky beacon
#

I was thinkin' that actually

#

ho boy I could even do it for getting hits on parts of vehicles like rotors

#

on another note, I could do a script that spawns a marker when you fire a weapon without a suppresor

#

that then fades

peak plover
#

Genius. This will improve arma immensly.

little eagle
#

I found it's best to do the scripts right the first time. I don't get back to improve stuff like 90% of the time. Only the really big features get overhauls and it's mainly stuff like new SQF commands or eventhandlers.

plucky beacon
#

well at least in my head including vehicles now or later is negligible since it won't be reusing much code. the damage to parts on vehicles is diffrent.

little eagle
#

I have rewritten a fuckton of old stuff though.

#

Not mine.

plucky beacon
#

I've rewritten things several times because I've been told it's wrong here

#

I prefer thorogh testing with a reliable group

little eagle
#

Yeah, I try to think of all of that before.

plucky beacon
#

I still think the safe zone object in helpers is way more effective

#

I prefer iterative design

#

I learn more

#

and I'm also not good enough to know the best way

#

so basically becuz nub

#

I can't plan for time spent

#

because I don't know how complicated it will get

#

i.e. hit markers

#

I'm pretty sure I know how I'm going to do it

#

but then, i dunno fucking sound files will be trouble suddenly

thin pine
#

hitPart EH description actually recommends usage for hitmarkers iirc

plucky beacon
#

haha lol

thin pine
#

Because of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation.

#

I've modified atlas' hitmarkers mod which also uses hitPart

plucky beacon
#

but what about dem headshots

thin pine
#

selection: Array - Array of Strings with named selection of the object that were hit.

plucky beacon
#

why not use the dammaged handler?

peak plover
#

Wouldn't you have to use MpHit anyway?

thin pine
#

eww

peak plover
#

I guess remotExec would work as well

thin pine
#

prevent network stuff wherever possible

#

for local feedback like hitmarkers i wouldnt recommend mphit

peak plover
#

Copy that. remotExec has object available as target, the function will be executed only where unit is local

#

So it's perfect

thin pine
#

on a side note - im hardly experienced with networking but doesnt remoteExec with a local 'target' still send a msg to the server and then the server checks locality and sends the msg on through to the selected client

#

I somewhat doubt its p2p

plucky beacon
#

I think the only P2P in arma is local and nondedicated hosted servers and VOIP

#

in Atlas' mod he makes it an extension of the hitPart event handler, can you do that in a script solution? description maybe?

thin pine
#

what u mean is that he's using the CBA hitPart extended eventhandler, for ease and stability.

#

there are several ways u can do the same without CBA tho

peak plover
#

Is p2p even possible in arma ?

thin pine
#

lobbies are kinda 😛

#

p2p to lobby host

peak plover
#

Is information sharing p2p possible, as in only sending a variable to a certain client?

little eagle
#

There is no p2p. Arma is server-client.

peak plover
#

So the best solution is still having the remoteExec

little eagle
#

For what?

thin pine
#

solution to what problem?

little eagle
#

Why though? remoteExec already handles objects. And labeling it p2p is misleading.

#

clientOwner still reports something different in loaded save games : (

#

p2p has a definition

#

Otherwise everything MP is p2p

thin pine
#

i get both povs but yeah i agree with commy here. p2p has a definition

#

remoteExec can give you the illusion of p2p

little eagle
#

They're fine, but you have to do stuff correctly to not break them.

#

CBA didn't work at all in loaded savegames until I fixed all the problems.

#

uiNamespace

#

And none of the displays survive

#

So all keyhandlers are gone for example

#

CBA_fnc_addDisplayHandler handles all this. Including restarting a mission in editor, where the RscDisplayMission is carried over, which leads to duplicate keyhandlers if done wrong.

thin pine
#

benefits of MP dedicated scripting...dont ever have to deal with this shit ^-^

#

locality is funnyjummy

little eagle
#

Yeah. That is the most common approach. To just say fuck savegames.

#

comment

#

...

thin pine
#

its good if u have to test it in the debug console 😛

#

I vouch for comment yo

little eagle
#

Dude. You can just remove comment and leave the strings inbetween the code.

#

That would make it faster too.

#

But it's true. The command is useless.

#

file search in the debug console

#

rght

#

syntax highlighter in the debug console : O

still forum
#

if you wanna file search for comment's just search for //

thin pine
#

leaving random strings in the code would perhaps make me think it's unfinished code. Putting comment before it though makes it abundantly clear it's a comment

#

Personal preference I guess XD

still forum
#

true. use /**/ then

polar folio
#

do textures used in UI stuff need proper size and ratio too like textures? having trouble loading a texture

thin pine
#

#careForComment

little eagle
#

Using the debug console for writing code is retarded in the first place.

thin pine
#

testing

#

rewriting inline functions on the fly for instance

#

#coffeeForCommy

turbid thunder
#

Quick question: Is it possible that when I enable respawn on custom position on a user selected position that the mission doesn't start with everyone having to wait until the respawn timer runs out after joining in?

#

I mean, ofc it is possible somehow but how

little eagle
#

What?

turbid thunder
#

Basically, I have a mission with respawn on custom location

#
  • the respawn menu to select where you spawn
#

BUT, that means that everytime you join in the mission, you basically have to respawn right away and wait until the respawn timer runs out. So assume I have a 60 second respawn timer and above settings set in the mission, the moment I launch the mission everyone needs to wait 60 seconds before being able to spawn in

polar folio
#

hm. sounds like it's a bug with the template tbh

#

BIS template respawn, right?

turbid thunder
#

3DEN in-house settings

#

No description.ext used

thin pine
#

uhhm

turbid thunder
#

And its one of the go to mistakes mission makers do in the arma 3 unit I used to be in. Respawn on custom location + spawn selection = lets wait additional 30 seconds before we can spawn in after the mission started

thin pine
#

respawnOnStart = 0; in description.Ext? this?

turbid thunder
#

Possibly

#

gonna try that

#

@thin pine Thx that seems to do the trick

subtle ore
#

RespawnOnStart 0 will run the respawn script, but not to actually respawn. 1 will run respawn script and actually respawn. That was the biki explanation, i guess if you set it to 0 it wont count as a respawn i suppose

turbid thunder
#

Yeah, basically setting it to 0 means that you won't see the respawn menu until you actually die which is exactly what I needed

#

Another issue though: Special characters like Miller loose their face whenever I do anything with their attributes (Because said attributes contain the identity and millers face isnt selectable there, thus resetting it) any workaround for that?

jade abyss
#

1 = true
0 = false

thin pine
#

1 = 0 0 = 1

turbid thunder
#

@jade abyss I know but that wasnt my point :S

jade abyss
#

Yeah? And?

turbid thunder
#

Nothing

jade abyss
#

erm, okay? ^^

turbid thunder
#

Still wondering how I fix that Miller looses his face

#

Or, how to make him still appear as miller

jade abyss
#

(iirc) setIdentity

turbid thunder
#

Well, now I just need to figure out the identity name of miller. Can't test it right now but, I'm just gonna assume its not "Miller" is it?

dusk sage
#

Using the debug console for writing code is retarded in the first place.
Right in the feels

peak plover
#

I think it's used for debugging scripts that have been written earlier. That's why he uses comment '';. So he can simply copy the script straight into the debug console and make small edits without reloading the mission.

plush cargo
#

@polar folio did you figure out the ui texture?

jade abyss
#

Added: New modelToWorldWorld and modelToWorldVisualWorld script commands (transforming model coordinates to world coordinates with absolute height without any adjustments)
modelToWorldWorld
modelToWorldVisualWorld
Rly? 😄

dusk sage
#

plz

#

What goes through their head when they name them?

little eagle
#

I'm amazed that people actually defend using comment when they also argue for count over forEach.
I mean, sure, Quiksilver is just trolling as always, but everyone else should be ashamed.

#

Pretty sure it's a typo and the command is named modelToWorldVisual

#

Oh, wait. That already exists. modelToWorldWorld oh wow.

dusk sage
#

Makes sense if you plan to use the debug console a lot

#

Sometimes I forget about comments, spend 20 seconds or so deleting them

#

Gets annoying

rotund cypress
#

Does anyone know a good way of adding "categories" to a listbox?

#

Like

  • Category 1
    -- Item
    -- Item
still forum
thin pine
#

imo comment should only be used for debugging scripts in the console, making small adjustments. When final tweak is done and nomore debug console is needed, I replace em with // (or i remove the preprocessor comments b4 testing in console)

civic maple
#

Why would anyone use comment?

plucky beacon
#

^

#

I know BI uses it for output on their arsenal

thin pine
#

if one is sure one tweaks a script in the debug console where regular preprocessor comments are not allowed and one must absolutely preserve those comments for some reason, one may use comment

civic maple
#

so, basically never?

thin pine
#

basically once in every 5000 blue moons

#

😄

plucky beacon
#

Every solar eclipse

civic maple
#

that often?

thin pine
#

when all the planets in the solar system align

dusk sage
#

If I wanted to focus on debugging in the debug console I'd use them

#

I just forget

plucky beacon
#

use the diaglog

thin pine
#

and spam the rpt? lol

plucky beacon
#

YA

#

while true
diag_log "fuck your performance";

civic maple
#

: ^)

thin pine
#

one should always put diag_logs in perFrame handlers

civic maple
#

gotta love dem 100 MB+ log files

plucky beacon
#

I can do one better

thin pine
#

for maximum performance

plucky beacon
#
while {true} do {
    0 = [] spawn {
       while {true} do {
         diag_log "spamming log until your computer dies";
      };
   };
};
civic maple
#

OH GOD

plucky beacon
#

virus activated

#

does this qualify as malicious code?

#

you all be good boys and not use that

jade abyss
#

@plucky beacon

ABC =
{
         while {true} do
         {
                  diag_log "spamming log until your computer dies";
                  [] spawn ABC;
         };
};

[] spawn ABC;
civic maple
#

GG

plucky beacon
#

LOL

civic maple
#

missing brace for while {true}?

thin pine
#

missing bracket!!!

#

triggerd

civic maple
#

yay we did it

#

\o/

plucky beacon
#

We shut down arma

#

Imma use this code now

jade abyss
#

Fkn spawn{ ppl instead of
spawn {

thin pine
#

you a newline bracketeer?

civic maple
#

Braces on same line master race

jade abyss
#

Yes, much cleaner and you can see on the first look, where it opens and where it closes.

thin pine
#

im with ya Dscha. screw sameline brackets

#

It is much cleaner indeed

jade abyss
#

Sameline brackets is for noobs! all hail the Newliners!

civic maple
#

😦

plucky beacon
#

newliners have neater code

thin pine
#

a happy newline is a happy coder

jade abyss
#

Newliners = bestliners!

civic maple
#

halp im being oppressed

jade abyss
#

With reasons.

#

filthy Sameliner

plucky beacon
#

A newline a bracket keeps the bugs back a bit

#

rhyme fail

thin pine
#

a bracket a line, keeps your faults in line

plucky beacon
#

used same word

#

a bracket a line keeps your bugs defined

civic maple
#

can we all agree on that we can't rhyme?

thin pine
#

programmer's poetry

#

lol

jade abyss
#

They can't

plucky beacon
#

programmer poetry

#

while (can't rhyme) do{12 things at the same time}

jade abyss
#

Okay, back to scripting stuff again. Getting outta hand again 😄

thin pine
#

a bracket a line, your script's all fine - my final attempt

jade abyss
#

oh ffs, rly Nitro? 😄

plucky beacon
#

ye :3

#

Look it's scripting related, I did code

#

we're back on topic

jade abyss
#
     if(_x isKindOf "SmartAss")then{bitchslap _x};
}forEach (units Channel);```
thin pine
#

((units Channel) select { _x isKindOf "SmartAss"}) apply { bitchslap _x; _x };

jade abyss
#
{
    if(name _x == "MrSanchez")exitWith{closeDialog 0;};
}forEach (units Channel);
thin pine
#

if (local _sanchez) then { createDialog "Discord"; };

#

the way you don't put a space between the last bracket and forEach hurts my eyes

jade abyss
#

I can live with both, tbh. The NonSpace Version looks more professional since (I HAVE NO TIME TO PRESS SPACE!)

thin pine
#

😄

plucky beacon
#
if (_uid == _Sanchezuid) then
   {
        player setAnimSpeedCoef 0.1;
   };
#

you will play arma at 1/10 speed

thin pine
#

pffft ill adjust the moves config, set everything to 10x

plucky beacon
#

not if I'm checking addons

thin pine
#

in that case, more time for coffee while playing

plucky beacon
#

get that autorun feature

#

also spot on aiming

jade abyss
#
if (_uid == _Sanchezuid) then
   {
        player setVelocity [100000000,0,0];
   };```
thin pine
#

input is an array with xyz

jade abyss
#

it is whistle

plucky beacon
#
while (gay) do
   {
      hint "you are gay";
      playSound "LoudScreeching";
   };
thin pine
#

pffffff

#

why hintSilent. Let the noise be heard.

#

I love the old arma 2 hint sound

#

on a loop ofc

#

now i think of it, is there autorun in arma?

plucky beacon
#

nu

#

there are mods

thin pine
#

ah Cyprus made a mod yeah

#

I was about to go and make one myself here

little eagle
#

quality discussion while I was gone I see

thin pine
#

always 😃

civic maple
#

ofc

plucky beacon
#

We're solving the real issues here commy

#

none of those bugs or errors

#

just the problem of not enough shitcode

little eagle
#

I can't save every chat.

plucky beacon
#

are you the hero we need, not the one we deserve?

#

<3

little eagle
#

yes

#

I am the terror that flaps in the night.

jade abyss
#

*-l

little eagle
#

What kinda smiley is that, Dscha?

jade abyss
#

\Okay, again: * -L / *remove L

little eagle
#

Gesundheit.

jade abyss
#

Danke.

dusk sage
#

I can't wait to make some ambigious code with these new commands

plucky beacon
#

@_@

#

I'm naming all my variables "variable_x" :P

#

ambiguity

dusk sage
#

_1, _2, _3, _4

#

waste no time

little eagle
#

_1, _11, _111, _11111, _111111, _1111111

dusk sage
#

Think of the bytes commy

little eagle
#

_I vs _l

dusk sage
#

They are going extinct

#

You can start local vars with numbers, as it's denoted by the _

#

Eh, am I going crazy

tough abyss
#

lol i noticed my mistake lol

little eagle
#

Comment was deleted.

plucky beacon
#

your mistake was looking at anything we been writing 1 hour ago

little eagle
#

missionNamespace setVariable ["0var", 127];

dusk sage
#

Does it work?

little eagle
#

idk

civic maple
#

does sqf support Unicode as variable names?

little eagle
#

ASCII

civic maple
#

aww

dusk sage
#
missionNamespace setVariable ["5", 6];
_1 = 5 + 1;
#

plz

little eagle
#

And without setVariable it's only letters and numbers

#

That will not work, BoGuu as "5" is a "reserved variable"

dusk sage
#

We can dream

#

So it's just the parsing then

#

You can use setVariable on numbers

little eagle
#
missionNamespace setVariable ["0var", 127];
missionNamespace getVariable "0var"
->
127

works

jade abyss
#

Deam?? It would be a nightmare if numbers where Vars!

dusk sage
#

See the picture

#

Just doesn't work when parsing because it's not expected to be a another type

jade abyss
#

Yeah Commy, but a simple 0var check resulst in error ("Error missing ;" )

little eagle
#
missionNamespace setVariable ["äöüß", 12];
missionNamespace getVariable "äöüß"
->
12
dusk sage
#

Oh boy this is fun

#
0 = "hi";
missionNamespace getVariable "0"; -> "hi"
little eagle
#

really?

dusk sage
#

yep

little eagle
#

Shit it's real

jade abyss
#

Oh my

little eagle
#

inb4 security hole by being able to end anticheat threads that are started via
0 = 0 spawn {

dusk sage
#

Guys

#

I'm releasing my obfuscation tool, plz buy

jade abyss
#

fml -.-

dusk sage
#

Gonna hide the code in numbers

#

shhhhhhhhhhh

little eagle
#

The BoGuu namespace

jade abyss
#
0 = "hi";
0 = 0 spawn{systemchat "test"};
missionNamespace getVariable "0"; //<NULL-script>

Oh my

little eagle
#

yup.

#
0 = 1;
missionNamespace getVariable "0"
-> 1
#

At least
0 = 1; with missionNamespace do {0}
Is still 0

jade abyss
#

At least, normal 0 is still 0

#

Yeah

little eagle
#

Not so fast, Dscha

#
0 = -0;
missionNamespace getVariable "0"
->
-0
jade abyss
#

No, its okay. I don't wanna hear anymore, it could affect my reality.

#

Yeah, thats normal.

dusk sage
#

yes

#

this is it

#

There must be a way to break it all from here

#

Keep writing shit code, we've got this

little eagle
#

Looks pretty broken to me already.

#

This is not shitcode. This is art.

jade abyss
#

As long as it only reacts to getVariable -> No Prob, tbh

dusk sage
#

Google numbers
Did you mean 'ARMA numbers?'

little eagle
#

True. It's just funny.

still forum
#

numbers are parsed into special instructions at compile time.

#

just like strings. but unlike true/false which are still function calls

dusk sage
#

shh

jade abyss
#

wait a sec

little eagle
#
_null = 0;
_null2 = -0;
[_null == _null2, _null isEqualTo _null2]
->
[true, true]
#

So isEqualTo makes no difference between them

#

0 and -0

dusk sage
#

0*-1 == -0

#

nailed it

jade abyss
#

puh, at least this doesn't work :D

missionNameSpace setVariable ["true",false];//reserved Variable
little eagle
#
_null = 0;
_null2 = -0;
[_null == _null2, str _null == str _null2]
-> [true, false]

str can detect 0 vs -0.

dusk sage
#
test = "_var";
_test = {
params [test];
hint str _var;
};

[1] call _test; //1
#

heh

peak plover
#

Is that how you use params?

little eagle
#
_null = 0;
_null2 = -0;
[_null] isEqualTo [_null2]
->
true
#

@peak plover The string can be a variable too, but it's unusual.

dusk sage
#

Yes @peak plover Makes my code more readable

little eagle
#

less*

jade abyss
#

omg

#

mom

little eagle
#

🍿

jade abyss
#
missionNameSpace setVariable ["null",player];

missionNamespace getVariable "null"; // O Alpha 1-1:1 (Khairullah Sabet)

isNull null; // false

^^

little eagle
#

null is used by so many people (and for no reason most of the time), that that code isn't really safe.

jade abyss
#

Some stuff that you can irritate some ppl with 😄

peak plover
#

Mind isEqualTo 'blown'

plucky beacon
#

if null == null

little eagle
#
objNull == objNull // false
controlNull == controlNull // false
displayNull == displayNull // false
grpNull == grpNull // false
locationNull == locationNull // false
taskNull == taskNull // false
scriptNull == scriptNull // ERROR
configNull == configNull // true
still forum
#

Yey consistency

little eagle
#

To be fair

#

inheritsFrom configFile == configNull // true

#

You could achieve configNull by using inheritsFrom configFile and they probably didn't want to break stuff.

#

It's more annoying that str configNull is "", so it's basically invisible in the debug console

#

also

#
isNull teamMemberNull // ERROR
jade abyss
#

tbf: Who would use that.

little eagle
#

I don't even know if it's implemented correctly.

jade abyss
#

Don't think so. Can't even think of a usefull thing to do with it

little eagle
#

It has some weird "control structures" associated with it:

{} forEachMember _team;
{} forEachMemberTeam _team;
{} forEachMemberAgent _team;
#

It's just all sorta fucked and circular though:

Syntax:
    team addTeamMember member
Parameters:
    team: Team Member
    member: Team Member
Return Value:
    Nothing
#

TEAM_MEMBER was another candidate used as variable container for pseudo namespaces, but LOCATION was faster.

#

So, it's useless.

jade abyss
#

hm

little eagle
#

This is a reserved Type for future implementations. In Armed Assault it is not implemented yet.

#

Well. That means never then.

#

I wonder if you can hack something together with this though.

#

Those not forEach'es look interesting.

little eagle
#

I think I figured it out:

modelToWorld            // reports AGL, simulation thread
modelToWorldVisual      // reports AGL, render thread
modelToWorldWorld       // reports PosWorld, simulation thread
modelToWorldVisualWorld // reports PosWorld, render thread

PosWorld is the same as ASL, but with the model center being z=0 instead of the lowest point in the LandContact LOD.

#

They fucked up when naming PosWorld. It doesn't really describe what it is all that well.
One "world" refers to model space vs map ("world") space and the other "world" refers to PosWorld.

#

There, chat saved. Suck gas, evildoers.

dusk sage
#

Yes but

#

commy

#

Why do they have such shit names

little eagle
#

Because they didn't anticipate having a PosWorld variant for modelToWorld.

#

I have no idea why they named it PosWorld. It doesn't even have to do anything with the world. The actual difference in the z coordinate is zero being model center instead of the lowest point in LandContact.

#

Should've been ASLCenter

#

getPosASLCenter instead of getPosWorld

#

ASL, cause it's ASL, Center cause it uses the models center.

#

logic ¯_(ツ)_/¯

#

modelToWorldVisualASLCenter

#

Still shit, but at least the words all make sense on their own.

jade abyss
#

(just pasted for some reading)

little eagle
#

Actually they already have a command named getPosASLVisual

jade abyss
#

oh wait

#

Wasn't it possible to raise the height of the water?

little eagle
#

So the visual comes after the "z type"

#

modelToWorldVisualWorld should be named
modelToWorldWorldVisual for consistency

#

It's not possible to raise the water, Dscha.

jade abyss
#

Of course

little eagle
#

-.-

#

That is not ingame

jade abyss
#

Of course