#arma3_scripting

1 messages ยท Page 402 of 1

jade abyss
#

And yet, you can't create Slots for JIP Players sherbRIP

#

:feelsBadMan:

little eagle
#

Well, my lobby "can".

jade abyss
#

When the mission.sqm has enough Units placed down before.

#

So it doesn't count ๐Ÿ˜„

peak plover
#

every unit is extra size

#

I guess you gotta have a mix somewhere

jade abyss
#

yo mama is an extra size

peak plover
#

can't just put down 1000 units

little eagle
#

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?

jade abyss
#

Yep

#

Doesn't count

#

ingame, on the Server, create new Slow, that would count.

peak plover
#

Does it matter what units there are placed

jade abyss
#

Rest is scripting fkery ๐Ÿ˜ฆ

#

No, Nigel

#

As long as it's marked as "playable"

peak plover
#

so true

little eagle
#

But you don't need playable units if you use createUnit selectPlayer.

jade abyss
#

To create a lobbyslot? You need one

little eagle
#

Depends on which lobby you use.

jade abyss
#

I wanna punch you

#

The ordinary lobby, when you connect to a Server.

little eagle
#

Just script your own lobby. Takes 2 days.

jade abyss
#

I wanna punch you again.

#

And again because of... reasons.

little eagle
#

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.

lone glade
#

should be around 3-4 for A4

winter dune
#
_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

peak plover
#

delete this

winter dune
#
params [
    ["_obj",objNull,[objNull]],
    ["_myStr","",[""]]
];
#

or is wrong?

little eagle
#
params [
    ["_obj", objNull, [objNull]],
    "",
    "",
    ["_myStr", "", [""]]
];
winter dune
#

๐Ÿ‘Œ

quartz coyote
#

@little eagle sent you A PM is you have a few minuts

little eagle
#

Yes, I had to search for the displays config in the all-in-one config, and I had to write the sort script. >.<

winter dune
#

what's the difference between

{isNull player}
isNull player

?

#

or are they the same

peak plover
#

first is code

#

typename code

little eagle
#

{isNull player}
is a glorified string known as CODE
and
isNull player
is a BOOLEAN.

peak plover
#

๐Ÿ‘Œ ๐Ÿ‘ ๐Ÿ‘†

little eagle
#

I think this is part of a bigger code snipped where the question would make more sense (lazy eval?).

peak plover
#

apparently lazy eval is bad in arma?

#

Performance wise

#

Only use it in isNil "_blah" && {}

little eagle
#

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.

peak plover
#
!(_x getVariable ['nig_perf_cached',false]) && {!(_x inArea [player,(_dist/3),(_dist/3),0,false])}
little eagle
#

The "nig" tag cracks me up.

winter dune
#

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 };
peak plover
#

cheap condition && {expensive conditon}

little eagle
#

That code snipped makes no sense.

winter dune
#

i know

little eagle
#

You're checking the same thing twice.

winter dune
#

guess where I found this ๐Ÿ˜„

peak plover
#
if (!isNil {player} && {!isNull player } ) then { do Magic Tricks };
little eagle
#

player is never nil/undefined, unless you broke your game.

peak plover
#

yeah well _unit

little eagle
#

Sure, that's different.

#

You know what also helps, nigel?

peak plover
#

hmm?

little eagle
#
if (!isNil "_unit" && {!isNull _unit}) then {

->

if (!isNull ([_unit] param [0, objNull])) then {
peak plover
#

๐Ÿ˜‚

subtle ore
#

@peak plover [nigel,lifetime] call nig_sendToJail /shrug

little eagle
#

life

peak plover
#

#define lifetime 9999999

subtle ore
#

He has it

#

The lifer code

#

He just doesn't want to admit

peak plover
#

๐Ÿ˜จ

#

l-l-l-lying

#

n-n-n-not life

little eagle
#

I believe it.

subtle ore
#

Nigel, pull yourself away from it

#

You can recover

hoary copper
#

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

little eagle
#

Better get a real player to fly the heli.

peak plover
#

hire a china to do it

#

disableAi 'AUTOCOMBAT';
setbehaviour 'CARELESS'

hoary copper
#

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

peak plover
#

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

hoary copper
#

I see, okay

little eagle
#

Ignore combat is like:
group1 setCombatMode "BLUE";
?

peak plover
#

deleteVehicle _unit;
no unit no problem
ยฏ\(ยฐ_o)/ยฏ

little eagle
#

I don't think just careless makes them not fire, but I guess disabling autocombat fsm does.

subtle ore
#

Wtf is that nigel

little eagle
#

It is an attempt.

#

ยฏ\(ยฐ_o)/ยฏ

subtle ore
#

๐Ÿ˜‘

hoary copper
#

I see, hope this works, is the last thing I need to do

peak plover
#

carless should (injtheroy) disallow autocobmato

little eagle
#

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.^^

peak plover
#

Well

#

if ur heli wont land

#

planting a invisible helipad can help

little eagle
#

setDriveOnPath for helis?

subtle ore
#

๐Ÿค”

hoary copper
#

I can set the behavior only on the heli driver, right?

peak plover
#

setDriveOnPath has z

#

so maybe it works

hoary copper
#

so it ignores combat while the gunners fire

peak plover
#

behaviour is group

hoary copper
#

oh

#

rip

little eagle
#

Or unit, which then makes it apply to the whole group.

peak plover
#

U can make him solo group

little eagle
#

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.

peak plover
#

same

little eagle
#

It's on the wiki, so it must be true, right?

hoary copper
#

I think if it's set to the group the unit will use the other grouยดbehaviour

peak plover
#

๐Ÿคฅ

#

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

subtle ore
#

@peak plover Do you not have a bohemia acount?

peak plover
#

I do but it does not work on wiki

subtle ore
#

@peak plover Wiki -> Log in (top right) -> Bam

peak plover
#

redirects me here

subtle ore
#

Oh

#

You tried after the temp acc restriction

#

Dwarden said he'd restrict new accounts til the new year

#

Bot spam

peak plover
#

We'll see then new yera

eager prawn
#

rip

#

wouldn't be surprised if people were trying to bot accounts to grow their units pages

peak plover
#

unit pages are broken

#

still beta

subtle ore
#

@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

eager prawn
#

ah okay

peak plover
#

ohh nvm

#

may be fixed now

eager prawn
#

I mean

#

units pages work

#

they just don't work well ๐Ÿ˜ƒ

peak plover
#

It used to be that >200 or so units it stopped owrking

eager prawn
#

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

subtle ore
#

I think they have a team for web thohgh

peak plover
#

Busy working on arma 4 units

#

or maybe dayz lol

eager prawn
little eagle
#

This is the #offtopic_scripting channel.

subtle ore
#

๐Ÿ˜‰

peak plover
#

scripting is actually the topicless offtopic

eager prawn
#

must mean that FM never reads the channel ๐Ÿ˜ƒ

peak plover
#

ANah, FM is smart he gets it

digital pulsar
#

whats an elegant way to convert 1/0 into true/false

peak plover
#

selecteeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

digital pulsar
#

yeah, of course, array index

#

meanwhile i came up with sth like this boolFoo = intFoo > 0

peak plover
#

alt of select

winter dune
#
#define TRUE 1
#define FALSE 0

no?

peak plover
#

yes

strong shard
#

@Foley#1330 better:
bool = int != 0;
โ€œZero/Non-zeroโ€ = (False/True)

abstract shuttle
#

Good evening everybody! Does somebody has an Idea how to change the color of an "button text" while hovering over the button?

austere granite
#

change the config entry for it in description.ext

strong shard
#

@abstract shuttle colorBackgroundActive in config

#

@abstract shuttle or ctrlSetActiveColor

abstract shuttle
#

Thank you in advance! ๐Ÿ˜ƒ I'll try it out! ๐Ÿ˜ƒ

strong shard
#

Oh fc, text not background

abstract shuttle
#

Yeah... I'll try to change the color of the text on a button...

strong shard
#

@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

abstract shuttle
#

Okay, thank you very much mister! ๐Ÿ˜ƒ That means I need to change it in every dialog. :b

austere granite
#

INHERITANCE

peak plover
#

๐Ÿ‘†

austere granite
#

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)

hoary copper
#

@Adanteh#0761 or someone can explain how inheritance works on Arma?

#

if it's not too complex

austere granite
#

See can't tag me either

#

2pro

hoary copper
#

pr0

strong shard
hoary copper
#

oh thanks

#

always forget the wiki

austere granite
#

How to not suck at arma modding.

  1. Use the wiki a lot
  2. Have a lot of time on your hands
  3. Ignore people with blue names
    4)???
    5)PROFIT
peak plover
#

How to not suck at scripting

  1. param
  2. macros
  3. don't do it
tough abyss
#

What do macros do again?

#

I know they are for config

#

I think

strong shard
#

@tough abyss not only for config, for scripts too

peak plover
#

Macro are preprocessor stuff

#

#define FALSE true

if (FALSE) then {
    hint 'Gucci gang':
};
#

Preprocessor replaces false with true

#

It makes life easier rly

strong shard
#

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);

tough abyss
#

..... Wow... And with that, that's how people make dialogues and not have to edit individual config classes?

#

Like on a bigger scale?

hoary copper
#

where do I put my #define tho?

tough abyss
#

Init works

hoary copper
#

anywhere is ok?

peak plover
#

kindof

#

you can only use it where preprocessor is used

tough abyss
#

I use #include to organize my scripts

tough abyss
#

So not everything is in the injt

hoary copper
#

cool stuff, haven't used it yet

#

my mission is pretty much a mess

#

but it almost works, so it's fine

strong shard
#

About define... what do you think: what will be in result?

#define MY_CONST โ€œaaa//bbbโ€

myVar = MY_CONST;
little eagle
#

Script error, because of the wrong quote marks?

rotund cypress
#

Hey guys, does players become a null object when being killed for a short period of time?

little eagle
#

No.

#

Corpse until respawn.

rotund cypress
#

What do you mean? @little eagle m

little eagle
#

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.

rotund cypress
#

yeah but If im doing isNUll player before respawn

#

just after being killed

little eagle
#

Then it reports false? ยฏ_(ใƒ„)_/ยฏ

rotund cypress
#

It appears that the parameter unit passed from the onKilled eventhandler is null in servers POV

peak plover
#

It might seem different with differnet respawn types

#

but seems like it's kinda the same all the time

little eagle
#

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.

rotund cypress
#

Well, I meant if the player object is sent to server.

#

However it appears its just the name that cant get

little eagle
#

There is no killed event on a dedicated server for players.

#

So you're talking about something else?

rotund cypress
#

Im talking about sending the player object to server

#

I get an error when I try to use name as Error: No Unit

little eagle
#

name has always been like that for dead units.

#

It does not mean the object is null.

rotund cypress
#

It was just an assumption i made

little eagle
#

Yeah, it's wrong. But justified from the stupid warning of name.

rotund cypress
#

Fucking bohemia

little eagle
#

Error type: Number, expected: Number, Not a number.

austere granite
#

i do like how somehow the magical command bar does know the name of units still

rotund cypress
#

Engine solution maybe?

#

Wouldn't be surprised if it's profileName being continously broadcasted from each client :kappa:

little eagle
#

It's hard coded.

rotund cypress
#

As in engine solution?

little eagle
#

It's not the profile name though.

rotund cypress
#

I know, that was a joke ๐Ÿ˜„

little eagle
#

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.

rotund cypress
#

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

little eagle
#

diag_log [_killed];

rotund cypress
#

yeah which reports the object variable of that unit...

#

so its fairly strange

#

It appears its only at certain times

little eagle
#

Then the answer is that it's not null.

rotund cypress
#

They are NULL to the server though it seems

peak plover
#

What are you trying to achieve?

rotund cypress
#

It doesn't matter, however, right now im just logging deaths. And no do not say log on client side.

little eagle
#

diag_log [_killed];

#

yeah which reports the object variable of that unit...

#

Not null.

rotund cypress
#

On client, no, or its just really fast

#

There is something weird going on

little eagle
#

I meant you should do diag_log [_killed]; on the server.

rotund cypress
#

Yeah im doing it now

little eagle
#

Good.

rotund cypress
#

Yep, NULL on server

little eagle
#

It may be a problem on how you pass it to the server.

rotund cypress
#

Its passed through a public variable eventhandler

#

But I doubt that is where the problem lies

lone glade
#

THEFUCK

little eagle
#

Yeah, and there may be a bug in there.

lone glade
#

why the hell are you using throw

#

jesus christ

rotund cypress
#

Why not?

lone glade
#

because it's stupid

little eagle
#

^ this tbh

rotund cypress
#

Why is it stupid though? ๐Ÿค”

peak plover
#

Bannable offence

lone glade
#

Armed assault command that wasn't used and shouldn't be used

#

it's from a failed attempt at adding javascript* support....

rotund cypress
#

Still, why not use it?

#

Like something being null when it shouldn't would be an exception

lone glade
#

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

rotund cypress
#

Whats wrong with it?

lone glade
#

huh, they somehow thought adding a new syntax to it was a good idea;...

rotund cypress
#

Whats wrong with MY syntax though?

lone glade
#

it should be inside a try catch block

rotund cypress
#

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

little eagle
#

Whats wrong with it?
It's a worse if-then-else.

lone glade
#

just stop using this horror and use if then else like everyone else

little eagle
#

Goto Mk2.

lone glade
#

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

rotund cypress
#

I thought you said Java support? ๐Ÿค”

lone glade
#

corrected^

rotund cypress
#

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.

peak plover
#

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

rotund cypress
#

I didnt say it was standarrd practise in arma

peak plover
#

That's a reason not to use

rotund cypress
#

If you go and look into the functions_f PBO, you want to go neck yourself regardless.

peak plover
#

Dlc functions are more okish

#

Tasks functions not so much

rotund cypress
#

Send me a hastebin of one

lone glade
#

until you get to tac-ops

peak plover
#

Haven't seen that yet

lone glade
#

and then you realize all the senior devs didn't touch those

peak plover
#

Interns lol

lone glade
#

yes, interns

rotund cypress
#

Senior Devs > SQF > Wot?

meager heart
#
if (alive this) throw "u wot m8"; //-- nothing happens 
if (alive this) throw hint "u wot m8"; //--- u wot m8
rotund cypress
#

if (alive this) throw hint "u wot m8"; //--- u wot m8

#

error

lone glade
#

needs to be in a try catch block anyways

little eagle
#

hint is evaluted before throw, and since hint reports nil, the if will never do anything.

rotund cypress
#

@lone glade it doesn't??

little eagle
#

No error, but the code is just a long version of:
hint "u wot m8";

meager heart
lone glade
#

it does

little eagle
#

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.

rotund cypress
#

Ehm @lone glade it will throw an unhandled exception and then dont continue further

little eagle
#

No, it won't.

#

hint is evaluted before throw, and since hint reports nil, the if will never do anything.

rotund cypress
#

Im not talking about his snippet

little eagle
#

OK.

rotund cypress
#

but if (true) throw "true"

#

will not require a try catch block

lone glade
#

also realize

Armed Assault

little eagle
#

That doesn't mean anything. It's bad even if it were introduced a week ago.

rotund cypress
#

@lone glade do you code any other language than SQF?

lone glade
#

๐Ÿคฆ

rotund cypress
#

Cause then you would know how throw and all that works

lone glade
#

Just keep digging

little eagle
#

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.

rotund cypress
#

try {
    call _fnc_hi;
} catch { hint _Exception; };```
little eagle
#

Thanks for proving my point?

lone glade
#

are you going to use the oo functions next?

#

because yes, those exist..... for some reason

rotund cypress
#

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

meager heart
#
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 ๐Ÿ‘Œ

lone glade
#

the fuck is that horror

rotund cypress
#

^^

#

why would u ever do throw hint ...??

lone glade
#

no

#

wtf

rotund cypress
#

Should give you an error

lone glade
#

that's the first thing you notice?

meager heart
#

lol

lone glade
#

really?

little eagle
#

Should give you an error
No, it doesn't. For the third time.

rotund cypress
#

I know

#

But it should

little eagle
#

Ah, prescriptive should, not descriptive should.

rotund cypress
#

^^

#

But again

#

We all know who made this game

lone glade
#

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

little eagle
#

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.

lone glade
#

EEnglish

#

german is now the lingua franca of the world, time to change all those var names

little eagle
#

german is now the lingua franca
lol what?

lone glade
#

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

rotund cypress
#

Im not mistaken thinking people can mess with the memory to change their uid so getPLayerUID gets a different UID?

lone glade
#

you can't

little eagle
#

Sure you can.

lone glade
#

UID is your steam64 ID

rotund cypress
#

I always check on server just because of this.

#

Since they cannot compromise it on server.

#

I guess(??)

little eagle
#

The only way to have a secure is server is to administrate it. I thought people figured this out by now.

rotund cypress
#

Administrate it?

little eagle
#

Moderate.

lone glade
#

Have someone on it H24

little eagle
#

Have an admin on, kicking the cheaters.

rotund cypress
#

Yeah, because getPLayerUID doesn't go through server if used locally right?

little eagle
#

Dunno what else to answer.

rotund cypress
#

Well you could answer my question (if you know of course) ๐Ÿ˜ƒ

peak plover
#

Can s1 make a dll that screenshots player screens during gameplay?

lone glade
#

yes

peak plover
#

Cheat suspision? sends screenshot to admin

lone glade
#

you can even send the screenshots somewhere else if you want

peak plover
#

snapchat the cheaters to admins

lone glade
#

but I seriously doubt that's a good idea / legal

little eagle
#

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.

rotund cypress
#

Ah okey

#

But I mean always good practise to do server side check of player id I suppose

#
  • the admins on server of course
meager heart
rotund cypress
#

But you do what you can to secure your mission in the first place amiright?

little eagle
#

Sure.

#

But I'd avoid adding placebo checks just to make you feel better about stuff, idk.

peak plover
#

anti-cheat
Just don't play with cheaters

dusk sage
#

Yes it can be spoofed

#

And checking on server is a good solution

#

@lone glade When were they attempting to add 'javascript' support?

little eagle
#

Never.

peak plover
#

promised for a3

little eagle
#

No.

#

Java != js

#

For starters.

peak plover
#

what is it

dusk sage
#

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

lone glade
#

ah, I was right the first time, it was java not javascript

little eagle
#

They weren't.

lone glade
#

it's from Armed assault (arma 1) so go figure

#

it isn't part of that attempt?

little eagle
#

But why bring that up if it doesn't change anything?

#

It may have been inspired I guess. Java has ttc, right?

dusk sage
#

Almost every language does

#

Just seemed peculiar you instantly associated the command(s) with their Java attempt

lone glade
#

I really thought it was, since they updated them in A3 (recently)

rotund cypress
#

๐Ÿ˜‚

little eagle
#

They only updated throw, but they did the same to breakTo, so what does that matter?

#

breakOut, not breakTo. Sry.

rotund cypress
#

I really don't see the problem..

little eagle
#

With ttc?

lone glade
#

breakOut has it's uses that no other commands provide tho

little eagle
#

If you say that, then the same is true for throw.

lone glade
#

we use breakOut in the zeus module ^

#

like, a lot

little eagle
#

Both make ugly code.

lone glade
#
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;
    };
};
dusk sage
#
if (...) exitWith {
    if (...) exitWith {
        if (...) exitWith {};
    };
};
little eagle
#

Thanks for proving my point.

lone glade
#

i'd still consider that readable compared to the alternative

dusk sage
#

Using breakOut in a return like style is quite elegant

#

Especially when nested in quite a few scopes

little eagle
#

Especially when nested in quite a few scopes
Well, there's your initial problem.

austere granite
#

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

dusk sage
#

Nothing wrong with being a few scopes deep

little eagle
#

So breakOut / throw are band aids for bad code.

dusk sage
#

As long as it doesn't look like that 15k file posted here a few days ago

austere granite
#

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

little eagle
#

^ this's all I'm saying.

lone glade
#

I agree with that

#

but there's extremely rare occasions when you need to use it

#

unlike ttc

little eagle
#

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.

lone glade
#

silentspike did it first ๐Ÿ˜›

#

I also used it a single time outside of those zeus modules, as a return too in garrison

little eagle
#

The ACE Arsenal mission has 5 spawn.

peak plover
#

๐Ÿ˜ฑ

dusk sage
#

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

little eagle
#

Sure, write what you want. Make a 5 MB script, but don't expect people to defend it.

austere granite
#

Lel

dusk sage
#

Who writes 5MB scripts?

austere granite
#

I do

little eagle
#

Dunno, forgot what the size of the thing was.

austere granite
#

I wrote a cryptominer in SQF

dusk sage
#

Oh right, that 15k line thing

peak plover
#

LMAO

#

What

austere granite
#

I use it to mine while people play on my life server

dusk sage
#

That crashed my chrome when I opened it

peak plover
#

๐Ÿ˜„

#

That's why life mission 30 mb

#

All the bc miner

little eagle
#

It's funny how there can be half of ACE in one file.

dusk sage
#

If life server developers can write miners in SQF, they should get a job with better pay

#

Because they deserve it

peak plover
#

๐Ÿ˜‚

austere granite
#

Gotta do an ico for Arma Life Coin

#

Will support microtra sanction between server

dusk sage
#

Did you see Dogecoin is now worth 1 cent?

peak plover
#

whot

dusk sage
#

๐Ÿค‘ LifeCoin

peak plover
#

That is impossible

dusk sage
#

It's a fact unless changed

austere granite
#

And I made it so yo have to process yep transactions yourself to send it

#

Two*

dusk sage
#

The market cap was 1 BN* or so

peak plover
#

btc ~12k

austere granite
#

Iota ain't got nothing on me

peak plover
#

Btw BUY

#

BUY

#

100k in 2018

lone glade
#

liar

#

you're saying that because you're dumping to invest into sqfCoin

peak plover
#

Normies ruin everything 'tho

little eagle
#

Hold onto your butts:

#

LifeCoin

peak plover
#

CSATCoin - Iranian currency in 2035

#

MillerCoin - US/EU currency in 2035

dusk sage
#

BohemiaCoin

#

Constantly crashing

peak plover
#

๐Ÿ˜‚

outer fjord
#
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.

little eagle
#

Line numbers have pretty much always been broken.

jade abyss
#

Check above the lines, prob is somewhere there

little eagle
#

Need to see the whole code to figure this one out.

jade abyss
#

That also

little eagle
#

My guess is, that _x is not an array.

jade abyss
#

Thought the same but: Wouldn't that cause another Msg popping up?

little eagle
#

I'll try in a minute.

jade abyss
#

aye (i can't remember the Messages anymore^^)

outer fjord
#

It's the RF3 script int.sqf within RF3 log

jade abyss
#

Link?

#

Pastebin it?

outer fjord
#

One second, I'll get it pastebin

little eagle
#

1 select 0
Generic error in expression.

jade abyss
#

Yep, then prolly not an array

little eagle
#

What is R3F_LOG_CFG_can_transport_cargo?

outer fjord
#

What is a generic error expression exactly? Sorry not a coder, but trying my best to fix it.

little eagle
#

Just a generic error.

#

Dunno how else to say that, lol.

jade abyss
#

You try to select something from an array, wich is not an array

little eagle
#

Something something param.

jade abyss
#

2014, ouch

little eagle
#

What is R3F_LOG_CFG_can_transport_cargo?

jade abyss
#

* Copyright (C) 2014 Team ~R3F~
copyright XD

outer fjord
#

Digging for the source of it.

#

I know it's a function.

little eagle
#

Just use the debug console inside the mission preview to retrieve it.

#

R3F_LOG_CFG_can_transport_cargo

jade abyss
#

print out what R3F_LOG_CFG_can_transport_cargo is
diag_log [R3F_LOG_CFG_can_transport_cargo];

#

or systemchat

little eagle
#

copyToClipBoard str R3F_LOG_CFG_can_transport_cargo

jade abyss
#

Many ways lead to rome ยฏ_(ใƒ„)_/ยฏ

outer fjord
#

Can't find it even with Agent Ransack T-T

little eagle
#

With who?

outer fjord
#

It's a program that can look into folders and search all program files for key words

jade abyss
#

wot

nocturne iron
#

Like a grep?

jade abyss
#

What are you searching for?

outer fjord
#

R3F_LOG_CFG_can_transport_cargo

jade abyss
#

Go ingame

#

type the code we posted before

outer fjord
#

In the debug menu?

jade abyss
#
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

little eagle
#

Debug Console.

nocturne iron
#

I like your message but the fact you're not using the Ui colour from the beta is upsetting

little eagle
#

T-the link is from the wiki?

#

I'm still using that orange.

outer fjord
#

What can I use to upload a image?

jade abyss
#

imgur?

little eagle
#

imgur

jade abyss
#

๐Ÿ‘ Commy

#

btw. what ya thinking about my name today, Commychan

little eagle
#

Beautiful.

jade abyss
#

aww, thank you

little eagle
#

I also liked "Dschanghis Khan".

jade abyss
#

My personal Favs still come

little eagle
#

Can't wait.

outer fjord
jade abyss
#

?

little eagle
#

copyToClipBoard str R3F_LOG_CFG_can_transport_cargo

#

And then ctrl+v it here.

jade abyss
#

add str between it or use copyToClipboard (as commy wrote)

little eagle
#

You also need to start your mission.

#

Doubt it is in the VR.

outer fjord
#

aH, my bad

#

paistbining it now

little eagle
#

That looks right, did the same original error happen while testing?

outer fjord
#

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.

little eagle
#

Ye, if you mess with R3F_LOG_CFG_can_transport_cargo in ways not intended, it could break.

outer fjord
#

Could it be effected by external other mod/scripts?

little eagle
#

Yes, if they mess with R3F_LOG_CFG_can_transport_cargo.

#

Or if there's another script error before that.

outer fjord
#

It would have to specificually call or use that name convention right?

little eagle
#

What?

outer fjord
#

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?

little eagle
#

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.

jade abyss
#

Oh yeah, right commy

#

good boy @little eagle Here, have a treat โ˜•

nocturne iron
#

wait why are those classes even in a3

#

bc they're not in the game

jade abyss
#

Mods?

#

maybe?

nocturne iron
#

Nah they're original a2 classes by the looks of it

jade abyss
#

You don't wanna know wich names i've seen (and used ๐Ÿ˜„ )

nocturne iron
#

oh no

strong shard
#

@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;
nocturne iron
#

Give it a test

#

I doubt it though, because you're defining it as a string

jade abyss
#

what speaks against?

myVar = โ€œaaa//bbbโ€;```
#

Should work, maybe... idk... idc

#

also searching food

nocturne iron
#

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

strong shard
#

@jade abyss if you not use define - all works good, but if you would define string with // in define...

jade abyss
#

then: Why use define?

nocturne iron
#

^

strong shard
#

@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โ€

little eagle
#

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.

meager granite
#

Looks like preprocessor treats comments like comments even inside preprocessor lines

#
#define MY_CONST #(aaa/*test*/bbb)
myVar = MY_CONST;
myVar = (aaabbb);
little eagle
#

That is because you used #.

meager granite
#

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

little eagle
#

Which preprocessor is this?

meager granite
#

preprocessFile\LineNumbers

#

Its not like other commands use something different

little eagle
#

Never encountered this with addons.

#

Trying...

strong shard
little eagle
#

Same.

#

But now explain those weird quote marks.

meager granite
#

Typed into Microsoft Word before pasting here (lol), which likes to turn quotes into special ones?

strong shard
#

@little eagle it is โ€œ from ipad keyboard

meager granite
#
#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

little eagle
#
#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.

still forum
#

@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

pastel cloak
#

It happens my dude, all g

still forum
#

Not good at all. It's so annyoing that Discord can't get their crap together :/

little eagle
#

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.

still forum
#

I have the perfect thing to test that

#

Just look at how the calls are ordered in assembly

little eagle
#

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.

still forum
#

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

little eagle
#

Ah, any is ANY type?

still forum
#

yes

#

A nothing (Not the var=value nothing) is a empty GameValue and thus doesn't have a type

little eagle
#

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.

still forum
#

{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

little eagle
#

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?

still forum
#

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

queen cargo
#

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

still forum
#

I don't know if you did. If a Type doesn't have a name it shows it's memory adress

queen cargo
#

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```
still forum
#

And no the stack pushes are not interesting at all

callNular nil;
callFunction group;
makeArray 1;
little eagle
#
[nil,hint "",hint hint ""]
[any,<null>,nothing]

So,
any is nil type ANY;
<null> is nil typeless; and
nothing is empty GameValue?

still forum
#

yeah.

#

Not perfectly sure about the typeless nil. But I can't check right now because my HDD is deadish

little eagle
#

It's weird that it can be typeless, but I have no better explanation.

queen cargo
#

not that weird

still forum
#

I'd guess a default constructed (c++) Nil is typeless

little eagle
#

You'd think they'd make it the same as the return value of the nil command, but oh well.

still forum
#

return GameValue(GameDataNil(GameTypeAny)); //nil of type any
return GameValue(GameDataNil()); //nil without type
return GameValue(); //empty gameValue (nothing)

little eagle
#

Yep.

still forum
#

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

little eagle
#

Now I wonder if the assignment constructor is also nothing or an entirely different beast.

still forum
#

different beast

#

missing value on the stack

little eagle
#

How can there be something missing on the stack? Empty stack?

queen cargo
#

you just do not push anything to the stack then @little eagle

little eagle
#

Wouldn't it carry over the last value, or is my understanding of it wrong?

queen cargo
#

your understanding is wrong

still forum
#

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.

queen cargo
#

can explain further if youre interested

little eagle
#

Yeah, so it's empty and my understanding is right.

still forum
#

There

#

I always leave that out when pasting assembly. But in this case it's important

little eagle
#

I wonder why it doesn't ctd if it errors there.

queen cargo
#

why should it ctd?

still forum
#

Because there is a special check for it before every command call

little eagle
#

Doesn't seem like something handled by sqf exceptions.

still forum
#

Instead of just pulling from the stack it does actually check if there is something on it

little eagle
#

And throws a script error.

still forum
#

And throws a evaluation error

#

๐Ÿ˜„

little eagle
#

Jup.

#

Makes all sense.

#

Well it doesn't, but in the forensic sense it makes sense.

still forum
#

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

queen cargo
#

not sure how we should fix this

#

we cannot optimize invalid syntax

#

just reporting it would be possible

still forum
#

could compiler error it. but returning nothing isn't actually a problem if it's a func that was never supposed to return anything

little eagle
#

How many minutes would it take to fix this with access to source?

still forum
#

if you expect a returned value and it can return nothing that's an error ofcause

#

about 5

little eagle
#

krgr -_-

jade abyss
#

As usual ยฏ_(ใƒ„)_/ยฏ

still forum
#

5 minutes to allow for
var1 = var2 = var3 = var4 = "test"

queen cargo
#

@still forum that is nothing of an optimizers bothering
you only optimize valid code

still forum
#

yeah. I know.

#

Could maybe make something optional later on

little eagle
#

But this is for a script language used by amateurs (like me), so at least make sensible exceptions and error handling / messages.

queen cargo
still forum
#

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

queen cargo
#

also provides you with better erroring for theese kind of things

still forum
#

Ohhhhh

#

and btw... I know have instruction access. Meaning I could no myNumVar += 5

queen cargo
#

but still is far from complete ๐Ÿ™ˆ

little eagle
#

Problem is that you will not have SQF VM, linter etc. running when the actual error happens: someone playing your mods.

still forum
#

But linter should catch it when you pack your mod

queen cargo
#

thing is: then it is already to late

#

unit testing your mods is your thing

little eagle
#

Would it catch assignedTeam player reporting nil iff remote controling a drone?

queen cargo
#

that is one goal of sqf-vm

#

if it was implemented, yes

little eagle
#

So, no^^?

queen cargo
#

right now neither player nor assignedTeam is implemented

#

assignetTeam would require networking

still forum
#

remote controlling a drone is also not implemented ๐Ÿ˜‰

little eagle
#

It's barely implemented in the base game.

queen cargo
#

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 ...

little eagle
#

X39, you could make yourself a legend if you could develop the following:
Precompiled sqf scripts at build time.

still forum
#

So basically assembly in PBO's

little eagle
#

Preprocessed*

still forum
#

But I think you mean.. .yeah

queen cargo
#

gcc

#

i am not into python is the thing

little eagle
#

There's still the step of implementation, X39.

queen cargo
#

wanted to add it to arma.studio

#

but again ... limited dev time

still forum
#

wanted to add it to armake. But.. C

little eagle
#

That is something badly needed, but not really recognized by people yet.

still forum
#

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

queen cargo
#

can you create a list with the different instructions available in arma (and its quirks) @little eagle ?

#

might create a PR onto the armake

little eagle
#

preprocessor?

queen cargo
#

then you do not even have to adjust for gcc

#

yep

still forum
#

Armake already has a working preproc with everything that Arma does

queen cargo
#

why then not use it?

still forum
#

It's used for configs

#

Would need to run on every sqf script when it's packed

little eagle
#

#define
#undef
#ifdef
#infdef
#else
#endif

still forum
#

I guess it wouldn't be to hard.
if packing SQF then script = preprocess(script)

little eagle
queen cargo
#

simple task then ...
gonna check

little eagle
#

__FILE__

still forum
#

You can stop now commy

little eagle
#

__LINE__

still forum
#

Already said there is no need for that stuff because the preproc is already completly implemented

little eagle
#

I am 99% sure I forgot something.

#

Well, comments.

queen cargo
#

hell i need to go to a doc for my eyes ...

still forum
little eagle
#
    // 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.

still forum
little eagle
#

So, armake when?

queen cargo
#

those could be implemented using sqf-vm

#

in theory

little eagle
queen cargo
#

not __LINE__ though ..

peak plover
#

I want it implemented in sqf

still forum
#

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++

queen cargo
#

@peak plover got you covered ๐Ÿ˜ƒ sqf-vm

#

just use sqf syntax with him @signal peak

peak plover
#

I need an advanced text editor inside the game.

little eagle
#

You expect me to do this? I made one C++ thing in my entire life.

queen cargo
#

but that is beautiful โค @still forum

still forum
#

sure

#

But sadly armake isn't beautiful c++

little eagle
#

Flummi wanted to show off.

peak plover
#

FLummi made AGHM

#

AMG

#

AGM

little eagle
#

BEST MOD

queen cargo
#

pff

peak plover
#

Some life communities still use it

little eagle
#

I-is that a compliment or an insult?

queen cargo
#

some life communities also still ask me if they can use XMedSys

little eagle
#

Insult it is.

#

jk

queen cargo
#

yes

little eagle
#

I like how the next Arma patch after we dropped AGM made it crash when opening the inventory.

jade abyss
#

Oh, those beautiful "Patches"

little eagle
#

Now we just get boring ENUM errors.

jade abyss
#

wot?

#

Where?

little eagle
#

1.78/1.80

#

LOADCOEF

#

FOREIGN ERROR, ENUM BLAH

jade abyss
#

oO

#

Wich codes/commands?

little eagle
#

player setUnitTrait ["LoadCoef", 1];

queen cargo
#

i am completly out of touch with armake ... can anybody tell me what is called when you just pack a PBO?

jade abyss
#

Anything else?

#

(can't remember using setUnitTrait at any time ๐Ÿค” )

still forum
#

@queen cargo nobody here knows that.

queen cargo
#

because for some reason there is an args.unpack but not a args.pack ?!?

little eagle
#

Well, they fixed loadCoef apparently, but set3denMissionAttribute sill errors.

jade abyss
#

ah

queen cargo
#

so it is like usual ... fiddling through legacy code

little eagle
#

I'd tell you if I knew.

jade abyss
#

So just the usual "Verschlimmbessert" or "Kaputtrepariert"

queen cargo
#

binarize is not handling sqf files

still forum
#

Yes?

queen cargo
#

no

#

or yes

#

or maybe

#

both

still forum
#

Make it do that

queen cargo
#

thing is: need to know where to start

still forum
#

The binarize step turns config.cpp into preprocessed config.cpp and then into binarized config.bin

queen cargo
#

right now i have no idea where to stop

still forum
#

ยฏ_(ใƒ„)_/ยฏ

#

I would just check when it writes files to PBO. and instead of writing the SQF script write preprocess(script) instead

queen cargo
#

if (success > 0) return success * -1; wtf!?

still forum
#

Have fun I guess

queen cargo
#

actually seems fairly simple if i understand this correctly

still forum
#

Yeah it is. It's just a chore

little eagle
#

"isn't"?

queen cargo
#
int preprocess(char *source, FILE *f_target, struct constants *constants, struct lineref *lineref) {...}
#

this is literaly the whole magic

still forum
#

Which I already told you before ๐Ÿ˜„

queen cargo
#

instead of opening the source file myself thus one just has to rly pass it and only open the target file

little eagle
#

I've seen this line before squint

still forum
#

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

queen cargo
#

it is called: move it into a function

#

meh
not today ...

still forum
#

^

queen cargo
#

got busy work to do to get paid next month

still forum
#

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"

little eagle
#

...

queen cargo
#

it is ugly code @little eagle

#

ugly code stays ugly

little eagle
#

Don't blame me.

queen cargo
#

did not do

little eagle
#

Good for you.

queen cargo
#

i just repeat myself: gcc

#

even showed you how to use it ๐Ÿ˜›

little eagle
#

Thanks. I wish someone implemented gcc to make.py.

queen cargo
#

python is not a language designed for me
i can read and write it but i do not want to

little eagle
#

I'd be fine with a batch file too. ยฏ_(ใƒ„)_/ยฏ

queen cargo
#

didnt i already have shown you how to use gcc in preproc only mode?

#

should be fairly easy to use tbh

still forum
#

But as you already said gcc won't produce exactly the same output as Arma preproc

queen cargo
#

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

still forum
#

armake preproc does perfectly the same as arma preproc

little eagle
#

Maybe I should just let the Arma preprocessor do this and use a extension to write all my functions to file...

queen cargo
#

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

still forum
#

Nope

queen cargo
#

maybe it also just have been a broken file ...

still forum
#

Armake was updated about a week ago

queen cargo
#

talking about gcc

little eagle
#

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.

queen cargo
#

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

still forum
#

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

queen cargo
#

wat

still forum
#

so make that about 5 hours

queen cargo
#

how
why

still forum
#

Kommi only works on Linux

queen cargo
#

openssl for a packing tool?

little eagle
#

"Kommi"?

still forum
#

It needs it for the bisigns

#

lol

queen cargo
#

ohh .. .forgot that part

still forum
#

XD

#

My brain broke. Flummi*

queen cargo
#

and i highly doubt he made it as opt-in ...

still forum
#

yeah.

#

I guess you can manually remove the files and comment out references to it

queen cargo
#

so make that more like 12 hours

#

in that time i could write the preproc myself ๐Ÿคฆ

still forum
#

And because Linux.. Only has a makefile. Because why bother with crossplatform cmake if a makefile works just fine

little eagle
#

{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?

still forum
#

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

little eagle
#

I just need to adjust the PREP macro.

queen cargo
#

you can use a batch to get all files

little eagle
#

That's super easy.

still forum
#

or hook CBA's compile func

little eagle
#

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.

still forum
#

Ewww

queen cargo
#

told you how you can archive the same with a proper preproc

little eagle
#

A "proper preproc" will give me different results than the Arma one, and therefore produce improper results.

queen cargo
#

just fixes what arma does wrong ๐Ÿ˜›

little eagle
#

I have no use for that.

queen cargo
#

it does not contains the arma quirks*

little eagle
#

Yeah, and is therefore not suited for this task.

#

How is this so difficult to understand?

queen cargo
#

you still can edit armake, download openssl, build openssl, build armake

#

but i guess that would take away the fun ๐Ÿ˜ฆ

little eagle
#

The fun will begin once I shave off 30s of game start time with ACE.

still forum
#

And take so much time that it would only pay off after it's 100th use or so

queen cargo
#

so much time that you would be faster writing it yourself

#

something i have to do anyways sooner or later for sqf-vm

nocturne iron
#

by the time you'll have it done nvme will be cheap and the gains you'll get will be like 0.2sec

still forum
#

What does nvme have to do with preprocessing scripts?

nocturne iron
#

the speed of loading in general

#

was a joke

errant jasper
#

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" ?

peak plover
#

๐Ÿค”

#

Why

still forum
#

Why do you wait for local player?

peak plover
errant jasper
#

Because that's the object I add the entries to

still forum
#

You can add diary entries to objects?

errant jasper
#

You have to????

still forum
#

interesting

errant jasper
#

E.g. for unit switching. If you play as A, and switch to B, you don't see A's entries

peak plover
#

can't remove entries

still forum
#

What means it doesn't work for JIP's ?

#

script error/ game crash/ nothing/ it actually works fine/ ...

errant jasper
#

No entry showed up. In SP and (editor) MP testing it works.

still forum
#

wut?

#

No entry showed up for JIP's in SP?

peak plover
#

You don't have to wait for local player

#

init.sqf runs after player is initalized

errant jasper
#

No, it works fine for non-jip.

still forum
#

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

little eagle
#

initPlayerLocal.sqf

nocturne iron
#

I'd suggest using someone elses solution if it's taking too much time

#

^

#

Diary entry frameworks have been done a thousand times

errant jasper
#

My own solution parses human-readable files containing the text.

little eagle
#

Use the initPlayerLocal.sqf and all your issues will magically disappear.

still forum
#

human-readable files? So.. You mean just like any SQF script?