#arma3_tools

1 messages Β· Page 23 of 1

glossy inlet
#

you can make web tools with c++ (webasm)

#

πŸ˜„

neon flax
#

cout << "<body>";

#

πŸ‘€

harsh steeple
#

yea web tool might be more useful, and allg ill go post it their

keen owl
#

The real general solution is for BI to implement named arguments, but since that's not gonna happen, I will echo Shia LaBeuof: "Just do it!"

#

Don't let your dreams be dreams.

harsh steeple
#

something i would love to see is a faction config generator, that gets the information from a faction you create in eden

toxic nest
#

so what's better? 4 or 5 if statements checking value of a variable or something that would filter through all of the types sort of like a switch do control structure in sqf? (cpp)

glossy inlet
#

define "better" ?

#

If you mean the switch statement checking all types. Aka checking types you don't even need. Then that's of course worse

toxic nest
#

No, all these types would be needed. "Better" as in clean, less sloppy, possibly more performance friendly?

glossy inlet
#

multiple if's vs a switch statement that in the end do the same thing most like don't have a perf difference

#

the optimizer get's rid of all that

#

most difference will be how you order the if's. Put the most likely first. And don't check the others if you don't need anymore

toxic nest
#

So, currently I have the following just to see what works:

double convert(std::string type,double num) {
    double conversion;
    if(type.compare("k")) {
        //converting in kilometers to miles
        conversion = num / 1.609344;
        return conversion;
    }
    else {
        //converting in miles to kilometers
        conversion = num * 1.609344;
        return conversion;
    };
};

I want to be able to compare meters to km, and km m. like i did with the miles and km.

glossy inlet
#

your convert doesn't work. The result is inverted.

#

biggest problem is that you are always copying the type string although you don't need to

toxic nest
#

Why would they be inverted? Where does type get copied?

glossy inlet
#

std::string type <-- get's copied there

#

and it's inverted because compare returns 0 if they are equal

#

and 0 is false. Meaning if type is k then your miles->kilometers is executed

#

or is type the target type?

#

If so you should probably call it targetType.

#

and if you just want to check the first character why don't you just check the first character?

#

type.front() == 'k'

toxic nest
#

inputType would be what determines kilometers or miles based upon input

#

Okay, sweet. Got that now.

#

In regards to the std::string though, you're saying that the type would be available in any scope then?

glossy inlet
#

any scope?

#

It's available in that function. Never said anything about a scope

#

You are copying it on every call

#

because you are taking a string. not a reference

toxic nest
#

Right, okay.

glossy inlet
#

I would just use a enum

#

and then a switch/case

toxic nest
#

Yeah, I was thinking about doing that. Thanks for the feedback πŸ˜„

nocturne basin
#

244MB for frking json parsing ....

#

could download boost too if i wanted to pile up a shitload of crap i never will use anyways -.-

#

anybody having a neat, header-only json framework for me?

#

literally only the test and benchamrk section causing that extreme size

keen owl
nocturne basin
#

want to add it as git submodule ... which is why i pretty much ignored it

#

anyways

#

deleted both folders now

#

can now start working with this πŸ™ˆ

#

now the question is: how to integrate the networking into the sqf-vm πŸ€”

glossy inlet
#

@nocturne basin 244MB? You are doing something wrong. My nlohmann json in the debugger is only 600KB

#

anybody having a neat, header-only json framework for me? nlohmann

#

You can also configure CMake to download single files I think

nocturne basin
#

It is added as submodule
Which might be it

nocturne basin
dim phoenix
#

Just someone who forked a lot of stuff.

glossy inlet
#

He forked your SQF-Assembly fork instead of the original πŸ€”

nocturne basin
#

that is why i wonder @glossy inlet πŸ˜„

dim phoenix
#

That's because this guy hates you, Dedmen.

#

No TFAR either.

nocturne basin
#

no sqf-vm either, which actually is way more up-to-date then the ArmA.Studio he forked

#

arma.studio can be considered dead by now simply because nobody uses it anymore and i do not plan on investing time on a large project for no outcome

#

stuff gets only funnier when one looks at the forked repository in general

#

only a few are what one could call "well maintained"

#

ohh wait

#

sqf-vm is in there too

vague shard
#

who has experience doing a custom A3 launcher and is still around to ask?

more specifically i'd like to explore the idea to drop the ingame browser and replace it with forwarding players to a website with a web browser - in combination with a system to show only servers for a given mod (say RHS, Unsung, IFA3, SFP, etc). in other words to see only those you can play on with your desired "total conversion" mod

glossy inlet
#

you can join servers by clicking a link on a webpage. Don't know exactly what you mean by replacing

vague shard
#

from what i understand you can load external website (within the steam browser?) (and certain restrictions) via https://community.bistudio.com/wiki/htmlLoad
so the idea is if you click the server browser button in the main menu, instead of the ingame browser, you will be forwarded to that external server browser

glossy inlet
#

yeah you can do that. Don't know if you can edit the existing button. But you could remove it and add your own

vague shard
#

thanks. ive done GUI mods like these already - its about existing server browsers and even more about the possibilities and limitations
like usually people ended up doing applications to reflect the customization and mod diversity arma offers, yet for the average player a simple solution but dedicated for the given TC mod should be enough

#

Ondrej/Suma even added some specific API code for Sickboy back in the late OA days to allow getting the specific mods from servers, let the game restart and supply all the relevant parameters to join the given server with necessary mods (+ par file). it was done by some bus type tech - cant remember the exact name anymore and dev heaven is down that had the details. anyway A3 team didnt care and didnt port the code..

keen owl
#

I am guessing the 1400 byte limitation is also why Bohemia's own launcher can't properly handle verify more than X mods when joining a server.

glossy inlet
#

^ both correct

vague shard
#

right. however you can query a server directly for the full set (this is what their external launcher does too).

#

so with caching and using ids instead of strings (or their very limited mod hash) they could have done a lot more

nocturne basin
#

@vague shard if it is a total conversion, you may still do it fully ingame by manually providing the actual servers list
intercept should have you covered and total conversion should have no prob. to use it

vague shard
#

using an extension may be another alternative indeed. depends on BE whitelisting in the end i would assume

nocturne basin
#

you even could push your own master server
though ... writing one is not that much of a trivial task (but not that difficult either)

glossy inlet
#

should also be easily doable using htmlLoad. But then you can't filter

vague shard
#

why should you not be able to?

glossy inlet
#

Because they are not interactive

#

I guess you can just load a new page with different parameters. And feed a filter by ingame UI text

vague shard
#

well the use case would be for a given TC mod. each TC can set their own link/url

#

a custom set of mods will get too complex already for public play essentially

toxic nest
#

when making a function in cpp, is it possible to make a variable have no value but retain the ability to be set inside the function?

#
double blah(blah variable) {
    variable = "blah";
};

?

glossy inlet
#

c++17

double blah(std::optional<blah>& variable) {
    variable = "blah";
};

If you need to be able to return the variable

#

do you need to return the variable? or do you only want it internally?
Usually people use pointers for optional parameters that are also used to return values

#

What are you trying to do?

toxic nest
#

(I obviously wouldn't use a double return on this) , just printing out the variable type based on input.

#

so, I didn't want a strict variable type for input, so I needed something like what you posted above

glossy inlet
#

You want a template?

#

or a variant maybe?

#

tell me what you are trying to do ^^

toxic nest
#

Quite most literally output the type of the variable to the console.

glossy inlet
#
template<typename T>
double blah(T variable) {
    const char* vartypename = typeid(variable).name();
};
#

Takes any possible type. And returns it's name

toxic nest
#

Aha, okay. That makes snese.

karmic niche
#
#define blah2(variable) (typeid(variable).name())

Sesesesese... 😈

dim phoenix
#

I've now officially seen more cases of obfuscation being used to hide that content was stolen than content protected with obfuscation by the actual author. Defend yourselves.

neon flax
#

Its hard to protect yourself from license violation if you provide open source code (i guess you refer to current "situation" in #arma3_scripting) .

dim phoenix
#

It was easy before people could obfuscate. Now it's easy, but you have to waste your time looking into depbo tools like Armake.

glossy inlet
#

ObfuSQF guys afaik said once that they make sure that such things don't happen

#

and here we have stolen code in a ObfuSQF pbo

normal wigeon
#

obfuscation is not encryption... if you are desperate enough to untangle it you can propably do it

glossy inlet
#

yeah. Already got work for the weekend

native kiln
#

@glossy inlet its not meant to help people that steal stuff to hide it, but like any service it can be misused

dapper pivot
#

It's far more useful for stealing than it is preventing theft.

#

But you also have to remember that part of the reason people want to obfuscate is so that other's can't learn from looking at their work, to stop other people becoming better at modding.

#

Hence why there's the odd viewpoint from a lot of people that you should never open a .PBO even if it's for only educational purposes.

fallen stone
#

It seems counter-intuitive to suggest that a large amount of people* would actively seek to stop people learning, more so just a side affect of an attempt to prevent theft

#

And to me it also seems more useful for stealing than preventing theft is contradictory in intended use. It is indeed the case people can hide what content they use (assuming stolen), but the core idea is to stop said person retrieving that code, however futile the ultimate fight is

#

It seems it would be very hard to monitor what is and what is not stolen, though

glossy inlet
#

Problem is. Previously people stole stuff. You DMCA'ed it. And it's gone.
Now they steal stuff. And as no one can look at it no one can proove that it's stolen and can't take action.

fallen stone
#

Perhaps the latter could be solved with communication with the creators of whatever tool it is?

#

Sucky two sides of the coin situation

glossy inlet
#

That'll be easier yeah. @native kiln help @hardy patio unpack that pbo. Then I don't have to waste so much weekend time on that.

hardy patio
#

while i appreciate the help, I cannot ask people to offer their free time. commy2 already helped quite a lot in restoring the debug tools ingame so I could take a look at the config and functions properly.

neon flax
#

It would be cool if there would exist such a tool that could compare AST trees of both original and stolen addon code to prove it was indeed stolen.

vague shard
toxic nest
#

Wicked, thanks!

glossy inlet
#

won't help you with obfuscated pbo's though. You need the script files first. And if you already have the script files. A plain comparison showing that original vs copy are equal is enough proof I'd say

smoky halo
#

@hardy patio gimme the pbo and I probably can give you the script files

smoky halo
hardy patio
#

thank you

thorn hawk
#

BattlNet never really worked for me/us as we require other languages πŸ˜‰

hallow rapids
#

nice, I'll check it out sometime

#

see if I can steal some stuff πŸ˜›

nocturne basin
#

anybody with c/c++ capabilities got too much time and wants to help in sqf-vm project? it still needs to have a ton of commands implemented to actually emulate SQF fully

lavish cypress
#

Any tool out there that will find where functions like "BIS_fnc_holdKey" is located?

orchid yew
#

the ingame functions viewer?

verbal oar
#

AIO configdump also works.

class CfgFunctions
{
    class A3_TacOps
    {
        tag = "BIS";
        class Systems
        {
            file = "\A3\Functions_F_Tacops\Systems";
            class holdKey
            {
            };
        };
    };
};
glossy inlet
#

Any tool out there that will find where functions like "BIS_fnc_holdKey" is located? Windows Explorer search on P drive

hexed gyro
#

BIS_fnc_holdKey You can use the notepad++ folder search for text inside your P:\ drive configs as well

scenic canopy
#

File is named fn_holdKey.sqf

neon flax
glossy inlet
#

yeah we all love crossposting don't we?

neon flax
#

πŸ‘πŸ½

#

absolutely.

elfin oxide
#

yep

smoky halo
#

Is this the best place to ask about the tool armamake/make.py? It's the release-build tool that was originally made by Taosenai, and is used in ACE, ALiVE, CBA, and I believe TFAR.

spiral forge
#

@smoky halo yep, shoot

glossy inlet
#

The version that ACE/CBA/TFAR use is mostly maintained/edited by the ACE guys.

smoky halo
#

It is unrelated to that, but someone approached me privately and solved the above issue, which was a corrupted file. Thanks for the replies.

pearl beacon
#

I mostly worked on make.py from ACE/CBA/ACRE/ACEX in the last 2 years

smoky halo
#

This is probably a really stupid question for you then, Jonpas, but is it possible to skip the check for external files? I'm not familiar with python and will probably break something if I fiddle with it myself.

It can be problematic when reskinning something from a separate mod, or using direct paths to Arma 3 assets.

(also, brilliant work on it overall. It is a huge timesaver, and virtually everyone I know uses it)

glossy inlet
#

that's Mikeros tool that you are using

#

TFAR's make.py is modified to pass a parameter to mikeros tools to disable that check

#

but you could also just use armake. That only shows these as warnings and doesn't completly abort

smoky halo
#

That's good to know, thank you. There are some other issues with Mikero's tools, particularly related to config class inheritance.

vague shard
nocturne basin
neon flax
#

Confluence also looks nice on mobile.

vague shard
#

are fbo (from ARGO) basically the same as ebo?

smoky halo
#

define basically ^^

#

I would assume they at least use a different key. I further assume some quirks of the encryption are also different. But they are generally the same as they simply encrypt the whole file

#

afair

#

I think I even extracted the key once

#

why you want to know @vague shard ?

vague shard
#

@smoky halo we have been considering to port their game modes to A3 (at least investigate if its doable)

smoky halo
#

I can check if it is ebo just with another key

smoky halo
#

seems to be different encryption algorithm

vague shard
#

alright ty

#

maybe we can bug BI to release the ARGO sources

smoky halo
#

would be the easiest route I guess

smoky halo
#

I think a few people have ported some assets already.

Does anyone have a good readup on CBA's XEH_ect functionality? I have a lot of basic, dumb questions, like 'How do I execute this script at the start of every mission'

keen owl
#

You can use either a Extended_PreInit_EventHandlers or a Extended_PostInit_EventHandlers. No idea what "ect" refers to.

smoky halo
#

post init, preinit, ect.
If you've got the time, Muzzle, do you have an example for if I wanted to run a script clientside when you join a missoin?

class Extended_PostInit_EventHandlers {
    //example
};
keen owl
#
class Extended_PostInit_EventHandlers {
    class My_post_init_event {
        clientInit = "call compile preprocessFileLineNumbers 'path\to\script.sqf'";
    };
};```
smoky halo
#

Thank you for both the example, and the link.

edit: Got it all going now, thank you. That was a huge help

runic vault
#

Has anyone ever had success with using BattleNET in an extension for Arma? I'm trying to make an extension to add bans to the bans.txt with custom reasons etc but am having trouble with having BattleNET connect to RCON for ban reloading after the bans.txt file is edited.

glossy inlet
#

How old is that thing? RCON port was moved fairly recently

#

Oh.. well. I guess just ask @hallow rapids if he's here anyway ^^

runic vault
#

I couldn't find any other solution for reloading the bans once the bans.txt was edited. I don't mind how it is done, just as long as I can reload the bans somehow

glossy inlet
#

where exactly is the problem?

runic vault
#

With the BattleEyeClient.Connect(), its returning BattlEyeConnectionResult.ConnectionFailed with the host being unreachable. Not sure why though, I'm using the correct connection details which I can verify works through an RCON tool

native kiln
#

I can confirm the library works

#

From where to where are you trying to connect from/to?

runic vault
#

I am trying to connect to the server that the extension is running on. @native kiln I know the library does work, just not sure if the fact I'm using it in an Arma 3 extension may be causing issues somehow

hallow rapids
#

hmmmmm what did I do?

#

using as an extension should work

#

try connecting to 127.0.0.1, 0.0.0.0, the LAN ip or the public IP

#

I think I had it working as an extension at some point anyway

#

can't remember

lethal lantern
#

Is anyone able to help me out in regards to referencing other dll's from an extension i made? essentially i just get a System.IO.FileNotFound Exception for the Dll im using which is aqquired from a nuget package.

hallow rapids
#

I seem to recall something like when you use the -ip param for arma3server.exe you can't use localhost anymore to connect to it

#

or something along those lines

#

why do we have 2 optixs?

#

that's confusing πŸ˜›

elfin oxide
#

Yes exacly I told @lethal lantern to rename himself to something else than @native kiln

#

XD

lethal lantern
#

Hehe

native kiln
#

@lethal lantern all DLLs that are not within the standard net runtime pack need to be put in the arma 3 root folder

hallow rapids
#

stop talking to yourself

native kiln
#

@lethal lantern no

lethal lantern
#

xD

hallow rapids
#

πŸ˜„

lethal lantern
#

System.IO.FileNotFoundException: Could not load file or assembly 'YoutubeExtractor is what i get returned.

native kiln
#

Put the DLL in the arma root folder

lethal lantern
#

Ill give that a try

#

Thanks, Ill let you guys know.

native kiln
#

Arma loads your main DLL with the working directory set to the arma root folder, so the .net platform will look there for referenced DLLs that are not included in .net itself

lethal lantern
#

Okay, makes sence

native kiln
#

Orrrr

#

You could load the DLLs manually

#

Damn why I have I never thought of this earlier

#

You can use the assembly loading in c# to load the libraries you need into memory yourself on startup, it's fairly easy as well, that allows you to put the DLLs in the same directory as your main DLL

lethal lantern
#

It works thanks πŸ˜ƒ

#

Wouldn't that cause performance issues tho for people with low memory ? ^^^

glossy inlet
#

no

#

any dll is loaded into memory. Doesn't matter which way

native kiln
#

plus you cant load the libraries twice anyway πŸ˜„

#

if two loaded assemblies have the same name and version, only one is kept in memory, the other one is dismissed

scenic canopy
#

@lethal lantern you can use ILMerge or Fody Costura to merge your dlls into one

lethal lantern
#

Fair enough, Ive used Fody Costura before didnt think to use it this time around, ima implement it now thanks guys πŸ˜ƒ

scenic canopy
#

πŸ‘

nocturne basin
#

just to mention it: sqf-vm can be used for extension development already, though ... only the in-dev build right now as the public release still is from the c version
snapshot release (32 & 64 bit) is available here: https://discord.gg/eP4QgTr
feel free to leave some feedback about usability etc. πŸ˜„

nocturne basin
#

............................................

#
debugger.cpp:4:29: fatal error: nlohmann\json.hpp: No such file or directory
 #include <nlohmann\json.hpp>```
glossy inlet
#

Wrong chat?

nocturne basin
#

anybody having an idea why this hell fails?

#

not really ...

glossy inlet
#

fatal error: nlohmann\json.hpp: No such file or directory

nocturne basin
#

yes

#

"/.../sqf-vm/json/include/"

#

located in here

glossy inlet
#

/ is root directory

nocturne basin
#

yes, relative also did not worked

glossy inlet
#

and what is ... supposed to be? did you mean .. ?

nocturne basin
#

... is just snipped out, contains rest of the path

glossy inlet
#

according to your github the file is in include/nlohmann/json.hpp not nlohmann/json.hpp

nocturne basin
#

"/.../sqf-vm/json/include/"

glossy inlet
#

why are you using \ in the include but / everywhere else?

nocturne basin
#

mhh?

#

ohh ...

#

that actually could be a problem ...

#

frking visual studio

glossy inlet
#

I know clang complains about that

nocturne basin
#

it is a debain i am building this on right now

#

so ... i highly expect this to also complain about that

#

not even noticed that tbh ..

glossy inlet
#

C99 standard:

If the characters ', \, ", //, or /* occur in the sequence between the < and > delimiters, the behavior is undefined. Similarly, if the characters ', \, //, or /* occur in the sequence between the " delimiters, the behavior is undefined.
nocturne basin
#

and yes, was exactly that

smoky halo
#

Is KZK’s dll for writing to external files the standard? My group is wanting to do β€œauto” attendance by writing to an external xml file.

glossy inlet
#

there isn't really a standard

#

but you can use that yes

smoky halo
#

He mentioned in the blog it had security issues but i really couldn’t find any alternatives. Thanks though, we’ll use that.

glossy inlet
#

well yeah. writing to arbitrary files is a security issue in general

#

which is why we don't have SQF commands to interact with files on disc

vague shard
#

kinda funny even the military allows this though (VBS) - they are said to have way stricter security in general

#

the internal exe from BI has it too from what i recall

smoky halo
#

Yeah, I mean its gotta write to the diag log. We can also read from files and dlls, but not write to any files, which is weird to me. But I also dont know much about security.

karmic niche
#

Basically, because BattlEye is sometimes bypassed by cheaters, so just assume that anyone can execute any SQF code (including calling your extension with any possible parameter) and write your extension accordingly

karmic niche
#

Namely: aggressive arg checking. Resolve the file path (to the real path) and check if it is inside a predefined directory. Make sure no one can "get out" by using .., using UNC paths, etc...

#

Do you even need to specify the file path yourself? Why not hardcode that path inside the extension?
Maybe the extension can decide where it is supposed to write to based on the date, for example.
That would be the safest way of doing it, since it would not have been "arbitrary" anymore. @smoky halo

nocturne basin
#

@vague shard just that the military is not playing arma on some public servers 🀷

normal wigeon
#

so thats what cyber war is going to be... foreign military hacking themself onto their enemies VBS servers and with their warcry "LOLOLOLO" start to spam dropping cars onto innocent people, scream in voicechat to ruin the OP and warp around in godmode and while pwning noobs?

karmic niche
#

I think you underestimate the advantages of hacking into ANY computer infrastructure owned by your enemy

dapper pivot
#

kju: VBS has per profile permissions to lock things down.

glossy inlet
#

https://github.com/Dahlgren/DokanPbo Because it seems like many people don't know about this I wanna draw a bit more attention to this. This allows you to create your full P-drive without unpacking any PBO's. Without wasting any disk space.
It will even include automatic debinarization of config.bin soon.

This tool allows you to bind pbo's as a Drive or Folder directly.

hallow rapids
#

ooohh that's cool

scenic canopy
#

πŸ™ƒ

native kiln
#

What mysterious man could have made such tool?

#

We will never know

vague shard
#

well its for your non source files, right? (ie A3\, CA\ and CUP\)

runic vault
#

Oh my bad, wrong channel, ill move it to scripting

glossy inlet
#

@vague shard correct.
Might be also nice to allow it to link real folders in there. so that you can also have a readable directory for your unpacked stuff. And some way to put buldozer into it πŸ€”

vague shard
#

alright nice. do you symlink/junction your sources in this "virtual virtual p drive"?

glossy inlet
#

It's a kernel driver thingy. When you try to read a file. The kernel driver calls a function in the program. Which then finds the appropriate pbo and reads the data from it directly.
So basically it's a link from a ordinary looking file, into a pbo

vague shard
#

is there some docu how to set it up? cant see a release on the github project
or how you set up your p drive with it?

karmic niche
#

Basically, it's the same thing as FUSE on linux, but on Windows πŸ˜ƒ

glossy inlet
#

Oh yeah. No releases yet.. Dahlgreen sent me his own build. And then I've just built it myself with Visual Studio.
First you install Dokan itself (The Kernel driver in the backend) https://github.com/dokan-dev/dokany/releases (DokanSetup.exe I think)
And then you just run the DokanPbo executable. With command line parameters. I can send you the latest build, built by me if you want

#

@karmic niche there is also a windows FUSE pbo thingy. But it's not as advanced as the Dokan one

karmic niche
#

Uhh... you sure? Every time I checked for "FUSE on windows", in the last 10 (maybe even 15) years, the results were always "Dokan is the FUSE for Windows"

glossy inlet
vague shard
#

i am interested to try it for our build server for example. i still dont get how the p drive is meant to set up fully

glossy inlet
#

I'll make a build with my two PR's https://github.com/Dahlgren/DokanPbo/pulls merged.
I still have some performance improvements on my list. Mainly improving read speeds. But speed right now is already way faster than I expected.. Especially after Dahlgreen told me "it's slower though" :D
A notepad++ findInFiles through all config.cpp (Automatically debinarized from config.bin in the backend) through the full virtual pdrive with all vanilla pbo's and about 40 more GB's of Mods that I load. Went as fast as I expected it from a real pdrive.

smoky halo
#

I also tested it when it was first mentioned here several months (a year?) ago. Did work pretty well. Just a little slow but sort of understandable

glossy inlet
#

Dahlgreen said it was very blue screeny back then. Didn't have any problems yet for that half a week I'm running it

#

https://s.sqf.ovh/DokanPbo.exe Here is the latest build @vague shard
It's a command line tool.
Basically
DokanPbo -f "<Armapath>\addons" "<Armapath>\Heli\addons" "<Armapath>\Expansion\addons" "<Armapath>\@CBA_A3\addons" -o P:
Basically after -f you just list all folders that contain pbo's that you want on your pdrive. And the -o at the end is the mount point. You can also mount into a existing folder like
-o C:\FolderForPdrive
It's takes a couple seconds for the mount to show up. And it's normal that the console window is just blank. Might add some logging back later but I disabled all logging for performance

vague shard
#

thank you!

#

does it break when an arma update updates the pbos or needs a restart or sth?

karmic niche
#

Wow, good question πŸ€”

vague shard
#

1.84 incoming, or so they say πŸ˜›

glossy inlet
#

Uh.. Interesting...

karmic niche
#

I never used Dokan but I'd guess that it is locking the files just as all other processes in Windows

glossy inlet
#

Never though about that. It will need a restart to detect new pbos. Unless you currently have a file open there won't be handles to the pbo meaning you should be able to edit the pbo's or steam should be able to update them. But without restart it won't detect missing/new files.

#

Currently the implementation is kinda bad. It grabs a new handle to the file when you want to read a chunk. And then throws the handle away again after you're done reading. So unless you are reading right now there shouldn't be open handles to the pbo's. But in my test a couple days ago I saw that it kept like 4 handles open for every RHSAFRF pbo.. But nothing else. Will have to investigate that

smoky halo
#

it would be possible to add an event that detects changes to pbo to handle those cases right? or is there a limitation with Dokan?

#

how robust is swiftPBO with obfuscated pbos and such things?

glossy inlet
#

obfuscated PBO's seem to work fine-ish. 3CB obfuscated pbo's displayed fine

#

If you try to open a fake file like a fake paa from a obfuscated pbo it will throw a "unable to read file" error.
And characters that cannot be displayed in explorer also aren't displayed. But what can be displayed from obfuscated pbo's will be displayed and accessible.
the automatic config debinarizer also works for them

smoky halo
#

could add me some ebo 😎

glossy inlet
#

Yeah had the same thought. I also have them in mine but of course can't share that

glossy inlet
#

Biggest minus currently is that the whole pdrive will be read only and contains only pbo contents. Meaning buldozer/mikero temp files are a problem. But I'm working on that

#

Can somebody help me a little. I need a list of all files from the Arma 3 directory that need to be on the pdrive for buldozer to work. And where they need to be too.
So arma3.exe and the dll's. Does arma3.exe need to be renamed to buldozer.exe?

scenic canopy
#

@smoky halo you could check if folder/files change and update the virtual FS

#

since the virtual FS doesn't really care about weird filenames etc it ignores many of the issues ntfs with default windows config would encounter

#

even if explorer might show it a bit weird

#

you can have a working pdrive, that's how we used it two years ago

#

you just filter out the a3 pbo prefix and mount it to p:\a3

#

and leave the rest of p: as usual

scenic canopy
#

so buldozer and mikero temp files work just fine

#

that one sorta sets up a valid p:

#

just adjust the _DOKANPBO path in the beginning

#

registry code stolen from @dawn palm πŸ™ƒ

#

we have another for ca directory too

neon flax
#

Nice bat. You could add this to Github wki as example usage so it is easier to find.

glossy inlet
#

I'm in progress of implementing all that the batch script does into DokanPbo directly. So probably not worth it ^^

neon flax
#

πŸ†

#

Retard friendly P: drive? I'm in.

smoky halo
#

would write access even be a good thing? feels very wrong to me

glossy inlet
#

It won't write to PBO's (yet.. Don't plan on implementing that though)
You will be able to specify a temp directory where written files are put into.

#

And you won't be able to create files inside pbo's prefix paths.
But you can for example create a temp directory in p-drive root directory. Which Mikero needs

vague shard
#

Not sure if i understand your above explanations fully correct - you can add source folders to it?
In regards to "read only" i guess one can just have a separate virtual drive for binarization itself, however usually it would be also convient if you had a mix of immutable "pbo folders" yet your source folders with write access.

glossy inlet
#

That's not that easy.. Having folders in the root directory of your p-drive be writeable is easy.
But the directories generated from the PBO prefix are just fake folders. They don't really exist and can't be written to. Interleaving your z folder for example with writeable and non writeable directories will not be that easy. Is technically possible though

smoky halo
#

personally I would only provide the arma pbo stuff with Dokan and link it to the P drive, however that may be realized

glossy inlet
#

How about a command parameter to add symlinks/junctions manually?
Like
--symlink "z\ace" "C:\devfolder\ace" So that you will then end up with P:\z not being writeable. But P:\z\ace will just act like a symlink to your ace folder which you can write into.
Dokan would then have to throw an error though if a pbo you are loading is already trying to create that folder as part of it's prefix.
Would that work?

#

Problem for the other approach of having a normal p drive and just links to the pbo's as directories inside it is that we then need a seperate mount for each folder. And then you still couldn't put files into the z folder at all because the mounts would be readonly.

smoky halo
#

mhh

#

i c

#

then only link files not folders ^^

glossy inlet
#

I think creating a writeable folder inside a readonly path should work.
And if the root directory is also writeable you can create folders/files there all you want.
And you can then create writeable folders inside a readonly path. But not if there is already a readonly folder with the same name. Which makes sense I'd say

scenic canopy
#

I'm not very into making it writeable

#

since its mainly meant to setup the arma files required for P:

#

and having it writeable means fucking up files πŸ™ƒ

#

@smoky halo that's how we used it, linking required arma pbos

smoky halo
#

πŸ‘Œ

scenic canopy
#

personally I don't think it makes sense to use the entire P: as a workdrive

#

we just have a setup_drive.bat that maps our root svn as workdrive

#

and then setup_arma.bat that creates virtual a3 directory etc

#

so arma has no connection to the p:

#

just creates some virtual directories where needed

#

it p: was a temp drive

#

and files were lost when it's unmounted

#

that would confuse people

#

if your computer BSODs and all files are lost, that's baaaad

#

@vague shard exactly, we use the dokanpbo for immutable a3 data for pboproject

glossy inlet
#

I'd also prefer it not to be like that. I only want to make it writeable because Mikero wants to write files to it.
and files were lost when it's unmounted won't. They'll be saved into a directory that you can provide as start parameter. If you don't provide that parameter then they will be deleted on unmount though.

Alternative would be to let people create their P-drive on their own. And then just let DokanPbo link all directories to the pbos. But then people still can't place editable directories inside a prefix path. Which they want to do for stuff like z prefix that's used alot. And also they will still need tools to create their p-drive.

I'd prefer to have DokanPbo be able to do everything in just one package. You run it. And your P-drive is ready and you can work.

vague shard
#

can you symlink folders from that Dokan space to the outside world?
ie it would be z: and you link its root folders (a3, ca, etc) to p: and here mix it with your writable source folders

karmic niche
#

I'd suggest keeping it simple (read-only with no additional fireworks) and using something like UnionFS (someone probably wrote something like that) to create files in a temp directory @glossy inlet

#

Like, two Dokan FS-es overlaid on top of each other

glossy inlet
#

Yeah. You can create symlinks to folders inside dokan.
Already got linking outside files into dokan ready. Now just directories and everything will be ready

#

Ah yes @vague shard one could do that too.

vague shard
#

i am asking for the other way round yes

karmic niche
#

That way you can focus on making sure PBOs are handled right and you leave the rest to other FS authors πŸ˜ƒ

vague shard
#

then temp folder would no longer be a problem if I understand this correctly

glossy inlet
#

correct. But you can already do that by running multiple DokanPbo instances. Dokan can Mount a folder too. Doesn't have to be a drive. That's what Dahlgreen is already doing.

#

But it'll be alot easier to use for people if they don't have to also learn how to create additional drives and how to manually symlink stuff.
My vision is just. Run DokanPbo and your pdrive appears with buldozer setup and all your writeable files being writeable.

only thing that's missing then is Arma3P's fixes to some files inside some pbo's. But I can handle that too

The readonly variant is already working just fine right now. Just adding more options to it

scenic canopy
#

@vague shard yes, it works like any FS

vague shard
#

ty

scenic canopy
#

the way the project is structured it is also possible to create other cli interfaces

dusky dune
#

so i'm a noob with this, would I be able to use os.path.isfile with python on this?

scenic canopy
#

so the FS implementation is reusable across different tools if needed

#

@dusky dune sure, it's just a folder/drive like any other

dusky dune
#

nice, i might look into using that then. Now i just need a super basic .p3d reader that can check for memory points..... πŸ˜„

glossy inlet
#

No tools will see the difference between a read-only p-drive of unpacked pbo's.
Or the Dokan virtual p-drive.
Only difference right now is the readonly

scenic canopy
#

but yes, like @glossy inlet says, the idea is that it should be able to populate your P: drive with requires files and folders with any thinking

dusky dune
#

then i can do landSlopeContact detection in my mod without needing to prebuild files

scenic canopy
#

like looking up arma 3 directory from registry

#

without the need of those bat files I posted before

karmic niche
#

@dusky dune it's not really suitable for use in mods

dusky dune
#

why not? ;_;

glossy inlet
#

It needs the Dokan library installed to work. Which requires Admin rights to install because it's a kernel driver

dusky dune
#

makes sense

karmic niche
#

Because everyone using it would have to set everything manually

#

And what Dedmen said. And not everyone with Admin rights feels confident installing kernel drivers

scenic canopy
#

as they shouldn't πŸ˜„

karmic niche
#

Don't you trust me and my kernel drivers? πŸ˜‡

scenic canopy
#

so to be clear, I'm not saying I don't want write support

#

but my priority when I made it was immutable mounting arma pbo files for work drive

glossy inlet
#

Aaaand linking real directories into the virtual drive is also done. Everything to automatically put buldozer onto pdrive is done.
Now I just need to implement the WriteFile functions.

Don't care if you want it or not. It's almost done so you're getting it.

karmic niche
#

Write support would be tricky to implement because you'd have to shift al the data in the whole PBO if you're appending data somewhere

glossy inlet
#

Nope. Not writing to PBO. Just writing to temp dir

scenic canopy
#

@karmic niche easiest is to append data and rewrite pointers, and then reoptimize the pbo when needed

glossy inlet
#

I don't want to do write to PBO. Unless someone can convince me it's needed

karmic niche
#

Are there offsets in PBOs? (so that you can have empty spaces) I don't remember. I seem to remember the files' data was just concatenated

scenic canopy
#

yes

#

each file in the pbo has a pointer to where the buffer should start

#

but most tools would of course just write all files directly after each other

#

since having gaps with useless data is not very efficient

karmic niche
#

I think I'm gonna have to disagree πŸ˜ƒ

glossy inlet
#

And I don't really see much use in that. Atleast I can't think of a real usecase. If you want these pbo's to load them into Arma for testing. Just use -filePatching

karmic niche
#

You can compute the offsets by counting the size of previous files in the headers but that's all

glossy inlet
#

@karmic niche could reorder the files in the header and insert a empty dummyfile into the old empty space

karmic niche
#

You can't make an arbitrary pointer pointing to 34GB

glossy inlet
#

Like. If the file is not at the end of the header. Replace it by a placeholder file with the same size. Then re-add the edited file at the end of the header and write it's data onto the end of the pbo.
No offsets/pointers means we have to do that for shrinking files too.. Unless we insert placeholder files into the middle of the header.. which would also be possible. In all cases we have to move the first file in the pbo out of the way to make space for the growing header and also rewrite the part of the header after where we inserted stuff

#

In the end it's kinda the same thing.. Just more complex. But same end result

karmic niche
#

Or do something that just appends to the end of the file, whatever you do. And every 100 appends (or after the file reaches a given size) run the "optimizer" that will pack the PBO file again, removing all the placeholders.
That's the lazy way of implementing the functionality πŸ˜„

scenic canopy
#

skies the limit!

glossy inlet
#

I need to find a solution for the 0 bytes free on the virtual drive. When I remove write protection again windows will pop up "little free space on drive" warnings. So I have to display something non 0 there.
.. Wait.. Duh I just answered myself. Free space is the amount of space free in the Directory where writeable files are stored.. Or does anyone have a better idea?

karmic niche
#

That or a hardcoded 100GB

#

But your solution would be the best

glossy inlet
#

I wonder what windows does if I have more space free than the disk has space at all...

#

100GB free on a 60GB disk πŸ€”

karmic niche
#

My guess is that it does nothing

#

Chinese were selling those 8GB pendrives as 64GB or even 128GB (who is so stupid to believe them?) for a long time

#

You'll just get a write-error when trying to write to the disk that is full

glossy inlet
scenic canopy
#

@glossy inlet Free space on disk

#

Apple fucked up on that one

glossy inlet
#

Windows is funny. I return AccessDenied from CreateFile. So when it tries to delete a file it can't. What does windows do? Show the "Delete File" progress dialog as successfully completed. And hides the file in the explorer. When I refresh the file is back where it was πŸ€”
Even when CreateFile returns Success it does that. And never actually calls DeleteFile..
Oh wow..
When windows tries to delete a file. It calls CreateFile with the Delete access flag.

vague shard
#

haha

scenic canopy
#

πŸ˜„

karmic niche
#

Yup, that's exactly what filemon was showing when you left it running and did some stuff, like deleting files πŸ˜ƒ

native kiln
#

I'm not really in that whole driver thing but how does a driver get to override the implementation of something like CreateFile?

glossy inlet
#

File system driver

#

Just like any other filesystem driver

native kiln
#

What happens if there are multiple drivers, is there like a priority list in which they are called and each driver gets to decide whether to do something or just pass the request onto the next driver?

#

That's all magic to me spinthink

glossy inlet
#

Yes. That's minifilter though that's something different. This is just a driver for a custom filesystem. There can't be two drivers for the same filesystem I'd say

native kiln
#

Oh right.. that drive "PboFS" has one specific driver

#

Missed that

glossy inlet
#

Not sure how it's implemented in the backend of Dokan.. I think Dokan is the only driver. But then checks which application belongs to that Mount and should get the messages and stuff

native kiln
#

I tell you, that whole Driver topic and what's possible with it is just pure magic to me.

#

So is the whole ArmA toolset going to be on that "virtual" drive with a custom driver and then that filesystems custom driver is going to redirect file requests directly to the games pbos possibly on a different drive? Or do the pbos still have to be on the same drive?

#

Sorry for the questions, just trying to get an image in my head 😬

neon flax
#

AFAIK PBOs can be anywhere, when you are browsing the virtual drive the underlying driver streams the content in the background.

glossy inlet
#

Dokan is a SDK. You write a C# application and get functions like ReadFile/CreateFile and so on. For all the file operations.

#

And then in the ReadFile function you just fill the buffer with whatever you want. In this case with the file from the pbo.
The pbo is just read via normal C# File IO Code

native kiln
#

That's pretty cool I must admit

#

Thumbs up from me for that project πŸ‘

glossy inlet
#

That project is already 2 or so years old πŸ˜„ I'm just improving it a "little"

native kiln
#

I probably never saw it because I'm not a mod creator :S

scenic canopy
#

@native kiln each drive or folder (or file?) can have it's own FS

#

just like on linux

#

so each mount path can have a different FS

#

and FS can be nested

native kiln
#

Each folder? oO

scenic canopy
#

on Unix everything is a file (even folders)

#

on Windows you can mount your harddrive as a drive (like C:) or a folder (like C:\lolz)

#

and on Unix /disk1 -> one drive and /disk1/disk2 -> another drive

#

everything is mounted somewhere on root (/)

native kiln
#

Not that I doubt it, just have never seen that being used before on windows, gotta try that out on windows

scenic canopy
#

Dokany is a kernel space FS implementation which interacts with a user space SDK

#

makes it easier to develop

#

and a lot safer

native kiln
#

Oh I can imagine it not being a good idea making everyone make a driver πŸ˜…

scenic canopy
#

well, performance takes a hit going between kernel and user space

native kiln
#

But I mean for something like this it sounds like a very good option doesn't it ?

scenic canopy
#

I probably spent as much time on SFP CI as on actually doing SFP mod content πŸ™ƒ

neon flax
#

I can sacrifice a bit of performance for less bluescreens xD

scenic canopy
#

we have our own Gradle DSL for building arma mods

neon flax
#

Good CI pipeline takes a lot of time.

#

And if you are developing the tools by yourself...

scenic canopy
#

and a WIP DSL for arma autotests

native kiln
#

Meanwhile on my pc, pure anarchy

scenic canopy
#

I'm just glad GPU VM's are cheapish now πŸ˜„

neon flax
#

Meanwhile I'm barely able to use docker for CI :D

scenic canopy
#

since we switched from steamcmd to steamworks sdk to fetch our current dev builds from steam workshop the tests are a lot more stable too

neon flax
#

Can you upload stuff with Steamworks SDK?

#

I would be happy if Liberation releases could be fully automated.

pearl beacon
#

@scenic canopy running VFIO setup?

scenic canopy
#

@pearl beacon we did in the past, waiting for next gen nvidia to get a spare 1070 for a new VM host. Currently we use https://www.paperspace.com/

#

with legacy pricing at $5/month for a GPU VM

pearl beacon
#

ah, I meant at home πŸ˜„

scenic canopy
#

I did before but not right now

pearl beacon
#

didn't exactly read what you were talking about, my bad

#

ah

scenic canopy
#

the CI server (jenkins) allows us to schedule the autotests on any machine so I can just run them on my desktop if I feel like 🀷

#

the paperspace VM is good enough for just crunching all our models at least

#

and some basic island tests

#

haven't expanded with combat scenarios etc yet

scenic canopy
#

@neon flax I would guess so, the upload functions are exposed in the sdk and my guess is that's what the publisher tool uses

#

we use the cmd version of the publisher tool for uploading from CI server and then steamworks sdk for downloading on GPU slaves

#

my only annoyance with the publisher tool is that it includes .svn folders so we have to hide those first πŸ˜„

fast yew
#

Hello all, would this be the placve to get some help setting up Mikero tools?

#

I have an error message I don't get.

neon flax
#

Ideally I would like to run it all on free travis but it seems that this could be hard to achieve.

scenic canopy
#

@neon flax if you want to check references to arma files, kinda

#

It would be possible to generate empty dummy files based on a list of all arma files perhaps?

#

@fast yew sure

fast yew
#

to do with eden?

#

"E" is an external drive - would that be an issue?

scenic canopy
#

Mikero mentioned this

#

Uhm

fast yew
#

Oh hey you're the author πŸ˜› cool!

scenic canopy
#

No, just fixed some missing things πŸ˜›

fast yew
#

Thanks for helping the community.

scenic canopy
#

Your user probably lacks write permissions to root of e:?

#

Is that your project work dir?

fast yew
#

No I set up on C drive - "P" drive points to that.

#

My other internal drive is too full to start a working folder for mods so I selected my external.

#

I ran it as administrator.

scenic canopy
#

You should use P: then

#

Arma3P is supposed to target your project drive

#

Otherwise pboproject wont work

fast yew
#

errrr, shit must of got the wrong idea - I'll give it a go now.

#

Well bugger me drunk - it's working.

#

Thanks very much πŸ˜„

#

Man if I am having trouble now, wonder how setting up a mod will go lols. Cheers@scenic canopy

neon flax
#

I see they have a lot of rest endpoints but workshop uploading is available through cpp only. Any idea what protocol they use there?

scenic canopy
#

Steamworks sdk is a C++ library, not a rest API

#

You’re thinking of steam web api

neon flax
#

Maybe I could just do the uploading in cpp but I have not used it for years :/

scenic canopy
#

It would require steam to be running with an arma 3 account too

neon flax
#

Oh it needs a running game. So dedicated server is the way to go.

glossy inlet
glossy inlet
#

We talked about PBO format and stuff. Ala pbo doesn't have file offsets. They actually do.
https://community.bistudio.com/wiki/PBO_File_Format#PBO_Header_Entry Header entries Reserved there is actually an offset. But I think that's just an additional "File should start here. But instead it starts X bytes further in the pbo" not a total offset. More like a "There is empty room before the file" although that doesn't make much sense I guess.
When a file inside a pbo is read it takes that offset from the "Reserved" entry. And add's that onto the offset inside the file that's trying to be read.

Oh.. nvm.. That entry is read. And the variable that's read into is also used like I described. But it's overwritten right after it's read from the pbofile. And it stores the total offset from pbo start where that file starts.
Exactly like you said PBO doesn't have it @karmic niche. It has it. But only internally and we cannot really access it :/ And that value is inside the pbo file format itself because... Don't actually know. Maybe it was used in the past and BI noticed why it's a bad idea.
Would've been nice tho

nocturne basin
#

what exactly is the problem?

glossy inlet
#

Huh?

#

None

nocturne basin
#

mkay

#

🀷

scenic canopy
#

πŸ™‰

vague shard
#

armake 0.6 release has

Use BI's binarize.exe on Windows

does anyone know why?

scenic canopy
#

It’s not fully functional yet

#

And a couple of bugs

glossy inlet
#

There are problems with paa conversion, And some model LOD's I think. Not sure if the Shadow LOD issues have been fixed.
Also if you try to pack a SuperExt rvmat with a model with armake's native binarize your game will crash when placing the model πŸ˜„
Such minor things is why it defaults to using the known working binarize

vague shard
#

thanks

glossy inlet
#

Oh and also it doesn't support all Shaders. But I made a PR for that. But something is still wrong in the rvmat binarization. Which is why the crashing I mentioned.

glossy inlet
#

DokanPbo drive is now working. Just got a full ACE build running on it. 30GB disk space saved. Or 62,5GB including the mods that I also have on my DokanPbo drive :3
And buldozer with a model made of proxies on the virtual pdrive
https://s.sqf.ovh/arma3_2018-07-21_19-52-08.png
All fine and dandy
There seem to be some performance problems when building big projects like ACE. Looking into it.
No #arma3_terrain stuff tested on it at all so far. But I don't expect big problems
config.cpp files are displayed on the virtual drive but they don't really exist. They are debinarized on the fly using CfgConvert and then cached till you close DokanPbo again.

vague shard
#

sweet πŸ˜ƒ will give it a try tomorrow - did you publish a new build/uploaded latest to github?

glossy inlet
#

nope. I guess @scenic canopy will do after he merged the PR's

scenic canopy
#

performance problems and BSODs was why we didn't pursue using it 2 years ago

#

but perhaps Dokany is more stable now

pearl beacon
#

using it for 2 days now and reporting problems to dedmen, so far no issues with BSODs

#

or any other for that matter that we couldn't fix

scenic canopy
#

the time spent explaining how p drive and arma3p works to others... 😦

vague shard
#

@scenic canopy stay strong πŸ™

native kiln
#

@scenic canopy that's the reason I never got into modding :P

cinder meteor
#

I'm not really sure where to ask about the arma's default AddonBuilder
How do I make it convert my whole folder with all files in it into a .pbo through the CLI? I tried to use wildcards with the -include command like -include=D:\myfolder\*.* but it gives an error.

nocturne basin
#

will build your pbo, put those into your game folder and, if setted up for it, place a copy inside a separate folder of your choice

#

compiles the whole -addon directory

#

but most essentially, it should tell you how you can actually do what you want

cinder meteor
#

Looks complicated but I'll look into that, thanks!

toxic nest
#

Are general cpp questions unrelated to arma okay in this channel?

glossy inlet
#

ye

#

Atleast has been done in the past ^^

toxic nest
#

Okay, fair. I am a bit confused on how global variables would work in the sense that I can set and read them from anywhere. From my understanding header files are where you want to put things that piece together your actions like your function definitions. Would I be declaring them in the header file?

#

and from there including them into cpp file?

glossy inlet
#

I think C++17 has nicer stuff though. With inline variables

karmic niche
#

AFAIR you should declare them as extern in headers and then define (assign value) in ONE cpp file. Other cpp files can then include the header just fine

#

Ugh. Dedmen beat me to it

toxic nest
#

LOL. Thank you both, this is a very clean looking solution compared to what I thought it would be lol.

karmic niche
#

Just remember to use the extern keyword in the header, otherwise the compiler will try to actually create that variable in each file that includes the header (and will fail)

glossy inlet
#

in c++17 it's just inline static int Varname = defaultValue in the header. Nothing in the cpp file. Then you can use Varname from anywhere
Not sure if the static is needed there. Probably not

karmic niche
#

Damn, I really need to find myself a C++ pet project so that I can finally write some of that C++17; it really seems like a big improvement over my... uhh... C++11 (or rather: C++somethingaround07 πŸ˜„ )

glossy inlet
#

Intercept cough cough

toxic nest
#

Okay. Seems pretty straightforward. Thanks for the note on that stack. How can I tell which version of c++ my compiler is going to be compiling for? I am just using VS Community IDE. Also, isn't static a flag for not writable after declaration?

karmic niche
#

Did you say something? πŸ™„

glossy inlet
#

VS community is default C++17 I think?

#

Should be. otherwise... (Screenshot incoming)

toxic nest
#

I can't grab a screen right now, but I would imagine this is the case.

glossy inlet
toxic nest
#

Oh, there we go. Okay, I'll have a look here soon.

karmic niche
#

Static previously meant that:

  1. A static function isn't visible outside its scope (file where it was created) - the compiler won't link it
  2. A static variable declared in a function will retain its value between the function calls

Not sure if something hasn't changed in the last 10 years, though πŸ˜„

toxic nest
#

Lol. Fair enough.

wind coral
#

You all mind having a look over this? See what needs improving? Maybe some way to streamline things a bit more? https://github.com/MidnightGH/Text-Adventure , it's barebones right now. But it's best I get these things out of the way before I go farther down the rabbit hole

nocturne basin
#

Uhm... What is that @wind coral

toxic nest
#

@nocturne basin It's entirely unrelated to Arma, but it's what I am trying to get myself conditioned with c++, it's a text adventure. I acidentally uploaded the linker and build logs. Woops

meager falcon
#

@wind coral some things for you to look up:
1.) memory handling: references will definetly help you
2.) lookup the c++ code style of google to get an idea what the conventions are like

#

maybe also have a look through the c++ standard libraries, the pure c stuff in there (like rand() ) is kinda outdated

#

also.. try to avoid global variables (as far as possible)

#

this will also save you most of the "extern" stuff

glossy inlet
#

commented all of that already. besides the extern stuff. IT doesn't need to be extern at all. It's only used in that one file so it might aswell just be defined in the cpp file.
Also what you are writing there is not really c++. The ++ stands for classes. You are not using them at all.

fallen stone
#

The ++ stands for classes
Did you just make that up πŸ˜› ?

glossy inlet
#

C++ comes from C with Classes

#

so.. yeah kinda

fallen stone
#

Using C++ as C with classes is a style avoiding the huge bulk that C++ introduces. I think the ++ is usually seen to mean as it does literally, an increment or next iteration on C

toxic nest
#

I am just now learning stuff, gotta make mistakes to learn. 🀷 . Thx for the comments on git ded, I will look them over soon.

glossy inlet
#

I'd say. If you only have one player. Make it a class. And learn how the "singleton pattern" works in c++

toxic nest
#

Oh, yes I see what you mean. I had stumbled upon that earlier and was experimenting, but couldn't seem to peice things together. Will have another look.

#

The point of having the global vars like playerHealth was to use it across files for reference, the time being it's not used in many places.

glossy inlet
#

With a singleton with a static getInstance method you can do the same. But you don't need extern anywhere.

scenic canopy
#

dependency injection!

karmic niche
native kiln
#

dependency injection ew

hardy patio
#

dependency injection is pretty nifty, but hard to wrap your head around it at first.

forest trellis
scenic canopy
#

πŸŽ‰

nocturne basin
#

getting old projects done feels great

#

just in case somebody gets bored and wants to have some fun with generating parsers in C, got some new solution for you :D
https://github.com/X39/XCG finally got it done and now can progress with further, funny things

pliant lynx
#

congrats

#

did you eventually learn C yourself as I saw you recruiting several times?

nocturne basin
#

i did, but that was years ago

#

but i recently started picking it up again

#

right now also no longer recruiting for c but rather c++ (custom sqf implementation)

tough tapir
vague shard
#

@tough tapir nice one πŸ˜ƒ what about one for mikero tools (pboproject/makepbo/etc)?

native kiln
#

@tough tapir very cool idea πŸ‘

knotty belfry
#

hi

#

i have a strange problem with rvextensionargs

#

interface

#

i dont know if it comes from my code or arma

#

at the first execution, the content of argc variable is not the number of parameters

#

for the next execution, it works as expected

#

does somebody encouter the same thing ?

vague shard
#

@knotty belfry pastebin your code please and share the link here please

knotty belfry
#
func RVExtensionArgs(output *C.char, outputsize C.size_t, input *C.char, argv **C.char, argc C.int) {
    var offset = unsafe.Sizeof(uintptr(0))
    var out []string
    limit := *(*int)(unsafe.Pointer(&argc))
    if limit < 1000 {
        for index := 0; index < limit; index++ {

            out = append(out, C.GoString(*argv))
            argv = (**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(argv)) + offset))
        }
    }

    temp := fmt.Sprintf("Hello %s %d %s!", C.GoString(input), limit,  out)

    // Return a result to Arma

    result := C.CString(temp)
    defer C.free(unsafe.Pointer(result))
    var size = C.strlen(result) + 1
    if size > outputsize {
        size = outputsize
    }
    C.memmove(unsafe.Pointer(output), unsafe.Pointer(result), size)
}
#

value of argc is over 800000 first time execution

#

after this it s 2

#

cause i have tow parameters

#

i only put a if limit against the segfault

elfin oxide
#

What language are we looking at here lol

#

I can ensure you that the engine calls RVExtensionArgs with the correct params every time

knotty belfry
#

it's C && Go

elfin oxide
#

Ok wont start a discussion on your choice there, lets focus on the issue

#

is this beeing compiled to native c code in the end?

knotty belfry
#

nope

elfin oxide
#

ok what kind of dll do you get then there

knotty belfry
#

in fact, certainly cause it creates a dll

elfin oxide
#

or do you do it for linux?

knotty belfry
#

or .so

elfin oxide
#

can you send me a compiled .dll there please?

knotty belfry
#

yes

elfin oxide
#

also unsafe.Pointer(&argc) sounds very fishy to me. Can you ensure the game does not send another callextension while you are still processing something ?

#

does the dll block?

#

aka singlethread?

knotty belfry
#

yes i call it one time

#

the sqf code is only

#
_result = "armago" callExtension ["John", ["yeahh", "test"]];
hint format ["Resultat: %1", _result];
elfin oxide
#

allright

knotty belfry
#

if i well understand unsafe.Pointer should cast the int variable into int golang variable

elfin oxide
#

actually

#

or this

#

I was just checking that the game does not override the memory while you read it

#

it should be fine

#

if its always just the first time and then it works it must have something to do with the variable initialization of those which persist even after the call

#

so any global vars

#

and you said over 800000

#

seems like its at INT.MAX_VALUE maybe

#

which could be the behavior of a int cast from currupt memory, or using the wrong int types (32bit/64) etc

#

i dont know go, i can only give some hits from the c++ perspective there

knotty belfry
#

mmm

#

normaly it should be correct

#

i use

#

2 type

#

i tried

#

with C.int and C.size_t

#

and i had the same results

glossy inlet
#

what value are you getting in hex?

#

does the same code as c++ code work? Or does it have the same problem

knotty belfry
#

i will try to retrieve the value

#

and for c++ i dont know

#

value is 824633720834

#

if i restart the same mission

#

the value is 2

#

Resultat: ["Hello John 2 [""yeahh"" ""test""]!",0,0]

#

first execution 824633720834 with empty array

#

and then

#

when i test the dll with KK callextension soft

#

it seems to work normaly

#

print ["Hello John 2 [""yeahh"" ""test""]!",0,0]

#

nope

#

it do shit also

#

:X

#

mmm so strange

fallen stone
#

Is there a reason why you are treating argc as a pointer value?

#

Or atleast, sorry, creating a reference just to deref?

knotty belfry
#

in fact i use the a command from manual

fallen stone
#

hm?

knotty belfry
#
func Float64bits(f float64) uint64 {
    return *(*uint64)(unsafe.Pointer(&f))
}
#

Provided that T2 is no larger than T1 and that the two share an equivalent memory layout, this conversion allows reinterpreting data of one type as data of another type. An example is the implementation of math.Float64bits:

#

normaly it should return a uint64 not a pointer

#

so now at least i know it s from my code

#

cause it s reproductable with kk soft

#

first time exec fail each time

elfin oxide
#

so it must be something related to creating the number from memory

#

and it happens only when doing it the first time

#

(maybe GO and switch to c++ or c# or something)

knotty belfry
#

i will ask to gonuts list

#

it s a bit tricky the type convertion between langages

elfin oxide
#

normally its not an issue. As the operating system declares what the int type is

#

LSB or MSG first

#

32 vs 64 bit

#

other langs such as pascal, C/c++ and c# handle it well

#

so it must be related to go there

knotty belfry
#

related to me : ))

#

i do some nasty things

#

but dont know where

fallen stone
#

It is definitely in your cast @knotty belfry

#

argc is 2 on the first call

knotty belfry
#

:X

#

how did you check it %?

fallen stone
#

I wrote its value as a C.int to stdout

knotty belfry
#

so strange

#

if you use C.size_t

#

instead of C.int

fallen stone
#

My suggestion would be to replace limit with argc

#

And then do something like this:

#
for index := C.int(0); index < argc; index++ {
#

Then you eliminate any possible issue with conversion, where there isn't much need to begin with

knotty belfry
#

yes it seems to works

fallen stone
#

πŸ‘

knotty belfry
#

thanks you

#

more simple & efficient

#

more clever

vague shard
#

To share more light on the latter, Senior Producer Julien Vida explains its purpose: 
"Some community terrain makers who work with large terrains and very high object counts (millions) were experiencing the limitation of the 32-bit Binarize. With the new 64-bit Binarize, we can push the limits in terms of available memory a bit further. This version has not become the default one, and some tweaks to the packing tools might be required to make it work. With Addon Builder, you simply need to point the Binarize.exe path to the 64-bit executable of Binarize from the options (Tools tab)."```
#

anyone checked what samples are in?

#

aslo the x64 binarze had some problems, didnt it?

narrow bough
#

in a3 samples there was a physx.hpp update in Test_Car_01

upbeat vine
pliant lynx
#

good stuff, thanks.

scenic canopy
#

Nice!

vague shard
#

looks nicely done. thanks for sharing!

upbeat vine
#

Thanks guys !

nocturne basin
#

mhh ... just one more problem to solve for sqf-vm being capable of pretty-printing stuff πŸ€”

#

or stupidity 🀦

#
player spawn {
    while {
        true;
    } do {
        waitUntil {
            sleep 3;
            alive _this;
        };
        _this setVariable ["defcamo", _this getUnitTrait "camouflageCoef", true];
        while {
            alive _this;
        } do {
            if (stance _this == "PRONE") then {
                _surfaceType = (surfaceType getPosATL _this) select [1];
                _grassCover = getNumber (configfile >> "CfgSurfaces" >> _surfaceType >> "grassCover");
                _newCamo = 1 max 500 * _grassCover;
                _this setUnitTrait ["camouflageCoef", _newCamo];
            } else {
                _this setUnitTrait ["camouflageCoef", _this getVariable "defcamo"];
            };
            sleep 1;
        };
    };
};```
output of sqf-vm pretty-printing random code from the [#arma3_scripting](/guild/105462288051380224/channel/105462984087728128/) channel all put in a single line
orchid shadow
#

what in gods name is that

scenic canopy
#

sleepy sleepy

nocturne basin
#

@orchid shadow the code? no idea actually .. not even looked into it 🀷

#

but it got transformed to the above

#

source looked like this:

player spawn { while { true } do { waitUntil { sleep 3; alive _this }; _this setVariable ["defcamo", _this getUnitTrait "camouflageCoef", true]; while { alive _this } do { if (stance _this=="PRONE") then { _surfaceType=(surfaceType getPosATL _this) select [1]; _grassCover=getNumber(configfile >> "CfgSurfaces" >> _surfaceType >> "grassCover"); _newCamo=1 max 500 * _grassCover; _this setUnitTrait ["camouflageCoef", _newCamo]; } else { _this setUnitTrait ["camouflageCoef", _this getVariable "defcamo"]; }; sleep 1; }; };};```
#

and yes
that is a single line

orchid shadow
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

nocturne basin
#

🀷 my pretty print at least works

#

though .... a single while { true } should not really be transfered into that monster with 3 lines

#

but anyways
sqfvm now can pretty-print sqf code

#

using .\sqfvm-cpp.exe --pretty-print file.sqf -anN and a non-public release

vague shard
#

@nocturne basin did you code the code beauifier yourself or do you use some lib?

nocturne basin
#

part of sqf-vm @vague shard

scenic canopy
#

was the private part added after the first dump?

#

since those local variables have no private declaration

vague shard
#

n1. you may want to offers this as cmd line util to update local files

scenic canopy
#

but it looks really nice, I'd look into using that to clean up some of our older arma 1/2/cwc sqf files which no one wants to touch πŸ™ƒ

vague shard
#

ive used Uncrustify and c template i think. had to fix some stuff with regex afterwards

nocturne basin
#

private? there is no private stuff

#

at least in that thing

#

arma 2 code could get problematic at least with sqf-vm

#

as there is no compatibility for arma 2s commands

#

also, a lot of newer commands are not supported either (this is a virtual machine in the end πŸ™ˆ πŸ˜„ )

scenic canopy
#

I was thinking about the ASSIGNMENTLOCAL switch case

nocturne basin
#

there are two kinds of assignments

scenic canopy
#

which adds private before assignment

nocturne basin
#

local ones, and the non-local ones

#

local ones always are lead by a private

scenic canopy
#

yes, shouldn't some of those be considered local?

nocturne basin
#

tool snapshot itself will be available from my webpage soon

scenic canopy
#

I guess you just parse the existing sqf and make no improvements to it

nocturne basin
#

mhh? it does not improve your code at all

#

it just pretty-prints it

scenic canopy
#

fair enough

#

would be a nice option thou

nocturne basin
#

you can do some code improvement if you want to 🀷 sqf-vm is open-source

scenic canopy
#

a lot of sqf floating around without private declarations

nocturne basin
scenic canopy
#

I already have πŸ˜›

#

I think I have a branch on my fork with some static code analyzers

#

if not, I should probably push it

#

probably never pushed the rest then

nocturne basin
#

looks like so

scenic canopy
#

at least top three contributer!

#

out of four πŸ™ˆ

#

I'll see about pushing the rest of the static analyzers then, poke me if there are no weird PRs in a day or so

neon flax
#

VS Code pretty printer would be be nice. :D

nocturne basin
#

will do so @scenic canopy if i remember to πŸ™ˆ πŸ˜„

#

to pretty print, just do .\sqfvm-cpp.exe --pretty-print path/to/file.sqf -anN (anN options to supress the normal output, you can always read more about arguments using --help)

scenic canopy
#

does it format the file in place or print the new format?

#

I guess nr2 based on parameter name πŸ˜›

#

I'll add it to our CI to make sure all SQF files are pretty formatted then 😚

nocturne basin
#

just prints it to console

scenic canopy
#

perfect

nocturne basin
#

yup
this way you can do whatever you want with it πŸ˜„

neon flax
#

does it support configurable indentation?

#

I need to take a look into prettier plugins. πŸ‘€

nocturne basin
#

Nope, no configuration at all

#

This is more a proof of concept πŸ˜‚

#

But one now could use the sqf-vm DLL to create some proper Tool

orchid shadow
#

a sqf prettier would be ace

#

for CODE

nocturne basin
#

and i got one fairly basic for ya

#

on which everybody can build further ontop

dusky dune
#

how do people use vs code?

#

i just cant get used to it, atom is nicer imo

orchid shadow
#

what do you mean?

glossy inlet
#

What is "how"?

orchid shadow
#

(something is wrong with you btw)

dusky dune
#

how to i learn to love it

#

i just dont understand it

orchid shadow
#

Use it?

dusky dune
#

it's like some people that like bananas, fucking weirdos honestly

#

I've used it a bunch, but I hate it everytime i do

glossy inlet
#

Just use it. Like any other editor.
Only thing I don't like is that I can't ALT+Click&Drag to select multiple lines. Only ALT+Click to select multiple which is tedious

dusky dune
#

all the keybinds suck too, searching is annoying, etc. The project / file view is not that great imo. Like I just don't see why people actuallyy like it

#

I understand why people dont like atom, because its pretty fucking slow on bigger files... but as the actual editor imo its much nicer 😦

nocturne basin
dusky dune
#

i'm wondering if there's some magical setting / plugin you gotta use in VS code

karmic niche
#

I still hope I'll finally find time to fix that intelliJ plugin that that other guy made to also work on pycharm

elfin oxide
#

@karmic niche You mean K-Towns plugin?

karmic niche
#

Oh, it says K-Town on Armaholic but not on GitHub...

#

I won't be able to try that solution out within a few days because of RL but I hope there are java people on this channel willing to help a poor Java noob like me to compile that plugin later because after a few hours spent on it yesterday, I wasn't able to do shit :P

nocturne basin
#

What has been the issue?

karmic niche
#

No pycharm support even though intelliJ and pycharm should be 95% compatible

#

So the plugin should be working out the box, in theory, but it doesn't :(

#

And now I'm setting everything up, even though I've never used intellij nor java (high school doesn't count) to probably change one line of config, build stuff and uninstall everything because the author doesn't seem to give a shit at all :/

scenic canopy
#

πŸ˜›

vague shard
#

a little official info and pics of "new tools"

fallen stone
#

@karmic niche What was your problem with compiling it?

karmic niche
#

It said package com.intellij.lang does not exist and I couldn't figure out how to fix that. Kayler said I should add the IntelliJ Community SDK set to my SDK, which I was sure I already did, because I followed his links on how to get started, but probably did it wrong, somehow.
I didn't have the time to work on it again, in the last few days (and probably won't be able to do that in the upcoming week) because I've been caught up in real life stuff. Maybe it's just a bad directory that I've set up in the SDK path - who knows...

#

And also, <rant>it's a bit demotivating when you take the time to analyze stuff, write down your suggestion, explain that it should be just a simple change to get one-liners as responses, one of them literally being Don't use Pycharm?. Thanks. If I have to use other software than PyCharm, then I don't see the point of installing IntelliJ just for SQF, duh!</rant>

fallen stone
#

The easiest way to correct the SDK issue is to create another project using the plugin development template (it will install it for you). When opening his project, it should warn you about the SDK if it cannot find it. You can simply select it from the drop-down.

If you cannot get it to work, I can add the depends into the XML and compile it for you, it should work

#

Seems odd he doesn't just add it though

karmic niche
#

If you have it working, then I'd be much obliged if you did, especially that it says in the docs that the parsing stuff is ALSO omitted there and I have to go through yet other hoops to make that other part work

#

So I feel like I'm going to spend at least a few days to test if changing that one line of config (not even code!) will make it work

fallen stone
#

Where is the page about parsing on the docs? Could you link it

karmic niche
#

FYI: I got rid of the "can't find the SDK" error message previously (see? I really tried to follow the setup guide! ;P ) hence I'm surprised it still doesn't work (and think it's some stupid rookie mistake that's obvious to everyone, save for the new people)

#

I have no idea what "run the generators" means or how to set them up, but I'm not even at the step when everything compiles so I decided to not bother about that part prematurely

#

Anyway, thanks for the help already.
I really have to focus on other RL stuff for the upcoming week so I can't check what exactly is wrong. I'll contact you when I'll be done with that and I'll be able to go back to compiling that plugin! πŸ˜ƒ

scenic canopy
#

seems like it's already generated with the gen folder

#

that repo looks really not well setup at all

#

perhaps I should make a PR with gradle

sinful girder
spiral forge
#

how long since you first saw it?

sinful girder
#

for the last 24hrs

spiral forge
#

make sure you are not alone, but if so, I can't say =\

sinful girder
#

im gonna upload to my server then access the workshop from there, hope fully its a isolated issue on my end...otherwise πŸ€” πŸ˜•

dawn palm
#

Mikero's DLL now has an SDK for other programmers to access it's features and roll their own code around it.

example code is also provided for each of the major modules (dewrp eg). These examples lay down the simple rules of engagement to access the dll and all of the functions available.

The code is written in Visual Studio 2012 C++ and is fully linux compatible. The same sdk can by used by the penguin.

Enjoy

dawn palm
#

When bis move goalposts, the dll itself will take care of those details. This means you have a reasonable garantee that your tool is going to work and be compatible without revisions, no matter what bis do. You have no reason to constantly reinvent the wheel of basic file format reading and writing.

#

The dll itself provides meta structures to the outside world. The same structure and and same function calls are used for access to binarised AND unbinarised files. You rarely have a need to know the difference. (except of course which type of file you want to write).

scenic canopy
#

❀

sinful girder
#

Anyone else having Workshop upload issues?

hallow rapids
#

@vague shard did you ever do an updated cmb repo thingy after withSix shut down their thing?

cobalt stag
#

@scenic canopy have your WEB panel any dependencies of an npm version?

#

Can't start it on Debian 9.5

#
10 silly lifecycle arma-server-web-admin@0.0.1~start: Args: [ '-c', 'node app.js' ]
11 silly lifecycle arma-server-web-admin@0.0.1~start: Returned: code: 1  signal: null
12 info lifecycle arma-server-web-admin@0.0.1~start: Failed to exec start script
13 verbose stack Error: arma-server-web-admin@0.0.1 start: `node app.js`
13 verbose stack Exit status 1
scenic canopy
#

works with node 0.10 and up

#

did you install the dependencies?

#

are you using the steam workshop branch?

cobalt stag
#

yes. I'm using the workshop branch and an all dependencies should be installd by your instruction on Git

scenic canopy
#

is that systemd or something?

#

what does the log say?

vague shard
#

@hallow rapids nope. mainly i was lacking many a3 updates in between (due me quitting till IFA3 revival)
i had it planned to upload to gitlab/github with some bloat and obsolete stuff removed. didnt get it done as git history/diff rewriting on such scale isnt easy

hallow rapids
#

I understand, just would've been nice to have πŸ˜ƒ

cobalt stag
#

and nothing in system logs

scenic canopy
#

try launching it using either npm start or node app.js directly

hallow rapids
#

does anyone happen to have a script that unpacks all the arma PBOs with armake?

#

(on Linux)

karmic niche
#

I don't know armake's switches, but it will go something like this:

for full_file in `find -name '*.pbo'`
do
    file=`basename $full_file`
    echo $file;
    echo armake_something --output_directory="${file%%.pbo}" --input_file="${file}"
done
#

Delete the last echo when you're sure of the command

#

Not tested with files containing spaces in names. You would then probably have to do something like find ... | for do read full_file; ... done
I think (not tested)

plush shard
#

but that won't be enough if you want to have the full prefix folder structure

hallow rapids
#

I'll just write a simple python script

#

but easier to manipulate stuff than with bash

karmic niche
#

Yes, you won't have the structure but I didn't know what were the full requirements Β―_(ツ)_/Β―

#

For full structure, you probably want "${full_file%%.pbo}", I guess... but I won't stop you from writing a python script using os.walk(), instead.
It all depends on what you want to do with it, how robust it has to be and how many times it will be run

hallow rapids
#

no worries, just wanted something similar to Mikero's unpacking thingy

karmic niche
#

If that's a one-shot script, I'd go with the bash route

hallow rapids
#

true

scenic canopy
#

you can mount the PBOs with fuse πŸ™ƒ

#

with python even

hallow rapids
#

hmm it might be interesting to mount all A3 PBOs

#

no wasted disk space πŸ˜›

scenic canopy
#

yep

#

that's the idea

#

I can add multiple PBOs to the python one if needed

#

it's a simple fix

hallow rapids
#

that would be neat

#

but a wrapper script would work as well

scenic canopy
#

just needs a glob

#

I can look at it later today

sick verge
#

How does the whole mounting thing actually work? Is this just some way to tell the file system how a pbo can be accessed and if so on which foundation does that work? Do you happen to have some reference on that or something? I'm really interested in that

nocturne basin
#

i can now write proper SQF parsers with my code-generator ❀

glossy inlet
#

@sick verge There is a custom filesystem driver in the backend. It just forwards all the drivery functions into your C# Application.
Things like "Read x bytes of this file into that buffer" or "return a list of files in the folder on this path"
You then just return the things it wants. Really simple actually.
DokanPbo just creates a internal filesystem just like Arma also does internally. And then exposes it to the OS through Dokan
https://dokan-dev.github.io/

karmic niche
#

i can now write proper SQF parsers
What sucks is that even your best parser will fail when parsing our files that use macros :(
That's kind of sad but I realize that you'd have to parse everything recursively to have macros working

nocturne basin
#

problem is actually macro expansion

#

could implement such a thing

#

but literally everything would be off as fuck

#

though ... i tried already to implement something with a preprocessing layer

#

problem is: i did not yet got something properly working

sick verge
#

Thanks @glossy inlet

dawn palm
#

no worries, just wanted something similar to Mikero's unpacking thingy
afaik, killswitch corected any/all differences to the penguin. From personal tests here extractbo.BIN is fully cognisant of penguin's utf8 filemames.

#

there is no armap3p equivalent for the penguin simply because the game itself doesm't exist on it. But absouletly all BINs (alias exes) of mine are compatible to bash scriptiing.

#

this is a garantee. since my interest in the windoze OS is zero

#

Although i have not personally done so (nor has killswitch) creating an arma3p for the penguin should not present any issues simply by modifying the original bat file in quite moinor ways.

#

you are free to modify arma3p without restricntion. it is an amalgum of all the expertts in terrain and model making and has no license or owner.,

hallow rapids
#

πŸ‘

#

I'll go the armake/this PBO fuse thingy way first

#

if for some reason it doesn't work for me then you're up ^^

#

also noticed that DeWrp is part of the Linux binaries but not the Windows binaries

#

what's up with that?

sick verge
#

Could someone provide an example of an actual PBO header file? I found https://community.bistudio.com/wiki/PBO_File_Format but there is no specific example given and I honestly don't quite understand the description with the whole struct-things - or rather I can't deduce how an actual header file would look like from that 🀷

smoky halo
#

what do you mean by PBO header file? The PBO Header is part of the pbo.

sick verge
#

Yeah I know but as I understand it it's plain text and I'd like to have a look at that piece of text

smoky halo
#

it is not plain text

sick verge
#

I used the linux terminal in order to simply print a PBO to the console which gives me some information but due to the whole unprintable characters it's quite messy. Therefore I was hoping that someone had a tiny example in stock

smoky halo
#

only part of it is plain text

sick verge
#

Isn't that the main part specifying the offsets of the contained files? And which parts aren't text? πŸ€”

karmic niche
#

Also, check the comments. They say that Asciiz is a null-terminated ascii string

#

ulong is an unsigned long C type, etc...

glossy inlet
#

the filenames and foldernames are text

#

that's about it

smoky halo
#

@stoic raft I will give you an example. just a second

karmic niche
#

What are you actually trying to achieve?

sick verge
#

What comments? I don't see any on that page and under Discussion there is no mention of Asciiz πŸ™ˆ

#

I am trying to write a Java wrapper class that allows me to access the PBO's content without having to extract the files

karmic niche
#

Below PBO Header Entry
You have: Asciiz filename; //a zero terminated string defining the path and filename,

glossy inlet
sick verge
#

Ah that comments xD
Thx

glossy inlet
#

Do you know C#?

#

Or C

sick verge
#

A little

glossy inlet
#

There are already a couple open source pbo parsers

smoky halo
karmic niche
#

Tbh if you want to be successful in writing a Java library, you should be able to read a C struct format without problems. After all, it's almost like a Java class declaration

smoky halo
#

this is a pbo in a hex viewer. the blue part is the pbo header

sick verge
#

@smoky halo thx

smoky halo
#

the rest is the content of the config.bin

#

which is the only file contained in this specific pbo

sick verge
#

@karmic niche I have no trouble reading the struct but I am unfamiliar with it's representation in memory... Or rather I thought it would be represented in a prettier way instead of simply writing that object's memory representation into the file 🀷

karmic niche
#

Just imagine that struct entry reads public class entry and you should be fine πŸ˜ƒ

glossy inlet
orchid shadow
#

wew

glossy inlet
#

That's how efficiently serialized files normally look @sick verge
Just writing the binary representation to memory. Because string would be way too inefficient

orchid shadow
#

rude, something something

glossy inlet
#

Oh wait!

#

Gimme a second

smoky halo
#

let me throw in my API too πŸ˜„

sick verge
#

Yeah well that kinda makes sense... Just didn't occur to me @glossy inlet ^^

glossy inlet
#

No wait.. Head that's yours πŸ˜„ I thought you felt bad because I didn't link yours πŸ˜„

orchid shadow
#

;)

sick verge
#

Okay thank y'all... I will try to wrap my head around the whole thing and might come back with more specific questions πŸ˜ƒ

orchid shadow
#

I ought to update it at some point, i have a new one i use for swifty v3

#

(now in testing, come on over to the swifty discord for fun times and bugs)

glossy inlet
#

I also got a PR for you.. Don't know if I actually PR'ed it to your repo

#

DokanPbo uses your library

orchid shadow
#

You did, just saw.

karmic niche
glossy inlet
#

We should make a list of them on biki

#

Should I link them just at the bottom of PBO file format page?

smoky halo
#

would make sense there

sick verge
#
Should I link them just at the bottom of PBO file format page?```
Yes that'd be great
glossy inlet
#

There was also some JS pbo library I think. @scenic canopy ? You do all the JS stuff πŸ˜„

dawn palm
#

also noticed that DeWrp is part of the Linux binaries but not the Windows binaries(edited)
what's up with that?

the linux tarball is the subscriber version.

as for KoffienFlummi's ArmaMake I consider him a higlhy competent programmer wiho has, more likely than not, accounted for the difference between the penguin and windoze.

nocturne basin
karmic niche
#

Dahlgren also did a python pbo library (I read his when I was writing mine) [because I needed different operations on those PBO files than his library could provide me]

sick verge
#

But there is none for Java, is there? (That might be a good question before I start digging there)

nocturne basin
#

just use the java-c interface and hook one of the C ones

dawn palm
#

well, there's also my SDK, for my dll, which, with about ten lines of C++ code (examples are given) will give you what you want.

#

you'd have no issue transforming that example into java and accessessing the (unmanaged) dll that way. Plus of course you get full documentation.

orchid shadow
#

I know that SwiftPbo works on mono ;)

smoky halo
#

there are also 2 Go APIs ^^

scenic canopy
#

@glossy inlet yeah... actually working on a browser thingy using PBO files so a JS library might appear "soon" πŸ˜›

nocturne basin
#

at this point: PBO might have more support then some zip libraries

glossy inlet
#

I searched on github for "pbo library" None of Dahlgreens and no java ones show up

scenic canopy
#

@smoky halo your C# implementation is very clean, I think the only issues I had was that the PAA stuff was a bit confusing

#

got it working in the end though but it uses the native PNG libs like your example

dawn palm
#

.... and if it's not noticed elsewhere @smoky halo and Synide are largely responsible for the dll's p3d module.

smoky halo
#

yeah getting the pixel data to a screen or image file is something that can be done in too many ways. that's why I left it out

scenic canopy
#

which is fine πŸ˜„

#

should probably try some more cross platform PNG solution and share some examples to the repo for it

smoky halo
#

and thx for the "clean" code praise πŸ˜ƒ

dawn palm
#

i use bitmap coz i haven't the brains to wrestle with windows obtuse image API

scenic canopy
#

yeah, I tried using that but the colors don't match up with the byte array

dawn palm
#

ummmm, i've had no issue i can recall with paa mipmaps->bmp

scenic canopy
#

ARGB vs RGBA etc

dawn palm
#

ah ok

scenic canopy
#

would be my guess at least

#

didn't look to much into it

#

it ALMOST worked

dawn palm
#

haha

smoky halo
#

yeah that is also confusing to me. it is not just that you have to know the color order but it gets more confusing if you think about endianness πŸ˜„

scenic canopy
#

that too

#

and it's not a tidy array with each pixel as element, just a stream of bytes

#

which is efficient to store

#

but not very efficient to reason about πŸ˜„

dawn palm
#

well, it's a stream of texels

scenic canopy
#

yep

dawn palm
#

it does not help my sanity that the top, is the bottom of the screen

scenic canopy
#

not sure if there are any bitmap libs in dotnet core/standard

#

might be worth adding some helper class/method for that if possible

dawn palm
#

urrgh what's dotNet 😎

scenic canopy
#

a decent CLI tool instead of msbuild? πŸ˜„

orchid shadow
#

Great?

scenic canopy
#

I like that the recent dotnet binary supports hooking in additional commands with nuget