#arma3_scripting

1 messages · Page 466 of 1

still forum
#

diag_log _this in your script file. That way you see if it's even executed and what's passed

half laurel
#

well, it doesn't activate the script

still forum
#

nothing in RPT?

half laurel
#

A null object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'

little eagle
#
[EB_supportradio, [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), {"actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2}]] remoteExec ["addAction"];
->
[EB_supportradio, [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), "actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2]] remoteExec ["addAction"];
half laurel
#

that's the only thing i ca nsee that might possibly be related

little eagle
#

You have weird curly brackets where there shouldn't be any.

#

Why do you need remote exec anyway?

half laurel
#

thanks!

#

got the curly brackets from the wiki 😦

little eagle
#

From where? 🤔

half laurel
#

it works without them - thank you

#

i'm using remoteExec to ensure the action appears on an object in MP dedi server for all players including JIP. is that not the right way to do it?

little eagle
#
{
    hint "Hello!"
}

is the statement block from the wiki and valid SQF.

{
    "actions\fnc_call_lumes.sqf",
    0,
    20,
    true,
    true,
    "",
    "true",
    2
}

is what you wrote, and while strangely valid syntax, not what you were trying to write.

#

All your additional parameters for addAction ended up inside the statement code block, not as actual parameters.

#

i'm using remoteExec to ensure the action appears on an object in MP dedi server for all players including JIP. is that not the right way to do it?
No, you should place the addAction inside initPlayerLocal.sqf.

#
// initPlayerLocal.sqf
params ["_unit"];

_unit addAction [<blah>];
#

Or if not the local avatar, not _unit, but whatever vehicle variable name you want.

#

If one does what you did, every client will add one action to every other machine, meaning that if in addition to the server, 3 players are there from the start, each one willl have 4 duplicate actions on the object which all have the same effect and name.

#

Well 3 duplicates and one intended one. You know what I mean.

#

4 copies.

agile anchor
#

hi all

#

is there a way i can use

#

[] spawn {
_targets = [target, target_1, target_2, target_3, target_4];
while {true} do {
_down = 0;

{
if (_x animationPhase "terc" isEqualTo 1) then {_down = _down + 1;}
} foreach _targets;

if (_down >= (count _targets)) exitwith {playsound "alarm"};
sleep 1;
};}

#

to set off a trigger instead of an alarm?

#

basically i would like to set up a timer so if the player gets targets down within time a green flare will go off and if not a red one

#

i just don't know enough about scripting to work this out and a kind chap on here gave me the script above last time

#

thnaks very much

#

i think maybe i need a second script for the smokes (sorry i said flares before i know) and it call it up?

#

like this..

#

"SmokeShellPurple" createVehicle [getPos smokingobject1 select 0, getPos smokingobject1 select 1,1];

#

but can't get them together

little eagle
#

What is the trigger for?

agile anchor
#

the trigger is how i set the smoke off currently (the only way i can think to do it) but there is probably a better way via script?

little eagle
#

Module is just a container for a script where you can change some parameters with a gui.
The problem is, that you cannot set it off multiple times per mission I believe.

agile anchor
#

basically all i'm trying to do is time the pop up target course. so if player completes within say 10 sec then they pass and if not they fail but i wanted some kind of indication in game rather than timing it in RL maybe there is a better way to achieve this than they way i'm thinking (not knowing what i' m doing lol)

little eagle
#

What if multiple players shoot targets in MP?

agile anchor
#

i can ensure only 1 player enters course at any 1 time however i was hoping to have multiple courses on the map with similar setup

little eagle
#

I would definitely run the script that handles this on the server only. So that shots from multiple players are handled correctly.

#

What module is that flare?

agile anchor
#

sorry i meant smoke not flare "SmokeShellPurple" for example

#

currently i have a trigger with timer that player enters as they start course but no way of canceling it if they complete it within the time

little eagle
#

There're two ways I could imagine.

#

Shoot and hit target one, then timer starts, all four have to be hit in 30 secs after the first one was hit.

#

Or, hit one, you have ten seconds for the next one, you lose if it ever takes more than 10. You win if you manage all 4.

agile anchor
#

yea i like the idea of the 2nd as the 1st idea would mean they have to hit a specific target first?

little eagle
#

Not a specific one.

#

Any of the four.

#

Timer starting at first hit sounds most fair to me.

agile anchor
#

oh ok then the 1st idea will work

little eagle
#

Those targets are placed in the editor, right?

agile anchor
#

and is actually better than a trigger start which is risky that someone sets it off

#

yes

little eagle
#
this addEventHandler ["Hit", {systemChat "boo"}];
#

Put this into their init box and test in SP if this prints "boo" in chat.

#

Whenever you hit them I mean.

agile anchor
#

ok the only thing is i have a script running that keeps the targets down when hit and reset them after will this effect what you are helping me with?

little eagle
#

Not with the test I just posted, but go ahead and post that script, so it can be incorporated.

agile anchor
#

this in mission init..._0 = [6,iCenterl1] execVM "resetl1.sqf";

#

then this as reset.sqf...../-------
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets,
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.
-------
/

params [["_dist",5,[1]],["_center",player,[objNull]]]; //in params
_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets
if (count _targets < 1) exitWith {
systemChat "No compatible targets were found."; //exit if no targets have been found
};
{_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos
{_x addEventHandler ["HIT", { //add EH
(_this select 0) animate ["Terc",1]; //if hit, get to the ground
(_this select 0) RemoveEventHandler ["HIT",0]; //remove EH
}
]} forEach _targets;
//systemChat "Ready.";

#

i got it off a youtube vid

austere granite
#

@agile anchor

little eagle
#

```sqf

```

agile anchor
#

^ what does that mean? sorry if it's obvious

little eagle
#

Markdown code tags to get the box with syntax highlighting and monospace in discord chat.

#

```sqf
player addItem "ace_banana";
```

#
player addItem "ace_banana";
#

-.-

agile anchor
#

aaahhh i'm sinking fast in a world of clever coders here 😦

#

not sure what any of it means sorry

#

so was i not allowed to post sqf infor here?

little eagle
#

You were, but it looks bad and is hard to read with kerning and mono colored.

agile anchor
#

ok so thats what the comes from? put pasted infor inbetween

#

lightbulb!

little eagle
#

What exactly does the script do you posted? It seems to put down all targets around the target, but does it actually keep them down? I thought those things pop up automatically again after a while. It has been a time since I used them.

agile anchor
#
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets, 
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.
-------*/

params [["_dist",5,[1]],["_center",player,[objNull]]];                    //in params
_targets = nearestObjects [position _center, ["TargetBase"], _dist];    //take all nearby practice targets
if (count _targets < 1) exitWith {
    systemChat "No compatible targets were found.";                        //exit if no targets have been found
};
{_x animate ["Terc",0];} forEach _targets;                                //get all targets to upright pos
{_x addEventHandler ["HIT", {                                            //add EH
(_this select 0) animate ["Terc",1];                                    //if hit, get to the ground
(_this select 0) RemoveEventHandler ["HIT",0];                            //remove EH
}
]} forEach _targets;
//systemChat "Ready.";
#

so it allows pop up targets to stay down when hit

#

then you can reset them

little eagle
#

I don't think that's what the script does. Did you place the targets with NoPop in the classname?

agile anchor
#

no i place pop up targets down then add game logic in the center of them

dry zephyr
#

"currently i have a trigger with timer that player enters as they start course but no way of canceling it if they complete it within the time" A way to deal with that is to have a trigger that has the success condition in its condition a1 and a2 and a3 where the a1 is a check on the first target being down and so on. Then, you have the player started trigger, with timeout of 10 seconds or whatever. Finally, a failure trigger with condition triggerActivated startTrigger and !triggerActivated successTrigger.

agile anchor
#
_0 = [6,iCenterl1] execVM "resetl1.sqf";
#

then this goes in the init

dry zephyr
#

If it's more complicated than three fixed targets down in 10 seconds, you probably need to step back and draw this out on paper as a state machine.

agile anchor
#

no its just me and my lack of knowledge i think

little eagle
#

I have an idea on how to get this to work, but I'm still trying to understand what's happening at the moment.

agile anchor
#

it is just a bunch of targets to be put down within a set time

little eagle
#

Because the script you posted doesn't keep the target down. What's the classname of the targets you placed.

#

?

agile anchor
#

but some way of knowing if pass or failed

#

Pop-up Target 1

#

it does work

#

i obvously just don't know how

#

lol

little eagle
#

TargetP_Inf_F

#

It says the classname in the edior. What I posted should be written somewhere.

#

When you double click it.

agile anchor
#

yes sorry wrong name commy2 thats the name

#

TargetP_Inf_F

little eagle
#

Do you have

nopop = true

Or something similar written anywhere?

agile anchor
#

no

#

i don't have to touch the targets with this

#

let me find the vid 1 sec

little eagle
#

TargetP_Inf_F has a script attached by config , and that is supposed to make it pop down and back up after a while.

agile anchor
#

^ this guy has bypassed that somehow

little eagle
#

There is no need to bypass it yet. I know how, but I don't understand why it doesn't pop up again for you.

#

The script you posted doesn't do that, so there is something else.

agile anchor
#

^this is his link to his script

still forum
#

A pastebin alternative where you have to solve a captcha in order to see the text? really?

agile anchor
#

yea i had problems with that too

#

i just copied scripts from his mission example

little eagle
#

That site made my browser freeze.

agile anchor
still forum
#

pastebin/github gist are the best

agile anchor
#

^ this one is working now

#

that was his alternative link

still forum
#

BIS_poppingEnabled That is the new nopop?

little eagle
#
//disable targets from moving automatically
nopop = true;
#

Do you have nopop = true?
no

#

🤔

#

This is what actually makes your targets keep down.

still forum
#

well. technically he doesn't

little eagle
#

Not the script you posted.

still forum
#

But that says it's called poppingEnabled now

little eagle
#

I'm just asking this, because I don't want to write a solution that is then broken by some other script interfering.

#

To me it seems like the resetl1 is not need and better off deleted.

agile anchor
#

well the timer is more important to me than having the targets down

#

esp if your script knows they have been hit?

#

thats the only reason i wanted them down as a visual aid

little eagle
#

But obviously the timer running out should then put up all targets in the group too. This all should work in unison.

agile anchor
#

well yea if you can that would be great

little eagle
#

Step one would be to delete:

#
nopop = true;
#

And

#
_0 = [50] execVM "reset.sqf";
#

And everything else associated with this.

#

Clean house so to speak.

agile anchor
#

ok

little eagle
#

Dedmen, the variable is still called "nopop".

still forum
#

but the script he posted says stuff ¯_(ツ)_/¯

agile anchor
#

that no pop bit is in one of these scripts i'm already using or somewhere else?

little eagle
#

Can be either object namespace, or if undefined is taken from mission namespace.

#

I copy pasted it from your wannabe-pastebin link.

still forum
#

init.sqf then

little eagle
#

L2 says "init.sqf", so I assume it is an init.sqf.

still forum
#

Good night bois. hav fun. Don't get Arma'd too much o7

little eagle
#

o7

agile anchor
#

bye

#

ok all deleted

#

(well ive started a new mission)

#

i have a rifleman and 1 target

little eagle
#

OK. Then name all the targets in the editor and use some names where you know which ones are grouped together.

#

I'm writing it...

agile anchor
#

ok

#

target1, target2 & target3

little eagle
#

Sure.

peak plover
#

nopop is a what

little eagle
#

A variable without ofpec tag.

obsidian violet
#

Hi guys! need some help regarding scripting. I am a noob comeing to scripting and such but I wonder if the following would be possible,
I would like to add a specific object to constantly have a way to open the ace arsenal.

ex. when i place down the object (Supply box Nato) everyplayer will get the option to open the ace arsenal on it with only my items in them.
And no, the solution is not to do it with zeus. I wan´t to have it as a script in my missionfile 😃

was thinking to set the classname of the object as an veriable like this:
_Arsenal setVariable ["B_supplyCrate_F", true];

and then set the _Arsenal to have the call function like [_Arsenal, ["Myshit", "Myshit2", "Myshit3"]] call ace_arsenal_fnc_initBox

I dunno if this way would do it or to get it all together in a script.
any help is appriciated!

BR Killet

still forum
#

that is exactly the way to do it.

#

you call initBox with a list of all your items that you want to have accessible

#

you can just double-click the box in editor and paste your initBox script inside it's "init script"

#

but make sure to replace _Arsenal by this

#

yes i said I'll sleep. But I wanted to wait to see what that horribly slow writing guy would write 😄

#

or do you want that any box of a specific type. Always has a arsenal regardless of how it was placed?

obsidian violet
#

haha thanks, but thats not the solution 😉 I would like to make it a veriable so every single "B_supplyCrate_F" that spawns in during the mission counts as a ace arsenal

#

by doing it your way I need to set it on every box before I start the mission, so I wan´t to make this a script called from the init

#

or such

still forum
#

Okey. You wouln't make a variable but I see what you mean

#

you can do that via a script in init.sqf or by putting something into description.ext. Which do you prefer? I guess init.sqf?

obsidian violet
#

init.sqf

#

but I don´t know how to get it together exactly 😛

still forum
#

That set's the box's init script

#

everytime a box of that time is placed anywhere via whatever method. That script will be executed

#

and you just add the arsenal inside that script

#

you just put that in init.sqf. Add the classnames for your item whitelist and done

obsidian violet
#

wow, that easy? damn, Thank you so much

#

gonna try this out

still forum
#

only that easy if you have CBA ^^

obsidian violet
#

from now on I love CBA haha

#

cheers mate, have a good night 😃

#

Is it possible to add it from another script so it dosen´t interfere with other things in the init.sqf ex if I call a arsenal.sqf from the init field. and then put:

["B_supplyCrate_F", "init", {
[_this, ["Myshit", "Myshit2", "Myshit3"]] call ace_arsenal_fnc_initBox;
}, false, [], true] call CBA_fnc_addClassEventHandler;
in Arsenal.sqf

little eagle
#

@agile anchor I hope you're patient, because this will take a while. I want to get it right...

agile anchor
#

@little eagle thats fine bud and i appreciate the time you are giving me

little eagle
#
// init.sqf
private _fnc_handleHit = {
    params ["_target"];

    // fall over
    if (_target animationPhase "Terc" > 0) exitWith {};
    _target setVariable ["commy_isDown", true];
    _target animate ["Terc", 1];

    // check win condition
    private _targets = _target getVariable "commy_targets";
    _targets params ["_main"];

    // if all down, win
    private _isWin = {!(_x getVariable "commy_isDown")} count _targets == 0;

    if (_isWin) then {
        private _smoke = "SmokeShellGreen" createVehicle [0,0,0];
        _smoke setPosASL getPosASL _main;
    };

    // reset "pop back up" script
    private _popupScript = _main getVariable "commy_popupScript";
    terminate _popupScript;

    _popupScript = _targets spawn {
        private _targets = _this;
        _targets params ["_main"];

        sleep 10;
        isNil {
            private _isWin = {!(_x getVariable "commy_isDown")} count _targets == 0;

            if (!_isWin) then {
                private _smoke = "SmokeShellRed" createVehicle [0,0,0];
                _smoke setPosASL getPosASL _main;
            };

            {
                _x setVariable ["commy_isDown", false];
                _x animate ["Terc", 0];
                _x setDamage 0;
            } forEach _targets;
        };
    };

    _main setVariable ["commy_popupScript", _popupScript];
};

private _fnc_initTargets = {
    if (!isServer) exitWith {};

    private _targets = _this;

    {
        _x setVariable ["commy_isDown", false];
        _x setVariable ["commy_targets", _targets];
        _x setVariable ["nopop", true];
        _x addEventHandler ["Hit", _fnc_handleHit];
    } forEach _targets;

    _targets params ["_main"];
    _main setVariable ["commy_popupScript", scriptNull];
};

[target1, target2, target3] call _fnc_initTargets;
[target4, target5, target6] call _fnc_initTargets;

I have no way to test this atm :/

agile anchor
#

dam

#

so this is all in the mission init file

little eagle
#

init.sqf

#

All it needs is target1 target2 target3 etc. placed in the mission.

agile anchor
#

ok awesome!

#

so it looks like there ia a smoke in there somwhere?

#

is this timer or smoke or both lol

little eagle
#

Spawns the green smoke if you win, red smoke if you loose.

#

You lose if you take longer than 10 seconds without hitting anything.

#

You win if you get all of one group down.

agile anchor
#

ok and i can change that?

little eagle
#

Change what?

agile anchor
#

10 sec

little eagle
#

It says sleep 10 somewhere. You can change that to 30 or whatever you want.

agile anchor
#

yea thats great

little eagle
#

The timer is reset every time you hit one target that wasn't down already.

agile anchor
#

ok and they pop up once hit or stay down and reset when complete?

#

think thats what you just said

#

lol

little eagle
#

They fall over when hit. They pop all up at once when you lose.

agile anchor
#

oh ok thats sounds good

#

how do i reset them (if someone passes)

little eagle
#

They reset themselves also 10 seconds after you win.

agile anchor
#

and i usually place a pencil on the ground to use as smoke do i do that still (can't see object name for it)

little eagle
#

The smoke is spawned on the first target in the array.

agile anchor
#

great thanks (even less for me to do) you are a star thanks very much for your time!!

little eagle
#

Don't praise before you have tested it. I would do myself, but it's a torture to run Arma on this 2010 laptop, and it will take 10 more days for me to get back at my desktop machine.

agile anchor
#

testing quik now

little eagle
#

SP or MP?

peak plover
#

jeez

little eagle
#

What is it, nigel?

peak plover
#

I'm surprised you can run it on a 2010

little eagle
#

It is a good laptop.

peak plover
#

🤔 🗒 ?

little eagle
#

I don't understand.

peak plover
#

ThinkPad 😄

gleaming oyster
#

I had a ThinkPad as my first pc

little eagle
#

It's not, but now that you mention it, it is what I have at work.

#

I dub it the thonkpad from now on though.

gleaming oyster
#

👌

little eagle
agile anchor
#

@little eagle just tested it on SP and it works great will test MP tom night and a bonus (although you prob did it intentionally) but targets 1 to 3 are a group and 4 to 6 are a group thus i can have multiple ranges/courses!

little eagle
#

Well, you said you wanted multiple courses.

agile anchor
#

again you are a star!

#

i keep trying with the scripting but most of the time i may as well be looking at the matrix lol

little eagle
#
// init.sqf
private _fnc_handleHit = {
    params ["_target"];

    // fall over
    if (_target getVariable "commy_isDown") exitWith {};
    _target setVariable ["commy_isDown", true];
    _target animate ["Terc", 1];

    // check win condition
    private _targets = _target getVariable "commy_targets";
    _targets params ["_main"];

    // if all down, win
    private _isWin = {!(_x getVariable "commy_isDown")} count _targets == 0;

    if (_isWin) then {
        private _smoke = "SmokeShellGreen" createVehicle [0,0,0];
        _smoke setPosASL getPosASL _main;
    };

    // reset "pop back up" script
    private _popupScript = _main getVariable "commy_popupScript";
    terminate _popupScript;

    _popupScript = _targets spawn {
        private _targets = _this;
        _targets params ["_main"];

        sleep 10;
        isNil {
            private _isWin = {!(_x getVariable "commy_isDown")} count _targets == 0;

            if (!_isWin) then {
                private _smoke = "SmokeShellRed" createVehicle [0,0,0];
                _smoke setPosASL getPosASL _main;
            };

            {
                _x setVariable ["commy_isDown", false];
                _x animate ["Terc", 0];
                _x setDamage 0;
            } forEach _targets;
        };
    };

    _main setVariable ["commy_popupScript", _popupScript];
};

private _fnc_initTargets = {
    if (!isServer) exitWith {};

    private _targets = _this;

    {
        _x setVariable ["commy_isDown", false];
        _x setVariable ["commy_targets", _targets];
        _x setVariable ["nopop", true];
        _x addEventHandler ["Hit", _fnc_handleHit];
    } forEach _targets;

    _targets params ["_main"];
    _main setVariable ["commy_popupScript", scriptNull];
};

[target1, target2, target3] call _fnc_initTargets;
[target4, target5, target6] call _fnc_initTargets;

I changed one line to make it work a tiny bit better.

agile anchor
#

ooh which line

little eagle
#

L6

obsidian violet
#

I feel abit annoying coming back here, I tried using this to get my arsenal whitelist working on every nato supply box spawned in during a mission.

init.sqf

["B_supplyCrate_F", "init", {
[_this,
[
"rhs_uniform_FROG01_d",
"AOR1_Camo"
]] call ace_arsenal_fnc_initBox;
}, false, [], true] call CBA_fnc_addClassEventHandler;

but getting an error everytime I spawn in the Nato supply box.
My error is:

=========================================
...ns\arsenal\functions\fnc_initbox.sqf"

|#|params [["_object", objNull]],...'
Error Params: Type Array,expected Object
File z\ace\addons\arsenal\functions\fnc_initbox.sqf, line 4

Do you have any clue whats wrong?

little eagle
#
["B_supplyCrate_F", "init", {
    params ["_box"];
    [_box, [ "rhs_uniform_FROG01_d", "AOR1_Camo" ]] call ace_arsenal_fnc_initBox;
}, false, [], true] call CBA_fnc_addClassEventHandler; 
#

Try it like this.

#

Killet ^

agile anchor
#

thanks again @little eagle bye guys of to bed lol

obsidian violet
#

@little eagle Cheers mate, gonna try it now

little eagle
#

Might have to change the "init" to "initPost" too, because init event is really early and some things don't work from there.

obsidian violet
#

what does the"initPost"change?

#

it worked!

little eagle
#

InitPost is a custom event by CBA triggered either one frame after the object was created, or after postInit in case the object is present at mission start.

#

To fix a ton of race conditions.

obsidian violet
#

alright, gonna change it then 😃
Does theese lines have to be written in the init.sqf or can I call this from another sqf file?

#

wanna keep my init.sqf as clean as possible

little eagle
#

File doesn't matter, but it should be one that runs on all machines.

obsidian violet
#

was thinking, initplayerlocal or something similar

little eagle
#

That'd work too I believe. The server doesn't need this function I think.

obsidian violet
#

atm this is all I have in my init.sqf

if (!isDedicated && hasInterface) then {
call compile preprocessFile "scripts\init_player.sqf";
};

and then I call all scritps from there like

call compile preprocessFile "scripts\brief.sqf";
call compile preprocessFileLineNumbers "scripts\arsenal_presets\box1.sqf";

#

Dont know if it is a good way or not,

little eagle
#

But I wanted to wait to see what that horribly slow writing guy would write
Grr

#

That's fine.

obsidian violet
#

cool, thank you very much man

little eagle
#

if (!isDedicated && hasInterface) then {

#

This could be changed to:
if (hasInterface) then {

#

Which is logically equivalent.

#

A dedicated server is a server without interface. isDedicated <=> isServer & !hasInterface.

obsidian violet
#

all my missions are being run from a dedicated.

little eagle
#

Doesn't matter, it is equivalent.

obsidian violet
#

alright then. 😃

little eagle
#

SP, MP, everywhere.

obsidian violet
#

gonna change it to if (hasInterface) then {

little eagle
#

I will post the logical proof^^ Sec.

obsidian violet
#

why haven´t I asked stuff here before?! I spent sooooo much time trying to figure out how to get theese things working HOURS.
and now I just got it all handed to me. THANK YOU ❤

little eagle
#

lol

obsidian violet
#

xD

little eagle
#
!isDedicated && hasInterface
!(isServer && !hasInterface) && hasInterface
(!isServer || hasInterface) && hasInterface
(!isServer && hasInterface) || (hasInterface && hasInterface)
(!isServer && hasInterface) || hasInterface
hasInterface
obsidian violet
#

I don´t quite get this more than all of them are using hasInterface somehow, so I suppose that would make sense to only use it

little eagle
#

L1 is what you wrote, L6 is what I suggested as alternative.

#

L2 replaces isDedicated with the equivalent (isServer && !hasInterface). Because that is what a dedi is: server without interface.

#

L3 De Morgan's law

#

L4 distributive property of & operator

#

L5 simplifies according to law of identity.

#

L6 is some other rule I forgot, it makes sense when you think about it.

obsidian violet
#

Alright, I try L6 and see how it works out. 😃

little eagle
#

Absorption law

#

Apparently that works on L3 too.

#
!isDedicated && hasInterface
!(isServer && !hasInterface) && hasInterface
(!isServer || hasInterface) && hasInterface
hasInterface
#

There. Simpler.

obsidian violet
#

Wow, this was alot of new info haha, need to do some more homework about this.

#

thanks!

little eagle
#

If you want to learn Arma, start with Aristotle. : P

obsidian violet
#

btw, the function I was handed
["B_supplyCrate_F", "initPost", {
params ["_box"];
[_box, [

]] call ace_arsenal_fnc_initBox;

}, false, [], true] call CBA_fnc_addClassEventHandler;

#

is there a way to do it without cba?

#

was thinking when you wanna run it "unmodded"

little eagle
#

Not without checking all objects every second or something silly like that.

obsidian violet
#

wow, yeah that sounds really bad for performance

little eagle
#

Not really if you do it smart.

#

There're commands that report all entities.

#

Those can easily compared with isEqualTo.

#

But ofc if everyone does it this way, and for every little thing, then yeah.

obsidian violet
#

well, using the cba was so short and easy so don´t see any reason why not to really. was more of curiosity

#

Don´t worry about it. feel like i have taken enough of your time.

thank you once again

little eagle
#

CBA does it by modifying the configs init events of all objects (a bunch of base classes).

#

Wouldn't work with vanilla that way obviously.

slate pollen
#

is their a Script that can prevent people from firing from vehicles that can like the offroad and jeep

dry zephyr
#

@little eagle nice use of propositional logic and deployment of De Morgan's law in an unlikely forum

little eagle
#

People otherwise argue for hours whenever I tell them to replace their strange isDedicated/isServer/hasInterface/isMultiplayer setups with something making sense, so I have to resort to this.

peak plover
#

@little eagle I noticed a feature that scripted lobby might need, vehiclevar names and gvar for every slot

#

And probably onCreatePlayer scripts.

#

could also have a slotIn condition etc.

#

I'll probably make a fork soon

little eagle
#

Sure. It's all simple stuff atm. Should be easy enough to edit once you get used to the macros...

peak plover
#

Yeah, I like the way you did the setvars and getvars

#

create a namespace and save the namespace name

peak plover
#

With the macro all that was so simple

burnt cobalt
#

noob question: is there a way for a client side addon to detect if another addon is running on server (Advanced Rappelling in my case)?

#
    params ["_inputString","_caller"];
    private ["_isClass"];
    _isClass = if (isClass(configFile/"CfgPatches"/_inputString)) then {true} else {false}; //~~ probably not gonna work
    _caller setVariable ["MCSS_ISCLASS",_isClass,true];
};

["AR_AdvancedRappelling"] remoteExec ["MCSS_CheckServerAddon",2];
MCSS_C2_IsRappel = player getVariable ["MCSS_ISCLASS",false];``` >> my best idea but it seems a bit unnecessarily complicated
delicate mason
#

You could remoteExec and ask the server about it

#

Which is exactly what you did :D

burnt cobalt
#

haha damn

delicate mason
#

Don't think there is an easier way without having server access

burnt cobalt
#

ah okay great... i was thinking maybe there's a way to return that is less wonky than my attempt with setVariable

delicate mason
#

Could use publicVariableClient to send to the client instead of settings a var on the player unit

#

But if you're checking it once at mission start any hacky solution should be fine :D

burnt cobalt
#

i see - many thanks! I needed assurance or schooling from the oracle 😃

thorn saffron
#

Is there a way to prevent units from getting killed, while allowing them to get damaged? Like still getting hit in the legs and such, just not actually dying

digital jacinth
#

this might sound weird, but is there a way to open the config viewer via sqf?

little eagle
#

Probably. Why?

digital jacinth
#

DMCA thing. someone reuploaded my mod after i dmca'd them, obfusicated it and removed the ability to open function viewer and config viewer

little eagle
#

What? lol

digital jacinth
#

yup

little eagle
#

Tried in 3den?

digital jacinth
#

ye, you cannot open it from eden or ingame view debug console

little eagle
#

Alt + G shortcut?

digital jacinth
#

also disabled

little eagle
#
0 spawn {
    sleep 0.1;
    [] call (uinamespace getvariable 'bis_fnc_configviewer');
};

in debug console.

digital jacinth
#

sadly doesn't do anything

#

i guess, I just need to compare the compiled functions and send a dmca

little eagle
#
0 spawn {
    sleep 0.1;
    [] call compile preprocessFile "A3\functions_f\debug\fn_configviewer.sqf";
};
digital jacinth
#

nope, also does not work..

#

what have they done to break it that much?

#

if you want i could just send you the pbo, it is not even 2 mb

little eagle
#

Please upload it.

tight moat
#

How does a mod disable the config viewer?

#

Even in 3den?

digital jacinth
#

commy, i sent it to you in private as i cannot upload it here

tight moat
#

Is there any way for a mod to run scripts in 3den?

digital jacinth
#

only requirement for the mod is CBA

little eagle
#

So what am I looking at here, diwako?

#

18:01:28 Failed to load TextureHeaderManager from file "test_anomalies\texheaders.bin" - failed to open the file.
18:01:28 Failed adding texture headers from file "test_anomalies\texheaders.bin"

#

@digital jacinth Do you want a config dump?

digital jacinth
#

that would be sweet

#

ii am currently looking through and collecting evidence, so far i already made this

hollow thistle
#

Arma: CSI DLC :D

digital jacinth
#

i already dmca'd them twice, so one of their admins is not banned form uploading to sw. they also do not respond to any sort of communication

#

it is somewhat frustrating

hollow thistle
#

I belive. Do you need the evidence for steam support?

little eagle
#

["CfgMods","CfgAmmo","CfgMagazines","CfgWeapons","CfgFactionClasses","CfgVehicles","CfgPatches","CfgSounds","CfgFunctions","Extended_PreInit_EventHandlers"]

#

These config classes are edited by this mod.

hollow thistle
#

Also why they re-upload it? Just to steal credit or because your license does not endorse any modifications.

digital jacinth
#

my license is against using it on any monetized server or server which offer ingame rewards after "donating" real life currency

#

wow, cfgfactionclasses has not been touched by my mod

hollow thistle
#

"life" or Russian players i guess?

digital jacinth
#

and no cfgmods has been touched

#

yep

hollow thistle
#

Sad.

digital jacinth
#

it is a cmobination of both actually

#

life and russian

#

you can compare what i am actually touching in my config in here

little eagle
#

Let's see what

getText (configFile >> "CfgFactionClasses" >> "DIW_ANOMALY" >> "displayName")

returns...

digital jacinth
#

oh hang on, "displayName" should return Stalker anomalies"

little eagle
#

"Stalker anomalies"

digital jacinth
#

ye i just rechecked, it is the config for the eden module category

little eagle
#

Now I wish I kept that custom config viewer I made.

#
configFile >> "RscDisplayConfigViewer"

returns config null, so it seems like they deleted that class.

#

I will just put it back in using a custom mod...

digital jacinth
#

what the hell

little eagle
#

That's pretty lame though. I hoped for a control that closes it's parent via onLoad. That would've been more difficult to fix.

digital jacinth
#

well i really want to get itno the config viewer and look thorugh what they have broken, meanwhile i am just going through the configs via debug watchers

digital jacinth
#

interesting, even with the config viewer working, they went ahead and pasted the whole script into one line so it would not show in the configviewer
https://i.imgur.com/1A7Fox6.png

little eagle
#

Functions viewer.

digital jacinth
#

woops, yeah

little eagle
#

Yeah, they used some regex tool to delete the newlines.

#

I don't even know if you're just tricking me, and this isn't actually your mod originally^^
But I hate obfuscations, so I'd help you anyway.

tight moat
#

Does anyone know how PBO files are structured? More specifically the "ProductEntry" that the wiki mentions, does this come after the "HeaderExtension" and what indicates that the HeaderExtension is included at all?

little eagle
#
params[["_pos",[0,0,0]],["_radius",10],["_isRectangle",true],["_angle",0]];if(!isServer) exitWith{};if(typeName _pos!=typeName[]) then{private _area=_pos getVariable"objectarea";_radius=_area#0;_isRectangle=_area#3;_angle=_area#2;private _module=_pos;_pos=getPosATL _pos;deleteVehicle _module;};_angle=0;if(count _pos<3) then{_pos set[2,0];};_pos set[2,(_pos#2)-2];_trg=createTrigger["EmptyDetector",_pos];_trg setPosATL _pos;_trg setdir _angle;_trg setVariable["anomaly_cooldown",false,true];_trg setVariable["anomaly_type","fog",true];_trg setVariable["radius",_radius,true];_trg setVariable["angle",_angle,true];
[_trg,[_radius,_radius,_angle,_isRectangle,4]]remoteExec["setTriggerArea",0,_trg];[_trg,["ANY","PRESENT",true]]remoteExec["setTriggerActivation",0,_trg];[_trg,["this && {round (cba_missiontime mod 2) == 1}","[thisTrigger,thisList] spawn anomaly_fnc_activateFog",""]]remoteExec["setTriggerStatements",0,_trg];if(isNil"ANOMALIES_HOLDER") then{ANOMALIES_HOLDER=[];};ANOMALIES_HOLDER pushBackUnique _trg;publicVariable"ANOMALIES_HOLDER";if(!isNil"ANOMALY_DEBUG"&&{ANOMALY_DEBUG}) then{_marker=createMarkerLocal[str(_pos),_pos];_marker setMarkerShapeLocal"ICON";_marker setMarkerTypeLocal"hd_dot";_marker setMarkerTextLocal(_trg getVariable"anomaly_type");};_trg

@digital jacinth You recognize this?

digital jacinth
#

ye

#

that is the fog anomaly

#

i already made some comparison of exactly that one

#

see here

little eagle
#

For some reason this obfuscation tool places a lot of empty functions into the mission namespace.

#
{
    private _fnc_scriptNameParent = if (isNil '_fnc_scriptName') then {'anomalyEffect_fnc_meatgrinder'} else {_fnc_scriptName};
    private _fnc_scriptName = 'anomalyEffect_fnc_meatgrinder';
    scriptName _fnc_scriptName;

params[["_obj",objNull],["_source",objNull],["_state","idle"]];if(isNull _obj||isNull _source) exitWith{};switch(_state) do{case"idle":{_source setParticleCircle[2,[0,0,0]];_source setParticleRandom[0,[0.25,0.25,0],[0.175,0.175,0],0,0.5,[0,0,0,0.1],0,0];_source setParticleParams[["\A3\data_f\cl_leaf",1,0,1],"","SpaceObject",1,7,[0,0,0],[0,0,0.5],0,10,7.9,0.075,[2,2,0.01],[[0.1,0.1,0.1,1],[0.25,0.25,0.25,0.5],[0.5,0.5,0.5,0]],[6,5,5],1,0,"","",_obj];
_source setDropInterval 0.2;};case"meat":{_source setParticleCircle[0,[0,0,0]];_source setParticleRandom[0,[0.25,0.25,0],[3,3,5],0,0.25,[0,0,0,0.1],0,0];_source setParticleParams[["\A3\data_f\ParticleEffects\Universal\Meat_ca.p3d",1,0,1],"","SpaceObject",0.5,5,[0,0,0.5],[0,0,10],0.5,50,7.9,0.075,[10,10,10],[[0.1,0.1,0.1,1],[0.25,0.25,0.25,0.5],[0.5,0.5,0.5,0]],[0.08],1,0,"","",_obj,0,true,0.1];_source setDropInterval 0.1;};default{};};
}
digital jacinth
little eagle
#

^^

digital jacinth
#

ye that on is the function which initialises a local particle emmiter

#

used for either the idle effect or the activation effect

#

they did not bother changing any function name, so you can just look them up inside the cfg functions file

little eagle
#

Link to the stolen thing?

digital jacinth
#

warning 9 gb

dry zephyr
#

@digital jacinth I'm just curious, your mod has 2300 subscribers and 23000 unique visitors. Their's has 8 and 10. Why care? Is it even worth your time? You have creative skills. This isn't creating anything.

digital jacinth
#

@dry zephyr It was uploaded 2 days ago, they are currently transitioning form one mod pack to this one, the have around 500 players. Plus they are giving ingame rewards in exchange for real life money which is against the license i put them up. plus this is the third time they have reuploaded it

#

so far they are the only ones i have dmca'd due to breach of the license. I do not really care for small groups of friends reuploading them because i knowhow hard it is to enable a mod after running my own small a3 community

little eagle
#

Steam should just ban their accounts and earn a few bucks by them having to re-buy all their video games.

digital jacinth
#

oh, plus i prefer settling this without a dmca, but they ignore all my efforts contacting them

little eagle
#

It has settings 👍

dry zephyr
#

@digital jacinth, you know the STALKER franchise is big in Russia (in part because it is set in Russia, well, technically Ukraine, but was part of Soviet Union when it happened). What they may be doing, even though you probably don't feel this way, is adding something by making it available to a Russian audience, albeit against your wishes. Do you have a Russian translation of all your copy, instructions, and license (which they probably haven't even read)? If not, you could outfox them by creating one and indicating "as used in <their mod> [without permission]"

digital jacinth
#

I would need someone who speaks russian for this sadly. I would not want to use an online translator for this

dry zephyr
#

Someone in the community would probably be able to help. You already got commy2 doing obfuscated script analysis and reverse engineering - that's a much higher and hard to find skillset than translation of a few English texts to Russian. 😋

digital jacinth
#

true

brave jungle
#

Running the following in a script ran on the init of a unit doesn't do anything, if i'm not mistaken, if my UID is present and i'm in the object named curatorUnit, it should failMission correct?

//Script edited to be working for others who may stumble across this

_BlacklistedUIDs = ["76561198116251840"];
_CuratorSlot = [curatorUnit, curatorUnit_1];

_uidActivePlayer = getPlayerUID player;

if ((Player in _CuratorSlot) && (_uidActivePlayer in _BlacklistedUIDs)) then {
   failMission "BlockedZeus";
};
#

Whoops forgot the context too. Basically, if a player is in the blacklist, I want to have them blocked from this slot entirely.

hollow thistle
#

you are checking if uid is in your slots array. instead you should check player in _CuratorSlot

#

also slot array should be an array of objects/vars not strings.

#

_CuratorSlot = [curatorUnit, curatorUnit_1];

brave jungle
#

Oh silly me, didn't even pick up on the objects situation haha. i'll do the fixes and see how it goes

#

Cheers working as expected 😃

#

It's always that second pair of eyes that spot the silly things haha

hollow thistle
#

yw. 😛

still forum
#

@digital jacinth btw contacting Dwarden might be easier/faster than trying a DMCA. But only when you have the evidence. I'll unpack that on the weekend when I have time.

digital jacinth
#

also wrote together some document already, but no dmca filed for now as i still naivly hope they accept my friend request and we can talk about it

errant jasper
#

@tight moat My reading of the Wiki, it says, if ProductEntry is present (the data is fixed), it is the first entry in the header. So you could check that first, and if it does not match it is not a resistance pbo. For header extensions, I guess your best bet is to use the version you read a bit before. Seems bit flawed that there is no way to properly detect this. I mean are you allowed to have an empty header extension - how would you differentiate from last entry? Though you might have more success at getting info in #arma3_tools .

limber tangle
#

Hey guys is there any way to set an object to be picked up and placed in hands like a weapon, trying to create my own fire extinguishers, that users can pick up and use on the wild fires, just not sure what direction i should look in?

still forum
#

yes.

#

you can just make your own weapon that looks like a fire extinguisher

limber tangle
#

Okay thank you, so no way of making the base game extinguisher into a usable object?

still forum
#

but it will 99% not be held in the players hands as you want it

little eagle
#

attach to floating before you.

still forum
#

would be essentially the same result as a fake weapon config. It won't be held in hands as you expect. it will just flobber around infront of you

limber tangle
#

Okay so the attach to would have it float then could use a addaction to fire it, no to worried about how it looks ts more the functionality of it

agile anchor
#

@little eagle that script worked in MP so thanks

little eagle
#

I'm proud that this worked without bugs despite no debugging at all.

agile anchor
#

i have another thing i can't solve....can i be cheeky and ask for help 2 days in a row? (don't wanna take the pee)

little eagle
#

I think I wasted too much time on this game...

#

Maybe.

agile anchor
#

i'm trying to use an Ai civilain as a target. Have him not move and careless so he doesn't run away but can't for the life of me work out how to respawn him when he dies. any ideas?

#

(using ai instead of pop up target in this particular case as AT or 40mm just destroy the pop ups and not knock them down) - maybe there is a better way?

little eagle
#

Only playable characters can respawn. You will have to create a new one.

agile anchor
#

i have looked at spawning in one instead of respawning but scripts avaiable seem to be random spawns and i want it to replace the dead one (same place same attributes) if you know what i mean

#

(almost like he behaves as a pop up target lol)

little eagle
#
civ1 addEventHandler ["Killed", {
    params ["_corpse"];

    private _loadout = getUnitLoadout _corpse;
    private _type = typeOf _corpse;
    private _group = group _corpse;

    [_type, _group, _loadout, _corpse] spawn {
        sleep 10;
        isNil {
            params ["_type", "_group", "_loadout", "_corpse"];
            private _unit = _group createUnit [_type, [0,0,0], [], 0, "NONE"];
            _unit setPosASL getPosASL _corpse;
            _unit setUnitLoadout _loadout;
            deleteVehicle _corpse;
        };
    };
}];

🤔

gleaming oyster
#

Hmm. What would the benefits of isNil be? (i know it executes the code inside)

little eagle
#

I don't want the unit to be spawned, drown because the game decides to put the scheduled script to sleep for 10 seconds, and then be teleported.

#

spawn sleep isNil is discount cba_fnc_waitAndExecute.

#

When precise time doesn't matter.

gleaming oyster
#

Hmm

little eagle
#
commy_fnc_respawnDude = {
    params ["_corpse"];

    private _type = typeOf _corpse;
    private _group = group _corpse;
    private _loadout = getUnitLoadout _corpse;

    [_type, _group, _loadout, _corpse] spawn {
        sleep 10;
        isNil {
            params ["_type", "_group", "_loadout", "_corpse"];
            private _unit = _group createUnit [_type, [0,0,0], [], 0, "NONE"];
            _unit setPosASL getPosASL _corpse;
            _unit setUnitLoadout _loadout;
            deleteVehicle _corpse;
            _unit addEventHandler ["Killed", commy_fnc_respawnDude];
        };
    };
};

civ1 addEventHandler ["Killed", commy_fnc_respawnDude];

Recursion, so it works more than once.

agile anchor
#

@little eagle so would this script go in the civilains init or a trigger on act that depends on his death?

little eagle
#

init.sqf

agile anchor
#

civ1 addEventHandler ["Killed", commy_fnc_respawnDude];

#

this bit?

little eagle
#

All of it.

agile anchor
#

oh ok nd call the civilian civ1?

little eagle
#

Yes,

agile anchor
#

sweet

little eagle
#

Then add

civ2 addEventHandler ["Killed", commy_fnc_respawnDude];

for every other respawning npc.

agile anchor
#

@little eagle it works apart from when civ spawns in it doesn't have this disableai "move"; civ1 setUnitPos "UP"; and runs off

little eagle
#

You can add those to the script easily.

agile anchor
#

wouldn't know where to start and end up ruining your work lol

#

@little eagle would it be after line 12?

little eagle
#

Yes. With _unit instead of this and civ1

agile anchor
#

thanks mate i'm learning (slowly)

#

@little eagle is the "0" [], 0, "NONE"]; the direction? as civ1 spawns in facing different direction?

little eagle
#

No. Placement radius.

#

But doesn't matter for us, since we set the position with setPosX.

agile anchor
#

setpos will only give me location on the map not actual direction unit is facing?

#

@little eagle i found this (sg1 select 0) setdir 180; but don't understand the "select 0"

#

what does that mean?

little eagle
#

sg1 is an array and select 0 picks the first element.

#

We don't have arrays here, so just _unit.

#

Do the setDir before the setPos, so the facing is synched correctly in MP.

agile anchor
#

ok

little eagle
#

setDir only changes it on the local machine, but setPos can be used to carry it to remote machines indirectly. This game's weird.

agile anchor
#

what do you mean by the first element?

#

sorry#

little eagle
#

An array is a set of objects, numbers, booleans, strings, whatever.

#

[1,2,3]

#

[1,2,3] select 0 // 1

#

[1,2,3] select 2] // 3

agile anchor
#

oh so copies the 1st

little eagle
#

Yes. 1st has index 0, because that's where you start counting according to R. Stallman (pbuh)

agile anchor
#

ok think i got it (when i say it i mean that very small bit lol) thanks again for your time and taking time to explain stuff to me 😃

#

@little eagle sorry 1 last thing you said a bit further up ^^^ that setdir only works on local so will that not transfer to MP or it will if I place it before setpos? thanks

little eagle
#

setPos will synch globally, and it will also synch the direction weirdly enough, which setDir on it's own doesn't.

agile anchor
#

oh ok so putting it before setpos will keep it- thanks i'll leave ya in peace now (well for today anyway lol) 👍

molten folio
#

Whats Display 24??

limber tangle
#

Okay so took a look at the attach and got the extinguisher in hand and moveable, the issue now is getting a addaction for turning on the script and turning off the script, how would i go about adding the addactions 1 to start and one to end the action, attched is the code:

null=[12,this] execVM "AL_waterfall\al_waterfall_start.sqf";
winter rose
#

@molten folio isn't it the map?

molten folio
#

nvm i found it

winter rose
#

and it's…?

jade imp
#

anyone have an idea as to how I could create two computers, one where you can put in information, and another that can look it up?

astral tendon
#

any idea how to fix that?

meager heart
#

if you're using respawn modules, the fix is > don't use them and make your own respawn "add position" function...

gleaming oyster
#

Yep

little eagle
#

anyone have an idea as to how I could create two computers, one where you can put in information, and another that can look it up?
🤔

inner swallow
#

...a LAN?

little eagle
#

I think he means the internet?

inner swallow
#

inb4 "i want to script the internet in arma"

meager heart
#

also maybe "lan mode" for dedicated and double click play... 😀

little eagle
#

ALOHA, was a pioneering computer networking system developed at the University of Hawaii

#

wow

digital jacinth
#

I mean, ALOHA sounds better then Hello world

little eagle
#

than*

meager heart
#

"what poppin my dudes" < sounds even cooler /s

peak plover
#

Eey wassup my newtons

#

Neutrons

gleaming oyster
#

Nigel, please don't. You hurt my head too much at 1:14 AM

limpid pewter
#

Does anyone know whether it is better for performance to use a regular event script (https://community.bistudio.com/wiki/Event_Scripts) or an event handler that calls a function as a file? I would assume that an event script would be more demanding as it interprets the commands rather than having it pre-compiled, but i was hoping someone might already know, that's all.

still forum
#

"interprets"?

#

All SQF scripts are compiled.

limpid pewter
#

For example, to handle player deaths, would it be best to put all of the code within onPlayerKilled.sqf or have a event handler that calls a separate function?

still forum
#

And all engine eventhandlers are compiled when called

limpid pewter
#

@still forum Awesome, that's what i was after.

still forum
#

onPlayerKilled.sqf with content _this call My_fnc_onKilled is essentially the same as killedEH with content _this call My_fnc_onKilled

limpid pewter
#

Afaik, custom .sqf scripts are interpretted rather than pre-compiled, because i was able to change the script mid game and the effects come through.

still forum
#

No

#

SQF cannot be interpreted directly

#

they have to be compiled to be executed

winter rose
#

execVM will reload the sqf file though?

still forum
#

as with eventhandlers they are compiled. executed. and the compiled script is thrown away just to be compiled again on next execution

limpid pewter
#

So how was i able to change the script in game and the effect of the change happen

#

?

still forum
#

Read what I just wrote

#

they are compiled before every execution

limpid pewter
#

ahh ok

#

sorry, just delay of text conversations

still forum
#

Always best is to not do the actual eventhandling in the eventhandling script

#

always place a function in CfgFunctions and just call that from the eventhandling script

#

so you don't waste alot of time re-compiling your big script over and over again

limpid pewter
#

Awesome, that's what i was after, and it makes sense.

#

Thanks alot. 😃

hollow thistle
#

As my question got burried in other ones some days ago I will ask again :D.

So we are thinking about using "floating" camera for Liberation build system (instead of current system where item is placed in front of player) .
Would it be feasible to integrate Zeus into our resource system or would it be better to write it from scratch?
#

Also any suggested things I should read about to learn how to "detach" controllable camera from player unit?

#

Basically we want to have zeus-like camera available for player to fly around "fob" area and build stuff. Some things would consume resources (fuel, ammo, supplies) to be build.

peak plover
#

Createcamera page on wiki

#

I dno about camera controls or mouse position in world tho

#

Like camera look around w mouse mite be hard,

#

Probably easiest to use zeus. But best is a non zeus solution

hollow thistle
#

The problem is we need to support our resource system. Maybe I could intercept zeus build event.

#

I think there was an remake of old RTS game that was using zeus to control gameplay. I will have to search for it. Maybe it could be useful for me.

peak plover
#

Yeah, zeus also has issues like when anouther player loads in, every gets lag

still forum
#

yeah. That project looked awesome. Please send me the link if you find it. I also searched for that a couple months back but just wasn't able to find it

hollow thistle
#

I will have to look into his code then. He has nice RTS like panel in zeus-like camera.

#

Sadly project looks dead.

still forum
#

Yeah that was it.. Never fully released though :/

hollow thistle
#

Maybe we don't need that new, improved build system... 🤣

still forum
#

confirmed yeah

meager heart
#

that is "spectator like" free camera ^

hollow thistle
#

This could be useful. Thanks!

queen cargo
#

uhm ... why you thought a heavily scripted UI would be simpler? 😅
for the creation of my medical display in XMS2 i already had a few dozent lines of code (and that was not even remotely as complex)
https://github.com/X39/XMS2/blob/master/X39_MS2_Scripting/Functions/DialogControl/MedicalUi/MedicalUi_createDialog.sqf
loads of stuff also hidden behind methods like https://github.com/X39/XMS2/blob/master/X39_MS2_Scripting/Functions/DialogControl/MedicalUi/TriageCardFrame/MedicalUi_TriageCardFrame_setVisibilityState.sqf

doing UI stuff always is PITA simply because you are doing UI stuff

dusk sage
#

Have you got enough indentation in there

still forum
#
[profileNamespace getVariable["X39_MS2_options_MedicalUi_toggleFrame_state_ToggleDrugsFrame", true], 0] call X39_MS2_fnc_MedicalUi_DrugsFrame_setVisibilityState;
[profileNamespace getVariable["X39_MS2_options_MedicalUi_toggleFrame_state_ToggleDiagnosticFrame", true], 0] call X39_MS2_fnc_MedicalUi_DiagnosticFrame_setVisibilityState;
[profileNamespace getVariable["X39_MS2_options_MedicalUi_toggleFrame_state_ToggleTriageCardFrame", true], 0] call X39_MS2_fnc_MedicalUi_TriageCardFrame_setVisibilityState;
[profileNamespace getVariable["X39_MS2_options_MedicalUi_toggleFrame_state_ToggleQuickActionFrame", true], 0] call X39_MS2_fnc_MedicalUi_QuickActionFrame_setVisibilityState;

That was back when X39 hated CBA/ACE for using macros :D
Imagine that with macros.

[OPTIONVAR(toggleFrame_state_ToggleDrugsFrame, true), 0] call FUNC(DrugsFrame_setVisibilityState);
[OPTIONVAR(toggleFrame_state_ToggleDiagnosticFrame, true), 0] call FUNC(DiagnosticFrame_setVisibilityState);
[OPTIONVAR(toggleFrame_state_ToggleTriageCardFrame, true), 0] call FUNC(TriageCardFrame_setVisibilityState);
[OPTIONVAR(toggleFrame_state_ToggleQuickActionFrame, true), 0] call FUNC(QuickActionFrame_setVisibilityState);
still forum
#

I guess someone used space indentation before.. And then thought I'll do tabs now. So replace all space with \t now

#

no github doesn't

#

nah.. Even if you replace all tabs with spaces the indent is too much

#
                                                                                                                if(str _currentPos == str _pos1) then
                                                                                                                {
                                                                                                                    [false] call X39_MS2_fnc_MedicalUi_DiagnosticFrame_setVisibilityState;
                                                                                                                }
                                                                                                                else
                                                                                                                {
                                                                                                                    [true] call X39_MS2_fnc_MedicalUi_DiagnosticFrame_setVisibilityState;
};

That's a great way to waste 8 lines with horrible indent to do something that could be written way more readable in a single line.
[_currentPos isEqualTo _pos1] call FUNC(DrugsFrame_setVisibilityState);

limber tangle
#

Okay so took a look at the attach and got the extinguisher in hand and moveable, the issue now is getting a addaction for turning on the script and turning off the script, how would i go about adding the addactions 1 to start and one to end the action, attched is the code:

null=[12,this] execVM "AL_waterfall\al_waterfall_start.sqf";
warm gorge
#

Is there a way I can clear the remote execution JIP queue?

still forum
warm gorge
#

Ah damnit, might just have to restart then

lone glade
#

technically if you assigned IDs to the RE you can remove all of them

warm gorge
#

In this case it was a hacker that did it, trying to avoid having to restart

lone glade
#

yeah, nah you have to restart

still forum
#

Just found out that https://pastebin.com/archive/sqf is a thing. See all recently posted SQF scripts on pastebin and laugh about their quality.. Or learn from them.. Maybe

digital jacinth
#

one more reason to set pastes to private :V

hollow thistle
#

# 👀

austere granite
#

pls macros

#

als does anyone actually use comment ? 😄

lone glade
#

yes, stupid people

#

very stupid people

austere granite
#

so much life stuff in there

tame stream
#

Hi, im trying to create the following ... Restricting vehicle driver seat to specified unit type.
Im using a old Pilot Restriction script and trying to add a new kind to restrict, logistic vehicles.

_crew = ["I_crew_F"];  //---------------------------------- Logi Units 
_logi = ["I_G_Van_01_fuel_F"];  //------------------------- Logistic Vehicles

_iampilot = ({typeOf player == _x} count _crew) > 0;

while { true } do {
    _oldvehicle = vehicle player;
    waitUntil {vehicle player != _oldvehicle};

    if(vehicle player != player) then {
        _veh = vehicle player;
        
        if(_veh isKindOf "_logi") then {
            if(({typeOf _veh == _x} count _aircraft_nocopilot) > 0) then {
                _forbidden = [_veh turretUnit [0]];
                if(player in _forbidden) then {
                    if (!_iampilot) then {
                        systemChat "Co-driver seat reserved for Logistic units";
                        player action ["getOut",_veh];
                    };
                };
            };
            if(!_iampilot) then {
                _forbidden = [driver _veh];
                if (player in _forbidden) then {
                    systemChat "Vehicle reserved for Logistic units";
                    player action ["getOut", _veh];
                };
            };
        };
    };
};
#

im still learning scripting so if i made a dumb error please point ti out

robust hollow
#

waitUntil {player == player};

#

that... that is pointless.

tame stream
#

@robust hollow ok, removed

#

any idea what im doing wrong, if im not mistaken i should be able to specify the vehicle type to add a new class

robust hollow
#

_veh isKindOf "_logi" pretty sure thats not how the world works. you would want something like typeof _veh in _logi. also i think this would be better off in a GetInMan EVH but im off to bed so hopefully someone else can explain that.

tame stream
#

this is from an existing pilot restriction script that currently wokrs, as mentions im mearly trying to add a new type

lone glade
#

I think I made something like this a year or two ago, lemme find it

tame stream
#

cool

tame stream
#

ill check it..thx

tame stream
#

@lone glade this is a pilot restriction script, how do i add specific vehicles restricted to specific unit types....just to be clear im not looking for pilot restrictions, im looking to add new vehicles to be restricted

lone glade
#

it's the exact same principle, just use your brain

agile anchor
#

hi i'm trying to have a trigger activate when any civilain dies in it without naming all the civilains. is it possible? i have a trigger set to civilian present and have tried !alive_x , !alive_x forEach thisList; in the trigger condand no joy any ideas please

lone glade
#

^ _x is a magic variable that stores the current index for a loop (foreach, apply, array select code)
in the second one you're missing code brackets { }

#

you're also missing a space between alive and _x in both

agile anchor
#

oh i thought x was ref to any and not specific...dam still trying sorry

#

when i try {!alive _x} forEach thisList; it says type nothing expected bool whatever that means and for {!alive _x} thisList;

copper raven
#

({!alive _x && side _x==civilian}count thisList)>0;

lone glade
#

first one is correct and it's probably the trigger field shitting itself like usual, second one isn't valid
and also I was trying to make him come to the solution by himself :/

agile anchor
#

@copper raven that didn't work thanks tho

copper raven
#

GWqlabsThonkery I almost never use triggers,weird.

digital jacinth
#

small update to the thing that happened yesterday, they removed it and reuploaded it into a different pbo name. It is dmca'd now as they did not want to communicate

#

I just wanted to thank all of you who stood up and helped me figuring this out.

mint kraken
#

So I am trying to make a admin cam/menu here, And I am setting up the initialiazion/loading for the dialog, It stops where it tries to initialize the ListPlayers . So it doesnt do the hint 3. And in this sqf file I have an include that includes an .inc file with all the IDC's. Anything wrong seen in this code?
REMOVED CODE

still forum
#

no errors in RPT or anywhere?

mint kraken
#

nope

#

nothing

still forum
#

Does it work too if you replace IDC_ADMINCAM_LISTPLAYERS by the actual IDC manually?

mint kraken
#

Well I'll try.. But should that matter? as I am including an .inc file that has defines inside.

still forum
#

easier to rule things out one after another

mint kraken
#

Alright will try that, gimme a few momento

still forum
#

How about adding a hint str [_ctrlListPlayers]; under the displayCtrl line

mint kraken
#

alrighty

#

Could it be that the display is not being passed?

still forum
#

could be. Don't know.......... waait

#

is that the onLoad EH of the display?

#

That might fire before the actual contents are loaded.. maybe

mint kraken
#

onLoad = "[""Load"", [_this]] call life_fnc_adminCam"; is in the display (.h file). Which executes that code ^^

#

Should I do a check if display is opened or something?

still forum
#

the hint I posted above will tell you if the display not being fully initialized is the problem

mint kraken
#

Alright will try it out

still forum
#

for adding the eventhandler

#

you could instead do that in the onLoad EH of the actual playerlist control

mint kraken
#

yeh, but I wanted it to be in the sqf

still forum
#

yeah. Just call another SQF script from it's onLoad

#

alternative... wait a frame or two and execute your code again

#

but passing displays/controls around is tedious because Arma can't serialize them and complains about it

lone glade
#

^ nope, just use unscheduled like a big boi

still forum
#

I'd say that too..

lone glade
#

no serialization needed 😛

still forum
#

but this is life apparently

lone glade
#

aaah, the land of "mission" dialogs and bad sqf 😄

mint kraken
#

xD

meager heart
#

life_fnc_adminCam > debug console 👌 /s

#

ez

mint kraken
#

Naah, its not just a camera and not all my staff know sqf

#

Well I solved the issue in another way...

#
  case "init": {
      _params = [ _this, 1, [] ] call BIS_fnc_param;
      private _display = _params select 0;

      //--- Store display in uiNamespace
      uiNamespace setVariable ["Life_AdminCam", _display];

      //--- Effects
      [_params, "Life_AdminCam"] call BIS_fnc_guiEffectTiles;

      _display displayAddEventHandler [ "Unload", {[ "UnLoad", _this ] call life_fnc_adminCam; uiNamespace setVariable [ "Life_AdminCam", nil ];} ];

      //--- Call
      ["Load", _params] call life_fnc_adminCam;
  };

I made a init mode. And using BIS_fnc_param; seemed to work..

#

Not sure how that fixed that

#

but yeh. Thanks for the help though!

meager heart
mint kraken
#

Well isnt that ^^ just like doing [_this]

lone glade
#

it's just param with an extra step

mint kraken
#

so I needed to do [[_this]]?

lone glade
mint kraken
#

Also I saved my gui with a name test but then it disappeared.. It copy it as code, did it save to somewhere else?

lone glade
#

you... you used the GUI editor didn't you?

mint kraken
#

yeh

austere granite
#

REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

lone glade
#

oh sweet summer child....

meager heart
#

lol

mint kraken
#

?

austere granite
#

don't use it it creates shitty configs

mint kraken
#

Well I tried it first time

#

I usually use arma dialog creator

#

Is that what everyone else uses?

lone glade
#

nope

mint kraken
#

What does everyone else use then?

lone glade
#

nothing?

mint kraken
#

oh, cool

lone glade
#

I write mine by hand, it's extremely fast once you get the hang of it

mint kraken
#

Any Advice on how I could get the hang of it?

lone glade
#

don't use "mission" dialogs if you can avoid it

#

it's literally hell

austere granite
#

i think your starting point would be creating a controls group and learning how coordinates work

lone glade
#

pretty much

austere granite
#

alganthe is in the process of writing a tutorial though

#

i heard

lone glade
#

nope

#

absolutely not 😛

#

I had the idea thrown at me then I forgot about it.

mint kraken
#

would love to see a tutorial, +1

austere granite
#

honestly i dont feel like it because theres just going to be 5000 life kids moaning for more help 😄

lone glade
#

^ yes, exactly

#

I do help some people here who ask for help with specific issues related to UI tho.

mint kraken
#

Oh btw 1 last question, anyway I can disable the hud of the BIS_fnc_camera? There isnt any parameter for it to disable it...

lone glade
#

if it's the splendid cam, press backspace

mint kraken
#

yeh but Isnt there a way in code?

meager heart
austere granite
#

open up the function

lone glade
#

^ nope

austere granite
#

showhud unrelated ;D

mint kraken
#

wouldnt that "showHud" disable everything that is a hud? So there is no other way than opening the fnc and editing it?

lone glade
#

nope

#

it's for the player HUD

austere granite
#

player hud being engine stuff that you dont influence with other scripting stuff

meager heart
#
case (_key in actionkeys "cameraInterface"): {
    _return = true;
    _ctrlOverlays = [_display displayctrl 3142,_display displayctrl 3143];
    if (BIS_fnc_camera_visibleHUD) then {
        {_x ctrlsetfade 1;} foreach _ctrlOverlays;
        (_display displayctrl 3142) ctrlenable false;
        cameraEffectEnableHUD false;
    } else {
        {_x ctrlsetfade 0;} foreach _ctrlOverlays;
        (_display displayctrl 3142) ctrlenable true;
        cameraEffectEnableHUD true;
    };
    BIS_fnc_camera_visibleHUD = !BIS_fnc_camera_visibleHUD;
    {_x ctrlcommit 0.1} foreach _ctrlOverlays;
};
``` that from BIS_fnc_camera ^
#

so... like that ^ 😀

mint kraken
#

😮

#

hmm but I would still need to transfer the BIS_fnc_camera into my mission then edit it right?

kind torrent
#

_this setUnitTrait ["camouflageCoef", 1];

#

Is this a proper execution of a script to modify a player's camo coefficient?

#

Or am I missing something?

winter rose
#

it is

meager heart
#

probably just wait until that dialog will be created, return the controls and do what ever you want with them and showHUD and cameraEffectEnableHUD will helps too, IsS127

#

anyone uses scripted "Guarded Points" ? is there any "area radius" or that is just position or object ? 🤔

#

probably nobody... 😄

kind torrent
#

excellent thank you 😄

#

What's the requirement for changing audio coef?

#

😮

junior stone
#

is it possible to add a custom message via the the command #exec ban?

peak plover
#

Do you mean like a dialog that will open when the player gets kicked for the player?

gleaming oyster
#

@nigel#4210 Yes, I think that is the intention ^&

#

damn

#

fucking discord

peak plover
#

@junior stone
https://community.bistudio.com/wiki/serverCommand
Setup serverCommand on the server and make your own ban function then run the guiMessage before kicking and then kick. I'm not sure if getting banned and forced out of server will leave the dialog open

winter rose
kind torrent
#

Ohhh!

#

I forgot about that! Thank you!

modest temple
#

why does this not work?


 titleCut ["", "BLACK FADED", 999]; 
[] Spawn { 
 
titleText ["6 Months after the withdraw of CSAT","PLAIN DOWN"];  
titleFadeOut 7; 
sleep 5; 
 
titleText ["CSAT decided to unstablize the region again","PLAIN"]; 
titleFadeOut 7; 
sleep 5; 
 
titleText ["FIA is starting a new rebelion","PLAIN DOWN"]; 
titleFadeOut 12; 
sleep 10; 
 
titleText ["NATO still has troops on the ground","PLAIN"]; 
titleFadeOut 9; 
sleep 7; 
 
titleText ["Operation Sustained lion","PLAIN"]; 
titleFadeOut 12; 
sleep 10; 
 
// Info text 
[str ("FIA Camp"), str("Medril Ares"), str(1) + "." + str(3) + "." + str(2036)] spawn BIS_fnc_infoText; 
 
sleep 3; 
"dynamicBlur" ppEffectEnable true;    
"dynamicBlur" ppEffectAdjust [6];    
"dynamicBlur" ppEffectCommit 0;      
"dynamicBlur" ppEffectAdjust [0.0];   
"dynamicBlur" ppEffectCommit 5;   
 
titleCut ["", "BLACK IN", 5]; 
};
#

it shows the last }; as blue, i think that is the issue

#

but i don't know how to fix it

digital jacinth
#

missing " at unstablize the region again

modest temple
#

thanks

digital jacinth
#

i suggest installing some syntax highlighting for your text editor of choice

warm gorge
#
params ["_unit", "_hitSelection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator", "_hitPoint"];

private _currentDamage = [_unit getHit _hitSelection, damage _unit] select (_hitSelection isEqualTo "");

if (!isNull _source && {_projectile isEqualTo ""} && {(vehicle _source) isKindOf "Car"}) exitWith {_currentDamage};

_damage

Any ideas why this anti-VDM script doesn't always work? Occasionally players will still die from being hit by a vehicle.

lone glade
#

desync, the force of the impact when they touch the ground killing them, whoever is driving switching seats

meager heart
#

also hd not 100% reliable... try maybe with dammaged*

lone glade
#

both of them are unreliable for something like this

meager heart
#

also slow ^ afaik

lone glade
#

nah

#

it just fires for every single goddamn selection damaged, even for damage propagation

#

which makes it a PITA to deal with

meager heart
#

someone said was some issues with hd and too late situation

lone glade
#

that's not possible

meager heart
#

idk

warm gorge
#

So nothing much I can do unfortunately?

lone glade
#

nope.

limber tangle
#

Too anyone who may be able to help i need to place this code into an AddAction how would i go about it?

null=[12,this] execVM "AL_waterfall\al_waterfall_start.sqf";
still forum
#

take it.. And place it in a addAction... ?

#

I mean.. Just do it. What's preventing you from doing it

limber tangle
#

Im not sure on the syntax as i tired following the examples on the link you provided and something in the code i have added just comes up with syntax error

still forum
#

example 1. The 3rd one.
player addAction ["Hint Hello!", { hint format ["Hello %1!", name player] }];
your script
-> player addAction ["Hint Hello!", { [12,this] execVM "AL_waterfall\al_waterfall_start.sqf"; }];

limber tangle
#

just to be clear "this" is regarding the object its placed in? instead of player

still forum
#

oh right

#

this won't work

#
player addAction ["Hint Hello!", {
params ["_target", "_caller", "_actionId", "_arguments"];
[12,_target] execVM "AL_waterfall\al_waterfall_start.sqf"; 
}];
limber tangle
#

Would there be away to stop this executing with a Addaction too?

#

like turning it on or off?

still forum
#

the waterfall?

limber tangle
#

yeah

#

for some context i have added the waterfall script to a fire extinguisher for to put out fires, the player would carry the extinguisher to the location and use an addaction to start the waterfall

still forum
#

if you have a script to stop the waterfall then you can stop it of course

limber tangle
#

The "al_waterfall_start.sqf" is a continual thing , "start" is referring to where it begins not the motion of it starting as the "waterfall_end" is the splash effect, so far i can run up to the extinguisher and turn it on with that code you sent but if there is a addaction to end the process?

still forum
#

I don't know your code

#

if it's your code then you should know how to stop that

limber tangle
#

So there is no way to stop or cancel an addaction once it begins?

still forum
#

"stop or cancel an addaction" doesn't make any sense

#

a action is not something that runs continuously

limber tangle
#

Ah my mistake, thank you for your help so far 😃

velvet merlin
#

what the max 2d array limit again? like is it feasible to cache int value for large/huge terrains with 1x1m cell size?

still forum
#

there is no 2d limit

#

there is a 1d limit

#

something like 9 million or so

peak plover
#

1x1m cell

#

What are you doing with that small cell 😮

#

height?

unborn ether
#

@limber tangle you can use exitWith to stop your running script at some point. If you want to make addAction executed once there is an argument in its syntax that acts this way

gleaming oyster
#

@limber tangle By the way, you do not need to do:

nil = [] execVM "blah";

It's just an editor qwirk, the executing script has to return a value

#
[] execVM "BlAH"
winter rose
#

even execVM "blah.sqf";

gleaming oyster
#

Eh. Lol

velvet merlin
#

@still forum ty
@peak plover the idea is to cache the vegetation density rather to compute it on the fly all the time again

still forum
#

I wouldn't put that into one huge array though

#

maybe make seperate ones for each 1kmx1km square or something

velvet merlin
#

alright

peak plover
#

Hmm, even more interesting. Why do you need the veg. desnity?

velvet merlin
peak plover
#

I don't see it 😮

tough abyss
#

CF_BAI uses vegetation density as a proxy for vision to adjust AI subskills to balance the AI in the woods.

#

But the approach effectively limits you to roughly 400 AI before the algorithm tops out. So its "slow", not stupidly so that is more than enough for most but faster and cheaper is better

#

If you could increase the number of times you can check vegetation density then you can increase the rate the algorithm runs and get better fidelity of skill adjustment.

#

It is a trade off, if you precompute it then you have less accuracy on the density calculation but higher speed, so you can check it more often and adjust the AI skills more often. The current trade off works well though, well worth playing with it and dialing in the skills based on how your community plays, solves a bit issue with Tanoa and other forests.

velvet merlin
#

well you could precompute at even higher precision and store the data as config arrays

#

and then dynamically cache the data to sqf land where you are currently playing in (to avoid contineous config reads or loading all to sqf land)

dry zephyr
#

@tough abyss how does the presence of headless clients affect the number of AI before the algorithm tops out, if at all?

limber tangle
#

@gleaming oyster @unborn ether Thank you both!

#

Got the scripts to work great now in singleplayer my only issue now is that they will not work in multiplayer

#

Is there something in this script here that can make it work on a dedicated server?

this addAction ["USE", {  
params ["_target", "_caller", "_actionId", "_arguments"];  
ex1=[12,_target] execVM "AL_waterfall\al_waterfall_start.sqf";   
}]; 

this addAction ["turn off", {(_this select 0) setVariable ["is_ON",nil,true];}];
astral dawn
#

addAction is local, so you will have to execute it on all players (look at remoteExecCall)

tough abyss
#

hey there - I wanna create a small editor-interface. My problem is, that i can't find any possibility to place an object at the mouse cursor inside a building on second floor. Just like in 3den editor. does any1 know how to do that? 😦

rancid pecan
#
3:18:37 Error in expression <ontainer getVariable["inUsePlyr",_unit])=!_unit) exitWith{hint"Baskası kullanı>
 3:18:37   Error position: <=!_unit) exitWith{hint"Baskası kullanı>
 3:18:37   Error Missing )
 3:18:37 File core\functions\fn_onTakeItem.sqf [life_fnc_onTakeItem], line 36
#
if (_container getVariable ["inUsePlyr",_unit] =! _unit) exitWith {
        hint "Baskası kullanırken itemi almaya calıstıgın için item ikinizdende silindi. ZARAR KARSILANMAYACAKTIR!";
        [_item,false,false,false,false] call life_fnc_handleItem;
        true;
    };
#

where is error i can not found it

robust hollow
#

from that script snippet there isnt a bracket issue, the error has a ) at the end of the getvariable array but its not in that script so 🤷 also is =! intentional or did you mean !=?

meager heart
#

looks like syntax for getVariable is wrong, you have _unit as default value, should be _container getVariable ["inUsePlyr", objNull]

robust hollow
#

well it could be the variable is nil when no one is using the container so if the goal is to only let one person access/take from the container at a time (which i assume it is) then using _unit as the default would make sense 🤔

#

that wouldnt have anything to do with the bracket issue tho which i feel he fixed before pasting that code snippet cause the if condition is different in the error.

meager heart
#

also =!

#
if !(_container getVariable ["inUsePlyr", objNull] isEqualto _unit) exitWith {/* blah */};
``` looks better to me 😀
lament grotto
#

hey guys to get this to fire for all players on the server how do i change this line to remoteexec null = [this] execVM "scripts\rock.sqf";

meager heart
#

to fire for all players on the server

[[], "scripts\rock.sqf"] remoteExec ["execVM", -2]; //--- all players
[[], "scripts\rock.sqf"] remoteExec ["execVM"];     //--- all players + server
```more info there > https://community.bistudio.com/wiki/remoteExec
#

@lament grotto

lament grotto
#

ty can this go into init box in a trigger?

#

or can it be used in addctions liek this line: task1 = t1 addAction ["Speak with civilian", "tasks\task1.sqf"];

meager heart
#

yes x2

lament grotto
#

okay sweet how would I do that for the addaction line, I am having some trouble with understnading wiki

meager heart
#

well... just add it in addaction, feel free to do so 😀

lament grotto
#

okay sweet

#

I get it now

peak plover
#

Some people save AARs and stuff

#

It's using a DB and saving it there, right?

#

How do they usually save the data there?

#

Like do you have a table for every mission and just save there or..

tiny wadi
#

for [{_i = 0}, {_j = count(_polygon) - 1}, {_i < count(_polygon)}, {_j = i++}] do {};

#

Is there an issue with the way that is setup?

#

trying to convert it from javascript:

#
for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) {}```
restive cedar
#

Ok quick question "Is there anyway to get the collective amount from choppers?" i know i cant get the throttle position of a fixedwing with AirplaneThrottle (vehicle player) but there must be a way to get the same from a chopper

tiny wadi
#

Possibly the animationphase of the throttle if there is one?

restive cedar
#

admin i++ dose not work in arma

#

i = i +1

tiny wadi
#

ah

#

ive been switching between too many languages lately

velvet merlin
restive cedar
#

donno your use case but

for [{_j = 0}, {_j = count(_polygon) - 1}, {_j < count(_polygon)}, {_j = _j + 1}] do {};

tiny wadi
#

The original c code is c int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy) { int i, j, c = 0; for (i = 0, j = nvert-1; i < nvert; j = i++) { if ( ((verty[i]>testy) != (verty[j]>testy)) && (testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) ) c = !c; } return c; }

#

It determines whether a point is within a polygon

restive cedar
#

then yer good luck lol

tiny wadi
#

:P, had it working but there were a few inconsistences. Figured i'd re-convert it to make sure

#

I did it a odd way before

restive cedar
#

like i said i can only see that i++ was the issue

tiny wadi
#

checking it out now

restive cedar
#

also look at the link @velvet merlin posted

tiny wadi
#

yeah, theres where I got the original syntax from for the loop

restive cedar
#

kk

velvet merlin
tiny wadi
#

oh shit

velvet merlin
tiny wadi
#

That could have saved alot of time haha, I never knew that existed

#

Thanks

tough abyss
#

@dry zephyr probably not a lot. It will just update the unit skills less often if it exceeds time so it is not a big problem.

tough abyss
#

@little eagle What are your initial thoughts to the idea that CBA gains a few functions for sub skill "pipelines" so that mods can be instantly compatible if they change subskills through the API. I can go about writing it and sending a pull request but I wanted to get your thoughts on it. I ask because VCOM_AI probably isn't compatible (and neither is TPWCAS without our direct work) because it assumes its the only mod changing it and I imagine there are a lot of mods that do the same thing.

still forum
#

Question then is if these previously standalone mods now want a CBA dependency

#

If it works and is useful. Then there is no reason not to add it to CBA.

languid fable
#

Is this the right room to ask about spawning AI on scripts and that, or should that be #arma3_scenario ?

still forum
#

if you wanna ask specifically about scripts then here.

languid fable
#

Alright thank you

#

I've become stuck with selecting a random player with this script

_heli1 = [];
if (isServer) then {
_crew1 = createGroup EAST;
_heli1 = [getMarkerPos "aiSpawn", 140, "RHS_Mi8mt_vdv", _crew1] call BIS_fnc_spawnVehicle;

_unit = (switchableUnits + playableUnits);
_randomUnit = (selectRandom _unit);
_wp1 = _heli1 addWaypoint [(position _randomUnit), 300];
_wp1 setWaypointType "TR UNLOAD";```

This line gives "Error,  type Array expected Group"
```_wp1 = _heli1 addWaypoint [(position _randomUnit), 300];```
#

Wouldn't the _randomUnit = (selectRandom _unit); select an object/group for the position? I'm fairly new to scripting but I have a semi idea of how it works

still forum
#

BIS_fnc_spawnVehicle returns Array - 0: created vehicle (Object), 1: all crew (Array of Objects), 2: vehicle's group (Group)
meaning your _heli is [vehicle, [], group]

#

meaning _heli is an array

#

but addWaypoint takes unit or group

#

so you have to take the group out of the _heli array

#

_heli select 2

languid fable
#

Ah ok, I'll try with that and mess around with it. Thanks

still forum
astral tendon
#

ok

still forum
digital jacinth
#

anyone knows if "CBA_fnc_createTrigger" also creates the trigger for every client connected as in JIP compatible and all that.

digital jacinth
#

Ah, dang.

errant jasper
#

Seriously? A global created trigger is not propagated to JIPs. WTF BI

#

I assume editor placed one are an exception then.

still forum
#

oh yeah. overlooked that.

#

no makeGlobal flag means.. makeGlobal is enabled

#

but setTriggerArea/setTriggerActivation/setTriggerStatements are all local.

#

and the triggers variable name is also only set locally. Seems like that CBA func is meant to add local triggers. But since A3 1.43 BI made them global by default

errant jasper
#

The CBA function should probably be updated to create only local trigger for proper backwards compatibility.

digital jacinth
#

Yeah that bit me in the butt at some point, trying to make triggers which are the same for everyone, server and client. then i noticed the trigger were note working for clients.

mint kraken
#

You can customize a van like in the vehicle arsenal, but how can you do that in script? Whats the command I need?

peak plover
#

There is an export button in the vehicle garage

mint kraken
#

Oh

half inlet
#

is there a way to tap into ACE3's advanced throwing event? I'm trying to run a script on throwables, but the "Fired" EH doesn't detect items thrown with ACE3's advanced throwing (obviously), so I need an alternative

digital jacinth
#

@half inlet that is because another EH will be fired.

["ace_firedPlayer", {
    params ["_unit","_weapon","_muzzle","_mode","_ammo","_mag","_projectile"];
}] call CBA_fnc_addEventHandler;
proven crystal
#

i have an issue adding some actions remotely to an AI in MP

#

i use this code

#
[_someAI, ["ActionName", {
        code;
    }]] remoteExec ["addAction", 0, true];
#

my problem is, that it will add the actions to the rangemaster everytime someone connects, how do i get it to execute only on the newly connected client?

digital jacinth
#

Where are you executing it from? Init field?

proven crystal
#

its a script

#

called fromanother script by command

digital jacinth
#

well then, from where does the script start. it sounds like you can just remove the remoteExec on addaction and it will work

proven crystal
#

then it wont show the actions for players that join the game

#

it would work on the hosting client. but not on server

half inlet
#

ah, thanks for the heads up @digital jacinth

proven crystal
#

so i am calling it on server side, but it must add the ctions client side

digital jacinth
#

if those lines of codes are executed only on server side, then it sohuld work. I take it there are now more then one "Reset Stats" addactions then?

proven crystal
#

bunch of actions that i add to a rangemaster to control a firing range

digital jacinth
#

are you sure that the code part is only ran once on the server? that is the only way there are multiple addactions of the same kind

proven crystal
#

i guess the issue is that with remoteExec ["addAction", 0, true]; i execute on every client whenever someone connects

digital jacinth
#

no, it should be only executing on the newly connecting client

proven crystal
#

hmm

digital jacinth
#

the last "true" is the jip flag

errant jasper
#

[...] remoteExec ["addAction", 0, true] would run the addAction command locally for each connected machine (including server), and the JIP flag will ensure it runs for future JIPs. Since you are getting duplicate actions either:

  • There is a serious bug with remoteExec you only stumbled upon, which is very unlikely since many use that command
  • You are accidentally running the command not only once. Either because the server runs it repeatedly, or non-server clients also run it.
proven crystal
#

hmhmhm

#

ok, so my issue is maybe somewhere else

digital jacinth
#

about that jip flag. you can change it out with _rangemasterso it will be removed from the jip queue once _rangemaster has been deleted

#

really looks that way

#

that part of the code is ran more then once

errant jasper
#

I know it is a script running another script and so on. But something must start it all. Either a special script like init.sqf or an event handler. If you tell us what we might be able to help more.

proven crystal
#

so it all starts with the init.sqf. which calls the init of my range. The range is marked with an area marker on the map, objects in the map are filtered in some way and it automatically finds target types and the rangemaster

still forum
#

so init.sqf

#

meaning you are executing more than once.

digital jacinth
#

you probably should move it to initserver

proven crystal
#

but i use if (!isServer) exitWith {}; in the beginning of the files. so it should only execute once on server startup, no?

#

i mean only when the server starts up, not when clients do

still forum
#

why though? init.sqf with isServer check is the same as just using initServer

proven crystal
#

trying to make it easy to use for others. otherwise i would probably also work with the initPlayerServer-Local files

#

"just add this line to the init" works for most

digital jacinth
#

depends, if you are adding cfgfunctions entries for your script, the easiest would be an autorun, no init.sqf would be needed.

#

besides, if it is server only, just tell the to putit in initserver

#

basically the same

proven crystal
#

anyway, the problem is i am on that server, i remoteexec somethin on the clients. and for some reason the actions end up showing multiple times....

errant jasper
#

So you have something like:
myfile.sqf - in here you have remoteExec call.
And in init.sqf you

  • if (!isServer) exitWith {};
  • later you run myfile.sqf.
    So are you sure nothing else is running myfile.sqf
proven crystal
#

pretty sure....

#

i only call these scripts from one location

errant jasper
#

Anyway, about init.sqf and initServer.sqf and so on. I always just use init.sqf with isServer guard and the like. Sure you can split stuff into initServer.sqf. But since both scripts are spawned and run in scheduled environment, you could get into trouble if one of the scripts create a object another need and so on... Frankly I never seen any benefit from initServer.sqf.

#

Not sure what to tell you then. I will still bet money on that from what you describe, that remoteExec command is being run multiple times.

proven crystal
#

yep appears like it then. i thought it was because of the jip stuff but i guess i got that wrong. will look somewhere else then. thanks for the help

dry zephyr
#

This brings up a question - I guess there's no equivalent to a stack trace in SQF (list of calls leading up to one that is intentionally or unintentionally erroring)?

tough abyss
#

A stack trace would be lovely, as would a more precise point to the problem variable or syntax error. While we are wishing for unicorns and rainbows I would also like full dynamic code update while the game is running for linked code so we can change it without restarting the game.

astral dawn
#

@dry zephyr I think Dedmen was developing a call stack based on his intercept addon

lone glade
#

already done

dry zephyr
#

The best I can come up with on short notice is:

trace =
{
    params ["_args"];
    diag_log format ["%1 %2 %3 %4 %5",
            diag_frameNo,
            _this select 0,
            diag_activeScripts,
            diag_activeSQFScripts,
            diag_activeMissionFSMs]
};
#

Called with [_this] call trace; in function that is getting called. Doesn't give you a stack trace, but provides maybe a little context.

#

Could add serverTime to that, but wiki suggests is unreliable.

lone glade
#

that doesn't work like you think it does

#

if you want a callstack you HAVE to either use macros or a proper debugger / profiler (ded's)

dry zephyr
#

Yes, it doesn't provide a stack trace, just lists in RPT each time the function you put it in is called, what the args were, and the information that active scripts/FMS gives you, to the extent that it is useful.

#

Ironically, running it clued me into that fact that there is a "fn_feedbackMain" state machine running on clean mission start that seems obsessed with suffocation.

lone glade
#

it's used to check if the unit(s) can breath or not

dry zephyr
#

It often lands in suffocation state when the log statements goes into RPT, but it looks like it also checks fatigue and, my favorite, "Check_Not_Burnin".

still forum
#

@dry zephyr my debugger can print a stack trace on command.

#

or on script error

dry zephyr
#

@still forum such that if @proven crystal were running it, he could find out where duplicate invocations of his bit of addAction code is getting called from?

still forum
#

yeah

#
Callstack:
    [] L7 (z\ace\addons\common\XEH_preInit.sqf)
    [CBA_fnc_preInit] L109 (x\cba\addons\xeh\fnc_preInit.sqf)
        _x: ["", "preInit", {call compile preprocessFileLineNumbers "z\ace\addons\common\XEH_preInit.hpp";}, true, []]

Like that. Including local variables

hallow spear
#

when I set BIS_fnc_holdActionAdd to take longer than 10 or so second the dialogue fades away (action is still going will eventually complete). anyone know how to make addactions/holdactions dialog stay on the screen?

willow trail
#

Hey guys im making a simple script for a mission and i need the player to go invisible and visible again via addaction for the invisible part i have

player addAction ["<t color='#FF0000'>Go Invisible</t>", {[player,true] remoteExec ["hideObject",-2,true];}];

Which works, I don't know how to make them re-appear tho. Anybody got any idea's they're willing to share?

still forum
#

🤔

#

hidden: Boolean - true->hidden; false->visible 🤔

willow trail
#

i tried changing true to false that doesn't work tho... sorry rather new to this.

still forum
#

why remoteExec?

willow trail
#

thats the script someone gave to me for it 😛 and it worked so i guess i didn't bother changing something thats not broken, However i find out now its broken so let me try that

still forum
#

hideObjectGlobal should be called on server though. So you still need remoteExec.

willow trail
#

thanks got it to work now, Appreciate it 😃

dry zephyr
#

In an FSM, if the condition code errors, should the FSM be left spinning and erroring or is there a way to shut down the FSM on scripting error in any of the conditions?

verbal otter
#

is possible to get player UID from remoteExecutedOwner?

still forum
#

yes.

#

get the player unit on that owner

#

then call getPlayerUID on that

verbal otter
#

@still forum ty

verbal otter
#
if (isRemoteExecuted OR isRemoteExecutedJIP ) then {
    if !(remoteExecutedOwner isEqualTo 0) then { 
        _index = allPlayers findIf {owner _x isEqualTo remoteExecutedOwner};
        _unit = allPlayers select _index;
        _uid = getPlayerUID _unit;
        _name = name _unit;
        diag_log format["[%1 | %2] remoteExecuted %3 on %4",_name,_uid,"scriptName",time];
    };
};```
little eagle
#
if (isRemoteExecuted OR isRemoteExecutedJIP ) then {

This is pointless.

verbal otter
#

just isRemoteExecuted?

little eagle
#

isRemoteExecutedJIP implies isRemoteExecuted

#

just
Yes.

verbal otter
#

ok, ty

little eagle
#

If used in SP or outside of remote executed context, the command returns 0.

#

remoteExecutedOwner != 0 also implies isRemoteExecuted

#

So you could just delete the first line completely.

#
if !(remoteExecutedOwner isEqualTo 0) then { 
    _index = allPlayers findIf {owner _x isEqualTo remoteExecutedOwner};
    _unit = allPlayers select _index;
    _uid = getPlayerUID _unit;
    _name = name _unit;
    diag_log format["[%1 | %2] remoteExecuted %3 on %4",_name,_uid,"scriptName",time];
};
#

Everything else is superfluous.

verbal otter
#

@little eagle ty

little eagle
#

yw

#

Uh, reading...

#

Anyone think it's worth it fixing CBA_fnc_createTrigger?

#

That function seems so pointless. :x

still forum
#

it is still using private ARRAY...

#

shudders

little eagle
#

BWC, otherwise I would just ctrl+a del it.

#

First one to go once A4.

still forum
#

Could atleast add the makeGlobal flag and set it to false

#

so it again does what it was doing when it was created

#

and maybe still add a deprecation warning?

little eagle
#

Never did those dep warnings in CBA.

verbal otter
#

trying close inventory dialog

#
{_x addEventHandler ["inventoryOpened","if (count (crew vehicle player)>1) then {hint 'This';closeDialog 0;false;};"];} forEach crew vehicle player;
#

but dialog not closed

little eagle
#

trying close inventory dialog
What? Why?

gleaming oyster
#

but must be local for the EH to trigger 🤔

little eagle
#

This is looks really wonky.

crew vehicle player
crew is something temporary. What if this eh will be added to the crew at mission start, but then someone else enters the vehicle? The eventhandler should be added to every unit no matter if crew at the mission start or not.

verbal otter
#

@little eagle when in player vehicle crew>1 inventory must be closed

gleaming oyster
#

but what is the count changes after post mission start?

verbal otter
#

@little eagle changed to sqf player addEventHandler ["inventoryOpened","if (count (crew vehicle player)>1) exitWith {hint 'This';closeDialog 0;false;};"];but nothing changed

little eagle
#

when in player vehicle crew>1 inventory must be closed
But why?

#

Where is this script located in anyway?