#arma3_scripting

1 messages ยท Page 359 of 1

little eagle
#

I've never heard of this and it's not what happens from my experience.

peak plover
#

dno, never saved for m:9

#

Either way, in hindsight, it was dumb of me to save profilenamspace every second

mild pumice
#

@little eagle vanilla.
I use this to hide a weapon on a player

player action ["SwitchWeapon", player, player, 100];

And i want to block him from taking his weapon in hands after this command
I could use a while loop and check when currentWeapon != "" and then switchWeapon but that's not the best solution

little eagle
#

lol

#
["commy_keepWeapon", "onEachFrame", {
    private _unit = player;

    if (currentWeapon _unit != primaryWeapon _unit) then {
        _unit selectWeapon primaryWeapon _unit;
    };
}] call BIS_fnc_addStackedEventHandler;
neon snow
#

Hmm I need a help one more time. I need to have a variable starting with 0, and whenever script is executed, the variable is incremented. I was thinking, can I" transmit" a variable from one script(example init.sqf) to another?

halcyon crypt
#

@whoever was helping me trying to figure out why error report line numbers were being weird, is it possibly because we do #include </some/path/to/file.hpp> instead of #include "/some/path/to/file.hpp"? ๐Ÿ˜

little eagle
#

No, they are the same in Arma.

halcyon crypt
#

dammit ^^

mild pumice
#

@neon snow if you declare your variable without the _ , you can use it anywhere in your mission.

little eagle
#

RiverX, you need a global variable.

#

Commy_myVariable

neon snow
#

Oh ok, thank you ๐Ÿ˜ƒ

astral tendon
#

if (isPlayer gunner car1) then {
doGetOut [gunner car1];
};

#

what is wrong in this one?

#

This is a trigger condition to eject the gunner of car1 if he is a player

astral tendon
#

if (isPlayer gunner car1) then {doGetOut [gunner car1];
};

#

i format this a little now it is worling, strange really.

astral tendon
#

enableSimulation false

#

does this make the mission have better performacy?

peak plover
#

if you don't want player to get in the gunner

astral tendon
#

i already solve that

peak plover
#

Just do ```sqf
if (player isEqualTo (gunner car1)) then {
"end_inGunner" call BIS_fnc_endMission;
};

astral tendon
#

is just a trigger to in a certain point the gunner gets kick out of the vehicle

peak plover
#
if (diag_fps < 50) then {
    "end_lowfps" call BIS_fnc_endMission;
};
#

You'd have to define the ending yourself, but that would end mission if fps is low

astral tendon
#

thats... not really what i want it

#

but does the enableSimulation false save perfomacy?

peak plover
#

A bit, yeah

#

That's 400x of x

distant egret
#

How do you make supersimple ?

astral tendon
#

what is that super-simple?

distant egret
#

Never heard of it only simple I heard about.

peak plover
#

are simple objects that are created directly from the object shape.

distant egret
#

So it can't be created like simple?

#

Ow it can

peak plover
distant egret
#

I need to test that.. been using simple this whole time..

peak plover
#

Well.. you'll still get more FPS if you downright DELETE the object

distant egret
#

I've been missing soo much performance ๐Ÿ˜€

peak plover
#

LMAO

distant egret
#

xD

warm gorge
#

Theres no other way to hide chat with scripting commands is there other than through enableChat?

slender halo
#

this perf chart is funny because in most cases i use simple object on houses and buildings...

peak plover
#

Yeah, when in reality that's gonna make the least amount of difference ๐Ÿ˜„

#

@slender halo run a loop that checks if the display for chat exists, if it does, close the display

slender halo
#

@warm gorge ^

peak plover
#

ops ๐Ÿ˜ฆ

#

zgmrvn, do you set cars etc. as simple as well?

warm gorge
#

Ah damnit was hoping there was an easier way. Surprised theres no script command for it

slender halo
#

yeah but usually i only have simple object suitable cars at the base camp, i mostly make coop scenarios for my clan

distant egret
#

I only use it on fortification objects.

#

I've made my own objectMapper that uses it and it dynamically spawns in fortifications for buildings.

peak plover
#

Nice. I dream of a furniture etc. script and yeah, fortifications sound very nice

distant egret
#

I could do furniture, it spawns the objects on 99.99% the same place.

#

In my testing it didn't spawn wrong yet so ๐Ÿ˜‹

peak plover
#

Yeah setposRel ?

distant egret
#

Nope

#

Using modeltoworld

peak plover
#

ohh yeah

#

That one

distant egret
#

It automatically checks for rotations. So very usefull.

peak plover
#

๐Ÿ‘Œ๐Ÿฟ

astral tendon
#

my vehicles tend to screw up way too much, can some one help me making a teleporting unit when he is in a X amout of a distance?

#

just make a unit teleport behind another unit once a distance is meet

sick drum
#

Hey How do I do time Triggers

simple solstice
#

@sick drum can you describe more?

sick drum
#

Let's say I am making a scenario In the scenario you have to destroy an anti air system in 30 minutes, If you don't do it in 30 minutes you automatically fail

simple solstice
#

in init

#
0 spawn {
uisleep 1800;
if (<condition>) then {
"end1" call BIS_fnc_endMission;
};
};
#

you could name the anti air system eg. antiairsys = this; and then the condition would be !alive antiairsys

peak plover
#

sleep 1; in front of that, because time should start when game starts, briefing might take 30 minutes as well

simple solstice
#

waitUntil {getClientStateNumber > 9};

#

before that

#

so it starts when briefing was read

sick drum
#

ok, ok i see thanks

simple solstice
#

you could do some kind of a timer

#

but that requires messing with display files ๐Ÿ˜„

little eagle
#

Not really.

simple solstice
#

without using a hint you can create some kind of custom dialog?

little eagle
#

Yep. With just scripting.

simple solstice
#

now im curious

little eagle
#

A timer is not a dialog though. It would be a control.

simple solstice
#

yes yes

#

now I see

little eagle
#
// initCounter.sqf
params ["_display"];

private _control = _display ctrlCreate ["RscText", -1];

_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];

_control ctrlSetPosition [
    safezoneX + safezoneW - 0.2,
    safezoneY + 0.0 * safezoneH,
    safezoneW * 0.1,
    safezoneH * 0.3
];
_control ctrlCommit 0;

MyMission_Counter = [_control];


//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";
#

CBA_missionTime would make it super easy to have a synchronized and JIP and savegame compatible timescale...

sick drum
#

What? It's Just An Ordinary scripting OH MY GOODNESS!

#

so im not doing time scenarios haha

peak plover
#

The command also returns all connected headless clients.

#

lies

little eagle
#

Well, is there a machine connected to the slot of headless_client ?

peak plover
#

Yes

#

what a rip off

little eagle
#

Check
owner headless_client

peak plover
#

3

#

It's working, I'm getting debug on the hc

#

Looks like they changed it at some point

little eagle
#

Yea. Good to know.

peak plover
#

btw how does arma kill all scripts when for ex. mission is unloaded?

little eagle
#

Magic from C++ land. Same way it clears the mission namespace.

peak plover
#

So, all scripts are stored somehow... But how can I acces that? Iassume c++ land

#

I've always wanted to close all spawned scripts

still forum
#

You can theoretically guess the script ID (what spawn returns) and just bruteforce close everything ๐Ÿ˜„

#

Or... you use cheat engine and set a single number to 0

little eagle
#

You can't get scripthandles with pure sqf.

#

If you don't save it, there is no way to get it.

still forum
#

They are just numbers internally... hmpf.. well then... #Intercept ๐Ÿ˜„ Theoretically..

peak plover
#

haha

still forum
#

You can create scripthandles with Intercept by providing the scripts ID. Too much hassle tho

little eagle
#

With your hacking mods one could shut down everything in Arma one by one...

still forum
#

With my Hack yes. With Intercept and the Debugger... not everything but more than what SQF can ^^

#

But I don't seee much use in that. Use profiling branch to check what scripts are running

frail zephyr
#

Is there any way to create custom events for addEventHandler? I think in the meantime I wll have to use _unit spawn fnc_eventHandler; Where fnc_event is something like: if(isServer) then { _eventDone = false; while(!_eventDone) do { } };

#

At least I think spawning a thread and checking for the event conditions seems the way to do it

still forum
#

no

#

#Intercept maybe... but... not really. no.

simple solstice
#

@frail zephyr only loops :(

frail zephyr
#

I figured as much... not ideal, but I can live with it. Would be so much easier to create a custom event, but I shall live.

still forum
#

What is the thing you want to eventizise? Maybe there is a better way for the exact thing you are doing

frail zephyr
#

BIS_fnc_enemyDetected

still forum
#

ouh... hm...

frail zephyr
#

Ehh long story short, I was having trouble with idleAnimationCombat, so used idleAnimation, wanna use enemyDetected or firedNear to call __terminate on the idleAnimation.

#

I really should just get idleAnimationCombat working right...

#

firedNear has an event, fnc_enemyDetected does not.

indigo snow
#

Youd probably be best off with a waitUntil and some amount of sleep. If you use CBA you can use a few more fancy things but in lieu of actual custom event handlers youll have to check in a loop anyway

frail zephyr
#

Hmmm that seems like a better idea; I just felt wasting cycles in a polling loop felt wrong.

indigo snow
#

I still think an enemy detected EH would be really good to happen but no real chance on that

frail zephyr
#

I would absolutely love that, I was searching for any kind of enemy, sound, or detected event handler and the closest I found was firedNear. I'll stick with relying on BIS_fnc_enemyDetected in the mean time.

agile pumice
#

I noticed in RHS with some vehicles that the getin/getout actions wait for the doors to open/close. What script functions do this?

indigo snow
#

Look in the config browser

#

The action and functions are all defined

polar folio
#

@frail zephyr are we talking mod or mission here? in a mod you could possibly add some hooks to the danger.fsm

#

might even be possible to do it inside a mission by disabling default AI and loading modified. that could be tricky and is likely to not work thoug. not an expert on default arma AI at all. jsut some random brain storming ideas

frail zephyr
#

Mission. although I'm open for making it a mod. Really, in the end, I would want this to be an editor module that you can place like Sites modules, but have been having tons of trouble making a new module.

#

It would probably work fine that way, but seems like a lot of extra effort just to switch some states from idle -> notIdle

#

I would love to go the editor module route if anyone has any tips for getting that to work; followed the wiki but couldn't get my custom module to show up in editor. Was probably missing a key step.

digital hollow
#

I remember doing something similar using an AnimDone EH, and checking group behaviour.

polar folio
#

^now this is a grea idea. depending on how long those ambient anims are

#

worst case scenario would be something playing till the end but no big deal if the anim isn't that long

digital hollow
#

In my head it would be like the group commander calling "alert" and then some individuals would be lazier than others =p

polar folio
#

and you could also always throw in the "firedNear" EH for really urgent cases. maybe even a "hit" one to make them isnta react on being hit

frail zephyr
#

The thing is, I don't care when the animation is done, I want them to continue their animation in a loop until there are enemies detected or there is fire detected. I'm fairly certain the civs combatMode won't change, as they are friendly to everyone in my mission.

polar folio
#

firedNear would also help deativating idling dudes through their firing team mates so the distance limit shouldn't be too bad of a problem

#

oh. civs?

frail zephyr
#

Yep

#

Make them flee when firedNear

digital hollow
#

The animations should loop. When one completes, check group behaviour and end if COMBAT, else do nothing.

frail zephyr
#

make Enemy attack when BIS_fnc_enemyDetected

#

Would the civ behaviour ever be COMBAT?

digital hollow
#

Yes. (95% sure)

frail zephyr
#

Hmm then that could work fine

#

I was under the assumption they didn't get a COMBAT behaviour mode, probably a wrong assumption

digital hollow
#

But that doesn't mean they'll shoot at who you want them to.

frail zephyr
#

Nope, just a state

digital hollow
#

Right.

frail zephyr
#

Luckily, I just need the civs to quit their idle animation and flee, and the OPFOR quit their idle animiations and attack BLUEFOR. I think I got a good idea on how to do it now.

#

a unit that has disableAI "PATH" will still run their CombatBehavior switching AI correct?

#

If so, this will work fine then.

digital hollow
#

Correct.

frail zephyr
#

Good, I'll give that a shot tonight after work; thanks for the ideas, I'll give everyone a heads up if it works.

queen cargo
#

@little eagle stop finding weird SQF quirks pls
my VM now also can use , instead of ; because it was requested ๐Ÿ™ˆ

#

besides, any command only for units/vehicles that will error out if the target is indeed, OBJECT type but not unit/vehicle? (unit => createUnit; vehicle => createVehicle; Asking for any known error that happens due to object being vehicle instead of unit)

shy karma
#

Does anyone know if it's possible to blacklist certain vehicles in bis_fnc_garage (the virtual garage)? Like I want it to not spawn planes helicopters or boats

queen cargo
#
str missionNamespace``` what is this outputting?
little eagle
#

annoyingly
"Namespace"

still forum
#

"Namespace"

#

awww too slow

#

Namespaces know their name though... it could output "missionNamespace" if it wanted to

little eagle
#

str [missionNamespace, uiNamespace, profileNamespace, parsingNamespace]

#

"[Namespace,Namespace,Namespace,Namespace]"

tough abyss
#

10/10.

little eagle
#

Could always be worse:

#

str configNull

#

""

tough abyss
#

๐Ÿคฆ

little eagle
#

This would be likely the first thing I'd change if I could.

tough abyss
#

You can try to convince devs on the feedback tracker.

queen cargo
#

for "_f" isEqualTo for "_j"
what does this outputs?

#

if true isEqualTo if false

still forum
#

:u

queen cargo
#

could continue with while etc.

still forum
#

you are asking awesome questions ๐Ÿ˜„

queen cargo
#

but somehow i highly doubt isEqualTo is actually giving correct output for those

still forum
#

Checking

queen cargo
#

questions that arise if you try to copycat SQF

still forum
#

It is quite possible that they did it right

#

49/51 I'd say ๐Ÿ˜„

little eagle
#

false

still forum
#

XD

little eagle
#

for "_f" isEqualTo for "_f"

#

also

still forum
#

if you compare ForType it always returns false

little eagle
#

false

still forum
#

no matter if it matches

queen cargo
#

kk
so only the actual types actually return something useful

little eagle
#

Seems like it.

still forum
#

IF type returns whether the condition is the same

little eagle
#

Not really

#

if true isEqualTo if true

#

true

queen cargo
#

meh ... so need to add more edge edges

still forum
#

so you could just remove the "if" and get same result

little eagle
#

if true isEqualTo if false

#

false

queen cargo
#

...
now to find when isEqualTo is actually comparing and when it does not
wohooo

little eagle
#

if false isEqualTo if false

#

true

#

if false isEqualTo if true

#

false

still forum
#

while...
if code matches ret true.
If no code exists... return false... if... type of code... doesn't match.. return false... uhm.... wat?

#

how can code in while not be of type code....

#

can you use while STRING ?

little eagle
#

while {true} isEqualTo while {true}

#

true

#

while {true} isEqualTo while {!true}
false

queen cargo
#

please do not tell me you can use while string

#

please no no no

little eagle
#

while {true} isEqualTo while {!!true}
false

still forum
#

I don't think so

queen cargo
#

undocumented "feature"

little eagle
#

str while {true}
"{true}"

#

But it's not CODE, it's WHILE type

still forum
#

They first check if the code is the same. then if no code exists.. then the type... then they check if the code is the same again..

little eagle
#

Just how

#

str if !true

#

"false"

#

But it's IF, not BOOLEAN type

queen cargo
#

uhm ... so while {true} isEqualTo {true} => true ? Oo

little eagle
#

Nope

still forum
#

IF type is Boolean type @little eagle

little eagle
#

Nope

queen cargo
#

IF is not boolean
just the same

#

but type is different

little eagle
#

IF and BOOL are different types

still forum
#

If is boolean. Just with different typename

queen cargo
#

y

still forum
#

everything else is the same

queen cargo
#

everything is garbage ๐Ÿ™ˆ

#

๐Ÿ˜„

still forum
#

inheritance wise

little eagle
#

Only because the are the same stringified does not mean they are the same isEqualTo. And only because they are the same isEqualTo does not mean they are the same stringified.

still forum
#

uhm

little eagle
#

log -1 isEqualTo -log -1
true

#

str log -1 isEqualTo str -log -1

#

false

still forum
#

@little eagle can you check while {true} isEqualTo nil ?

queen cargo
#
unsigned char is_equal_to(PVM vm, PVALUE l, PVALUE r)
{
    ...
    if (l->type != r->type)
        return 0;
    if (l->type == SCALAR_TYPE()) { ... }
    else if (l->type == BOOL_TYPE() || l->type == IF_TYPE()) { ... }
    else if (l->type == ARRAY_TYPE()) { ... }
    else if (l->type == STRING_TYPE()) { ... }
    else if (l->type == NAMESPACE_TYPE()) { ... }
    else if (l->type == CODE_TYPE() || l->type == WHILE_TYPE()) { ... }
    else if (l->type == SIDE_TYPE()) { ... }
    else if (l->type == OBJECT_TYPE()) { ... }
    else { return 0; }
}
``` that is how i do it right now ...
to make things faster, anything i missed?
little eagle
#

isEqualTo nil
just reports nil, because one argument is undefined

queen cargo
#

great ...

#

just great

still forum
#

is there any other type that doesn't contain a value? probably not

#

Because... WHILE isEqualTo <something that contains no value. like nil> crashes the game with a nullpointer exception

little eagle
#

Every command reports nil and fails silently in scheduled environment when one argument is nil. Note that arrays with one nil element are not nil.

#

By "reports" I mean is fed the argument nil (on either side). OOps.

still forum
#

@little eagle
while {true} isEqualTo for {test} ?

little eagle
#

for {test}
is syntax error

still forum
#

oops

#

for "_f" ๐Ÿ˜„

little eagle
#

false

#

Obviously, because WHILE is different from FOR type

still forum
#

hm... I have to investigate that further some day

little eagle
#

_for = for "_i"; _for isEqualTo _for

#

false

queen cargo
#

horrible enough that this is valid SQF sqf test = "test123", test2 = "test45", diag_log format["hello -test => %1 -test2 => %2", test, test2]

still forum
#

no.. actually not that obvious.

#

@queen cargo you missed with

little eagle
#

diag_log uses the same logic as str and format I believe.

queen cargo
#

with is not yet implemented

still forum
#

with missionNamespace isEqualTo with profileNamespace -> false

#

returns true if you compare the same namespaces

little eagle
#

Yup.

#

Can confirm.

still forum
#

Exceptions also always return false if you compare them

queen cargo
#

just wondering right now ...

_veh = "pleasechangewithvalidvehicleclassname" createVehicle [0, 0, 0];
_veh2 = _veh;
deleteVehicle _veh; //nullify _veh & _veh2
_veh isEqualTo _veh2
little eagle
#

switch (true) isEqualTo switch (true)

#

false

still forum
#

SWITCH also always false

little eagle
#

_switch = switch (true); _switch isEqualTo _switch

#

false

#

always false, can confirm

still forum
#

nil is also always false

little eagle
#

Example?

still forum
#

Nothing too

little eagle
#

It should just report nil

still forum
#

I'm checking Intercepts internal isEqualTo. Which uses what the isEqualTo script function uses in the backend

#

if you pass nil it probably stops before even going to backend

queen cargo
#

any one of you could check the bit of code i pasted in here quickly?

little eagle
#

Here is something super annoying:

still forum
#

jclass returns if case insensitive names of both classes match

little eagle
#
_a = [nil]; _a isEqualTo _a
true

[nil] isEqualTo [nil]
false
still forum
#

you mean if you missed types? @queen cargo

#

ouhhh

queen cargo
#
_veh = "pleasechangewithvalidvehicleclassname" createVehicle [0, 0, 0];
_veh2 = _veh;
deleteVehicle _veh; //nullify _veh & _veh2
_veh isEqualTo _veh2```
still forum
#

@little eagle
[while {}] isEqualTo [nil] that maybe?

#

@queen cargo true

little eagle
#

Can confirm

queen cargo
#

and with objNull on one side?

little eagle
#

objNull === objNull essentially

queen cargo
#

or what about objNul on both sides?

still forum
#

objNull is equal to objNull

little eagle
#

objNull isEqualTo objNull
true

queen cargo
#

maybe i should start writing that stuff down ...
and publish the big book of SQF specs

#

5kk pages

#

with all edge cases

#

gah ...

little eagle
#
_veh = "B_Soldier_F" createVehicle [0, 0, 0]; 
deleteVehicle _veh; 
_veh isEqualTo objNull

false

still forum
#

wat

#

๐Ÿ˜„

queen cargo
#

means objNull holds on to one object

#

whohooooooooooo

#

party hard

#

whoop whoop

little eagle
#

I think I broke it

#
_veh = "B_Soldier_F" createVehicle [0, 0, 0]; 
deleteVehicle _veh; 
isNull _veh

false

#

lol

still forum
#

objNull is probably nullpointer on first level. deleted vehicle is nullpointer on second level

queen cargo
#

what oO

#

how is isNull _veh false when _veh is deleted ๐Ÿ˜ฎ

still forum
#

maybe it takes a frame?

little eagle
#
_veh = "B_Soldier_F" createVehicle [0, 0, 0];  
deleteVehicle _veh;
_veh

1305311ea80# 44: b_soldier_01.p3d

queen cargo
#

probably

little eagle
#

Seems like it's deleteVehicle that fails.

#

Yup, one frame later it's null.

#

So it's just a delay of the effects of deleteVehicle

queen cargo
#
[] spawn {
    _veh = "pleasechangewithvalidvehicleclassname" createVehicle [0, 0, 0];
    _veh2 = _veh;
    deleteVehicle _veh; //nullify _veh & _veh2
    sleep 1;
    systemChat str (_veh isEqualTo _veh2);
    systemChat str (_veh isEqualTo objNull);
    systemChat str (objNull isEqualTo objNull);
};
still forum
#

so if SQF-VM executes in unscheduled.. it would not be null. If scheduled then it can be null if it happens to pause the script right there. and if you add a sleep in scheduled it is 100% null after that

little eagle
#

true

#

true

#

true

still forum
#

so you now have to take care of yes,maybe,no

#

๐Ÿ˜„

#

I'd just go for yes,no,no

queen cargo
#
 if (((POBJECT)l->val.ptr)->inner == 0 && ((POBJECT)r->val.ptr)->inner == 0)
{ return 1; }
else
{ return l->val.ptr == r->val.ptr; }```
taken care
still forum
#

I love compact code

queen cargo
#

ty btw

still forum
#

return (((POBJECT)l->val.ptr)->inner == 0 && ((POBJECT)r->val.ptr)->inner == 0) ? 1 : l->val.ptr == r->val.ptr;

#

๐Ÿ˜„

queen cargo
#

nah ... confuses ppl when they read it

still forum
#

return l->val.isNull();

queen cargo
#

not correct due to r might not being null and not in c++lands

still forum
#

#GloryToArstotzka

little eagle
#
veh = "B_Soldier_F" createVehicle [0, 0, 0]; 

0 spawn {
    sleep 1;
    isNil
        deleteVehicle veh; 
        systemChat str (veh isEqualTo objNull); 
        systemChat str (veh isEqualTo veh);
     };
};

false
true

#

^???

#

The debug console ate a {

#

lol

still forum
#

tasty

little eagle
#
veh = "B_Soldier_F" createVehicle [0, 0, 0]; 

0 spawn {
    sleep 1;
    isNil {
        deleteVehicle veh; 
        systemChat str (veh isEqualTo objNull); 
        systemChat str (veh isEqualTo veh);
     };
};

That was the code. And it seems like deleteVehicle does not have immediate effect.

#

false

#

true

ionic orchid
#

the wiki says as much, though?

little eagle
#

NOTE: Actual object deletion, when object becomes objNull, happens on the next frame after command execution, but there are some object modifications that happen immediately. For example if the object is unit in a group, it immediately becomes groupless

#

yup

ionic orchid
#

kinda nutty that it immediately deals with some other things first

#

that aren't entirely specified

queen cargo
#

SQF
questions nobody ever asked because he fears the answer

little eagle
#
LOC = createLocation ["Name" , [0,0,0], 0, 0]; 
deleteLocation LOC; 
isNull LOC
#

true

ionic orchid
#

asdf

little eagle
#

deleteLocation has immediate effect.

#

Once again LOCATION > OBJECT

#

No surprises here.

queen cargo
#

probably has to do with allowing network to take effect

little eagle
#

I'm in SP though.

queen cargo
#

does not matters

#

would not add edge cases for SP

#

would just cause problems in MP which do not happen in SP then

#

or other way around

#

is "B_Soldier_F" createVehicle [0, 0, 0] actually creating a vehicle Oo

little eagle
#

Yes

queen cargo
#

or is the result acting like a weirdo unit?

#

which means my inner concept (sqf-vm) will get completly fucked up ๐Ÿ™ˆ

little eagle
#

Just a brainless soldier looking statue

queen cargo
#

kk
so there IS a difference between unit and vehicle

#

cannot execute doMove too i guess?

little eagle
#

B_Soldier_F and arifle_MX_F are like the only classnames I can ever remember. Aside from BWA3, which has sane classnames.

rotund cypress
#

Hey guys, anyone here knows if ctrlShown command returns true if faded out? As in ctrl ctrlSetFade 1; ctrl ctrlCommit 0;

queen cargo
#

opacity and isShown are two different things

little eagle
#

Probably false unless you use ctrlShow

rotund cypress
#

Ye, that's what I thought

queen cargo
little eagle
#

For the fade you're supposed to use ctrlCommited I think...

queen cargo
rotund cypress
#

However, isShown is not the command @queen cargo

queen cargo
rotund cypress
#

I know what I am doing with the fading

#

Was just a bit wondersome since ctrlShown was returning true

#

After fading, but probably control is just still shown

queen cargo
#

because ctrlShow allows for the edit

rotund cypress
#

Of course

queen cargo
#

ctrlFade only changes opacity

rotund cypress
#

I know

queen cargo
#

--> control is still rendered

rotund cypress
#

I know

queen cargo
#

only thing they did not added quirks is the UI system
well ... besides the known quirk of that weirdo config crap

rotund cypress
#

The GUI system is ok.., could be better however

queen cargo
#

though, in theory one could create a complete separate design language for it
that builds everything using ctrlCreate

rotund cypress
#

Yes

#

But it would be total cancer

queen cargo
#

no

#

it would be beautiful

#

coding XAML instead of weird config commands would be great โค

little eagle
#

ctrlShown controlNull

#

false

rotund cypress
#

Well of course, @little eagle, what my question was; if fading out a control would return false when running that ctrl command

#

Cause it wouldn't surprise me if it didn't, but we came to the conclusion that it didn't.

little eagle
#

Try it?

rotund cypress
#

Ye I did

little eagle
#

I can't be debug nanny for everyone^^

rotund cypress
#

I did try it myself, after I asked ๐Ÿ˜‰

little eagle
#

after

rotund cypress
#

Didn't ask anyone to debug for me, was just curious if anyone here already knew

little eagle
#

I can't really trust my knowledge, unless I just tested it right before. I can always misremember...

rotund cypress
#

Of course, we can all do that ๐Ÿ˜‰

queen cargo
#

now ... next question: [createGroup west createUnit ["B_Soldier_F", [0, 0, 0], [], 0, "FORM"], 1, createGroup west createUnit ["B_Soldier_F", [0, 0, 0], [], 0, "FORM"]] doMove [100, 100, 0]
what is happening in here?
do both soldiers move?
does only one move, and if yes, which one?
or does it only throws a script error?
or may it does nothing of all those things??

#

just spotted this fancy lil command
resetSubGroupDirection
not documented in the wiki
unary, takes OBJECT as param

#

ahh wait

#

found it

#

resetSubgroupDirection thats correct casing

frail zephyr
#

Is this the correct way to remove an event handler when a condition is met? I'm not home, but am getting some scripts done on lunch:

    _unit addEventHandler ["FiredNear", {
        // ... 
        _unit removeEventHandler ["FiredNear", _thisEventHandler];
    }];
#

Or should I grab the _idx from the addEventHandler call? Will that be in scope?

simple solstice
#
_unit removeAllEventHandlers "FiredNear";
#

if you have only one FiredNear EH its easier that way

frail zephyr
#

I like that better; should only ever have one, runs on init and only on the server.

queen cargo
#

avoid that command like you would avoid a leaking nuclear power plant

#

unless you are surely always and in any case running on vanilla

#

the moment, one mod adds such an EH, you also remove that mods EH

#

breaking the actual functionality of the mod you installed

#

better: put the ID of your EH into a var eg. _unit setVariable ["dockam_my_fired_near", _unit addEventHandler ["FiredNear", {...}] and remove it later by getting the variable from the unit again

#

@simple solstice @frail zephyr

frail zephyr
#

Doesn't _thisEventHandler cover it?

queen cargo
#

before 1.63.137807 that was not existing
in any version after, that is correct

frail zephyr
#

I only play on current versions

#

always patched

queen cargo
#

everybody does

frail zephyr
#

Exactly

#

Thus, it covers my need

queen cargo
#

your solution would completly cover your usecase
though ... you might want to rethink your code unless you rly only need that EH temporary

#

might be more useful to leave it attached

#

instead of readding it everytime

frail zephyr
#

I add it once and get rid of it on a trigger when I detect a condition

#

works fine

simple solstice
#

@queen cargo right.. I forgot about mods

frail zephyr
#

I only add it once

simple solstice
#

my bad then, listen to what he said!

frail zephyr
#

As in, I add it once, and test a condition on each time it fires, don't remove it every time, only once I'm done with it.

queen cargo
#

if it is done via a trigger, you might better be off by removing it in that trigger again
but both will work
just one way might cause confusion when you revisit

frail zephyr
#

Yep, good points. And no not done with a trigger; esentially spawning units with static idle animations and want to call __terminate under certain conditions.

#

When animIdleCombat wasn't working for me for some reason.

#

Which, if I could get that to work, would make all of this so much easier and moot.

cloud thunder
#

@ShadowRanger#8911 showChat false; will hide chat.

astral tendon
#

0 = [] spawn
{
while{true}do
{
playMusic "Track_22";
sleep 50;};
};

#

i manage to loop this music

#

but how to stop it? lol

#

also, this is on a trigger condition.

little eagle
#

playing an empty track instead?

astral tendon
#

if i play another track with playMusic "othertrack"; still goes back to play this

#

i even tryed to delet the trigger but it does not worked

indigo snow
#

well yea you dont save either the handle to the spawned thread or use a variable for the loop condition

#

either save the return from spawn to a variable you can terminate, or change the true to a variable you can set to false

copper raven
#

when trigger deactivates you want it to stop?

indigo snow
#
xyz_playMusic = true;
0 = [] spawn { 
    while {xyz_playMusic} do { 
        playMusic "Track_22"; 
        sleep 50;
    }; 
};```
#

to turn off, just do xyz_playMusic = false

#

to stop it when the trigger deactivates:

0 = thisTrigger spawn { 
    while {triggerActivated _this} do { 
        playMusic "Track_22"; 
        sleep 50;
    }; 
};```
#

And more fun variations in the same trend

astral tendon
#

that xyz_playMusic = false i put on another trigger?

indigo snow
#

Sure

astral tendon
#

thanks for the help, got to go.

neon snow
#

guys I have a problem, I need to create conditions, 3 seperate conditions for each situation , when variable is equal 1,2,3. However I cant use "=" sign for some reason.(it is in the config I know, but it is more logical queston). I can only use expressions:+,-,<,>*,/. Condition look like: condition="variable" for example means that if "variable" is 0, then the condition is true

#

and ARMA reads anything above 0 as true

#

and here is my problem

#

becouse I need to distinguish the conditions. When is equal 1, when is equal 2 etc...

#

My heads hurts at the moment becouse of that

little eagle
#

= is an assignment.
== is like <

neon snow
#

I know that from CPP, but for some reason, == doesnt work in config for me.

#

And here there is no == :/

little eagle
#

Yeah, simple expression has no ==. It's not really SQF

neon snow
#

That is weird for me. Ok , sorry for posting here then

little eagle
#

You can use multiplication and addition as AND and OR though.

neon snow
#

Hmm that might work, I'll check it

runic surge
#

what is the best way to get a random position from inside an area marker?

#
_radius = param [0,100,[0]];
_pos = getMarkerPos "TestMarker0";
_rndx = round(random _radius);
_rndy = round(random _radius);

_newPos = [(_pos select 0) + _rndx, (_pos select 0) + _rndy, 0];

I came up with this for a regular marker

#

Not sure if it is the best way, but I will test it out

little eagle
#

Depends on if the marker is a rectangle or a circle.

runic surge
#

I would imagine a circle is much easier since it is just a radius

little eagle
#

I guess. A rectangle can be rotated, so that could make it harder.

#

If the sides of the rectangle align with the world x and y axis, west and north, then it's easy. Like you posted. But I think you misused the word "radius".

ivory vector
little eagle
#

Don't think there is Leighham. There is no way to make the upper parts invisible and you have to not change the controls height.

ivory vector
#

Yeah , i got another neat animation by trying keepAspect though

#

Dont know whether to keep the squeezing or go with that one.

#

what do you think commy ?

little eagle
#

That one is a good compromise I think.

frail zephyr
#

Quick, hopefully simple, question. Anyway to extend/alter the base BIS functions? Example: BIS_fnc_ambientAnimCombat has an _acceptableStates of animations it can accept; but it calls "[_unit,_animset,_gear,nil,nil,false] call BIS_fnc_ambientAnim;" which has a significantly larger set of animations available to it. Otherwise, I'll have to call ambientAnim and replicate what the BIS function does.

queen cargo
#

not noted anywhere on that page

#

i mean ... i can guess

tough abyss
#

Test it?

queen cargo
#

one usually has arma running in here

tough abyss
#

Prefer to pushing back an element is using pushBack

#

I'm currently writing a data-structures library for arma 3.

#

So I make use of it fairly frequently.

queen cargo
#

data-structures library??

tough abyss
#

Stacks and Queues.

queen cargo
#

still no idea what such a library is supposed to be

tough abyss
#

Can be a useful tool in increasing performance in code.

queen cargo
#

also, [0, [0], [[0]]] - [[0]] has nothing to do with pushBack Oo

tough abyss
#

Ohhh tree data structures.

#

Thats basically what that is.

queen cargo
#

so you create a tool that does static analysis of code

tough abyss
#

Good way to manage and clean-up of dead stuff.

#

Array deleteAt 0; is a 1 direciton queue.

#

pushBack allows you to add 1 element to the queue

little eagle
#

- creates a new array. Flat copy.

polar folio
#

is there a marker type that only displays the marker text?

tough abyss
#

Yes

#

"Empty"

#

No marker.

#

Probably not directly obvious how a Queue or a Stack is useful.

#

But BIS_fnc_stackedEventHandler probably uses it.

polar folio
#

empty shows nothing

tough abyss
#

You have to add text to it.

#

[0, [0], [[0]]] - [[0]]

#

Better example of this is this.

polar folio
#

i did

tough abyss
#

[1,
[2],[
[3]
]
] ] -
[4]
]
]

polar folio
#

or is class name "Empty" a different one than the one called empty in the editor?

tough abyss
#

Thats a tree @queen cargo

#

try that @polar folio

queen cargo
#

so you are not even creating an AST ... seriously ... the fuck are you doing!?

robust hollow
#

you cant see empty markers, pretty sure they are invisible on the map. use a different type and set the size to 0 so the icon doesnt show

tough abyss
#

I am just saying what that multi-nested array it's called a tree.

#

I am simply writing a collection of small functions to act as data-structures thats it.

polar folio
#

ah ofc. thx @robust hollow

sick drum
#

Hey guys How do I add supports like artillery

tough abyss
#

Support module.

#

Link it to the units you want access to it.

#

"Sync"

sick drum
#

thats it?

tough abyss
#

Pretty much.

#

You've got to also let it know if it needs to be the group who has access or just 1 unit.

#

Then it will show up in the "supports section" menu

queen cargo
#

seriously @tough abyss ... you have to work on your wording for your projects
right now i imaginating you writing python code to parse SQF into semi-structured AST/Token lists which you want to call via SQF (and probably callextension) for ... reason

tough abyss
#

No no.

#

using SQF to replicate python data structures

#

It can't be a direct 1 : 1 conversion it has to use procedural / functional programming.

#

Which deleteAt etc.

#

Is all I'll need.

sick drum
#

so

queen cargo
#

see? that was clear ๐Ÿ˜„

tough abyss
#

I was using computer science speak...

queen cargo
#

you have posted vague terms that can mean anything without any context

#

can tell you i work on a stack-based machine for arma

#

you would still not know what it is doing

tough abyss
#

Fair enough.

queen cargo
#

telling i work on a stack-based runtime for SQF would tell you everything ๐Ÿ˜ƒ

sick drum
#

@little eagle Do you know how support artillery works?

tough abyss
#

Yeah it's to simpilfy some things with clean up.

queen cargo
#

unless you do not know what that magic word runtime is ๐Ÿ™ˆ

tough abyss
#

In theory I could even store string-code into it to be processed.

#

[codestrings,codestrings] etc.

#

so ["Some SQF script here","Another SQF script", "Yet Another"]

#

The idea behind it is it can handle any kind of code.

#

or datatype.

sick drum
#

ok i got

#

You forgot to tell me I needed a support Requester

tough abyss
#

Yeah sorry.

#

Sync it to your artiliery unit.

#

and the Support module

sick drum
#

I know that now

tough abyss
#

I've been away from ArmA 3 a long time.

#

Atleast 2 - 3 months

sick drum
#

its ok you helped me so its cool

queen cargo
#

fun fact: found a use for the , quirk of SQF

tough abyss
#

Which quirk is that?

queen cargo
#

you can use it to allow for comma separation with ; ๐Ÿ˜„

#

@tough abyss SQF allows you to use , instead of ;

tough abyss
#

As a terminator?

#

Statement terminator?

#

Oh.

queen cargo
#
_obj1 = "B_Soldier_F" createVehicle [0, 0, 0],
_obj2 = "B_Soldier_F" createVehicle [0, 0, 0],
_obj1 != _obj2 //true;```
tough abyss
#

Thats weird...

#

Then again VBS can do other wierd stuff like that.

queen cargo
#

mhh?

tough abyss
#

Like a piece of string code can be {Code} or "" code

#

In all parts not just EH's

queen cargo
#

well ... thats due to commands accepting strings then

tough abyss
#

Yeah, but VBS allows a more... wider use.

#

Wish A3 had VBS3's external script interpreter console...

#

VBS took DayZ's map...

#

Why can't we have some of VBS's quality of life stuff?

#

I mean wouldn't you like this @queen cargo ?

#

Also look at MinErrorLevel

queen cargo
tough abyss
#

Yeah VBS has some internal details about how the SQF engine works

#

The more scripts/โ€œthreadsโ€ running at one time, the more time will be taken by the script switching logic and the less time the chosen script has to run before being interrupted again. As a result, this number should be kept as low as possible, using call compile preprocessFile "script.sqf" in place of execVM "script.sqf" as demonstrated above unless it is absolutely necessary to do otherwise. You should limit the number of scripts with infinite loops checking for some conditions and see if a similar logic cannot be performed using an event handler.

#

So less VM scripts == better

#

This section details the actual workings of the script interrupter within the engine. You do not need to understand it and it is here mainly for those who are curious.
All scripts placed in a queue ordered from the least recently executed to the most recently executed script. Every time the limit for processing scripts within the current frame is reached, the execution of the current script is interrupted. Upon entering the new frame a new script to execute is selected based on whether its condition allows it (the script might be sleeping or waiting for a condition). Thanks to the ordering, the least recently run script with a satisfied condition will run. If no script satisfies its condition the whole process is repeated the next frame.

#

That was the most interesting part I've found about the SQF engine itself.

#

So @queen cargo dedmen was playing with an FPS limit parameter

#

Why doesn't BI just add -limitfps parameter

#

?

#

I mean if it's 1 line of code he saw.

#

Let people decide if they want 60 FPS or 30 FPS

#

On the server-side.

#

Obviously VBS added this functionality quite a while ago.

little eagle
#

The only good thing about the scheduler is, that it warns about undefined variables. Too bad it also errors on them as well.

tough abyss
#

Yeah...

#

Some scripts can't work in unscheduled very well

#

Weather changing stuff from my experience

#

Broke...

#

if it wasn't run in scheduled.

#

No idea why.

#

Whats your opinion about adding a -limitfps option @little eagle

#

For both servers and clients?

little eagle
#

The more options the better I guess.

#

Weather works just "fine" in unscheduled. Fine as in it's just as broken.

tough abyss
#

Oh. Well if someone told me that before I tried to implement a more dynamic weather system.

#

It was a headache the engine hated you changing stuff instantly.

#

using skipTime 24;

#

then skipTime -24;

#

The clouds wouldn't sync, then the rain wouldn't sync. you'd end up with this grey empty sky.

little eagle
#

There is zero consistency with the weather commands and rain and fog are just b0rked.

tough abyss
#

so you'd have to issue simulWeatherSync;

#

Which sometimes failed to work.

#

BI removed a lot of the "weather commands"

#

like controlling the humidity etc.

little eagle
#

Simul weather is just another third party library that causes me more headache than it does good. The other being PhysX and AFM.

tough abyss
#

PhysX is broken isn't it?

#

AFM has issues too?

little eagle
#

They'll apparently fix tanks falling over for no reason, but there is still scenarios where I can't understand why a physics simulation throws around 60 ton vehicles as if they were rubber balls.

#

AFM is just annoying to implement for a custom helicopter. Mainly because you don't have the tools to create the xml tables.

#

Like two weeks ago there was this guy that talked about the SAGE engine. There you had all movement properties in a config that you could copy from one vehicle class to another. I wish it were like this in Arma too. Model based masses are just a huge pita.

runic surge
#

my random location script seems to send my test object about 620 meters from the center point of the marker

#

Not sure why, I have the positions hint and it looks right

little eagle
little eagle
#

Why not?

sick drum
#

I have spent almost three days making this scenario But I want to say thank you to everyone that helped me script half of this

sick drum
#

So guys I want to put in UAV support but I don't know how to do it, does anyone know how?

queen cargo
#

mhh ... what if ... one would ever do this:

_arr = [];
missionNamespace setVariable ["test", 10];
uiNamespace setVariable ["test", 20];
parsingNamespace setVariable ["test", 30];
profileNamespace setVariable ["test", 40];

_arr pushBack test;
with uiNamespace do
{
    _arr pushBack test;
    with parsingNamespace do
    {
        _arr pushBack test;
        with profileNamespace do
        {
            _arr pushBack test;
        };
        _arr pushBack test;
    };
    _arr pushBack test;
};
_arr pushBack test;
_arr```
#
_arr => [10, 20, 30, 40, 30, 20, 10] //Expectation
_arr => [10,20,30,40,30,20,10] //Reality```
tough abyss
#

Sounds messy.

#

And expensive.

#

Test it with code performance.

daring pawn
frail zephyr
#

Is there a way to get the name of a unit that is displayed in the Eden editor and not the class name?

subtle ore
frail zephyr
#

Ty! I had no clue what to search for and name/title got nowhere.

subtle ore
#

yeah no problem

rancid ruin
#

@daring pawn I'd always run in to exactly the same problem with that function so ended up rolling my own

#

it's not so bad to do

daring pawn
#

I was going to try and add an extra filter to make sure rock objects weren't nearby

#

But damn, thats soo silly... I was using the "meadow + 2*hills" and its like, oh so you want to be IN the hill!?

subtle ore
#

Rocks could be in the way of hill definitions

daring pawn
#

But in the rock though...

#

I'd accept ontop of the rock

subtle ore
#

Technically, it doesn't see the rock if that's the case.

daring pawn
#

Nah seemingly not, but theres filters for "houses" and "DeadBodies" in the bestPlaces commmand for some reason

#

but a rock is too much ~_~

subtle ore
#

Oh well, easy to fix.

rancid ruin
#

i never really noticed it until tanoa, there's just so many big rocks on that map

#

but it does it on any map, the function is bad

subtle ore
#

Well it's a little old too

#

A2

daring pawn
#

I honestly think i'mm better off combining isFlatEmpty and findEmptyPosition for what I want anyway, i just liked the thought of using bestPlaces to select some spots more randomly

tough abyss
#

There is another option

rancid ruin
#

i guess you could return a load of positions from selectBestPlaces and then just choose one which is >X meters away from rocks

tough abyss
#

Simply select a rock location find out it's bounding box edges

rancid ruin
#

fuck why didn't i think of that before i wrote my own

daring pawn
#

You'd need to find a lot though, it also seems to freeze my game on even a very few

tough abyss
#

displace the player outside those bounding boxes

rancid ruin
#

you don't have to do this during the mission, you could precompute 5000 random positions well in advance

daring pawn
#

Thats also true. I'm using it to find positions around a player or group of players at different conditions

#

To like have some "events" happen

subtle ore
#

Orrr...maybe see if the player is stuck inside the wrock and move the player outside of the rock?

daring pawn
#

like a crashed heli or something of similar nature, just to add some more variety

#

Or spawning of a composition

rancid ruin
#

if you move him out of the rock manually then how do you know the new position is a good position?

#

surely this could just go on forever putting you in bad positions

daring pawn
#

Yea precreating a bunch of positions and then removing the ones that are inside objects would be a decent idea

rancid ruin
#

if it fits in with the mission i've always been a fan of precomputing as much stuff as possible

subtle ore
#

@rancid ruin Possibly just continiously ask for a new position that isn't in a rock?

#

then exit when it's finished

#

I mean, unless you want to take a guess with seelctBestPlaces again I suppose

rancid ruin
#

but it also needs to adhere to the conditions you feed the BIS function in the first place

#

like you could move him out of a rock and in to the sea for example

subtle ore
#

Hmm

rancid ruin
#

by which point you might as well just write a whole new function

subtle ore
#

Right, that's the idea.

rancid ruin
#

oooooor do it BR/PUBG style, stick them in a parachute and let them find their own random position

#

guaranteed to probably not land inside a rock

#

but still possible because arma

subtle ore
#

Hahahahah.

daring pawn
#

You'd end up on another map with that ๐Ÿ˜›

subtle ore
#

I've always hated that whole community + concept

rancid ruin
#

arma 2 dayz and wasteland was bad for that, people would prone, roll, and glitch below buildings/rocks and camp there

#

you can probably still do it in arma 3 tbh

subtle ore
#

Not as bad in arma 3, but yeah.

daring pawn
#

Its not as bad in A3

sick drum
#

{alive _x} count (units fob + units fob1 + units fob2 + units fob3 + units fob4 + units fob5 + units fob6 + units fob7 + units fob8 + units fob9 + units fob10) == 0

Is there anything wrong here?

rancid ruin
#

does it work?

#

if not, there is something wrong there

sick drum
#

I tested it once and it worked but I was playing the game to make Sure that The scenario was ready to Launch, {And I think} I killed all the enemies But it wasn't triggering the next Objective. But I'm going to try something and hopefully it works

sick drum
#

Ok got it to work

still forum
#

@GeekGuy884#0311 We have script Interruption. Just can't disable it. We also have a FPS Limit cheat only clientside though.
And BIKI page about Arma 3's scheduler also has all that info. Just not as nice I guess I guess we'll just add a link to the VBS page to it.
@GeekGuy884#0311 @GeekGuy884#0311 I hate Discord...

limpid pewter
#

With respect to adding Event Handlers with the command "displayAddEventhandler"; If i add an "onUnload" EH to a menu like this ```sqf
spawnMenuDisplayEH = (findDisplay 12034) displayAddEventHandler ["Unload",{
[] spawn mld_fnc_spawnMenuCancel;
}];

still forum
#

afaik re-add

limpid pewter
#

ok, so the EH is destroyed as soon as the display/dialogs is closed?

still forum
#

Would say yes. But not sure. IMO this would deserve a comment on the displayAddEventHandler wiki page

limpid pewter
#

ok thanks for the help

sick drum
#

!alive at1 && at2;

Will this work?

still forum
#

if at2 is a boolean. yes

#

so.. probably not

sick drum
#

The At1 Is anti-tank Vehicles you have to destroy them

still forum
#

If you want to check both. You have to do that.
The game can't know what you want to do with at2. So you have to tell it that you want to check if it's alive

simple solstice
#

just add another !alive

sick drum
#

Ah yes thats it

still forum
#

(!alive at1) && (!alive at2)

sick drum
#

I knew I was forgetting something

#

thxs

little eagle
#

@limpid pewter

Will the EH always trigger when the display Unloads, no matter how many loads and unloads happen?
There can only ever be one unload event per dialog, because after it's been unloaded, it's destroyed. There can be multiple displays of the same type just as there can be multiple vehicles of the same type and they don't share event handlers.

#

This game still can't add event handlers to classes of dialogs or objects out of the box and needs mods for that, i.e. cba_a3.

thick sage
#

if I replace myFunction = {<code>}; by myFunction = compileFinal str {<code>};, would it solve the injenction problem, or compileFinal str {<code>} is not equal to {<code>}?

still forum
#

str {code} returns "{code}" if you compile that it would result in {{code}}

#

you can just cut off these brackets

thick sage
#

good point. besides the brakets, is there any problem (e.g. escaping quotes or else)?

#

(I see you have been using it, so I guess it is fine)

still forum
#

Didn't have any issue with that while it was being used.. Besides the call to compile crashing the game because we deleted the command ๐Ÿ˜„

little eagle
#

would it solve the injenction problem
No and compileFinal is pointless unless you're using it to prevent the cached function in ui namespace to be overwritten with very primitive methods.

thick sage
#

commy2, could you elaborate? Generally, I am trying to move a mission to be run on a public server. I though compileFinal (or putting in on cfgFunctions) was a step of this process.

little eagle
#

If they can change the game data with a tool, they can also change a compileFinal'd function with a tool. No difference.

still forum
#

cfgFunctions compileFinal's by default

little eagle
#

All compileFinal does is to prevent a function to be overwritten by the game itself. With a tool you can get around everything and you as server owner can do nothing about it.

still forum
#

With Intercept for example you can just swap out the code inside the variable. And ignore the final flag.. Though that is a bad thing to do and no one should ever do it

little eagle
#

Think about it. If it were so easy, they'd just implement the magic into everything else.

#

You can still use it as placebo if you think you feel better afterwards though.

thick sage
#

let me then refrase it: what steps do I need to take (on the SQF level) to make a mission public-safe. I do not care about whether there are in-securities on other systems, I care about what I can control

still forum
#

just use CfgFunctions. it compileFinals anyway so users cannot override them.
But if you run without battleye players can do anything anyway

#

so what do you mean by "safe" ?

thick sage
#

Assume battleEye is on.

still forum
#

battleye and bisigning enable. Don't need to worry about compileFinal as players can't do anything anyway

thick sage
#

great. That is what I wanted to know. is bisigning needed for a mission, or only for addons?

still forum
#

missions are not signed

#

addons are

thick sage
#

so, I need that the server verifies the signatures of the addons it uses, right?

still forum
#

If you let people load their own debug console... then they will be able to use it ofacuse

#

yes

thick sage
#

for battleye, I need to declare the right functions in cfgRemoteExec, so that the client can execute server code. Correct?

still forum
#

yes

thick sage
#

great. Thanks a lot @still forum and @little eagle, it clarified everything

still forum
#

But we didn't even tell you about params yet

little eagle
#

lol

#

cfgRemoteExec is not for battle eye.

limpid pewter
#

@little eagle Yeah that makes alot of sense about the display EHs, thanks

thick sage
#

@little eagle, ok, but I do need to declare the functions in cfgRemoteExec, or is that deprecated or something?

little eagle
#

It's for remoteExec

#

Maybe some mods or the mission need it.

thick sage
#

@still forum tell me about them (671 results in 271 files) ๐Ÿ˜›

#

ok. Yes, the mission needs it a lot to communicate between the client and the server (since I avoid publicVariable)

little eagle
#

1,327 code results in acemod/ACE3

tough abyss
#

Does anyone has an idea what this error would be?
Error in expression <c"] select Gear;waitUntil {scriptDone processParamsArray}; If (!isNil "PE_PL")> Error position: <processParamsArray}; If (!isNil "PE_PL")> Error Undefined variable in expression: processparamsarray File mpmissions\__cur_mp.Takistan\tfwp_scripts\gear_script\gearSelector.sqf, line 3

waitUntil {scriptDone processParamsArray};
still forum
#

welll..

#

Undefined variable in expression: processparamsarray

#

No.. I have absolutly no clue what it could be

#

Sure won't be a undefined variable. that's for sure

tough abyss
#

it is defined though
processParamsArray = [] execVM "functions\ParamsArray.sqf";

#

inside the init file

still forum
#

It's not

tough abyss
#

?:|

still forum
#

it can still be set to nil if ParamsArray.sqf returns Nil or isn't found

#

and a variable set to nil is undefined

#

what is inside ParamsArray.sqf

tough abyss
#
for [ { _i = 0 }, { _i < count(paramsArray) }, { _i = _i + 1 } ] do
{
    _paramName =(configName ((missionConfigFile >> "Params") select _i));
    _paramValue = (paramsArray select _i);
    _paramCode = ( getText (missionConfigFile >> "Params" >> _paramName >> "code"));
    _code = format[_paramCode, _paramValue];
    call compile _code;
};
still forum
#

uh

#

that doesn't return anything

#

ahh wait

#

are you sure that processParamsArray is never written to anywhere else?

tough abyss
#

yep

still forum
#

Can you send me whole mission without the mission.sqm?

#

or pastebin every scriptfile in there ๐Ÿ˜„

tough abyss
#

give me a sec

still forum
#

yup. the script file doesn't exist

tough abyss
#

๐Ÿคฆ ๐Ÿ˜ฆ

#

because it returns nothing?

still forum
#

ParamsArray.sqf is in functions\ParamsArray.sqf

you are calling processParamsArray = [] execVM "functions\ParamsArray.sqf"; inside tfwp_scripts\init.sqf meaning your working directory is tfwp_scripts and tfwp_scripts\functions\ParamsArray.sqf doesn't exist

tough abyss
#

ooooooooooooooh

#

Like start from the root like what

still forum
#

execVM "..\functions\ParamsArray.sqf" might work

#

or you should just use cfgFunctions and spawn instead of execVM

#

you are even already using cfgFunctions

#

but not using it.

tough abyss
#

I do, to spawn gearScript.sqf

still forum
#

just use spawn F_common_fnc_processParamsArray instead of execVM stuff

#

also the code in fn_processParamsArray is quite bad.. Should tell the F3 guys to optimize that ๐Ÿ˜„

tough abyss
#

should I exchange the code with paramsarray and fn_processparamsarray?

still forum
#

what code?

tough abyss
#

The one I quoted at the begining of the conv

still forum
#

just use fn_processParamsArray via the function name you defined using CfgFunctions

tough abyss
#

ok

#

Like that? processParamsArray = [] spawn F_common_fnc_processParamsArray;

still forum
#

yup

tough abyss
#

and it can stay inside its original place right? because we are not using execVM anymore

still forum
#

yes

tough abyss
#

It still goes
Error in expression <c"] select Gear;waitUntil {scriptDone processParamsArray};If (!isNil "PE_PL")> Error position: <processParamsArray};If (!isNil "PE_PL")> Error Undefined variable in expression: processparamsarray File mpmissions\__cur_mp.Takistan\tfwp_scripts\gear_script\gearSelector.sqf, line 3

still forum
#

did you check if f_common_fnc... is the correct name?

#

maybe I swapped common and fnc

tough abyss
#
    class F // Defines the "owner"
    {
        class common // catagory
        {
            file = "functions";
            class processParamsArray
            {
                preInit = 1;
                postInit = 1;
            };
        };
    };
still forum
#

yep.. I read that

#

don't use cfgFunctions alot. dunno

tough abyss
#

I will just put that line in the root folder ini

robust hollow
#

r u trying to call processparamsarray itself or is it the result of spawning a script?

still forum
#

the variable contains the scripthandle.

#

or should

robust hollow
#

but processParamsArray itself is code? idk im not thinking straight so im not understanding that. also with no tag defined it should be common_processParamsArray

#

pretty sure

#

oh, no common_fnc_processParamsArray

still forum
#

but the F has to be somewhere in there too..

#

doesn't it default to classname if you don't set a tag?

robust hollow
#

to the category not the owner (as adir described it)

tough abyss
#

I actually did not, I was that way ><

still forum
#

it is tag_fnc_function. so F_fnc_processParamsArray

#

and tag is classname if not set otherwise

#

category is completly ignored

tough abyss
#

so it's like f_fnc_processParamsArray

robust hollow
#

๐Ÿ‘

tough abyss
#

The script is being executed now, but I still get errors

#

๐Ÿ˜

#

The same errors as before

still forum
#

debug console?

#

test?

tough abyss
#

I'm not using the debug console

still forum
#

Yes.. that's what I'm trying to recommend you to do

#

put the spawn call into the watch field and check if you get correct result
put your variable into watch field and check if you get correct result

#

trial and error is only gonna get you so far

tough abyss
#

no errors when using watch fields

sick drum
#

Hey guys I'm making a scenario where you have to escape an island And I want a objective to say pick up your gun In the container, Then when you pick the gun up the game tells you to go to the other objective.

What do I do for the game to realize I have picked up the gun from the container And to tell the character to go to the other objective?

still forum
#

do the watch fields show the correct output

#

put a trigger area around the container

#

and as condition primaryWeapon player == "weaponsClassname"

tough abyss
#

processParamsArray = [] spawn f_fnc_processParamsArray;
returns nothing


waitUntil {scriptDone processParamsArray};
returns true

still forum
#

uhm

sick drum
#

ok cool thxs

still forum
#

you mean scriptDone returns true? or waitUntil returns true?

little eagle
#

An assignment obviously does not report true. But what does this report:

processParamsArray = [] spawn f_fnc_processParamsArray;
processParamsArray 
tough abyss
#

<NULL-script>

little eagle
#

And

#
f_fnc_processParamsArray

?

tough abyss
#

the full code of fn_processparamsarray.sqf

still forum
#

NULL-script is correct

#

it means scriptDone == true

#

so it means your scripts are all correct and work properly... but... Arma still thinks the variable is undefined

tough abyss
#

yea

#

the script works perfectly

still forum
#

where is the function that checks scriptDone called from?

tough abyss
#

I only get those errors

still forum
#

also your cfgFunctions entry is kinda wrong. You are calling the processParamsArray function 3 times. preInit,postInit via cfgFunctions and then again in your init.sqf

#

you are executing your gearScript via remoteExec

#

it might arrive and execute on the client before the ParamsArray func....

#

you are... calling your gear script on every player for every player that joins... meaning for 4 players it executes 4 times on each player.. 16 in total

#

don't you really want it to execute once on each player?

tough abyss
#

hm yes

#

.-.

still forum
#

just execute it in init.sqf then

tough abyss
#

where does it

still forum
#

why are you using BIS_fnc_MP?

tough abyss
#

oh

still forum
#

right after you call ParamsArray.sqf

tough abyss
#

I thought that way it will work with MP ><

still forum
#

ok

#

why did you think all the other stuff would work without it then?

#

we could spend over an hour talking about everything that's wrong or unoptimal in your code ^^

#

But I won't do that if you don't ask specifically ^^

tough abyss
#

so is it wrong to work with MP? or should i work with MP on everything

still forum
#

no where

#

unless you need it

#

but... generally you don't need it

#

if you don't know if you do. then you don't

#

init.sqf runs on every client. so no need to make it run on every client again

tough abyss
#

alright so I just made it a normal execVM..

If I remove the
preInit = 1;
postInit = 1;
and let only the init call the function.
Will it work?

still forum
#

yes

#

but I would recommend just leaving it in preInit

#

then you don't even need to call it and don't need the scriptDone check

#

because you are guaranteed that it will be completed when init.sqf runs

tough abyss
#

because it runs preinit

#

.-.

#

so you said I don't need to waituntil processparamsarray is done?

still forum
#

xes

tough abyss
#

Where does it 'say" that the script runs 4 times on every player that joins

still forum
#

your BIS_fnc_MP

#

it executes on local machine and all other players

#

and it is in init.sqf meaning all players execute it

#

meaning every player executes it once on local machine and then once on every other player

tough abyss
#

oh so it's fixed already because I changed it to execVM

#

like execVM "tfwp_scripts\gear_script\gearSelector.sqf";

#

I also removed processParamsArray = [] spawn F_fnc_processParamsArray;

copper raven
#

why not just execute in initplayerlocal.sqf?

still forum
#

oh yeah.. init.sqf also executes on server. You probably don't want your gear scripts to execute on server

tough abyss
#

so just move execVM "tfwp_scripts\gear_script\gearSelector.sqf"; to initPlayerLocal.sqf?

little oxide
#

Yes

tough abyss
#

gearSelector won't be executed ๐Ÿ˜

#

I get no gear

still forum
#

initPlayerLocal.sqf right next to where your init.sqf is

tough abyss
#

the one in the folder or the root?

#

I know that initPlayerLocal goes in root

still forum
#

jup jup

tough abyss
#

it won't give me my gear ๐Ÿ˜

slender halo
still forum
#

I'd recommend postInit. But then you need a !isServer check

tough abyss
#

I put processParamsArray = [] spawn F_fnc_processParamsArray; back in and it worked

tough abyss
#

@still forum What do you mean?

subtle ore
#

Meaning to make sure the script isn't running on the server

pale wind
#

Anyone here have any decent experience with ACE ? I'm trying to change the location of the action point on a certain object-type

#

But can not get it working, interaction point is always centered in model

#

Thought the arg for position in the addAceInteraction was the function for it, but seems not

tough abyss
#

@still forum the script won't run whenever I remove processParamsArray = [] spawn F_fnc_processParamsArray;

still forum
#

ยฏ_(ใƒ„)_/ยฏ

tough abyss
#

:\

peak plover
pale wind
#

thanks ๐Ÿ˜ƒ

cyan pewter
#

i cannot get this trigger to loop for the life of me

#

true

#

0 = [] spawn {"marker_4" setMarkerPos getPos asl; "marker_6" setMarkerPos getPos bsl; "marker_5" setMarkerPos getPos csl; "marker_7" setMarkerPos getPos operator}

#

and im set on keeping this a single mission file for use as a template

still forum
#

this is a trigger that always loops? Is it ever stopped?

cyan pewter
#

never. i could make it stop if the player dies if that helps, but i couldnt figure that out either

still forum
#

there is a thing for things that loop. It's called a loop.

#

๐Ÿ˜„

cyan pewter
#

i read "while" doesnt work in triggers. again, im set on keeping this a single file

still forum
#
[] spawn {
    while {true} do {
"marker_4" setMarkerPos getPos asl; "marker_6" setMarkerPos getPos bsl; "marker_5" setMarkerPos getPos csl; "marker_7" setMarkerPos getPos operator;

        sleep 0.5;
    };
};
#

it does

#

put this into trigger with execute once

#

or into the init of ONE unit

#

no wait.. init of one unit might not the that great of an idea

#
[] spawn {
if (!isNil "markerLoopRunning") exitWith{};
markerLoopRunning = true;
    while {true} do {
"marker_4" setMarkerPos getPos asl; "marker_6" setMarkerPos getPos bsl; "marker_5" setMarkerPos getPos csl; "marker_7" setMarkerPos getPos operator;

        sleep 0.5;
    };
};

There. Put that in as many unit inits as you want. but you only really need one

cyan pewter
#

got it! first one worked. i dont know where you got some of the variables in the second one

still forum
#

imagination and creativity

cyan pewter
#

lesson here is that you can define conditions in the init field

still forum
#

the first one might not work with JIP

#

other players that join later might not see the markers update

cyan pewter
#

yeah, i read that could be an issue, but in this particular case, i wouldnt need it in a mp environment

tough abyss
#

Do I even need to remove
processParamsArray = [] spawn F_fnc_processParamsArray;
?

still forum
#

dunno

#

it will get executed twice if it already runs at preInit

#

there is no NEED to remove anything

#

you can have the same code running in a loop a thousand times every frame..

chrome mason
#

Yo, im trying something and just wanna check, pretty basic but syntax is key.

_a = true;

if (_a) then {do something} else {do something else};
#

Does that if function search for _a being true or do i need to define it more?

simple solstice
#

it's fine

chrome mason
#

like ```sqf
if (_a == true)

#

oh its fine

simple solstice
#

you can add private before _a

#

but it's fine that way

chrome mason
#

I already have a private array with all the variables in the script listed

#

๐Ÿ˜‰

#

Thanks for the clarification tho

simple solstice
#

private before a variable is faster

real tartan
#

When I create helicopter and then pilot and gunner I end up with scenario that Helicopter spawns with pilot already in helicopter flying, but gunner spawn at [0,0,0] and heli land and wait untill gunner come from end of map and enter heli. My question is WHY is gunner not in helicopter?

#

`
_helicopter = createVehicle ["I_Heli_light_03_F", [0,0,0], [], 0, "FLY"];
_helicopter setPos _spawnPos;
_helicopter flyInHeight 50;

_group = createGroup east;

_pilot = _group createUnit ["O_helipilot_F", [0,0,0], [], 0, "FORM"];
_pilot assignAsDriver _helicopter;
_pilot moveInDriver _helicopter;

_gunner = _group createUnit ["O_crew_F", [0,0,0], [], 0, "FORM"];
_gunner assignAsGunner _helicopter;
_gunner moveInGunner _helicopter;
`

still forum
#

Because! eh... mh... Good question..

real tartan
#

From WiKi: moveInGunner - move soldier into vehicle gunner position (Immediate, no animation).

still forum
#

maybe first move them in and then setPos/flyInHeight the helicopter

real tartan
#

so Wiki is lying, again

still forum
#

dunno..

#

I don't see why it wouldn't work. just guessing

peak plover
#

@real tartan , works on my machinbe

real tartan
#

do you have example mission? I just edited it to: create heli, create pilot, create gunner and AFTER THAT move heli, same result

peak plover
#

        call {
            if (isNull (assignedDriver _vehicle)) exitWith {
                _unit moveInDriver _vehicle;
                _unit setskill ["aimingAccuracy",0.05];
            };
            if ((_vehicle emptyPositions "Gunner") > 0) exitWith {
                _unit moveInGunner _vehicle;
                _unit setskill ["aimingAccuracy",0.01];
            };
            if ((_vehicle emptyPositions "Commander") > 0) exitWith {
                _unit moveInCommander _vehicle;
                _unit setskill ["aimingAccuracy",0.01];
            };
            if (count _turrets > 0) exitWith {
                _unit moveInTurret [_vehicle,(_turrets select 0)];
                _turrets = _turrets - [ (_turrets select 0)];
                _unit setskill ["aimingAccuracy",0.01];
            };
            if ((_vehicle emptyPositions "cargo") > 0) exitWith {
                _unit moveInCargo _vehicle;
                _unit setskill ["aimingAccuracy",0.3];
            };
        };
still forum
#

@real tartan scheduled script?

#

add a sleep 0.1 before you move in both.

real tartan
#

yes, execVM (for testing)

peak plover
#

maybe your heli does not have a gunner

#

do

#

player moveInGunner cursorObject when looking at your heli

#

Either way, I don't have any suspension, but run in scheduled. And never had an issue

still forum
#

Maybe you just don't know that you have suspension

peak plover
#
    if ((_units select 1) >= 10) then {
        _setPos = [(_setPos select 0), (_setPos select 1), 150];
        _vehicle = createVehicle [_veh, _setPos, [], 0, "FLY"];
    } else {
        _vehicle = _veh createVehicle _setPos;

    };



    _vehicle setDir _dir;
    _unitArray = _unitArray - [(_unitArray select 0)];

    _turrets = allTurrets [_vehicle,true];
    {
        _unit = _gName createUnit [ _x, position _vehicle, [], 20, "NONE" ];
        _unit addEventHandler ["Killed", aiMaster_fnc_onKilled];
        _unit setSkill _skill;
        _unit setskill ["aimingAccuracy",0.01];
        call {
            if (isNull (assignedDriver _vehicle)) exitWith {
                _unit moveInDriver _vehicle;
                _unit setskill ["aimingAccuracy",0.05];
            };
            if ((_vehicle emptyPositions "Gunner") > 0) exitWith {
                _unit moveInGunner _vehicle;
                _unit setskill ["aimingAccuracy",0.01];
            };
            if ((_vehicle emptyPositions "Commander") > 0) exitWith {
                _unit moveInCommander _vehicle;
                _unit setskill ["aimingAccuracy",0.01];
            };
            if (count _turrets > 0) exitWith {
                _unit moveInTurret [_vehicle,(_turrets select 0)];
                _turrets = _turrets - [ (_turrets select 0)];
                _unit setskill ["aimingAccuracy",0.01];
            };
            if ((_vehicle emptyPositions "cargo") > 0) exitWith {
                _unit moveInCargo _vehicle;
                _unit setskill ["aimingAccuracy",0.3];
            };
        };
        _unit setskill ["aimingSpeed",0.3];
        _unit setskill ["spotTime",0.7];
        _unit setskill ["spotDistance",0.8];
        _unit setskill ["Courage",0.5];
        _unit allowFleeing 0;
        true
    } count _unitArray;
still forum
#

the call maybe ๐Ÿ˜„

peak plover
#

should not take more than 3 ms, therefor it would be on same ffame

still forum
#

probably not.. but..

peak plover
#

call should still be on the same frame ?

#

because call in EH would be instant

still forum
#

yes. should. dunno ^^