#arma3_scripting
1 messages · Page 357 of 1
getIn
tht triggers whenever a unit gets ijn
not sure about what you try to archive
but that should get you some steps closer to your goal as long as you understand some SQF
is this
helicopter is called med1
medi once there is a player inside cargo must go to a landing area
and repeat the cicle all over
{isNull gunner _x} was working
but i dont wanna the player have to be in the gunner seat to be trasported
{isNull gunner _x} count [medi1] == 0
this is the full activation
and {isNull cargo _x} does not exist
crew counts evreyone
<CODE> count <ARRAY>
_obj = gunner _x; {_x != _obj} count crew _x > 0
whoops
what is that
magic 😱
hf 😃
yes
{isNull gunner _x} count [medi1] == 0 is bs
isNull medi1 would be sufficent
private _obj = gunner medi1; {_x != _obj} count crew medi1 > 0
use that
now the tigger activate when there is not player inside
also, there is the AI pilot inside it
add more exceptions
alternatively you also can remove gunner etc. from the crew
think there was also a passengers command
i made it work
private _obj = gunner medi1; {_x != _obj} count crew medi1 > 1
that 0 in the end was what?
im gonna use that one you give me, thanks.
@queen cargo a object variable contains a pointer to a pointer. If the unit is deleted the second pointer is a nullptr.
but not in the SQF-VM
if (_grpSide != west || east || civilian) then {_grpSide = resistance;};
Since there is basically no consistency with what is used to refer to the independent side, I am trying to use this to make sure that the player side gets set to resistance. It says generic error in expression before the first ||
my
that's not how "or" works
you are doing
(_grpSide != west) || (east) || (civilian)
Which doesn't make sense
if !(_grpSide in [west, east, civilian]) then {
_grpSide = resistance;
};
But that still is pretty nonsensical.
As you can see https://community.bistudio.com/wiki/a_or_b only accepts booleans.. you are giving it sides
It also doesn't give you a generic error in expression.. It shows what the real error is just above...
Since there is basically no consistency with what is used to refer to the independent side
Yes there is. It'sresistanceandindependentjust like how NATO is onbluforandwest.
the strings return "GUER"
so it messes up my script format and complicates things
it only works if I set the default value to be resistance
Then fix your script.
private _fnc_serializeSide = {
#define SIDES [west, east, independent, civilian]
#define SIDES_STR ["WEST", "EAST", "INDEPENDENT", "CIVILIAN"]
params [["_side", sideUnknown, [west]]];
SIDES_STR param [SIDES find _side, "SIDEUNKNOWN"] // return
};
call compile str resistance // any
call compile (resistance call _fnc_serializeSide) // GUER
I posted this 3 times this week already. D:
😱
I didn't know you could modify values like that
I don't get the problem. This is very easy to do.
There is no value being modified in that script...
literally...
also.. @little eagle isn't the comment on the last line incorrect?
How so?
GUER IS independent
The function only returns "WEST", "EAST", "INDEPENDENT", "CIVILIAN", "SIDEUNKNOWN"
It can't return "GUER" or GUER
so it doesn't change what the green side string is?
GUER is how independent is represented.
I just assumed the comment is telling the returned value
It does.
call compile (resistance call _fnc_serializeSide)
GUER
call compile str resistance
any
I see....
Don't tell me this is too difficult for you too^^
It is
params [
['_grpType',configNull,[configFile]],
['_grpCost',0,[0]],
['_grpSide',sideEmpty,[civilian]]
];
if (_grpSide == civilian) exitWith {hint "You cannot recruit civilians! That's a war crime, you absolute cunt";};
private _p_balance = [WEST_balance , EAST_balance, GUER_balance] select ([west, east, resistance] find _grpSide);
If I play as independent it always uses the default value, which in this case is sideEmpty, because the "GUER" string is what is being passed into the function
I already closed everything besides discord because I wanted to go to bed
just make the default value be resistance instead of sideEmpty
if you already know that sideEmpty can't happen as you always pass in a valid side
There is nothing wrong with this script. The issue must be in how it's called.
yeah. He posted earlier today. He is calling this via a formated string
Command is formed with the format string
You can't do that. Change it.
If you really really have to "format string" (serialize) the side, then use:
private _fnc_serializeSide = {
#define SIDES [west, east, independent, civilian]
#define SIDES_STR ["WEST", "EAST", "INDEPENDENT", "CIVILIAN"]
params [["_side", sideUnknown, [west]]];
SIDES_STR param [SIDES find _side, "SIDEUNKNOWN"] // return
};
call compile str resistance // any
call compile (resistance call _fnc_serializeSide) // GUER
And it will all work out and there will be no problem.
...
I kind of need to since it is a diary record and the part that calls the function is dynamicish
Anyway, thanks for your patience
Yes and I posted how you have to do it
Where should that code be?
because I'm retarded I don't know what to tell you
Post the line where you 'format string' the side
could I post it in the init to be used in all of the format strings? There are several of them
actually nvm I can just post it where all the records are created
... ?
is there a way to turn off a trigger? like, i dont wanna hes conditions to be meet until another trigger activate first
triggerActivated triggername
or set a variable to true when the first one activates
use that as the condition
how i set a trigger to false?
not sure what you mean
you said about set a variable to true?
In the init or a game logic, put myvar = false and in the first trigger myvary = true on activation and the second trigger put myvar as the condition
second trigger won't activate until the first one
yeah
in case of triggerActivated triggername && triggerActivated anothertriggername
i nedd to activate the 2 triggers or 1 at time and still works?
{isNull gunner _x} count [car1, car2, car3, car4, heli1, heli2] <= (4 - ({alive _x} count playableUnits)) max 0
this condition is supouse to work only if there is 4 gunners in total in those units but only alive players/AI slots
this is not activating
any idea?
they need to activated at same time?
// if there are 4 gunners this will return 2
{isNull gunner _x} count [car1, car2, car3, car4, heli1, heli2]
// if there are 4 playable units, this would be 0
(4 - ({alive _x} count playableUnits)) max 0
so your basically doing 2 <= 0;
2 is never less than or equal to 0
and if i put >=?
do u want it just players as gunners or any player or AI, as long as there are atleast 4 gunners?
then u could just do
{!isNull gunner _x && {gunner _x in playableUnits}} count [car1, car2, car3, car4, heli1, heli2] >= 4
which is if the gunner is not null and the gunner is a playable unit.
about the trigger, they need to be activated at same time or one time only?
I am just going to start over with my better understanding of things now. I hopefully will do things right this time
{!isNull gunner _x && {gunner _x in playableUnits}} count [car1, car2, car3, car4, heli1, heli2] >= 4
this did not worked
3 AI gunners in and 1 player in and still not firing the trigger
Well yeah, this only is true when 4 players are the gunners, not AI
playableunits includes playable AI?
i find another way around
quick question, if i add a DLC prop, units, vehicle people need to own the DLC to play my mission?
i expect it will add said DLC to the requiredAddons list in your mission file so yeah
no. You can play still play the mission but if you use weapons or vehicles belonging to a DLC u dont own it will have watermarks (and maybe wont let you use some things, im not 100% certain on that).
is the biki dead slow to anyone else?
dead, yes
google cache?
Both the forums and biki are down.
stares at a wall, motionless
What do you need?
a working biki.
😗 thanks commy2
just use google cache like senfo said
or you could wget the whole wiki the next time it's online, i did that a year or so ago
somehow google cache isn't working out for me on biki.
same
Anyone aware of a way to figuring out if PIP setting is turned on?
@Adanteh#0761 isPipEnabled?
that works. Guess i sholudve checked the archive page
Does anybody have a clue how I could get the path of the surface texture? With surfaceType I can get the surface type. When I remove the leading # I get the config name in CfgSurfaces. But there the paths to the textures are not defined, there is a wildcard for the file name. When just using maps from A3 I can parse this and get the path of the surface texture (\a3\map_data\<tetxure>_co.paa) but this doesn't works for community made maps. Theoreticially the absolute path has to be defined somewhere. But where is it defined?
Why you want the path ? Its prob baked in the wrp or rvmats for the surface mask.
One example could be having custom fortifications with a hiddenSelection for the dirt mound, which you would then texture according to the surface it is placed on, by retrieving the surface texture for it.
Anyway from a terraijn making perspective you never specify the path in something that you would be able to read through scripting. The full path is specified in layers.cfg, but that gets baked in
does anyone know if teh NVG goggles overlay is a dialog control or display that can be accessed?
looking at my terrain files and scripting i dont think it's possible @shut flower
i think you'll have to go the route of either creating some config entries yourself for each terrain or using a switch for worldName and just looking up the paths that way
It would require you to manually add support for terrains, but dont think you got another option
thanks for point me out what is it
hi, can I script here?
Yes you can script here
script machine broke
special someone told me that you would like this
tickTime = diag_tickTime;
diag_log format["Time to complete: %1 (in seconds)",(diag_tickTime - _tickTime)];
that returns
"Time to complete: scalar NaN (in seconds)"
@simple solstice its because the first "tickTime" is missing an underscore
I know that, but people were looking what causes a NaN error(?)
yup, x39 was looking for NaN errors 😃
It's not really a NaN value though. It's a nil with the NaN type. Because all math commands can return either NUMBER (scalar) or NaN (NaN scalar).
All the math commands in SQF are set up to report NaN by default.
Other commands that can't report NaN, but only NUMBER do this:
str [_undefined ammo _undefined]
"[scalar]"
@queen cargo
So careful, scalar NaN is a nil value and not a NaN value like 1+INF or QNAN
[nil, nil ammo nil, + nil, sqrt -1]
[any,scalar,scalar NaN,-1.#IND]
damn copy paste
ugh...
[nil, nil ammo nil, + nil, sqrt -1] apply {typeName _x == "NaN"}
// [bool,bool,bool,true]
[nil, nil ammo nil, + nil, sqrt -1] apply {isNil "_x"}
// [true,true,true,false]
all these typos, urg
How can I setVariable on before initPost
By doing it?
at init.
I guess I might jsut add a sleep to my function that requires the variable
I might just have to put a sleep for ~1 sec and then loadout
probably best to do a little randomization for the sleep as well, as loadouts might cause fps drops
setVariabe public is broken for the object init events. It doesn't synch, no matter if the object is created at mission start or during the mission. And that is one reason why InitPost exists in CBA.
well, im having trouble with AI (once more), now i dont know what i did but they are not following correctly the leader of the convoy
they just stop in the middle of the road sideways and do nothing
any idea how to fix that?
Delete them and create new ones?
by doing that im trowing a week of work to the trash
That's impossible
You already worked, so you already spent it. Can't get it back and throw it away.
You could however throw the result of your work in the trash
they just stop in the middle of the road sideways and do nothing
Are they grouped together?
yes they are in the same group
actually, one of they stop in the midle of the road stoping everyone
hmm
is there any way to prevent an object from jumping up when being detached from a parachute?
I have tried several things, mostly attempts with enableSimulation and setPos
but everytime the object gets detached, it appears a few meters above where it was and falls to the ground
nvm setPosATL seems to be the way to go
threre is a command to make enginne invunerable?
Anyone who can help me regarding to script a weapon I'm making?
you need to be more specific
well, I want to know what I need to do
My modelling artists are setting up the weapon model
how do I actually make it work
assign a sound to it
assign the animation they're making*
You should do some research before coming here, since that AFAIK is pretty basic stuff, but if you have trouble, you should ask in #arma3_model
that is all just the config and model.cfg work
@astral tendon No, you'd have to use handleDamage eventhandler instead
Is there a way to avoid doing private do get to the previous scope?
because I'm too lazy to private ~20 variables
_var 1 = 1;
call {
_var2 = 2;
_var3 = 3;
};
_varTotal = _var1 + _var2 + _var3;
How to I do this with the least amount of effort?
I might just do global variables ...
I'll try using global variables
and I used allVariables command to grab the varaibles
So I'll reset after every use
I hope this won't be slow
jeez. this all seems stupid..
You're drunk.
Nop.
Is there a way to avoid doing private do get to the previous scope?
???
Yes.
Well, solution 1:
_var1 = 1;
_var2 = 2;
_var3 = 3;
_varTotal = _var1 + _var2 + _var3;
Get rid of the scope.
I need it because I'm loading a file
"loading a file"
call compile preprocessFileLineNumbers _factionFile;
private code = call compile format ["loadout%1Code",_role];
🤔
I'm adding a file that can be anything and then I'm getting a value that can be anything
Unknowns
I'd rethink the structure of what you're doing.
Before I had a huge array of private variables, but that ment if I ever wanted to add something I had to add another variable to private array
Basing your code on carried over locals is really bad.
Now I will just use global variables instead
but that ment if I ever wanted to add something I had to add another variable to private array
Yeah, that's why we have the keyword now.
Well now I can just _unit setVariable ["unit_loadout_role","ANYROLE"]; and it will get it from the proper file
Object namespace variables are always a good idea.
When I last tested, I think with 32 bit game
Took many millions variables to crash game
So it should not be an issue
Either way I got a script to delete everything
Eh, all the variables you can think of will only ever make up a tiny fraction of what a single texture will eat of memory.
I'm also going for more of "First do it, then optimize it"
Seems to be working out nice
Havind doubts 'tho:S
It's not what I do, but the more "professional" programmers I know talk sometimes about that approach.
Very rarely do people actually use techniques to optimize code in SQF. It's more like rewriting it to compensate for the lack of a compiler that would do that stuff for you.
And stupid arguments like count vs. forEach.
Yeah, while in reality all we need is 200 fps server 😂
I wonder if that benefits scripts?
In theory it should give more time per second to the scheduler
So scheduled scripts should run better...
Quantum computers.
Ok, in theory there are way better and faster script engines / languages... so there's no need to push hardware until we've peaked software wise...
Don't think the problems of Arma with performance come from SQF.
What's the biggest killer?
I have no idea, maybe dedmen knows. I suspect animations and PhysX.
ai...
Eh, not sure. Many soldiers also means many animations going on.
I think what's also a huge part of understanding is comparision to other games...
To test one would have to place like 100 v 100 VirtualMan_F against each other.
Those have no model.
VirtualMan_F The what?
It's just like B_Soldier_F, as soldier classname, but without model.
No model = no animations. In theory.
for "_i" from 0 to 1000 do {private _guy = "VirtualMan_F" createVehicle position player;}
//3fps
stabilized to 15 in a few sec
You need createUnit
12 fps with 100 createUnit
"Yeah, while in reality all we need is 200 fps server 😂 " That guy is so annoyingly stupid ...
is there a way to set the high command commanders entirely through scripting?
The eden editor has a function to save compositions. they're saved in an extra file each, sqe format, and the contents look like this: https://pastebin.com/xtAG5CLi
i would like to use this format to save objectives i spawn dynamically by scripts during the mission. but i'm a bit clueless how to interact properly with these classes? i mean i know the basic concept of classes i've just never used them in sqf and my google fu failed me. maybe someone can point me in the proper direction. 😳
include them in ur description.ext (or config.cpp if ur doing a mod?).
for spawning them id just use soemthing like forEach ('true' configClasses <configDir>) to loop through each item in the composition.
it is just a mission, not a mod. okay i'll play around with configClasses. but it doesn't seem there is any real advantage in this data format?
i guess the advantages of classes (inheritage?) can't really be utilized in that case
its good for readability i guess. i tend to use configs instead of arrays of data cause to me its easier to understand getNumber(missionConfigFile >> 'myClass' >> 'myNumber') than _array select 4 or whatever
fair enough
getNumber(missionConfigFile) can be replaced if they fixed it using the BIS function.
@waxen tide
by what?
Less messy.
or
Not sure if it still works though.
It had issues with some config files I used #include config.hpp to use seperated config files.
Had issues where it wouldn't pick up the #include headers copy placed into the file
i'll check that out, thanks!
np.
DutchMan.Hx - vandaag om 09:28
i never saw that channel
btw
quick Scripting question
i wanna have AI follow into a Player vehicle
multiplayer session
i have a netID
Major Mittens - vandaag om 09:28
Lol go #arma3_scripting 😛
DutchMan.Hx - vandaag om 09:29
Do i need to use the Netid from the player to dertermine what kinda vehicle it is or get the NetID from the vehicle so that i set the AI to follow it
backtick backtick backtick sqf
so, all sorted
If you wanted to post the code you've got so far.
AI is handled server-side.
I know
So making them follow the player isn't too hard. Even in MP
Do you need to know what kind of vehicle the player has?
cant post the code in here
codeshare?
some like that
Just waiting for Atom editor to install SQF syntax highlighter.
afk I've got do go do somethings.
it exists
Okay so it's a flow logic error.
it follows the player
But?
but i need to let it check if the player is inside a vehicle and if
let it get in the car with the player
that it is following
but
with whatever i tried untill now it didnt work
so i took a snippit from a other script that i knew worked in the past, not sure if it still does but anyway, i figured adapting it to get the vehicle from the netid or something would be sufficent enough to make the ai stick to it and get in
waitUntil {!isNil BTH_RTS_MissionInitComplete}; Shouldn't this wait until a variable called BTH_RTS_MissionInitComplete is defined? It gives me an undefined variable in expression error, which doesn't really make sense
nevermind it is supposed to be a string
btw that group spawning issue I was having a couple days ago is something I just decided to approach differently.
BTH_RTS_TEAM_BLU_Grp_List = [
[["B_Soldier_SL_F", "B_soldier_LAT_F", "B_Soldier_GL_F", "B_soldier_AR_F"], 550, "Fire Team"]
];
An array with a list of units to create a group from makes things much easier and allows much more customizability
i need to run a line of code whenever a player removes his backpack.. how do i detect this event. ?
You guys know any way to disalbe fiendly fire?
@astral tendon like no getting damage or preventing friendly AI shooting you?
no get any damage by fiendly
@peak plover true. The more fps the more scheduler time. so scheduled scripts finish faster. That's about the only improvement I am sure about.
And yes.. There are faster script languages.. #Intercept
Biggest part of Arma frametime is usually simulation and rendering.
@runic surge The syntax is isNil "varName" not isNil varName
Does simulation include animation and physics?
yes
Now the question is which part of the simulation is the worst.
I suspect it is really bad, but does it come into play when everything is stationary? Is it that poorly programmed?
I'm really suspicious of the animations of soldiers. They seem very complicated when you look at the config and how many classes there are and how convoluted they are linked.
Yeah. Some of the animations look pretty bad.
But again doesn't all this get piped again through SQF?
No.
The only things that are SQF in vanilla are... let me think... Many ui things and stuff like modules and eden attributes.
What exactly?
Can't recall and don't have A3 installed but I de'pbo'd a bunch of files and found a number of scripts.
I mean come on the cfgFunctions.hpp
is written in SQF :/
I've seen the code that manages it.
Oh yeah. The initFunctions.sqf is SQF. But that runs at mission start and is done at some point.
Also the .fsm of the animals etc.
But a lot of the functionality as a whole the entire game is built on SQF I think that there is in part of the problem.
Everything SQF is not part of what dedmen said is simulation and rendering though. It should be it's own item.
No that is true.
But his "FPS unlocking solution" according to dwarden will just improve some scheduled scripts execution
Doesn't unfortunately effect the Simulation loop
I think that there is in part of the problem.
And I don't think so. Not because it wouldn't be if the premise was true, but the most complicated things are done outside SQF.
The FPS unlocking is rather pointless when your server already is below 47 FPS.
@tough abyss initFunctions.sqf us actually quite performant. I rewrote it in Intercept and didn't get much improvement out of it
It's pretty ugly though.
@tough abyss "But a lot of the functionality as a whole the entire game is built on SQF" Not that true.. SQF is still a very small part if you look at the rest of the engine
@tough abyss Not according to Dwarden.. According to me. https://forums.bistudio.com/forums/topic/210492-server-fps-limit-testing/#comment-3233256 That is what Dwarden said.
It does affect the simulation loop. In that it get's double the executions if you run at 100 fps
and as you can see rendering is what.. 75% part of the frame?
The vanilla debug console is so tiny^^
@tough abyss Can you even read what you post? wDisp 2ms rendr 16.5ms
Look at my dia_capture you could say sound is the performance hog.
Look at the "main thread"
I do..
You are trying to tell me that of 28ms the 0.6 and 2ms ones are the most performance hogs? but you ignore rendr which takes 16.5ms
preload. Load Models/Textures from disk
Yeah, I never bought into this the "sound breaks the FPS". I believe people started thinking this, because a problem that causes bad FPS also affects the sound. But not the other way around. Also gunfire sounds, but the simulation of the fired bullet is the actual problem.
I just don't see how playing a sound would be expensive compared to drawing a landscape and models.
It does sometimes though.. @little eagle There is some bug that causes sound to sometimes go to 90+ ms. It's processing sounds you don't even hear and that shouldn't even exist.
Very hard to reproduce so I don't know of BI already fixed that by accident
Particles are on CPU
There is lies a big big problem
Move the particles to the GPU
SpaceEngineers recently did this.
Eliminated a number of performance issues
Particles are also multithreaded.. except they need to be on main thread for some reason
t does sometimes though.
Sure. Never exclude dumb bugs like that..
I really don't like the word multi-threading when talking about ArmA 3
Space engineers is still a power hungry game regardless of those Little performance updates
It does a weak scaling multi-thread.
Also server still has to calculate particles. Server's usually don't have GPU's
Called... function parallelism if I remember correctly.
Everything is talking back to the main thread.
So you can clearly see this when you try to run 4 HC's
I've done it for a community CPU core 0 maxed out.
The entire server effectively got crippled, and when a HC DC'd oh yeah that wasn't good.
I even had the HC's locked to specific cores
to keep them contaminating the server loop
do a serverside captureFrame and check why that happens
Oh, also MP is pretty poor compared to SP.
If you have 4 HC's on your server, you have 5 different main threads.
@tough abyss Where did you come from btw? Your first message in this Discord was starting this conversation.
I'm the one you and RyanD were berating for being a retard
I've seen this name before.
Why do you need a new account?
Seperation from personal-life.
As I said I am not a "noob" when it comes to this game.
I had to do a lot of RND for that community.
The servers just couldn't handle everything on 1 thread.
Even with HC's...
That needs to be fixed.
Again. Check what exactly is the problem using profiling build.
I was belittling your results I got shirty when RyanD was being an asshat
I apologize.
48 cores is a lot though. And Arma is single threaded for the most part. Maybe the server just isn't suited for the game? Lot's of smaller cores shouldn't help at all.
Yeah.. Fewer higher clock/IPC cores are way better
Get a watercooled server. Overclock CPU to 5Ghz and profit.. This is getting #hardware_vs_arma again.. kinda.. or #offtopic_arma
It has been offtopic from the start. But it's not like any meaningful discussion about sqf was going on here. So who cares. Don't make me switch between 50 channels-
We always go offtopic here anyway 😄
Let's talk about how replacing forEach with count is dumb.
well.. it is faster...
BI should just add a forEach without _forEachIndex.. That will be faster again because it doesn't count
I put that into the same category as saying
false || true
is faster than
false || {true}
It's technically true, but in practice worse.
A)
{
_x;
nil
} count [1,2,3,4,5,6,7,8,9,10];
B)
{
_x;
false
} count [1,2,3,4,5,6,7,8,9,10];
C)
{
0 = _x;
} count [1,2,3,4,5,6,7,8,9,10];
A, B or C?
all are kinda bad
Thinking of it... Turning true/false into constants instead of commands.... Would make that even faster again
myTag_true = 1 == 1;
myTag_false = 0 == 1;
#define true myTag_true
#define false myTag_false
+100FPS
No.
might even be worse than the command call
Which again.. nulars being variables or commands is evaluated at runtime.. so... another thing to fix
nularies* I meant
ah yeah... the player thing..
calling player is slower than getting it from a local variable in lowest scope
which is different from a global variable again
#define is probably better than a variable assignment only if it's used constantly.
Yeah, globals are worse.
as it doesn't check if that could be a script command. because commands don't start with _
#define doesn't make any runtime difference
Weird according to the wiki it saves memory.
What?
Disk space?
where does it say that? 😄
Doubtful.
Geekguy, are you fracture?
@rough heart yes. he already said that before
It's rather slightly worse due to it's usage and you having to make the macro callsafe.
it triggers the shit out of me
GAWD
Using a hard coded constant more than once? Use preprocessor directives rather than storing it in memory or cluttering your code with numbers. Such as:
But, for real, he got banned?
#define BUFFER 1.053
_a = _x + BUFFER;
_b = _y + BUFFER;
no
Macros do save disk space though. At least for SQF. But no one should care about that.
I think the most interesting article I dug out of the net was this one.
true. It's easier to code. But at runtime it doesn't make a difference.
It makes the uncompiled raw script smaller but after compiling there is no difference
Also a compiled script stores the preprocessed script. not the unpreproced variant
Compiled script is so confusing does anything actually get compiled?
Using a hard coded constant more than once? Use preprocessor directives rather than storing it in memory or cluttering your code with numbers. Such as:
Macros are better than global variables performance wise, but so is putting the same number over and over again into your code. And doing that is exactly the same as using macros after the script is preprocessed.
@tough abyss Read what it is telling you. Storing something in a variable is using more memory.
Which does make sense
@tough abyss Yes.. SQF is being compiled.
Compiled in what way?
From string to binary instructions
I have a way that could disprove this, maybe.
Correct. Arma's VM is not a Java VM.. which doesn't make sense... Because Arma is not Java
@tough abyss What is it then.. If you know so much better than me
Yeah but it uses a Virtual Machine to execute code correct?
I don't think the definition of VM is quite fitting here
^^^
Not in that sense it's virtualized in the sense ArmA 3 understand s it
test_code_str = "call { 'code with whitespace a compiler should remove' }";
test_code = compile test_code_str;
"{" + test_code_str + "}" == str test_code
???
is there a way to reduce gunner acuracy?
Why not?
a CODE variable consists of the preprocessed string & the compiled instructions.
when you call str it returnes the preproced string. preproc doesn't remove whitespace
I'm betting that the ArmA 3 VM is just a string based interpreter mapping those strings to C++ insutrctions.
@astral tendon setSkill ? I guess
And if that is the case where does the "code get compiled" ?
i set to 0 and still sniping me
@tough abyss It's compiling the string to an array of instructions. Each instruction has a Execute function that does stuff.
@astral tendon Using mods?
compile @tough abyss
RHS
But what are those instructions?
a CODE variable consists of the preprocessed string & the compiled instructions.
That is really weird, but it would explain the issue. It also means that sending compiled code over the network is even worse than sending uncompiled strings.
Constant,Nular,Unary,Binary call for example
If for example you look at intermediate languages like MSIL or Java Byte code
this setSkill ["aimingAccuracy", 0.0]
is that what this is?
yes roughly
I had the smae issue with tanks. They would never miss, no matter what accuracy. I guess they are using a weird way of doing shots for tanks
for the gunner and the vehicle
So what is that intermediatry language coded in itself?
coded in itself?
@little eagle true that. I think Arma doesn't even compress the string when sending
The programming language used to build the intermediatry language interpreter or compiler.
C++
And C I believe
Well... C++ that is also C code..
No...
C is not C++ not even close.
C you have to manipulate memory addresses by hand...
C code is the same code in C++
The result is the same after the game is build, no?
pointers and all that fun.
yes
No C is not the same as C++
C is far more efficient, if used correctly.
C++ is managed a lot of the time.
Write a piece of C code. Paste it in a C file. works. Paste it in a C++ file. works. exactly the same.
You could say that every C code IS C++ code.
true
I wonder, if #intercept would help with performance when doing loops there and for ex. remove ai FSM and do ai stuff there?
Not every C++ code is C code though.
^
Hence, Arma is C++
C++ is much easier to deal with.
Than C
C is very unforgiving of errors segfaults are a persistent issue you have to deal with. Also, buffer overflows are really easy too. due to memory constraints of data types.
The question is, do we trust the compiler making the C++ efficient more than the programmer writing efficient C?
Depends on the programmer.
Now look at what we got.
: P
@tough abyss Same in C++.. Except you stick to modern c++
We're not talking about Arma, not a kernel.
so @tough abyss If you know C++ I can also explain it to you that way.
SQF code is compiled into a tree structure of C++ Classes. Each class has a virtual execute method.
The levels of the tree are the scopes in SQF. If you use call you go into a subscope which is a level lower in that tree.
Arma goes through the tree then. So a SQF instruction execution is a pointer lookup in the vtable and a function execution.
It's not parsing the String live as in SQS
Yep understand and no currently focusing on studying Python and C
Been using Linux more and more so C is very useful.
were should i use CBA_fnc_addPlayerEventHandler need it to run a script when it detects loadout change.. i have tried initserver.sqf and init.sqf to no avail.
When you talk about classes yes I understand instantiation so this tree which is the root class?
init.sqf
@peak plover loop performance https://www.reddit.com/r/arma/comments/6zvcpj/intercept_version_090_released/dmygvyu/
Senfo is writing Zombie AI on a Server using Intercept.
Tree data structures have a root is call that root?
@lavish hamlet Player Eventhandler only works on the players machine. Not on the server
The root is called "Simple" it does nothing besides holding a local variable namespace. It's execute method
so this ["loadout", player call '\RDF_Radioer\scripts\forceWalk.sqf', true] call CBA_fnc_addPlayerEventHandler;
in init.sqf should work ?
So in which direction is this traversed?
no. you are missing {} @lavish hamlet
no.. A tree is by definition not that.
call expects {CODE} and not 'STRING'.
Wait I'll do a thingy for you
So this tree is basically starting at "Simple" this branches off to more tree branches
So which is processed first in this tree?
In terms of commands?
This is intriguing and might explain some of the screwy results SQF gives.
or any way to reduce the damage of a vehicle?
1.0 call {
diag_log _this;
}
Base
Constant (1.0)
Code ({diag_log _this})
binary func call (call) (call opens a new level and executes the code)
And here is what is inside that Code:
Base
Nular func call or varialbe (_this)
unary func call (diag_log)
RDF_fnc_forceWalk = compile preprocessFileLineNumbers "\RDF_Radioer\scripts\forceWalk.sqf";
["loadout", {
player call RDF_fnc_forceWalk;
}] call CBA_fnc_addPlayerEventHandler;
As I said which part of the class tree gets processed first?
So when it executes that code in the end it does in this order
Constant (1.0)
Code ({diag_log _this})
binary func call (call) (call opens a new level and executes the code)
Nular func call or varialbe (_this)
unary func call (diag_log)(edited)
It is a stack machine internally. Constant and Code push to the stack
a binary func call pops it's left&right arguments from the stack
The "binary func call" class has an array of possible functions as member variable
in case of call that array has only one element. That element contains the pointer to the C++ function in the engine
so call.methods ?
that array has multiple elements for SQF commands that are different depending on which type you pass into one of it's arguments
No offense but this sounds like a screwy way to make a compiler.
Finite Automata?
So it is line by line instruction
So why doesn't BIS make an actual high speed bytecode interpreter?
Take all commands translate them to byte code execute?
SQF comes from a little basis of commands from the first arma, back then there was no need to have that few things on highspeed, as arma itself and hardware back then was still slow
A Interpreter by definition parses the source code while executing it. Which Arma is not doing. It's compiling it into a intermediary that's easier and faster to execute
then arma got bigger and then kept using the same engine again and again
SQF comes from SQS.
Now Enfusion is their attempt to make things better, and they did
Yeah I've open'd the DayZ pbos
Enfusion is different
It even looks far more akin to C++
i played dayz mod for ages, and when i look at standalone i got more fps everywhere, and the leaked enfusion scripting looks way better to use than sqf
@little eagle thanks works like a charm 😃
I just wish ArmA 3 SQF actually allowed me to run my little immersion scripts around the bas 😦
They weren't even processor hungry.
simple PlaySound3D compiled with a spawn'd loop
and a sleep command.
It was utilizing the builitin sound-files arma 3 had like the quad-bike to mimic a generator running at a base.
And the chatter from the radio sounds file to mimic radio chatter under tents
with sat-phones and computers.
So what's the problem? That sounds feasible.
It was, till the mission had 30 - 40 people.
it was running scheduled and started to stall.
The generator sound I had running on a while loop
it was running scheduled and started to stall.
I hate the scheduler too.
every 0.5; seconds
Running clientside? @tough abyss
Move it clientside?
[{
//playSound3D
}, [], 0.5] call CBA_fnc_addPerFrameHandler;
fixed
Then grab my 200fps patched server. If you run at 200 fps then you'll execute 4 times the scheduled scripts
PlaySound3D plays global
Can't limit it to CS otherwise the object wouldn't exist.
But I had all these little scripts I had for the community I'd written.
Don't use the scheduler and it will work just fine.
I mean on Takistan I had to massively modify a script to work with a sand storm
biggest issue with it was, getting the scheduler to play nice.
It hated that script.
I was also playing with new weather ideas as I said did a lot of RND for that community.
Owner became an arrogant ass, and never went back.
The scheduler just isn't suited for UI, effects, sounds etc.
I mean for I&A I re-wrote the entire destroyed objective manager
So get used to not depending on sleep and waitUntil.
And used onDestroy to manage clean-up
Lightning fast.
I think one of the biggest problems @little eagle was that community was running a shit ton of mods
the LHD was one of them it's geometry was screwed.
Stretching models and bunch of other screwery
Including vehicles placed on it exploding at mission start
I had to write a workaround that by putting a script on every blufor vehicle on the LHD
Mods...
Are...
a pain.
Have to disagree. Mods made by bad scripters are a pain
I wouldn't know I protested many changes, such as adding lots of faulty mods.
"I was just the server and code monkey"
Well can't really complain about performance when 100+ units active, because that's pretty impressive, compared to other games
Is there something good to compare the scripting to ? dayzSA ?
Does that have any significent performance issues?
You could call everything that doesn't complete in 0 time a performance issue
No as they limit how many lines of code you are allowed to have
Atleast in the Programmable blocks
Outside that the game is fully moddable with C#
Can you try 100 agents? See if the performance is better
The way scripting in space engineers works is by creating byte code out of any scripted thing
And then just executing it normally in the clr
// Check last notification, so we don't repeat the same thing.
private _lastSide = missionNamespace getVariable ["mission_respawn_notifyLastSide",sideEmpty];
private _lastTime = missionNamespace getVariable ["mission_respawn_notifyLastTime",(time-5)];
// Quit if it has not been 5 seconds and side is same
if ((time - _lastTime < 5) && (_lastSide isEqualTo _side)) exitWith {};
// set new side/time
missionNamespace getVariable ["mission_respawn_notifyLastSide",_side,true];
missionNamespace getVariable ["mission_respawn_notifyLastTime",time,true];
What are the chances that 2 clients run this script at nearly same time and both get past the if
Also how do I avoid this ?
Let the server tell the client to execute?
What are the chances that 2 clients run this script at nearly same time and both get past the if
Guaranteed over time.
Hmm, yes remoteExe will bail me out here!
RDF_fnc_vehicleDenie = compile preprocessFileLineNumbers "\RDF_Radioer\scripts\vehdenie.sqf";
["vehicle", {
player call RDF_fnc_vehicleDenie;
}] call CBA_fnc_addPlayerEventHandler;
private ["_veh","_backpack"];
_backpack = backpack player;
if (_backpack == "RDF_M11_a_d") then {
_veh = player vehicle;
if (_veh != player) then {
player action ["getOut", _veh];
Hint "Antennen er foldet ud"
};
};
why doesent this kick the player out when the == is true
Because player vehicle is invalid syntax
You have a script error in there.
and Arma should tell you
-showScriptErrors
Example 1
? vehicle player != player : hint "Player is in a vehicle"
Let's delete this.
That is SQS right?
Put a big (SQS ONLY) after the example and move it to be the last example
The wiki should explain things. This example just confuses more.
i tried this
if (_backpack == "RDF_M11_a_d") then {
if (vehicle player != player) then {
player action ["getOut", _veh];
Hint "Antennen er foldet ud";
};
};
stil dosent work
_veh undefined?
yes.. thanks 😃
missionNamespace setVariable ["GUER",resistance,true];
missionNamespace setVariable ["CIV",civilian,true];
Why didn't I think of this before ?
isEqualType
Why didn't I think of this before ?
Wow, this is so stupid, it might just work.
It just did 😂
👌🏿 👌🏿
15:48:45 Error position: <GUER,"nigel"]]>
15:48:45 Error Undefined variable in expression: guer
15:48:45 Error in expression <ide","_name"];
!(
_targetSide isEqualTo _side
)
};
};
if (_target isEqualType >
15:48:45 Error position: <_side
)
};
};
if (_target isEqualType >
15:48:45 Error Undefined variable in expression: _side
15:48:45 File plugins\respawn\files\fnc\fn_srvDeadRemove.sqf [respawn_fnc_srvDeadRemove], line 259
No longer errors 😂
You could've just used my function to stringify resistance instead though. Now you wasted a week for nothing.
I had this issue in many different scripts, the last issue I had was with tasks and groups as well. But thanks anyway
Couldn't stringify grups like that, so I just use "group" and compile it when I need it (not before).
I don't think I wasted a week on nothing
You wasteda week on nothing every 2 weeks.. Sleeping is such a waste of time
github says 23k additions. I doubt I wasted a week on resistance 😄
no strings attached
Well If I don't convert the group it errors
Rewrite it so it doesn't error and accepts GROUP.
The reason It does not work is because I have a function for adding a task and a function that loops the tasks
adds _target to array
then tries to grab it
fail
Rewrite it so it doesn't fail.
Converting to string is never needed outside from callExtension maybe.
I did, it checks if it's a string and if it's a string, it compiles it in the loop
No error
Finish it Then optimize, right? right?
Sounds like twice the work.
write optimized code to begin with
this doesnt sound like an optimization case in the first place..
Anybody know why the animal fsms work for a little while then just stop?
Had a dog move around for a little bit, but the rest that spawned just sit there
Disregard last
For future reference for anyone who is running into the same siutation: the animals were created to early and didn't load their proper fsm
what means too early?
During preinit?
Yeah during preInit
Hmm, now i am only getting a certain area to populate with animals.
i need some help
i have an object and i want to find its rotation angles relatively to world
You could use zero as a base distance, and then getPosATL on the player
Trig will be your friend on this one
(_vehice modelToWorld [0,0,0]) vectorFromTo (_vehice modelToWorld [0,1,0])
something like this?
AGLToASL (_vehice modelToWorld [0,0,0]) vectorFromTo AGLToASL (_vehice modelToWorld [0,1,0])
Just to be safe on hilly maps.
yep, something like that but the position doesn't matter
i juste want the angle according to world x y z
i went with a rotation matrix but i ended with what vectorUp and vectorDir returns...
Well, that is what I posted. Add some sine and cosine and you have angles.
ok, i try that
what is the category in cfgFunctions for?
The ingame functions viewer.
? wanting to add a marker link in a briefing but the link is part of a string.... stripped down example...
_STR= "1) <a href='marker:EF_POI_1'>Place of Interest 01</a>";
player createDiaryRecord ["Diary",["> ENEMY Forces", _STR]];
Tried wrapping the marker in '', "", '"
Anyone any idea of the correct syntax ?
direct from the wiki.....
You can use some <a href="marker:MarkerName">links</a> too.
https://community.bistudio.com/wiki/Briefing.html#Markers
Briefing.html isnt a thing anymore
okay so whats the reference i should be using, havent done any scripting for a few yeats now
<marker name="nameofmarker">link text </marker> iirc
ah ok thx for that
Might be a phone typo in there
And what are the expected results?
works as expected thanks
Click on link in briefing text, map zooms to maker coord, commy
Nah since that page is on briefing.html
The current 'briefing' system is in the diary pages
Its certainly outdated but theres text on top saying its not for arma 3 iirc
thx for the link cptnnick
https://community.bistudio.com/wiki/createDiaryRecord for completeness
anyone know if the apex uniform boxes create and apex dependency?
RDF_player_connect = compile preprocessFileLineNumbers "/rdf_deltag/functions/fn_player_connect.sqf";
RDF_player_disconnect = compile preprocessFileLineNumbers "/rdf_deltag/functions/fn_player_disconnect.sqf";
["RDF_player_connect", onPlayerConnected, RDF_player_connect] call BIS_fnc_addStackedEventHandler;
["RDF_player_disconnect", onPlayerDisconnected, RDF_player_disconnect] call BIS_fnc_addStackedEventHandler;
Error in expression <DF_player_connect", onPlayerConnected, RDF_player_connect] call BIS_fnc>
16:21:54 Error position: <, RDF_player_connect] call BIS_fnc>
16:21:54 Error Invalid number in expression
16:21:54 File \rdf_deltag\functions\fn_deltag_init.sqf [RDF_stats_fnc_deltag_init], line 4
16:21:54 Error in expression <DF_player_connect", onPlayerConnected, RDF_player_connect] call BIS_fnc>
16:21:54 Error position: <, RDF_player_connect] call BIS_fnc>
16:21:54 Error Invalid number in expression
16:21:54 File \rdf_deltag\functions\fn_deltag_init.sqf [RDF_stats_fnc_deltag_init], line 4
why not just add the files to cfgFunctions?
also the second parameter should be in quotes
how would you write it in cfgFunctions ?
this is my config.cpp
class CfgPatches
{
class RDF_Statistics
{
units[] = {"RDF_STATS"};
requiredVersion = 1.0;
requiredAddons[] = {"A3_Modules_F"};
};
};
class CfgFunctions
{
class RDF_stats
{
class Statistics
{
file = "\rdf_deltag\functions";
class deltag_init{postInit=1;};
};
};
};
@lavish hamlet onPlayerConnected is wrong syntax. onPlayerDisconnected is wrong syntax. you are missing the parameter to the unary function call.
Maybe you should read wiki.
class CfgPatches
{
class RDF_Statistics
{
units[] = {"RDF_STATS"};
requiredVersion = 1.0;
requiredAddons[] = {"A3_Modules_F"};
};
};
class CfgFunctions
{
class RDF_stats
{
class Statistics
{
file = "\rdf_deltag\functions";
class deltag_init{postInit=1;};
class player_connect {};
class player_disconnect {};
};
};
};
oh fuck the spacing on discord
dont know if it changing anything but im trying to make a serverside mod.. that writes to db on connect and disconnects to track attendance.
ok, what I wrote is that the function is compiled already
@lavish hamlet Read the wiki entry to addStackedEH and onPlayerConnected
That is not the problem. CfgFunction sucks, might as well compile the functions yourself for a mission.
I know, but since he has it already why not just throw in there
["RDF_player_connect", onPlayerConnected, RDF_player_connect] call BIS_fnc_addStackedEventHandler;
["RDF_player_disconnect", onPlayerDisconnected, RDF_player_disconnect] call BIS_fnc_addStackedEventHandler;
["RDF_player_connect", "onPlayerConnected", RDF_player_connect] call BIS_fnc_addStackedEventHandler;
["RDF_player_disconnect", "onPlayerDisconnected", RDF_player_disconnect] call BIS_fnc_addStackedEventHandler;
if I want a module to only exist if a player has the role (AI disabled) would it be better to check it the player unit is alive or if it is null
Who is djotacon?
who is who?
@little eagle "The ingame functions viewer." thank you. So, no semantic change besides being easier to search on the editor
Yes.
good.
Another question that came up recently: is it possible to declare functions in cfgFunctions that can only be executed on the server?
(for missions, not addons)
so that e.g. some functions are not even initialized on the clients
afaik no
You will need to make up your own code to compile(final) the functions.
Or you could just add if !(isServer) exitWith{}; at top of the functions you don't run on client.
Or just split the server functions into a serverside addon.
Just add
if (!isServer) exitWith {};
as first line. Stop overthinking this.
so private []; is bad
params is evil too
why not private param for each input individually?
yes.
YES.
you're telling me :
private _belh
private _meh
private _beh
is cleaner than
params["_belh","_meh","_beh"];
doesn't make sense.
no, faster.
By how much?
if it's by 0.000000001 ms then yes I do care, cleanliness is better than a unoticeable difference when I'm reviewing latero n
why did you compare private to params, two different things
i mean suit yourself and use params and private not as a keyword but don't come crying tomorrow when dedmen painted dicks on your face while you sleept.
Dedmen can paint dicks on my face all he wants.
you can't apply private to vars if you define them with params.
but if you do it with param you can
for '_i' from 0 to 10000 do {
private _a = 'a';
private _b = 'b';
private _c = 'c';
private _d = 'd';
private _e = 'e';
private _f = 'f';
};
//28.4444 ms
for '_i' from 0 to 10000 do {
private ['_a','_b','_c','_d','_e','_f'];
_a = 'a';
_b = 'b';
_c = 'c';
_d = 'd';
_e = 'e';
_f = 'f';
};
//40.32 ms
credits to @peak plover
why would you even do that? Wtf?
If you're going to be using params, then just use the values that are passed
I think Katekarin mistakes private ARRAY with params.
me?
```sqf`
_playerUID = getPlayerUID _Player;
_playerName = format ["%1",(name _Player)];
_sql_res = "extDB3" callExtension format ["0:SQL:INSERT INTO rdfstat SET playerUID = '%1',playerName = '%2',connected = NOW()", _playerUID, _playerName];
};
No, asdfghj . I apologize.
i only referred what to what is faster, private [array] or private _var
https://i.imgur.com/UPlQ7X6.png why does it skip uid and player name ??
someone here have an crystal ball?
post logs, post the query you run, post the script that runs the query
🔮
we arent wizards
Yes.
its because you are blue
😱
daba di
first of all you have invalid SQL syntax
or maybe its correct, havent seen it
nontheless
logs are not showing anything.. but it only logs connect and disconnect not name and uid.. .
_sql_res = "extDB3" callExtension format ["0:SQL:INSERT INTO rdfstat SET playerUID = '%1',playerName = '%2',connected = NOW()", _playerUID, _playerName];
};
_query = format["INSERT INTO rdfstat SET playerUID = '%1', playerName = '%2', connected = NOW()", getPlayerUID player, profileName];
and I suggest you to use something like an extdbasync file that you can grab from eg. altislife
to make your life easier
im new at this.. but ill check i out..
but if you just want to insert using extdb3
@lavish hamlet does your database initialize properly?
yes im using it for presistent milsim mission.. i have just added the rdfstat table to track attendece..
ok, so if the syntax you provided for inserting the query is alright, and works with other functions
_query = format["INSERT INTO rdfstat SET playerUID = '%1', playerName = '%2', connected = NOW()", getPlayerUID player, profileName];
_sql_res = "extDB3" callExtension format["0:SQL:%1",_query];
in my case, I use 1:SQL:%1 for inserting, updating
@waxen tide I prefer params :D
you can't apply private to vars if you define them with params. Yes... because params does it automatically 😄 Read Biki
@simple solstice https://i.imgur.com/4tjkOkb.png (and) should have been T. Andkjær
but still no uid
is there a way to force vehicle to NOT use the road at all?
@lavish hamlet anything in extdb logs?
[19:41:43:901909 +01:00] [Thread 5016] extDB3: SQL: Error MariaDBQueryException: Duplicate entry '' for key 'playerUID'
[19:41:43:901926 +01:00] [Thread 5016] extDB3: SQL: Error MariaDBQueryException: Input: INSERT INTO rdfstat SET playerUID = '', playerName = 'and', connected = NOW()
did you make playerid the primary key in the database?
if yes, switch the primary key to the ID
because playeruid will repeat
and do you have 0:SQL:%1 or 1:SQL:%1?
CREATE TABLE rdfstat (
id INT(11) NOT NULL AUTO_INCREMENT,
playerUID VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
playerName VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
connected DATETIME NULL DEFAULT NULL,
disconnected DATETIME NULL DEFAULT NULL,
UNIQUE INDEX playerUID (playerUID),
INDEX id (id)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
unique index should be ID
you can have an index on playeruid, but its not necessary
["0:SQL:%1",_query];
unique index means that this value wont repeat
and the playeruid will repeat. cause its not unique to the table
if you insert it everytime someone connect
and try switching the 0 to 1
UNIQUE INDEX != INDEX
the plan i to have a new entry into the table every time a player connects so if i connect 3 times = 3 entrys
yes. I understand
switch the UNIQUE INDEX key to ID
if you leave UNIQUE INDEX on playerUID then that means playerUID CANNOT be repeated in the table
Ahh ill try 😃
@simple solstice tried both option 0 and 1 and changed the unique index.. now i get a new entry everytime i connect /disconnects.. but still on uid and only 3 letters in the playername
no uid
hmm maybe try a different syntax..
_query = format["INSERT INTO rdfstat (playerUID, playerName, connected) VALUES ('%1', '%2', NOW())", getPlayerUID player, profileName]
Oh @lavish hamlet is the table set to UTF-8?
and the database?
æ
yes it is COLLATE='utf8_general_ci'
try with the syntax I provided
and maybe try removing non unicode chars..
Well I don't really know how you connect with the database, how the other queries work.. I suggest you to take a look at https://github.com/RPFramework/RPFramework
and see how they handled EXTDB
once you have it setup, so you can just
the last syntax does nothing not even connect disconect.. but no errors in extdb log
_query = format["INSERT INTO rdfstat (playerUID, playerName, connected) VALUES ('%1', '%2', NOW())", getPlayerUID player, profileName];
_sql_res = "extDB3" callExtension format["1:SQL:%1",_query];
you have it like that, I assume?
When I submitted it without ; I was wondering if you are going to add it 🤣
need to learn so fine by me 😃 still dosent work.. in other tables it has no problem returning the uid and the correct playername
hope you solve it.. or someone else can help you.. I cant seem to find the issue. maybe player isnt initialized
you can try adding waitUntil {!(isNull player)} before the _query line
im going to bed now, maybe someone else can help you 😃
ill try.. thanks for helping
yup 😃
@simple solstice got it working with
_query = format["INSERT INTO rdfstat (playerUID, playerName, connected) VALUES ('%1', '%2', NOW())", _uid, _name];
_sql_res = "extDB3" callExtension format["1:SQL:%1",_query];
_uid and _name comes from the onplayerconnected...