#arma3_scripting
1 messages ยท Page 349 of 1
Who is Jack?
Short for "Jack Shit", slang for "anything".
alternatively the character in hollywood blockbuster "the titanic"
The image surely shows clockwise rotation
@still forum https://github.com/ArmAIvan/ADMM3
The guy that wrote that page is from Australia.
I've seen things like linting plugins for visual studio
i guess there is a better way to write stuff than using a simple editor
preferably something that interacts with github?
Atom/Sublime/Arma.Studio/VisualStudioCode
sublime is what i'm using right now
private ["_object"];
_object = _this select 0;
Why do people still do this in 2017? Especially when params is used two lines below.
because people are too stupid for params.
i tried every variant of params i could think of in that spot
params ["_object"];
lol
params is not the right solution here @little eagle
That function takes one argument only. There is no reason why that should be in an array
could omit all the overhead and just use _this as I wrote in my comment
@waxen tide Please do a perf test again after the changes. I'm curious how much that will do
will do
you could use params to make sure no one passes a nil
But I like my functions to be called as either
arg1 call func;
or
[arg1] call func;
It's a style decision then. But params will atleast be faster than ugly private ARRAY and a select
private _arg1 = param [0];
I can accept this as alternative if it's always just one argument. But it looks uglier than the slick params.
and might actually be slower
But params does all that for you ๐ค
I find it interesting how both of you ignored what the functions actually do and focussed entirely on coding style
considering that's a lot of instructions. Compared to a params call
And ye slower
I focused on performance'
also i'm surprised nobody yelled at me for my if () exitWith madness
I don't see madness in there. Exiting soon is a good thing
so, i'm not entirely hopeless.
Maybe I didn't look close enough ^^
A)
params [["_num1", -1, [0]]];
B)
private _num1 = param [0, -1, [0]];
A or B, dedmen?
I can see the appeal of B, as long as the function only has one argument.
I'd still use A for consistency though.
But A B might be faster. It has one less array and one more number instead.
A ofcause
array's don't matter. They are composed at compileTime.. I think
Not sure if it directly combines all constants into an array at compileTime... I'd guess so..
C/C-whatever should implement params.
Why? @little eagle
I'm trying to use a script function to create objects in eden
I have managed it with this in the debug menu: positioncheck = screenToWorld [0.5,0.5]; "C_Quadbike_01_F" createVehicle positioncheck;
but it isn't actually editable with the editor
Isn't param faster if you got 1 var?
is there a way to actually add it to the editor?
I found create3DENEntity
that might work
that works nvm I solved my own problem within a matter of seconds after asking lol
positioncheck = screenToWorld [0.5,0.5]; create3DENEntity ["Object","C_Quadbike_01_F",positioncheck];
@runic surge Why can't you just place them in Eden?
I'm in the process of creating a script to duplicate terrain objects and add them to Eden
you know, like a thief
I am simply trying to make some prefabs based on altis villages and forests from my terrain
you have to do it in Eden and execute scripts with debug console or anything else
that is what I am doing
_SearchPosition = screenToWorld [0.5,0.5];
_SearchRadius = _this select 0;
_ObjectType = _this select 1;
_TerrainObjects = nearestTerrainObjects [_SearchPosition, _ObjectType, _SearchRadius];
{
_type = typeOf _x;
_pos = getPos _x;
_dir = getDir _x;
_obj = create3DENEntity ["Object",_type,_SearchPosition];
sleep 0.1;
_obj setPos _pos;
_obj setDir _dir;
} forEach _TerrainObjects; ```
Any idea why this doesn't work? It tells me that _obj is undefined
that is for the type of entity to create
alternatives are "Trigger" "Logic" things like that
ah, right. sorry.
I can get it to create the objects just fine
just not the rotation or exact position right now
it seems there is no way to define a variable name for an eden entity so this might not actually be possible
setVehicleVarName
_dropList2 ctrlSetBackgroundColor [1,0.0,0.0,1];
_dropList2 ctrlSetForegroundColor [1,0.0,0.0,1];
_dropList2 ctrlSetActiveColor [1,0.0,0.0,1];
Why does my button not change color?
This should mean 100% red, right?
_dropList2 ctrlSetTooltip "Priority of the task";
This command works alright
Is there some secret to setting button colors?
Anyone experienced with installing sqflint for atom? i have no clue how to install stuff with python on the cmd
Either _dropList2 is null or you need to https://community.bistudio.com/wiki/ctrlCommit
Can't be null, tool tip works...
Try commiting
I think there was a problem with button indeed
@still forum setvehiclevarname that wouldn't work either
I can't change the var name of something that can't be selected to begin with
Ouuhh.. create3denentity doesn't return anything?
You know the position of the object. Maybe nearestObjects?
maybe
that won't work since the object doesn't spawn in the exact location of its original
likely will mix things up that aren't more than a couple meters away
I can get it to place the object in the exact right position but it doesn't actually change the rotation and position values in the objects attributes
if I click and drag or copy and paste they both reset
_obj = create3DENEntity ["Object",_type,_pos,true];
_obj should refer to the eden entity, right? It doesn't seem to actually, and changing the position or rotation of the object seems to only affect the actual 3D model, without actually changing any attributes. At the same time, it returns an error saying that _obj isn't a defined variable. get3DENentityID doesn't work either
it seems I can't actually do what it is I want to here
Yes, you have to save the attributes manually.
Nah, setting the position is a write to temp file operation.
So it's not necessarily what you want every frame.
@waxen tide not tested but there is a sqf lint on VScode and installing extensions is painless
By manually I mean by script command: https://community.bistudio.com/wiki/set3DENAttributes
"Position"
Are you sure?
@slender halo thanks
set3DENAttributes [[_obj ,"Position",_pos]]
that's the only way I could think to try it, and that doesn't work
player set3DENAttribute ["Position", [0,0,0]];
This should set the player to the corner of the map.
It's a command that reports the player entity.
Did they ever finish
showSquadRadar = 1;
?
set3DENAttributes [[[player],"Position",[0,0,0]]];
this is the other syntax. I think you forgot an array.
Arg, I did too
rotation is a different attribute
"Rotation"
[X is pitch, Y is roll and Z is yaw]
Ah I think I know what to do here
the 3den rotation is pretty arcane
it seems to actually be quaternion / euler angles
Good
@still forum http://i.imgur.com/Hb33TWX.jpg (old one was 39ms)
i looked into it a while ago and its not really possible to set them yourself becuase it might end up upside down
shouldn't the party be longer ?
the rotation works but the position is still slightly off
That's more like it ๐
set first the rotation and then the position maybe?
when i call it again it drops to 7-9
yes
is getDir okay?
Yes.
How would you repeat a command so i can keep it nighttime it keeps reseting
for some reason it isn't working for all of the objects but that is a separate issue
Halp me plz
I don't think your problem is that you have to repeat the command. I think your problem is, that the server switches back the time, because you only changed it locally.
No its argo they did not support night time but you can activate it so if i can repeat the command after i activated it it will stay night time
What are you doing?
?
You sound totally confused. What you're telling me makes no sense.
The devs of argo did not support night time so it resets every 60 sec
That sounds wrong.
Its argo not arma they did not support everything from arma but there is night time
I was thinking that i could add an action to an object and set the time to midnight then have it repeat but idk the script for repeating a command
You don't have to repeat the command. You have to fix your script.
Whats wrong with it?
How would I know if you refuse to post it?
I asked you "what are you doing".
But no reply.
You said the time changes back after a few seconds.
So you must be doing something already.
is it possible to link onMouseButtonDown to a RscEdit ?
So when i click in the box , it clears the box ?
I think so, yes.
@ivory vector are you doing it by script or config ?
either ๐
in script you have to remove the on prefix
im doing a messaging system, and its just as an ease thing really, not neccesary.
Commy i am doing nothing wrong the game is argo not arma 3 the devs did not support nightime and when you set the time to a desired time every 60 sec it repeats
should have !showcode command xD
This addaction "settime,055" this is very wrong it just and example idk the code i have to be able to test it with my pc but this is my phone
See? You did use setTime wrong
Ok i just wana know how to repeat the command
You don't have to repeat the command.
You have to fix your code.
It's broken.
ffs
Get on your PC and post it. And then I can tell you what's wrong maybe.
Is there a way to repeat the command even it it was working it will reset it
You're very stubborn for someone who apparently is pretty lost.
Here ill go on the arma webpage and tell you it but i still need to know how to repeat the command, why because its argo the free ti play shooter then never bothered with the night time so every time you set it to night even without scripting it will reset it
setDate and skipTime are commands that have to be executed on the server. You're using an action menu action. You have to incorporate remote execution into your code somehow. Otherwise the server will overwrite your changes after a short period of time. This has nothing to do with argo.
This addaction "settime,055" ๐ ๐
Arma i said it was an example lol
๐
lol ivan doing fnc partymode ๐ @waxen tide
well thats the WIP name at least ๐
That command must run on server
player addAction ["Action", {[1986, 2, 25, 16, 0] remoteExec "SetDate"}]
setTimemuiltiplayer is not a command. So yes., this is wrong
Oh well i could not find a set time on the arma webpage
remove the , 2, zgmrvn and you get the change immediately on the clients.
indeed
This addacction ["settime",{setTime 55}];
player addAction ["Action", {[1986, 2, 25, 16, 0] remoteExec ["SetDate", 2]}] this will work?
player addAction ["Action", {[1986, 2, 25, 16, 0] remoteExec ["SetDate"]}]
lgtm
@little eagle ? :D
player addAction ["Action", {[1986, 25, 16, 0] remoteExec ["SetDate", 2]}]
eff off, Dscha
๐
This is hard enough without you.
I know, i read it the past 5min and thought: "what?"
Ya but even if i ran this script it will reset the time
How did you determine this?
Because argo does not support night time which is why i want to repeat this command
I thinks he's trying to say that Argo doesn't support night time guys
That what i just said
Ok bye
Is this some elaborate troll by Blaubaer?
It will reset it back to the basic time because its ment to be a competitive shooter
You used skipTime wrong and it's documented on the wiki that you have to remotely execute it.
I'd try with correct code first.
Commy get argo and set the time to night time
Did you even tried the Code above?
^
No im on my phone
Baer, this isn't funny. Sorry that I said to you that you're gay for liking traps.
Who baer??
Exactly what Baer would write.
Yeah, baer wtf
this is elaborated troll
๐
Im not baer
Then get off your phone and change your code according to our suggestions.
I am leading off topic but i cant be on my "moms" pc because idk password
I am building my own though thank god
Isn't komanda koroma one of the many us army generals trying to make me pay them to ship gold from a middle eastern country?
๐ณ ~embarrasing~
๐คฆ
I did not scam james
lmao and I thought #arma3_terrain had enough cancer
what with the lifers and all
No
I did not scam james, Random, no context, no meaning, something somone intoxicated would say...
Yup
Nigel dom know what im talking about
It's ok
I really really don't
but maybe you do
you just need to believe
unlock a horrible repressed memory from a traumatic event in your childhood
Then why do you rember this name?
Wad it because it was used in an act of comedy
Was*
Isn't komanda koroma one of the many us army generals trying to make me pay them to ship gold from a middle eastern country? Isnt this toooo specific??
oshit
I get what your referring to, but I've had the same emails lol
James Veitch is who your referring to
No you just saw the video james veitch
Nah I actually have
Same as i which is why i used this name
Anyway this doesn't belong in #arma3_scripting
I know whu did you bring it up??
Isn't komanda koroma one of the many us army generals trying to make me pay them to ship gold from a middle eastern country?
???
#offtopic_politics or anything, just not here ๐ฆ
Because you were basically trolling
How?
You ask for help, you get help, you don't try it
Lol im on my phone i asked for help because i did not want to spend my time working to get on my "moms" pc and then have to ask help on scripting i did it before hand
Im going to try it
Can we have this channel back for scripting please?
Yes
Ask for something they will help
Yes
Is there any way to write text/ variables to a live texture? Rather than making all the posibilites as textures then changing the texture when the condition changes.
Procedually generated textures?
Is it possable to add attachments that are not supported on weapons? Like a sos scope on a pistol although it will be stupid
Essentially yes - ie laptop screen showing number of enemies left in an area.
Is it possable to add attachments that are not supported on weapons? Like a sos scope on a pistol although it will be stupid
Not with scripts, no.
Draw3d, but you would jump some hoops ... I think that is possible
Easier version would be to have to click on laptop and get UI
just include small textures for the numbers 1 - 200
digits
possibly even just 0-9 and a custom object
That sounds like effort
youd need a custom selection then
How about lineintersects, getDir and draw3d?
itll never look as if it was actually on screen
Thanks commy2
Yeah... true
I guess the digits version might work
But can you combine textures somehow to the screen?
if you have many smaller selections you can sprite stuff i guess
Well if the attachements dont have to work its semi possible. https://www.youtube.com/watch?v=LzyphQkjBYY
Hmm, i'm thinking multiple textures will be the quickest way. Can just auomate the texture creation in PS.
Awesome
if its small numbers you can do like 8x8 textures anyway
Lol
Ok I'm very bad with SQL related stuff so if anyone knows anything about it here, here's a question.
I want to check if a specific string exists in the database. I need to check 3 specific columns (it could exist in any of those three). If it does, return TRUE if it doesn't return FALSE.
I've searched Google but everything it comes up with doesn't seem to work.
soo. In mp. if I don't call BIS_fnc_endMission on the server, does that mean the mission never stops running?
I'll just do endMission on server too, after players
BIS_fnc_endMissionServer for a one in all solution
I might want different endings for certain players/sides, so I want to avoid that one
Great
\o/ linter works \o/
// Get winners
private _winSide = missionNamespace getVariable ["mission_tasks_winSide",TASKS_SETTINGS_ENDING_SIDE_AUTO];
private _winPlayers = missionNamespace getVariable ["mission_tasks_winPlayers",(allPlayers select {side _x isEqualTo _winSide})];
missionNamespace setVariable ["mission_tasks_winners",_winPlayers];
hmm, is this a good way to do winners for my mission?
Essentially, a side would be set as winner, but this could be overwritten by a list of players who win instead...
So when I want to make a pvp or gimmick mission with 1 winner, I can do that, but it will also work with COOPs
Just wondering if an array of winners would be too much to send to clients, or should I just send win/lose functions from server?
JUST GOT RAM
Fixed my prob, justwent for two diff. remoteExecs
Cool
So
Very nice to see that the weaponholder has a collision box
and when you walk over it it makes you jump up a bit -_-
Using enhanced movement?
Yea
It's good to sometimes feel a bump when running over dead bodies 'tho
So it's enhanced movement thats the issue? ^^
Yeah, vanilla doesn't have that feature/bug
Feeling quite stupid. Why is the addition sign giving a Generic error?
for [{_i=0}, {_i<10}, {_i=_i+1}] do {
testVariable = testVariable+1;
publicVariable "testVariable";
sleep 5;
};
for "_i" from 0 to 10 do {```
@peak plover I supposed noone has a fix ready?
Jsut ask bad benson in his thread for the mod. I'm sure if there's a way, he'll fix it ๐
๐ค
are you running your code in the scheduler ? @tepid pollen
thanks for that tip, but the plus sign is still being marked as a Generic error? this is running as an SQF script
[] spawn {
// my scheduled code here ;)
};
ill try that
you can't suspend (sleep) in un-scheduled non-scheduled
non-scheduled run all the code instantly and suspend ALL scheduled scripts until the non-scheduled script is done
scheduled scripts are given total (all scripts) 3ms per frame. The higher your framerate, the more code you get through in a second
made no difference. it's the plus sign being marked as an error. it's as stupid as it sounds
[] spawn {
for "_i" from 0 to 10 do {
testVariable = testVariable+1;
publicVariable "testVariable";
sleep 5;
};
};
is testVariable defined
yeah. left that part out this time, it was in the last code block I sent
testVariable = 0;
[] spawn {
for "_i" from 0 to 10 do {
testVariable = testVariable+1;
publicVariable "testVariable";
sleep 5;
};
};
[] spawn {
testVariable = 0;
for "_i" from 0 to 10 do {
testVariable = testVariable+1;
publicVariable "testVariable";
sleep 5; hint 'yay';
};
};
// computes
straight to debug console
[] spawn {
testVariable = 0;
for "_i" from 0 to 10 do {
testVariable = testVariable + 1;
publicVariable "testVariable";
sleep 5;
};
};
@tepid pollen if you add sqf behind the three ` you get highlight in discord
```sqf
//code
```
is impressed
backward slash before the char to disable it's function
*ok*
ok
that did it. have to define the variable inside the spawn
gag = 0;
[] spawn {
for "_i" from 0 to 10 do {
gag = gag+1;
publicVariable "testVariable";
uisleep 0.5; hint 'yay';
};
};
works
@tepid pollen Where is your code being executed from
no clue then. that setup gives me the error
it's an SQF script. not sure if that is what you are asking
Just do something like
private _testVar = missionNamespace getVariable ["testVariable",-1];
missionNamespace setVariable ["testVariable",(_testVar + 1),true];
server-side
anyways... don't know and frankly don't really care. it works so I am going with it. thanks guys
I found out where the doors are stored in the cfg on houses. but are entrances without doors noted somewhere aswell? any way to detect them by mission script?
Im trying out the code
@waxen tide do you mean entry ways? I believe you can return exits and entrances. https://community.bistudio.com/wiki/buildingExit https://community.bistudio.com/wiki/buildingPos
Yes exactly! Thanks
Does anyone know how to get autocomplete for BIS functions to work in atom with the acemod syntax highlight?
Not sure atom has sqf syntax hightlighting, but Arma Studio has something similar afaik.
there is a package for atom for sqf highlightning from the ace mod team
is there a linter for ArmA Studio?
heya guys, is there a % (modulo) in sqf or a bis_fn to get the remainder of a division ?
canยดt find it
i am pretty sure i saw a function for that but i don't recall the name
yea iยดd rather just have the operator
but i ยดll have another look in the fn library
well thought of asking before getting into it
but just tried and the operator does work, hm... sqf
well itยดs right there and i passed right through it .. had to check again kek
@waxen tide yeah Arma Studio is a linter
k thanks i'll try it
scratches his head
If someone is bored to death, i wouldn't mind some info about how the cfg is actually structured and how the class inheritance? works for stuff like a house for example
@blissful wind https://community.bistudio.com/wiki/mod
@tame portal ty
is it possible to remove parts of a string?
I am trying to simply remove the ".p3d" at the end of a string
SplitString with find
thanks
would this work
while {isNil "_something"} do {
_something = true;
};
_string = "folder\pathfile.sqf";
_string splitString "." select 0 // "folder\pathfile"
_string select [0, toLower _string find ".sqf"] // "folder\pathfile"
nigel, not always.
f-f-fuck me
private "_something";
while {isNil "_something"} do {
_something = true;
};
This would always work.
ohh right, awesome, thanks ๐
What would be the best way to create a smoke grenade-like effect over a larger area? Obviously one could use multiple smoke grenades, but performance tanks rather heavily. Another could be somehow setting up the smoke module in such a way that it visually looks like a smoke grenade, which I've failed to do so far.
Any ideas in that regard?
You'd need a large amount of particles to cover a large area, so no matter what you do, it will either tank performance or be too thin and ineffective.
Damn, I was thinking maybe using the fog, but there's no way to limit it's radius or anything.
Oh, apparently BIS_fnc_sandstorm is a thing.
I'll have to see what that looks like.
It uses pp effects and not particles iirc
Some sort if location based ppeffect?
That's what I was trying to do yesterday in #arma3_scenario haha.
There are scripts for this
I used this tutorial like years ago
Fps impact was big, so I ended up using fog and pp effects.
I just wanted a cute sandstorm
For smokescreen this can be used as a decent how to
Sure ๐
Aw man, I could have swore there was a googly eyes mod on the workshop :(
Can someone please mod that as a face wear?
Like, I really want googly eyes as a thing.
Maybe even NVG googly eyes.
hahaha
How did your experimentation with fog and ppeffects go anyway? Get anything useful out of it?
streamable link I posted in #arma3_scenario was the end result
It was hella CUTE!
I keep backups of a lot of stuff, if you're interested, I can look up the exact values
Ah, sorry, that wouldn't load for me earlier, but it looks actually quite nice.
Still trying to figure out ppeffects, especially CC. I've gotten this http://i.imgur.com/c8o4eWY.png
But I'd love it more blended, moreso than just complete original color removal,
_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_hndl ppEffectAdjust [ 0.7 , 0.7, 0, [1.01, -2.46, -1.23, 0],[2.11, 1.6, 0.71, 0.8],[1.43, 0.56, 3.69, 0.31]];
_hndl ppEffectCommit 0;
I like saturation too much
I actually got this one, which I like a little more http://i.imgur.com/5oXF5rJ.png
But it still drains out all original color though :C
private _varName = format ["SP_var_%1_controls", toLower _mode];
missionNamespace setVariable [_varName, []];
{
private _idc = _x select 0;
private _value = _x select 1;
private _childControl = _option controlsGroupCtrl _idc;
(missionNamespace getVariable _varName) pushBack [_idc, _childControl];
_childControl ctrlSetText _value; // works
} forEach _values;
// SP_var_brush_controls = [[1, No control], [1, No control], [2, No control], ...]
any idea why SP_var_brush_controls ends with No control ?
private _varName = format ["SP_var_%1_controls", _mode];
private _value = [];
missionNamespace setVariable [_varName, _value];
...
_value pushBack _x;
This is the sane way of doing it.
My guess is that _option is not a controls group or the idc's are wrong.
What is _values, since thats being iterated?
I can't grab the ace_spectator display
https://github.com/acemod/ACE3/blob/43ac39f06c39d07813cc3888642b8a4171f1b886/addons/spectator/functions/fnc_ui.sqf#L67
I do (findDisplay 60000), but it's always "No Display"
Since its returning "No control" the error is somewhere in these values not working for you, because im not seeing any obvious errors codewise
findDisplay only reports dialogs, not displays, nigel.
LMAO ๐ฆ
Addon or mission?
mission
hmm
Doesnt cba offer UI handles now?
@indigo snow yeah but the ctrlSetText right after works :/
I already run a custom version of ace, so might as well add uiNamespace setVariable or sth to the spectator display...
Don't think there's any other way...
Yeah, do that.
I would like another way so this mission would work with normal ace, but yeah....
@slender halo wierd guess but try and save str _childControl to the array? They might not exist when you check them or something, but idk much about UI stuff
Doesnt cba offer UI handles now?
This one isn't using BIS_fnc_initDisplay and therefore doesn't support the XEH displayLoad event handler.
I see
Maybe PR an event to it, nigel
One that reports the display
Then you can hook into the event
uiNamespace setvariable, like unconsciousness
SP_var_brush_controls // [[1,"Control #1"],[1,"Control #1"],[2,"Control #2",...]
Yea they probably just didnt exist when you check the array or where you checked the array
Since those look like existing controls to me
What is _option ?
i'm retard, i'm watching the console so the dialog is closed and indeed the controls don't exists...
Its ok, ui is black magic anyway
I concede
I accept your concession.
I feel UI and AI are both hell, but they are so fun
@waxen tide private keyword vs private ARRAY is not a style decision. It's a performance decision.
private ARRAY is a command that you call. private keyword is evaluated at compileTime and has 0 runtime overhead
And maybe its just me but now i never forget adding new locals to the array anymore...
private command is old and ugly. private keyword is new and shiny.
@still forum i see, thanks
Also what nick said.
well believe it or not i constantly think about "how much performance will that cost"
compelling arguments
i actually forget that all the time.
It really helps when reading the code too. Every time you see an assignment without private, you know the variable already had a value.
I cluddered a lot of comments on one of your newer commits ^^ Check your github. But 90% of these are just copy pasted messages
is scar ed
how can i find the comments on github?
i randomly clicked every button 5 times and nothing happened
Go to the list of commit and click on the one with the comments
@indigo snow @little eagle thanks, it works fine, @little eagle i need to get used to namespaces ๐
_key = 'abc'; is faster than private _key = 'abc'
Only use private if required...
SetVariable is too good for generated variable names
thanks commy2
Nigel always use private or the pixies will come and get you one day
I do, but I intend on removing all unnessary ones once I'm done
I will NOT pre-optimize
post-optimize instead, once it all works
private is not a performance optimization.
You do it so you don't modify external variables
Im of the opinion the hunt for optimization can cross stupid-lines
But i wont tell you how to code
Yes, but I use it pretty much everywhere, meaning in some places there are no external variables to modify. These times it needs to be removed
Yeah.. @waxen tide also has that in an eventhandler. There is no scope higher up. So no variables that could be modified. So private in there doesn't make sense
well i use private when it is clear to me the variable will only see use in such a way that private will work out?
thats what i get for using other peoples scripts...
[] spawn {
private _myvar = blabla;
};
wasted performance, wasted CPU power, wasted power, wasted earth
Save earth, remove uesless privates
The script is probably fine. It was written to be used anywhere. And in most cases you need private
fair point, there can be functions which don't conflict currently, but if somone uses it, it might...
If you have a completly closed system. Then you'll know if a variable in a script might overwrite one of yours. So you don't need private at all if you choose variable names wisely
But open Frameworks should always use private everywhere that might be potentially a problem if someone else calls it
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
for '_i' from 0 to 10000 do {
_a = 'a';
_b = 'b';
_c = 'c';
_d = 'd';
_e = 'e';
_f = 'f';
};
//28.8571 ms
I guess private is not as bad as I thought
normalx100 000
//284.5 ms
privatex100 000
//271.5 ms
private is faster than normal
Theoretically private has no overhead besides setting one bool to true.. Which is otherwise set to false
so you are setting one bool eitehr way
You are probably in the measuring tolerance
True, I thought it might have bigger impact, but it seems like it has a positive impact instead...
private confirmed good boy
positive impact... Okey yeah.. it makes sense
Because if you don't private. Arma will search from current scope through all upper scopes to check if the variable already exists
if you private you create the variable in the current scope. So it only has to go up by 0 levels before it finds it
1mil private = 2776 ms 1mil nonprivate = 2808 ms
This has been eyeopening
I had the completly wrong idea about this
The difference should be higher if you go to a lower scope.
instead of <perfcode> call {call {call {<perfcode>}}}
And yeah, that makes complete sense
On an entirely unrelated side note, anyone of you using Atom? The language-arma-atom package autocomplete is driving me crazy. It doesn't work for most BIS functions but their project site says otherwise?
okay. can you elaborate on that?
https://i.imgur.com/OzQ8hDP.jpg
I find poseidon very good
Don't know what I could elaborate there
thats what i used before atom. but i wanted linting.
well why don't you use BIS functions?
HAHA
if (typename _destTarget == typename objnull) then
{
_dest =
[
_destTarget,
_dest param [1,false,[false]]
]
}
else
{
if (typeName _destTarget == typeName objNull) then
{
_dest =
[
_destTarget,
_dest param [1,false,[false]]
]
}
else
{
_dest =
[
_destTarget,
_dest param [1,0,[0]],
_dest param [2,0,[0]]
]
};
};
This is why
I don't need BIS functions. Dunno why.. I just don't
With frameworks, you also have to protect your variables from the user.
// third party function
user_fnc_customFnc = {
_array = [];
// your framework
private _array = [user_fnc_customFnc];
{
//private "_array";
call _x;
} forEach _array;
Without the commented out line, your frameworks _array becomes overwritten.
Because the user forgot private.
so private doesn't have a negative performance impact, potentially prevents errors by overwriting unintentionally, and should be considered good practice?
Yes
and they told me i'm stupid when i was a kid.
I'd always use it, unless it's like a completely isolated loop that will never call any function.
It IS considered good practice. And it actually has a positive performance impact as @peak plover Just found out.
I theoretically knew that. But my Mind is weird
Then I'd still use it, because autism.
^
๐
likely i would out of habit
It makes the code easier to read. For me at least.
Plus in Atom private is blue. And I like blue
i don't like blue
i've gotten used to poseidon autocomplete which deliveres the options in the proper order
also i'm disturbed that Atom pretends "BIS_fnc_CodePerformance" doesn't exist until i type it out in full.
Is there even a reason to use BIS_fnc_codePerformance now that it is in engine?
who knows. but i noticed that diag_codePerformance is autocompleted just fine and i SUSPECTED there is reasons for that.
call {
call {
call {
// _var = nil;
// private _var = nil;
isNil "_var";
};
};
};
Dedmen, can you think of an example were private helps with performance?
Can you delete an object created by createSimpleObject? I've read that it cannot be destroyed, but deleted? Via deleteVehicle for example
everytime your scope has more than 0 scopes above
Yes.
@little eagle scroll up to Today at 2:38 PM (20 min ago)
Because otherwise Arma checks all scopes above if they have a variable with that name
If you scope is 5 deep and the variable doesn't exist. It's 5 lookups
That would only apply to undefined variables though, no?
Then it know when to stop when it reaches the variables home scope.
yes
if the variable is defined 1 scope higher up. It would check current scope. Then 1 higher up. Find it and overwrite it
which is another reason to use private
Oh, so even assignment would walk up all scopes?
yes
That happens very often.
True.
If it is privatized it will find it in the current scope without going up. So that's quite fast
That explains why nigels example with the for scope had private being faster than classic assignment.
It had to walk the home scope for all a-f variables.
yep. Although that was only one scope deep. So it only checked 2 scopes. and in the private example it checked only 1.
Even that seems to make a noticable impact
With frameworks, scopes can go very deep.
Like all the ACE shit
A)
call {call { call {
_var1 = 1;
}}};
- check scope 3, undefined
- check scope 2, undefined
- check scope 1, undefined
- check scope 0, undefined, but the main scope -> write variable
B)
call {call { call {
private _var1 = 1;
}}};
- check scope 3, undefined, but this is set as home scope -> write variable
This should be the most convincing argument for using private for people that care about code performance.
Feel free to add it to https://community.bistudio.com/wiki/Code_Optimisation#private_.5B.22_var.22.5D_vs_private_var btw
But is this actually how it works?
This would mean that the variable is accessible in parent scopes.
Which it isn't.
which one?
_var1
if it doesn't exist in the upper scopes then it creates in current scope
Or does it simply write it to scope 3 in A, even though it walked through them all?
It only checks if it already exists. If it doesn't then it creates it.
And as you know local variables only go current scope and lower
not higher
By higher I meant higher up in the file.
3->0 upwards
Just like how the top 10 is above the top 100.
Yeah. I mean the same
it check if variable exists in any of the higher scopes. If it doesn't. It creates in current scope
same happens too if you access a local var that is Nil
Yup
And if the variable actually belongs to a parent scope, then it's not written to the current one, but that parent scope.
This makes a lot of sense, but I think it's counter-intuitive how adding an instruction (private) speeds up the code.
It's quite odd, but in reality like Dedmen said, it flips a switch from true to false. So it actually disables functionality, rather than adds some elaborate quirk
Which is quite fascinating
Yeah. It essentially disables the scope walking to overwrite the variable with the same identifier in parent scopes.
Which could be rather costly if you have a lot of scopes, like how ACE is designed.
private ["_var"]; however is slow!
That's not really what it does... But.. If you understand it that way it's fine ^^
well. it's kinda how it works
private array has to iterate through an array of strings in SQF.
It's a command, yeh
well. it's kinda how it works
Is there a meaningful difference?
it doesn't disable any functionallity though. It still does the same scope walking. Just it find it in the first scope
It just creates the variable in the lowest scope first. Before it does the scope walk
I see.
Meaning the scope walk turns into a scope stand
// works just fine
fnc_unnecessary = {
["teleport_id", "onMapSingleClick", "Ivan_fnc_teleport_player"] call BIS_fnc_addStackedEventHandler;
};
DEBUG_SWITCH = true;
if (DEBUG_SWITCH) then {systemChat "DEBUG MODE ON";
player addAction ["Enable Teleport (click map)",
"call fnc_unnecessary",
nil,
1.5,
false,
false,
"DEBUG_SWITCH = true"
];
};
// Error missing ]
DEBUG_SWITCH = true;
if (DEBUG_SWITCH) then {systemChat "DEBUG MODE ON";
player addAction ["Enable Teleport (click map)",
"["|#|teleport_id", "onMapSingleClick", "Ivan_fnc_teleport_player"] call BIS_fnc_addStackedEventHandler",
nil,
1.5,
false,
false,
"DEBUG_SWITCH = true"
];
};
I don't understand this at all.
Escaping strings.
duh. thanks ๐
you can see that immediatly if you have syntax highlighting in Atom
Or the superior Sublime Text 3
Sublime is the best ๐
^ this
i do have highlight in atom but it is INFERIOR to atoms because i missed that. obviously.
I started in notepad++ and it was horrible, someone told me sublime and the world was saved
sublime is hard to beat
Indeed it does all you want and more for free
i miss a linter for sublime.
not free 'tho
A)
call {call { call {
_var1 = 1;
}}};
- check scope 3, undefined
- check scope 2, undefined
- check scope 1, undefined
- check scope 0, undefined, but no parent scope left
- set home to scope 3
- write variable
B)
call {call { call {
private _var1 = 1;
}}};
- set home to scope 3
- check scope 3, is set as home scope
- write variable
Acceptable description of the games doings, dedmen?
1444 ms / 1458 ms
As in A/B
yeah
So A was quicker now :/
1461 ms / 1411 ms
Lol
They're really close. Within measuring error.
Maybe add more zeroes
C++ land steps are very fast compared to SQF steps, so a bunch of additional instructions aren't that bad.
14376 ms / 14060 ms
14585 ms / 14244 ms
10 million times
I don't wanna do 100 mil, because I don't wanna wait 2 minutes every time ๐
I should just do it with like 100 billion when I go to sleep
finds computer on fire
rent server, install arma dedicated, check code performance, whole serverfarm burns down ๐
Next petty topic:
255
vs
0xFF
๐
Difference in Hexa vs nonhexa is meaningless as both are stored in the same way internationally
agreed
$11111111
is the only true way.
This SQF plugin for discord doesn't handle binary and hex.
$100 142.375 ms / 256 145.429 ms
https://github.com/X39/sqf-vm/blob/master/SQF-VM/SQF.c#L299
That is more or less how assignments work in sqf too
Just that sqf has a separate stack for scopes unlike I have
$100 is only 4, not 256
Wasn't $ for bin?
$100 isEqualTo 256 //true
anyone know anything about extb3, with the altis like async function ?
SELECT senderUID,recieverUID,messagecontent,date FROM messages WHERE (senderUID='76561198132926159' AND recieverUID='76561198132926159') OR (recieverUID='76561198132926159' AND senderUID='76561198132926159') ORDER BY date DESC LIMIT 100
``` Query im running works fine in db query but
Error in expression <!_loop) exitWith {};
};
};
_queryResult = call compile _queryResult;
if ((_query>
Error position: <= call compile _queryResult;
if ((_query>
Error Generic error in expression
File \life_server\Functions\MySQL\fn_asyncCall.sqf [DB_fnc_asyncCall], line 105
Seems like you have a Generic Error
Apparently $ is alias for 0x in SQF
tried with * instead of selecting coloums, then apparently i was missing an ] on the output
What is _queryResult ?
"SELECT * FROM messages WHERE (senderUID='76561198132926159' AND recieverUID='76561198132926159') OR (recieverUID='76561198132926159' AND senderUID='76561198132926159') ORDER BY date DESC LIMIT 100"
Error in expression <8132926159','76561198132926159',Message Sent,2017-09-01 23:45:58],[56,'765611981>
Error position: <Sent,2017-09-01 23:45:58],[56,'765611981>
Error Missing ]
Error in expression <8132926159','76561198132926159',Message Sent,2017-09-01 23:45:58],[56,'765611981>
Error position: <Sent,2017-09-01 23:45:58],[56,'765611981>
Error Missing ]
_queryResult is the return from the async function
And what does it look like?
Because if it's an assignment as last operation, then this is the same error as we had yesterday.
Before line 47
Add
diag_log text _queryResult;
And copy paste what it writes to RPT.
sec
It has to be a compile'able string that ends up in a function that doesn't report the assignment operator.
hm
"_a = 1"
would error for example
@little eagle home is confusing. But yeah.
255 vs 0xFF no difference. Because evaluated at compiletime.
But what was the keyword for a binary number in SQF, dedmen?
$ is just alias for 0x
I don't even know what my string is.
I didn't know you could even do binary
There is a bunch of strings.
['76561198132926159','76561198132926159',Message Sent,2017-09-01 23:45:58]
``` Could it be the way the messagecontent and date are being pulled out ?
Could be and that would definitely error with missing ]
Because Message Sent,2017-09-01 23:45:58 is not SQF
why are they being pull out without " "
Dunno. Don't even know where they come from.
How did this string came to be? SQF or C++ extension?
sqf
params ["_data"];
_returnText = "";
if(isNull (_data Select 2))then{
_returnText = "Message Failed to Send, the target is not accepting messages at this time.";
};
//Query the receiving guid to make sure the player exists.
_query = format ["SELECT pid, name FROM players WHERE pid='%1'",(_data select 3)];
//Send the Query
_queryResult = [_query,2] call DB_fnc_asyncCall;
//if the query is empty send an error back.
if((count _queryResult) <= 0)then{
_returnText = "Message Failed to send, the targeted player does not exist!";
};
//If there is no return text already, send the query to insert the message, and send it to the unit :D
if(_returnText == "")then{
_queryInsert = format ["INSERT INTO messages (senderUID,recieverUID,messagecontent) VALUES ('%1', '%2', '%3')",(_data select 1),(_data select 3),(_data select 4)];
diag_log format ["%1",_queryInsert];
[_queryInsert,1] call DB_fnc_asyncCall;
_returnText = "Message Sent";
};
[_returnText] RemoteExecCall ["ADT_ReturnFromMessage",(_data select 0)];
Which line. I don't see it
I don't see ctrlText here.
//lets make this check early :D
if((lbCurSel 3002) isEqualTo -1)exitWith{hint "Please select someone to send a message to!"};
//Main Display
_display = uiNamespace getVariable ["Lega_CustomTablet_Messaging",displayNull];
//PlayerList
_plist = _display displayCtrl 3002;
//Message Box
_MBox = _display displayCtrl 3005;
//Getting Data from Controls.
_Data = _plist lbData (lbCurSel 3002);
_unit = call (compile _Data);
_Text = ctrlText _Mbox;
//if they are trying to send an empy message. exit here.
if(_text isEqualTo "")exitWith{hint "You cant send an empty message."};
if(isNil "_unit")exitWith{};//Whoops. BadJuJu
//Getting all the data in a neat little array :)
_data = [player,(getPlayerUID player),_unit,(getPlayerUID _unit),_text];
[_data] remoteExecCall ["adt_fnc_serverSort",2];
_data ?
I don't see exactly where the issue is, but here is the likely problem:
""%3"" should i change to that in the insert ?
format ["%1", 0]; // "0"
format ["%1", "0"]; // "0"
format ["%1", str "0"]; // ""0""
If you use format and you want to preserve a string, then you have to add a str before it in the format array.
ill test now ๐
Otherwise the strings quote marks become discarded.
as for the timestamp, how would i get around that ?
If you updated to extdb3 it will auto convert date timestamps to Arma date array
So the date comes from the extension?
its extdb3
Submit repo it should convert the date to an array
this chan should be renamed reverse_engineering
"['76561198132926159','76561198132926159',Message Sent,2017-09-01 23:45:58]"
This string can't be compiled.
['76561198132926159','76561198132926159','Message Sent,2017-09-01 23:45:58']
This one can.
version="1.027";
```version of extdb3
Also try latest one before you make a bug report
Yup, will do , does it have to be a specific type of timestamp in database, there are a few choices ?
[1,[['76561198132926159','76561198132926159',"Message Sent",2017-09-02 14:10:38],['76561198132926159','76561198132926159',"Enter your message here.",2017-09-02 14:10:32]]]
Error in expression <iag_log text _queryResult;
_queryResult = call compile _queryResult;
if ((_query>
Error position: <= call compile _queryResult;
if ((_query>
Error Generic error in expression
File \life_server\Functions\MySQL\fn_asyncCall.sqf [DB_fnc_asyncCall], line 106
``` so after adding the string, getting that. going to update extdb now and try
Ok.
updating extdb3 worked.
I always thought Dedmen were multiple people
There are at least 3 nigel with the same avatar in this channel.
:U Good one..
men is plural of man
dedmen is a name. Not multiple words connected
Gotcha
Does anyone know a way of detecting if vehicle touched/hit an object create by createSimpleObject?
There is none. Nothing practical at least
Okay, so odd issue - in the init.sqf file for the server, I have this;
if (!isNil "pOperator1") then {
pOperator1 execVM "operator1Script.sqf";
};
However, everyone who isn't pOperator1 also see's the hint they get, even though the code should be executed locally. That, and for some reason, I get scalar NaN for one of the variable values.
That's a shame, wanted to optimise road barriers ;/
I'll share the scripts I have with everyone in a little bit, because everything should have worked fine.
if (player isEqualTo pOperator1)
Yeah... That is correct
Oh, that helps.
init.sqf runs on every machine, not just the server.
if you only want it to be executed on the machine that owns the operator use local to check if he is local
^
But the execVM "Operator1.sqf" should only execute for the pOperator1, right?
In your example? No.
Damn, okay :C
if (local pOperator1)
Also, BIS_fnc_createSimpleObject isn't working
@still forum What would you suggest for setting up radios? TFAR functions or modules?
Functions in preInit is most reliable
preInit? hmm okay, I used to have issues with ACE, where I tried to set variables in preInit, but some functions seemed to run in postinit in ace 3 and overwrote my values
You might have to use:
if (!isNil "pOperator1" && {local pOperator1}) then {
Because pOperator1 looks like a vehicle var name and if AI is disabled, the unit might not exist.
What about the player isEqualto pOperator1 part? Would I use that too?
nah, local is enough
And yeah, the mission doesn't use any AI, which is why I was using isNil, just incase there wasn't a player for one slot.
if (!isNull (missionNamespace getVariable ["pOperator1", objNull])) then {
Alternative ^
pOperator1 as variable still exists on every other machine as long as someone took the slot.
TFAR sets default variables at preInit. But only if they are not set already.
So doesn't matter if your preInit runs before/after TFAR
Ah, thanks! I'll try out the first one in a little bit. Got to finally test out my mission tonight, which is why I saw all this issues :c
TFAR waits 5 seconds after respawn till it sets Radio frequencies. If your frequency setting didn't arrive on the client till that point then it will use randomized frequencies.
So if your JIP queue is too full that might cause problems. I think I'll increase that time to 10 seconds though
can't you "just" EH the setting arriving on the client?
I can just setFreq. on player as well right?
I'll just setFreq for all the channels manuelly
I can't figure out how to search in a certain branch in gitHub?
you can't
just the master branch as far as I can tell
you'll have to clone it and search locally
g-g-great
Can you just EH that a JIPed Variable arrives on the client and you have 100% guarantee that it doesn't get overwritten after a few seconds?
you have to wait till the player has his Radio then. Before you setfreq
ohh, really? wait for radio, huh?
A JIP variable arrives before postInit on the client, even if it was sent at preInit from the server at mission start.
I can set up TFAR_defaultFrequencies_sr_west
ClientInit runs in postInit
So if I just set up the frequencies in preinit, when player jips, he should get correct frequencies
default frequencies are taken from a variable on the players group
if you set defaultFrequencies. The server detects that and the server set's the group variable and publicVariables it
You could just manually set the group variable I guess. That would be way more reliable
That's something I left from 0.9.x and didn't want to change. I probably should've though
Okay, I'm going to link all the important / main scripts. If anyone wanted to look over it, I'd be extremely grateful. I know it's a bit of a mess, but some of this was written when I first started A3 scripting, so it's been progressing over time, as my skills have progressed.
init.sqf: https://hastebin.com/ibusovujem.sqf
serverScript.sqf: https://hastebin.com/yuyanacuxe.sqf
operator1Script.sqf: https://hastebin.com/axewowiven.sqf
emp1Script.sqf: https://hastebin.com/kuvobagobe.sqf
hudScript.sqf: https://hastebin.com/aceretitut.sqf
How do you retrieve the damage of a vehicle now? After hitting a wall, shooting damage returns 0.
But if I setDamage it returns the damage just fine
@spice kayak For that much script a github repo would be far easier. In a commit we can just write comments on each line.
Instead of writing the comments hear and looking for the line number every time
@simple solstice getHitpointDamage
Ah, never used gitHUB, might try it then!
@still forum thanks!
or a google Doc where everyone can write comments. That could also work. But that would mean everyone has to show their google account. Which I don't quite like
Yeah, that's understandable.
I didn't realize how big this mission had gotten until I needed to copy and paste it :C
Is it possible to add addAction to an specific index point of a vehicle?
No. afaik.
If you have ACE you can use ACE Interaction menu to do that
I want _ARRAYELEMTN setVariable or variable setVariable
Would make things so much better
setting variables on a variable? :U
Setting variable on everything
Okay, not going to lie, I haven't used gitHub from the perspective of actually putting stuff on there. THis might take a while haha.
yeah, same. I got no clue how it works. I just post issues ๐
@spice kayak Learning how to use Git will probably be useful to you later on. Version Control is quite important if you write more than a couple small scripts
Yeah, maybe so. I've gone with what nigel said haha.
Is it possible to check if a certain index of an object is visible to a player?
Well, here you go, @still forum. Until I have a better understanding of GitHub, this'll have to do. Sorry!
Get it's position and line intersects
@still forum yeah know about lineIntersects but how do I get the positions?
That is even more useless than the hastebin ^^ Because the issue doesn't have line numbers
dunno that :u
Ha, sorry :c
selectionPosition found it ๐
I think you can just use the webinterface to add files to the repository
Go to https://github.com/Luronius/OperatorsVSGuards and click "Create New File"
Or just "Upload files" and put all your files in there
private _frequencies = [
"111",
"112",
"110",
"121",
"122",
"120",
"131",
"132",
"130"
];
private _data = [
0,
7,
_frequencies,
0,
nil,
-1,
0,
getPlayerUID player,
false,
true
];
(group player) setVariable ['tf_sw_frequency',_data];```
I'll just run this in preInit for all clients, ensuring they get the same radio freq
yes... looks good I guess
very interesting stuff
I can use vehicleVarName to set up the architecture...
And auto-assign channels as well
ohh, right..
Stuff like this is best suited to postInit anyway
Then gear scripts and all that jazz have had time to run, too
Also youre setting a variable on a group, thats dangerous at mission start
Groups are wierd then
Would preinit be great for stuff like weather sync and what not, or just init?
At any moment, really, but the later you do it the less chance something overwrites it after
Weather is its own bag of wierd behaviour anyway
You would really need a init. that is between preInit and postInit. But I don't think that exists sadly
Init.sqf in SP
will postInit only execute after that is done?
or is that scheduled and could run even after postInit?
MP init.sqf is completly useless because it is scheduled and there is no guarantee that it is done before postInit
Since in MP it runs after ill go and assume theyre not linked in SP either, i guess
Is there a CBA init?
What are you trying to do?
So when the sqm init fields are parsed
a script like init.sqf but with guarantee that it is done before postInit runs
And after preInit
preferably around the same time as init.sqf runs.. Or just before postInit..
init.sqf is a scheduled script. It might run hours after the mission started.
yeah that is the problem
Well yes thats why were asking
As soon as a script is scheduled, you have no idea when it's done and which of two finishes first.
How are pre and postinit called? Engineland or obscure UI script like cfgFunctions?
If there is something like prePostInit.
so
preInit
<init.sqf somewhere in between>
prePostInit (This is what I'm searching for)
postInit
preInit is called by initFunctions.sqf at frame 0.
PreInitPost would be before init.sqf and before objects are initialized
I want something before postInit and after init
Ah, right
postInit is called by initFunctions.sqf after a waitUntil {!isNull player} essentially.
except for the server and hc
So modify it and call an extra script before then is possible
What do you think of adding a prePostInit to CBA?
That calls all prePostInit's first and then the normal postInit. Just to get more granularity
can't you just manipulate the order of which the postInit things are executed by changing requiredAddons
?
you can't in a mission
PostPostInit4 level granularity :P
and you can only force others to run before you. Not after you
postinit and initpost was difficult enough for me.
Right now we have
1
2 preInit
3
<Mission spawns objects>
4
5 postInit
6
I just want EH's for the numbers that don't have anything yet
that was what i was working on @little eagle just gotta mess with the colours.
Actually what i think would be mostly useful is the one where <Mission spawns objects>
There rest is just adding more featurewise
In there https://github.com/CBATeam/CBA_A3/blob/ffd5fa78b0c51427e186909682fe7ea1815c6906/addons/xeh/fnc_postInit_unscheduled.sqf#L26-L31
Just add another
// call prePostInit events
{
if (_x select 1 == "prePostInit") then {
[] call (_x select 2);
};
} forEach GVAR(allEventHandlers);
before the normal postInit. That seems quite easy to add
Use the init box of a game logic ๐
What if its for an addon?
TFAR is doing that with a Module. But these seem very flaky with JIP.
And that would only work for Missions
I just need a reliably way where people can execute code between pre and postInit.
Because at preInit my Addon initializes it's core stuff. and at postInit it runs.
If mission maker set's stuff at preInit it might be before the addon is initialized. And if he set's stuff at postInit. It might run after the Addons postInit
init box of any object
PR ;)
It's bloated already. Stop
@peak plover doing it in postInit should work. Because TFAR will only hand out radios 5 seconds after that.
Aigh, sounds good
lineIntersects [aimPos player, jerry modelToWorldVisualWorld (jerry selectionPosition "head"), player, jerry];
jerry is an spawned NPC
If i look at him, nothing changes. it always returns false
and Im lost. because modelToWorldVisualWorld returns an ASL position, same as aimPos or eyePos
onSetFocus = "_this ctrlSetText ''";
``` I should be able to do something like that on a RscEdit ? right ?
_this select 0
Ill try it ๐ thanks ๐
@simple solstice youre telling the function to ignore jerry?
so ofc it would return false
i have a string that i would like to be interpreted as a variable name, as in alive "_unit"; how do i do that?
missionNamespace getVariable ["STRING",objNull]
missionNamespace? even if its private and local
what is your string
is it really "_myVar"
or does it hold the varName of the object
"_unit" lets say
then you have to use call compile "_unit" with the sidenote that you can do things in a far better way
how do you even end up with a string of a local var
Anyone know about issues where ctrlCreate controls, actually end up below, the layer your making them on ?
well ok it's not _unit at all
i have three local functions _fnc_a _fnc_b etc
each takes one argument
i want to apply one of them randomly to that argument
arg call selectRandom [_fnc_a,_fnc_b,_fnc_c]