#arma3_scripting

1 messages Β· Page 333 of 1

cloud thunder
#

So _newVehicle it a string untill after first run. Problem is they are srings at preinit not objects

little eagle
#

You're wrong somewhere. At preInit, there are no objects. Not even the module. So there cannot be a module script.

vivid quartz
#

dont use modules at all, its way easier to do stuff for your needs outside editor

little eagle
#

Agreed.

cloud thunder
#

How easy then would it be to get a list of applied sensors from editor and reapply to a respawned vehicle not using modules?

little eagle
#
10:44:53 ["a",[bis_o1,bis_o1]]   <<< initial respawn


10:45:17 ["a",[bis_o1,bis_o1]]  <<< cursorTarget setDamage 1
10:45:27 ["a",[bis_o1,bis_o1]]
10:45:34 ["a",[bis_o1,bis_o1]]
#

It worked for me just now four times in a row.

#

I think it would be easier if you write your own replacement for the vehicle respawn module.

cloud thunder
#

What? what would be easier and for who?

little eagle
#

Me. :/

vivid quartz
#

πŸ˜‚

cloud thunder
#

Your easy alright

little eagle
#

I was about to write "anyone", but then I reconsidered.

#
["Plane", "init", {
    params ["_plane"];

    _plane enableVehicleSensor blah
}] call CBA_fnc_addClassEventHandler;

^ anyone can use this : P

tough abyss
cloud thunder
#

not peolpe on an unmoded server wich is the majority on an umoded server or servers that use keys and no mods

#

Im not trying to make mod requirements. I keep them optional

little eagle
#

Fixed: The BIS_fnc_addStackedEventHandler function did not accept object argument or function name
Well, let's hope they didn't do what I think they did. Because it's broken for anything that isn't bool / number / array / string; not just object.

tough abyss
#

so far i haven't seen any issues, but i didn't test extensivly

#

object, code and number and strig are working

#

Is this RscTitles's structure fine? ```CPP
class RscTitles {
class ai_count {
duration = 1e6;
idd = 81000;
enableDisplay = 1;
name = "ai_count";
class controls {
class structuredText {
idc = 81001;
text = "AI: 999";
x = "1 * safezoneW + safezoneX";
y = "1 * safezoneH + safezoneY";
w = "0.03 * safezoneW";
h = "0.03 * safezoneH";
};
};
};
};

little eagle
#

Yeah, @cloud thunder . I guess the best you can do is to have a loop that does something like this:

// init
spawn {
    while {true} do {
        sleep 5;

        {

            if !(_x getVariable ["commy_isprocessed", false]) then {
                _x setVariable ["commy_isprocessed", true];

                _x enableVehicleSensors [blah];
            };
        } forEach allMissionObjects "B_Plane_Fighter_01_F";
    };
};
#

@tough abyss try group

subtle ore
#

is there an alternative to allMissionObjects , because it seriously takes al ong time even with a specified classtype to finish searching

little eagle
subtle ore
#

Oh, sweet. Very neat.

little eagle
#

This looks through fewer and shorter lists.

#

But it can't find flying ammunition, butterflies, bullet holes and stuff like that.

subtle ore
#

Lol, pretty sure allMissionObjects can even find blood decals...?

tough abyss
#

@little eagle group == object afaik

little eagle
#

The ones from ACE it can find.

#

@tough abyss No, GROUP is a different type from OBJECT

tough abyss
#

ok

cloud thunder
#

You don't need a loop to enable vehicle sensors. Thats a waste and that loop is not detecting editor set sensors.

little eagle
#

OK, then you're on your own I guess.

tough abyss
#

Ah!

#

I seems that the issue was that I forgot to : RscText.

vivid quartz
#

@cloud thunder

sh_fnc_vehRespawn= {
    params ["_old"];
    private "_new";
    _new=objNull;
    _type= typeOf _old;
    _pos=getPos _old;
    _sensors=listVehicleSensors _old;
    {
        _isEnabled=((_old isVehicleSensorEnabled (_x select 0)) select 0 select 1);
        if (_isEnabled) then {
            _sensors deleteAT (_sensors find _x);
        };
    }forEach _sensors;
    deleteVehicle _old;
    sleep 0.5;
    _new=createVehicle [_type,_pos,[],0,"NONE"];
    _new addEventHandler ["killed",{[_this select 0] spawn sh_fnc_vehRespawn}];
    waitUntil {!isNull _new};
    {
        _new enableVehicleSensor [(_x select 0), false];
    }forEach _sensors;
};
#

just tested on wasp, and it works.

cloud thunder
#

Where is this executed from?

little eagle
#

init.sqf

vivid quartz
#

well you might want to run this server side , if its mp enviroment

little eagle
#

killed wouldn't trigger if this code only runs on the server when the plane was boarded when it died.

#

init.sqf

vivid quartz
#

yeah then init.sqf

cloud thunder
#

your passing old vehicle so is this from expression filed of Vehicle Respawn Module? Putting this in init.sqf would just store the function. It has to be called from somewhere..

vivid quartz
#

dont use modulessssssss

#
this addEventHandler ["killed",{[_this select 0] spawn sh_fnc_vehRespawn}];
cloud thunder
#

whre do you call the function?

vivid quartz
#

in vehicle init

cloud thunder
#

Ok thanks

little eagle
#

The waitUntil {!isNull _new}; is superfluous. It's never null.

vivid quartz
#

yeah,idk why i even put it after sleep lol

mortal halo
#

help

#

dropweapon doesnt work for me

still forum
#

@vivid quartz You know you can use the private keyword right?

    private "_new";
    _new=objNull;

is essentially just a uglier and slower version of

private _new = objNull;

also Why do you initialize _new to objNull? You never use it till you assign it from createVehicle. Which overwrites anything you put into it before anyway.

vivid quartz
#

yeah, that was bad of me, same like useless waitUntil there.

#

@mortal halo what do you mean dropweapon? give us an example of what youre trying to do

still forum
#

Sqf command dropWeapon

mortal halo
#

no im talking about the main exploit of putting weapons with items into a container

#

using action ["DropWeapon"

#

...

#

that's the only part of my lovely function that doesnt work

vivid quartz
#

so you want to put a weapon into container?

mortal halo
#

yeah, with attachments

#

on it

vivid quartz
#
player action ["DropWeapon", myContainer(object), primaryWeapon player];
#

or currentWeapon whatever

mortal halo
#

no no here's the deal

#

it works for me in the debug console

#

but as for my code, just doesn't work. i create a unit and make it drop

#

and it doesn't 😦

cloud thunder
#

@vivid quartz sh_fnc_vehRespawn= { params ["_old"]; private "_new"; _new=objNull; _type= typeOf _old; _pos=getPos _old; _sensors=listVehicleSensors _old; { _isEnabled=((_old isVehicleSensorEnabled (_x select 0)) select 0 select 1); if (_isEnabled) then { diag_log text format ["Previosly Enabled Sensor: %1", ((_old isVehicleSensorEnabled (_x select 0)) select 0 select 0)]; _sensors deleteAT (_sensors find _x); }; }forEach _sensors; deleteVehicle _old; sleep 0.5; _new=createVehicle [_type,_pos,[],0,"NONE"]; sleep 0.1; _new addEventHandler ["killed",{[_this select 0] spawn sh_fnc_vehRespawn}]; { _new enableVehicleSensor [(_x select 0), false]; diag_log text format ["Disabling Sensor: %1", (_x select 0)]; }forEach _sensors; }; F-18 Bllack Wasp non stealth version
All sensors enabled in editor
4:13:35 Previosly Enabled Sensor: IRSensorComponent
4:13:35 Previosly Enabled Sensor: PassiveRadarSensorComponent
4:13:35 Previosly Enabled Sensor: LaserSensorComponent
4:13:36 Disabling Sensor: VisualSensorComponent
4:13:36 Disabling Sensor: ActiveRadarSensorComponent
4:13:36 Disabling Sensor: NVSensorComponent

All sensors disabled in editor
4:16:09 Previosly Enabled Sensor: IRSensorComponent
4:16:09 Previosly Enabled Sensor: PassiveRadarSensorComponent
4:16:09 Previosly Enabled Sensor: LaserSensorComponent
4:16:09 Disabling Sensor: VisualSensorComponent
4:16:09 Disabling Sensor: ActiveRadarSensorComponent
4:16:09 Disabling Sensor: NVSensorComponent

#

I don't think its working

mortal halo
#
    _dummy = call fn_createEmptyUnit;

    {
        private ["_weapon"];
        _weapon = (_x select 0);
        _weapon = _weapon call BIS_fnc_baseWeapon;
        _dummy addWeapon _weapon;
        {
            if(_forEachIndex > 0 && !(_x isEqualTo "") && !(_x isEqualTo [])) then {
                _dummy addWeaponItem [_weapon, _x];
            };
        }foreach _x;
        hint primaryWeapon _dummy;
        _dummy action [ "DropWeapon", _container, _weapon ];
    }foreach _weapons;

    deleteVehicle _dummy;
};```
#

fn_createEmptyUnit simply creates a unit, removes all weapon , disables damage and disables AI

#

before calling the action, the hint returns the primary weapon added (ofcourse, im testing it with a primary weapon)

#

i've tried commenting deleteVehicle _dummy because it might delete the unit before the action is done

#

still doesnt work

vivid quartz
#

@cloud thunder yeah, thats the point of it, it disables the sensors you dont want, and leaves the ones that you want

little eagle
#

@mortal halo DropWeapon action never worked in A3.

#

Reliably at least.

mortal halo
#

damn

#

how would i add a weapon with attachments to a container then

little eagle
#

You can't.

mortal halo
#

no

little eagle
#

You ran into the same issue as many before you did.

mortal halo
#

but it works for my player

#

in the debug console i can make it happen

#

maybe its because i've disabled some of the AI?

#

i dunno

little eagle
#

It doesn't work reliably and there is no way to fix it.

peak plover
#

There are workarounds 'tho

cloud thunder
#

@vivid quartz But "Previosly Enabled Sensor" is not showing the sensors I enabled in the editor. By default all sensors are dissabled.

little eagle
#

Jigsor, the editor is bad. Just enable them manually...

vivid quartz
#

@cloud thunder i don't really know whats wrong, i tried the script above with multiple sensors, and with 1 sensor, it works, use

vehicle enableVehicleSensor [componentName, state]
cloud thunder
#

I know that command in that context example it works. @little eagle quit being useless

little eagle
#

this could've been solved hours ago Β―_(ツ)_/Β―

cloud thunder
#

But you didn't you just kept posting uselessness foy my application.

little eagle
#

No, but you dismissed it, because it required you to think a bit for yourself instead of being a copy paste solution.

peak plover
#

😡 🌴

little eagle
#

I told you why it doesn't work, what should be done instead and linked the feedback tracker issue where it says it's broken.

#

"but it's not what I want waha"

#

Β―_(ツ)_/Β―

cloud thunder
#

Dude get overyour self I'm not using the repawn module here

little eagle
#

Good.

#

Now also drop the editor attributes and use the enable sensor commands manually.

cloud thunder
#

And quit clogging with uselessness again

little eagle
#

But that IS the solution. How is the solution useless?

obsidian chasm
#

Is it possible to make me and my friends spawn in the air in 'Escape Tanoa'? I can add the parachute/elavation in a fresh file but there must be code forcing my characters to spawn with a regular back pack. removebackpack this; this addbackpack "B_Parachute"; That's what I'm currently using to add backback

cloud thunder
#

CBA or anything you poosted is not the solution for passing editor set sensor attributes to a respawned vehicle for unmodded

mortal halo
#

okay commy well i've monitored the behaviour. for now i've found 2 things:
first - i can't deleteVehicle straight away because it takes a second until the weapon is actually dropped into the container

little eagle
#

I also posted an alternative for when you're not using any mods.

#

But you didn't like it.

mortal halo
#

and seocnd it doesn't work when i spawn the dummy unit in [0,0,0]

#

probably because it is water, and the unit does an animation

peak plover
#

@obsidian chasm I think escape tanoa uses vanilla respawn system and you don't respawn when you first start the mission, but jip is considered respawn. Do you just want to start in the air when you first start the mission or all the time?

little eagle
#

Yuval, give it up. DropWeapon doesn't work.

obsidian chasm
#

@peak plover Just the first time so my friends are like "woah thats cool" πŸ˜›

mortal halo
#

yeah but it does work. i've spawned the unit near me and everything works fine.

little eagle
#

It has many problems and you will not be able to solve them all.

#

No it doesn't work. Only working sometimes is the same as not working.

mortal halo
#

I'd say it is more like "only working under certain conditions"

little eagle
#

Yes, but you cannot control these conditions.

#

For example, it will fail when you rotate your character while you're dropping the weapon.

#

That happens all the time.

mortal halo
#

yeah but im not working on a character

#

im working on a disabledAI unit

#

it's just a placeholder for adding weapons into containers

#

it's tough

#

it's ugly

#

but its gonna work

little eagle
#

Do what you want, but I'll tell you that it will never work reliably.

mortal halo
#

probably. but my project is all about inventory. i can't give up especially if i can make it work somehow haha

#

we'll see but thanks for the heads up

obsidian chasm
#

@peak plover I guess a run down of my 'mission' would help?. We start with the regular gear and then use the 'Arsenal' to switch gear to our preferred stuff, we die and respawn using the arsenal gear.

mortal halo
#

people said it wasn't possible to copy a container inside a container with all it's items

#

i've sat down for a few hours and made an algorithm for it

peak plover
#

To start in air you can just place the units like 1km on top of the starting position

little eagle
#

It isn't possible. Try to copy a weapon with manually changed weapon attachments from one crate to another.

obsidian chasm
#

@peak plover Yeah I did the elavation part but my soldiers don't spawn with a parachute, so they just kind of die.. haha

mortal halo
#

@little eagle thats exactly what im doing

peak plover
#

Do it in initPlayerLocal

little eagle
#

It doesn't work, because the game is missing required API.

obsidian chasm
#

I'm guessing I need to edit the player loadouts or something?

peak plover
#

create a file called initPlayerLocal.sqf inside the mission directory

mortal halo
#

i've got everything working except weapons

#

so im trying to fix it

little eagle
#

Well, weapons don't work. And neither do backpacks btw.

obsidian chasm
#

I have one already

mortal halo
#

backpacks do

obsidian chasm
mortal halo
#

it's working for me

obsidian chasm
#

it has all the player loadouts inside

mortal halo
#

copied a backpack with items from a box to another

#

it's a tough algorithm

#

but it works

#

the only thing i have not been able to deal with was weapons inside backpacks

#

vest

#

etc.

#

we'll see

little eagle
#

Yuval, you're reinventing the wheel. And everyone before you got stuck on weapon attachments.

cloud thunder
#

I can't find your solution commy2 could you post again?

peak plover
#

in it you can add ```sqf
params ["_player","_jip"];
if !(_jip) then {
_pos = getPosATL player;
_player setposATL [(_pos select 0),(_pos select 1),(_pos select 2)+1000];
removeBackpack _player;
_player addBackpack "B_Parachute";
};

little eagle
#
// init
0 spawn {
    while {true} do {
        sleep 5;

        {

            if !(_x getVariable ["commy_isprocessed", false]) then {
                _x setVariable ["commy_isprocessed", true];

                _x enableVehicleSensors [blah];
            };
        } forEach allMissionObjects "B_Plane_Fighter_01_F";
    };
};
obsidian chasm
#

@peak plover I should add that in and not remove something?

tame portal
#

@cloud thunder How does the editor save what sensors a vehicle should have enabled when it spawns?

little eagle
#

OPTiX, it's Eden attributes.

tame portal
#

Never worked with Eden before so I don't what that is :D always end up not using modules and such

cloud thunder
#

I already commented on that. Again, that does not gather sensor attibutes from editor and that loop is usless

tame portal
#

*know

peak plover
#

Yes, it will spawn any player that did not jip in 1500 meters of it's positions and give a parachute. It might not work, because it might set the position after the init in some other script

little eagle
#

Jigsor, you can't gather the sensor attributes from the editor.

cloud thunder
#

@tame portal mission.sqm I suppose as all editor placed objects

little eagle
#

The loop is not useless. It finds newly respawned planes and applies the sensors you want.

peak plover
#

@mortal halo You can't loot weapons with attachments on them in PUBG, it seems to be an industry wide problem /jk

cloud thunder
#

You don't need a loop to apply sensors

peak plover
#

How does ace 3 handle looting weapons from unconcious people?

little eagle
#

But you need one to find freshly spawned planes.

#

How is this so difficult to understand?

tame portal
#

@cloud thunder Can you give each jet a unique name in the editor? Or is it a requirement that that is dynamic

still forum
#

@mortal halo You can probably create a box with weapons and attachments by creating a box in CfgVehicles.

obsidian chasm
#

@peak plover No parachute spawned 😦

cloud thunder
#

Your saying apply same atributes to all planes of one class

peak plover
#

What backpack do you have?

#

if any?

mortal halo
#

yeah @still forum its an inventory system so configs are a no go.

obsidian chasm
#

This soldier doesnt have one, maybe thats the issue

peak plover
#

no, should not be an issue. Also that script only gives parachutes to players

#

Not ai

still forum
#

I don't see the relation between Inventory system and configs forbidden

tame portal
#

If the names are fixed, I'd simply use the loop commy proposed to initially make an array with each objects unique name and their configuration and in case a new vehicle respawns you just stringify that object again and look in your array for the corresponding sensor settings

mortal halo
#

im trying to recreate the functionality

little eagle
#

Your saying apply same atributes to all planes of one class
Not necessarily. You can do whatever SQF woodoo you want in that script.

cloud thunder
#

@tame portal Sure you could. Dynamic name is not required.

tame portal
#

Then I propose my solution

peak plover
#

cba has functions to add stuff to classes, right?

obsidian chasm
#

@peak plover Yeah it doesnt seem to work

peak plover
#

Try the code in the debug console, see if it works without

little eagle
#

cba has functions to add stuff to classes, right?
It has a function to add eventhandlers to classes.

tame portal
#

Look for all jets, save vehicle name and configuration in array, Mark the vehicle as "processed", wait until a new jet pops up that isn't processed yet, look for corresponding configuration, apply if found, if not register new jet @cloud thunder

#

Only works with fixed names though

peak plover
#

init eventhandeler for plane class and boom

little eagle
#

I suggested that too, but he's using no mods.

tame portal
#

My solution is what commy posted but a bit extended to fit your need "Each jet may have a unique configuration"

little eagle
#

And he is hellbent on using the eden attributes for the sensors even though that is the reason it doesn't work in the first place...

peak plover
#

Sooo, the eden does not work and he wants to make it work? don't you still need to have a mod to fiddle with the editor ?

#

Creating a custom mod would be far harder than using cba...

little eagle
#

They don't work in conjunction with the respawn module. Because respawning vehicles does not carry over the eden attribute things.

peak plover
#

Aaaa

little eagle
#

Vehicles can't really respawn. You just create a new one of the same type and delete the wreck.

#

It's different from respawning player units.

obsidian chasm
#

@peak plover nothing :\

peak plover
#

The plot thickens

tame portal
#

Is a sleeping script in any way bad for performance (if you don't care if the slept time is accurate or not) (in scheduled)? The script is just skipped in a frame if the sleep time has not expired yet, right? So it wouldnt use any additional time of the 3ms per frame

still forum
#

true

#

the engine has to check if the sleep is over though. But that's <5us (on my CPU. Better CPU = less time)

peak plover
#

@obsidian chasm ```sqf
_player = player;
_pos = getPosATL player;
_player setposATL [(_pos select 0),(_pos select 1),(_pos select 2)+1000];
removeBackpack _player;
_player addBackpack "B_Parachute";

little eagle
#

Well, the script is checked every frame if the sleep timer has passed.

peak plover
#

Does that not work in the debug box

little eagle
#

^ What dedmen wrote

tame portal
#

Sounds good

still forum
#

Also if the sleep is not over the script get's pushed to the end of the queue

obsidian chasm
#

ok so that works @peak plover

still forum
#

so If you have a high load on scheduled it only get's checked every few frames and doesn't impact the performance of others

tame portal
#

So it's guaranteed that it will be one of the last scripts checked per frame?

#

Ah okay

#

Yeah, makes sense if the 3ms have already been used up, it may just skip it a few frames

vivid quartz
#

it obviously wouldnt work if you paste this in debug console:

params ["_player","_jip"];
if !(_jip) then {
    _pos = getPosATL player;
    _player setposATL [(_pos select 0),(_pos select 1),(_pos select 2)+1000];
    removeBackpack _player;
    _player addBackpack "B_Parachute";
};
peak plover
tame portal
#

πŸ‘

peak plover
#

You can add code to the respawn module

still forum
#

not the last per frame. It starts from the start of the queue each frame and runs for 3ms. Each script that was executed get's pushed to the far end of the queue

#

so every other script will execute atleast once before your sleeping script is checked again

peak plover
#

Just put (_this select 0) enableVehicleSensors [blah];

still forum
#

your second statement is true

little eagle
#

EntityRespawned doesn't trigger for vehicles

peak plover
#

Ohh okay

little eagle
#

Because, as I said, vehicles don't respawn.

tame portal
#

Ok so

  1. Scripts not executed in a frame are higher priority next frame due to them being "left over in the queue"
  2. If a sleeping script was checked, it gets pushed to the back of the queue
still forum
#

yep yep.

obsidian chasm
#

@peak plover Ok So I just put _player = player;
_pos = getPosATL player;
_player setposATL [(_pos select 0),(_pos select 1),(_pos select 2)+1000];
removeBackpack _player;
_player addBackpack "B_Parachute";

inplace of what you originally sent me and it worked

tame portal
#

πŸ‘Œ

obsidian chasm
#

πŸ‘Œ indeed

#

many many πŸ‘Œ s

peak plover
#

Ok, but then

#

Add

#
if (time < 30) then{```before and a
```sqf
}```
after
#

Otherwise all players might get it

#

Even if they jip

obsidian chasm
#

Well I want everybody who spawns to do it, we only play with 3-4 people πŸ˜ƒ

peak plover
#

Sure, but the vanilal respawn system will make everyone who joins after 30 seconds spawn with the respawn system

obsidian chasm
#

ah..

peak plover
#

So it would break/not work

#

You all get into the mission together so you will all get it

obsidian chasm
#

I'm going to feel stupid for asking this but where do I add the new lines?

#

I only started doing this about a week ago.. lol

#

thats what mine looks like

peak plover
#

Soo

#

Check this out

#

This is how you can use a if

#

if you want to do more and learn, then get started early

obsidian chasm
#

if( I am confused, what do I do? πŸ˜„

peak plover
#

Can you get the entire file and put it on pastebin

#

something looks odd

#

Ok

#

So

obsidian chasm
#

yes ok

#

line 30

peak plover
#
if ( CONDITION ) then {
    CODE
};

if will be followed by a condition, if this condition is true it will execute/run/continue with the code inside the curly brackets after then. But if it's false it will skip it

#

ugh, you don't need to put that code into the eventhandler

obsidian chasm
#

I don't..?

peak plover
#
// Start the unit in air if it's been less than 30 seconds
if !(didJIP) then{
    _player = player;
    _pos = getPosATL player;
    _player setposATL [(_pos select 0),(_pos select 1),(_pos select 2)+1000];
    removeBackpack _player;
    _player addBackpack "B_Parachute";
};
// Handle JIP respawn
missionNamespace setVariable ["_initialRespawn", addMissionEventHandler ["PreloadFinished",
{
    removeMissionEventHandler ["PreloadFinished", missionNamespace getVariable ["_initialRespawn", -1]];
    missionNamespace setVariable ["_initialRespawn", nil];
 
    if (didJIP and (time > 30)) then
    {
        player enableSimulationGlobal false;
        player enableSimulation false;
        player hideObjectGlobal true;
        player hideObject true;
        forceRespawn player;
        deleteVehicle player;
    };
}]];
#

On your pastebin

still forum
#

DId anyone every try to use emoji as Variable Names in Arma?

peak plover
#

line 15 > line 35 the curly brackets show the code inside the eventhandeler

#

Oh god, that's the best idea today

obsidian chasm
#

So just put that in and we're golden?

peak plover
#

arma 4's scripts will be powered by emojis>
Victus, try it out

#

You need to take baby steps 'tho, because it seems you are still not grapsing the subject

#

Start small. There's ton of scripts online that you can learn from

obsidian chasm
#

I know..

#

It's pretty hard to grasp, sadly but I am trying

still forum
#
_😒 = "hello";
hint _😒;

can someone try that in debug console?

obsidian chasm
#

I mean it seems to work, will have to test it with friends

still forum
#

or

missionNamespace setVariable ["😒","hello test"];
hint (missionNamespace getVariable "😒");
little eagle
#

test Β―_(ツ)_/Β―

#
missionNamespace setVariable ["Β―\_(ツ)_/Β―", 1];
missionNamespace getVariable "Β―\_(ツ)_/Β―"

1
#

This works

still forum
#

Yeah. I asked if someone could test that cuz I don't have Arma open

peak plover
#

How do you get emojis

little eagle
#

So Japanese characters do work.

still forum
#

you copy paste

#

or ALT+Numpad 12

peak plover
#

♀

still forum
#

♀β™ͺβ™‚

#

not rly emojis though

peak plover
#

u\AFAS;Β©β”˜β–ΌΒ₯v┬zΓ„

little eagle
#
missionNamespace setVariable ["😒","hello test"]; (missionNamespace getVariable "😒");

reports "hello test"

still forum
#

:3

#

Wonder if that also works in Configs as a ofpec tag

#

That would be neato

tame portal
#

Inb4 whole missionfile only uses smileys as variable names

little eagle
#

But idk if it can differentiate between the emojis or if they all default to some null characters or something

#

Arma cannot display them

still forum
#

Emoji's are UTF-8 and Arma scripts understand UTF-8

#

as Γ„Γ–Γœ are also UTF-8

little eagle
#

πŸ€” πŸ˜„

tame portal
#

Well if it understands UTF8, you are free to use any characters you want

still forum
#

does that real variable without get/setVariable thingy also work?

#

I know russian Variable Names work. So I guess everything does

little eagle
#

No, only accepts a-z and _ as first char for variables

tame portal
#

Yep

#

Oh

still forum
#

Levitating businessman πŸ˜„
That's bad

tame portal
#

"πŸ™ƒ 😝 πŸ™„ πŸ˜‹ πŸ™ƒ πŸ˜‡ πŸ€— 😍 πŸ˜— πŸ˜›"

#

Good variable name

still forum
#

Mikero should use Emoji's in Variable names for his obfuscation

tame portal
#

Lol

still forum
#

stuff like πŸ–•

#

πŸ˜„

little eagle
#

missionNamespace setVariable ["πŸ€”", "thinking"];
missionNamespace setVariable ["πŸ˜„", "smile"];
[missionNamespace getVariable "πŸ€”", missionNamespace getVariable "πŸ˜„"]

tame portal
#

Would be funny the moment someone tries to deobfuscate and send it to his partner, it's full of emojis

#

Don't know how notepad displays those

peak plover
#

haha

still forum
#

Windows can do that. Arma apparently not.

tame portal
#

I assume it shows those plain simply versions?

still forum
#

Guess what! Orange DLC = Emoji

tame portal
#

*simple

little eagle
#

If I copy my versions, it says ":thinking :" :/

peak plover
#

orangle dlc replaces all text and script commands with emjoy

still forum
#

LUL

#

Intercept could add Emoji Script commands. I need to try that

tame portal
#

"Experience full scale open world warfare with the Emoji-DLC. Command squads with new dimensions, experience real communication problems, adding emojis instead of names or colors to squads! "πŸ€”, move, one and a half click, Nord East! ""

#

Brilliant DLC

#

By the time ArmA 4 releases, everyone will have forgotten his native language

peak plover
#

πŸ˜‚ πŸ˜‚ πŸ˜‚

tame portal
#

I'd buy that

#

Next April fools joke by BI

#

I promise

still forum
#

player 😰 otherUnit makes player look at other Unit and play funny animation lul

tame portal
#

DLC releases 4th of πŸŽ„

obsidian chasm
#

Is there a better word to use when searching for 'Parameters'? I'm looking for the ones you change before a mission and not the -no splash screen ones

#

these things

still forum
#

Mission Parameters

obsidian chasm
#

Thanks.

#

Is it possible to actually change the starting times to something more specific IE 6:15, 6:30, 6:45 etc?. I may as well ask here before I research this

still forum
#

yes

#

setDate

obsidian chasm
#

ok thanks, now to figure out how to do it πŸ˜„

still forum
#

They are configured in description.ext

obsidian chasm
#

Thanks.

#

It error'd when I tried 06.30

#

06 works though

tough abyss
#

@little eagle with the following, the text is created at the center of the screen and then moves to the desired position. Is there a way to create it at a set position, and have no movement? ```SQF
_control = findDisplay 46 ctrlCreate ["RscText", -1];

_control ctrlSetPosition [0.967152 * safezoneW + safezoneX, 0.951388 * safezoneH + safezoneY, 0.0352567 * safezoneW, 0.0470196 * safezoneH];
_control ctrlCommit 1;
_control ctrlSetText "AI: 999";

little eagle
#

Look up ctrlCommit on the wiki

tough abyss
#

Ah, so ctrlCommit 0;

#

Thanks.

#

Hmm, why am I getting an undefined variable error in a spawn loop after the above code (I removed the private) ```SQF
[] spawn {
_control ctrlSetText str time;
};

little eagle
#

Because _control is undefined. Local variables don't carry over into threads.

tough abyss
#

don't you need to pass it as argument to the spawn?

little eagle
#

Yes, you do.

tough abyss
#

Well, today I learned.

jade abyss
#

e.g.

_control spawn {
    _this ctrlSetText str time;
};```
tough abyss
#

Now it doesn't like serialization πŸ˜„

#

Is it bad practice to disable it in XEH_postInit?

little eagle
#

@jade abyss What you posted will always error. You cannot not pass a control or display inside an array.

#

@tough abyss Serialization is disabled on a thread by thread basis. So your suggestion makes no sense.

jade abyss
#

stahp correcting me, when i make mistakes!

#

You you you... you X!

little eagle
#

Stop making mistakes then.

jade abyss
#

No! I refuse!

little eagle
#

Stop making me correct you!

jade abyss
#

I call you X from now on.

tough abyss
#

The only error I get from @jade abyss's code is "serialization not supported for _control".

little eagle
#

Yes, you cannot pass a control unless it is inside an array.

still forum
#

Which is exactly what Commy said πŸ˜„

little eagle
#

Because the guys that made SQF are weird.

jade abyss
#

wait a sec

#

what if you add disableSerialization before _this bla (fk... i hate that word)

little eagle
#

You can't. _this exists before you can use any command. That is why you have to pass it as an array.

jade abyss
#

gay

still forum
#

Commy you typoed before You cannot not pass a control or display inside an array.

little eagle
#

The game does not complain about arrays containing controls and displays.

still forum
#

5:04 PM

tough abyss
#

@little eagle the game will find something to complain about...

little eagle
#

Strictly speaking, you don't have to disable the serialization. You just cannot ever store a control or display inside a variable unless it's an array.

jade abyss
#

I still have no clue, why you have to disable it anyway Β―_(ツ)_/Β―

little eagle
#

You can keep using
(_this select 0)

#

No, you don't have to.

#

I wouldn't do it just out of spite.

tough abyss
#

Well ```
18:10:00 Error in expression <AI: 999";

[_control] spawn {
_this ctrlSetText str time;
};>
18:10:00 Error position: <ctrlSetText str time;
};>
18:10:00 Error ctrlsettext: Type Array, expected Control

#

🀷

little eagle
#

Well duh.

jade abyss
#

_this select 0 ...

tough abyss
#

Right.

little eagle
#

_this is now an array and not a control.

tough abyss
#

I was about to ask how to un-array an array 🀦

jade abyss
#

πŸ‘

little eagle
#

With param

#

jk, select is fine here.

tough abyss
#

Yeah param [0].

jade abyss
#

for example

tough abyss
#

This is somewhere inside the an addon ```SQF
// param [0] is _this select 0 but faster, said commy2
param [0] params ["_control", "_value"];

still forum
#

param [0] is slower than _this select 0

little eagle
#

lol, should've double checked.

still forum
#

We prooved that as Commy talked about that with you a couple days ago

little eagle
#

But is it as fancy?

tough abyss
#

@still forum I saw that but ^

peak plover
#

but using param with default is faster than using select 0 with if isNil

still forum
#

So.. You thought "It's fancier.. So I'll just use it and add a comment saying that it's faster"

tough abyss
#

Yes.

still forum
#

Looks nice == fast. Okey. Good. Well...

jade abyss
#
comment "is faster!";```
still forum
#

Set all your graphics settings to max and you'll get more FPS.

It's sad that this is actually kinda true for Arma...

peak plover
#

comparing strings isEqualTo is faster @still forum

tough abyss
#

@still forum I rest my case.

still forum
#

Why are you telling me things that I know @peak plover ?

peak plover
#

you use nice == fast

little eagle
#

"faster" is not the comparative of "fancy"? Sorry, English is my second language. :3

still forum
#

Not seeing my sarcasm? .-.

tough abyss
#

Also the text in the control isn't updating.

peak plover
#

Man, this "set your settings to low" is a lie

#

I love that people still belive this

still forum
#

Well it's common sense

peak plover
#

*'set your settings to high to reduce cpu load'

tough abyss
#

I don't remember stopping time being a feature of this script πŸ€”

peak plover
#

Shit. I'm off the case

still forum
little eagle
#

@jade abyss comment is a reserved variable. That will error.

jade abyss
#

remove the = ... oh ffs

little eagle
#

haha

peak plover
#

😡 🌴

jade abyss
#

πŸ–•

little eagle
#

😘

jade abyss
#

πŸ˜–

tough abyss
#

I'll go ahead and rustle some jimmies here. Is while {true} do {}; the same as [] spawn {};?

little eagle
#

No.

tough abyss
#

dscha isn't as fit as he used to be πŸ˜›

peak plover
#

No, while {true} do {} will run indefinately and script won't continue from it

jade abyss
#

I got fkn 32Β°C in my flat... i am happy that i am still alive and not melted away

little eagle
#

indefinitely*

tough abyss
#

Wait so why is the time not changing?

little eagle
#

What's your script?

peak plover
#

It won't go past while {true} do {};

#

It will stay inside the do {};

tough abyss
#

This inside debug console ```SQF
_control = findDisplay 46 ctrlCreate ["RscText", -1];
_control ctrlSetPosition [0.967152 * safezoneW + safezoneX, 0.951388 * safezoneH + safezoneY, 0.0352567 * safezoneW, 0.0470196 * safezoneH];
_control ctrlCommit 0;
_control ctrlSetText "AI: 999";

[_control] spawn {
_this select 0 ctrlSetText str time;
};

little eagle
#

Well duh. You set the time once.

#

Of course it will never move.

tough abyss
#

I don't understand.

peak plover
#
[_control] spawn {
    waitUntil {_this select 0 ctrlSetText str time;false};
};
#

try this

tough abyss
#

Use param [0] REEEEEEEEEEE

little eagle
#

You didn't either.

peak plover
#

use () around your _this select 0

tough abyss
#

Ah yeah it works.

#

Why, though?

little eagle
#

Because now you set the time every frame.

peak plover
#

Because waitUntil will loop until the inside of {} returns true

#

or exitWith

little eagle
#

nigel, exitWith will not leave the waitUntil scope.

peak plover
#

Are you sure?

little eagle
#

Yes.

jade abyss
#

Yep

little eagle
#

Try it.

jade abyss
#

We had that Discussion a few weeks ago

peak plover
#

ahh, woa, yeah have to exitWith {true}

little eagle
#

It's retarded, but it's also SQF we're talking about.

#

Yeah, that is different then.

peak plover
#

I've used this as well, but yeah SQF is pretty surprising

tough abyss
#

So in theory waitUntil's scope is not an actual scope?

peak plover
#

Yea

#

I think it might be

little eagle
#

It's a scope you can't leave with exitWith.

peak plover
#

But it will start agin

little eagle
#

Can't remember if we tried breakOut / breakTo or throw for that matter

peak plover
#
waitUntil {if (isNil "test123") exitWith{false};true}
#

What will this do?

tough abyss
#

Voodoo magic.

still forum
#

execute code once and always exit

little eagle
#
waitUntil {!isNil "test123"}
#

Same as this ^

still forum
#

Doesn't exitWith in waitUntil exit always?

peak plover
#

Ok, so exitWith will stop the current loop but a new one will be created instead

little eagle
#

No, dedmen. You cannot leave the waitUntil scope with exitWith as was said 5 lines above.

peak plover
#
waitUntil {if (isNil "test123") exitWith{exitWith{};};true}
jade abyss
#

ffs

tough abyss
#

How many exitWiths are we going to test?

still forum
#

So it was not that exitWith leaves always it was that it leaves never also when you exitWith true right?

#

won't work nigel

jade abyss
#

Vote:
Remove write Permission of Nigel
[X] Yes!
[] Maybe
[XXX] Commy smells like old chicken

still forum
#

exitWith is a binary command

#

you are missing the left argument there

little eagle
#

It leaves every scope, dedmen. Except the waitUntil one.

tough abyss
#

Also thanks everyone, the fancy AI counter now works.

still forum
#

Yes. But something with exitWith on waitUntil was special. does exitWith true end the waitUntil? because it returns true?

little eagle
#

How does old chicken smell like?

jade abyss
#

You

#

+so a bit like chicken, just old.

little eagle
#

That's circular, Dscha.

#

Dscha smells like old fish.

jade abyss
#

atm, yeah.

tough abyss
#

That's way worse than chicken.

#

Q: will XEH_postInit run on a respawning unit in MP?

still forum
#

No

little eagle
#

No, it runs once at mission start.

still forum
#

It runs once

#

postInit

#

does init run on a respawning Unit? NO.

tough abyss
#

What runs on repsawning units, then?

little eagle
#

respawned

still forum
#

or onPlayerRespawn.sqf or what it's called

little eagle
#

Yeah. Those 3 ^

tough abyss
still forum
#

That's exactly what I just said

tough abyss
#

Yes.

#

Thanks.

#

btw you don't really need XEH_postInit if you just need postInit

still forum
#

XEH_postInit is essentially the same

tough abyss
#

sure but adds a mod dependency

#

I don't mind CBA as a dependency.

#

πŸ‘

peak plover
#
[] spawn{
    sleep 5;
    test123 = true;
};
[] spawn {
    test123 = nil;
    waitUntil {
        if !(isNil "test123") exitWith {};
        hint 'running';
         false
    };
    hint 'stopped';
};
still forum
#

Everyone has CBA and everyone needs CBA anyway. If you are making Mods that is. Not for Vanilla Missions ofcause. But who plays Arma Vanilla?

peak plover
#

final hint displayed after 5 seconds is 'running' and the loops ends

still forum
#

because exitWith doesn't exit waitUntil

#

Are you even reading what people tell you?

tough abyss
#

@still forum I bet even the devs don't play vanilla.

peak plover
#

Ohh, I thought you said that it does not exit at all

still forum
#

The dev's probably play with the newest dev version of the latest DLC loaded as Mod

#

Which I actually really just said again.

peak plover
#

exitWith {true} ends me with "stopped" hint

tough abyss
#

Q: What's faster hint 'some text'; or hint "some text";?

still forum
#

no difference

little eagle
#

btw you don't really need XEH_postInit if you just need postInit
Well one runs scheduled and the other unscheduled. So it's your choice between a short loading screen or a 30 FPS, long loading screen...

still forum
#

Attribute postInit is scheduled? WTF BI

peak plover
#

typing " takes longer because you must alos press shift, therefor ' is around 0.5 ms faster

still forum
#

On German keyboards " and ' both need shift

tough abyss
#

You know what's faster? param [0] πŸ˜„

little eagle
#

Always.

peak plover
#

well, I didn't know that exitWith {} leaves the whole thing, but exitWith {true} means it will end the waitUntil and continue on

#

This is very interesting behaviour

still forum
#

exitWith {} doesn't leave the whole thing

#

it doesn't leave anything

peak plover
#

It just did

still forum
#

no

little eagle
#

Returning true is what makes it leave, nigel

peak plover
#

It stoppped the loop

little eagle
#

Not exitWith

indigo snow
#

No it its pretty logical? Waituntil checks if the return value of the scope is true

still forum
#

It jumped back to the first line of the waitUntil

indigo snow
#

Exitwith just gives a return value to that check

#

{} returns nil, which isnt true

little eagle
#

Don't tell that to a logician.

peak plover
#

It's true I'm telling you

little eagle
#

^^

peak plover
#

One moment

indigo snow
#

I leave those alone in their dark cellars

tough abyss
#

Inb4 "OH right!".

peak plover
#

ILL SHOW YOU ALL!!!

little eagle
#

🍿

tough abyss
#

🍺

peak plover
#

(buys a gun)

little eagle
#

😒 πŸ”«

peak plover
#

exitWith {}; stops the loop and does not show hint 'stopped';

#

Therefor it leaves the whole [] spawn {};

still forum
#

How did you get the Idea that it stops the loop?

#

Because it totally doesn't

peak plover
#

Because if I use


[] spawn{
    sleep 5;
    test123 = true;
};
[] spawn {
    test123 = nil;
    waitUntil {
        if !(isNil "test123") exitWith {true};
        hint 'running';
         false
    };
    hint 'stopped';
};
#

Last hint I see is "stopped"

still forum
#

Do I really need to explain it to you step by step?

little eagle
#

exitWith doesn't stop it. Returning true via exitWith (or not) does.

still forum
#
    waitUntil {
        if !(isNil "test123") exitWith {};
        hint 'running';
         false
    };

test123 is nil.
if !(isNil "test123") exitWith {}; //isNil check is true. get's negated to false and exitWith is not executed.
hint 'running'; //hint is displayed
false //waitUntil loop continues running

test123 is not nil
if !(isNil "test123") exitWith {}; //isNil check is false. get's negated to true and exitWith is executed. exitWith exits the current run of the waitUntil but doesn't end it.
Next frame
if !(isNil "test123") exitWith {}; //isNil check is false. get's negated to true and exitWith is executed. exitWith exits the current run of the waitUntil but doesn't end it.
Next frame
if !(isNil "test123") exitWith {}; //isNil check is false. get's negated to true and exitWith is executed. exitWith exits the current run of the waitUntil but doesn't end it.
Next frame
if !(isNil "test123") exitWith {}; //isNil check is false. get's negated to true and exitWith is executed. exitWith exits the current run of the waitUntil but doesn't end it.
Next frame ...

#

get it now?

#

The loop never stops.

peak plover
#

Oooooooh, Now I get it 😡 🌴

#

That's so stupid of me

#

How could I be so foolish

little eagle
#

That took way too long.

#

Apologize.

peak plover
#

I am sorry 😿

#
 
[] spawn{ 
 sleep 5; 
 test123 = true; 
}; 
[] spawn { 
 test123 = nil; 
 waitUntil { 
  hint 'pre exit';
  if !(isNil "test123") exitWith {true}; 
  hint 'post exit'; 
   false 
 }; 
 hint 'stopped'; 
};
#

Yeah, that's my mistake right there

tough abyss
#

So the script we get working 10 minutes ago doesn't work from XEH_postInit.

#

πŸ˜•

#

Does the interace exist during postInit?

little eagle
#

Maybe. Maybe not.

tough abyss
#

perhaps you need something like:
waitUntil {!isNull (findDisplay 46)};

peak plover
#

He wanted something that runs on respawning units?

#

There's the init xeh

#
class Extended_Init_Eventhandlers
{
    class Man
    {
        // To use the exclude directive, we'll have to make this an
        // "inner" (composite) XEH init EH class
        class XEH_Exclusion1_Man
        {
            exclude="SoldierWPilot";
            init = "[] execVM '\xeh_exclusion_example1\init_man.sqf'";
        };
    };

    class SoldierWPilot
    {
        xeh_init = "[] execVM '\xeh_exclusion_example1\init_west_pilot.sqf'";
    };
};
#

Is this what you want @tough abyss

indigo snow
#

Then youd still want the respawn one

peak plover
#

true

stray kindle
#

don't argue with @little eagle, especially not on discord πŸ˜„

#

❀

tough abyss
#

@peak plover I don't need something that runs on respawning units, atm.

#

@tough abyss thanks, I'll try it.

#

Having a hard time wrapping my head around XEH_postInit. Stuff like addAction works, so the unit exist, but it doesn't have an interface, yet?

still forum
#

what do you mean by "interface"

tough abyss
#

Display #46.

#

Isn't it the "main interface"?

#

I don't remember the exact terminology.

little eagle
#

RscDisplayMission is idd 46

#

RscDisplayMain is idd 0

tough abyss
#

@tough abyss, doesn't work. ```
19:45:57 Suspending not allowed in this context
19:45:57 Error in expression <og ""nev_debug_menu"""];
};

waitUntil {!isNull (findDisplay 46)};

_control = f>
19:45:57 Error position: <!isNull (findDisplay 46)};

_control = f>
19:45:57 Error Generic error in expression
19:45:57 File NEV_Addons\addons\nev_debug_menu\XEH_postInit.sqf, line 12

still forum
#

Why do you choose unscheduled environment if you want scheduled?

tough abyss
#

TBH I've yet to grasp the idea of scheduled and unscheduled...

still forum
#

Okey. Take your time then and come back when you're done

little eagle
#

lmao

tough abyss
#

What I do know, is that if I can't suspend a script, I need to spawn it, and not call it.

still forum
#

if you are in unscheduled

#

you can't suspend in unscheduled because the engine freezes completly till your unscheduled script is done running

#

suspending there would freeze the engine completly for however long you suspend

#

Which is why that is disabled

#

Read the wiki page about the Scheduler

little eagle
#

I never liked that "the engine freezes completely" explanation, because all it does is error out and not freeze.

peak plover
#

Would the engine be faster if it didn't have to check for that error 'tho

still forum
#

What are you talking about?

#

you mean sleep in unscheduled?

little eagle
#

Yes.

still forum
#

Well. As I said it would freeze the engine. If it wasn't disabled

#

@peak plover no. the Sleep command would be faster by a few nanoseconds

tough abyss
#
The scheduler is the part of the game engine that decides which thread runs at a certain point in time.
#

What is a thread?

still forum
#

Nope. Not Googling for you.

little eagle
#

What is a thread?

A long piece of fiber.

tough abyss
#

🀦

still forum
#

isn't it interwoven fibers? is interwoven even a word?

little eagle
#

Yeah, it's a strand of fibers.

#

Not a single fiber.

still forum
#

That actually explains it quite well.

#

A script is a fiber. And a thread can be mutliple scri... actually not that well

little eagle
#

No, the whole script instance is one thread.

tough abyss
#

Is there a max number for threads?

still forum
#

@tough abyss Btw the wiki page explains that one line below the text you quoted

little eagle
#

Is there a max number for threads?
Yes. Don't worry about it.

still forum
#

You should better read.

#

There is? ScriptThreads I mean`

#

are you sure?

peak plover
#

threads : 0

for "_i" from 0 to 1000 do {
    []spawn {
        while {true} do {
            sleep 1;
        };
    };
};

threads : 1000

little eagle
#

There is a max number of everything in the world that isn't something metaphysical like numbers.

still forum
#

Yeah okey. So yeah. Max number of Threads is dependent on how much Ram you have

tough abyss
#

@still forum it doesn't explain what a thread is, it just says that threads are created when you spawn, execVM or exec.

still forum
#

a couple Million probably

#

yes

#

a spawn/execVM/exec 'ed script is a thread

tough abyss
#

Ok?

peak plover
#

So basically

#

[] spawn { a = 1;};
[] spawn { a = 2;};
we don't know which one will finish first

tough abyss
#

So in order to fix the suspention issue I have to spawn a function from XEH_postInit?

still forum
#

I don't know what that part talking about call is in threads.. That totally doesn't belong there

peak plover
#

They run next to each other ... kind of

still forum
#

Or use postInit via CfgFunctions

peak plover
#

If you want to use sleep. You have to use spawn/scheduled

tough abyss
#

@still forum I don't use CfgFunctions.

still forum
#

Or CBA_fnc_waitUntilAndExecute :u

#

Then use it.

#

or just spawn from XEH_postInit

little eagle
#

something something DisplayLoad

peak plover
#

Btw using CfgFunctions is extremly fun

tough abyss
#

I just CBA for that πŸ˜›

peak plover
#

#ifdef is pretty fun as well

digital pulsar
#

what does faction return for dead players? i'm trying to get around the fact that side is useless after death

little eagle
#

Probably doesn't change when dying.

#

All it does is read the faction entry from the objects class.

#

And that one never changes.

digital pulsar
#

cool, thanks

tough abyss
#

@still forum so do I put just the waitUntil in CBA_fnc_waitUntilAndExecute?

#

Or the whole script?

#

Because this looks very useless ```SQF
[
{!isNull (findDisplay 46)},
{true}
] call CBA_fnc_waitUntilAndExecute;

little eagle
#

Maybe replace true with something useful.

tough abyss
#

I'm assuming the script continues to run after the line with the function?

little eagle
#

?

tough abyss
#

[{}, {}] call CBA_fnc_waitUntilAndExecute doesn't act as a waitUntil for the whole script, right?

little eagle
#

No.

tough abyss
#

Ok, thanks.

little eagle
#

It couldn't.

tough abyss
#

Nice, it works. Thanks.

#

Although I still don't understand this line πŸ˜• ```SQF
waitUntil {(_this select 0) ctrlSetText str time; false};

#

Why do I need waitUntil and false?

little eagle
#

It's an infinite loop.

#

The code block after waitUntil is executed every frame* until it reports true.

#

So never. It runs forever.

tough abyss
#

Oh, ok.

little eagle
#

Which means that every frame* the control sets to the current time.

tough abyss
#

So it's 2 parts, (_this select 0) ctrlSetText str time and false.

little eagle
#

Yes, two statements. Statements are separated with semi colons.

tough abyss
#

1st part is the actual code we need to run, 2nd part is there to report false to waitUntil.

little eagle
#

You can have any number of statements. It's just that the return value of a code block is the same as the return value of the last statement.

#

false is a command that always reports the boolean false.

#

So false being the last statement in the code block means, that the code block reports false.

tough abyss
#

And waitUntil wants true.

#

So it runs again.

little eagle
#

And if the waitUntil code block reports false, the code block is executed again in the next frame*.

tough abyss
#

Alright that makes sense, thank you every much πŸ˜„

little eagle
#

If the code block of waitUntil reports true, then the code continues after the waitUntil command.

jade abyss
#

@digital pulsar

what does faction return for dead players? i'm trying to get around the fact that side is useless after death```
try `side group _Corpse`
tough abyss
#

This is probably the largest comment you've ever written πŸ˜ƒ

#

6:1.

little eagle
#

Yes, but have you written it, or have I written it?

tough abyss
#

You did πŸ˜”

#

I've a bad habit regarding statements like that.

little eagle
#

Ha, I don't mind. I just wanted to be cheeky.

tough abyss
#

On side note - having an AI counter on during official BIS missions will scary.

tough abyss
#

this needs to be a channel

rotund cypress
#

@open vigil

open vigil
rotund cypress
#

Need a specific one πŸ˜‰

peak plover
#

How do the default data types for param work?

little eagle
#

That question is ill formed.

#

There are no "default data types"

rotund cypress
#

params [["_var", dataTypeValue, [expectedDifferentDataTypesArray]]]

peak plover
#

*expected

#

dataType value is what? "ARRAY" ?

little eagle
#

It's an array of samples of all data types that are accepted.

rotund cypress
#

no

#

i.e [] for array

#

you can also have like ["string"]

peak plover
#

[] means all are accepted

little eagle
#

Yes.

peak plover
#
_side = [_this] param [0,[west,east,resistance,civilian],[[]]];
#

does not compute

rotund cypress
#

which would mean if not [] is passed, it will default to ["string"]

little eagle
#

That means only array is accepted

rotund cypress
#

@peak plover per your example, you would default to an array [west, east...] if not they are passed

#

and it would have those values

peak plover
#

It says type string, expected array

little eagle
#

Then _this is probably a string and not an array.

peak plover
#

_this is empty

#

call myfnc

little eagle
#

Maybe it's carried over from a lower scope

#

The unary call does that.

#
_this = "";

0 call {
    _this // 0
};

call {
    _this // ""
};
peak plover
#

hmm, shouldn't

#

It does not seem to get _this from anywhere

#

Ohh I think, it's because [_this]

#

means it's always an array

#

nvm, it should not

little eagle
#

Then it wouldn't complain about strings.

#
systemChat str [_this];

Just add this ^ line and see what it is.

peak plover
#

I want a function to be used with nothing, or with an array. I'll try that

#

okay, that's happening because of debug window code check box

#

But still does not work

little eagle
#

Maybe post more than one line.

peak plover
#
// Dead side
// Returns array with all the dead units (for side)
// Defaults to all sides
// [west,east] call respawn_fnc_getDeadArray;
"respawn_fnc_getDeadArray" spawn debug_fnc_log;

str _this spawn debug_fnc_log;
// Code begins
private _sides = [_this] param [0,[west,east,resistance,civilian],[[]]];
private _deadUnits = [];
// Check all players if they are dead and on the side requested
nul = {
    _unit = _x;
    _unitDead = _unit getVariable ["unit_respawn_dead",false];
    _unitSide = _unit getVariable ["unit_respawn_side",(side (group _unit))];
    // If unit is on side requested and dead add him to _deadUnits
    str _sides spawn debug_fnc_log;
    if ((_unitSide in _sides) && _unitDead) then {
        _deadUnits pushBackUnique _x;
    };
    true
}count allPlayers;
_deadUnits
#

I guess I can just not use param as an alternative

#

It'll get ugly 'tho

little eagle
#

And how is that function called?

peak plover
#
[west,east] call respawn_fnc_getDeadArray;
// works
call respawn_fnc_getDeadArray;
[] for both debugs
little eagle
#

Yeah, as I said, the unary version of call carries over the parent scopes value of _this.

#
call respawn_fnc_getDeadArray;
->
[] call respawn_fnc_getDeadArray;
peak plover
#

still []

little eagle
#
private _sides = [_this] param [0,[west,east,resistance,civilian],[[]]];
->
[_this] params [["_sides", [], [[]]]];

if (_sides isEqualTo []) then {
    _sides = [west,east,resistance,civilian];
};
peak plover
#

wroks πŸ‘

#

Thanks

little eagle
#

Was there ever any doubt?

peak plover
#

Nope, I know by now that pretty much everything is possible to some extent

rancid ruin
little eagle
#

But I'm the first one that says that something isn't possible.

tough abyss
#

@rotund cypress #offtopic_scripting

#

@little eagle what's the hardest script you had to write?

little eagle
#

The ones that never got anywhere and thus were never published,

tough abyss
#

Out of the ones that were published.

little eagle
#
+1,202 βˆ’4,100 
tough abyss
#

You don't get nearly enough credit.

tough abyss
#

Pretty sure there is an engine function for stacked init eventhandlers now

still forum
#

yes. addMissionEventHandler

#

but you can't pass parameters along with it like you can with BIS_fnc_stacked..

tough abyss
#

No i was talking about stacked eventhandlers init config wise i mean. I tend to ignore sqf code, that you can implement yourself.

still forum
#

Not aware of that. Besides CBA's XEH

little eagle
#

There is only entityRespawned and entityKilled, not entityInit or entityCreated

queen cargo
#

Didn't bi added a way to create that behavior via addon Config?

little eagle
#

No.

tough abyss
queen cargo
#

Yup

little eagle
#

Yes, but that would require ACE for example to have this class in every custom object.

still forum
#

ah yeah

queen cargo
#

That's what I meant

little eagle
#

Yeah, I use that in the XEH rewrite. But it's only half the task done.

little eagle
#

I tend to ignore sqf code, that you can implement yourself.
You couldn't implement the BIS stacked eventhandlers yourself. At least before they added those addMissionEventHandler versions and now rewrote the function to use those. This thinking is what made Exile break when used with TFAR...

rancid ruin
#

why did exile break when used with tfar?

little eagle
#

Used onPlayerConnected instead of the stackable version, so TFAR, which did use the stackable version correctly, overwrote it.

#

And that caused something about bambis and being stuck in the loading screen or something.

tough abyss
#

I meant that is in adding mod dependencies for the odd sqf function :P
BIS code i always try to look at first, some of it find some of its not bad

little eagle
#

That's garbled.

peak plover
#

How does PATHTO_R work in ace3?

#

Does not excist in coding guidelines where GVAR and FUNC are

peak plover
#

so it would mean

#

"z\ace\addons\medical\sounds\mysound.ogg"

peak plover
#

Ok, I don't under stand the ARR_4 thing now...

#

ARR_4(1,2,3,4) == [1,2,3,4] ?

still forum
#

No

#

ARR_4(1,2,3,4) -> 1,2,3,4

peak plover
#

I don't get it... why even bother writing ARR_4 ? Why not just 1,2,3,4 ?

#
#define ARR_4(ARG1,ARG2,ARG3,ARG4) ARG1, ARG2, ARG3, ARG4
still forum
#

Because that doesn't work in Macros

peak plover
#

Only difference is the ()

still forum
#

In Macro's the , denotes the start of the next argument

peak plover
#

Snap

#

(,) keeps it in the before argument (),() is two arguments

#

(1,2,3) is still 1 argument

still forum
#

kinda

#

If you put ARR_3 before it

#

I'll try to show you

peak plover
#

Ahh I get it I have to use it because the thing uses QOUTE before, so that makes it a makro

still forum
#
#define myMacro(param1, param2, param3) param1 | param2 | param3

myMacro([1,2,3], p2, p3) -> [1 | 2 | 3]
myMacro([ARR_3(1,2,3), p2, p3]) -> [1,2,3] | p2 | p3
peak plover
#
 playSound3D [ARR_7((QUOTE(PATHTO_R(sounds\def\start.wss))),_player, false, (getPosASL _player), 1, 1, 15)];
still forum
#

why are you using PATHTO_R?

#
playSound3D [ARR_7(QPATHTO_R(sounds\def\start.wss), _player, false, (getPosASL _player), 1, 1, 15)];
peak plover
#

IT used qoute and then path in this one

#

also in cook off or sth

still forum
#

QPATHTO_R is the same as QUOTE(QPATHTO_R

peak plover
#

Yes, that's what I thought, but then I realised I am not very familiar with macros and since they used that in ace3 , it must be the correct way

peak plover
#

QPATHTO_R throws an error

#

with QOUTE(PATHTO_R i get an error "missing ]" right after the QOUTE

#

I assume I can't use qoutes as well because it's already in some qoutes

still forum
#

show full line

peak plover
#

        statement = QUOTE([ARR_4(_player, _target, 'body', 'Defibrillator')] call DFUNC(treatment); playSound3D [ARR_7(QOUTE(PATHTO_R(sounds\def\start.ogg)),_player,false,getPosASL _player,1,1,15)];);
still forum
#

you may need Quote(Qpathto

#

double qupte

peak plover
#

Hmm, yes

#

still

#

\ instead of =

still forum
#

QOUTE

peak plover
#

HAAHAHA

#

QUOTE

#

I've lived my whole life without knowing how to spell Quote

#

Ok, let's try it now

#

Thank you dude

#

it works

#

I can finally sleep at peace

tough abyss
#

lol

#

gg wp

warm gorge
#

I cant remember if ive asked this before on here, but is there any way around the issue where dead bodies will not pop out of exploded vehicles when they are deleted? For example, a helicopter full of players gets destroyed and everyone dies. You delete the helicopter wreck, and only the pilot's body pops out

little eagle
#

setPos getPos?

#
{
    _x setPos getPos _x;
} forEach crew _wreck;

?

peak plover
#

This?

#

I've had the same issue. Killing units with script won't cause this, but killing them with real events in-game will cause units to not work with scripts like deleteVehicles _deadMan;

#

Best part is that it happens to only ~75% of the units

tough abyss
#

What's the point of a newline at the end of a file, and why doesn't GitHub disapprove of not having it (🚫)?

#

(Sorta, kinda scripting related πŸ‘€).

little eagle
#

Imo it's a problem with the definition of line being wrong, but there's your answer.

warm gorge
#

@little eagle Ill give that a go, its behavior is very weird. Sometimes certain players CAN see the dead bodies from the wreck, but others cant. Almost like its a locality issue, but im not sure. @peak plover Thats not really the issue from what I read in that ticket, but might be along the same lines. I just want everyone to be able to see the dead bodies, for revive scripts etc. But instead the pilot's body seems to be the only one that comes out of a deleted vehicle wreck most of the time

peak plover
#

Yes, I assume this is similar, it's pretty much unability to setPos or do anythign fun with units that die inside vehicles

warm gorge
#

Well thats the thing im not doing anything with the units, other than cleaning up destroyed vehicle wrecks in a cleanup script

peak plover
#

I literally had to add a getVariable ["deleted",false]; to my clean up script, because dead units won't sometimes delete from vehicles and I couldn't even setpos them

little eagle
#

Can't you just delete the wreck and then create some new bodies?

warm gorge
#

I probably could, but silly that should be needed. Dead bodies should just eject out of a vehicle when its deleted like it does for the pilot

little eagle
#
  1. delete crew
  2. create equal amount of corpses around the wreck
  3. delete wreck
peak plover
#

@little eagle 1. won't work sometimes

little eagle
#

Maybe they should, but they don't, so there's that.

#

@peak plover

  1. mark crew with variable
  2. create equal amount of corpses around the wreck
  3. delete wreck
  4. delete all remaining marked corpses
#

Put all that into a function called "My_fnc_cleanupWreck". Call function when needed.

peak plover
#

Yes.

little eagle
#

done

#

Sure it sucks, but it's not like this will hurt performance in any way, so...

warm gorge
#

Just did a quick search cause I thought I had asked this a couple months ago, turned out I did. @jade abyss Suggested creating a temporary unit in each seat of dead units, to 'force them out' in a way. I might give that a go before resorting to creating bodies myself

little eagle
#

I tried that, but couldn't get all units out as the dummies would push out each other and not the original crew.

peak plover
#

You can also add a onKilled EH and if the unit is about to die inside a vehicle, drop the guy out next to vehicle and kill him

little eagle
#

Only one AI dropped out and then it stopped and shoved out my dummies instead.

#

killed eventhandler triggers after the unit is dead, so I assume that that changes nothing.

peak plover
#

Ohh, shit yeah, damaged or hit

#

Causes issues with mods 'tho

icy raft
#

Hey ppl! What's up? Are subarrays passed by value or by reference when you do a select?

#

I want to store lots of data in a single array, but want to change stuff inside the subarrays, can do manual sets but it's a pain

tough abyss
#

AFAIK select copies all filtered elements...

#

okay, u need reference...

icy raft
#

Yep

#

That's sad

#

Having data moving around for no reason hurts my heart

tough abyss
#

u could filter with count...

icy raft
#

😦 😦

#

hmmm

#

that might work

peak plover
#
_array = [[1,2,3],[2,3,4]];
_array2 = _array select 0;
_array2 pushback 99;
systemChat _array //[[1,2,3,99],[2,3,4]]
#
_array = [[1,2,3],[2,3,4]];
_array2 = [] + ( _array select 0); // not [] but ()
_array2 pushback 99;
systemChat _array //[[1,2,3],[2,3,4]]
little eagle
#

Are subarrays passed by value or by reference when you do a select?
reference

tough abyss
#

wow

#

thats surprising for me

#

could have caused so much bugs ^^

little eagle
#

Think of arrays as objects you can put stuff into.

#

And keep in mind that + and - and some other commands create new such "objects".

peak plover
#

ohh yeah + (array select 0) works as well as [] + (array select 0)

tough abyss
#

thats clear but somehow I thought that select would alway do a copy for the resulting array

little eagle
#

I think copying the array is the exception.

tame portal
#

Yes

little eagle
#

Only +, -, select CODE, apply and arrayIntersect copy the array.

tough abyss
#

I even wondered how select is so fast while copying πŸ˜ƒ

tame portal
#

You get a reference to the object/array as you would in other programming languages

tough abyss
#

but it doesn't

tame portal
#

@little eagle select copies the array?

peak plover
#

I had a huge array and didn't know that it edits the array if I use set and pushback etc. shit confused me so ad

little eagle
#

select CODE

#

not select NUMBER

tame portal
#

Ah okay

tough abyss
#

ah okay

#

that sehd some light

#

shed

#

some more light ^^

#

and reduces my bug count cause I mostly use it with CODE

tame portal
#

Actually the fact that you get references of arrays is quite handy

little eagle
#

Yes, which is why it sucks that select CODE, apply and arrayIntersect always copy it.

peak plover
#

It's handy if you know about it

little eagle
#

Would've been more useful if they didn't.

tame portal
#

Should be included in the wiki what uses references and what not, as far as I know that isn't mentioned in the corresponding wiki pages

peak plover
#

If you have no clue, it can be a pain. I thought _local ment that I could do whatever I want to the array with no consequences... ohh, I've never been so wrong in my entire life

tame portal
#

Well it's kind of unexpected to be honest. In a language that doesnt use objects atleast

little eagle
#

I wouldn't rely on using array references if it's not needed. And it seldom is. I think it hurts readability. I would only worry about it, if it can save performance. Because copying arrays is pretty slow.

icy raft
#

Wow! @little eagle as helpful as ever!

rotund cypress
#

Hey guys, is there any style or type to invert progress bar ctrl so 0 is at right and 1 is at left?

#

Or do I have to do that myself in code?

little eagle
#

1 - _progress
?

rotund cypress
#

Ye of course, was just wondering if there was any way to just do it via ctrl instead

little eagle
#

I don't think so.

rotund cypress
#

Alright, thanks

icy raft
#

I didn't know about that, and it's really good to know. I doubted how RVE stored data

#

@little eagle , are you get paid? You are always present and helping

little eagle
#

No, I just have the week off.

peak plover
#

24/7 scripting live support support

#

Can createDiaryRecord be edited?

icy raft
#

well, we have to start a poll or something with the admins to get you a few free beers

rotund cypress
#

@peak plover is that a display?

peak plover
#

my goal:
Add a clickable entry in the briefing that will run a function

#

I want to avoid using addAction

#

But I want the diary entry to be removed once it's used

rotund cypress
#

What do you want to edit? Not the command itself I suppose?

peak plover
#

The diaryRecord that I will create with this will have a clickable function. I want the diary entry to get out/be deleted/edited

rotund cypress
#

<execute expression="Code to execute">Text</execute>

peak plover
#

Ok, but how do I get rid of this diary entry now?

#

Once it's used I don't want it to clutter the diary

rotund cypress
#

Not sure if you can

#

I cant find a remove command or similar

peak plover
#

Yeah, I tried google, he was not very helpful

rotund cypress
#

Ye I don't think you can

peak plover
#

What are my alternatives?

rotund cypress
#

Make a display

peak plover
#

I feel like if I make a dialog it will be alot of trouble to get it to work well and not be annoying

#

Because if it appears when I open the map, it might obscure the thing

#

...actually

rotund cypress
#

If you have troubles with getting displays to work and want an easy way, I guess you could use something as http://convert.sqf.io/

#

Converts it from GUI editor directly into SQF

#

MAybe something for you

peak plover
#

ugh.. the a3 gui editor is weird

rotund cypress
#

How so?

#

I know it's not the best tool out there

#

But its quick and easy

peak plover
#

Ok new plan that might work:

Choosing the "COMMANDER" diary entry will execute code to open the dialog and unchoosing it will close it

#

I got the dialog example from workshop and used that as a base and got it working pretty good

#

But I'm not entirely sure how to make it so that the dimentions remain good even with 4:3 or smaller sizes etc.

rotund cypress
#

safezone or pixelGrid

warm gorge
#

Yeah the arma 3 gui editor isnt the best, few known bugs and it doesnt have many controls added

peak plover
#

I assume I can create like custom buttons dynamically? How hard would it be to create a dynamic system similar to the diary, but having the ability to add/remove/edit elements at any time?

warm gorge
#

Theres plenty of commands for making controls dynamically. Just a matter of managing them in an array or something for easily adding/removing/editing them

peak plover
#

I guess that's what I'll have to do. I could still use the briefing, but it might get cluttered

mortal halo
#

is there a way to create custom event handlers for objects?

#

i need to create an eventhandler to an object and call it later

#

and i want to refrain from using waitUntil because I like 60 fps

warm gorge
#

What are you trying to do?

rotund cypress
#

Well, either add an eventhandler

#

You can also use scripted eventhandlers

#

But really no use for it

#

@mortal halo

#

like object addEventHandler ...

#

However, in ArmA, you can not make your own eventhandler.

mortal halo
#

i need to check if a container's cargo has changed

#

and it changes via script so you can't use inventory related stuff

indigo snow
#

Sure the basics are pretty simple if you can also always fire it yourself.

#

E.g. you control the scripts that change the inventory

#

Just maintain a list with all the functions that need to be called and a function that calls all of them

obsidian chasm
#

Anybody know where cfggroups is (providing this is how to change an AIs loadout)

#

Just looking to make the Syndikat Stalkers a little bit more robust and the Viper Stalkers to not have the 50 cal weapon as it's too good for a pick up in the early game for my mission

little eagle
#

The loadout of a unit is defined by it's CfgVehicles class.

indigo snow
#

Just pointing out early that you cant edit those with just a mission

obsidian chasm
#

@little eagle Where would that be located?

little eagle
#

characters_f.pbo

shadow sapphire
#

@obsidian chasm, you're building a mod, not a script if you go that route. It's not a problem, but know that players joining your mission will need the mod to get the intended effect.

#

Would be better to script it with an event handler.

obsidian chasm
#

@shadow sapphire Right now I am editing 'Escape Tanoa'