#arma3_scripting
1 messages ยท Page 402 of 1
Well, my lobby "can".
yo mama is an extra size
can't just put down 1000 units
Does it count if all you have to do is to execute:
100 execVM "setup.sqf"
once in 3den and then to export the mission?
Does it matter what units there are placed
so true
But you don't need playable units if you use createUnit selectPlayer.
To create a lobbyslot? You need one
Depends on which lobby you use.
Just script your own lobby. Takes 2 days.
Sure, a single command would be nicer. But just compare the wait times: 2 days for your own implementation, and 10+ years and counting for something from the base game.
should be around 3-4 for A4
_obj = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_myStr = [_this,3,"",[""]] call BIS_fnc_param;
How am I suppose to use params instead of the bis function?
I mean, how can I tell to params that the fourth element is _myStr and the first one is _obj ?
I'll do it like this
delete this
params [
["_obj", objNull, [objNull]],
"",
"",
["_myStr", "", [""]]
];
๐
@little eagle sent you A PM is you have a few minuts
Yes, I had to search for the displays config in the all-in-one config, and I had to write the sort script. >.<
{isNull player}
is a glorified string known as CODE
and
isNull player
is a BOOLEAN.
๐ ๐ ๐
I think this is part of a bigger code snipped where the question would make more sense (lazy eval?).
apparently lazy eval is bad in arma?
Performance wise
Only use it in isNil "_blah" && {}
No, it's not. People just don't know how logic works and do flawed tests.
I had this discussion a million times. Get's tiring after a while. Last time I explained this to ulteq and after an hour, he now is on my side in this.
!(_x getVariable ['nig_perf_cached',false]) && {!(_x inArea [player,(_dist/3),(_dist/3),0,false])}
The "nig" tag cracks me up.
still can't understand why the fuck do I have to use {} if I have to get a boolean as an output. Code where I found this
if ( isNull player || { isNull player } ) then { do Magic Tricks };
cheap condition && {expensive conditon}
That code snipped makes no sense.
i know
You're checking the same thing twice.
guess where I found this ๐
if (!isNil {player} && {!isNull player } ) then { do Magic Tricks };
See: https://community.bistudio.com/wiki/a_or_b "Alternative Syntax".
player is never nil/undefined, unless you broke your game.
yeah well _unit
hmm?
if (!isNil "_unit" && {!isNull _unit}) then {
->
if (!isNull ([_unit] param [0, objNull])) then {
๐
@peak plover [nigel,lifetime] call nig_sendToJail /shrug
life
#define lifetime 9999999
I believe it.
Anyone has a decent heli extraction script? I made a few attempts but they doesn't work properly
Or make some blufor npcs ignore combat
Better get a real player to fly the heli.
The problem is that there is a combat so either it never lands or it lands and leave too fast
Thanks, I'll try that
If you want them to still be able to shoot, get behaviour safe or aware
but autocombat is must
enableAttack false
is also probably good for u
I see, okay
deleteVehicle _unit;
no unit no problem
ยฏ\(ยฐ_o)/ยฏ
I don't think just careless makes them not fire, but I guess disabling autocombat fsm does.
Wtf is that nigel
๐
I see, hope this works, is the last thing I need to do
carless should (injtheroy) disallow autocobmato
Idk, if you want them to never fire, and there is a command that has a parameter "BLUE" (Never fire), then I'd try that personally.^^
setDriveOnPath for helis?
๐ค
I can set the behavior only on the heli driver, right?
so it ignores combat while the gunners fire
behaviour is group
Or unit, which then makes it apply to the whole group.
U can make him solo group
If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group.
๐
I somehow doubt this works.
same
It's on the wiki, so it must be true, right?
I think if it's set to the group the unit will use the other grouยดbehaviour
๐คฅ
I want a wiki account already
I have very important note to make
2018 witll be crazy if they fix wiki accounts
can't wait
@peak plover Do you not have a bohemia acount?
I do but it does not work on wiki
@peak plover Wiki -> Log in (top right) -> Bam
Oh
You tried after the temp acc restriction
Dwarden said he'd restrict new accounts til the new year
Bot spam
We'll see then new yera
rip
wouldn't be surprised if people were trying to bot accounts to grow their units pages
@eager prawn Well in this case it was just a bunch of spam bots sending links. Don't think it ever got around to changing things
ah okay
It used to be that >200 or so units it stopped owrking
but its hardly a priority considering they are working on tanks dlc
my unit got limited at 500 members
then the limit got either raised or removed, because we havent hit it yet
I think they have a team for web thohgh
oh well, we're probably a bit offtopic here though, #community_units ๐
This is the #offtopic_scripting channel.
๐
scripting is actually the topicless offtopic
must mean that FM never reads the channel ๐
ANah, FM is smart he gets it
whats an elegant way to convert 1/0 into true/false
selecteeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
yeah, of course, array index
meanwhile i came up with sth like this boolFoo = intFoo > 0
alt of select
#define TRUE 1
#define FALSE 0
no?
yes
@Foley#1330 better:
bool = int != 0;
โZero/Non-zeroโ = (False/True)
Good evening everybody! Does somebody has an Idea how to change the color of an "button text" while hovering over the button?
change the config entry for it in description.ext
@abstract shuttle colorBackgroundActive in config
@abstract shuttle or ctrlSetActiveColor
Thank you in advance! ๐ I'll try it out! ๐
Oh fc, text not background
Yeah... I'll try to change the color of the text on a button...
@abstract shuttle donโt know how do this in config, but you can use two event handlers โMouseEnterโ and โMouseExitโ, with ctrlSetTextColor
@abstract shuttle try color2 or colorActive in config
Okay, thank you very much mister! ๐ That means I need to change it in every dialog. :b
INHERITANCE
๐
I'd ping you and explain it, but you have a shitty ascii name so NOPE
your loss ๐
(inb4 you can do rgith click mention)
@Adanteh#0761 or someone can explain how inheritance works on Arma?
if it's not too complex
pr0
@hoary copper https://community.bistudio.com/wiki/Class_Inheritance
How to not suck at arma modding.
- Use the wiki a lot
- Have a lot of time on your hands
- Ignore people with blue names
4)???
5)PROFIT
How to not suck at scripting
- param
- macros
- don't do it
@tough abyss not only for config, for scripts too
Macro are preprocessor stuff
#define FALSE true
if (FALSE) then {
hint 'Gucci gang':
};
Preprocessor replaces false with true
It makes life easier rly
Macros just replace one text with another text at compilation time:
#define PI 3.14
#define ADD(A, B) (A + B)
...
sum = ADD(PI, 10);
...
After compilation:
sum = (3.14 + 10);
..... Wow... And with that, that's how people make dialogues and not have to edit individual config classes?
Like on a bigger scale?
where do I put my #define tho?
Init works
anywhere is ok?
I use #include to organize my scripts
So not everything is in the injt
cool stuff, haven't used it yet
my mission is pretty much a mess
but it almost works, so it's fine
About define... what do you think: what will be in result?
#define MY_CONST โaaa//bbbโ
myVar = MY_CONST;
Script error, because of the wrong quote marks?
Hey guys, does players become a null object when being killed for a short period of time?
What do you mean? @little eagle m
player becomes the corpse after killed, until you respawn, and then it becomes the new body.
Well, "becomes the corpse". It stays the same body as it was before, but now it's a corpse.
Corpse is just a body with !alive.
Then it reports false? ยฏ_(ใ)_/ยฏ
It appears that the parameter unit passed from the onKilled eventhandler is null in servers POV
It might seem different with differnet respawn types
but seems like it's kinda the same all the time
But killed is executed on the local machine only.
There is no servers pov, unless the unit belonged to the server, in which case there is only the servers pov.
Well, I meant if the player object is sent to server.
However it appears its just the name that cant get
There is no killed event on a dedicated server for players.
So you're talking about something else?
Im talking about sending the player object to server
I get an error when I try to use name as Error: No Unit
name has always been like that for dead units.
It does not mean the object is null.
It was just an assumption i made
Yeah, it's wrong. But justified from the stupid warning of name.
Fucking bohemia
Error type: Number, expected: Number, Not a number.
i do like how somehow the magical command bar does know the name of units still
Engine solution maybe?
Wouldn't be surprised if it's profileName being continously broadcasted from each client :kappa:
It's hard coded.
As in engine solution?
It's not the profile name though.
I know, that was a joke ๐
As in engine solution?
Yes.
But name itself is also an engine solution on it's own, so ideally they'd follow the same logic. But they don't.
When doing getPlayerUID player on the guy who is killed
(on server)
it reports back as <NULL-object>
So it seems that it is actually NULL
Let me test further
diag_log [_killed];
yeah which reports the object variable of that unit...
so its fairly strange
It appears its only at certain times
Then the answer is that it's not null.
They are NULL to the server though it seems
What are you trying to achieve?
It doesn't matter, however, right now im just logging deaths. And no do not say log on client side.
diag_log [_killed];
yeah which reports the object variable of that unit...
Not null.
I meant you should do diag_log [_killed]; on the server.
Yeah im doing it now
Good.
It may be a problem on how you pass it to the server.
Its passed through a public variable eventhandler
But I doubt that is where the problem lies
THEFUCK
Yeah, and there may be a bug in there.
Why not?
because it's stupid
^ this tbh
Why is it stupid though? ๐ค
Bannable offence
Armed assault command that wasn't used and shouldn't be used
it's from a failed attempt at adding javascript* support....
Still, why not use it?
Like something being null when it shouldn't would be an exception
check where the # is
right before throw
on top of using this command (that imho should've been removed along with try and catch) your syntax is wrong
Whats wrong with it?
huh, they somehow thought adding a new syntax to it was a good idea;...
Whats wrong with MY syntax though?
it should be inside a try catch block
Why should it? I don't need to handle all thrown exceptions of course
If I want to recover, THEN sure I can try catch it
Whats wrong with it?
It's a worse if-then-else.
just stop using this horror and use if then else like everyone else
Goto Mk2.
the whole thing is a failed attempt at adding javascript support, AGES ago, it's one of those commands that shouldn't be there
along with some of the TKOH ones that don't do anything
I thought you said Java support? ๐ค
corrected^
Either way, you haven't provided one argument for not using it except for it being a failed attempt on javascript support. I mean its pretty standard practise in all other languages.
I don't see any of the a3 functions have this
Go through the new DLC functions
Nothing
It's definatley not a standard practice in arma
I didnt say it was standarrd practise in arma
That's a reason not to use
If you go and look into the functions_f PBO, you want to go neck yourself regardless.
Send me a hastebin of one
until you get to tac-ops
Haven't seen that yet
and then you realize all the senior devs didn't touch those
Interns lol
yes, interns
Senior Devs > SQF > Wot?
if (alive this) throw "u wot m8"; //-- nothing happens
if (alive this) throw hint "u wot m8"; //--- u wot m8
needs to be in a try catch block anyways
hint is evaluted before throw, and since hint reports nil, the if will never do anything.
@lone glade it doesn't??
No error, but the code is just a long version of:
hint "u wot m8";
it does
sldt1ck, ignore these two and just read what I wrote (carefully) and you'll see what happened.
Point is, this will also print the hint if the object was dead.
Ehm @lone glade it will throw an unhandled exception and then dont continue further
No, it won't.
hint is evaluted before throw, and since hint reports nil, the if will never do anything.
Im not talking about his snippet
OK.
That doesn't mean anything. It's bad even if it were introduced a week ago.
@lone glade do you code any other language than SQF?
๐คฆ
Cause then you would know how throw and all that works
Just keep digging
Yea, I'm sure the problem is just that alganthe doesn't know how it works...
ttc makes shitty code. Hard to read and slow. No reason to use it. End of conversation. There's nothing to add.
Before fraudsters like X39 chime in.
try {
call _fnc_hi;
} catch { hint _Exception; };```
Thanks for proving my point?
are you going to use the oo functions next?
because yes, those exist..... for some reason
I looked at those, made me wanna go kill myself.
name of guy how could he even do that shit, like what was he thinkinmg
0 spawn {sleep 2; player setDamage 1; waitUntil {!alive player}; if (alive player) throw hint "u wot m8";}; //--- u wot m8
And commy is right ๐
the fuck is that horror
Should give you an error
that's the first thing you notice?
lol
really?
Should give you an error
No, it doesn't. For the third time.
Ah, prescriptive should, not descriptive should.
there's a very high likelyhood that the person who made that attempt at adding javascript into RV1 isn't working there / didn't work on A3
Prescriptive should vs descriptive should is a bug in the English language, and we should therefore move on to EnEnglish for the next iteration of the American presidency.
EEnglish
german is now the lingua franca of the world, time to change all those var names
german is now the lingua franca
lol what?
I see you haven't heard the news, germany nuked china and the US, it now controls the world
everyone needs to wear knee high socks and sandals now
Im not mistaken thinking people can mess with the memory to change their uid so getPLayerUID gets a different UID?
you can't
Sure you can.
UID is your steam64 ID
I always check on server just because of this.
Since they cannot compromise it on server.
I guess(??)
The only way to have a secure is server is to administrate it. I thought people figured this out by now.
Administrate it?
Moderate.
Have someone on it H24
Have an admin on, kicking the cheaters.
Yeah, because getPLayerUID doesn't go through server if used locally right?
Dunno what else to answer.
Well you could answer my question (if you know of course) ๐
Can s1 make a dll that screenshots player screens during gameplay?
yes
Cheat suspision? sends screenshot to admin
you can even send the screenshots somewhere else if you want
snapchat the cheaters to admins
but I seriously doubt that's a good idea / legal
Well you could answer my question (if you know of course)
Ok then:
Yeah, because getPLayerUID doesn't go through server if used locally right?
Has nothing to do with what I wrote.
Ah okey
But I mean always good practise to do server side check of player id I suppose
- the admins on server of course
Btw there is https://community.bistudio.com/wiki/screenshot
But you do what you can to secure your mission in the first place amiright?
Sure.
But I'd avoid adding placebo checks just to make you feel better about stuff, idk.
anti-cheat
Just don't play with cheaters
Yes it can be spoofed
And checking on server is a good solution
@lone glade When were they attempting to add 'javascript' support?
Never.
promised for a3
what is it
The Java stuff is still buried in the engine I think (Dedmen?). But I'm not seeing how their try/catch commands were part of that attempt
ah, I was right the first time, it was java not javascript
They weren't.
But why bring that up if it doesn't change anything?
It may have been inspired I guess. Java has ttc, right?
Almost every language does
Just seemed peculiar you instantly associated the command(s) with their Java attempt
I really thought it was, since they updated them in A3 (recently)
๐
They only updated throw, but they did the same to breakTo, so what does that matter?
breakOut, not breakTo. Sry.
I really don't see the problem..
With ttc?
breakOut has it's uses that no other commands provide tho
If you say that, then the same is true for throw.
Both make ugly code.
scopeName "Main";
private _fnc_errorAndClose = {
params ["_msg"];
_display closeDisplay 0;
deleteVehicle _logic;
[_msg] call FUNC(showMessage);
breakOut "Main";
};
switch (false) do {
case !(isNull _unit): {
[LSTRING(NothingSelected)] call _fnc_errorAndClose;
};
case (_unit isKindOf "CAManBase"): {
[LSTRING(OnlyInfantry)] call _fnc_errorAndClose;
};
case (alive _unit): {
[LSTRING(OnlyAlive)] call _fnc_errorAndClose;
};
};
if (...) exitWith {
if (...) exitWith {
if (...) exitWith {};
};
};
Thanks for proving my point.
i'd still consider that readable compared to the alternative
Using breakOut in a return like style is quite elegant
Especially when nested in quite a few scopes
Especially when nested in quite a few scopes
Well, there's your initial problem.
I use it for recursive calls that are looking for a certain value
Like through a treeview or so
Is what I used it for today
Nothing wrong with being a few scopes deep
So breakOut / throw are band aids for bad code.
As long as it doesn't look like that 15k file posted here a few days ago
Breakout there makes sense to me? I mean this was the first time I used it in my current code in a lot lot lot of functions
I agree it has a habit of making things look ugly though
^ this's all I'm saying.
I agree with that
but there's extremely rare occasions when you need to use it
unlike ttc
Same with exitWith, if I understand your reply as one to me, BoGuu.
And you, alganthe, used breakOut essentially as return, so I guess that's a good use for it.
silentspike did it first ๐
I also used it a single time outside of those zeus modules, as a return too in garrison
The ACE Arsenal mission has 5 spawn.
๐ฑ
It's down to the user whether they choose to write 'ugly' code with breakOut, because in its most simple usage, it can be far from it (return)
Perhaps we should talk about breakTo instead
Because I'm hungry for spaghetti around now
Sure, write what you want. Make a 5 MB script, but don't expect people to defend it.
Lel
Who writes 5MB scripts?
I do
Dunno, forgot what the size of the thing was.
I wrote a cryptominer in SQF
Oh right, that 15k line thing
I use it to mine while people play on my life server
That crashed my chrome when I opened it
It's funny how there can be half of ACE in one file.
If life server developers can write miners in SQF, they should get a job with better pay
Because they deserve it
๐
Gotta do an ico for Arma Life Coin
Will support microtra sanction between server
Did you see Dogecoin is now worth 1 cent?
whot
๐ค LifeCoin
That is impossible
It's a fact unless changed
The market cap was 1 BN* or so
btc ~12k
Iota ain't got nothing on me
Normies ruin everything 'tho
๐
19:47:02 Error position: <select 0)];} forEach R3F_LOG_CFG_can_tra>
19:47:02 Error Generic error in expression
19:47:02 File mpmissions\__cur_mp.Tanoa\R3F_LOG\init.sqf, line 46```
Could anybody explain this error to me? The code it's mentioning doesn't even line up with the line number.
Line numbers have pretty much always been broken.
Check above the lines, prob is somewhere there
Need to see the whole code to figure this one out.
That also
My guess is, that _x is not an array.
Thought the same but: Wouldn't that cause another Msg popping up?
I'll try in a minute.
aye (i can't remember the Messages anymore^^)
It's the RF3 script int.sqf within RF3 log
1 select 0
Generic error in expression.
Yep, then prolly not an array
What is R3F_LOG_CFG_can_transport_cargo?
What is a generic error expression exactly? Sorry not a coder, but trying my best to fix it.
You try to select something from an array, wich is not an array
Something something param.
2014, ouch
What is R3F_LOG_CFG_can_transport_cargo?
* Copyright (C) 2014 Team ~R3F~
copyright XD
Just use the debug console inside the mission preview to retrieve it.
R3F_LOG_CFG_can_transport_cargo
print out what R3F_LOG_CFG_can_transport_cargo is
diag_log [R3F_LOG_CFG_can_transport_cargo];
or systemchat
copyToClipBoard str R3F_LOG_CFG_can_transport_cargo
Many ways lead to rome ยฏ_(ใ)_/ยฏ
Can't find it even with Agent Ransack T-T
With who?
It's a program that can look into folders and search all program files for key words
Like a grep?
What are you searching for?
R3F_LOG_CFG_can_transport_cargo
In the debug menu?
print out what R3F_LOG_CFG_can_transport_cargo is
diag_log [R3F_LOG_CFG_can_transport_cargo];
systemchat str [R3F_LOG_CFG_can_transport_cargo];
copyToClipBoard str R3F_LOG_CFG_can_transport_cargo```
Select one of them from above
Of course, yeah
I like your message but the fact you're not using the Ui colour from the beta is upsetting
What can I use to upload a image?
imgur?
imgur
Beautiful.
aww, thank you
I also liked "Dschanghis Khan".
My personal Favs still come
Can't wait.
?
add str between it or use copyToClipboard (as commy wrote)
That looks right, did the same original error happen while testing?
Yes, after talking to my partner we are thinking another set of scripts is effecting it in some way.
Issue is we don't know exactly when it happened, as we never messed with this file.
Ye, if you mess with R3F_LOG_CFG_can_transport_cargo in ways not intended, it could break.
Could it be effected by external other mod/scripts?
Yes, if they mess with R3F_LOG_CFG_can_transport_cargo.
Or if there's another script error before that.
It would have to specificually call or use that name convention right?
What?
Like for another script to interfear with it, it would have to use something that actually names R3F_LOG_CFG_can_transport_cargo as part of whatever it runs?
Actually, hold.
["land_misc_cargo1ao",110],"smallboat_1","seafox","pbx_acr","boat",["aav",8],
I see these elements in the array.
And that's wrong.
"smallboat_1","seafox","pbx_acr","boat"
Those don't belong there. There is another script that modifies the array and appends it with these broken entries.
And that is why it says "Generic error".
Another mystery solved. I'm grabbing something to eat.
Nah they're original a2 classes by the looks of it
You don't wanna know wich names i've seen (and used ๐ )
oh no
@little eagle
About define... what do you think: what will be in result?
#define MY_CONST โaaa//bbbโ
myVar = MY_CONST;
// in string will be interpreted as a comment:
#define MY_CONST โaaa
myVar = โaaa;
what speaks against?
myVar = โaaa//bbbโ;```
Should work, maybe... idk... idc
also searching food
It should
Good scavenging dscha
To define as plaintext you don't use quotations
It's a major advantage of #define over a=b
because a=b doesn't support plaintext
@jade abyss if you not use define - all works good, but if you would define string with // in define...
then: Why use define?
^
@jade abyss why use define. define - easy way to define constant in all scripts and configs. Curr i am use format for avoid this โerrorโ
I feel like I was answered this before. It would result in a script error, because โ and โ are invalid characters.
Also: โaaa//bbbโ is not a string
This: "aaa//bbb" is a string, because it begins and ends with ".
This: "โaaa//bbbโ" would also be a string. Same reason.
And no, // are not cut off inside strings.
The reason why your example is cut off, is because โaaa//bbbโ is not a string. Because it doesn't start with quote marks.
Only " and ' are quote marks.
โ and โ are different characters that appear like quote marks, but aren't actually quote marks.
I hope this settles this.
Looks like preprocessor treats comments like comments even inside preprocessor lines
#define MY_CONST #(aaa/*test*/bbb)
myVar = MY_CONST;
myVar = (aaabbb);
That is because you used #.
Same with quotes
Pasted wrong test actually, meant to post quotes
#define MY_CONST "(aaa/*test*/bbb)"
myVar = MY_CONST;
to
myVar = "(aaabbb)";
parenthesis don't matter either, just been testing to see if it does any difference
Which preprocessor is this?
For my arma 3 it looks like this: https://steamuserimages-a.akamaihd.net/ugc/906779173773135918/99895DE4964B18A0AFA239CAAD55AC15E620C857/
Typed into Microsoft Word before pasting here (lol), which likes to turn quotes into special ones?
@little eagle it is โ from ipad keyboard
#define MY_CONST "aaa/*test*/bbb"
var1 = MY_CONST;
var2 = "aaa/*test*/bbb"
var1 = "aaabbb";
var2 = "aaa/*test*/bbb"
Looks like preprocessor commands exclude comments regardless of being inside string (quotes) or not
#define CONCAT(A,B) A##B
#define TEST #CONCAT(aaa/,/bbb)
var1 = TEST;
var1 = "aaa//bbb";
This is how you'll need to do it then, I guess
#define SLASH /
#define MY_CONST 'aaa##SLASH*test*SLASH##bbb'
myVar = MY_CONST;
I came up with this.
#define MY_CONST 'aaa##SLASH##SLASH##bbb'
For the other thing.
Though I found that glue (##) is annoying to work with, because some chars require it, other don't (like *).
I was waiting for you yesterday, Dedmen.
@winter dune CTP==FPS. Yeah servers are locked to 50 fps but you can unlock it using my patch
@little eagle command calls with nil get silently ignored. I completly understand because Nil != SCALAR or whatever the accepted parameter type is. But did you ever try that with a command that takes ANY?
Maybe I should just check what it does instead of asking you :U would probably be faster
@pastel cloakuu#1044 Yes Java is still in engine. I don't understand your reference to try/catch
@jade abyss Check above the lines, prob is somewhere there the code snippet is always correct tho. Just the line number might be off. And that generally only if you have a #include after a multiline comment.
Sorry @pastel cloak I meant @dusk sage and Discord is a useless piece of shit that everyone should just stop using
@little eagle Why tho? Was sadly hooked into family christmassy stuffz
It happens my dude, all g
Not good at all. It's so annyoing that Discord can't get their crap together :/
Because of exactly what you just did. Someone has to talk sense into this insanity.
The only times command provided with nil does not fail silently, is if they are nil's inside arrays:
group player setGroupId [nil]
Then it says "type ANY, expected STRING".
But if the lhs and/or rhs arg is actually nil, not an array with empty element, then it always fails silently.
Something I haven't quite figured out yet is why:
hint hint "fuck the police";
prints, and fails silently, but:
hint hint hint "fuck the police";
prints and fails with error message.
I guess that's why:
[hint "", hint hint ""]
[<null>,nothing]
unary nil reports "nothing", not "nil", and feeding "nothing" is noisy.
I have the perfect thing to test that
Just look at how the calls are ordered in assembly
Seems like GROUP type nil: [group nil] is also noisy when fed to other commands.
But I think that's just the type check:
[group group nil] // Generic error
[units group nil] // [array]
So stacked nil are silent as long as the types are correct.
And commands that report nil don't report nil when fed with nil, but nothing.
I wonder if there is a technical difference between the nil-return commands nil "<null>", and the ordinary nil.
[hint "", nil]
[<null>,any]
Besides string representation.
nil has a type
your second nil is a nil of type ANY. the first one maybe doesn't have a type?
Or it's just a empty GameValue
That's a nil without a nil
Ah, any is ANY type?
yes
A nothing (Not the var=value nothing) is a empty GameValue and thus doesn't have a type
Didn't consider that ANY is actually implemented as a type on it's own, but that makes sense.
Also explains why it's shown as any.
{hint hint hint "fuck the police";}
push string ""fuck the police"";
callFunction hint;
callFunction hint;
callFunction hint;
{hint hint "fuck the police";}
push string ""fuck the police"";
callFunction hint;
callFunction hint;
hm
I think the stack it pushes to is more interesting for this.
[group nil]
[00000000031B7690]
Did we ever figure out why certain typed nil's are shown as memory addresses?
The first one might error because hint returns Nil if it has a valid string. and returns Nothing with a invalid string.
In the first example the second Hint returns nothing. so the third get's nothing as argument and fails
assumption: first one prints, exits nil
second one takes nil, fails silent
third has nothing to take, fails explicit
that is exactly how it would work in sqf-vm
I don't know if you did. If a Type doesn't have a name it shows it's memory adress
or more: sqf-vm would not fail silent at all
[HINT]: fuck the police
hint hint hint "fuck the
^^^^
[ERR][L1|C6] RUNTIME: EXPECTED RIGHT PARAM TO BE OF TYPE STRING
Finished in 7 instructions```
And no the stack pushes are not interesting at all
callNular nil;
callFunction group;
makeArray 1;
[nil,hint "",hint hint ""]
[any,<null>,nothing]
So,
any is nil type ANY;
<null> is nil typeless; and
nothing is empty GameValue?
yeah.
Not perfectly sure about the typeless nil. But I can't check right now because my HDD is deadish
It's weird that it can be typeless, but I have no better explanation.
not that weird
I'd guess a default constructed (c++) Nil is typeless
You'd think they'd make it the same as the return value of the nil command, but oh well.
return GameValue(GameDataNil(GameTypeAny)); //nil of type any
return GameValue(GameDataNil()); //nil without type
return GameValue(); //empty gameValue (nothing)
Yep.
The problem is the devs write these returns manually
So it depends on whatever dev wrote that sqf command and his style of default return value
Now I wonder if the assignment constructor is also nothing or an entirely different beast.
How can there be something missing on the stack? Empty stack?
you just do not push anything to the stack then @little eagle
Wouldn't it carry over the last value, or is my understanding of it wrong?
your understanding is wrong
You can imagine it like
endStatement; //Clears the stack
push string ""fuck the police"";
callFunction hint; //Takes 1 value from the stack and pushes back it's returned value
endStatement; //Clears the stack
callFunction hint; //Takes 1 value from the stack... wait.. It's empty...
wait I'll edit that message.
can explain further if youre interested
Yeah, so it's empty and my understanding is right.
There
I always leave that out when pasting assembly. But in this case it's important
I wonder why it doesn't ctd if it errors there.
why should it ctd?
Because there is a special check for it before every command call
Doesn't seem like something handled by sqf exceptions.
Instead of just pulling from the stack it does actually check if there is something on it
And throws a script error.
The optimizer could also detect empty stack btw. And fix it. But probably a bad Idea to do so because a optimizer shouldn't change visible behaviour
not sure how we should fix this
we cannot optimize invalid syntax
just reporting it would be possible
could compiler error it. but returning nothing isn't actually a problem if it's a func that was never supposed to return anything
How many minutes would it take to fix this with access to source?
if you expect a returned value and it can return nothing that's an error ofcause
about 5
krgr -_-
As usual ยฏ_(ใ)_/ยฏ
5 minutes to allow for
var1 = var2 = var3 = var4 = "test"
@still forum that is nothing of an optimizers bothering
you only optimize valid code
But this is for a script language used by amateurs (like me), so at least make sensible exceptions and error handling / messages.
https://github.com/X39/sqf-vm/tree/master/SQF-VM in case you are bored @little eagle
there you can try to implement it
should take you a brief minute and give you an idea how "much" work it would be
For devs it's certainly interesting to have a potential error check on every compiled script. But the linter should already take care of it
also provides you with better erroring for theese kind of things
but still is far from complete ๐
Problem is that you will not have SQF VM, linter etc. running when the actual error happens: someone playing your mods.
But linter should catch it when you pack your mod
Would it catch assignedTeam player reporting nil iff remote controling a drone?
So, no^^?
right now neither player nor assignedTeam is implemented
assignetTeam would require networking
remote controlling a drone is also not implemented ๐
It's barely implemented in the base game.
quite easy task actually, but due to no ppl besides me are rly deving sqf-vm and i have right now extremly limited time ... it is stupid to even start implementing a full network stack for sqf-vm
but it can be done
a nobrainer actually ... most stuff is just busywork
implementing commands
crap ... forgot what i wanted to do ...
X39, you could make yourself a legend if you could develop the following:
Precompiled sqf scripts at build time.
So basically assembly in PBO's
Preprocessed*
But I think you mean.. .yeah
There's still the step of implementation, X39.
wanted to add it to armake. But.. C
That is something badly needed, but not really recognized by people yet.
If armake would be c++ it would be easy to do as it basically already has everything that's needed.
But I don't have time to mess around with C crap
can you create a list with the different instructions available in arma (and its quirks) @little eagle ?
might create a PR onto the armake
preprocessor?
Armake already has a working preproc with everything that Arma does
why then not use it?
I guess it wouldn't be to hard.
if packing SQF then script = preprocess(script)
simple task then ...
gonna check
__FILE__
You can stop now commy
__LINE__
Already said there is no need for that stuff because the preproc is already completly implemented
hell i need to go to a doc for my eyes ...
https://github.com/KoffeinFlummi/armake/blob/master/src/preprocess.c#L656 just call that when packing SQF scripts. And then pack the resulting temp file instead of the original script into the pbo
// first constant is file name
// @todo
// strcpy(constants[0].name, "__FILE__");
// if (constants[0].value == 0)
// constants[0].value = (char *)malloc(1024);
// snprintf(constants[0].value, 1024, "\"%s\"", source);
// strcpy(constants[1].name, "__LINE__");
// strcpy(constants[2].name, "__EXEC");
// if (constants[2].value == 0)
// constants[2].value = (char *)malloc(1);
// strcpy(constants[3].name, "__EVAL");
// if (constants[3].value == 0)
// constants[3].value = (char *)malloc(1);
Doesn't look promising without those.
So, armake when?
not __LINE__ though ..
I want it implemented in sqf
See that's the annoying thing about C why I don't want to handle that shit.
lineref = (struct lineref *)malloc(sizeof(struct lineref));
lineref->num_files = 0;
lineref->num_lines = 0;
lineref->file_index = (uint32_t *)malloc(sizeof(uint32_t) * LINEINTERVAL);
lineref->line_number = (uint32_t *)malloc(sizeof(uint32_t) * LINEINTERVAL);
success = preprocess(source, f_temp, constants, lineref);
Could be just
string preprocessedSource = preprocess(source, constants)
in C++
I need an advanced text editor inside the game.
You expect me to do this? I made one C++ thing in my entire life.
but that is beautiful โค @still forum
Flummi wanted to show off.
BEST MOD
pff
Some life communities still use it
I-is that a compliment or an insult?
some life communities also still ask me if they can use XMedSys
yes
I like how the next Arma patch after we dropped AGM made it crash when opening the inventory.
Oh, those beautiful "Patches"
Now we just get boring ENUM errors.
player setUnitTrait ["LoadCoef", 1];
i am completly out of touch with armake ... can anybody tell me what is called when you just pack a PBO?
@queen cargo nobody here knows that.
because for some reason there is an args.unpack but not a args.pack ?!?
Well, they fixed loadCoef apparently, but set3denMissionAttribute sill errors.
ah
so it is like usual ... fiddling through legacy code
I'd tell you if I knew.
So just the usual "Verschlimmbessert" or "Kaputtrepariert"
https://github.com/KoffeinFlummi/armake/blob/73fde59d6d4c0dfa1645109904dde8f461a86278/src/build.c#L300 Here it finds stuff to binarize
I guess you could use that callback thingy to look for SQF files
binarize is not handling sqf files
Yes?
Make it do that
thing is: need to know where to start
The binarize step turns config.cpp into preprocessed config.cpp and then into binarized config.bin
right now i have no idea where to stop
ยฏ_(ใ)_/ยฏ
I would just check when it writes files to PBO. and instead of writing the SQF script write preprocess(script) instead
if (success > 0) return success * -1; wtf!?
Like here: https://github.com/KoffeinFlummi/armake/blob/73fde59d6d4c0dfa1645109904dde8f461a86278/src/build.c#L145 I'd just
if filename ends with sqf then preprocess and write that to pbo.
But this is C crap. So I have to load the string from a file completly into memory, then preprocess it and write it to a different temp file then read that temp file completly into memory again and write that into the pbo
Have fun I guess
actually seems fairly simple if i understand this correctly
Yeah it is. It's just a chore
"isn't"?
int preprocess(char *source, FILE *f_target, struct constants *constants, struct lineref *lineref) {...}
this is literaly the whole magic
Which I already told you before ๐
instead of opening the source file myself thus one just has to rly pass it and only open the target file
I've seen this line before squint
Even pasted you the link to the lkines that prep the constants and lineref. because you have to be careful how you prep them because it will crash if you don't do that in exactly the correct way
And if that get's changed in the future and someone forgets to update both places it will crash or leak memory
Yey C
^
got busy work to do to get paid next month
Exactly my thought everytime I thought I'd do something on armake
look at it for 10 minutes and think "Ugh.. No.. Maybe some other day"
...
Don't blame me.
did not do
Good for you.
python is not a language designed for me
i can read and write it but i do not want to
I'd be fine with a batch file too. ยฏ_(ใ)_/ยฏ
didnt i already have shown you how to use gcc in preproc only mode?
should be fairly easy to use tbh
But as you already said gcc won't produce exactly the same output as Arma preproc
which does not matters if commy adjusts the defines
armas preproc is broken
was broken for ages
but i do not blame them for not touching it
armake preproc does perfectly the same as arma preproc
Maybe I should just let the Arma preprocessor do this and use a extension to write all my functions to file...
theese kind of things are code once thingies full of legacy code
what is not done 1:1 like in arma are those concat operators and stringification ops iirc
Nope
maybe it also just have been a broken file ...
Armake was updated about a week ago
talking about gcc
The more you guys talk, the more I think:
Maybe I should just let the Arma preprocessor do this and use a extension to write all my functions to file...
It will be annoying to make, but then I have a super fast loading ACE/CBA_A3 for myself.
you also just could adjust the c code yourself
it would be 5 mins to do so for me
but an hour or so to get it build correctly, tested etc
With Intercept you can list all PBO contents.
Just go through all SQF files
{if filename ends with then write preprocessFileLineNumbers <filepath> to C:\temp<filepath>} forEach allFiles
then you have a perfect copy of every ACE pbo with preproced SQF scripts.
@queen cargo btw you need openssl dev libs to build armake
And there is no build script for windows afaik
wat
so make that about 5 hours
how
why
Kommi only works on Linux
openssl for a packing tool?
"Kommi"?
ohh .. .forgot that part
and i highly doubt he made it as opt-in ...
And because Linux.. Only has a makefile. Because why bother with crossplatform cmake if a makefile works just fine
{if filename ends with then write preprocessFileLineNumbers <filepath> to C:\temp<filepath>} forEach allFiles
This one looks promising too, but why Intercept for that if I could do the same with the base game?
You cannot go though all files in all pbo's with the base game
I guess you could manually create a list of all file paths
I just need to adjust the PREP macro.
you can use a batch to get all files
That's super easy.
or hook CBA's compile func
Yep.
Since you guys seem to be unable to produce something, and instead talk about build scripts for tools for tools that could maybe achieve this, I'm scrambling together all we already have and create something that works.
And this is what I'll use: http://killzonekid.com/arma-extension-make_file-dll-v1-0/
Ewww
told you how you can archive the same with a proper preproc
A "proper preproc" will give me different results than the Arma one, and therefore produce improper results.
just fixes what arma does wrong ๐
I have no use for that.
it does not contains the arma quirks*
Yeah, and is therefore not suited for this task.
How is this so difficult to understand?
you still can edit armake, download openssl, build openssl, build armake
but i guess that would take away the fun ๐ฆ
The fun will begin once I shave off 30s of game start time with ACE.
And take so much time that it would only pay off after it's 100th use or so
so much time that you would be faster writing it yourself
something i have to do anyways sooner or later for sqf-vm
by the time you'll have it done nvme will be cheap and the gains you'll get will be like 0.2sec
What does nvme have to do with preprocessing scripts?
I need to add some createDiaryRecord entries. Indirectly from init.sqf I check for hasInterface, and waits for "local player", and then adds them, but it does not work for JIPs. What else do I need to do? Wait for "time > 0" ?
Why do you wait for local player?
Because that's the object I add the entries to
You can add diary entries to objects?
You have to????
interesting
E.g. for unit switching. If you play as A, and switch to B, you don't see A's entries
can't remove entries
What means it doesn't work for JIP's ?
script error/ game crash/ nothing/ it actually works fine/ ...
No entry showed up. In SP and (editor) MP testing it works.
No, it works fine for non-jip.
Does the script actually run? Maybe there are other things that stop it from running on JIP
put some diag_logs or something into it to see if it does run
initPlayerLocal.sqf
I'd suggest using someone elses solution if it's taking too much time
^
Diary entry frameworks have been done a thousand times
My own solution parses human-readable files containing the text.
Use the initPlayerLocal.sqf and all your issues will magically disappear.
human-readable files? So.. You mean just like any SQF script?

