#arma3_scripting

1 messages ยท Page 338 of 1

mortal halo
#

say, I want to input an array

#

but if an array is not passed - i'd like to return false

#

so can i set the defaultvalue to false and the expected data type to [] ?

#

if(_inventory isEqualTo false) throw "Error: Invalid inventory specified";```
#

like this

peak plover
#

Ohh nice, thanks found the control type, it's exactly what I was looking for

still forum
#

@Neviothr#0132 How about

    // Because lineIntercets needs ASL
    _aiPos pushBack (getTerrainHeightASL _aiPos + 0.1);

    // Check if the player sees the position
    _intersections = lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull];

? Just a simple addition instead of a vectorAdd

#

@mortal halo Try it

peak plover
#

default value type does not matter

lusty canyon
#

ive converted a ghosthawk into a uav, but when a player controls driver/gunner his view camera pos is in the seat (since no human model?), any way to use a GetIn EH to change the crew camera pos?

#

does getIn even trigger when someone controls a uav?

lusty canyon
#

you guys took too long to respond, so i had to ask the losers in #cfg, now i feel dirty and violated.

still forum
#

does getIn even trigger when someone controls a uav? no

#

Because you are not getting into anywhere

#

And his camera pos should be in the camera

#

@regal geyser Everything is wrong on there

#

you are getting the position of a marker.. but providing an array instead of a marker. and then you are trying to select a random element from that position (which only has 3 elements) using a completly outdated method

#
BIS_startingPos setMarkerPos ((BIS_spawn getMarkerPos) select (floor (random (count BIS_spawn))));
#

That is what you are doing

#

and yes.. an array is not a marker. so the error is completly correct

#
BIS_startingPos setMarkerPos (getMarkerPos (selectRandom BIS_spawn));

There is a correct version..

regal geyser
#

Oh. Yeah, I'm bad at this. I've been analyzing old BIS inits to try to figure this out

still forum
#

Also you were not actually calling getMarkerPos with BIS_spawn as argument.. you were trying to call BIS_spawn which is not a script command with getMarkerPos which is not an argument as argument

lusty canyon
#

@still forum quote: And his camera pos should be in the camera
if you mean the view the the typical uav driver hud, that camera pos is fine
but when you switch views back to the internal cockpit view then your view is where your balls are

still forum
#

the argument goes to the right side. Check the Wiki

regal geyser
#

Thanks for the correct version.

tough abyss
#

@still forum that would probably work, and be more efficient.

regal geyser
#

I have been messing with this for way too long but I've been working off an old init and so my code is all convoluted and outdated because I've been learning from convoluted and outdated inits

#

so thank you so much

#

i can't believe it was that easy

still forum
#

Also I'm quite sure the error message didn't just tell you "error in expression".
RPT first lists the error. then location.. and under that it prints "error in expression"

regal geyser
#

RPT?

still forum
#

yes.

#

RPT.

#

Google?

regal geyser
#

oh i didn't even look at a log file.

lusty canyon
#

how do i check if my cursortarget is a TREE? isKindOf "tree"?

little eagle
#

A tree cannot be the cursorTarget

lusty canyon
#

how bout an intersect object?

little eagle
#

Sure.

peak plover
#

cursorObject

Returns the object under cursor. This command is quite different from cursorTarget as it is more precise in determining the boundaries of the pointed at object and can detect a larger variety of objects including map objects and trees.
lusty canyon
#

so how do i find out if its a tree? can be vanilla and/or cup trees

peak plover
#
nearestTerrainObjects [player, ["Tree","Bush"], 200];```
little eagle
#
_object in nearestTerrainObjects [_object, ["TREE", "SMALL TREE"], 0]
lusty canyon
#

gonna attach a rope to a tree the player is aiming at so gotta be accurate

little eagle
#

I like this to check if a thing is a tree.

lusty canyon
#

so all trees in tanoa churnarus altis whatever are all child class of "TREE"?

little eagle
#

No, that's why this method is better.

#

They don't share a base class and this is one is more like a classification.

#

All trees share.

lusty canyon
#

so "TREE" is like a config property? like isTree = 1?

indigo snow
#

Trees baked into the map arent "real" objects and dont necessarily have a config entry

lusty canyon
#

so i can check it like this?


        _beg = eyePos _myPlayer;
        _end = (_beg vectorAdd (_myPlayer weaponDirection currentWeapon _myPlayer vectorMultiply 500));
        _array = lineIntersectsSurfaces [_beg , _end, _myPlayer, objNull, true, 1, "GEOM","NONE"];
        _targetObject = ((_array select 0) select 2);

if ( _object in nearestTerrainObjects [_object, ["TREE", "SMALL TREE"], 0] ) then 
{
    // yes its a tree now rope it
};
little eagle
#

I think it was something in the model. But I can't remember for sure.

lusty canyon
#

trees has which LODS? GEOM FIRE VIEW? which one to make sure intersect hits a tree?

little eagle
#

trees and ropes, huh ๐Ÿ‘€

lusty canyon
#

monkey business

#

cant wait to watch war for the planet of the apes!

#

so will turn arma into apetopia irst

little eagle
#

A3 trees have VIEW, they all should have GEO and FIRE GEO at least in the trunk.

lusty canyon
#

whats the best LOD args i should go for?

little eagle
#

Chernarus trees don't have a VIEW geo by default iirc, which is why the AI can see through them in A2...

sage belfry
#

_array = lineIntersectsSurfaces [_beg , _end, _myPlayer, objNull, true, 1, "GEOM","NONE"];
_targetObject = ((_array select 0) select 2); could also return an empty array

little eagle
#

VIEW I guess.

#

That is what blocks the eyes of the AI

lusty canyon
#

how can you make intersect check all the LODS of an object?

little eagle
#

You can only have two.

lusty canyon
#

ill then just have to run intersect multiple times covering all LODs until the tree is hit

#

the higher up the player aims at the tree the less likely intersect will be reliable?

tough abyss
#

Anyone mind explaining all the LOD types (fire, view, geom, ifire and none)?

little eagle
#

"NONE" just means no LOD ^^

warm hemlock
#

Hello, I have a small question about trigger activation. I want to make a convoy stop once a random guy is shot in the convoy, I am doing this by a trigger and setting the fuel 0 for all the cars. and i gave names to all the people in the convoy so i want that if any of these guys is shot the script will activate

#

so i want to do something like !alive en1 or !alive en2 or etc

still forum
#

shot as in hurt or shot as in dead?

#

Why don't you just do !alive en1 or !alive en2 ?

little eagle
#
this addEventHandler ["killed", {
    [car, 0] remoteExec ["setFuel"];
}];

?

warm hemlock
#

i got it its !(alive en1) or !(alive en2) etv

#

etc

#

Thank you anyway guys ๐Ÿ˜„

still forum
#

the brackets shouldn't be needed I think.. but... oh well

subtle ore
#

Are you scraping for that 0.00000000000001 MS performance gain? :p @still forum

still forum
#

No.. There is no performance gain in brackets

subtle ore
#

Cries, we have to go faster! Ludicrous speed!

still forum
#

but !alive is easier to write than !(alive) when you are doing that a dozen times

little eagle
#

What do you mean?!?

if (!(alive(enemy1))) then {
warm spade
#

Does anyone know why selectplayer _name; doesn't work?

if (player distance cursortarget <50) then {
        
        if (alive cursortarget) then {
            
            _name = name player;
            
            selectplayer cursortarget;
            sleep 5;
            
            selectplayer _name;
            
        };

};
indigo snow
#

because it only accepts objects as input

#

and name player is a string

little eagle
#

Yup, that would be sufficient to explain why it fails.

warm spade
#

ok thanks

shadow sapphire
#

@little eagle, adding private to those variables as described did not fix my problem.

#

I am trying to run a script in a composition. It can't be run from a file.

little eagle
#

I answered how to set the variables private scope. Didn't read the convo above.

shadow sapphire
#

Ah! Okay, thanks.

little eagle
#

You can wrap everything into a:

call {
    ...
};
#

And it should no longer complain.

shadow sapphire
#

I need to run a script as part of an Eden composition and have it run when the composition is placed. Anyone know anything?
This is basically the script:

Sleep 1;
_G2 = [(getPos thisTrigger), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setBehaviour "SAFE";
    } forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;```
#

It appears @little eagle has a solution.

still forum
#

what is the problem. Why doesn't it just work?

shadow sapphire
#

It won't use a local variable, but if I use global variables, then the scripts will be stepping all over themselves.

little eagle
#

Eden complains about local variables, because this game is retarded.

still forum
#

GG Bohemia

little eagle
#

Just wrap it all into a call { }

#

(or use CBA, which does this for you)

shadow sapphire
#

It seemed to accept it.

#

Now I just have to figure out a decent activation method.

#

@little eagle, can you not use sleep commands inside calls?

little eagle
#

You can use sleep inside calls.

shadow sapphire
#

Hmm...

little eagle
#

But you can only use sleep or any other suspension command inside the scheduled environment.

shadow sapphire
#

I see.

#

Any way I can do that from my script?

little eagle
#

Since it complains, you're probably operating in the unscheduled environment.

shadow sapphire
#

I'm running it from an editor placed trigger, if that helps.

little eagle
#

To enter the scheduled environment, you have to use spawn (or execVM).

shadow sapphire
#

Interesting. It never complained when I was using this script as an sqf. Are sqf files treated differently in that way?

#

Thanks so much for how much help you give me all the time, by the way. You're always teaching me stuff on here.

little eagle
#

No, it depends entirely of the environment you're operating in.

shadow sapphire
#

Unfortunately, I'm pretty sure I'm not retaining enough.

little eagle
#

init.sqf runs in scheduled environment.

#

Every eventhandler in unscheduled.

#

You can use

canSuspend

to debug the current environment.

shadow sapphire
#

Could I wrap my script in spawn {SCRIPT};?

little eagle
#

Sure, but keep in mind that spawn has a fixed return value (a SCRIPT type for this command), so you have to use an assignment with a throwaway variable, OR wrap it all into an additional call.

#

Otherwise the Editor complains again, because this game is retarded.

shadow sapphire
#

AH! interesting. So I could do call{spawn{SCRIPT};}; or something of that nature?

#

I thought it was an OR type scenario between call and spawn.

little eagle
#

Yes, except that spawn is a binary command that needs an argument on the left side too.

#

Even if it's just an empty array or 0 as throwaway value.

polar folio
#

is it possible to disable lobby slots based on conditions? no idea when the slots are established or if it's possible at all. deleteVehicle from the init line is happenign to late it seems

shadow sapphire
#

0 spawn {};?

little eagle
#

Yup, DEL

shadow sapphire
#

@polar folio, I know for a fact that you can disable lobby slots, but my way would be hacky.

little eagle
#

@polar folio Since the lobby is created before any script of the mission is run, I'd say no.

shadow sapphire
#

@little eagle, you can kill the unit.

little eagle
#

But how do you kill the unit before the first mission script ran?

#

Also what if it's a mission with respawn? Delete the unit?

polar folio
#

oh dude. i have zero issue with hacks if they do the job ๐Ÿ˜„

shadow sapphire
#

Sounds like he does need it too early for my solution.

polar folio
#

ah k

shadow sapphire
#

If you need it before players can join the lobby, then I can't help you, haha.

polar folio
#

yer ideally it would atleast feel clean on the clients side. kinda want to avoid screen messages a la "you chose the wrong slot pls go back to lobby"

shadow sapphire
#

@polar folio, actually, I do have a solution for you, MAYBE.

little eagle
#

Script your own lobby :S

polar folio
#

i guess i could do it the dayz mod way with a shitload of civ slots and then move them into groups

#

yer kinda like that. but then how do i avoid people having to fully join to find out that player limit is reached

shadow sapphire
#

If you want like a certain ratio of players to be certain things or something, you could use the skiplobby command, then just place down the units in your mission in the exact order you want those slots occupied.

polar folio
#

?

shadow sapphire
#

Place them all ungrouped and enable dynamic groups for a little more flexibility.

little eagle
#

Isn't there also a forced auto balance or am I thinking of enemy territory again?

polar folio
#

mostly aiming for it to be clean for someone who joins. i can come up with ways to do it after the lobby but ideally i would like to have someone know they can't participate before they join

shadow sapphire
#

@little eagle, will I be able to use 0 spawn in multiple scripts or will I have to start using 1, 2, etc.?

polar folio
#

did someone successfully hack the lobby dialog? i guess i could add a message there and disable the join button, if max players are in

little eagle
#

It's just a throwaway argument. _this becomes 0 inside your spawn-block.

#

The game has as many zeroes as you want.

shadow sapphire
#

Ah, gotcha.

#

That's good. Now my problem is this. Wait one.

#
Error in expression <call {
0 spawn {
_G1 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_S>
10:07:22   Error position: <thisTrigger), INDEPENDENT, ["I_Soldier_S>
10:07:22   Error Undefined variable in expression: thistrigger```
little eagle
#

Yeah, thisTrigger is a special variable in that it's only defined in the triggers script instance.

shadow sapphire
#

Now it's not working at all and complaining about that. Before it was complaining about and skipping sleeps, but it worked otherwise.

#

Haha, Arma, always something.

little eagle
#

When you start a scheduled script with spawn, thisTrigger is no longer defined.

shadow sapphire
#

FUDGE. Any way to define that one internally? Holy cow, haha.

little eagle
#

It's the ideal candidate to pass as argument instead of the zero.

shadow sapphire
#

Yeah?

#
call {
thisTrigger spawn {
_G1 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos thisTrigger), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setBehaviour "SAFE";
    } forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;
};
};```
little eagle
#

Yeah, except that thisTrigger is still undefined.

#

The passed argument is inside the _this variable.

shadow sapphire
#
call {
thisTrigger spawn {
_G1 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setBehaviour "SAFE";
    } forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;
};
};```
little eagle
#

The first line is superfluous.

#

And is missing a ;

#
[1,2,3] spawn {
    _this // [1,2,3]
};


[4,5,6] call {
    _this // [4,5,6]
};
#

lgtm now

shadow sapphire
#

@little eagle, my script as posted above is working perfectly thanks to you!

What is this that you've posted most recently? A more efficient way of doing something?

little eagle
#

It explains how passing variables works.

#

You write something on the left of spawn or call and its value becomes the value of the _this variable inside the CODE-block.

shadow sapphire
#

AH! Okay, sounds good!

#

Now that it's working, I need to work on some randomization and the like.

little eagle
#

Imo, you should tweak it a bit.

// init.sqf
MyTag_fnc_spawnGroups = {
    ...
};

// trigger box
call MyTag_fnc_spawnGroups;
#

That way you can edit these functions with a text editor and don't have to use the ingame boxes.

shadow sapphire
#

I edit it in NotePad++ then past it into trigger boxes at present.

little eagle
#

Well that way you don't need to change anything in the trigger and could use multiple of them with the same function.

shadow sapphire
#

That's a solid copy. Sounds good.

#

    _x setFormation [(selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"])];```
#

Arma is saying this needs to be a string. How do I make it a string?

tough abyss
#

Why does 3den complain about local variables?

indigo snow
#

@shadow sapphire remove the outer []

shadow sapphire
#

@tough abyss, according to @little eagle and some other skilled scripter people, "It's retarded."

indigo snow
#

currently is ["STRING"] where you need "STRING"

shadow sapphire
#

@indigo snow, that was my first instinct. I should have at least tried it before I came crying to deddy.

little eagle
#

@tough abyss There is literally no reason.

#

X39 will probably tell you otherwise.

#

And that is when you know that there actually is no reason.

shadow sapphire
#

Hmmm. Why isn't there an AI behavior somewhere between SAFE and AWARE. I want them to be relaxed, but not completely dicking off. Like, instead of rifles at high ready, rifles at rest, but like, in formation and shit, ya know?

#

Anyone know of a solution? Maybe some kind of force formation command with the SAFE behavior?

tough abyss
#

@little eagle maybe it's a bug?

little eagle
#

Maybe it's a feature.

tough abyss
#

Perhaps.

subtle ore
#

Bugs < Features

shadow sapphire
#

Does this work to delete the trigger from which the script is running?

#

call {
thisTrigger spawn {
_G1 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
    } forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;
Sleep 1;
Delete _this
};
};```
still forum
#

as you can see from syntaxHighlighting... no..

#

Delete doesn't exist

#

deleteVehicle might do the job

shadow sapphire
#

Ah! Okay.

#
call {
thisTrigger spawn {
_G1 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos _this), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
    {
    _x execVM "Gear\FN_CentralGreen.sqf";
    _x setBehaviour "SAFE";
    _x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
    } forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;
Sleep 1;
deleteVehicle _this
};
};```
halcyon crypt
#

what was the solution for line numbers being weird when #includeing files again? ๐Ÿ˜

little eagle
#

#LINE 1

still forum
#

put #include before your comments

#

instead of after

halcyon crypt
#

hmm that's weird, it's on line 1

#

scratches head

little eagle
#

Try
#LINE 1
at the end of the macro file.

#

I wanna know if that works.

halcyon crypt
#

alright give me a sec

#

working on dedi so it takes a little while ๐Ÿ˜„

subtle ore
#

Unpacked Folder -> use server profile -> restart server to see changes

halcyon crypt
#

@little eagle adding #LINE 1 completely breaks the PBO

little eagle
#

aww

halcyon crypt
#

actually, it could be armake ยฏ_(ใƒ„)_/ยฏ

shadow sapphire
#

Is there something I could stick in the init of an autoturret to change the side it is on?

indigo snow
#

group it to a different side unit with a spawn probability of 0%

lusty canyon
#

autoturret? like the autonomous hmg gmg? then deletecrew replace with uav_crew class of desired side?

halcyon crypt
#

@little eagle Preprocessor failed with error - Invalid file name(empty filename) is the error in case you're interested in what it did

shadow sapphire
#

So, I know about the grouping trick, I was hoping there was a slightly more sophisticated way to do it.

#

I'm trying to get a Praetorian 1C anti-air turret to be on independent side.

#

I believe they work just like the autonomous GMG and HMG turrets, yes.

little eagle
#

delete the crew and put an ai from the needed side inside?

still forum
#

@halcyon crypt #LINE macro needs filepath

lusty canyon
#

SO MY SUGGESTION WORKED BUT WE IGNORED CUZ IM STILL A LITTLE SHIT?

shadow sapphire
#

@little eagle, this is what I know needs to be done, but until you phrased it that way, I didn't realize it was that simple.

still forum
#

#LINE 1 file\file\file.sqf
maybe path in quotes

shadow sapphire
#

I'll place an empty one and then search Eden for AI units.

still forum
#

yes you can enter anything in there

halcyon crypt
#

I'll give that a try in a bit, it's not a real solution though ^^

still forum
#

You can make arma tell you "error in file hubbabubba"

little eagle
#

I like to (try to) phrase things simplistically, because I am a simple mind.

still forum
#

That won't help you if you put it into the included file though

shadow sapphire
#

@little eagle, I can't find an AI type unit to place there. Do I need to place it like game logic or whatever?

still forum
#

as Arma add's another #LINE after it goes back to the file that is including

little eagle
#

O_UAV_AI

#

A_UAV_AI B_UAV_AI

#

I_UAV_AI

shadow sapphire
#

If they had some kind of presence in Eden then I'd just drag the appropriate AI from an existing autoturret, but they aren't clickable.

#

Ah! Very nice.

little eagle
#

One of these depending on the wanted side.

#

Arg, it's B_UAV_AI, not "A"

lusty canyon
#

i got a point from an intersectsurf, i want it to continue for 2 more meters from returned point. (say if a wall was hit, i want another point just 2 meters continuing along the same vector)


        _beg = eyePos player;
        _end = (_beg vectorAdd (player weaponDirection currentWeapon player vectorMultiply 100));
        _array = lineIntersectsSurfaces [_beg , _end, player, objNull, true, 1, "GEOM","NONE"];
        _targetPoint = ((_array select 0) select 0);
        
        _newPoint = (_targetPoint vectorAdd ( _targetPoint vectorMultiply 2));
little eagle
#
_targetPoint vectorAdd ( _targetPoint vectorMultiply 2)

Isn't this just a fancy way of writing:

_targetPoint vectorMultiply 3

?

shadow sapphire
#

@little eagle, haha, I figured that's what you meant, but I don't know how I'd have said AI created, let alone occupy the turret.

#

If you've got better things to do than help me at the moment, I will just group the turret to the appropriate side.

halcyon crypt
#

@still forum @little eagle adding a path to the #LINE 1 thingy with or without quotes results in the same error ๐Ÿ˜‰

lusty canyon
#

ok so i can do vectormultiply 1.5 to add just 0.5 meters to my vector?

shadow sapphire
#

Anyone know of a script that does a better job imitating off duty behavior than the damn DISMISSED waypoint?

little eagle
#

@lusty canyon Yes, that is how multiplication works^^.
1 x 1.5 = 1.5

lusty canyon
#

yes im being stupid but the amount of vecAdd / vecMulti translates to how many game meters?

#

vecAdd 1 = 1 game meter?

digital pulsar
#

vecadd takes 2 vectors

#

vectorMagnitude _vector; will tell you how many metres long it is

little eagle
#

vectorAdd is just a plus sign for vectors in SQF

#

It's like asking "how many numbers does "+" add?"

still forum
#

@halcyon crypt DIAG_log a preprocessed script and look at how the line command works yourself

lusty canyon
#

@digital pulsar great thats what i was actually looking for

halcyon crypt
#

@still forum there's a ton of whitespace after the "normal" #line 1 cutting out at the diag_log char limit before showing anything else

#

I guess something is off somewhere

still forum
#

put the function in debug console watch and copy the source out of there

#

you'll get the whole code

halcyon crypt
#

can't copy.. ๐Ÿ˜ฆ

#

working through steam in home streaming

#

(because BI refuses to update the port ๐Ÿ˜ )

little eagle
#

You can, click line, press "home", hold "shift" and press "end".

shadow sapphire
#

Hey, how would one place a group randomly within a certain radius of its editor placed position?

If I change the spawn radius of the group, it does nothing.

If I change the spawn radius of the group leader, then the rest of the group has to run to him at mission start.

halcyon crypt
#

@little eagle I know, the steam streaming thingy doesn't support clipboard stuff

little eagle
#

Aww

halcyon crypt
#

exactly

little eagle
#

I blame Microsoft.

halcyon crypt
#

this is what I have to work with

#

and yes, the text in game actually looks like that, it's not compression ๐Ÿ˜›

lusty canyon
#

in home streaming to a mac? nvr tried it before is the performance good?

halcyon crypt
#

to Linux and it works

#

my laptop is too underpowered to do anything above 800x600 though

lusty canyon
#

actually playable? 60fps?

halcyon crypt
#

input is spot on but without a proper GPU I can't tell you how it plays but it should be fine

lusty canyon
#

how about voice input steam send it back to the game?

halcyon crypt
#

no clue

#

probably works fine, it's even detecting my controller

rancid ruin
#

@shadow sapphire loop through each of the group leader's group members and put them next to him on mission load maybe

lusty canyon
#

im in a similar situation, using slashtop to a shitty laptop but it doesnt stream back the remote mic input so i can only use teamspeak on the other machine

worthy zealot
#

Can anyone help me with my MP mission i use the liberation mission and i want to add custom ammo boxes into the game that they can buy from the Fob menu.

halcyon crypt
#

@lusty canyon give it a try I guess, if your host has a decent GPU it will probably work fine at 60fps

lusty canyon
#

i would need steam on both ends right?

#

@worthy zealot someone here would need intimate knowledge about that liberation mod considering you want player to buy from its UI? if its only just creating a new ammo box and placing it in the world then that should be easy you just need the classnames of items to put in

halcyon crypt
#

yep

worthy zealot
#

Yeh i know how to place in editor and i also know how to add/remove boxes from the buy menu. What i am stuck with is making a custom box and then adding a custom box to the liberation files

#

so i guess what i am asking is how would i get the box from arma editor that i made from there and into the libeartion mission

lusty canyon
#

@worthy zealot sorry i dont know anything about liberation. if you have access to the cfgs then i guess you can inherit an existing crate class then go from there

worthy zealot
#

they have an array of crates they allow (default arma crates )

// Classnames of ACE3 crates (which have to be in the unit preset as well).
KP_liberation_ace_crates = [
"ACE_Box_82mm_Mo_HE",
"ACE_Box_82mm_Mo_Smoke",

#

However if i make a custom crate with all various contents i don't know where i would add it

#

support_vehicles = [
["ACE_medicalSupplyCrate_advanced",50,0,0],
["ACE_Box_82mm_Mo_HE",50,40,0],
["ACE_Box_82mm_Mo_Smoke",50,10,0],

#

And that's the buy menu array

little eagle
#

Only the mission makers would know. Looks to me like you can't do it. At least like that.

#

You could do this...

#

Use the ACE_Box_82mm_Mo_HE class

#

And then add an init event script to this class to fill the crate yourself with script commands.

lusty canyon
#

are the mission scripts not unpackable?

little eagle
#

You mean the PBO?

lusty canyon
#

yeah just unpack the pbo

worthy zealot
#

yes they are unpackable

little eagle
#

Well, everything is unpackable.

lusty canyon
#

the you can trace how the author makes the buy menu? only BIS can make ebos?

#

or can we make ebos too?

little eagle
#

The sentence sounds funny.

worthy zealot
#

ebos?

little eagle
#

"everything is unpackable"

lusty canyon
#

encrypted pbo

little eagle
#

You can't make EPBO's yourself.

lusty canyon
#

can you get the contents of a populated crate in the INIT? or the crate is still empty on INIT phase?

little eagle
#

No, it will be full. Otherwise clearItemCargo this etc. wouldn't work.

worthy zealot
#

What am doing is am taking away the virtual arsenal and i want players only to be able to use BAF mod content so i want to add one crate with all BAF weapons uniforms ect to the fob buy menu. i can make a custom crate with all that in the editor and place in the world and i can also add crates to the buy menu. but i am new to scripting and i have no idea where to go from there

still forum
#

Yes you can make ebo's yourself

little eagle
#

This helps?

//init.sqf
["ACE_Box_82mm_Mo_HE", "init", {
    params ["_box"];

    if (!local _box) exitWith {};

    clearWeaponCargoGlobal _box;
    clearMagazineCargoGlobal _box;
    clearBackpackCargoGlobal _box;
    clearItemCargoGlobal _box;

    /* fill box */
}, false, [], true] call CBA_fnc_addClassEventHandler;
still forum
#

Same as you can build a fusion reactor yourself. You can. But you don't know how

subtle ore
#

Woah, how exactly can you make your own ebos?

little eagle
#

Dedmen doesn't know

still forum
#

How exactly can you build your own fusion reactor

#

I actually do know.

#

But I also know I'm not allowed to talk about that

little eagle
#

Careful that the CIA doesn't land a drone on you.

subtle ore
#

Alright, stepping out now. That was obviously a bait question

little eagle
#

You still haven't disproved dialetheism.

subtle ore
#

What?

little eagle
#

Dedmen

subtle ore
#

I assumed as much ๐Ÿ™„

rotund cypress
#

Anyone else who thinks it would be nice with a command like return and then value instead of just putting value in order to return data?

#

IMO, having a command like that makes it explicit and more easy to understand codebase quickly

still forum
#

Theoretically Intercept could

little eagle
#
scopeName "main";

....
    _return breakOut "main";

???

#

That is essentially "return".

rotund cypress
#

Hmm

#

Why would you use breakOut at end of scope?

#

It's gonna end execution either way

little eagle
#

You can put it anywhere, I'm just not very creative.

shadow sapphire
#

Is there an event handler that is linked to AI switching behaviors?

little eagle
#

No.

shadow sapphire
#

Drats.

rotund cypress
#

Of course you can put it anywhere, but why use breakOut when it's not needed? @little eagle

#

breakOut is for stopping execution

little eagle
#

...

rotund cypress
#

At end of scope it will end anyways

shadow sapphire
#

Any way that I could have it where whenever a group switches to COMBAT mode, it switches all allied groups within a certain radius to AWARE and gives them a waypoint at the nearest identified enemy?

little eagle
#

while loop

rotund cypress
#

Or in EF handler @shadow sapphire

#

Less threads

shadow sapphire
#

Is that performance intensive?

#

What is an EF handler?

rotund cypress
#

onEachFrame

shadow sapphire
#

Hmm... I don't think I'd be able to do that.

little eagle
#

I really doubt you want to check this every frame.

shadow sapphire
#

I'm working on a system that covers a map in AI bases and patrols, so performance is a huge deal.

rotund cypress
#

You could use a lazy eval, and check what frame it is on

#

so it won't check that unless it's every like x frames

shadow sapphire
#

Hmm... I'll have to think on this more.

rotund cypress
#
    if (diag_frameno % 50 isEqualTo 0) then {
        if _myCondition then {do what you want here};
    };
};```
#

@shadow sapphire could do something like that

#

or addMissionEventHandler ["EachFrame", { if (diag_frameno % 50 isEqualTo 0 && {myCondition}) then { do what you want here }; };

shadow sapphire
#

Is there a set frame cycle? Or maximum I can check, like fifty or could I do a check once every thousand frames or something?

rotund cypress
#

Or if you want to create a thread for "_i" from 0 to 1 step 0 do {sleep (x amount of time); do what you want};

halcyon crypt
#

I'd switch to a time based thingy

shadow sapphire
#

Time based would probably be my go to.

rotund cypress
#

You could also switch to time based with eachFrame

shadow sapphire
#

But I'm not opposed to anything that gets it done.

halcyon crypt
#

at 120 fps this diag_frameno would do 2x the work in the same amount of time as 60 fps

#

assuming that it's linked to the fps ๐Ÿ˜›

rotund cypress
#

Yes ^

shadow sapphire
#

Well, it'll be on a dedicated server, which is locked to fifty cycles per second.

halcyon crypt
#

EachFrame + time thingy is fine but you're probably better of doing a spawned while since it's not really time critical at all

#

as @little eagle said

rotund cypress
#
    private "_lastCheck";
    if (time > _lastCheck) then {
        do whatever....
        _lastCheck = time + (minutestosleep * 60);
    };
};```
#

Could do that as well

halcyon crypt
#

that won't work

rotund cypress
#

Which I think is good because then you don't have to create a thread

halcyon crypt
#

_lastCheck goes out of scope every frame

rotund cypress
#

You sure?

halcyon crypt
#

I'm not sure sure but I'm pretty sure ๐Ÿ˜›

rotund cypress
#

In that case just remove the underscore

#

And the private

subtle ore
#

Underscore would make it unusable in other scopes

rotund cypress
#

Why would he want to use it in other scopes? ๐Ÿค”

#

Except for next frame

subtle ore
#

Good question - > but i does. I probably should've said for future reference

#

The private making it even more so

rotund cypress
#

The private means he CAN use it in other scopes...

#

Well, child scopes

subtle ore
#

Oh wait a sec. Lool

#

Sorry i guess my brain is not working so well right now lol

rotund cypress
#

๐Ÿ˜‰

#

Always use privates, else you are going to have a bad time

subtle ore
#

Terrible time even

rotund cypress
#

Well, undefined variable in expression time

subtle ore
#

Oh no. Time to use sqf lint ๐Ÿ˜„

little eagle
#

You guys are making this way too complicated I feel like.

subtle ore
#

Yes, indeed.

rotund cypress
#

@little eagle Do you know if local variables will be undefined in next frame in OEF handler?

little eagle
#

They will be.

#

It's a new script instance every frame.

indigo snow
#

They have to be, theyre not subscopes of each other

little eagle
#

Just like how local variables in a GetIn eventhandler wouldn't carry over.

subtle ore
#

So you'll likely want to send any params to a fnc?

rotund cypress
#

When you put it like that in makes sense @little eagle

#

I mean, SQF are known to have weird things so...

little eagle
#

That is why I said it this way. Thanks for noticing.

rotund cypress
#

Wouldn't be surprised if they were defined

halcyon crypt
#

when you want to do EachFrame stuff that's time based then you'll probably want to wrap it in a per frame handler as CBA already did

rotund cypress
#

What, pass arguments into next frame?

halcyon crypt
#

nah just in general

rotund cypress
#

I do not know what CBA does with EF handler so

#

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

halcyon crypt
#

it basically keeps an array with functions and the delays they run at

#

and there's 1 EachFrame thingy that goes through that list and calls the functions in it when needed

#

used to have a much more simple example than what's currently in CBA but don't have it anymore

#

that's the core of it though

rotund cypress
#

Could've read if it weren't for the 100000000 macros

little eagle
#

I think DEL is more likely to ruin something than he can save by not just using a while loop with a sleep.

#

Could've read if it weren't for the 100000000 macros
Sounds like a personal problem to me.

rotund cypress
#

Seriously though, what is about all the macros?

#

Why?

little eagle
#

It's GVAR and QFUNC.

#

Hardly 100000000

rotund cypress
#

Was on about the whole of CBA

little eagle
#

Like 99% of them are GVAR and FUNC though^^

rotund cypress
#

For example, what is the reason behind this? #define IS_ADMIN serverCommandAvailable "#kick"

little eagle
#

Someone asked for it.

rotund cypress
#

IMO, it just decreases readability

#

Especially for a mod that so many use

little eagle
#

I used them in my section of the code and defined them there.

rotund cypress
#

For new users it will be very hard to learn

little eagle
#

And I was asked to move it to the main file.

#

serverCommandAvailable "#kick" is horrible to read.

#

I never can remember which one is for voted and which one is for logged admins.

#

So I put these in the local header file.

#

But as I said, they wanted me to move them to the common one.

#

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

rotund cypress
#

And GVAR is?

#

Couldn't find it

#

I hope it's not like getVariable

halcyon crypt
#

it's quite useful actually

little eagle
#

In cba_common GVAR(xyz) is cba_common_xyz

#

It's used so you can move files between components (and mods) without having to rewrite their pseudonamespace.

halcyon crypt
#

I don't use the macros myself but I see how they can be useful ๐Ÿ˜ƒ

little eagle
#

FUNC is the same just FUNC(xyz) is cba_common_fnc_xyz

rotund cypress
#

I see how something can be useful with macros as well, like defining a number to a more suitable name to that number

little eagle
#

Q means quote marks around it

#

There you have it, 95% of all used macros explained.

rotund cypress
#

I doubt it's 95% ๐Ÿ˜‚

little eagle
#

Measured per use it probably is.

rotund cypress
#

Why have a bunch of macros in your hpp that never gets used?

little eagle
#

Half of them are legacy.

rotund cypress
#

Aah

little eagle
#

E.g. EXPLODE_N is basically the same as params is now.

rotund cypress
#

Aah I see

#

I just never saw the point in making things to obscure code

#

New people are just going to learn the macros, not the syntax itself

little eagle
#

You get used to GVAR and FUNC quickly and the PREP framework instead of CfgFunctions and then you can't go back.

#

The syntax doesn't change with any of this though.

rotund cypress
#

Of course not, it's essentially just an alias

little eagle
#

But on the other hand, apparently half this channel scripts their mods in the debug console, so help is beyond them anway.

rotund cypress
#

Wot? ๐Ÿ˜‚

halcyon crypt
#

always wondered about PREP. In what way is it better than CfgFunctions?

#

would it make sense to move an existing code base over to it?

little eagle
halcyon crypt
#

I guess it's also mostly about prefixes

little eagle
#

You can edit / add / remove PREP all the time, while you would need config file patching enabled with CfgFunctions.

#

Because it's all script based.

#

Also with CfgFunctions, you can make use of recompile for all functions.

#

But in ACE that would mean adding like 40 seconds to every restart just to recompile everything.

#

With PREP you uncomment one line in the local header file and it takes not even a second for one component.

#

I'd go insane with CfgFunctions.

#

would it make sense to move an existing code base over to it?
Probably not. I see it as a part of the build environment. So if you start from scratch you can use the example addon that is somewhere on github I think and start something from there.

mortal halo
#

okay

#

im gonna start working on a virtual inventory system (@little eagle ) so I can finally go about remaking the whole inventory system. i need advice on how to network it properly for multiplayer tho

#

as in, take and remove items from containers (all items are stored as variables on the objects they are in)

#

any suggestions on how to do it safely?

little eagle
#

How would I know? You act like I've done something so ambitious ever before.

mortal halo
#

you have! an year ago.

little eagle
#

setVariable public is a place to start

#

A year ago?

mortal halo
#

yeah you've been telling me progressively to stop trying to achieve an inventory system

#

because you tried it all an year ago

#

as in weapons in containers, etc etc.

little eagle
#

No, I said I tried to make an AI reliably drop a weapon about one to two years ago.

#

I never tried to rewrite the inventory system, because I know it's futile to do so.

halcyon crypt
#

sounds like a burnout in the making ๐Ÿ˜

mortal halo
#

bah

#

not when its all virtual

little eagle
#

Call me when it's done. โ˜•

mortal halo
#

sure, but you must send nudes if i make it happen

halcyon crypt
#

raises eyebrow

little eagle
#

I thought this had an emoji too, but then I remembered that the Japanese have weird eyes.

halcyon crypt
#

there's ๐Ÿค”

little eagle
#

My favourite emoji. I dunno why.

halcyon crypt
#

because it communicates the "what the hell am I looking at" quite well

#

๐Ÿ˜„

little eagle
#

๐Ÿค”

halcyon crypt
#

๐Ÿ˜…

digital pulsar
#

what's the simplest way to create a temporary fire with damage and smoke?

little eagle
#

Blow up a vehicle

digital pulsar
#

mmm, wrecks are undesired

#

what i have now is, a fuel pump spawns and blows up

#

but you can see it for a few frames

subtle ore
#

@digital pulsar there are test fire objects under the CfgEmpty biki page

digital pulsar
#

can't see it in cfgvehicles/empty

subtle ore
#

Search for fire

digital pulsar
#

FireSectorTarget i guess?

subtle ore
#

Nope

digital pulsar
#

well then there's no "test fire objects"

subtle ore
#

Afaik it was in there

digital pulsar
#

found it in cfgvehicles/other

#

thanks

subtle ore
#

Sure

#

Dedmen has a better solution probably

still forum
#

if (serverCommandAvailable "#kick") then is more readable than if (IS_ADMIN) then. @rotund cypress are you serious?

little eagle
#

๐Ÿฟ

subtle ore
#

๐Ÿฟ ๐Ÿป

still forum
#

And if you wanna read the code and understand what it does. Which is the definition of readability. You can just ignore GVAR and that stuff.
And because the code is much shorter it's easier to read

#

And if you want to use the variables in your own code. GVAR is just modname_component_varname
On Github you already have the component in the filename which is displayed in big letters right above the file you are looking at.
If you unpacked a pbo you also have the modname in the path.

little eagle
rotund cypress
#

@still forum I do not use CBA and probably will never do, so it's irrelevant to me

#

And IS_ADMIN can be pretty much anything in a project as big as CBA

#

So putting that in global macros I just think is stupid

still forum
#

Tell that BI then..

#

BIS_fnc_admin admin

rotund cypress
#

Why would just not a comment suffice?

#

We have different ways of developing, that is why code look different, this is just my opinions

little eagle
#

It can be anything? Sounds to me like it can only be one thing but whatever.

subtle ore
#

Always Same

#

Not all code written has to be the same, some is written better but in a better method for the author

#

Don't even have to write it to conclude that

little eagle
#

I have no idea what this is about now.

rotund cypress
#

Me neither

subtle ore
#

๐Ÿฟ roll with it i guess.

#

Is it possible to set a custom camera as the main perspective?

still forum
#

yeah. You can move the players view into a camera that you can create and move as you want

tardy yacht
#

I've been looking around the wiki but I only found something on KK's blog, is there an easy way to detect when the play is talking? I only need to know it client-side, lighting up an image in the player's GUI when they're speaking in-game.

rancid ruin
#

KK's blog post and code explains how to do exactly that though..?

tardy yacht
#

Yes, I was just asking if there was an easier way to do it, as many posts from KK have been obsoleted by updates to the game later on.

#

Most of KK's posts come with feature requests, many of which have been added.

rancid ruin
#

yeah it's kinda convoluted, but i don't think anyone's gonna write this for you from scratch when KK's basically already done it

#

try modifying his code, that's what i'd do

tough abyss
#

Hi, I have this t12 animate["terc", 0]; codes.
I execute those with execVM. I have asked here a couple of days ago if the code runs globally, and I've got an answer says it is.
But when I host a server on my PC and I have someone else besides me, I bring the targets up and they only pop up on my screen.
When I run it on a dedicated server, it runs only on the server.

#

What should I do to make the animate command run globally

kindred lichen
#

When I use AttachTo commands, to Attach a vehicle to something, it breaks the weapons cool down. It's really wierd, Like the turret spins super fast, and the weapons, refire and reload times are drastically refuced.

#

Really wierd.

lusty canyon
#

is there a way to display the displayname prop of an object without traversing cfg >> shit ?

little eagle
#

No.

lusty canyon
#

Ty. now suffer classnames cuz im lazy

#

where is TypeOf partner NameOf?

#

i want to play some music while in virtual playground (debug console) is it easy to do and which pbos do i have to unpack to find the music path?

#

been looking for a simple music player mod but cant find any

lusty canyon
#

i need an equal chance random num from 0.0 to 0.5, will this work?

_num = 0.(floor random 5);
lusty canyon
#

wait im stupid ((floor random 4) * .1) works

still forum
#

No that doesn't work. It will only give you 0.0 to 0.4

#

how about just random 0.5 ?

halcyon crypt
#

how do you get the code in the init field of a vehicle/object during runtime? ๐Ÿ˜ƒ

#

nvm, don't need it anymore.. bad thought process ๐Ÿ˜

tame stream
#

hi all, im hoping someone can help me...
im trying to create a tank factory, what im trying to do is to activate a add action that would spawn a tank if certain conditions are met.

For instance if a number of fuel barrels and ammo crates are detected in trigger area i want it to activate a add action that would give the player a option to spawn a tank.

im currently sitting with a trigger that can spawn a tank if playr is detected, my next step is to have the trigger only activate once required fuel and ammo is detected in trigger area

how do i script a trigger to activate once certian number of items are detected

halcyon crypt
#

count ((getPos thisTrigger) nearObjects [typeName, radius]) > 10

#

should be able to use something like that for the trigger condition

#

replace typeName with the class of the barrels and radius with the radius you want to check

digital pulsar
#

what's the benefit of using private? parser knows that variable starting with _ cant be manipulated outside the scope

halcyon crypt
#

scope bleeding for one

digital pulsar
#

how

halcyon crypt
#
_myVar = true;

[] call someFunc;

someFunc:

_myVar = false;
#

results in _myVar being false after the call

digital pulsar
#

and if i use private in front of either of these, they won't collide?

halcyon crypt
#

yup

digital pulsar
#

cool

#

i'm usually used to it being the other way around, keyword global to manipulate variables from outide function

halcyon crypt
#

the way I remembered this happened was assuming that call is basically an #include

#

which is kinda true in a way ๐Ÿ˜›

digital pulsar
#

myeah like a paremetrized copypaste

lusty canyon
#
  1. does the cba xeh stuff add new events like onParachuteOpen or leanLeft/r?
  2. should dumb shits like me just stay away from CBA?
  3. how do i get exact moment when my AI units have deployed their chutes?
halcyon crypt
#

dumb shits should actually use CBA lol ๐Ÿ˜

#

and I don't think CBA adds any new events by itself

indigo snow
still forum
#

Variables carry over to lower scopes. That's why you can manipulate the _myVar in the higher scope

#

When you access a Variable in Arma it always searches from lowest to highest scope and uses the first variable it finds

#

by using private you create a new variable in the lowest scope. So the engine will always use that then

halcyon crypt
#

@indigo snow ah cool, didn't know about that

lusty canyon
#

those player events can be used on ur AI too or not?

indigo snow
#

No, they behave like mission event handlers in that they dont have a specific target

#

Just the player

lusty canyon
#

it looks like when a unit open a chute they become a vehicle?

while (true) { if ( vehicle _myCunt == "Parachute_Classname" ) then {  // chute is open? };};
still forum
#

They are inside a vehicle

#

They don't become one

#

Besides a Unit is always a vehicle theoretically

lusty canyon
#

vehicle keyword should get the parachute they are inside right?

still forum
#

yes

lusty canyon
#

so does the condition work or not?

#

or i could just go vehicle _myCunt != _myCunt to cover all parachutes?

#

or is there a parachute parent that i can isKindOf?

still forum
#

Check config viewer if there is a parent

#

if you just check if he is in a vehicle it would also return true for any other vehicle

#

no your condition doesn't work. vehicle returns a object not a string

lusty canyon
#

oh right forgot the typeOf

#

but yeah i gotta include mod chutes as well. i guess ill just run the loop check while unit is freefalling so if they become a a vehicle chute must of opened. (unless they are doing hollywood A TEAM stunts)

#

are IRL chutes disposable use once only? is BIS trying to simulate that by force dropping the chute bkpk when you hit the ground

still forum
#

In IRL you pack the chute back into the bag after you landed

lusty canyon
#

then you can go back up and halo again with your same chute?

tough abyss
#

.-. no

#

You can't jump with the parachute again after you packed it, it has to be folded in a particular way for it to open correctly.

#

I also didn't know they pack the parachutes after they landed I thought that they just leave it like that

still forum
#

Yeah.. And by "Packing it" I meant folding it exactly that way

#

If you do it you can. And Helo jumpers certainly know how to do that

tough abyss
#

Do they do it in combat too? It doesn't make any sense

still forum
#

In the middle of combat probably not

tough abyss
#

Yeah, that's what I though lol

lusty canyon
#

yeah doesnt make sense: its like "UNDER FIRE TAKE COVER!"

" SARGE WAIT IM STILL PACKING MY CHUTE!!"

still forum
#

And if they don't plan to helo again they probably also wouldn't fold it correctly

tough abyss
#

@lusty canyon When I say "combat" I didn't mean under fire

#

I meant in a combat zone

#

I'm reading here from a paratrooper:
I was a paratrooper for 2 years. In combat, the chutes would be discarded. But for training jumps, we would deflate the canopy, fold it up and stuff it into a bag that we carry in a compartment on the parachute harness. Then we would carry it to the waiting logistics trucks to bring it back to base. When we are done with the day's jumps (there may be more than one jump in a day), we head back and hang the chutes on 3-storey hooks and shake them out, then pack them back into the bags for the rigger folks to prep them for the next jump.

lusty canyon
#

what about those self packing oen with vacuum suction and stuff? (like in the bond movies, no IRL counterpart?)

tough abyss
lusty canyon
#

VQI has something like that

#

got tools like the spec watch for halo

indigo snow
#

RE: The parachute, it's simulation type might be special, maybe

#

so check getText(configFile >> 'cfgVehicles' >> typeOf (vehicle player) >> 'simulation') and see if that gives you anything

still forum
#

assignAsCargo does different stuff than moveInCargo

#

Just read the wiki page

#

it says everything

peak plover
#

I'll assign you as cargo ๐Ÿ˜‰

lusty canyon
#

i guess what im trying to ask is, why do i have to assign anyone as anything they should automatically be assigned to whatever seatType it is. i dont see any ill effects i can move them in dismount then they still FFV shoot and whatnot

mortal halo
#

well these questions come up alot when dealing with arma. you can just make your own little function that checks free slots in any possible form and return them / put a unit in them.

#

and assigns too

warm spade
#

is there a way to return the current selected squad in high command?

tough abyss
#

is there a way to use the respawn modules (and menu selection) with the Nimitz? At any height everyone respawns in the water, never on the Nimitz itself

#

like setting the height of the respawned player when selected in the menu?

#

it's not a marker

#

it's a respawn module

#

and it's a meter above the deck of the Nimitz

#

yet spawns people below sea level

obsidian chasm
#

How would I make a small group patrol to move with my vehicle via a trigger?.
https://pastebin.com/12E03zAi
I'd basically want 2-4 guys to spawn relatively close to the vehicle and to move on its path.

rancid ruin
#

i'd get positions to the left and right side of the vehicle and repeatedly tell group members to moveTo those positions

hasty pond
#

Anyone here know if those text fields being really off with a small font in dialogs have been reported to BI? I thought they'd be fixed by now

shadow sapphire
#

@hasty pond, I never reported it, haha.

#

Anyone know what kind of AI drives the Praetorian 1C turret and/or how to replace it with AI of a different faction?

hasty pond
#

I swear to god

shadow sapphire
#

What?

hasty pond
#

It's been annoying me too much

shadow sapphire
#

Screenshot? I haven't seen it.

warm spade
#

@shadow sapphire the game handels Praetorian C1 liken an uav so there is no real Driver. but if you write this in the init of it [this] joinSilent (createGroup EAST) it will join opfor

shadow sapphire
#

@warm spade, thanks! Will try it immediately!

tame stream
#

@shadow sapphire also, spawn empty one in eden and drag soldier from desired faction in to turret

shadow sapphire
#

@tame stream, thanks! I thought I'd tried that, but I was trying to group it. Didn't work as well, haha.

#

Your trick works perfectly.

tame stream
#

@tough abyss i had the same issue and realized it was me placing the carrier out of bound (check on the map and make sure carrier is not in the black border of the map)

tough abyss
#

really? that is the source of all my problems?

#

f*ck

shadow sapphire
#

Do I need to hide the unit or disable them to make sure nothing screwy happens, @tame stream?

#

I don't want a crewmember to pop out of the turret or something if it's destroyed. I want it to appear automated just as normal.

tame stream
#

nope not needed, the turret will act as a UAV does. If destroyed the unit dies aswell

hasty pond
#

@shadow sapphire Make a marker on the map and it's not vertically centered

#

It's noticably off

#

This can also be noticed in dialogs where there are text controls

shadow sapphire
#

Ah! Okay.

tough abyss
#

@tame stream placing it there still spawns people on the lowest deck ๐Ÿ˜›

#

but it'll do for the purpose

#

Why is BIS_fnc_findSafePos so atrociously slow?

#

doesn't it already do that whenever you use setPos

tame stream
#

im trying to activate a trigger once condition is met...
Condition must activate once 5 item are present, 3 barrels and 3 ammo crates.

this works fine on cond count ((getPos thisTrigger) nearObjects ["CargoNet_01_barrels_F", 5]) > 2 but i need it to count/check that there are ammo boces aswell

it should be like this count ((getPos thisTrigger) nearObjects ["CargoNet_01_barrels_F" plus "B_CargoNet_01_ammo_F", 5]) > 2

so it should count to see if there are more than 2 barrels and more than 2 ammo boxes before condition is met

little eagle
#
count (thisList arrayIntersect [barrel1, barrel2, barrel3, crate1, crate2, crate3]) == 6
#
count (thisList arrayIntersect entities [["CargoNet_01_barrels_F", "B_CargoNet_01_ammo_F"], []]) >= 6
tame stream
#

@little eagle thx for that but i was hoping that the barrels it would not have to be named as the barrels will be spawned in periodicly during the game, but ill give it a go

little eagle
#

See 2.

tame stream
#

mm ill try the seconds option

#

thx

indigo snow
#
  1. wouldnt fully satisfy the condition would it? 6 barrels or 6 ammoboxes would work too.
little eagle
#

Yeah. Does it have to be 3 each?

tame stream
#

which eva really

#

just using 3 as example

little eagle
#
count (thisList arrayIntersect entities "CargoNet_01_barrels_F") >= 3 && count (thisList arrayIntersect entities "B_CargoNet_01_ammo_F") >= 3
tame stream
#

oo yes 3 of each kind

#

@little eagle does not seem to work ๐Ÿ˜ฆ

little eagle
#

How so?

tame stream
#

placed crates both in the trigger area, should then spawn tank but no joy

little eagle
#

You need 3 each, 6 items in total.

tame stream
#

on first try i did

on second try i made it >= 1 to speed up testing

little eagle
#

@tame stream Apparently ammo boxes etc. don't get picked up by triggers list or thisList.

tame stream
#
count ((getPos thisTrigger) nearObjects ["CargoNet_01_barrels_F", 5]) > 1 && count ((getPos thisTrigger) nearObjects ["B_CargoNet_01_ammo_F", 5]) > 1```

got it working thx
#

@little eagle thx for the help

#

@little eagle if i could bother you for one last thing....?

#

how would i make the trigger delete the boxes after it activates?

little eagle
#
count (entities "BOX_ind_ammo_F" inAreaArray thisTrigger) >= 1 && count (entities "CargoNet_01_Barrels_F" inAreaArray thisTrigger) >= 1
#

I came up with this. Changed classnames for my mission.

tame stream
#

ok lemme try them

#

@little eagle yup works perfectly

little eagle
#

Triggers are so random in what they pick up and what not.

tame stream
#

yup seems like that

#

script ... test ... swear at monitor ... adjust sript... script ... test ... swear at monitor ... adjust sript... script ... test ... swear at monitor ... adjust sript... script ... test ... swear at monitor ... adjust sript... script ... test ... swear at monitor ... adjust sript... script ... test ... swear at monitor ... adjust sript...

tough abyss
#

You forgot the part where you sit on Discord for 8 hours trying to figure out why that one line doesn't work.

tame stream
#

๐Ÿ˜ƒ true

tough abyss
#

And it ends up being some arbitrary shit in another conflicting mod.

shadow sapphire
#

Hey! Anyone know how to create a zone into which and through which AI will not go? A zone to force them to go around, rather than through or into?

tame stream
#

any idea how to delete all or specfic items (not named) if trigger area.... i tried

{deleteVehicle _x} forEach nearestObjects [player, ["all"], 200]

replaced player with trigger name but no joy

shadow sapphire
#

@tame stream, I do this:

#

Wait one. Realized I gotta launch Arma.

#
{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],50])```

Placed inside of a gamelogic entity.
#

If that won't work for you, I've got something else that might do it.

tame stream
#

@shadow sapphire do tell

shadow sapphire
#

Toy with this, see if you can make it work for you:

_house = nearestObjects [player, ["house"], 2000];

{

    switch (typeof _x) do {

        case "Land_d_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle [(selectRandom ["Land_i_House_Big_01_b_blue_F","Land_i_House_Big_01_b_pink_F","Land_i_House_Big_01_b_whiteblue_F","Land_i_House_Big_01_b_white_F","Land_i_House_Big_01_b_yellow_F","Land_i_House_Big_01_b_brown_F"]), position _x, [], 0, "NONE"];
            _h attachto [_x,[0,0,0]];
            detach _h;
            _h setdir _dir;
            deletevehicle _x;

        };
    };
};```
#

What this does is replace a destroyed house with any of the non destroyed versions within 2km of the player.

tame stream
#

sorry i should have specified, players will place items on trigger area which will activate the trigger...i then want those items in that trigger area to be deleted

#

๐Ÿ˜ฆ

shadow sapphire
#

Ah! Okay, yeah, my solutions are tailored for different purposes for sure.

indigo snow
#

You can just deleteVehicle them

#

You already have a list of them you count, so you can delete say 3 from both lists

tame stream
#

im still learning scripting so not to sure how to utilize that command proparly, how would i structure the script within a trigger's on act:
in my senario id have upto 3 CargoNet_01_barrels_F.

how do i combine the command deleteVehicle with the object type CargoNet_01_barrels_F to achieve the desired result

deleteVehicle _CargoNet_01_barrels_F; obviously won t work

indigo snow
#

sure but entities "BOX_ind_ammo_F" inAreaArray thisTrigger would for example give you an array (list) of all ammoboxes in your trigger

#

just delete three of those

vivid quartz
#

deleteVehicle expects object

indigo snow
#

e.g.

{ 
    deleteVehicle _x;
} forEach (entities "B_CargoNet_01_ammo_F" inAreaArray thisTrigger select [0,3]);
little eagle
#

missing parenthesis

#

Or rather, move the closing one to the end.

indigo snow
#

wasnt sure about the order of inAA vs select

little eagle
#

It's a binary command.

#

But so is forEach and forEach has to run last

#

lgtm now

indigo snow
#

i think [0,2] -> [0,3]

#

second number is no. of entries right?

little eagle
#

It might be different for STRING vs ARRAY

tame stream
#

ok great lemme give it a go

little eagle
#

in STRING it's the length of the result.

indigo snow
#

wiki says same for array

little eagle
#

Yeah, but they call it "count" instead of "length".

#

Whatever

indigo snow
#

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

little eagle
#

I hate that the ARRAY version has "count" mandatory, while omitting the "length" for the STRING version makes it select everything to the last char.

tame stream
#

WORKS PERFECT :)
Still infant when it comes to constructing new scripts, i can reconise and ammend most script but compiling new ones is were im seriously lacking ...thx again ๐Ÿ˜ƒ

indigo snow
#

gotta build up your sets of building blocks man, its ok

indigo snow
#

Test it?

#

name _unit will be trivially fast

tough abyss
#

hey guys someone here with experience in extDB scripting? I'm quite new to it so would really appreciate some guiding. I've got some functions in the init and config already and the sqf functions almost ready but I'd love to have some with experience see if I am doing it right ๐Ÿ˜ƒ

PM if possible

little eagle
#

@hasty violet The displayName from config has nothing to do with the name reported by the command. The premise of that question is wrong.

tame stream
#

hi all :)

how can i have a delay on a addaction once its been activated, example...

walk to object with addaction
activate script via addaction
addaction disapears/deactivates for 30seconds
30 seconds later addaction reappears/re-activates and ready to execute script again

halcyon crypt
#

you'll have to keep track of the time someone used the addAction and then test whether the current time - last time used is more or equal to 30 seconds in the addAction condition

tame stream
#

well i was hoping its possible to disable the option for 30 seconds after its been activated, then have it back to just execute the script again

halcyon crypt
#

yeah that what the condition thingy is for

#

if that condition doesn't return true it'll hide the action

tame stream
#

ok but i have not idea how to do that

#

currently i have the addaction working fine but the delay has me stumped

#

how would i go about adding a condition to check if time has passed?

halcyon crypt
#

one sec ๐Ÿ˜ƒ

tame stream
#

๐Ÿค”

warm spade
#

While {true} do {

    _action = _unit addaction ["Action", {go = 1; execVM "script.sqf"}];

    waituntil {go == 1};
    _unit removeAction _action;
    sleep 30;
    go = 0;


};``` this should work
tame stream
#

checking

#

does it replace my current addaction command in init

#

getting generic error in expresion

halcyon crypt
#
_factory addAction [
    "some title", // title
    {             // code / script
        (_this select 0) setVariable ["last_time_action_used", diag_tickTime, true];
    },
    nil,          // arguments
    1.5,          // priority
    true,         // showWindow
    true,         // hideOnUse
    "",           // shortcut
    "(diag_tickTime - (_target getVariable ['last_time_action_used', 0])) >= 30", // condition
    15,           // radius
    false,        // unconscious
    ""            // selection
];
#

as an example

#

if you use a script instead of a code block then put the setVariable thingy in that script

tame stream
#

im currently calling it as follows...

_act = this addAction ["Produce Fuel", "scripts\Fuel1.sqf"];```
#

script simply spawn feul barrels on marker

halcyon crypt
#
_act = this addAction [
    "Produce Fuel", // title
    "scripts\Fuel1.sqf",
    nil,          // arguments
    1.5,          // priority
    true,         // showWindow
    true,         // hideOnUse
    "",           // shortcut
    "(diag_tickTime - (_target getVariable ['last_time_action_used', 0])) >= 30", // condition
    15,           // radius
    false,        // unconscious
    ""            // selection
];
tame stream
#

obviously its just added to random item

warm spade
#

nevermind, mine doesn't work as promised, since you need for every addaction a new script. I recommend using marcel's version.

halcyon crypt
#

and add (_this select 0) setVariable ["last_time_action_used", diag_tickTime, true]; to the Fuel1.sqf

#

all the other values are just the defaults for addAction ๐Ÿ˜ƒ

tame stream
#
_act = this addAction [
 "Produce Fuel", 
    "scripts\Fuel1.sqf",
    nil,
    1.5,
    true,
    true,
    "",
"(diag_tickTime - (_target getVariable ['last_time_action_used', 0])) >= 30",
    15,
    false,
    ""
];```
more like this i suppose

```css
_act = this addAction [ "Produce Fuel",  "scripts\Fuel1.sqf",  nil,  1.5,   true,   true,  "", "(diag_tickTime - (_target getVariable ['last_time_action_used', 0])) >= 30",   15,   false,   ""];
#

and in my fuel1.sqf

(_this select 0) setVariable ["last_time_action_used", diag_tickTime, true];
_veh = "CargoNet_01_barrels_F" createVehicle getMarkerPos "barrela1";
sleep 5;
_veh = "CargoNet_01_barrels_F" createVehicle getMarkerPos "barrela2";
sleep 5;
_veh = "CargoNet_01_barrels_F" createVehicle getMarkerPos "barrela3";
;
#

if i understand correctly

halcyon crypt
#

yeah probably

tame stream
#

ill give it a test

halcyon crypt
#

not sure what you changed in the above but if it works it works ๐Ÿ˜„

tame stream
#

simply removed to comments

halcyon crypt
#

ah

still forum
#

Why is the syntax highlighting so weird

indigo snow
#

You cant inline comment like that

tame stream
#
this ```

instead of 
```this```
?
indigo snow
#

If its in a line you need /* comment */

still forum
#

what languague are you using for the highlighting?

halcyon crypt
#

ah cool @indigo snow didn't know that. They were just there for clarity though. ๐Ÿ˜ƒ

indigo snow
#

Yea just thought id clarify why since copy paste is so common in here

halcyon crypt
#

fucking SQF ๐Ÿฅ€

indigo snow
#

Good solution with the ticktime btw

halcyon crypt
#

๐Ÿ˜ƒ

tame stream
#
_act = this addAction [ "Produce Fuel",  "scripts\Fuel1.sqf",  nil,  1.5,   true,   true,  "", "(diag_tickTime - (_target getVariable ['last_time_action_used', 0])) >= 30",   15,   false,   ""];```

works like a BOSS

@halcyon crypt thx my man ๐Ÿ‘๐Ÿผ ๐Ÿ˜Ž
halcyon crypt
#

nice ๐Ÿ˜

still forum
#

@tame stream
```sqf
<code>
```

halcyon crypt
#

wonder what language does this weird stuff with the brackets ๐Ÿ˜›

still forum
#

css

halcyon crypt
#

heh weird well not weird but yeah ^^

little eagle
#

Can you use macros in discord like IRC? Explaining how to make SQF code boxes would deserve one...

#

!help

#

/help

#

๐Ÿ˜ฆ

still forum
#

You can make the same macros that you can with a Console window as IRC client

#

Which is.. Your keyboard software if you have macro keys

little eagle
#

I mean shorthands. Like how in the BWA3 Slack I can type !pr and it opens the gitlab pull request page for that mod.

halcyon crypt
#

it would probably involve a bot

#

so create a bot and let it join this discord ^^

little eagle
#

Yeah, that might be it.

halcyon crypt
#

!bet ct all

#

๐Ÿ˜›

little eagle
#

I'll bind it to some keycombo I guess.

nocturne basalt
#

hi guys. I'm using this "1 man tank" script which allows me to control the turret of a tank while driving it. I'm getting this bug that accumulates the "Get out" user action every time I enter and exit the vehicle. If I enter and exit a few times this happens.
"Get out"
"Get out"
"Get out"

#

This is the script I'm using:

private ["_v", "_laser"];
_v = _this select 0;

_v call {
    if (isServer) then {
        _this lockCargo true;
        _this addMPEventHandler ["MPKilled", {
            if (isServer) then {
                _d = driver (_this select 0);
                _g = gunner (_this select 0);
                if (!isNull _d) then {deleteVehicle _d};
                if (!isNull _g) then {_g setDamage 1};
            };
        }];
    };
    if (!isDedicated) then {
        _this addEventHandler ["GetIn", {
            _tank = _this select 0;
            _unit = _this select 2;

            if (vehicle player != _tank) exitwith {};
            _unit allowDamage false;

            _unit action ["EngineOn", _tank];
            _unit action ["MoveToGunner", _tank];

            _tank addAction [localize "str_action_getout", {
                (_this select 0) removeAction (_this select 2);
                (_this select 1) action ["GetOut", (_this select 0)];
            }, "", 3, false, true, "GetOver"];

            _tank spawn {
                waitUntil {!isNull gunner _this};
                _ai = createAgent [typeOf gunner _this, [0,0,0], [], 0, "NONE"];
                _ai allowDamage false;
                _ai moveInDriver _this;
                waitUntil {!isPlayer driver _this; !isNull gunner _this; };
            
                _this lock true;
                enableSentences false;
            };
        }];
        _this addEventHandler ["GetOut", {
            _tank = _this select 0;
            _unit = _this select 2;
            _unit allowDamage true;
            deleteVehicle driver _tank;
            _unit action ["EngineOff", _tank];
            _tank lock false;
        }];
    };
};
#

can anybody immediately see were the problem is?

still forum
#

Yes. You are never removing the getOut action.

nocturne basalt
#

(_this select 0) removeAction (_this select 2);

#

?

still forum
#

Oh yeah... Please use
```sqf
<code>
```
Makes it far easier to read

#

and use params. also makes it easier to read

#

You only have that one getOut action? What happened to the default getOut action?

nocturne basalt
#

dunno.. I found this script. Didnt write it myself. I don't know too much about sqf scripting. basic stuff really

still forum
#

My thought is that you already have a "Get Out" action by default. If you use that instead of the one you added then yours won't be removed

nocturne basalt
#

so you're saying I should just remove this?
(_this select 0) removeAction (_this select 2);

#

no sry. this I mean
(_this select 1) action ["GetOut", (_this select 0)];

still forum
#
if (!_tank getVariable ["hasGetOut",false]) then {
            _tank addAction [localize "str_action_getout", {
                (_this select 0) removeAction (_this select 2);
                (_this select 1) action ["GetOut", (_this select 0)];
            }, "", 3, false, true, "GetOver"];
_tank setVariable ["hasGetOut",true];
};

#

this will prevent your action from getting added multiple times

nocturne basalt
#

thanks alot @still forum I'll try it

halcyon crypt
#

you can only "GetOut" once with that though

nocturne basalt
#

oh?

halcyon crypt
#

since the removeAction is still there ๐Ÿ˜›

#

and the hasGetOut doesn't get reset

still forum
#

But the removeAction doesn't work

#

apparently

halcyon crypt
#

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

nocturne basalt
#

@still forum didnt work :\

#

what about this?
_this addEventHandler ["GetOut", {
_tank = _this select 0;
_unit = _this select 2;
_unit allowDamage true;
deleteVehicle driver _tank;
_unit action ["EngineOff", _tank];
_tank lock false;
}];

#

this is just what happens to the tank when getting out isnt it?

still forum
#

yes

indigo snow
#

Ah, does that trigger when you get moved out by script tho

still forum
#

That doesn't make sense though. How does the action get added if my variable is set to true.

#

that doesn't matter though. as it does nothing to the action

indigo snow
#

Try adding some letters to it so its different from the engine one, what if its the engine one thats multiplying?

nocturne basalt
#

@still forum I was actually packing it in the wrong place lol. but when I tried your code

if (!_tank getVariable ["hasGetOut",false]) then {
            _tank addAction [localize "str_action_getout", {
                (_this select 0) removeAction (_this select 2);
                (_this select 1) action ["GetOut", (_this select 0)];
            }, "", 3, false, true, "GetOver"];
_tank setVariable ["hasGetOut",true];
};
#

I get this error

still forum
#

if (!_tank getVariable ["hasGetOut",false]) then { -> if (!(_tank getVariable ["hasGetOut",false])) then {

nocturne basalt
#

ah I c

#

hang on

still forum
#

I find it weird to have the ! outside of the if condition

#

But I'm also doing that alot myself

nocturne basalt
#

now it worked, but I can only exit the vehicle once

#

Once I enter it again, I can never get out

#

it is 2 when Im in

#

and 1 when out

#

never 0

#

should this be (_this select 0) removeAction (_this select 1);
instead of
(_this select 0) removeAction (_this select 2);

#

?

#

I'm a little closer now. now I always have a "Get out" action when standing by the vehicle. both when inside and out

#

but it dont accumulate

polar folio
#

do you guys think publicVariable of a number every second is too much?

still forum
#

guess not.

dusk sage
#

I think the question should be do you guys think publicVariable of a number every second could be done a better way?

polar folio
#

just wondering because i have a time limit that i sync and last test certain players had and caused desync but others were totally fine.

#

yes BoGuu you are right. it's a bit of a lazy solution atm

still forum
#

a single number every second definetly won't cause desync

polar folio
#

already changing it but i was wondering how touchy force syncing like that is. i mean ideally i wanna make code that potentially works well no matter the number of players

dusk sage
#

If the time is just ticking down as normal, you can avoid pvar'ing it every second

polar folio
#

yer that would be my next question

#

isn't there still stuff happening that might desync mission time?

#

or is it totally tied to system time?

still forum
#

can always happen

#

use diag_tickTime. That is totally tied to systemTime

polar folio
#

ah k. i just have a mission time limit bleeding down. so doing sync every 10 seconds should be enough to keep all synced

warm gorge
#

Im having trouble understanding bounding boxes. How would I use them to get an offset position from another position utilising the objects bounding box to avoid getting a colliding position?

subtle ore
#

boundingBoxReal ?

still forum
#

if distance to bounding box on second object on x and y axis is bigger than respective bounding box side on first object/2 then they don't collide

#

|-----x-----| |------x------|
| being the bounding box
x being model center

#

use math

warm gorge
#

Yeah im horrible when it comes to maths haha. But I understand what you mean, wasnt sure how to go about it. Cheers

halcyon crypt
#

collision detection is one of the most asked and written about subject in game development ๐Ÿ˜›

#

I'm sure you can find something

icy raft
#

You'll need math for game development

abstract shuttle
#

Somebody knows how to play a custom .ogg video-file on an ingame billboard or on a usertexture eg?

indigo snow
#

you should try looking at the functions added with the APEX expansion

abstract shuttle
#

@indigo snow Is this answer to me? ๐Ÿ˜„ If yes, thak you for your fast reply

indigo snow
#

yes

still forum
#

@abstract shuttle ogv not ogg. ogg is audio

abstract shuttle
#

True ๐Ÿ˜„ Thanks for the last link! That is what I was searching for. +1

indigo snow
#

You could still handle that with a CBA PFH.

#

But 4-5 loops likely wont be too many either way

still forum
#

@hasty violet CBA PFH sorts the handlers. No it won't have a big effect having lots of handlers that execute on bigger intervals

#

PFH also has a scheduler though. @tough abyss

queen cargo
#
                case "define":
                    break;
                case "include":
                    break;
                case "ifdef":
                    break;
                case "ifndef":
                    break;
                case "else":
                    break;
                case "undef":
                    break;
                case "endif":
                    break;```
#

anything i forgot in regards of preprocessing commandS?

little eagle
#

It's #undef and not #undefine.

#

__EVAL, __EXEC, __FILE__ and __LINE__.

queen cargo
#

check, the latter are macros though?
or are you actually able to write #__EVAL etc.?

little eagle
#

They are preprocessor commands, but without #.

#

"Config parser macros"

#

"keywords"

queen cargo
#

so just the predefined and not undef'able as specialized macros

little eagle
#

I never tried to undef them, but I doubt that would work.

still forum
#

@queen cargo #line
__EVAL, __EXEC, __FILE__ and __LINE__. Are more Macros not Preprocessor commands

still forum
#

I think that was some bug that came up recently

tardy yacht
#

Would a for loop nested in a forEach do anything to the forEach's _x ?

indigo snow
#

No, unless you use _x for your for loop instead of the common _i

tardy yacht
#

Alright, thanks!

#

But somehow, _x here is nothing.


_num = "";
{
    for [{_i = 0}, {_i < 5}, {_i = _i + 1}] do {
        _x = _x + (str floor(random(10)));
    };
} forEach [_num];
#

From what I've read, _x should be a reference to _num here.

#

hint _num returns absolutely nothing. Not even "".

#

Might it be that _x lost its reference when moving to the for loop?

#

It's got nothing to do with the latter. Is _x still a reference to its original like in Arma 2?

still forum
#

Should work from what I can see.

#

Can you show how you really wanna use that? Your code is useless

little eagle
#

Yeah, this code does nothing.

#

_x doesn't exist in the scripts main scope, only in the forEach-block scope. And it can't leave to the main scope anyway, because as a magical variable, it's set to private to the forEach-block.

#

And _num is never changed.

tardy yacht
#

I'm having trouble understanding what you mean. Are you saying _x is undefined in the for loop? Shouldn't _x be a reference to _num when used in the for loop?

#

One wiki entry on forEach talks about _x being a reference of its original (_num in my case), assigning a new value to _x should assign it to _num from what I understand.

#

The entry is from 2010 though, which means it was from Arma 2. But I might be using forEach wrong anyway.

little eagle
#

_x is undefined in the main scope. The most outer part of the script.

still forum
#

there are no string references. You can only have references to arrays

little eagle
#

_x is not a reference to _num. It just has the same value. Only ARRAY's are passed as reference.

still forum
#
_num = [""];
{
    for [{_i = 0}, {_i < 5}, {_i = _i + 1}] do {
        _x set [0, (_x select 0) + (str floor(random(10)))];
    };
} forEach [_num];
_num = _num select 0;
little eagle
#

Assigning a new value would stop making it a reference, even if it was an ARRAY.

#

And nothing changed in that regard since A2.

#
private _num = "";
for "_i" from 1 to 5 do {
    _num = _num + str floor random 10;
};
#

Now for the commy version:

#
private _num = random 1 toFixed 5 select [2];
tardy yacht
#

I'm new here what's the commy version?

little eagle
#

It's when I turn your script into a one liner.

tardy yacht
#

jeez

#

I'll send you my mission file, impress me.

little eagle
#

I posted it already

still forum
#

here is my commy version:

private _num = "";for "_i" from 1 to 5 do {_num = _num + str floor random 10;};
#

tadaa

little eagle
#

You cheated.

#

And mine is still a shorter one liner.

still forum
#

Better Idea!

private _num = "12345";
little eagle
#

That is no longer random.

still forum
#

It was random once though

tardy yacht
#

I'm struggling to understand your one liner. I mean it works, but I wish I could understand it.

#

Oh

#

shit

#

I just got that

#

Only thing I can't understand is the select [2]

still forum
#

generate a random number between 0 and 1..
0.1242357345358345 then convert it to string with 5 precision "0.12423" then cut off first 2 letters "12423"

tardy yacht
#

oh

still forum
#

STRING select [offset,length]

tardy yacht
#

that's what select [2] does

#

Thanks guys that'll be helpful

tough abyss
#

Can someone explain __EXEC and __EVAL in layman's terms?

indigo snow
#

Theyre for advanced config magic

#

Not really laymans tools

still forum
#

In layman's terms: "Doesn't exist"

distant egret
#

Anyone knows as to why endMission only works once. I got a mission where people get booted back to the lobby if there not enough players on for that slot. And it seems to only happen once (on mission start). But after that they don't get "kicked" by endMission. (if they rejoin in that slot or any other slot that should end their mission.) And if I try to execVM my script via debug console it "kicks" me.

#

I diag_log'd the whole path and it all runs correct, but endMission is just not doing its thing...

#

same behaviour with BIS_fnc_endMission.

#

Adding a sleep of 2 seems to have fixed it. looks like the endMission was done too soon.

mortal halo
#

im trying to spawn a dead unit

#

im spawning it as vehicle to reduce performance impact (im willing to spawn alot of those)

#

but i dont want the animation to be visible (the unit needs to seem dead)

#

is there any way to do it? the most i could achieve was to set damage and hide, then unhide

#

but the ragdol dont always finish at the specific time interval between the hiding and unhiding.

#

has anyone an idea how to approach this, perhaps on a different way?

#

found a solution for the approach i've taken, which is to wait until velocity is [0,0,0]

digital pulsar
distant egret
#

@digital pulsar it's only to kick a single client.

#

That ends the mission for everyone

digital pulsar
#

force respawn then?

distant egret
#

That will just respawn them?

digital pulsar
#

well depends on respawn settings

distant egret
#

It's for a locked player slot. I don't want everyone to get into it.

#

But a 2 sec delay seems to have fixed it so ๐Ÿ˜›

#

So if someone gets in the slot that shouldn't he gets brought back to the lobby because his mission is ended.

digital pulsar
#

cool

distant egret
#

It worked fine back in the day so I think they might have changed some stuff. but all works again.

tardy yacht
#

Dedmen you asked me earlier how I was using the snippet I posted, I'll answer with another question if you don't mind. It's supposed to generate a phone number for the player and then save it in the database. Now my question is, I have to check every time a number is generated for its existence in the database. Every player has 3 numbers (1 for every faction). Should I make a DB call every time I generate a number like this:

_nums = [];
for [{_i = 0}, {_i < 3}, {_i = _i +1}] do {
    _num = random 1 toFixed 5 select [2];
    _query = "SELECT COUNT(*) FROM cellphones WHERE civ_nid = _num OR cop_nid = _num OR med_nid  = _num"
    if (_query isEqualTo 0) then { _num pushBack _nums }
    else { _i = _i - 1};
};

INSERT CODE
#

Most of the code here doesn't make any sense and wouldn't work, it's mainly to show you what I mean.

vivid quartz
#
{
   if (!(EQUAL(name _x, name player)) && !(EQUAL(vehicle _x, _x))) then {
        findDisplay 12 displayCtrl 51 ctrlAddEventHandler    
        [    
            "Draw",     
            format ["_this select 0 drawIcon     
            [      
                getText (configFile >> 'CfgVehicles' >> %1 >> 'Icon'),     
                [0,1,0,1],      
                %2,      
                24,     
                24,      
                %3,      
                %4,      
                1,      
                0.03,      
                'TahomaB',      
                'right'     
            ]", str(typeOf vehicle _x), getPos vehicle _x, getDir vehicle _x, ,str(name _x)]   
        ];  
   };
}forEach playableUnits;

any way to make this work? this is just an example of what i want, i need to remake it so position and dir updates. This only draws static icon because position is same from time it was called because of format. I want to cycle it through every playable unit.

still forum
#

@tardy yacht Just make a custom stored procedure that takes care of all that on the DB side and only returns the phone number to you.

digital pulsar
#

exel, why not iterate inside of event handler?

#

you won't need format

vivid quartz
#

youre right, gonna try, thanks

little eagle
#

@tough abyss __EXEC and __EVAL can only be used in config. They allow for SQF expressions that are evaluated when the unbinned config is parsed at game start. They are not very useful generally imo.

indigo snow
little eagle
#

ugly

__EVAL(format ['\x\tmf\addons\common\ui\loadscreens\%1.jpg', floor random 10 + 1]);
indigo snow
#

Ye could be better

#

Also ceil, I guess

little eagle
#

ceil random 11 could result in 11 technically, so ...

#

And ceil random 10 can result in 0.

tough abyss
#

Whenever I learn something new about configs I immediately start thinking "can I use this for dynamic #includes?".

nova belfry
#

Hey, guys. How can you convert uid in guid?

peak plover
#

Does drawTriangle work with inArea?

queen cargo
#

there is no real guid @nova belfry