#arma3_scripting
1 messages · Page 496 of 1
but M242 you could just put the code from the if then into the exitwith
You can
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
Doesn’t make it weird though if you don’t
¯_(ツ)_/¯
there should be an
if ( ) exitexitwith {};
that exits 2 scopes at once. i'm genius i know.
You can mark scope with scopeName "whatever" and use <returnvalue> breakOut "whatever" from anywhere, poor man’s return
oh, nice. didn't know.
Feels like a dirty goto.
ahhh the fond memories of goto riddled qbasic code 20 years ago ...
is there a script way to check if user have squad xml set in profile ?
squadParams ?
:+1:
@waxen tide that loop should be a findIf
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..
Impossible
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?
@tough abyss No jokes, I just attempted to createVehicle in preInited funciton and it said me so I don't have that "content"
Mod?
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?
you shouldn’t createVehicle in preInit
Yeah I get that now 😄
Is there a simple way to smoothly move a resource from the centre to the bottom right corner?
ctrlSetPosition ctrlCommit
Cheers
How would I be able to check a spawned object's owner with my debug console?
Current owner or creator?
Either. Both!
@shadow sapphire netID gives original owner, owner gives current owner.
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...
netID cursorObject // looking at the vehicle
owner _vehiclereference // server execution
Oh.... OH! I think I get it.
Drats, haha, you beat me to it. I wanted to try it on my own.
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];
setPos each player to each marker So Player 1 to Marker 1, 2 to 2, etc?
something like ```sqf
{_x setPos _bluforPlayerSpawnArray} forEach _bluforPlayersArray;
yes sir
{
_x params ["_unit","_marker"];
_unit setPos (getMarkerPos _marker);
} forEach [[bP1,"bPS1"],[bP2,"bPS2"],[bP3,"bPS3"],[bP4,"bPS4"]];
aaaaaaaaaa makes sense
Lets you pair a unit to a marker in any combination you wish
thank you gnashes makes sense now that you typed it
np
does that code need to be called? or can it run just like that?
As long as those units and markers exist at runtime, that can be executed anywhere and it should work.
so code doesnt have to be stored in a variable and called to run? it can be put in just like that?
yup, storing code in variable is itself code
awesome thank you
player setVariable ["nowInGame", false];
publicVariableServer "nowInGame";
``` Is this the proper way to announce this variable to the server only?
No
No
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
Doesn’t make the question code right
https://s.sqf.ovh/notepad%2B%2B_2018-06-04_18-30-19.png
This is how script error messages should look 😄
@still forum makes too much sense
4:58:17 Error 44021176 elements provided, 1784219632 expected
🤔
you tried to append an array to itself?
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 😐
using a 4mb array is blazing fast, i didn't expect that.
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]
is there a way i can create a marker with custom icon without needing an addon ?
You can drawIcon, that’s about it
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
configName
oh yeah now i see. thanks!
❤ @tough abyss
next thing, is there a way of scaling the rotation with ctrlMapscale ?
🤔 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};
How do you scale rotation?
@tough abyss as i was zooming in the rotation was moving quicker xD
How go you rotate it?
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.
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 ...
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
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.
@tough abyss i didn't in the end xD
that function was probably left for compatibility reasons
i was using the angle part of drawIcon
as M242 mentioned, most likely it was bit more complicated code before new native script command appeared
“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
yeah, i didn't give that much thought. breaking compatibility would be bad.
But how do you rotate it? @wary vine
Each frame?
You make it dependent on FPS of the Draw, if it changes speed of rotation changes.
it was only changing for me when i zoomed in
You need to hook the delta angle to time accordingly if you want constant rotation with any FPS
i just used a map marker for the rotating one in the end
the one he wanted rotating was a cfgmarker
When you zoom in out FPS changes
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.
FPS of the Draw could change regardless of map scale
{
[_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
Hi - I like everyone here
sorry did not saw that one
@waxen tide Are the double quotation marks intentional? yes. Stringified strings need double double quotes.
Or u can use ' "" ' or " '' "
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"];
this createUnit what is this?
The trigger? I guess that's incorrect then. Sorry I'm fairly new to this ha.
https://community.bistudio.com/wiki/createUnit
it takes group or string.. soo
So this wouldn't work if I didn't want this unit to be a part of a pre-existing group?
I think you can pass grpNull as gorup
I'll give that a shot.
Group null will just reject unit creation
"The Group parameter MUST be an existing group or the unit won't be created. " reading helps
Unit has to be in a group unless you create an agent
How would you give a unit more health with ACE?
Let him wear armor. A good vest and a helmet.
Another thing is to boost the player damage threshold on that clients machine. But that would introduce other problems.
how would I do that @digital jacinth
I could just remoteexec whatever you are thinking and have it applied globally
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
HandleDamage Event Handler will help.
I've tried that, it doesn't work with the ace damage system very nicely
Also ACE uses one, so you might want to modify it.
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
ight
https://s.sqf.ovh/arma3_x64_2018-11-02_18-25-53.png There's the setting ¯_(ツ)_/¯
give discord a minute to embed that
How do you manually set it? Not really familiar
Thanks @still forum ,iam on mobile right now and cannot look it up properly
it took me 7 minutes to open arma and get to that setting
Do I just put ace_medical_playerDamagethreshold = (number I want); in the unit's init?
no.
No
Well then that's not even what I'm asking
not a specific one
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
yes
Do you hsv access to init player local?
Ah yeah. You can use that variable for that then and set it just on that player
what variable? the ace thing you showed me?
yes
Yes
so how would I do that for an individual player?
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.
Okay and then what do I put
ace_medical_playerDamagethreshold = (number I want); ???
or how do I set it specifically there?
you need to set it after the settings are initialized otherwise they'll overwrite it again
And yes. You essentially do that
Ok so I make a delayed script that will run after they load in
And this script will be launched in initPlayerLocal, correct?
yeah
Kinda late for haloowee huh?
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?
People told you yesterday that publicVariableServer "nowInGame"; won't work
🤦
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
Biki is hard
I didnt see it yesterday. SOrry.
when using EH, do the params listed on the wiki pass using _this?
@wide hamlet
_this is an array of whatever variables the EH returns, obviously in the context of the code used inside an EH
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.
Ok, post it
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
you need to learn what "indentation" is.
its debug console lol. infi doesnt let me tab D: ill format it nice rn sec
@still forum publicVariableServer sends vars only to server
And you are telling me that because...?
@wide hamlet the event only fires where you add it
You said "I think you can make it send vars only to a server"
how do you mean?
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
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
you could do that yeah
you could also add it everywhere. And add a _unit==player check
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
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
im just saying for other EH that dont contain _unit
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
indeed. Ight ill start with compiling this up in my dev server and see where that leaves me.
Dedmen I am still confused. You said publicVariableServer won't work, but it does it's the resetDone portion that doesn't work.
You can only use it once per sqf file?
About ownerID?
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
^ which is exactly what we said yesterday
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?
Sorry Dedmen I am trying to understand this. So the player is an object?
nice, thanks
wow it even shows where i'm currently in. really could have used that a long time before.
Thank you for the explanation Dedmen and Dom. I'll have to figure out another way to do this.
We already told you how to do it. 3 times in total now
Really 3 times?
I found nothing about sending variables to server only on the setVariable wiki
To find out what ID you want you need a little bcakground info
https://community.bistudio.com/wiki/remoteExec look at the targets parameter. The text about the "Number" type
Thank you sir
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
sqf {_x setVariable ["nowInGame, true, 2]} forEach all players;
close... Quite close.
Ok ok hold on now
_id = clientOwner;
{_x setVariable ["nowInGame", true, _id]} forEach allPlayers;
🍿
_id = clientOwner;
player setVariable ["nowInGame", true, _id]};
@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
anyone know why in Altis framework have a function folder with bohemia functions ?
And prefix "BIS"
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.
do u think that?
Bortfive, BIS_fnc_ are functions bohemia put into arma3 itself. seems whatever you're looking at there overwrites these functions with different versions
ok
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.
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.
you can also just unpack the functions pbo in the addon folder of arma, but that might break some EULA
but they're not binarized or anything, they're just plain text files.
yep
They probably have them to hook them, or to optimize something
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.
Everything's a dildo
well it's a lot faster than the stuff previously, but 300kb of data per 1km² suddenly sounds bad when the map is 1600km²
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
Lets do chess in Arma.
Why?
Because why not? 😄
Let’s play poker then
Nice idea, lets make casino with our blackjack and.. exceptions.
And sell it to lifers
Free exceptions! Free exceptions! Only today!
@unborn ether https://www.youtube.com/watch?v=LkUBv6MixWQ
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?
@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.
Coolios, thanks.
@waxen tide lol
Is there something like http://killzonekid.com/arma-extension-make_file-dll-v1-0/ without the safety nonsense?
@waxen tide If you are about battleye whitelisting - use that on server, server doesn't care about battleye whitelist.
Write it yourself, it is literally a few lines of code with standard library.. oh wait, you despise extensions
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.
You said it, when you were trying to save your map in profile namespace and were told to use extension
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.
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
no, it is not time. people have written extensions to write into files and databases, i'm sure i can find something suitable.
I should be able to use intercept on a dedicated server for non-client stuff right?
does extDB3 not work in singleplayer?
So I have this script I want to use. Now where to I put it in editor?
was just the malloc being named wrongly.
┬─┬ ノ( ゜-゜ノ)
@soft ruin hit ESC, there is a debug console
Awesome thanks
@waxen tide Database in singleplayer?
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.
@zenith edge yes
Just make something good. No need to discuss
yeah too dumb for that.

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
Why? When you query your db you can dump it into an array, but it's not necessarily stored as an array.
i'm using that.
Ok, are you asking how to use it?
Extensions have output limit
no i'm asking how to lay out the SQL tables. maybe i should write down what i want to store first.
yes
yeah it's like 10k chars right?
unless your output data in one query is 10k characters, then you shouldn't have any worry.
i'm looking at 48mb of data to store
do you really need it all at once? Why is it 48 MB?
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
So prepare to call extension 4,800 times then to get it back
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
I don't understand what element of this data turns out to be 48 MB? Are we talking actual terrain data like heightmaps?
it's a lot of empty positions to spawn compositions on, roadblock positions, fortification positions and such
i suggest using mysql workbench when designing DB
and writing down all the columns you'll need
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?
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.
Splitting the array and storing numbers would actually be lot more efficient size wise
The furry has answers
yeah but i don't really care about the memory footprint. ease of queries and speed would probably be more important
Intercept could be really useful here 😄
i'm actually moving from extdb3 to intercept for my logging
@zenith edge like heidisql most so far. mysql workbench installer is broken, demands a vc redist that's uninstallable on win10 atm.
Intercept can write to DB?
^
intercept can do everything you want
I want an egg and bacon
i was also going to setup a discord bot plugin using discord c++ library
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
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.
moving server functions and functionality over to intercept for our mission
but i can do the same thing with extDB3, no ?
I guess yeah. But I think it's... Well you could use stored procedures to pull your stuff apart and store it properly
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 ?
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
but doing 1x1km takes 17 seconds ..........
because SQF is slow AF :U
store it inmemory in intercept and serialize it to save to file, and load it from a file and unserialize back into memory
i don't want to do that on runtime
then expose functions in intercept to mission, call those functions to get what you want from intercept
Maybe you can optimise it and run in scheduled before you need it
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.
Also with Intercept you don't have to worry about any size limits when calling extension 😉
i just have to remember how to use c++
better than sqf
this works fine tbh
but that's just roadblocks and houses
now i want empty positions
How close your test points from each other on map?
10m
"safe data" => "save data"
scheduled script
Yeah if you gonna draw and hint and system chat and diaglog it could take ages
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.
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
┬─┬ ノ( ゜-゜ノ)
I honestly don't know why your script takes so long
besides it being scheduled of course. That probalby 10/20x's your time
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.
a db connection is going to add in the latency to contacting a DB
Can run scheduled during loading screen, it allows for longer runs
Is that script on your github so that I could run it myself and find potential perf problems?
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 😛
unscheduled == 20fps? you're doing something wrong then
it should freeze the game and then just be instant done 😄
what script are you talking about dedmen? the one for empty positions, or the roadblock + houses madness?
the stuff that's taking the 17 seconds
@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
👍
You create marker right there and then why you say it is not included in speed test?
You have a while loop calling nearestTerrainObjects running 10k times
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.
Basically all what I said and you denied was true
idk but the average must be like ..15k loop iterations?
Anyone has an idea what might be causing cursor flickering on initial map screen?
Like this: https://i.imgur.com/XCmQlOU.gifv
That code is one big marker systemchat diaglog creation
Dedmen asked you for 17 seconds script and here it is
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.
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
no. my question was how to structure SQL tables.
it depends, do you know anything about database design at all?
yeah i build some small php/mysql projects between 10-15 years ago. you know, the typical stuff. guestbooks. forums.
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
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.
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
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?
are you saying you think it will be too slow if you have all of the x,y in a single table?
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)
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
imagine you have 1200 locations of [x,y]. you store a key on them to define that they're of radius 20?
you then use a join to determine what 1 or all those fields are for a particular thing you select
and another key for the info that they're from altis or tanoa?
thats 2 x 1200 x a key
seems silly?
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
do you use extDB3 ?
yes
can i connect to multiple databases at once?
why?
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
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
that's the old stuff. the new stuff i estimate at ~48mb for the map.
how many rows
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
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
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)
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
you are saying you think the file size is going to be greater than you want?
or that it will be slow?
both?`
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
Thanks @@tough abyss there is better performance bis fnc call or bis fnc spawn?
@knotty arrow Its better to use commands that are native to engine, neither BIS_fnc_*. Your case is call and spawn
Ok, thanks
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.
@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.
Use https://community.bistudio.com/wiki/weaponState @wide hamlet
@tough abyss Works like a dream. Ty for that.
hey jo, short question: am i allowed to use a percent symbol (%) in a stringtable? And how?
Who’s Jo?
nobody, it is just a slang
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"];
}];
source: Object - The source unit that caused the damage.
instigator: Object - Person who pulled the trigger
yea isnt that the same thing?
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 😛
The source can be a vehicle, the instigator not
whenever im in doubt i just add the EH and for the code i put diag_log str _this Helps out alot 😛
Look up getShotParents
A person
oh okay
don't forget UAVs
(PS: getShotParents always makes me think of Batman :3 hue hue hue)
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?
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
Thanks I'm new with GUI. I should stay with commnunication menu just for now.
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
Then I need to watch more guide for that.
@still forum ```sqf
_id = clientOwner;
player setVariable ["nowInGame", true, _id]; `` you said this was close?
How to make AI shoot moving target?
no I said this was even more wrong that before
you already had it right. Besides some syntax errors.
Dedmen do u know if its possible cuz I looked all over internet
But then you fixed the syntax errors. And removed the stuff that was correct
If I knew I would've already told you
player setVariable ["nowInGame", true, 2];
@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 ☕
yeah. You get ☕ I get 🛏
@still forum more 🌹🌻🌼 for you
pours his latte down the drain and fetches a quadruple expresso
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;)
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.
ok i found couple discussions there sorry
@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.
Thanks for the info
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
What does loon1 = this; do?
marks the unit thats spawning as loon1
For what purpose?
it refrences so the stuff calling this in its lines fire and apply to it.
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?
Let me hand you over to the writer @proud carbon
I don’t care about the writer, you asked the question, I ask you
Where do you execute it from?
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
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
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
a trigger
Then look in your .rpt file it should be full of errors
so he straight up copied and paste from someone's else script?
When script errors it won’t work, this is the answer to why it doesn’t work
btw way i am new to scripting so what is the rot?
Rot is autocorrection of rpt
so where do i find the rpt?
ty
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.
it is in a sqf
That makes no sense @earnest ore https://community.bistudio.com/wiki/BIS_fnc_taskPatrol the position should be position of the leader
Looks like someone took examples from biki and mashed them together hoping it would work out of the box
And probably should be getPos leader _Newgroup. 👀
And probably should find another coder.
yeah thats why i wanna learn me self
Also trigger execution is unscheduled you cannot sleep in it
in a sqf activated through a trigger would have sleep in it wouldn't it?
No idea what you just said
so you said a "trigger execution is unscheduled you cannot sleep in it" you can if the execution is a sqf?
Cannot see _heavychance defined anywhere either
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?
What is hunterscav array of what?
loadouts
Line 9, the init argument isn't properly enclosed in quotes.
Those rogue effing quotes man.
Warlord, Hunter, Heavy, Militia scav are loadouts of gear and weapons
what do you mean about line 9?
Are they strings are they configs are they arrays? What are they? Where you define them? It is not on the pastie
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
So they are objects?
So those variables are defined at the start of the script?
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
ok
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.
wait, so i can just overwrite their variables?!?
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
eventhandlers, yeah. For me It would be changing up a few things such as tapping on someone shoulders. guess a fork it is then
hi guys can someone explain me the rpt failure ?
the webconsole is full of theese
someone a solution ?
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
oh yeah thx u
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?
Yep is that, fixed
Now I´m having a problem creating a control in a class Areas like this: https://forums.bohemia.net/forums/topic/167884-dialog-controls-on-3d-object-surface/
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
This is my dialog: https://pastebin.com/VCmsSNMD
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
Any clues?
Can I safely use deleteAt inside count loop?
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
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?
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.
so if you are at element 5. And delete element 5. Then the next iteration will land you at element 7
O.o
Copy might be more expensive though. not sure
like
(+_array) count...
instead of _array count
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.
that is really stange for me x)
Ok obviously it wasn´t working, i missed class controls 🤦 what a waste of time
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.
I thought foreach iterate on a copy of the array
well. no.. That would be SUPER inefficient
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 ?
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.
Interesting. As always you deliver some interesting low level arma knowledge 😄
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
I knew about _forEachIndex but was unsure how count will behave.
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
Kinda, yes, some languages will not allow you to crash whole runtime/program by doing stuff like that.
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
You contradict yourself, you say it is c++ yet you can delete foreach elements while iterating and not crash
huh?
It is about how it is handled internally
I don't see a contradiction. And I also don't see the connection between C++ and deleting things
Not you
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
Undefined behaviour
shooter4 forceWeaponFire ["LMG_Minigun_Transport", "close"];
Why does this not work
Is the first element a muzzle and is the second element a valid muzzle fire mode?
https://community.bistudio.com/wiki/forceWeaponFire for syntax 😉
When using clientOwner, does the player ID get reused when a player disconnects and another joins after?
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?
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.
i think the FFAA mod has a script on the C130 that does that nicely.
killzone has a tutorial on how to drop tanks : http://killzonekid.com/arma-scripting-tutorials-epic-armour-drop/
killzone has a tutorial on how to drop tanks : http://killzonekid.com/arma-scripting-tutorials-epic-armour-drop/
scary hivemind there.
scary hivemind there.
OR JUST A BOT
OR JUST A BOT
Tanks would be a bit heavier than my intended goal but thanks for the reference link.
Hopefully it carries over.
apparently there is also a new function since apex to have some native vehicle-in-vehicle transport: https://community.bistudio.com/wiki/Arma_3_Vehicle_in_Vehicle_Transport
ah it doesn't matter if you drop a tank a car or a goat, they're all just a "vehicle"
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.
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
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
you're talking about the RHS C-130, right?
doesn't it already have that function? did you try?
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.
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?
Because your end position could be just slightly above surface for the intersection not to happen. Make sure the line goes through terrain
shooter4 forceWeaponFire ["LMG_Minigun_Transport", "close"];
Why does forceWeaponFire not work on gunner
Have you tried the biki example on the corresponding vehicle?
@winter rose Yes
@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
Works for me @gleaming cedar for AI it fires once for player it fires burst
There is nothing to send get into GhostHawk gunner and execute in debug console
Ok thanks I will try
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
isn't there a solution to do with scripts?
you can use loadmagazine to forcefully put DAR missles in a raised 50.cal
no
you can add a weapon and it's magazines to a vehicle yes.
Completely unrelated to this though
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
you can spawn a new bullet and delete the old
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] ];
};
};
}];
BIS_fnc_selectRandom We have a command for that. selectRandom
making a gun fire out suv's is working but changing its bullet/magazine to 6.5 is a different story
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
oooh that how
that is what i wanted without cfg editing, a simple mk20 shooting 6.5 mm ammo
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
I don't think you can actually simulate bullet ballistics with just a scripted commands.
Or am I wrong?
you can
setVelocity and diag_ticktime is all you need
that's what ACE advanced ballistics does
Interesting, need to investigate.
afair ace checks the type of gun and only works on like snipers, but not on like miniguns or something.
nope
it did that in the past. over a year back
Back when it wasn't as performant as nowadays
interesting
https://github.com/acemod/ACE3/blob/master/addons/advanced_ballistics/functions/fnc_handleFired.sqf#L22 that's basically the only check. Which rules out missles.
The rest is all range based.
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
call compile -> parseSimpleArray
[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?
ok
i just got it to work.
t-thanks. i guess. maybe.
is confused
wow calling this extension is suuuuper slow
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.
any idea on how to "modify" the engine itself ?
Talking about it would break EULA. So the answer is no
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
i mean writing speed i don't care too much about, but fetching data will probably be slow as well :/
meh
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
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.
navicat is my top
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)
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
My profiler would certainly have fun. But at your point I'd probably be optimizing extdb and not your script 😄
yeah but when i googled that the first thing i found was some bugreports so i ran away scared.
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
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
nono. one table per sector bad
just don't insert everything seperate. Do one insert run. Into one table
oh uhm ok.
i know what it doesn't have, a documentation i understand.
Yeah.. Same.. Just looked. it's not really... that informative
I've seen people talk about extdb features that aren't mentioned in the docs
so there must be some other docs elsewhere?
haven't found them yet 🤷
If I had the time I'd just make you a intercept plugin that does all you need 😄
that's a horrible idea. i have no idea what i need.
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
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.
I can make you a unprotected make file dll in like 5 minutes 😄
too late.
I have one...... WAIT.
"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
SQL is more professional and better anyway
pfff it's bloat.
PROFESSIONAL bloat.
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 ?!
Yeah. If you make the map key indexed. Lookups will be fast
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.
it doesn't. If you give that ID a 4 byte int. it will take that
you should make it a smallint
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.
isn't tinyint just one bit?
it's 0-255
there is "BIT" which is 1 bit.
i guess BIT is for usecases where one would use BOOL ususally?
🤔 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
i didn't find bool, i looked for it and found BIT instead so i took that.
https://i.imgur.com/8jlWvsi.png why remember stuff good software shoves in your face
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
@still forum I can't find anything on multistatement for extDB3
¯_(ツ)_/¯
Just write stored procedure and call it
Really? Just google stored procedures
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
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
but the idea was to make it faster by reducing the amount of inserts?
Start a thread then and return
Yes. you are still doing that
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
@tough abyss i do not follow
Dunno if extdb is multithreaded
tons of async calls still cost much. Reduce it to one very slow async call. As the slowness doesn't matter to you
you can specify worker thread count
Sounds complicated
Thread = 0;
;; Option to force number of worker threads for extDB3.
;; Auto = 0, Min = 2, Max = 6
@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
Why do you need more that one worker thread?