#arma3_scripting
1 messages ยท Page 330 of 1
It's totally not. Old TFAR with SQF can take between 5 to over 50ms per frame. Effectively killing your FPS. new TFAR with Intercept is at about 2-5ms per frame.
AI is SQF yeah.
What native lang?
Yeah part of AI is native engine. But a lot of it is also FSM.
it looks extremely similar to SQF
FSM is SQF.
What is the EULA / TOS for reverse engineering arma to make mods?
or acquiring information to make mods with
Uhm. I think reversing is not allowed. But... BI didn't really get angry at Intercept yet... soo..
That's true
Ok, well if I have data on a private computer they can try to send auditors if they want lol
Problem is SQF is the only part we can actually really influence.
Arma doesn't actually use Threads for that.
Also not visible in windows perf monitor
windows performance monitor isn't always accurate though. It's best to use a debugger for that kind of thing
all scripts (FSM's are scripts) run in main Thread
ah k
yeas
If arma spun up 2 legit threads for every unit it would be a miracle for it to run at all
No.
Oh you reversed it and mapped it out?
Publicly I don't have anything.
you know when you say things like "publicly I don't have anything"
it doesn't do shit to cover you legally lol
especially when you just admitted to reversing, just own it
your computer, your control. they can send auditors if they want
I don't do anything bad with the Information I have. And that's also why I share as little as possible of that
@tough abyss just for an example of an FSM https://www.dropbox.com/s/4a1joi77407laur/fsm.png?dl=0
That's fine. I'm just saying that things like "my friend may have..." I don't publicly..." don't do anything to protect you
If I were to reverse engineer arma the intent would also be to improve gameplay experience for everyonre
i'm sure you're pretty safe in the knowledge that there's sketchy people doing sketchy stuff with the same data you reverse eng'd anyway
it's danger.fsm
@tardy wagon Which is what I'm doing ^^
๐
Though, remember that FSM is run the legendary 2nd core
yay, I am a strong believer of "my computer my control"
FSM also runs in main thead. Not on 2nd or any other core.
... No
Except if Addons like ASR AI modify AI behaviour
Then the Wiki is wrong.
where does it say that?
Or unclear.
The wiki is also mostly written by people that speculate and don't know any better.
We did a little cleanup on scheduled/unscheduled just recently
@tough abyss You also think Suma is a person? ^^
Suma is a company.
BI was created out of Suma
Using IDA mainly.
https://community.bistudio.com/wiki/User:Suma
Ondrej's Account
A version for Atari Jaguar was in development, but has not been released
nice. when can we expect this?
if I was feeling more trolly I would tag dwarden and ask him
ida is love. i wish i had enough to buy the proper licence though
would totally support those dudes that make it
Me too. I would actually really pay the 500โฌ for it as much as I use it. But that would only pay for the starter edition which doesn't support x64. Which is hugely important for me :/
They should really have a Education/Student program.
The stuff that I currently have a need for. When choosing the always cheapest option I'm looking at 8k.
I don't really like people that use cracked Software because they want to just spare money. But if I can choose between my own Car or a piece of Software I use as part of my Hobby a couple times a week. I don't think that long.
Why does #arma3_scripting always get so offtopic? ๐
@still forum branched discussions ๐
but tl;dr ida is very powerful. i love some of the addons it has (i mainly use it for reverse engineering)
Cracked software? I would never do that but have fun proving it
Hey folks.
if !isserver exitwith {};
systemChat format["%picking new site..."];
_goodSite = false;
while {!_goodSite} do {
_site = selectRandom SITES;
_goodSite = true;
};
systemChat format["%chosen new site..."];
_site
I have the following file. Should be returning a marker, from my global SITES.
However it's returning any
as in, if I systemChat _site
it states, any
_site is undefined in the parent scope (of the while loop). You need to declare _site in the parent scope (whether you define it, or just make it private)
Ahh,
Thank you.
I should have seen that..
if ((count units _group == 0) || (isNull _group)) exitWith {
deleteGroup _group;
0 = ["Zen_SpawnGroup", "No units could be spawned, group is empty and null", _this] call Zen_PrintError;
call Zen_StackPrint;
call Zen_StackRemove;
(grpNull)
};
if (surfaceIsWater _pos) then {
{
_x setPosASL ([_pos, random 2, random 360, "compass", _pos select 2] call Zen_ExtendVector);
} forEach (units _group);
} else {
{
_x setPosATL ([_pos, random 2, random 360, "compass", _pos select 2] call Zen_ExtendVector);
} forEach (units _group);
};
call Zen_StackRemove;
(_group)
Is, (grpNull) a return statement?
This is obv not mine, from the Zen framework.
Hey guys, does anyone know if default groups in lobby removes when empty? LIke if I choose a group in side selection in lobby, and then I script myself into another group, will that old group remove itself?
Because I know you can script so you can create a group that will delete when empty
probably not, because then how would JIP players choose a group?
if they all just deleted themselves cos they were empty it would be a clusterfuck surely
Ye, I was afraid of that
yes @hearty plover, because of the exitWith
So I've got this script that destroys all buildings in an area. I've just modified it so that it will randomly damage or destroy a building, but other than the damage textures, the damaged buildings are still intact. Is there a way to make the damaged ones partially collapsed? _buildings = (markerpos "DE1") nearobjects ["house",500]; {_x setdamage selectRandom [0.9,0,8,1];} foreach _buildings;
I'm wondering if it would be difficult to add the 'Enhanced Movement' mod to my small co-op mission I have..
@outer scarab I don't seem to get the point with the 8 in your array
As damage only takes values between 0 and 1
@obsidian chasm Define Enhanced Movement
If you are looking for reloading and such, have a look at actions @peak plover
selectRandom [0.9,0,8,1];
typo?
0.9 0 8 1
Maybe
Aye I did it. It was simple. I just kind of turned it on.. lol
@peak plover https://community.bistudio.com/wiki/Arma_3_Actions
Action: SwitchMagazine
Maybe that is what you are looking for
SwitchMagazine actually "switches" the weapon, muzzle and weapon mode, but not the magazine.
Yeah this action does not work
It does work..
Well not like how I want it to
Yes.
I want a script where I can change the magazine of the weapon through a function. So basically instead of using action menu to load my tracers, I would use ace interaction and do it through that instead
tracers will corrode the shit out of your barrel. Proceed with caution
they are also expensive as fuck
and you might start fires
Im pretty sure more fires are started in the military by cooking than tracers
@rotund cypress Hah, that was MEANT to be 0.8
It would be cool to write a rigging / mountaineering mod
building anchors, better rappelling, etc
Hmm, yes
https://jiveassanchors.files.wordpress.com/2013/05/rappel-anchor-ryan-cupp.jpg
Would not reccomend rapping off of a knot wedged in a restriction
Can't find anything about changing plane loadouts in a script in the wiki, can anybody link to some related page?
Look for pylon in then command list in wiki
If I need a good script for it then use
GOM Aircraft Loadout
It does it in a GUI where I can change the loadout in-game
Besides running canAdd on the smallest possible item (I'm thinking chemlight?), is there any way to determine if an object has storage?
load _container < 1
I think.
is there a way to "broadcast" briefing.(sqf) from dedicated server to init and JIP players alike?
@little eagle thanks for the tip, but it only works for "containers" -- ie uniform/vest/backpack ๐ฆ
well, technically units*
a
b
d
c
Hey guys, does anyone know whats faster, _this select _i or _this param [_i]?
@rotund cypress param afaik
@rotund cypress u r comparing different things an u ve wrong syntax.
I think I mean:
_i=_this select 0;
which can be substituted with
params["_i"];
But to be precise this is more the same as
private _i=_this select 0;
params is faster and has much more features to define default values and check for types and so on...
That is not what I mean
I would use params
But for only one parameter
{param [0] == "string"} or {_this select 0 == "string"}
@rotund cypress you're making this so much harder on yourself. https://community.bistudio.com/wiki/params
no need to use that when only thing I need is one parameter
params[["_myCookie",objNull,Object,1]];
that doesnt even need to be stored in a variable
Yes that is what I usually use
But there is sometimes no need for it
When only thing I have an if
Good to check anyways, just in case you or someone else is debugging your mission and has no idea the problem
Sorry, but tbf, question wasn't about params or what to use, question was which one is faster, select or param
and you can't check if it's a string by doing "_myCookie == "object" typeName is the command you want to use
He never suggested that
๐คฆ
Little off topic
Well I'm just pointing that out. It is related as Sim was asking the difference between param and just selecting from passed
and I was just suggesting that param should be used to check the variable type instead of getting a new line to check the type
and you can't check if it's a string by doing "_myCookie == "object" typeName is the command you want to use
I never said I wanted to get datatype of a variable
It was just an example of checking a variable to a string
I'm not sure that you were, I was just pointing that out in case you hadn't already been using it
๐
@subtle ore typeName is pretty much deprecated with the introduction of isEqualType
Alright, I'll make sure to use it in the future
๐
@Midnight typeName is pretty much deprecated with the introduction of isEqualType
They are fundementally different, and cannot cover every use case
typeName can be used for switch blocks I guess. But it definitely got rarer since isEqualType
When doing the CFG radio is the db-100 like the cfgmusic where you can +10 too?
class CfgRadio
{
sounds[] = {};
class Halo2_D
{
name = "";
sound[] = {"\Voice\dead\Halo2.ogg", db-100, 1.0};
title = "";
};
};
Idea @tough abyss Maybe handle the key being pressed to engage it?
if unconscious -> moveOut ?
at least for the VehicleProb
hmm
You can still do it, even without a Bipod
Yep :/
+Check 2nd comment
That together with an EH -> Should do the trick
Does anyone know how long ago the loadUniform, loadVest and loadBackpack changed to percentages rather than total mass as the wiki describes?
were percent since first day of alpha
Thank you very much for that confirmation @meager granite
@plucky beacon yes
Can someone explain this error 11:39:36 Performance warning: SimpleSerialization::Write 'params' is using type of ',CONTROL' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 11:39:36 Serialization of Control variables is not implemented in the context of the following code ```SQF
#include "script_component.hpp"
disableSerialization;
params ["_control", "_pos"];
switch (str _control) do {
case "Control #80003": {
hint "works";
};
};
Called with ```CPP
onSliderPosChanged = QUOTE([ARR_1(_this)] remoteExecCall [ARR_2(QQFUNC(commitWeather), 0)]);
@tough abyss Certain data types (eg namespace, config, display, control, target, task) aren't optimized with params
I wouldn't worry about it too much, unless its constantly spamming you
@warm gorge thanks.
Thanks cuel
is it possible to give a vehicle radar without modifying configs?
mmm probably not
@tough abyss It has nothing to do with the params, but with publicVariable or remoteExec. Just for the record.
How can i split a multi array? For example: [[1,2,3],[4,5,6]] into [1,2,3] and [4,5,6] ?
_array1 = _multiArray select 0;
_array2 = _multiArray select 1;
๐
@little eagle ok, thanks.
@scarlet temple
_multiArray params ["_array1", "_array2"];
Also for the record, onSliderPosChanged returns 2 vars in an array. So the following won't work SQF _control = _this select 0; _value = _this select 1; but this will ```SQF
_sliderRtrn = _this select 0;
_control = _sliderRtrn select 0;
_value = _sliderRtrn select 1;
(_this select 0) params ["_control", "_value"];
Wow that's...
Much better but still kinda retarded.
Why not return 2 separate vars...
param [0] params ["_control", "_value"];
Same as
_this select 0
but faster
Oh, nice.
Idk, I was bored.
hello all im making a mission on utes so im making a script that kills the lights what are those lights called in the builinds around the airport control tower etc (noob at this but i gota start somewhere :D)
you could find out by using nearestObjects or something like that (i can't remember the function exactly) @midnight idol
like, get close to one, systemchat or diag_log near object classnames...boom
ok cool
cutText ["<t color='#ff0000' font= 'PuristaMedium' size='5'>test</t>", "BLACK FADED", 999, true, true];
keep getting error for 2elements expected, 5provided
even used this in biki example:
cutText ["<t color='#ff0000' size='5'>RED ALERT!</t><br/>***********", "PLAIN", -1, true, true];
no luck
i can create extra display in rsctitles just to display this kind of thing, but there has to be another way
I guess it never went into stable?
think so (ive already made a display), but i have another question guys, whats the path to this background? http://prntscr.com/fu0mq7 iam searching through rscbackgrounds and stuff, cant find it
old screen ikr
who was the person that got Discord to add syntax highlighting for sqf in code blocks?
asking on behalf of a game engine which has a discord but no discord syntax highlighting for their scripting language
@rotund cypress _this select 0 should logically be faster than param [0]
But best solution would still be to use params once for all your arguments. And if you only have on argument then don't pass it in an array.
Good to see Midnight is like always giving wrong advice and completly missing the actual question ๐
๐
I use params for all my parameters
However
When doing something like (param [1, [], [[]]]) params [...]
Params I don't think would be needed as it would drain more performance
If the code path that needs that parameter is rarely taken. use _this select 0 better readability than param [0] and should logically be faster because param has a few extra features that select doesn't have and that you probably don't need in there anyway
And if that path is rarely taken the performance impact doesn't matter anyway. so go for readability
Dedmen, param is unary when "used with" _this. And that makes it faster I believe.
And it being easier to read is subjective. I got used to param [N] pretty fast. And since it's less words and unary...
You believe? one 16 byte value on the scriptstack is a couple nanoseconds.
compared to the amount of extra work param is doing o check for nil and stuff..
Finding the value in _this is probably taking the most time. but param is also doing that. Just behind the scenes
why doesn't someone just test it and back their argument up with cold hard data
Next computer with Arma that I have access to is about 10km away from me. And I guess Commy doesn't have Arma running right now
pretty sure commy is a bot running inside arma 3
_this = [1,2,3];
_this select 0
_this = [1,2,3];
param [0]
Will test these ^
wait, is param [0] params ["_a","_b"] faster than params ["_a","_b"] makes no sense
Yeah, that would make no sense.
param [0] params [blah
vs.
(_this select 0) params [blah
0.0066 ms
0.0085 ms
Yeah, select one is still faster
But it's a race of param vs. binary command, so it wasn't clear.
select is only faster if you have 1 thing and you don't need private
param has nothing to do with private
s
params does and params != param
param still has the benefit of working with non-arrays though.
Also this is all marginal and no one should care.
Not really. There are some rare instances of things that run 1000s times per second
People should always care
If performance is important then it is. If it's not then it's not.
Yeah, this isn't everyones top priority
apply the pareto principle :^)
Whenever I want to do something and I get ideas for something, I always look at someone elses work, but I never rip it off because I just disagree with most of it and have to rewrite to fit my "standards"
_this = [1,2,3];
_this select 0
0.0009 ms
_this = [1,2,3];
param [0]
0.0012 ms
๐ I don't always save time, but when I do, it is in nanoseconds...
10k
If everyone whose scripts I've sniffed knew I'd be sued.
@little eagle ^^^^^
I've done a lot of things
I'll have you know I've made hundreds of missions ๐
Some of them even worked
Recent ones use a mission framework that's a mod. I'm working on my own framework right now, I'll hit you on DM if still interested.
It's not 300 nanoseconds per 10000 cycles, but per each cycle.
https://pastebin.com/BCNLN7GZ I've spent hours on documentation now. I remove time from procastinating and browsing internet and put it into nanoseconds and documentation
Yeah, depending on how heavy the loop is it can save a bunch of performance
I had 3000 cycles in around a second and turned it to around half by optimizing and removing really stupid code
nice nigel, when are you gonna write the code to go with those comments?
That's all ready
Yeah and also on the scope of what you're doing. If it's thousands of scripts like in ACE, you can't be as lazy as some BI scripts.
I'm still not finished with all of the systems
I write the code, comment it and then make documentation
documentation ๐ฒ
// Runs onRespawn for wave respawn
// Runs the respawn timer for players
// _unit call respawn_fnc_wave_onRespawn;
"respawn_fnc_wave_onRespawn" spawn debug_fnc_log;
// Code begins
params ["_unit"];
// Get/set unit side
private _unitSide = _unit call respawn_fnc_getSetUnitSide;
// Check if respawn wave has already been requested for _unitSide
_requestedVar = format ["respawn_wave_requested_%1",_unitSide];
private _requested = missionNamespace getVariable [_requestedVar,false];
// If wave is already requested, check if it's done yet
if (_requested) then {
_timeVar = format ["respawn_wave_time_%1",_unitSide];
_time = missionNamespace getVariable [_timeVar,1];
// Respawn unit if respawn time is less than 0 and unit is dead
if (_time < 1) then {
if (_unit getVariable ["unit_respawn_dead",false]) then {
_unit call respawn_fnc_respawnUnit;
};
};
} else {
// if wave has not been requested, requrest it!
missionNamespace setVariable [_requestedVar,true,true];
};
// Show time 'til respawn as hint ?
if (_unit getVariable ["unit_respawn_dead",true]) then {
_unit spawn respawn_fnc_wave_playerTimer;
};
My issue is that I've got a pretty bad memory. So I can forget what I wrote in a few weeks
So doing this actually saves me tons of time when using older scripts in the future
no tag = not valid code
What do you mean?
nige_func_funcname
nah, fuck that. This is for my use. I'll put it on github when it's more polished. But I don't really care for nig_fnc
If I used some other mission base/fw or I do somethign as a mod I use nig_fnc. But this does not really need it as you won't have code with respawn_wave_ most likely
those OPFEC guys are gonna fk you up when they find you
What will they do?
have you seen the film Scum?
it's a good convention though, no need to shit on it ๐
@peak plover nig_fnc ? Hehehe.
Hey there, can someone tell me how i would get the _adminpos out of this, prefering %3 ```C
_adminpos = username, uid, the guy executing the script thru debug infistar (F3 key)
_marker = createMarker ["event1", _adminpos];
_marker setMarkerType "mil_warning";
_marker setMarkerText "ADMIN SPOTTED";
_marker setMarkerColor "ColorRed";
@waxen jacinth because its an array not a single pos.
@waxen jacinth (position (_adminpos select 2))? Since _adminpos select 2 is, "the guy executing the script" which I assume is a player object.
explain your question better because it's not really making sense
you want to get a position or a username?
@waxen jacinth that's exactly what I was getting at sigh (position(_adminPos select 2))
The above pastebin is a file I have, which is giving me a missing ; on line 69...
I have been trying to track this one down for a few days, as the rest of my teams efforts have been on other features, now we are coming back around too it and we can't figure it out for the life of us..
If anyone can take some time to give it a look, please do.
Disclaimer, it's a mess, two large switch statements wrapping code that will eventual be moved into other functions.
So, sorry for that before hand.
Hmm, It's copied right from the website to...
Damn
Yeha
You can tell which one I used my auto complete on too.
The inner loop I did with the auto complete.
How did I miss that shit..
stared at it too long ๐
Likely..
Been wokring on this for 2 hours, trying to get it done this morning so the other guys can start splitting this into nice neat functions and I can move on to building a database for another set of things we wana do
@little eagle so when would one use param [N] instead of _this select N?
you can use param [N,default] to get a default value in case the entry doesn't exist in the Array or is Nil
also param can also cope with non-arrays "test" param [0] -> "test"
I only use param for the default value.
private _myvar = something select 0;
if (isNil "_myvar") then {_myvar = default;};
is equal to
private _myvar = something param [0, default];
Although at that point you might as well write
something params [["_myVar", default]];
According to Config Viewer on Eden editor, Map size of Malden is 30720. is it correct?
(FYI, Stratis: 8192, Tanoa: 15360, Altis: 30720)
malden is somewhere between 12000 and 13000
Weird. Measured distance is 12xxx, but 30720 on the Config viewer.
I believe this has already been reported on the feedback tracker
or not, it was a twitter post ๐
thx guys.
where did next/prev buttons go in debug console? to retrieve command history http://i.imgur.com/1Uff1ur.png
That's part of CBA, do you have it launched?
ah thanks, I was working on a different mod when I remembered seeing those buttons, and CBA was loaded then
Tiny Release of ArmA.Studio
https://x39.io/projects?project=ArmA.Studio
https://forums.bistudio.com/forums/topic/203020-armastudio-the-open-source-community-made-ide-for-arma/?do=findComment&comment=3212306
just pushing the latest developments to the "major" build
@grand berry not sure it is, thought it was in base game too
@subtle ore https://youtu.be/iJ2eHMvjiQo It was certainly originally added in CBA, don't think it's part of the core game yet.
@grand berry I swear it was at one point in time ๐คท
Would be good if it was
Would calling endMission/BIS_fnc_endMission on a player loading into a server (past lobby, on map screen loading in) cause any issues? Or would it be better to waitUntil !isNull findDisplay 46 or something
it would end the mission before he gets a chance to play it, is that not an issue?
Just curious because I want to use it in this way but not sure how endMission works with the UI or if it wouldn't work properly until the player is fully loaded in. But I guess it should be fine
how come you want to do this anyway?
To prevent a player from loading into the mission if they arent whitelisted for a certain slot. So basically from initLocalPlayer it does a check and if that fails, it calls endMission
ahhh that makes sense
so many things seem stupid til you think of all possible use cases ๐
Yeah true aha
If he is JIP then you could kick him before he runs initPlayerLocal.sqf if server does it remotely from initPlayerServer.sqf. Sudo code: private _player = _this select 0;
private _whitelist = ["232342342323","232323232323"];
if (!((getPlayerUID _player) in _whitelist) && _player == ReservedPlayerVarName) then {
"end1" remoteExec ["BIS_fnc_endMission", _player, false];
};
initplayerlocal if (!((getPlayerUID _player) in _whitelist) then {endMission "LOSER"}
Yeah, there is no reason to remote exec almost anything at mission start. You can just put it into the initPlayerLocal file instead. Why transfer information ingame when the whole mission is transferred beforehand anyway? (incl. initPlayerSever file!). It's like doing twice the work and the code is uglier too.
@little eagle you mentioned that the private params aren't set when using onMapSingleClick with addMissionEventHandler
does this apply to all (mission) EHs?
i have literaly no idea what you just said
and searching for that what you mentioned did not resulted in anythign useful @halcyon crypt (unless it was neither yesterday nor today)
params ["_foo", "_bar"]```
will mark `_foo` & `_bar` private if thats what youre talking about
[4:02 PM] commy2: @Neviothr _pos is not a special variable in the mission eventhandler version
[4:03 PM] commy2: use:
params ["_units", "_pos", "_alt", "_shift"];
(edited)
[4:03 PM] commy2: Order might be wrong.
that's the quote
ahh ... probably ... the addMissionEventHandler callback functions differ from onMapSingleClick a lot
general info if something does happen can be optained via https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler
Hey! Someone is interested in making a JSON-RPC plugin for A3?
JSON-RPC?
HTTP/RPC, whatever
I want to make a Marketplace addon for mission makers baked by NodeJS + Mongo
And I though that it would be usefull to make a .dll that directly connects with an external API from the client, as for now people tend to use extDB2/3, that gives a heavy load to the A3 server
I'm trying my way around it in C++ w/ sockets & threads, but I can't do it alone it seems
NodeJS and MongoDB ๐
connecting the bad with the evil
Hahahaha, redis is also a choice ๐
no idea about implementation details of extDB2 ... but it sounds pretty bad if it does have a real impact
Or would you rather do it in PHP? ๐ฎ
It puts all request throw 'call_extension', that is blocking. They made a tickeing system that aliaviates some of the load, but still block on each call
Well, I leave this here, please do tell if you are interested in making a Open Source project for that
How come when I create a vehicle, for example a Go Kart (C_Kart_01_F), the camo/variant is different per client? How can I make it the same for everyone
what's wrong with node or mongo @queen cargo ?
@warm gorge Disable color randomization, do your own
both just hipster crap
nodejs usually gets used for applications like the discord client which opens gigantic security holes as to run it a full blown webbrowser is required
mongodb is simply missused most of the time like most of those db types are (just search for mongo db "security" issues in google)
BI color randomization uses Init event handler which runs at point where vehicle locality is still not set and all vehicles you get from server appear as local to you so each client thinks they created the vehicle and paints it
in general: search for security problems and you will find plenty for both
Ah I see, thats kinda silly... Oh well. Found the variable I need to disable, BIS_enableRandomization. Will just set it manually. Cheers. @meager granite
so your problem is with CEF based desktop programs rather than node itself?
is that "security" issue you're refering to DBA's not changing the default password
you'd have to come up with many good reasons to not use node if you want to counter the many good reasons TO use it
it's very fast, it's javascript so comes with huge knowledge base and millions of packages
npm install anything_you_want
vs "hipster crap and ummm security problems?"
to 1: depends on your usecase
for what JS was build innitially, yes
for a lot of other cases, no
to 2: mainly useful for webdevelopers
C/C++ still has way more (though way more complicated in usage)
python also has a hell lot of packages
c#, java, ... all the same
just a different way to access those libs
to 3: there are other languages you can get such things too
hell thx to nuget in visual studio you even can do that in c/c++ nowdays
and in regards of security ... just lets take this as example (first showing up on google which is pretty recent)
http://www.infoworld.com/article/3048526/security/nodejs-alert-google-engineer-finds-flaw-in-npm-scripts.html
hahaha
it's just a backend
you can do it with whatever, but all software implementations can break in pieces with a bad design
NodeJS, Python, Ruby, PHP etc
You probably are going to mess more easily with C/C++, Java etc that in JS
ye ... defend it
instead of admiting those problems
one lil thing: if you cannot find things you can point at on the language you use, and you enjoy using that language
you are probably nothing else but a fanboy ...
But on the long painfull run, C++/Java is a better approach
c/c++ i have to agree on
java, c# etc. not rly
to mess up here you have to be trying
NodeJS is good for a fast delivered prototype,
lmao x39 talking shit again
use whatever tool or language that is suitable and right for the job
was asked why i am not for NodeJS @cedar kindle
just use the right lang for the right problem as @cedar kindle said
but do not use one lang just because you favor it if another lang is better
javascript/node mainly useful to web developers? who'd have thought?
python does have many packages but npm has the most of any in the world. and it's faster than python for pretty much everything
no i said use whatever you want as long as it's suitable
he was talking about a marketplace, you can use whatever backend you want
you did noticed that i said the exact same thing and agreed with you @cedar kindle ...
Just
yet you instantly said nodejs was wrong to use here which it is certainly not because it's nothing else than io
Program in assembly, fun granted for years to come
Anyway, still no one interested in C++ .dll fun? ๐
c++ is for hipsters and it's insecure
But RVEngine forces you to use it for plugins
I'd rather do it in any other language, but I'm not allowed
(Yeah, I know there was a JNI plugin, but hasn't been updated since 2014 and doesn't work properly as of today)
@cedar kindle fakenews ... the whole discussion was not about nodejs being right or wrong for the job
lol.
it was about why i dislike nodejs and mongodb
@cedar kindle yeah, tried it on my local machine but couldn't get it to work
But NodeJS is soooooooo easy for making an API
Piece of cake
it's good isn't it
Why is c++ insecure
good question
it should work if you're running 32bit @icy raft, we're using it for logs on our unix server
hmm
idk, will try to get it working some other day, tried compiling it from source with no luck
@halcyon crypt
you mentioned that the private params aren't set when using onMapSingleClick with addMissionEventHandler(bearbeitet)
does this apply to all (mission) EHs?
Yes._thisis the only special variable and can be different from the stacked / command version.
Aaand as usual X39 is just talking non-sense. Why even answer if you have no idea? At least the wiki link is helpful.
aaaaand commy2 is a retarded as usual
@little eagle german?
he is
so I guess when the wiki says "(same as _id param)", "(same as _uid param)", etc it's save to assume that those variable are available without explicitly doing the params ["_id", "_uid", "etc"]; thingy, right?
๐
it's save to assume that those variable are available without explicitly doing the params
No, all it means that the wiki is ambiguous. "same as" refers to the stacked and command versions.
well using those variables without params doesn't seem to be throwing errors soo I'm lost ๐
in sqf it's never safe to asume anything
ever
Do error checking before trying something risky if you want to be safe, and even then sometimes it will blow up
@icy raft into bits and pieces
With fire, lots of it
oh I know, I'm just not in a position to actually test anything at the moment :/
huh huh?
@halcyon crypt youre not in the position to test? Im not sure what you are talking about
on Linux and BI/VP taking a long ass time to update the port from 1.64 to 1.72 ๐
Ooooh..sweet a linux update :D
I wish ๐
1.72 is the latest is it not?
for Windows yes
Damn,
@subtle ore and butterflies
@icy raft Shieett.
@halcyon crypt What's your question, I'll answer it with no drama ๐
whether or not the magic variables are available in EHs set with addMissionEventHandler vs BIS_fnc_addStackedEventHandler
e.g. _id and _uid in the case of PlayerConnected
@tranquil nymph takes cover from shots above head
When using addMissionEventHandler the arguments listed in the third column here (https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#PlayerConnected) are passed in as _this
When using the script command onPlayerConnected or the stacked function, they are local variables pre-set before the code you pass in runs
You should always be using addMissionEventHandler these days anyway though
Hope that clears everything up
so you're saying that _id and _uid are definitely set without going through the params ["_id", "_uid"]; dance
In the case of the script command onPlayerConnected and when using BIS_fnc_addStackedEventHandler yes
Those are both obsolete methods though and addMissionEventHandler is preferable for compatibility and performance reasons
Plus, personally, I find that having all arguments consistently given as _this is much cleaner than magic local variables that are not explicitly declared
sure, I agree. Just mentally debugging some code laying around ๐
๐
@halcyon crypt A mental debugger? What are you the first cyborg we don't know about?
I'm not allowed to discus such things! ๐ค
Shit, we're on to them. Spies! Lies! Gov experiments! Arma debuggers, what's next?
Have you tried running it through the sqf linter? ๐
SQF Linter HAHA ๐
Holy fuck, it exists!
Not perfect, but pretty close and has saved me some headaches before
I've been told it's not throwing any errors so it should be correct
@halcyon crypt not always true
@little eagle was right after all
He usually is
_id, _uid, etc aren't set with addMissionEventHandler
I...just said that ๐
you didn't ๐
marcel
well using those variables without params doesn't seem to be throwing errors soo I'm lost ๐
Because the code of eventhandlers run in unscheduled environment where undefined variables are usable and simply reportnil
I wish discord had a quote feature
When using addMissionEventHandler the arguments listed in the third column here (https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#PlayerConnected) are passed in as _this
commy2 was right after all
What did you expect?
@tranquil nymph I'm sorry.. I must've misread the bits after that โค
All hail Commy? ๐
๐
haha it's cool, I figured as much
and just to annoy @queen cargo, you were wrong ๐
You misunderstood what I said
Do I need to grab my popcorn?
No one understands what X39 says, because it makes no sense to begin with.
Hey guys, can I use try catch without throw and still get an exception?
try catch works?
It works, but I am not sure, it works a bit differently from other languages
Only throw makes it jump to the catch block.
Script errors don't. assert doesn't either.
The whole try-throw-catch command structure is pointless.
It's a glorified if-then-else.
hmmm i'll wait for x39's opinion
Ahaha. He'll probably say it's useful or some cray shit like that.
if/then/else is for hipsters
Dunno about that, but try-throw-catch certainly is.
Did you know that...?
Yeah the try catch sqf syntax is dumb
It's like they added it because programming languages have it, but they didn't grasp the purpose of it
@little eagle that makes it absolute useless
The whole point of try catch is non-existant but it's still in? ๐ค
Hey y'all there's something I can't seem to understand: I'm trying to display the player's cash and bank from my spawn menu (life) but can't seem to parse formatted text to the structured text thing.
17:06:16 Error in expression <x) select 0];
} forEach _spCfg;
CONTROL(38500,38575) ctrlSetStructuredText pars>
I don't think I know what I'm doing with that "CONTROL(X,X)" thing
Join the life frameworks discord @tardy yacht
There is no one here who knows what those macros are doing
Well you still helped me by telling me that was a macro. I was right, I don't know what I'm doing. Thank you!
try catch and throw got their usecases
but nobody (not even BIS) is using it anyway ...
in regards of "is not catching script errors" well ... actually surrounding scripts with trycatch is a pretty bad way ...
even in everyday coding you should not surround everything that could throw exceptions with a try catch
it indeed is bad however, that it is not catching exceptions
would be kinda simple to do so one would think
Well, try catch in other languages are very handy sometimes, for things that causes errors that is out of programmers control @queen cargo
Which is exactly what it is intended for
you do not have those things in arma
thats the point
there is no IO stuff
no networking
no nothing like that
only those pisky script errors
which can most of the time be catched by using params
There is things in ArmA that is out of users control, that can cause issues depending on different situations
need to run x39's messages through the commy linter
๐ @little eagle
need to run x39's messages through the commy linter
"try catch and throw got their usecases"
->
๐ฉ
Commy, how badly do you hate X39's gut?
I don't. I just hate the poo poo he writes all the time.
while {true} do {hate += 1}
imagine if you could += in SQF like a proper language
and don't show me some cba macro commy
cos i'm sure there's one for that
I was about to write something different, but meh
what's the hate threshold then?
you were about to show me a cba macro weren't you
It's:
INC(_number);
btw.
let me run that through the dscha linter and see what it says
what's the hate threshold then?
0.5
Eh, I'm not even advocating for using this macro or all the similar ones.
I think pure SQF is easier to read in such cases.
I'm unsure why I get this error Error position: <(38500,38575) ctrlSetStructuredText pars> 18:17:39 Error Missing ;
Full line: ((findDisplay 38500) displayCtrl 38575) ctrlSetStructuredText parseText format ["<img size='1.7' image='icons\ico_bank.paa'/> $%1<br/><img size='1.6' image='icons\ico_money.paa'/> $%2",[BANK] call life_fnc_numberText,[CASH] call life_fnc_numberText];
```sqf
NewLinesWithYourCode
```
18:17:39 Error in expression <ct 1,localize "STR_Spawn_CSP"]];
CONTROL(38500,38575) ctrlSetStructuredText pars>
18:17:39 Error position: <(38500,38575) ctrlSetStructuredText pars>
18:17:39 Error Missing ;
like this?
private ["_spCfg","_sp","_ctrl"];
disableSerialization;
if (life_is_arrested) exitWith {
[] call life_fnc_respawned;
};
if (life_respawned) then {
[] call life_fnc_respawned;
};
cutText["","BLACK FADED"];
0 cutFadeOut 9999999;
if (!(createDialog "life_spawn_selection")) exitWith {[] call life_fnc_spawnMenu;};
(findDisplay 38500) displaySetEventHandler ["keyDown","_this call life_fnc_displayHandler"];
CONTROL(38500,38575) ctrlSetStructuredText parseText format ["<img size='1.7' image='icons\ico_bank.paa'/> $%1<br/><img size='1.6' image='icons\ico_money.paa'/> $%2",[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];
_spCfg = [playerSide] call life_fnc_spawnPointCfg;
_ctrl = ((findDisplay 38500) displayCtrl 38510);
{
_ctrl lnbAddRow[(_spCfg select _ForEachIndex) select 1,(_spCfg select _ForEachIndex) select 0,""];
_ctrl lnbSetPicture[[_ForEachIndex,0],(_spCfg select _ForEachIndex) select 2];
_ctrl lnbSetData[[_ForEachIndex,0],(_spCfg select _ForEachIndex) select 0];
} forEach _spCfg;
_sp = _spCfg select 0; //First option is set by default
[((findDisplay 38500) displayCtrl 38502),1,0.1,getMarkerPos (_sp select 0)] call life_fnc_setMapPosition;
life_spawn_point = _sp;
ctrlSetText[38501,format ["%2: %1",_sp select 1,localize "STR_Spawn_CSP"]];
CONTROL(38500,38575) is ((findDisplay 38500) displayCtrl 38575)
Are the macros included in here?
๐
Tried it and it works. I feel smart. Thank you
@rancid ruin in SQF it would have to be inc _xyz due to that has to be a unary command
if build into the actual SQF language (like the = operation) it could be possible though
commy parse that message for me please
๐ฉ
Is there any way to determine if an object is an object that was originally part of the map or not?
even something as arcane as setting the object IDs everything is assigned crazy high?
so that if <, then it's old map stuff?
ahhhh, I see, inverse of that is allMissionObjects
๐คถ๐ฟ
Anyone have a clue of how TextPos class works when using a buttonshortcut?
I'm trying to center the text horizontally and vertically in the green button.
@little eagle I've never seen anyone use try, throw and catch commands in SQF.
Yes, because anyone but X39 realizes that they are pointless.
This repo seems to have a bunch of 'em https://github.com/AGPHeaddikilla/LiveInLife
try {
throw true;
} catch {
_exception;
};
That's...
pretty sure he uses them wrong
...something.
uses them like control statments
private _balance = param [0, 0, [0]];
try {
if (_balance <= 0) throw false;
if ((lilc_player_cash - _balance) < 0) throw false;
throw true;
} catch {
_exception;
};```
uses it like 'return'
or exitWith
Does it exit the same way?
assuming any of his code works, i guess so
Would have to if it worked. /shrug
would be confusing if lilc_player_cash was nil though.. would return a string with the error in it instead of true/false
Seems like a bit extensive for just a return.
yeh i dunno.. could be cheaper than exitWith potentially
since exitWith creates a new scope
Depends on how fast all of it is, condition and return data size right?
just depends how fast try/catch/throw is compared to exitWith {}
Odd, i thought exitWith existed in executed scope?
i could be wrong about scope, but it's code (hence the { })
Right
unlikely to make enough difference to do that to your code anyway imo
True. Other uses may seem to prove otherwise
@little eagle I use try catch to save some lines. I can just throw my exception and put it out as a formatted hint. So i can just use 1 hint but a dynamic exception if you get what I mean.
100% you can do it with less lines @tough abyss
Have we tested performance yet..?
Test what?
Well hell, unless there is something wrong with the speed of the commands i dont see a problem with it. You forgot your less than commy ;)
i don't think you can do what cloud said at all without try/catch?
let alone with less lines
(that's what try catch is generally for)
Well true, i believe in any case it depends on what you are using it for
unless 'exceptions' are only things you throw manually, not script errors etc
๐คท
unless 'exceptions' are only things you throw manually
Correct
It is a user handled system
You forgot your less than commy ;)
?
try-throw-catch is trash. Just an example from the posted repo:
try {
if (_cameraName == "") throw configNull;
private _camera = (missionConfigFile >> "CfgStaticCameras" >> _cameraName);
if (isNull _camera) throw configNull;
throw _camera;
} catch {
_exception;
};
This whole function could just be:
missionConfigFile >> "CfgStaticCameras" >> _cameraName
and it would be exactly the same.
common usage of try/catch: as few as absolutely required
in a3: a bit senseless
๐
There is no point in comparing SQF try-throw-catch with the ones from other langues, because they are completely different.
Just because they share the same name, doesn't mean they have anything to do with each other.
^
I hate this. Why do people care so much about the names of things?
SQF is a String interpreter in a nutshell
SQF code (strings) -> Interpreter -> Some intermediate stage -> Action
Thats the extent of it right @little eagle
I don't know if this necessarily has a connection with what try-throw-catch does.
I don't see it.
It fails to demonstrate why that being different would change anything about the control structure or what it would have to look like to make try-throw-catch useful.
Does try-throw-catch serve any uses?
No.
So why not remove it? Actually come to think of it there might be BI functions that depende on it still...
Backwards compatibility.
Yeah I thought that.
Just because someone uses it, doesn't mean that the functionality couldn't be achieved with different commands in a better way, or the whole structure of the script could be simplified.
And it being useless does not mean that deleting it would do any good.
you might be able to do easy error handling in it if throws go back to outer scopes
like if you call 10 functions inside other functions and the 10th one 'throws' an error.. it returns all the way back to the catch
Please provide an example. This sounds like a horrible mess.
_fnc_C = {
if(_this == "nothing") then {
throw "Nothing passed to C";
};
[] call _fnc_C;
};
_fnc_B = {
_vA = something;
_vB = _va call _fnc_C;
//do something with _vB
};
_fnc_A = {
_vC = call _fnc_B;
//do something with _vC
};
try {
[] call fnc_A;
} catch {
hint "FAILED: " + _exception;
};```
seems like it's either that, handle it in every function, or let it 'die of natural causes'
most scripts just tend to do the latter
I see no application for that. Has anyone ever used it this way?
don't know.. but seems like it could be feasible in some circumstances
It really doesn't.
I'm only assuming that would work.. but i don't see any easier alternative (other than not handling it)
don't think there's any other way to sorta exit all scopes of script?
other than letting it fall apart
Handling what? You could just put the hint where all the throw atm are!
then what happens with the 'do somethings'
would have to check in each function that something valid was returned
Yes, every function should be designed in a way that it always reports something meaningful.
That way they can be used interchangeably at any point in the project where they could be useful.
And not depend on a control structure of a function on a lower level.
yeah, not saying it's a good design (i've never used it.. don't know what happens when you 'throw' outside a try)
but seems like it could be useful in some circumstances
I too am saying that it's not good design. And my evidence for it not being useful is, that no one bothered to implement it the way you suggested.
yeah, most scripts don't bother error handling
because the scripts will generally just stop and show a half-decent error anyway
I think relying on control structures that are distributed across multiple functions is universally a bad idea. Because it hurts readability a lot. So I reject your example as being a template for anything decent.
that's how try/catch is generally used in other languages too.. just guessing that's what it's there for
Most of the examples I have seen so far end with:
catch {
_exception
};
And it's easily demonstrated that these can be either simplified by using exithWith, or, if the throw is inside a secondary scope, with breakOut.
And even breakOut is a novelty.
If you have many secondary and tertiary (or worse) scopes, your script already is ugly.
yeah looks like most usages of it are as a control structure.. that's not what an exception should be
but maybe it's faster or something.. who knows
Yes, it lacks the capability of handling actual SQF exceptions, therefore is just a control structure and it fails to have any meaningful benefits compared to other available control structures.
The only reason people think it has uses is, because they compare it with stuff from other languages. But I don't believe in names.
it does the same thing as in other languages
just doesn't catch internal exceptions
best you can do for handling errors is assert
If you wanted to you could mass generalize a try-catch-throw system.
To get a set of boolean values.
As a function then plug them in.
Sigh. "It's the same thing, but lacks this fundamental component"
best you can do for handling errors is assert
fml
All hope seems lost here. Just because something exists, doesn't mean it serves any practical use.
assert's only use is showing (confusing) on screen errors. You can do the same thing way better with hint or a custom control, BIS_fnc_error etc etc.And do the RPT logging with diag_log.
@little eagle Ok ok...
Maybe, it would be a good idea to say these functions are deprecated?
And old?
That would imply that they ever had a use, so no, it would not be a good idea.
@little eagle. define > "less than"
Backtracking... Can't remember what exactly this was about. You might want to repeat it.
@little eagle you had asked why i had said "you missed your less than" since you use it instead of mentioning someone.
Yeah, sorry.
is for quoting. It works in Slack and Github that way. Can't be done in discord easily.
Ooh, that makes a lot of sense now.
Also it's a "greater than", not a "less than"?
Oh, duh . fuck it, its 4:56 in the morning. All semantics if you ask me as of right now
The difference is pretty elemental and beyond "semantics" ๐
Hello guys, I'm trying to make a sort of a music player and I'm trying to pull all the music that's currently loaded.
'true' configClasses (configFile >> 'CfgMusic')
However I get for example with testing,
getArray (("true" configClasses (configFile >> "CfgMusic") select 30) >> "sound")
returns,
["\DBE1\Models_dbe1\Music\WithCare_War.ogg",1,1]
How do I transfer this to a classname so it can be used with playMusic?
The configName of the class that contains that property? Been a while since I messed with sounds.
ah thanks that did it,
configName ("true" configClasses (configFile >> "CfgMusic") select 30)
"WithCare_War"
configName (configFile >> "CfgMusic" select 30)
This does the same thing btw.
Also uh take care that number 30 might not always be the right one when modding gets involved
Nah it was just a quick test to get a value
I'm using a forEach and list them up in a dialog
try catch and throw have much in common with other languages
the whole reason why it is that "usable" in other languages is due to the fact that they throw theese by themself
by checking that stuff before calling
you got giant frameworks rdy to be used which all contain exceptions
even the exception class of pretty much all langs is in fact: a class on its own
only thing in SQF is that it wont catch input errors (eg. int * string)
which is that kind of stuff you are already supposed to manually check for
reason for try catch throw not being useful in SQF is because nobody chekcs for that stuff and neither they throw when they do (including BI)
and as the internet usually already said everything i say: https://stackoverflow.com/questions/2737328/why-should-i-not-wrap-every-block-in-try-catch
and i highly doubt that anybody would have any real use for those script errors thrown by SQF and not catched by try catch
There is no point in posting this article here, precisely because the SQF command structure cannot handle native exceptions. The C++ version and the SQF version are fundamentally different.
And if the exceptions are not handled internally, you should instead handle them with the available control structures.
@rancid ruin
imagine if you could += in SQF like a proper language
You could add that with Intercept ๐
@little eagle
assert's only use is showing (confusing) on screen errors.
Or breaking in the Debugger if you use one.
You could use any other faulty expression instead, so no.
in which aspect are the c++ version and sqf version fundamentally different?
enlighten me
SQF is composed of a long list of functions that are called "commands".
These don't throw exceptions that can be handled by try-throw-catch.
doesn't mean you can't throw your own exceptions (not that sqf scripts are usually complex enough for it to help much)
could be useful if all script functions used them.. but kinda pointless as it is
So you cannot come up with a proper argument?
Only reason those commands are not throwing exceptions capturable is because bis decided so
C++ the dev of the method also had to decide when it would throw
You develop your cide
So do not blame others for not doing what you also are not doing
You could easily throw in a simple throw on all functions that you yourself write so that you could use try catch
As you and others are not doing so
It is useless
How is that not a proper argument? If SQF would be different ("because bis decided so") then of course it could be useful.
Not due to its design
But it's not and as long as that not changes, try-throw -catch is useless.
If sqf was like c++ bis still would have had to insert the throw themselves
The sqf functions not throwing exceptions is design
If sqf was like c++ bis still would have had to insert the throw themselves
Yes if SQF was different, anything I said could be false.
Problem is, it's not.
You just love to blame sqf for everything
Including the community not utilizing all available commands drawing some useless
Blame? I'm just saying what's true. "If A was like that, B would be useful" is not a proper argument either.
No, it cannot handle exceptions.
And we have no way to rewrite SQF at the command level.
And if I had to rewrite it at the function level, that would cause huge problems too.
It's a ton of work and then you have to maintain two libraries.
there are no exceptions in any language on that level that you are asking for
C++ does not have such an extensive command list.
They are functions that don't support exceptions catchable by try-throw-catch
"on that level". SQF doesn't support it at ANY level.
i always ๐คฆ when i read SQF written by someone and it has try catch
cpp also will not catch its faults for the "commands" it has
writing to NULL will not be catchable
SQF supports it ... using try catch
and throw is how you provide the engine an exception
Yes, but the C++ commands are actually "commands" and not functions. C++ and SQF are different dude.
all exceptions come from some code somewhere having 'throw something'
And no, neither the commands nor the functions library supports exceptions like that.
all exceptions come from some code somewhere having 'throw something'
Wow such an insightful comment...
better then your bullshit flaming about SQF all the time
use try catch
and it will for some weirdo reason start to be useful
do not use it
and for some weird reason nobody else will use it too
How is it flaming to point out that some concepts were introduced at one point and then abandoned?
so lets get back to my comparison to c++
you just try to avoid to say that try catch would have a usage if stupids like you would stop blaming SQF for their problems and start using it
Why not demonstrate the usefulness? Show me what you've written and how try-throw-catch was in any way helpful.
Also
stop blaming SQF for their problems and start using it
Why would I not blame X for it's problems?
because you are X
not SQF
SQF is the tool you are provided with
and you blame the tool that nobody uses its abilities
And the tool doesn't support exceptions in any meaningful way...
you still do not understand the whole fucking shit
talking to you is like talking to a wall
an extremist
or whatever wont even try to take apart
You're a talentless hack, X39.
"it's abilities" the problem here is that it's a crippling ability
how is it crippling? tell me
It's creates bad code.
because you're better off using literally anything else
how does throwing exceptions create bad code
convince me
that i am wrong
because trying so will invalidate ALL try catch functions in literally all languages
You cannot be convinced, because you're a fraud. Create something useful for once and proof how useful try-throw-catch is.
Create something useful for once already did
showed my usefulness to the community
stopped caring after AGM came up with a lot larger team
And it supports your ideas about try-throw-catch's usefulness?
Show it so we can laugh at it.
why should it? the user was never supposed to call any function in there
i am not creating user functions
So all you've created is yet more evidence in favor of what I said. Thanks.
try to turn your "argument" around however you want
You don't even know what an argument is.
you just try what koffeinflummi tried when he was the "big guy"
ppl like you come and go
they always think they are the best as they got their lil baby to show
no need to
everybody knows
Knows what?
Maybe you assume shit that never happened. And that's why you spout non-sense all the time. It's called delusions.
you mean what you are doing the whole time?
thing is: continuing this way will summon dwarden
and i do not plan to clutter this chat further with you not even trying to stop blaming SQF for your and the communities faults
I will keep "blaming" X for it's faults. That is the reasonable thing to do.
KK had examples for trycatch inb4
try {
if !(assert isNull _unit) then {throw _unit};
/*...code...*/
} catch {
diag_log format ["Unit <%1> is not null", _exception];
};
such a stupid as i know
completly useless guy
commy obviously is right like always
-i am out- for this convo now
Oh, KK said it, so it's true.
What a great thinker you are.
Now look at Github and check out the projects there.
And see that no one uses try-throw-catch.
put away popcorn @jade abyss
blocked commy for now again
X39 is bad at thinking.
Excuse me? I haven't even typed in here. Just clicked in.
that example of try-catch is simply pointless, in C++ exception catching is meant for exceptions thrown deeper in the code, not in the actual try block (but something that is called from it for example), in this case it would be a lot shorter and simpler to just do an if check
was just one example
obviously it would happen in a function you call using ... well call
looking for a good way to start debugging a mod's scripts - getting low fps on server and want to find a way to see which scripts are causing the most problems
https://community.bistudio.com/wiki/diag_activeScripts and it's brothers is probably a good start
thanks, didn't know that was a thing. does the profiling branch help me here? can't find a lot of info about it #perf_prof_branch
soonโข ArmA.Studio will also include that
something to get diagnostics of performance
Is there a character limit to diag_log messages?
Nevermind, apparantly theres a 1044 character limit. Not sure of any way around that
could split the string if you really need it that long
depending on what you're doing, copyToClipboard might be better
Yeah true
@frosty cave Debugging != Profiling.
Best option would probably be using profiling branch with https://community.bistudio.com/wiki/Performance_Profiling#Creating_your_own_subtree
thanks Dedmen
guys does try/throw/catch have any use in arma 3 sqf? anyone know?
is this a meme? I swear I've seen this conversation like 5 times the last two days
what is meme?
fake screenshot
wrap all your code in try catch for extra safety
The toxicity in the Arma community by some people over the ethics of using try-catch-throw in a niche scripting language just makes me ๐คข
XMedSys was Cool and Goodโข fight me irl
the ethics of using try-catch-throw ๐น
Hi, I'm learning stuff and looking for a script to turn on spotlights without doing so manually, has anyone accomplished this?
maybe something like this @rugged lake
player action ["lightOn", the_spotlight_object];
I can't remember how "player" works on a dedicated server though, you might want to get a player from allPlayers to do the action, not sure the best way
or any other unit I guess, doesn't have to be a player
Use the unit name instead of player on a dedicated server
@rancid ruin say I stick an AI on the spotlight, could I use a script a command similar to what you posted to make them turn the light on ? Instead of player using the thisunit function? I'm really new to this sorry
(driver the_spotlight_object) action ["lightOn", the_spotlight_object];
or maybe gunner instead of driver not very sure
yeah it doesn't matter which unit does the action or their distance, or anything if I remember correctly
ye that might be it, dedmen's one
gunnegunner is correct
does setPilotLight not work? cos I used that for cars and stuff in a persistent database thing I made
ah yeah use the action function instead, probably easier
(setPilotLight) Switches headlights of a vehicle on/off. Note that the vehicle has to be local, for global variant use Arma 3 Actions "LightOn"/"LightOff"
Never heard of it
@still forum I got it to work using your script
this action ["lightOn", the_spotlight_object]
Thank you!
the both of you.
it is and you are now responsible for maintaining said script
Well you brought it to my attention, as somebody who knows almost nothing about scripting you are now a god in my eyes ๐
Huh, now both the spotlight operators turn their lights from the original position to look at the same point?
welcome. you have arrived at Arma Scripting
next train is to misery and disappointment, leaving in approximately one hour
Huh.....greeeat
It is working. I don't know how and I don't know why, but it's working.
is it possible to make a script that prevents showing error messages like "could not find p3d" ?
yeah more than likely, but you should fix the problem instead
if it's not your addon then tell the developer
the problem is that the error is a wanted error to create the effekt of it
its basicly to make some parts invisible and if there is a p3d it would cast a shadow ...
that sounds fucked up. this is probably a #arma3_model question
you're not trying to do things which you shouldn't be are you?
what do you mean with that ?
I mean are you ripping models from other games, or modifying other people's addons?
don't think it's possible to disable those errors
no i dont @rancid ruin its just a config for arma 3 models that lead to not existing p3d and paa so the backpacks are invisible i could work with Globaltexture but then they cast shadows...
and backpacks are nice to have to store weapons and stuff but the apex bergen for example is abit to big for my taste ๐
i knew there was also a way to set the position of backpacks but not sure how to ๐
could you use a dummy model/paa instead?
ask in #arma3_model bro, someone there will know the exact best way to tackle this
Turns out it was KK that broke the stacked eventhandlers. https://forums.bistudio.com/forums/topic/143930-general-discussion-dev-branch/?page=899#comment-3213110
Great experts. No wonder this game is broken every other patch.
I bet this will make it into the next version without being fixed.
lul ๐ฌ
The problem has been pointed out a month ago and it's still ignored. And what's worse is, that the broken code is now even advertised on the forums as a scripting solution.
It is very concerning that the one in charge of rewriting the functions library lacks basic knowledge of the scripting language.
And so is the resistance to criticisms.
If the next patch crashes and burns then don't say I haven't told you so.
manglement at it again
@little eagle how did this end up happening?
did they try to improve eventhandlers in some way and failed, or what?
That's my guess, yes.
they need to just slow down patch releases if this shit is still happening
Well, anyone decently knowledgeable in SQF wouldn't have made that error in the first place. Especially when the exact same thing was pointed out and discussed months ago already. And many times since release.
It's baffling really. Passing arguments is the one benefit the stacked ehs have over the mission ehs. And it was wrecked just like that.
It's again because people assume something is "essentially the same" just because it shares it's name.
But again onEachFrame stacked eventhandler is fundamentally different from EachFrame mission eventhandler. And the same is true for the rest of them.
quick explanation of difference between onEachFrame stacked EH and eachFrame mission EH?
that's it?
i don't know how it works behind the scenes, but usage wise i think that's it
seems like all they need is 1 global var per event type (or all in 1 big array) of [[args, code], [args, code]] and to run them from a mission event handler
oh god
imagine the talk section of any command/function
lol
I understand people giving KK a hard time if he fucks something up badly, but before BI took him on wasn't there even more problems which were never looked at?
or is it a case of BI using KK instead of a more seasoned internal developer, and things getting done badly?
I think this is more about: "One who lives in glass houses shouldnt throw stones"
in what sense?
KK (in my memory at least) used to be kinda arrogant when it came to mistakes he made or being Mr. IamBetterInEverything sometimes
especially on Feedbacktracker and wiki
that's true. good communication and inter-personal skills don't always go hand in hand with programmers, talented or not
he seemed to always love putting things up on his youtube channel which he knew would get 50 comments asking "how did you do that?" but never actually tell people lol
but on the other hand - his blog is/was one of the only real blogs for arma 3 scripting, so full credit there
commy & x39 imo
i'd watch that in TV ๐
yep.. well, personally I find the underlaying situation of BI only having a single person to do it more problematic
single person could be fine if they were more inclined to integrate in to and communicate with the community itself
IMO they should just halt current DLC plans or make the Orange DLC become a cleanup patch
can't see them ever doing that until the end of arma 3's life
I keep delaying finishing and polishing my arma 3 projects in the hope of a truly "stable" version of the game, but it probably won't come
I dont see a reason why the arma 3 function library isnt a git repo yet
but thats none of ym business
Isn't Arma sort of an open source game?
I mean, one can unpack the game's PBOs and basically see the games code.
but thats just stuff they cant hide
Hmm, I guess.
you wont ever see game code by unpacking pbos ^^
the "magic" all happens in the exe and dlls
You can take a peek at some of the content, but nothing at what makes it work
google dll first pls
I know what a DLL is.
it appears you dont
Do enlighten me.
@royal abyss
is it possible to make a script that prevents showing error messages like "could not find p3d" ?
Script. No.
No the DLL's are not encrypted. So what now?
DLLs are binaries .. raw code to be executed so to speak
there is nothing to encrypt (well you could ofc)
What lol
i fixed it with another script instead of using a config ^^
@tough abyss
Isn't Arma sort of an open source game?
No. By opening PBO files you reconstruct the human editable code from binarized files. Open source means that you have all the unbinned files available which can then be used to build the software yourself.
And there are large parts that cannot be reconstructed.
Everything that is not inside a PBO
@dusk sage ?
Thanks for explaining.
Maybe some miss information above? KK has said he hasn't touched the broken function.
https://forums.bistudio.com/forums/topic/143930-general-discussion-dev-branch/?do=findComment&comment=3213199
@pliant stream How would you go about that?
Oh the BIS functions?
In functions viewer?
Ah yep, sounds interesting
@grand berry commy is just a gigantic asshole
He wanted to prove that in the forums too now
Discussions about copy protection or copying, backing-up, hacking, cracking or reverse engineering of any of BI's products or the products of any other developer will not be tolerated and such discussions will be deleted immediately. Any breach of this rule may result in the poster no longer having access to the forum.
It applies here as well. This is the only warning on the subject.
Can you link those rules please? Never read that and also didn't know forum rules apply to Discord
Exactly. Maybe just in #info_help_tips Because I'm very sure no one knows that these rules apply here
Common sense?
My common sense says continue and see how long you remain here.
๐คฆ
To come into a company's official Discord and think it's ok to discuss illegal activities regarding their product is unreasonable.
intercept didnt use any reverse engineering, the offsets and all were only good guessing ;)