#arma3_scripting

1 messages · Page 496 of 1

tough abyss
#

@fossil yew correct

waxen tide
#

but M242 you could just put the code from the if then into the exitwith

tough abyss
#

You can

waxen tide
#

the actual code i wrote makes more sense

{
    private _abort = false;
    if (!(_x in _deduplicate)) then // if we already checked this road for a safepos, skip it.
    {
        private _pos = [(getpos _x), 0, 1, _size, 0, 0.3, 0] call BIS_fnc_findSafePos;
        if ((count _pos) isEqualto 2) exitWith {_spawn_positions pushBack _pos;_abort = true};
        private _mkr = [(getpos _x),"hd_dot","ColorOrange","findSafePos"] call ADMM_fnc_spawn_debug_marker;
        _debugmarkers pushBack _mkr;
        _deduplicate pushBack _x;
    };
    if (_abort) exitWith {}; // abort once we find a suitable pos on path
} forEach _path;     // check if road is empty enough for roadblock
tough abyss
#

Doesn’t make it weird though if you don’t

waxen tide
#

¯_(ツ)_/¯

#

there should be an

if ( ) exitexitwith {};

that exits 2 scopes at once. i'm genius i know.

earnest ore
tough abyss
#

You can mark scope with scopeName "whatever" and use <returnvalue> breakOut "whatever" from anywhere, poor man’s return

waxen tide
#

oh, nice. didn't know.

earnest ore
#

Feels like a dirty goto.

waxen tide
#

ahhh the fond memories of goto riddled qbasic code 20 years ago ...

tough abyss
#

You cannot carry value around with you with goto

#

gosub @waxen tide

real tartan
#

is there a script way to check if user have squad xml set in profile ?

#

squadParams ?

winter rose
#

:+1:

still forum
#

@waxen tide that loop should be a findIf

unborn ether
#

Wow, you cant do createVehicle in preInit in some cases because it fails to find CfgVehicles class?

#

Is that normal behavior?

#

Says You can't play this mission..

tough abyss
#

Impossible

young current
#

Has anyone recently messed around with assigning different functionality to mouse buttons and if its still very limited? As in rightmouse defaults to scope no matter what and so on?

unborn ether
#

@tough abyss No jokes, I just attempted to createVehicle in preInited funciton and it said me so I don't have that "content"

tough abyss
#

Mod?

unborn ether
#

Yes that createVehicle is instigated from preInit function of a server for a vehicle from a -mod.

#

Mod is read, initialized and is working, tried the same code in postInit = everything is fine.

#

🤔 It happens that -mod vehicles are compiled later than preInit?

cedar kindle
#

you shouldn’t createVehicle in preInit

unborn ether
#

Yeah I get that now 😄

brave jungle
#

Is there a simple way to smoothly move a resource from the centre to the bottom right corner?

tough abyss
#

ctrlSetPosition ctrlCommit

brave jungle
#

Cheers

shadow sapphire
#

How would I be able to check a spawned object's owner with my debug console?

tough abyss
#

Current owner or creator?

shadow sapphire
#

Either. Both!

unborn ether
#

@shadow sapphire netID gives original owner, owner gives current owner.

shadow sapphire
#

They are script spawned and don't have global variable names.

#

@unborn ether, thanks, searching now.

#

Oh! I don't know how to use them in commands, is the problem.

#

I know owner exists, but I have trouble with syntax interpretation...

unborn ether
#
netID cursorObject // looking at the vehicle
owner _vehiclereference // server execution
shadow sapphire
#

Oh.... OH! I think I get it.

#

Drats, haha, you beat me to it. I wanted to try it on my own.

carmine abyss
#

Hi question. Trying to optimize some code. I have 4 marker names bPS1 bPS2 bPS3 bPS4 and I have 4 players named bP1 bP2 bP3 bP4. I am thinking of a forEach command that setPos each player to each marker. Anyone have a clue or a hint on how to code this?

#

this is what I have so far ```sqf
private _bluforPlayerSpawnArray = [(getMarkerPos "bP1S"), (getMarkerPos "bP2S"), (getMarkerPos "bP3S"), (getMarkerPos "bP4S")];
private _blueforPlayersArray = [bp1, bp2, bp3, bp4];

ruby breach
#

setPos each player to each marker So Player 1 to Marker 1, 2 to 2, etc?

carmine abyss
#

something like ```sqf
{_x setPos _bluforPlayerSpawnArray} forEach _bluforPlayersArray;

#

yes sir

ruby breach
#
{
    _x params ["_unit","_marker"];
    _unit setPos (getMarkerPos _marker);
} forEach [[bP1,"bPS1"],[bP2,"bPS2"],[bP3,"bPS3"],[bP4,"bPS4"]];
carmine abyss
#

aaaaaaaaaa makes sense

ruby breach
#

Lets you pair a unit to a marker in any combination you wish

carmine abyss
#

thank you gnashes makes sense now that you typed it

ruby breach
#

np

carmine abyss
#

does that code need to be called? or can it run just like that?

ruby breach
#

As long as those units and markers exist at runtime, that can be executed anywhere and it should work.

carmine abyss
#

so code doesnt have to be stored in a variable and called to run? it can be put in just like that?

winter rose
#

yup, storing code in variable is itself code

carmine abyss
#

awesome thank you

carmine abyss
#
player setVariable ["nowInGame", false];
publicVariableServer "nowInGame";
``` Is this the proper way to announce this variable to the server only?
tough abyss
#

No

still forum
#

Yes....

#

What other way would there be?

tough abyss
#

No

still forum
#

I think you can use ownerID as last param of setVariable but...

#

Oh wait I see

#

Yes. Do that what I said in 2 senteces above

tough abyss
#

Doesn’t make the question code right

still forum
tough abyss
#

@still forum makes too much sense

waxen tide
#
 4:58:17   Error 44021176 elements provided, 1784219632 expected

🤔

still forum
#

you tried to append an array to itself?

waxen tide
#

i'm still trying to figure out what i tried.

#

oh i tried to push an array into itself with pushback.

#

poor choice of var names 😐

waxen tide
#

using a 4mb array is blazing fast, i didn't expect that.

waxen tide
#
private _classname_list = (missionConfigFile >> "CfgCompositions" >> ADMM_enemy_compositions >> "building_extensions") call BIS_fnc_getCfgSubClasses; // [""Land_Unfinished_Building_01_F"",""Land_Unfinished_Building_02_F""]

Are the double quotation marks intentional?

#
private _configs = "true" configClasses (missionConfigFile >> "CfgCompositions" >> ADMM_enemy_compositions >> "building_extensions");
// [C:\Users\jcd\Documents\Arma 3\mpmissions\ADMM5.Deniland\description.ext/CfgCompositions/rhs_rus/building_extensions/Land_Unfinished_Building_01_F,C:\Users\jcd\Documents\Arma 3\mpmissions\ADMM5.Deniland\description.ext/CfgCompositions/rhs_rus/building_extensions/Land_Unfinished_Building_02_F]
wary vine
#

is there a way i can create a marker with custom icon without needing an addon ?

tough abyss
#

You can drawIcon, that’s about it

waxen tide
#

If i just want to have the config class itself, like what BIS_fnc_getCfgSubClasses provides, what do i need to filter for with configClasses?

#

I've read the wiki but i don't quite get it.

#
C:\Users\jcd\Documents\Arma 3\mpmissions\ADMM5.Deniland\description.ext/CfgCompositions/rhs_rus/building_extensions/Land_Unfinished_Building_01_F

to this

Land_Unfinished_Building_01_F
tough abyss
#

configName

waxen tide
#

oh yeah now i see. thanks!

wary vine
#

❤ @tough abyss

wary vine
#

next thing, is there a way of scaling the rotation with ctrlMapscale ?

waxen tide
#

🤔 And how do i get subclasses without BIS_fnc_getCfgSubClasses ?

#

yeah ok crawled thru the BIS_fnc nonsense and it's just

_comps = "true" configClasses (_x) apply {configName _x};
tough abyss
#

How do you scale rotation?

wary vine
#

@tough abyss as i was zooming in the rotation was moving quicker xD

tough abyss
#

How go you rotate it?

unborn ether
#

yeah ok crawled thru the BIS_fnc nonsense and it's just im reading like ...crawled thru BIS_fnc_nonsense

#

Just caught myself on thought that BIS_fnc_nonsense was a pretty logical for the first time.

waxen tide
#

what else do you call 28 lines of comment header and 1 line of actual f***** code

#

which btw then calls another BIS_fnc which is like 80 lines from which we use actually 1 line which is an if exitwith ...

tough abyss
#

Pretty sure this one line is the result of optimisation due to some new engine commands and prior to that it had many lines with awful performance

#

Haters gonna hate

waxen tide
#

not hatin

#

just not usin

#

i looked into the first BIS_fnc and realised it calls a second BIS_fnc and when i tracked down the actual code from both that is being executed i realised it's just "true" configClasses (_x) apply {configName _x} so why not use that directly for more clarity.

wary vine
#

@tough abyss i didn't in the end xD

dim terrace
#

that function was probably left for compatibility reasons

wary vine
#

i was using the angle part of drawIcon

dim terrace
#

as M242 mentioned, most likely it was bit more complicated code before new native script command appeared

tough abyss
#

“This function is bad, because the amount of comments in header exceeds the amount of code” this is pretty fucked up statement by any means

waxen tide
#

yeah, i didn't give that much thought. breaking compatibility would be bad.

tough abyss
#

But how do you rotate it? @wary vine

wary vine
#

angle = angle + 1

#

also tried angle = angle + ctrlmapscale

tough abyss
#

Each frame?

#

You make it dependent on FPS of the Draw, if it changes speed of rotation changes.

wary vine
#

it was only changing for me when i zoomed in

tough abyss
#

You need to hook the delta angle to time accordingly if you want constant rotation with any FPS

wary vine
#

i just used a map marker for the rotating one in the end

#

the one he wanted rotating was a cfgmarker

tough abyss
#

When you zoom in out FPS changes

waxen tide
#

the lengthy headers with 9001 different usecases are bad because they have nothing to do with what i need. if i later review the code, wonder what it does, i'll read 2 lengthy headers again, try to understand them, and then figure out which of the 4 if cases in the function actually equals true so i can figure out which single line of code is finally executed. no thank you. i'll rather just use the 1 line of code directly for more clarity.

tough abyss
#

FPS of the Draw could change regardless of map scale

wary vine
#
{
    [_x] call lega_fnc_spawnselection_addEntry;
} forEach (("true" configClasses (missionConfigFile >> "CfgSpawnPoints" >> worldName >> ([] call lega_fnc_spawnselection_getSide))) select {
    ((getText (_x >> "conditions")) isEqualTo "") || {(call compile (getText (_x >> "conditions")))}
});
``` anyone see anything up with this, it works in game when i test it, but when i use it inside the function it returns ```11:12:09 File lega_spawnselection\functions\init.sqf, line 12
11:15:18 Error in expression <call lega_fnc_spawnselection_getSide))) select {
((getText (_x >> "conditions"))>
11:15:18   Error position: <select {
((getText (_x >> "conditions"))>
11:15:18   Error select: Type code, expected Array,String,Config entry
11:15:18 File lega_spawnselection\functions\init.sqf, line 12
11:15:18 Error in expression <call lega_fnc_spawnselection_getSide))) select {
((getText (_x >> "conditions"))>
11:15:18   Error position: <select {
((getText (_x >> "conditions"))>
11:15:18   Error Generic error in expression
11:15:18 File lega_spawnselection\functions\init.sqf, line 12```
#
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/Athira
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/Pyrgos
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/Sofia
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/RebelN
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/RebelS
11:18:01 mpmissions\__CUR_MP.Altis\description.ext/CfgSpawnPoints/Altis/Civilian/RebelE
``` but it returns that if i diag_log it
frigid raven
#

Hi - I like everyone here

wary vine
frigid raven
#

sorry did not saw that one

still forum
#

@waxen tide Are the double quotation marks intentional? yes. Stringified strings need double double quotes.

unborn ether
#

Or u can use ' "" ' or " '' "

thick slate
#

Hey all, trying to work into a trigger getting an AI to spawn inside a building in a designated area.

this is what I have now, but I think it's just spawning him somewhere on the map so I'm not certain if it's working at all.. lol.

this createUnit ["LOP_CHR_Civ_SchoolTeacher", (_nearestBuilding buildingPos 1), [], 0, "NONE"];

still forum
#

this createUnit what is this?

thick slate
#

The trigger? I guess that's incorrect then. Sorry I'm fairly new to this ha.

still forum
thick slate
#

So this wouldn't work if I didn't want this unit to be a part of a pre-existing group?

still forum
#

I think you can pass grpNull as gorup

thick slate
#

I'll give that a shot.

tough abyss
#

Group null will just reject unit creation

still forum
#

"The Group parameter MUST be an existing group or the unit won't be created. " reading helps

tough abyss
#

Unit has to be in a group unless you create an agent

tough abyss
#

How would you give a unit more health with ACE?

still forum
#

Let him wear armor. A good vest and a helmet.

digital jacinth
#

Another thing is to boost the player damage threshold on that clients machine. But that would introduce other problems.

tough abyss
#

how would I do that @digital jacinth

#

I could just remoteexec whatever you are thinking and have it applied globally

digital jacinth
#

No need for that it is the player damage threshold you St in the cba add on options

#

It is just a variable nothing else

tough abyss
#

I just need it for one player

#

Not everyone

unborn ether
#

HandleDamage Event Handler will help.

tough abyss
#

I've tried that, it doesn't work with the ace damage system very nicely

unborn ether
#

Also ACE uses one, so you might want to modify it.

digital jacinth
#

Okay, find out what the name is of that variable., ou will be about to see the name if you hover over the option. Just increase the value for the client you want.

#

If you want to change the damage eh for ace I recommend removing the existing and apply it again with your modified one

tough abyss
#

ight

still forum
#

give discord a minute to embed that

tough abyss
#

How do you manually set it? Not really familiar

digital jacinth
#

Thanks @still forum ,iam on mobile right now and cannot look it up properly

still forum
#

it took me 7 minutes to open arma and get to that setting

tough abyss
#

Do I just put ace_medical_playerDamagethreshold = (number I want); in the unit's init?

still forum
#

no.

digital jacinth
#

No

still forum
#

It's a global setting

#

and it applies to all units on that machine

tough abyss
#

Well then that's not even what I'm asking

still forum
#

not a specific one

digital jacinth
#

It is, as that variable is only used for players. If you remoteexec a new value for it to that client they will have a different damage threshold than others

tough abyss
#

That's what I'm trying for yo

#

I need one unit to be stronger than the other players

still forum
#

what does "unit" mean?

#

A specific player?

tough abyss
#

yes

digital jacinth
#

Do you hsv access to init player local?

still forum
#

Ah yeah. You can use that variable for that then and set it just on that player

tough abyss
#

what variable? the ace thing you showed me?

still forum
#

yes

digital jacinth
#

Yes

tough abyss
#

so how would I do that for an individual player?

digital jacinth
#

Init player local, make a condition that only applies to that slot you want to boost

#

E. G. Check for unit type, slot description, player uid etc.

tough abyss
#

Okay and then what do I put

#

ace_medical_playerDamagethreshold = (number I want); ???

#

or how do I set it specifically there?

still forum
#

you need to set it after the settings are initialized otherwise they'll overwrite it again

#

And yes. You essentially do that

tough abyss
#

Ok so I make a delayed script that will run after they load in

#

And this script will be launched in initPlayerLocal, correct?

still forum
#

yeah

tough abyss
#

thanks

#

Jason Vorhees needs to be overpowered 😉

digital jacinth
#

Kinda late for haloowee huh?

tough abyss
#

We play on Fridays

#

So it's the closest I can get

carmine abyss
#

Question. I have a client run this sqf {_x setVariable ["nowInGame", true]} forEach allPlayers; publicVariableServer "nowInGame"; at the beginning of a script and this at the end... sqf {_x setVariable ["resetDone", true]} forEach allPlayers; publicVariableServer "resetDone"; For some reason when the server checks for this it only finds the first one but not the second. Anyone know why this is?

still forum
#

People told you yesterday that publicVariableServer "nowInGame"; won't work

tough abyss
#

🤦

still forum
#

publicVariable sends a variable from missionNamespace over

#

you set the variable on a player object

#

look at the wiki page for setVariable. I think you can make it send vars only to server

tough abyss
#

Biki is hard

carmine abyss
#

I didnt see it yesterday. SOrry.

wide hamlet
#

when using EH, do the params listed on the wiki pass using _this?

high marsh
#

@wide hamlet
_this is an array of whatever variables the EH returns, obviously in the context of the code used inside an EH

wide hamlet
#

Ok. so here is where i am at. i cannot say for sure because i am using debug console to test, but the code i am trying to run is ran on me versus the driver of the vehicle.

high marsh
#

Ok, post it

wide hamlet
#

ye sec

#
_obj1 = objectFromNetId _obj;
_ind = _obj1 addEventHandler ["GetIn",  {_this spawn {
for "_i" from 0 to 5 do { 
["Test",-1,-1,0.5,1] spawn bis_fnc_dynamictext; 
sleep 0.5;
};
};
}
];
systemChat str _ind;```
#

"test" flashed on my screen, not the player that got in. I do plan on making this into a seperate client sided fnc so it looks cleaner, but for my purposes im just trying to get the text to show to the driver and/or passengers

still forum
#

you need to learn what "indentation" is.

wide hamlet
#

its debug console lol. infi doesnt let me tab D: ill format it nice rn sec

carmine abyss
#

@still forum publicVariableServer sends vars only to server

still forum
#

And you are telling me that because...?

#

@wide hamlet the event only fires where you add it

carmine abyss
#

You said "I think you can make it send vars only to a server"

wide hamlet
#

how do you mean?

still forum
#

If you add the EH on your own machine. It will fire on your machine

#

If you don't add it on other machines. It won't fire there

wide hamlet
#

so i only want it to fire on the server. Then have some sort of fnc call a mission sided fnc to only display the text to the driver/passengers?

#

that seems like it makes sense to me, just double checking lol

still forum
#

you could do that yeah

#

you could also add it everywhere. And add a _unit==player check

wide hamlet
#

well that wouldnt work for other EH that dont contain that specific param right?

#

for those that dont ig i could just do _veh = _this select 0; _driver = driver _veh; _driver ==player; maybe

still forum
#

only if you get in as driver

#

and I don't know if you already are driver when GetIn fires

#

But why do you get the vehicle?

#

why don't you directly take the unit. Like I recommended

wide hamlet
#

im just saying for other EH that dont contain _unit

still forum
#

Well other EH do completely different things

#

So you probably don't want to do the exact same thing in a thing that's completely different

wide hamlet
#

indeed. Ight ill start with compiling this up in my dev server and see where that leaves me.

carmine abyss
#

Dedmen I am still confused. You said publicVariableServer won't work, but it does it's the resetDone portion that doesn't work.

still forum
#

So.. It works. But it doesn't work for you..

#

What does that tell us?

carmine abyss
#

You can only use it once per sqf file?

still forum
#

🤦

#

Maybe it doesn't work for the exact reason that we told you yesterday

carmine abyss
#

About ownerID?

cold pebble
#

So you use setVariable on an object

#

publicVariableServer works with mission namespace, not object hence why it isn’t working as expected

#

You can use setVariable’s alt syntax to broadcast the variable just to the server

still forum
#

^ which is exactly what we said yesterday

west grove
#

oi, people. quick question. i'm running an fsm file, but i am suspecting it to fail / not running anymore after a while (even though that makes no sense to me). can i somehow check if the fsm is still being executed?

carmine abyss
#

Sorry Dedmen I am trying to understand this. So the player is an object?

still forum
#

yes

west grove
#

nice, thanks

#

wow it even shows where i'm currently in. really could have used that a long time before.

carmine abyss
#

Thank you for the explanation Dedmen and Dom. I'll have to figure out another way to do this.

still forum
#

We already told you how to do it. 3 times in total now

carmine abyss
#

Really 3 times?

#

I found nothing about sending variables to server only on the setVariable wiki

still forum
#

To find out what ID you want you need a little bcakground info

carmine abyss
#

Thank you sir

west grove
#

my fsm jumps to fake .. interesting

#

hah, found the problem

#

this is so stupid

#

i've added some sort of failsafe loop, in case something goes wrong. but for whatever reason i've connected a knee the wrong way to the condition.. of course this can't work

#

yay, only 1 hour of debugging

carmine abyss
#

sqf {_x setVariable ["nowInGame, true, 2]} forEach all players;

still forum
#

close... Quite close.

carmine abyss
#

Ok ok hold on now

carmine abyss
#
 _id = clientOwner;
{_x setVariable ["nowInGame", true, _id]} forEach allPlayers;
tough abyss
#

🍿

still forum
#

(╯°□°)╯︵ ┻━┻

#

even worse

#

slightly

#

maybe

#

It does basically nothing now

carmine abyss
#
_id = clientOwner;
player setVariable ["nowInGame", true, _id]};
tough abyss
#

@wide hamlet Not all event handlers use _this, older EH have special variables set like in onPlayerConnected for example. Other might not pass anything so _this is undefined, it depends basically

knotty arrow
#

anyone know why in Altis framework have a function folder with bohemia functions ?

#

And prefix "BIS"

waxen tide
#

i just thought "i wonder if i can do something like BIS_fnc_findsafepos, but 100x faster" and then spotted "optimised by Killzone_Kid" in the header

#

eh, how hard can it be.

knotty arrow
#

do u think that?

waxen tide
#

Bortfive, BIS_fnc_ are functions bohemia put into arma3 itself. seems whatever you're looking at there overwrites these functions with different versions

knotty arrow
#

ok

waxen tide
#

you can check their exact contents in the functions viewer in eden

#

the uss freedom aircraft carrier has an init function for example to init the vehicle properly and arrange the dozen or so parts of it. but the function has a check so you can only execute it on servers. i once made my own version where i just removed that check because i was spawning the carrier as local object for a cutscene.

earnest ore
#

You can check their exact contents in the functions viewer
BIS_fnc_selectRandomWeighted:

// --- [[item, item], [weight, weight]]
if (_this isEqualTypeArray [[],[]]) exitWith {_this select 0 selectRandomWeighted (_this select 1)};

// --- [item, weight, item, weight]
if (_this isEqualType []) exitWith {selectRandomWeighted _this};

["Input format must be [[item, item, ...], [weight, weight, ...], ...] or [item, weight, item, weight, ...]"] call BIS_fnc_error;
nil
#

O-oh.

knotty arrow
#

yep

#

thanks

waxen tide
#

you can also just unpack the functions pbo in the addon folder of arma, but that might break some EULA

knotty arrow
#

xD

#

ok

waxen tide
#

but they're not binarized or anything, they're just plain text files.

knotty arrow
#

yep

still forum
#

They probably have them to hook them, or to optimize something

waxen tide
#

drawing map markers sucks.

#

the more you draw, the slower drawing new ones becomes

#

certainly no thought was put into people spawning lots of markers.

waxen tide
#

HELP IT IS GROWING

still forum
#

Everything's a dildo

waxen tide
waxen tide
#

well it's a lot faster than the stuff previously, but 300kb of data per 1km² suddenly sounds bad when the map is 1600km²

tough abyss
#

Maybe they are overwritten and do nothing or log calls to them because those function present security risk? I wouldn’t want those function on my server for sure @knotty arrow

unborn ether
#

Lets do chess in Arma.

tough abyss
#

Why?

unborn ether
#

Because why not? 😄

tough abyss
#

Let’s play poker then

unborn ether
#

Nice idea, lets make casino with our blackjack and.. exceptions.

tough abyss
#

And sell it to lifers

unborn ether
#

Free exceptions! Free exceptions! Only today!

waxen tide
earnest ore
#

Just need a quick clarification on variable scope:

private _fncActivityCheck = {
    params["_location"];
    private _trg = createTrigger ["EmptyDetector", position _location, false];
    _trg setTriggerArea [_areaRadius, _areaRadius, 0, false, 1000];
    _trg setTriggerStatements ["this", "", ""];
    _trg setTriggerActivation ["ANYPLAYER", "NOT PRESENT", false];
};

while { !zKillHotzone } do {
    if(count zActiveHotzones > 0) then {
        private _active = zActiveHotzones#0;
        private _refIndex = _active getVariable "MapRefIndex";
        private _location = zMapReferences#_refIndex#0;
        _location call _fncActivityCheck;
...

The variable _location in _fncActivityCheck is isolated, correct?

unborn ether
#

@earnest ore params recieve and parse the argument, so yes its private to _fncActivityCheck. But that variable also exists in if(count zActiveHotzones > 0) then { scope, since you pass it there.

#

So its kinda isolated in both of them.

earnest ore
#

Coolios, thanks.

unborn ether
#

@waxen tide lol

tough abyss
#

It is shadowed

waxen tide
unborn ether
#

@waxen tide If you are about battleye whitelisting - use that on server, server doesn't care about battleye whitelist.

tough abyss
#

Write it yourself, it is literally a few lines of code with standard library.. oh wait, you despise extensions

waxen tide
#

This is the second time you pretend i said that. Which is false.

#

I'm not on about battleeye, i'm on about the extension popping a confirmation popup on every write.

tough abyss
#

You said it, when you were trying to save your map in profile namespace and were told to use extension

waxen tide
#

i said i'll not use extensions since my usecase does not warrant it. which, at the time, was entirely correct and still is entirely correct. But now i have another (similar) usecase where i need to save multiple things in multiple files, and now i feel like such an extension is very much warranted. Also i believe X39 was on about scanning the map with SQF code which is horribly slow, and told me to write an extension to do that.

tough abyss
#

Yeah you said something like you not gonna start learning how to write extensions just because of that. Well maybe now is time?

#

And when you write your first extension to write to file you will realise that you can overwrite any file on your computer with it and this is dangerous, and you will need some sort of guard especially if you decide to responsibly share it with others

waxen tide
#

no, it is not time. people have written extensions to write into files and databases, i'm sure i can find something suitable.

zenith edge
#

I should be able to use intercept on a dedicated server for non-client stuff right?

waxen tide
#

does extDB3 not work in singleplayer?

soft ruin
#

So I have this script I want to use. Now where to I put it in editor?

waxen tide
#

was just the malloc being named wrongly.

#

┬─┬ ノ( ゜-゜ノ)

#

@soft ruin hit ESC, there is a debug console

soft ruin
#

Awesome thanks

unborn ether
#

@waxen tide Database in singleplayer?

waxen tide
#

i just fired up single player editor real quick to tinker with basics while installing extDB3 and wondered if it has some MP only weirdness, but it was the malloc file being named wrongly. all good.

still forum
#

@zenith edge yes

waxen tide
#

🤔

#

anyone here willing to discuss SQL db/table layouts? (it has been a while)

still forum
#

Just make something good. No need to discuss

waxen tide
#

yeah too dumb for that.

high marsh
waxen tide
#

i'm tempted to just save a shitton of arrays as a string and then convert them back to arrays in arma for example

#

because i need them all at once, kind off?

#

and i doubt splitting them up and saving lot of integers is a good idea

high marsh
#

Why? When you query your db you can dump it into an array, but it's not necessarily stored as an array.

waxen tide
#

what.

#

oh yeah. hm.

high marsh
#

querying your db, request data from db.

#

extDB3 works well for arma 3.

waxen tide
#

i'm using that.

high marsh
#

Ok, are you asking how to use it?

tough abyss
#

Extensions have output limit

waxen tide
#

no i'm asking how to lay out the SQL tables. maybe i should write down what i want to store first.

zenith edge
#

yes

waxen tide
#

yeah it's like 10k chars right?

high marsh
#

unless your output data in one query is 10k characters, then you shouldn't have any worry.

waxen tide
#

i'm looking at 48mb of data to store

high marsh
#

do you really need it all at once? Why is it 48 MB?

waxen tide
#

no i don't need it all at once

#

i pre-calculate map data which takes way too long to do it during runtime, so i want to pre-generate it and save it in db

tough abyss
#

So prepare to call extension 4,800 times then to get it back

waxen tide
#

well i've seperated the data into sectors of 1x1km already

#

so i have 1681 sectors

#

i'll only need the data of 4 or 9 sectors to generate a mission

high marsh
#

I don't understand what element of this data turns out to be 48 MB? Are we talking actual terrain data like heightmaps?

waxen tide
#

it's a lot of empty positions to spawn compositions on, roadblock positions, fortification positions and such

zenith edge
#

i suggest using mysql workbench when designing DB

#

and writing down all the columns you'll need

high marsh
#

Question is, is querying your db so many times for that information going to be fast enough?

#

Why can't you pregenerate this for each island and use it as static data stored in mission?

waxen tide
#

i don't need to query much

#

i need to store a lot

#

and yeah i've used copytoclipboard so far and just saved a few files, one per map

#

but i'm now exceeding the string length of arma (10mb) and copytoclipboard is getting a bit tedious

#

i think a DB is more convenient in the long run.

still forum
#

Splitting the array and storing numbers would actually be lot more efficient size wise

high marsh
#

The furry has answers

waxen tide
#

yeah but i don't really care about the memory footprint. ease of queries and speed would probably be more important

still forum
#

Intercept could be really useful here 😄

zenith edge
#

i'm actually moving from extdb3 to intercept for my logging

waxen tide
#

@zenith edge like heidisql most so far. mysql workbench installer is broken, demands a vc redist that's uninstallable on win10 atm.

tough abyss
#

Intercept can write to DB?

zenith edge
#

im using it on win10

#

intercept can use standard mysql libraries

high marsh
#

^

still forum
#

intercept can do everything you want

tough abyss
#

I want an egg and bacon

zenith edge
#

i was also going to setup a discord bot plugin using discord c++ library

still forum
#

With that you could easily do a real DB layout (buildings table, locations table, buildingpositions table with cross references between them)
And let intercept take care of stitching it all together

waxen tide
#

so far i've divided the map into 1x1km sectors. and then i have a sub-array for each "size" of empty position, ranging from 20 to 120 in steps of 10. so i have map->sector->20,30,40,50,60,70,80,90,100,110,120 each with a whole bunch of [x,y] coordinates inside.

zenith edge
#

moving server functions and functionality over to intercept for our mission

waxen tide
#

but i can do the same thing with extDB3, no ?

still forum
#

I guess yeah. But I think it's... Well you could use stored procedures to pull your stuff apart and store it properly

waxen tide
#

at least i didn't see any limitations. last time i used SQL was like 10 years ago with mysql&php bullshit.

#

why not just do it in sqf ?

tough abyss
#

If you only do a 1km by 1 km a pop, you can search that area there and then for suitable positions, no reason to do the whole map and store it so you can use 1x1 from it

waxen tide
#

but doing 1x1km takes 17 seconds ..........

still forum
#

because SQF is slow AF :U

zenith edge
#

store it inmemory in intercept and serialize it to save to file, and load it from a file and unserialize back into memory

waxen tide
#

i don't want to do that on runtime

zenith edge
#

then expose functions in intercept to mission, call those functions to get what you want from intercept

tough abyss
#

Maybe you can optimise it and run in scheduled before you need it

waxen tide
#

the beauty is that storing the data can take as long as it wants to, i literally do not care. and i only fetch a tiny fraction of the data to actually spawn something, so sqf only has to handle the tiny amount of fetched data (say, 200kb at most) and the speed isn't an issue then.

still forum
#

Also with Intercept you don't have to worry about any size limits when calling extension 😉

zenith edge
#

i just have to remember how to use c++

waxen tide
#

i can't use C

#

i still have PTSD from the last time.

zenith edge
#

better than sqf

still forum
#

C != C++ :U

#

C is garbage. I agree

tough abyss
#

It depends, I use MySQL driver written in C it is fast

#

No problems with it either

zenith edge
#

im trying out the mariadb connector

#

someone should hook this all up to c# for me :)

waxen tide
#

this works fine tbh

#

but that's just roadblocks and houses

#

now i want empty positions

tough abyss
#

How close your test points from each other on map?

waxen tide
#

10m

tough abyss
#

So 100 x 100 is 10000 and it takes 17 seconds to iterate through it?

#

17?

#

Seconds?

hollow thistle
#

"safe data" => "save data"

waxen tide
#

@tough abyss yeah, looks like it. depends on the map ofc and which spot.

still forum
#

scheduled script

tough abyss
#

Yeah if you gonna draw and hint and system chat and diaglog it could take ages

waxen tide
#

okay you have a composition that's 100x100m and need a spot for it. there are 3 suitable spots in a 4x4km square, thats 16*17 seconds to find them and pick one random so it isn't always the same spot which would make the effort futile

#

all the logging and systemchatting is after the diag_ticktime already, and drawing these map markers doesn't actually do much for performance.

#

oh also there is no inclination check or water check in there yet.

#

so i'm probably going to massively increase the time 😛

#

atm just water check on the center position and check for terrain objects.

tough abyss
#

You can pass 10000 points to extension in a whiff and make extension search for 100x100 space in it, could be done in real time

waxen tide
#

damn extension junkies

#

(╯°□°)╯︵ ┻━┻

still forum
#

┬─┬ ノ( ゜-゜ノ)

#

I honestly don't know why your script takes so long

#

besides it being scheduled of course. That probalby 10/20x's your time

waxen tide
#

i concur that it would be vastly more efficient to do this with an extension. i totally get all the advantages. but i have too little experience with SQF as is, so i won't try to learn another language in parallel to write an extension. i'll rather pre-calculate the stuff in need and store it, and access it selectively to achieve the speed during the mission runtime i need.

zenith edge
#

a db connection is going to add in the latency to contacting a DB

tough abyss
#

Can run scheduled during loading screen, it allows for longer runs

still forum
#

Is that script on your github so that I could run it myself and find potential perf problems?

waxen tide
#

i have not noticed a massive difference between scheduled and unscheduled for those map scanning scripts. i've tried both. only effect unscheduled had was 20 fps 😛

still forum
#

unscheduled == 20fps? you're doing something wrong then

#

it should freeze the game and then just be instant done 😄

tough abyss
#

If you alt tab you get 20 FPS

#

Beats me why limit on alt tab

waxen tide
#

what script are you talking about dedmen? the one for empty positions, or the roadblock + houses madness?

still forum
#

the stuff that's taking the 17 seconds

waxen tide
#

@still forum https://pastebin.com/YKFZegvB - Note: This is far from finished and i'm mostly just trying to figure out what data i need. It runs for 17 seconds on the map "deniland" for me.

#

inb4 dedmen optimises the shit out of it and it runs in 12ms

tough abyss
#

There is worldSize command

#

No need to look in config for that

waxen tide
#

👍

tough abyss
#

You create marker right there and then why you say it is not included in speed test?

dusk sage
#

You have a while loop calling nearestTerrainObjects running 10k times

waxen tide
#

i've removed the markers and checked with and without them.

#

if you spawn a limited amount, the speed impact is small. it becomes nasty if you scan 4x4 or larger, then they slow down massively.

#

and actually the while loop runs like up to 10 times depending on the location inside two for loops which together run 10k times, yes.

tough abyss
#

Basically all what I said and you denied was true

waxen tide
#

idk but the average must be like ..15k loop iterations?

hollow thistle
tough abyss
#

That code is one big marker systemchat diaglog creation

#

Dedmen asked you for 17 seconds script and here it is

waxen tide
#

heh it's only 8 seconds since i copied the marker function directly into the file 😛

#

yeah it's 2.2 seconds if you cut out the markers. but as i said this is without actual checks for inclination and water (except for center) so this is bound do get almost as slow as the previous findsafepos madness.

zenith edge
#

wasnt the point of this discussion not that that was slow, which you dont care about, but the speed of querying those results into a live game

waxen tide
#

no. my question was how to structure SQL tables.

zenith edge
#

it depends, do you know anything about database design at all?

waxen tide
#

yeah i build some small php/mysql projects between 10-15 years ago. you know, the typical stuff. guestbooks. forums.

zenith edge
#

write down all the columns ur going to need than start normalizing if you need to

#

you don't have to normalize all the way, or normalize at all depending on what ur doing

#

could literally be just a flat table

#

nothing else

#

that page summarizes it pretty well and has links

waxen tide
#

yeah but if i break it down all the way, i would have a table which has ID,radius,x,y in it, and probably be 100mb of data. and then a few tables with nothing inside

#

the ID and the radius seem like massive overhead to me

#

it doubles data amount, basically

#

with no benefit

#

there is only 10 different radius'ses

#

so rather have 10 tables, one per radius i guess

#

but then there is different maps, and each map has different sectors.

zenith edge
#

make a radius table with UID, Value, then in your other table have UID, x, y, fk_radius_UID

#

your going to have massive tables

#

the only difference is in how you select things out of them

waxen tide
#

i was actually thinking to make a table per sector

#

but that would be 1681 tables for each sector for the current map

#

but if you need to query something, you then query 4 relatively small tables and literally use all the data in them

#

which seems speedy?

zenith edge
#

are you saying you think it will be too slow if you have all of the x,y in a single table?

waxen tide
#

i mean what's x?

#

it's a 5 digit integer

#

same with y

#

the ID will be what, 6-7 digits?

#

and then the radius which is either 2 or 3 digits?

#

thats doubling the data amount per coordinate.

#

that seems weird.

#

if all the coordinates are in a table which has no ID, and no radius, then i just need to save X and Y and can do select * and be done

#

but that would be a gigantic amount of tables.

#

table name would carry all the non-redundant information. mapname_sector_radius (deniland_1348_30 for example)

zenith edge
#

you would connect tables to each other with foreign keys

#

one of the normalization forms removed redundant information

#

so if you have 10 fields that repeat per certain items, you'd just include a single foreign key for those items, and in another table have a UID with those 10 fields

waxen tide
#

imagine you have 1200 locations of [x,y]. you store a key on them to define that they're of radius 20?

zenith edge
#

you then use a join to determine what 1 or all those fields are for a particular thing you select

waxen tide
#

and another key for the info that they're from altis or tanoa?

#

thats 2 x 1200 x a key

#

seems silly?

zenith edge
#

my current logging system logs the FPS for the server, HC, and all clients, every 30 seconds + several other things

#

every 30 seconds

#

i have 192 games in the current DB

#

i dont have any problems querying

waxen tide
#

do you use extDB3 ?

zenith edge
#

yes

waxen tide
#

can i connect to multiple databases at once?

zenith edge
#

why?

waxen tide
#

was thinking 1 DB per map

#

and 1 DB for non-map-related data

zenith edge
#

and you can, but i think ur trying to optimize something that you shouldnt and doesn't get optimized

#

your not understanding how relational db's work

#

let me show you a schema

waxen tide
#

i do.

#

if i do it like you said, a map is going to be 50-200mb of data. that's approaching a gigabyte for a handful of common maps quickly. if i do it like i want to do it, it will be 20-30mb for a map.

#

sigh. i now kinda want file export. 1681 files doesn't sound half bad 😛

#

hides

zenith edge
#

so your screenshot earlier

#

it shows current dataset 4871KiB

#

thats 4MiB

waxen tide
#

that's the old stuff. the new stuff i estimate at ~48mb for the map.

zenith edge
#

how many rows

waxen tide
#

now you wanna know what those 48mb looks like?

[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]],[[x,y],[x,y],[x,y]]
#

radius20, radius30, radius40, ... radius120

#

first array is going to have like 1000+ elements per sector

#

last array mostly 0

#

and there is 1681 sectors

#

so the array above? *1681

zenith edge
#

1681 rows?

#

im not understanding what you described there

waxen tide
#

so you have like, 10 maps, ok?

#

each map has like a couple 100 to 1600 "sectors" of 1x1km each

#

each sector has a couple of 1000 to 0 locations with radii between 20 and 120

#

each coordinate has x and y value

#

if you spawn a mission, you'll want the data of like 4-9 sectors

#

say you want all locations of radius 100 or bigger in the sectors 510-520

zenith edge
#

MapTB{UID, Name}; SectorTB{UID, x, y, fk_mapUID}; LocationTB{UID, x, y, Radii, fk_sectorUID};

#
SELECT * FROM LocationTB WHERE (fk_sectorUID >= 510) && (fk_sectorUID <= 510) && (Radii >= 100)
waxen tide
#

i know the traditional way to do it

#

i guess i'll have to try it to see if it is as bad as i think it will be

zenith edge
#

you are saying you think the file size is going to be greater than you want?

#

or that it will be slow?

waxen tide
#

both?`

zenith edge
#

i doubt it will be slow enough for you to care

#

i can query without a problem on a 22GB database

#

and i doubt you'd save much in space unless you are serializing or compressing results somehow into a file

waxen tide
#

eh, you know what

#

this is simple to do

#

so i'll try it

knotty arrow
#

Thanks @@tough abyss there is better performance bis fnc call or bis fnc spawn?

unborn ether
#

@knotty arrow Its better to use commands that are native to engine, neither BIS_fnc_*. Your case is call and spawn

knotty arrow
#

Ok, thanks

wide hamlet
#

is there a way to change which turret currentWeapon returns for vehicles with more than 1 turret. i.e. [-1] for driver, [0] for gunner.

still forum
#

@waxen tide to your pastebin.
L11-15 use params FFS
Line 77 any reason to have that variable available outside the loop?
Line 85
private _check = []; if () then _check=1 else _check =2
->
private _check = if () then 1 else 2

Line 92 the whole switch.
([_pos20, _pos30, _pos40, ...] select ((_mkr_radius-20)/10)) pushBack _coordinates

#

@dusk sage You have a while loop calling nearestTerrainObjects running 10k times no he doesn't. Read the code.
Also btw count _check == 0 -> _check isEqualTo []

with no benefit
there is only 10 different radius'ses
so rather have 10 tables, one per radius i guess

Then use an enum or just a 8bit int.
No don't use 10 tables.

seems silly? No. That's just how databases are.
As long as you have indicies correctly set, it doesn't matter how big your table is.
I have a Table with over 30 million entries in one of my hobby projects DB's. No problem whatsoever to sift through all of that in half a second.

tough abyss
wide hamlet
#

@tough abyss Works like a dream. Ty for that.

spice axle
#

hey jo, short question: am i allowed to use a percent symbol (%) in a stringtable? And how?

tough abyss
#

Who’s Jo?

spice axle
#

nobody, it is just a slang

edgy dune
#

on the Arma 3 EH wiki, wats the diffrence between source and instigator?

this addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
}];
wide hamlet
#

source: Object - The source unit that caused the damage.
instigator: Object - Person who pulled the trigger

edgy dune
#

yea isnt that the same thing?

wide hamlet
#

im assuming source would be like the item that hit the object. So Like a bullet classname? and insitgator is obvious. Someone correct me if im wrong 😛

spice axle
#

The source can be a vehicle, the instigator not

wide hamlet
#

whenever im in doubt i just add the EH and for the code i put diag_log str _this Helps out alot 😛

tough abyss
#

Look up getShotParents

edgy dune
#

oh okay

#

instigator is always a unit then?

tough abyss
#

A person

edgy dune
#

oh okay

winter rose
#

don't forget UAVs

#

(PS: getShotParents always makes me think of Batman :3 hue hue hue)

manic bane
#

In GUI, every component has unique idc as far as I know. But if idc in my GUI and other GUI has same idc, I thinks it will be completely mess. What should I do prevent this situation without manually check every other GUI idc?

austere granite
#

In GUI, every component has unique idc as far as I know

#

Incorrect

#

What should I do prevent this situation without manually check every other GUI idc?
Always refers to controls and not to IDCs

#

There's two syntaxes, one uses IDC, one uses ctrl. To get the control, check for either saved variable, or do the _display displayCtrl _idc thing, but keep in mind there in some cases there's overlapping IDCs there it could fuck up. Also controlGroupsctrlis your friend

manic bane
#

Thanks I'm new with GUI. I should stay with commnunication menu just for now.

austere granite
#

If it's dialogs you are making, then use "onLoad" EH in the dialog to set a variable to uiNamespace so you can refer to that as the display

#

If it's rscTitles / custom displays or whatever, then the return of the command that creates them will give your display

#

Unless you're making workarounds for very specific BIS UIs, or poorly designed UIs by other people you never need the IDC syntax for ui commands

manic bane
#

Then I need to watch more guide for that.

austere granite
#

watch guide

#

sweet summer child

carmine abyss
#

@still forum ```sqf
_id = clientOwner;
player setVariable ["nowInGame", true, _id]; `` you said this was close?

gleaming cedar
#

How to make AI shoot moving target?

still forum
#

no I said this was even more wrong that before

#

you already had it right. Besides some syntax errors.

gleaming cedar
#

Dedmen do u know if its possible cuz I looked all over internet

still forum
#

But then you fixed the syntax errors. And removed the stuff that was correct

#

If I knew I would've already told you

carmine abyss
#
player setVariable ["nowInGame", true, 2];
waxen tide
#

@still forum
Line 77 any reason to have that variable available outside the loop?
Yeah idk how else to seed it with start value 🤔
Also i do not get your line 85 and line 92 comments. I'll fetch ☕

still forum
#

yeah. You get ☕ I get 🛏

carmine abyss
#

@still forum more 🌹🌻🌼 for you

waxen tide
#

pours his latte down the drain and fetches a quadruple expresso

trail grove
#

why in zeus this works only at > certain altitude

st=true;o='Sign_Sphere200cm_F'createVehicle[0,0,0];
[]spawn{while{st}do{
_a=lineIntersectsSurfaces[
    getpos curatorCamera
    ,screenToWorld getMousePosition
,objnull,objnull,true,1];hint str _a;
if(count _a isEqualTo 0)then{_a=[ [[0,0,0]] ]};
o setposasl(_a select 0 select 0);
sleep 0.1}};
acIcuraZ0 addCuratorEditableObjects[[o],true]

and is any ideas on how to make it with ability to find out when cursor is on water?
(also there is some weirdness: the sphere positioned under cursor when aiming at terrain;)

calm bloom
#

Hello there! Guys, do anyone know what type of controls the multiplayer lobby slots are? They have disable ai button and the small group name entries, and they seem to be controled by engine without any configs.

calm bloom
#

ok i found couple discussions there sorry

unborn ether
#

@winter rose batmobile addEventHandler ["Fired", {systemChat str getShotParents (_this select 6)}]; 👀

#

@calm bloom Side selection is specific active text, slots are specific listbox. You can't control that much.

calm bloom
#

Thanks for the info

lament grotto
#

Hey guys I am trying to get the groups that spawn from this part of the script to randomly patrol the area they spawn sqf AreasToSpawn = ["ScavSpawn","ScavSpawn_2","ScavSpawn_3","ScavSpawn_4","ScavSpawn_5","ScavSpawn_6","ScavSpawn_7","ScavSpawn_8","ScavSpawn_9","ScavSpawn_1","ScavSpawn_11","ScavSpawn_12","ScavSpawn_13","ScavSpawn_14","ScavSpawn_15","ScavSpawn_16","ScavSpawn_17","ScavSpawn_18","ScavSpawn_19","ScavSpawn_10","ScavSpawn_21","ScavSpawn_22","ScavSpawn_23","ScavSpawn_24","ScavSpawn_25","ScavSpawn_26","ScavSpawn_27","ScavSpawn_28","ScavSpawn_29","ScavSpawn_20","ScavSpawn_31","ScavSpawn_32","ScavSpawn_33","ScavSpawn_34","ScavSpawn_35","ScavSpawn_36","ScavSpawn_37","ScavSpawn_38","ScavSpawn_39","ScavSpawn_30","ScavSpawn_41","ScavSpawn_42","ScavSpawn_43","ScavSpawn_44","ScavSpawn_45","ScavSpawn_46","ScavSpawn_47","ScavSpawn_48","ScavSpawn_49","ScavSpawn_40","ScavSpawn_51","ScavSpawn_52","ScavSpawn_53","ScavSpawn_54","ScavSpawn_55","ScavSpawn_56","ScavSpawn_57","ScavSpawn_58","ScavSpawn_59","ScavSpawn_50"];

#
while {(resistance countSide list GameArea1) <= 130} do {
///Group Spawning
_Newgroup1 = createGroup independent;
"rhsgref_nat_warlord" createUnit [getMarkerPos (selectrandom AreasToSpawn), _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom WarlordScav); _Newgroup1 selectLeader this", 0.8, "corporal"]; 
"rhsgref_nat_hunter" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom HunterScav)", 0.8, "PRIVATE"];
"rhsgref_nat_militiaman_kar98k" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom MilitiaScav)", 0.8, "PRIVATE"]; 
"rhsgref_nat_militiaman_kar98k" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom MilitiaScav)", 0.8, "PRIVATE"]; 
"rhsgref_nat_militiaman_kar98k" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom MilitiaScav)", 0.8, "PRIVATE"]; 
if ((selectrandom (_Heavychance1)) == 1) then {"rhsgref_nat_scout" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom HeavyScav)", 0.8, "PRIVATE"];} else {"rhsgref_nat_militiaman_kar98k" createUnit [getpos leader _Newgroup1, _Newgroup1, "loon1 = this; this setUnitLoadout (selectrandom MilitiaScav)", 0.8, "PRIVATE"];};
[_Newgroup1, getPos this, 250, 100] call bis_fnc_taskPatrol;
sleep 10;
};```
#

it appears to not work, any help would be appreciated

tough abyss
#

What does loon1 = this; do?

lament grotto
#

marks the unit thats spawning as loon1

tough abyss
#

For what purpose?

lament grotto
#

it refrences so the stuff calling this in its lines fire and apply to it.

tough abyss
#

You are overwriting it immediately with next unit you created, you cannot reference previous unit anymore

#

You don’t need it just as you don’t need to use this ancient syntax for unit creation either. You can also pass marker array directly to unit creation

#

Also where do you put this script?

lament grotto
#

Let me hand you over to the writer @proud carbon

tough abyss
#

I don’t care about the writer, you asked the question, I ask you

#

Where do you execute it from?

proud carbon
#

Hey so ol' mate @lament grotto was helping me out. with this

#

so i had another fella helping me out with it and he put in loon1 = this. i kept it in because i thought this was useful

ruby breach
#

If you’re going to build an array that large with “Something_#”, build it with something like a for-do loop to save yourself a huge chunk of copy-pasting every time you add something new

tough abyss
#

Your other fellow just copy pasted biki example with little clue to what is happening. For the third and last time, where do you execute this script from

proud carbon
#

a trigger

tough abyss
#

Then look in your .rpt file it should be full of errors

proud carbon
#

so he straight up copied and paste from someone's else script?

tough abyss
#

When script errors it won’t work, this is the answer to why it doesn’t work

proud carbon
#

btw way i am new to scripting so what is the rot?

tough abyss
#

Rot is autocorrection of rpt

proud carbon
#

so where do i find the rpt?

tough abyss
proud carbon
#

ty

earnest ore
#

If this code is in the trigger's activation, then this in [_Newgroup1, getPos this, 250, 100] call bis_fnc_taskPatrol; means nothing.

#

And probably should be thisTrigger.

proud carbon
#

it is in a sqf

tough abyss
#

Looks like someone took examples from biki and mashed them together hoping it would work out of the box

earnest ore
#

And probably should be getPos leader _Newgroup. 👀

#

And probably should find another coder.

proud carbon
#

yeah thats why i wanna learn me self

tough abyss
#

Also trigger execution is unscheduled you cannot sleep in it

proud carbon
#

in a sqf activated through a trigger would have sleep in it wouldn't it?

tough abyss
#

No idea what you just said

proud carbon
#

so you said a "trigger execution is unscheduled you cannot sleep in it" you can if the execution is a sqf?

tough abyss
#

Cannot see _heavychance defined anywhere either

proud carbon
#

well you are not actually seeing the full script let me link it here.\

#

that should be my script

#

how do i input code here without it being weird?

tough abyss
#

What is hunterscav array of what?

proud carbon
#

loadouts

earnest ore
#

Line 9, the init argument isn't properly enclosed in quotes.

tough abyss
#

And load out could be many types, what type your load outs,

#

Data type

earnest ore
#

Those rogue effing quotes man.

proud carbon
#

Warlord, Hunter, Heavy, Militia scav are loadouts of gear and weapons

#

what do you mean about line 9?

tough abyss
#

Are they strings are they configs are they arrays? What are they? Where you define them? It is not on the pastie

proud carbon
#

yeah so what I've done is created a group filled with units who's gear and weapons are different person. I then use getUnitLoadout and for each and separated the roles has either WarlordScav etc, into an array. that part works really well so each spawned in unit has different gear and weapons.

#

its not too random and give me heaps of freedom on what i want the scavs to look like

tough abyss
#

So they are objects?

proud carbon
#

nope

#

its a variable that i got from an object.

tough abyss
#

So those variables are defined at the start of the script?

proud carbon
#

nope. start of the mission file

#

so as a script what do you think of the script?

tough abyss
#

You have missing " and you cannot use sleep as I told you, otherwise after you fix that it should at least create some units

#

Until you make it run without errors there is no point speculating any further

proud carbon
#

ok

digital jacinth
#

is it possible to overwrite a function defined in cfgfunctions?

Reason is I do not want to make a full fork of ACE and only need to change like 3 functions. I can use a mod if that is needed as well.

still forum
#

Yes.

#

ACE doesn't use cfgFunctions though..

digital jacinth
#

wait, so i can just overwrite their variables?!?

still forum
#

no they are compileFinal'ed

#

ACE is actually pretty hard.

#

You can replaced their preStart/preInit XEH eventhandler config entry. To redirect their whole init script to yours. And then replace the function paths in yours

digital jacinth
#

eventhandlers, yeah. For me It would be changing up a few things such as tapping on someone shoulders. guess a fork it is then

viscid trail
#

hi guys can someone explain me the rpt failure ?

#

the webconsole is full of theese

#

someone a solution ?

still forum
#

That's not #arma3_scripting also you can shorten your text. Don't have to post the same thing a dozen times. That's kinda spammy

#

@viscid trail you just broke #rules rule number 9.
Better delete your message here. And have a read of the rules

viscid trail
#

oh yeah thx u

orchid saffron
#

Hey guys, I´m dealing with some issues using the ctrlAnimateModel command. When i use it the animation is instant like _obj animateSource ["example_source",1,true];

#

Do you know why is it?

#

Do i need to put some sort of animationsource class and define the animation period inside the dialog?

orchid saffron
#

Yep is that, fixed

orchid saffron
#

I´ve created a custom object with the named selections in memory lod (screen, screen tl, screen tr, screen bl, screen br) a geometry lod and lod 0

#

And the RscEdit it´s not appearing

#

Also findDisplay 1000000 displayCtrl 1000002 is Null

#

Some screenshots of the p3d

#

Also i have the screen selection in my model.cfg

orchid saffron
#

Any clues?

hollow thistle
#

Can I safely use deleteAt inside count loop?

still forum
#

no

#

count/forEach and the others iterate by index

#

so if you are at element 5. And delete element 5. Then the next iteration will land you at element 7

hollow thistle
#
private _validItems = global_itemsQueue select {_x getVariable ["isValid", true]};
global_itemsQueue = global_itemsQueue - _validItems;

// Process valid items
{...something...} forEach _validItems;
#

Went with something like that, any better way?

still forum
#

Yes.

#

No.

#

uh.

#

Well you could copy global_itemsQueue before iterating and then deleteAt inside your loop. As you iterate over a copy. That's fine.

spark sun
#

so if you are at element 5. And delete element 5. Then the next iteration will land you at element 7

O.o

still forum
#

Copy might be more expensive though. not sure

#

like
(+_array) count...
instead of _array count

hollow thistle
#

Oh yeah copying could work too. I will leave it as is as it works and it is only executed when player confirms something in dialog.

spark sun
#

that is really stange for me x)

orchid saffron
#

Ok obviously it wasn´t working, i missed class controls 🤦 what a waste of time

hollow thistle
#

As the underlying code is a C++ (?) code it makes sense that deletion while iterating would fuck up stuff because the indexes would change but the iterator would be left as is.

spark sun
#

I thought foreach iterate on a copy of the array

still forum
#

well. no.. That would be SUPER inefficient

hollow thistle
#

What happens when you would delete all indexes inside the count? In c++ you would try to read some random memory. What happens in SQF ?

still forum
#

Yes C++.
You can even crash the game. When you remove UI eventhandlers while it iterates

#

SQF iterating functions check that they don't go over the end

#

Whereas the UI eventhandlers for example don't.

hollow thistle
#

Interesting. As always you deliver some interesting low level arma knowledge 😄

still forum
#

Atleast I think the SQF iterating functions check that. i know that forEach does. I don't know about the new ones like apply/select.
But it would be really dumb if they didn't

hollow thistle
#

I knew about _forEachIndex but was unsure how count will behave.

tough abyss
#

It doesn’t matter what language it is written c++ or other, it matters how the container is managed, and Arma uses custom cooked containers

hollow thistle
#

Kinda, yes, some languages will not allow you to crash whole runtime/program by doing stuff like that.

still forum
#

This not crashing is not related to the container tho

#

it's how the code iterates through the container. Which you can do with any container

#

AutoArray doesn't have any special checking

tough abyss
#

You contradict yourself, you say it is c++ yet you can delete foreach elements while iterating and not crash

still forum
#

huh?

tough abyss
#

It is about how it is handled internally

still forum
#

I don't see a contradiction. And I also don't see the connection between C++ and deleting things

tough abyss
#

Not you

still forum
#

Fun fact. Even if they didn't have any checks. it wouldn't crash. But you would iterate over some elements multiple times.
Because elements are moved forward when you remove something to fill the gap. But the memory of the end elements isn't set to null afaik.
1234567 remove 4.
Now you have 1235677 array of 6 elements in memory. With a buffer size of 7 and with the 7th element still being there

tough abyss
#

Undefined behaviour

gleaming cedar
#

shooter4 forceWeaponFire ["LMG_Minigun_Transport", "close"];

#

Why does this not work

tough abyss
#

Is the first element a muzzle and is the second element a valid muzzle fire mode?

winter rose
gleaming cedar
#

First element is gun second mode

#

@tough abyss

#

@winter rose do you know?

winter rose
#

know what sorry?

#

@gleaming cedar sqf unit forceWeaponFire [muzzle, firemode]

gleaming cedar
#

@winter rose yes ots broken

#

It's

#

Doesn't work on gunner in vehicle

carmine abyss
#

When using clientOwner, does the player ID get reused when a player disconnects and another joins after?

elder karma
#

Oh wow. Didn't see this chanel before I went to the ask questions channel. I feel like a dang fool.

#

Don't suppose anybody is on and about at this late hour who could help a newb out?

waxen tide
#

there is 13k people in this discord.

#

just ask your question

elder karma
#

Well that's a response. lol

#

I'm just needing help with what sort of init code I would need to make it possible to load a Mazr into the back of a C-130J to ideally do a low altitude paradrop into a DZ. Or if that can't be reasonably done in a way that the occupants would be combat ready (aka, not painted over the floor paneling from the shock of impact) then I'd want it to at least be possible to load a single vehicle into the back of the C-130 with cargo bench.

waxen tide
#

i think the FFAA mod has a script on the C130 that does that nicely.

left narwhal
waxen tide
#

scary hivemind there.

left narwhal
#

scary hivemind there.

waxen tide
#

OR JUST A BOT

left narwhal
#

OR JUST A BOT

elder karma
#

Tanks would be a bit heavier than my intended goal but thanks for the reference link.

#

Hopefully it carries over.

waxen tide
#

ah it doesn't matter if you drop a tank a car or a goat, they're all just a "vehicle"

elder karma
#

I know i was jjust laughing at the mental image of an OPFOR ATC crapping himself when a Challenger II is dropped on his active.

#

I've found that wiki page you linked but its French to me.

#

Like I wouldn't know if just the C130 needs the enable cargo code or if every vehicle I want in it needs the iscargo code, etc.

waxen tide
#

Do you just want to drop an AI vehicle, or do you want to offer players the ability to use it?

#

if you just want to spawn a plane that drops a car with AI inside, i would probably do something hacky like attachTo and temporarily disabling the damage or something.

#

and probably you could copy killzone's example and just add vehicle crew

elder karma
#

This would ideally be a situation where either a player-run C-130 drops player-manned vehicles on the strip

#

Or a player (cus I have the pilots for it) sits on the strip in a C-130

#

While other players run up to an OPFOR vehicle, grab it, load it in the back, and the C-130 takes off without them aboard but with the vehicle in back

waxen tide
#

you're talking about the RHS C-130, right?

#

doesn't it already have that function? did you try?

elder karma
#

I've tried with the intended vehicles and some other RHS vics

#

Man that seems to crawl. I think my safer bet is gonna be having them use the C-130 as a means to extract an OPFOR vehicle. Save some trouble. Because if it takes that long for one vehicle to land, it'd be three or four passes to get the entire Troop down like I'd planned.

trail grove
#

Why

idIsc=[]spawn{
    _o='Sign_Sphere200cm_F'createVehicle[0,0,0];
    while{true}do{

_a=lineIntersectsSurfaces[
    ATLToASL positionCameraToWorld[0,0,0]
    ,ATLToASL screenToWorld getMousePosition
,objnull,objnull,true,1];
hint str _a;
if(_a isEqualTo [])then{_o setPos[0,0,0];
}else{ _o setPosASL(_a select 0 select 0) };

sleep 0.1}};
acIcuraZ0 addCuratorEditableObjects[[_o],true];

periodically have _a==[] when aiming at ground?

tough abyss
#

Because your end position could be just slightly above surface for the intersection not to happen. Make sure the line goes through terrain

gleaming cedar
#

shooter4 forceWeaponFire ["LMG_Minigun_Transport", "close"];

#

Why does forceWeaponFire not work on gunner

winter rose
#

Have you tried the biki example on the corresponding vehicle?

gleaming cedar
#

@winter rose Yes

trail grove
#

@tough abyss

idIsc=[]spawn{
    _o='Sign_Sphere200cm_F'createVehicle[0,0,0];
    while{true}do{


_rp=ATLToASL positionCameraToWorld[0,0,0];
_rp1=ATLToASL screenToWorld getMousePosition;
_rp2=_rp1 vectoradd(_rp vectorFromTo _rp1 vectorMultiply 10);
_a=lineIntersectsSurfaces[
    _rp
    ,_rp2
,objnull,objnull,true,1,'view','fire',true];
hint str _a;
_o setPosASL _rp1;
_o setPosASL(_a select 0 select 0);

systemchat str[call{{_rp1 set[_foreachindex,round _x]}foreach _rp1;_rp1},call{{_rp2 set[_foreachindex,round _x]}foreach _rp2;_rp2}];
sleep 0.1};
acIcuraZ0 addCuratorEditableObjects[[_o],true];
};

thanks, weird from my side

tough abyss
#

Works for me @gleaming cedar for AI it fires once for player it fires burst

gleaming cedar
#

@tough abyss can you send me the mission file

#

Doesn't work for me

tough abyss
#

There is nothing to send get into GhostHawk gunner and execute in debug console

gleaming cedar
#

Ok thanks I will try

mild storm
#

guys i need one solution

#

i need to change a magazine or caliber of a firearm, i want the mk20 to shoot 6.5 30 rounds magazines

still forum
mild storm
#

isn't there a solution to do with scripts?

#

you can use loadmagazine to forcefully put DAR missles in a raised 50.cal

still forum
#

no

#

you can add a weapon and it's magazines to a vehicle yes.

#

Completely unrelated to this though

mild storm
#

i can use the eventhandler "fired" and attachto command to shoot let's say cars out of a weapon but it will still fire he bullet with it

still forum
#

you can spawn a new bullet and delete the old

mild storm
#

randomcars = ["c_suv_01_f"];

player addEventHandler ["Fired", {
_null = _this spawn {
_missile = _this select 6;
_veh = (randomcars call BIS_fnc_selectRandom) createVehicle position player;
waitUntil {if (isNull _missile) exitWith {true};
_veh attachTo [_missile, [0, 0, 0] ];

};
};
}];

still forum
#

BIS_fnc_selectRandom We have a command for that. selectRandom

mild storm
#

making a gun fire out suv's is working but changing its bullet/magazine to 6.5 is a different story

still forum
#

you can't change it's magazine or caliber

mild storm
#

how do i spawn a new bullet and delete the old one

#

that's what i need

still forum
#

you already have the code above

#

instead of spawning a vehicle classname. You spawn a ammo classname

#

and instead of attaching it to the old bullet.
You set it's velocity and position to the same as the old bullet. And delete the old.

#

you might want "setShotParents" too

mild storm
#

oooh that how

#

that is what i wanted without cfg editing, a simple mk20 shooting 6.5 mm ammo

still forum
#

to get the ammo classname. Look at the config of the magazine you want. it has a ammo entry

#

But your weapon cannot load a different magazine. And the weapon itself also doesn't shoot different ammo

unborn ether
#

I don't think you can actually simulate bullet ballistics with just a scripted commands.

#

Or am I wrong?

still forum
#

you can

#

setVelocity and diag_ticktime is all you need

#

that's what ACE advanced ballistics does

unborn ether
#

Interesting, need to investigate.

waxen tide
#

afair ace checks the type of gun and only works on like snipers, but not on like miniguns or something.

still forum
#

nope

#

it did that in the past. over a year back

#

Back when it wasn't as performant as nowadays

waxen tide
#

interesting

still forum
waxen tide
#

I'm struggeling a bit writing into a database with extDB3. Reading from it works just fine, but my writing attempt does nothing.
admmsql.ini

[admm_get_all_known_maps]
SQL1_1 = SELECT `worldname` FROM `known_maps`;
OUTPUT = 1-String

[admm_insert_sector_coordinates]
SQL1_1 = INSERT INTO `map_positions` VALUES (?,?,?,?,?);
SQL1_INPUTS = 1,2,3,4,5
"extDB3" callExtension "9:RESET";

_result = call compile ("extdb3" callExtension "9:ADD_DATABASE:ADMM");
systemchat format ["connect to database: %1",_result]; // [1]

_result = "extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:ADMM:SQL_CUSTOM:ADMMSQL:admmsql.ini";
systemchat format ["select sql custom ini file: %1",_result]; // [1]

_result = call compile ("extDB3" callExtension format ["0:ADMMSQL:admm_get_all_known_maps"]);
systemchat str _result; // [1,[["Deniland"],["Altis"]]]

private _querycmd = format ["0:ADMMSQL:admm_insert_sector_coordinates:%1:%2:%3:%4:%5",worldname,_sector_counter,_sub_sector_counter,(_coordinates select 0),(_coordinates select 1)];
diag_log format ["_querycmd: %1", _querycmd];    // 0:ADMMSQL:admm_insert_sector_coordinates:Deniland:1:10:190:90
private _query = call compile ("extDB3" callExtension _querycmd);

Does anything look off her? (I read all the tutorials i found in google, still a tad confused)

#

@waxen tide how about you check the logfile

still forum
#

call compile -> parseSimpleArray

waxen tide
#
[18:37:57:049459 +01:00] [Thread 10196] extDB3: Input from Server: 0:ADMMSQL:admm_insert_sector_coordinates:Deniland:1:0:0:0
[18:37:57:049506 +01:00] [Thread 10196] extDB3: SQL_CUSTOM: Trace: UniqueID: 1 Input: admm_insert_sector_coordinates:Deniland:1:0:0:0
[18:37:57:049520 +01:00] [Thread 10196] extDB3: SQL_CUSTOM: Error No Custom Call Not Found: Input String admm_insert_sector_coordinates:Deniland:1:0:0:0
[18:37:57:049529 +01:00] [Thread 10196] extDB3: SQL_CUSTOM: Error No Custom Call Not Found: Callname admm_insert_sector_coordinates
[18:37:57:049539 +01:00] [Thread 10196] extDB3: Output to Server: [0,"Error No Custom Call Not Found"]
#

@still forum can you elaborate?

still forum
#

replace

#

more better

waxen tide
#

is it a performance thing

#

or a functional difference

#

?

still forum
#

perf

#

readability

#

niceness

#

reduced shittyness

waxen tide
#

ok

#

i just got it to work.

#

t-thanks. i guess. maybe.

#

is confused

#

wow calling this extension is suuuuper slow

still forum
#

yes. that too

#

But I think you can do something to make the writes async

waxen tide
#

it just slowed the script by like factor 1000

#

i am writing out every single position one by one tho

#

yeah

#

okay that's 20-30x faster.

midnight mauve
#

any idea on how to "modify" the engine itself ?

still forum
#

Talking about it would break EULA. So the answer is no

midnight mauve
#

allright my bad

#

even as a mod ?

still forum
#

If you were able to do that. You'd already know how.
Seeing that you don't. You still have years of stuff to learn

waxen tide
#

i mean writing speed i don't care too much about, but fetching data will probably be slow as well :/

#

meh

midnight mauve
#

yes indeed im a newbie, but i was wondering on how to improve the parachute / freefall flow on arma 3, but scripting would just make it worst

waxen tide
#

hm yeah okay 90k entries in 10 seconds :/

#

anyone has a recommendation for a good SQL tool? tried navicat, dbeaver and heidisql so far, none blew me away.

still forum
#

navicat is my top

waxen tide
#

well it's the only one that was able to delete all 90k entries at once, but they want money from me.

#

90 seconds for 16km² :/

#

(no markers, no diag_log, no systmechat Mr. M242)

still forum
#

I can help with that. PM

#

90 seconds. What was it before?

#

still scheduled?

waxen tide
#

before it was like 7 seconds

#

the issue is writing to the DB 9001 times

#

which isn't actually the problem

#

but if i want to read, i'll also wanna read like 4 or 9 km²

#

so if saving 16km² takes 90s i'm not thrilled

#

but i just got this to work so lemme tinker a bit maybe

still forum
#

My profiler would certainly have fun. But at your point I'd probably be optimizing extdb and not your script 😄

waxen tide
#

the saving is horrible inefficient.

still forum
#

mysql has a spacial xy coordinates type

#

combined. no need to store seperate

waxen tide
#

yeah but when i googled that the first thing i found was some bugreports so i ran away scared.

still forum
#

You could try to save less. instead of always saving one point.
Collect all points. And then save in one go

#

the length you can pass to a extension is equal to the max string length

waxen tide
#

that's what i tried to discuss here like 1-2 days ago

#

my idea was to actually save 1 table per sector, and as entries have 100 subsector lines * 10 different radii, so like 1000 lines per sector table and the values would be [x,y],[x,y] ....

#

but you said noooo jcd i have 30 million entries it's blazing fast DON'T WORRY ABOUT IT

still forum
#

nono. one table per sector bad

#

just don't insert everything seperate. Do one insert run. Into one table

waxen tide
#

elaborate please?

#

can i insert multiple lines in one go ?

still forum
#

yeah

#

INSERT..; INSERT... ; >INS....

waxen tide
#

oh uhm ok.

still forum
#

fu cramp in foot

#

maybe extdb has something nice for tons of inserts

waxen tide
#

i know what it doesn't have, a documentation i understand.

still forum
#

Yeah.. Same.. Just looked. it's not really... that informative

still forum
#

I've seen people talk about extdb features that aren't mentioned in the docs

#

so there must be some other docs elsewhere?

waxen tide
#

haven't found them yet 🤷

still forum
#

If I had the time I'd just make you a intercept plugin that does all you need 😄

waxen tide
#

that's a horrible idea. i have no idea what i need.

still forum
#

But yeah. Making an array of ["INSERT...", "INSERT.."] and at the end just joinString ";" and throw at extdb. That will work, if multistatement is enabled. Which you might have to do first in extdb config

waxen tide
#

i wanted to get away from copytoclipboard, and i would have been fine with make_file.dll without the "ARE YOU SURE YOU WANT TO ALLOW THIS TO SAVE A FILE INTO A FOLDER?" popup.

#

but i didn't find anything like that so i settled on sql

#

saving 1681 files sounds like fun tho.

#

kinda wanna do it.

still forum
#

I can make you a unprotected make file dll in like 5 minutes 😄

waxen tide
#

too late.

still forum
#

I have one...... WAIT.

waxen tide
#

nooooooooooo 😵

#

i just got SQL to work :/

waxen tide
#

there is a demo sqf file

#

glorious

still forum
#

"ConfigDumpFileIO" callExtension format ["open:AiO.1.%1.%2.cpp", (productVersion select 2) % 100, productVersion select 3];
"ConfigDumpFileIO" callExtension ("write:" + _myString);
"ConfigDumpFileIO" callExtension "close:yes";

#

first one is just filename. Which you should be able to see

#

but it can't read files

waxen tide
#

eh well, i'll stick to SQL for now

#

but thanks

#

might come in handy sometime

still forum
#

SQL is more professional and better anyway

waxen tide
#

pfff it's bloat.

still forum
#

PROFESSIONAL bloat.

waxen tide
#

i'm wondering

#

i'm looking at 4 mio positions for this map

#

should i throw the positions of ALL maps into the same table ?!

still forum
#

Yeah. If you make the map key indexed. Lookups will be fast

waxen tide
#

i got a table "known_maps" with just ID and worldname

#

and then each position has that map ID on it

#

but it seems kinda redundant to me

#

saving a map ID (the same one) on 4 mio positions? jeez

#

i sure hope sql internally optimises that away.

still forum
#

it doesn't. If you give that ID a 4 byte int. it will take that

#

you should make it a smallint

waxen tide
#

it's tinyint!

#

don't you dare save more than 256 maps.

#

i already see it coming. 50kb missionfile, 5mb serversided scripts, 50gb sql db.

#

i'm kinda stupid

#

the queries to fetch the data will be much better

#

it will be subsector by subsector

#

which can be like hundreds of positions

#

all fine.

#

i have 2 usecases: fetch a large position, then i don't care much where exactly it is, because they're rare (maybe 3 in the relevant mission area)

#

second usecase: i already know pretty exactly where i want something, and need an empty pos. in that case i search 1 subsector (100x100m) and probably get 20-30 positions and select one random. (and if it fails, i search the next subsector)

#

so fetching is so trivial already that speed should be splendid.

still forum
#

isn't tinyint just one bit?

waxen tide
#

it's 0-255

#

there is "BIT" which is 1 bit.

#

i guess BIT is for usecases where one would use BOOL ususally?

still forum
#

🤔 I need to do more database stuff again

#

I guess yeah. Not sure if the "bool" datatype is 1 bit actually. or if that was one of the pitfalls that it's not but you expect it to be

waxen tide
#

i didn't find bool, i looked for it and found BIT instead so i took that.

waxen tide
#

oh, now i get what's going on. extDB3 in async is writing to the DB minutes after i closed the game ?!

#

jeez

#

yeah ok i spam it way too much

waxen tide
#

@still forum I can't find anything on multistatement for extDB3

still forum
#

¯_(ツ)_/¯

tough abyss
#

Just write stored procedure and call it

waxen tide
#

idk how to do that

#

do you have an example?

tough abyss
#

Really? Just google stored procedures

waxen tide
#

i think i get it now. but that would have to be fixed length, while what i'm storing is kind of random length. so i would write a buffer that gets written once it hits the length

#

i'll try it i guess

still forum
#

you can just pass a string. And inside the stored procedure split the string and then insert

#

Will make the insert overall FKIN slow. But it's async anyway

waxen tide
#

but the idea was to make it faster by reducing the amount of inserts?

tough abyss
#

Start a thread then and return

still forum
#

Yes. you are still doing that

torn juniper
#

I am making a custom AI spawner, and I have a bunch of locations consisting of position, radius. Server handles the initial logic and sends all tracking/spawning to a headless client.

Anyone have an thoughts on HC tracking players entering the positon/radius then spawning AI, constantly monitoring about ~60 locations with a bit of delay between running through the list

or pass off that to the player and have the players let the server/HC know they have entered that location and then spawn the zombies based off their request

#

just trying to see benefits/downsides before I write either logic

waxen tide
#

@tough abyss i do not follow

tough abyss
#

Dunno if extdb is multithreaded

still forum
#

tons of async calls still cost much. Reduce it to one very slow async call. As the slowness doesn't matter to you

waxen tide
#

you can specify worker thread count

tough abyss
#

Sounds complicated

waxen tide
#

Thread = 0;
;; Option to force number of worker threads for extDB3.
;; Auto = 0, Min = 2, Max = 6

still forum
#

@torn juniper perf load on clients will probably be low.
If you want to give the clients optimum perf you can do it on a HC. That way you also control how fast you check. And you can always add more HC's. The clients can't just add a better cpu tho

torn juniper
#

true - thanks for that input

#

helps to have another set of opinions 😃 thanks!

tough abyss
#

Why do you need more that one worker thread?