#arma3_tools
1 messages Β· Page 23 of 1
yea web tool might be more useful, and allg ill go post it their
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.
something i would love to see is a faction config generator, that gets the information from a faction you create in eden
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)
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
No, all these types would be needed. "Better" as in clean, less sloppy, possibly more performance friendly?
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
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.
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
Why would they be inverted? Where does type get copied?
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'
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?
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
Right, okay.
Yeah, I was thinking about doing that. Thanks for the feedback π
ohhh noes ... what have i done
https://github.com/nlohmann/json
this is a hell lot of stuff i do not need
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
Have you looked at the single include folder? Haven't gone into detail but by the name it seems what you are looking for: https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp
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 π€
@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
It is added as submodule
Which might be it
anybody knows who is behind this git orga? https://github.com/RVEngine
Just someone who forked a lot of stuff.
He forked your SQF-Assembly fork instead of the original π€
that is why i wonder @glossy inlet π
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"
and no hate on dedmen in there, https://github.com/RVEngine/ArmaDebugEngine
forked from https://github.com/dedmen/ArmaDebugEngine
ohh wait
sqf-vm is in there too
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
you can join servers by clicking a link on a webpage. Don't know exactly what you mean by replacing
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
yeah you can do that. Don't know if you can edit the existing button. But you could remove it and add your own
https://github.com/acemod/ACE3/blob/master/addons/arsenal/RscDisplayMain.hpp#L14 Like this is how to add a Arsenal button under Tutorials
Change that to GroupMultiplayer and add your serverbrowser button
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..
Can't you get mods from standard Steam server query? https://community.bistudio.com/wiki/Arma_3_ServerBrowserProtocol2
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.
^ both correct
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
@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
using an extension may be another alternative indeed. depends on BE whitelisting in the end i would assume
you even could push your own master server
though ... writing one is not that much of a trivial task (but not that difficult either)
should also be easily doable using htmlLoad. But then you can't filter
why should you not be able to?
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
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
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";
};
?
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?
(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
Quite most literally output the type of the variable to the console.
template<typename T>
double blah(T variable) {
const char* vartypename = typeid(variable).name();
};
Takes any possible type. And returns it's name
Aha, okay. That makes snese.
#define blah2(variable) (typeid(variable).name())
Sesesesese... π
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.
Its hard to protect yourself from license violation if you provide open source code (i guess you refer to current "situation" in #arma3_scripting) .
It was easy before people could obfuscate. Now it's easy, but you have to waste your time looking into depbo tools like Armake.
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
obfuscation is not encryption... if you are desperate enough to untangle it you can propably do it
yeah. Already got work for the weekend
@glossy inlet its not meant to help people that steal stuff to hide it, but like any service it can be misused
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.
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
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.
Perhaps the latter could be solved with communication with the creators of whatever tool it is?
Sucky two sides of the coin situation
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.
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.
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.
Wicked, thanks!
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
@hardy patio gimme the pbo and I probably can give you the script files
thank you
@hallow rapids sorry did not get a notification.
Yes our work is public.
The current implementation is available here:
Protocol: https://github.com/playnet-public/battleye
and the rewrite of our rcon tool based on it is being built here: https://github.com/playnet-public/gorcon
BattlNet never really worked for me/us as we require other languages π
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
Any tool out there that will find where functions like "BIS_fnc_holdKey" is located?
the ingame functions viewer?
AIO configdump also works.
class CfgFunctions
{
class A3_TacOps
{
tag = "BIS";
class Systems
{
file = "\A3\Functions_F_Tacops\Systems";
class holdKey
{
};
};
};
};
Any tool out there that will find where functions like "BIS_fnc_holdKey" is located? Windows Explorer search on P drive
BIS_fnc_holdKey You can use the notepad++ folder search for text inside your P:\ drive configs as well
File is named fn_holdKey.sqf
yeah we all love crossposting don't we?
yep
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.
@smoky halo yep, shoot
The version that ACE/CBA/TFAR use is mostly maintained/edited by the ACE guys.
If this is about the thing you posted in #arma3_scripting that's not related to make.py. That's related to the textures inside your model and #arma3_config in your config
It is unrelated to that, but someone approached me privately and solved the above issue, which was a corrupted file. Thanks for the replies.
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)
that's not make.py
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
That's good to know, thank you. There are some other issues with Mikero's tools, particularly related to config class inheritance.
anyone checked the new VBS wiki yet? https://sqf.bisimulations.com/display/SQF/ (now Atlassian based)
seems not much of interest these unless you want to follow their sqf work
https://sqf.bisimulations.com/display/SQF/AARDeleteSelection
looks exactly as expected
only real pro is: unlike mediawiki markdown, atlassian bbcode is extremly simple to parse
Confluence also looks nice on mobile.
are fbo (from ARGO) basically the same as ebo?
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 ?
@smoky halo we have been considering to port their game modes to A3 (at least investigate if its doable)
I can check if it is ebo just with another key
seems to be different encryption algorithm
would be the easiest route I guess
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'
You can use either a Extended_PreInit_EventHandlers or a Extended_PostInit_EventHandlers. No idea what "ect" refers to.
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
};
class Extended_PostInit_EventHandlers {
class My_post_init_event {
clientInit = "call compile preprocessFileLineNumbers 'path\to\script.sqf'";
};
};```
Also the docs are here: https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)
Thank you for both the example, and the link.
edit: Got it all going now, thank you. That was a huge help
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.
How old is that thing? RCON port was moved fairly recently
Oh.. well. I guess just ask @hallow rapids if he's here anyway ^^
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
where exactly is the problem?
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
I can confirm the library works
From where to where are you trying to connect from/to?
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
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
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.
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 π
Yes exacly I told @lethal lantern to rename himself to something else than @native kiln
XD
Hehe
@lethal lantern all DLLs that are not within the standard net runtime pack need to be put in the arma 3 root folder
stop talking to yourself
@lethal lantern no
xD
π
System.IO.FileNotFoundException: Could not load file or assembly 'YoutubeExtractor is what i get returned.
Put the DLL in the arma root folder
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
Okay, makes sence
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
It works thanks π
Wouldn't that cause performance issues tho for people with low memory ? ^^^
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
@lethal lantern you can use ILMerge or Fody Costura to merge your dlls into one
Fair enough, Ive used Fody Costura before didnt think to use it this time around, ima implement it now thanks guys π
π
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. π
............................................
debugger.cpp:4:29: fatal error: nlohmann\json.hpp: No such file or directory
#include <nlohmann\json.hpp>```
Wrong chat?
fatal error: nlohmann\json.hpp: No such file or directory
/ is root directory
yes, relative also did not worked
and what is ... supposed to be? did you mean .. ?
... is just snipped out, contains rest of the path
according to your github the file is in include/nlohmann/json.hpp not nlohmann/json.hpp
"/.../sqf-vm/json/include/"
why are you using \ in the include but / everywhere else?
I know clang complains about that
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 ..
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.
and yes, was exactly that
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.
He mentioned in the blog it had security issues but i really couldnβt find any alternatives. Thanks though, weβll use that.
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
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
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.
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
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
@vague shard just that the military is not playing arma on some public servers π€·
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?
I think you underestimate the advantages of hacking into ANY computer infrastructure owned by your enemy
kju: VBS has per profile permissions to lock things down.
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.
ooohh that's cool
π
well its for your non source files, right? (ie A3\, CA\ and CUP\)
Oh my bad, wrong channel, ill move it to scripting
@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 π€
alright nice. do you symlink/junction your sources in this "virtual virtual p drive"?
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
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?
Basically, it's the same thing as FUSE on linux, but on Windows π
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
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"
https://github.com/Dahlgren/python-pbo-fuse That I thought.. Oh I guess that's not windows. Sorry then π
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
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.
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
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
thank you!
does it break when an arma update updates the pbos or needs a restart or sth?
Wow, good question π€
1.84 incoming, or so they say π
Uh.. Interesting...
I never used Dokan but I'd guess that it is locking the files just as all other processes in Windows
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
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?
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
could add me some ebo π
Yeah had the same thought. I also have them in mine but of course can't share that
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?
@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
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
Nice bat. You could add this to Github wki as example usage so it is easier to find.
I'm in progress of implementing all that the batch script does into DokanPbo directly. So probably not worth it ^^
would write access even be a good thing? feels very wrong to me
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
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.
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
personally I would only provide the arma pbo stuff with Dokan and link it to the P drive, however that may be realized
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.
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
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
π
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
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.
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
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
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.
i am asking for the other way round yes
That way you can focus on making sure PBOs are handled right and you leave the rest to other FS authors π
then temp folder would no longer be a problem if I understand this correctly
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
@vague shard yes, it works like any FS
ty
the way the project is structured it is also possible to create other cli interfaces
so i'm a noob with this, would I be able to use os.path.isfile with python on this?
so the FS implementation is reusable across different tools if needed
@dusky dune sure, it's just a folder/drive like any other
nice, i might look into using that then. Now i just need a super basic .p3d reader that can check for memory points..... π
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
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
then i can do landSlopeContact detection in my mod without needing to prebuild files
like looking up arma 3 directory from registry
without the need of those bat files I posted before
@dusky dune it's not really suitable for use in mods
why not? ;_;
It needs the Dokan library installed to work. Which requires Admin rights to install because it's a kernel driver
makes sense
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
as they shouldn't π
Don't you trust me and my kernel drivers? π
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
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.
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
Nope. Not writing to PBO. Just writing to temp dir
@karmic niche easiest is to append data and rewrite pointers, and then reoptimize the pbo when needed
I don't want to do write to PBO. Unless someone can convince me it's needed
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
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
I think I'm gonna have to disagree π
I don't see any offsets here: https://community.bistudio.com/wiki/PBO_File_Format
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
You can compute the offsets by counting the size of previous files in the headers but that's all
@karmic niche could reorder the files in the header and insert a empty dummyfile into the old empty space
You can't make an arbitrary pointer pointing to 34GB
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
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 π
skies the limit!
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?
I wonder what windows does if I have more space free than the disk has space at all...
100GB free on a 60GB disk π€
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
https://s.sqf.ovh/explorer_2018-07-17_14-23-14.png Well.. That works I guess π Windows doesn't show the "this much full" progressbar because it's confused
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.
haha
π
Yup, that's exactly what filemon was showing when you left it running and did some stuff, like deleting files π
I'm not really in that whole driver thing but how does a driver get to override the implementation of something like CreateFile?
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 
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
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
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 π¬
AFAIK PBOs can be anywhere, when you are browsing the virtual drive the underlying driver streams the content in the background.
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
That project is already 2 or so years old π I'm just improving it a "little"
I probably never saw it because I'm not a mod creator :S
@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
Each folder? oO
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 (/)
Not that I doubt it, just have never seen that being used before on windows, gotta try that out on windows
Dokany is a kernel space FS implementation which interacts with a user space SDK
makes it easier to develop
and a lot safer
Oh I can imagine it not being a good idea making everyone make a driver π
well, performance takes a hit going between kernel and user space
But I mean for something like this it sounds like a very good option doesn't it ?
I probably spent as much time on SFP CI as on actually doing SFP mod content π
I can sacrifice a bit of performance for less bluescreens xD
we have our own Gradle DSL for building arma mods
Good CI pipeline takes a lot of time.
And if you are developing the tools by yourself...
and a WIP DSL for arma autotests
Meanwhile on my pc, pure anarchy
I'm just glad GPU VM's are cheapish now π
Meanwhile I'm barely able to use docker for CI :D
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
Can you upload stuff with Steamworks SDK?
I would be happy if Liberation releases could be fully automated.
@scenic canopy running VFIO setup?
@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
ah, I meant at home π
I did before but not right now
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
@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 π
Hello all, would this be the placve to get some help setting up Mikero tools?
I have an error message I don't get.
Ideally I would like to run it all on free travis but it seems that this could be hard to achieve.
@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
Great cheers π Well I have this error message that I have linked - https://ibb.co/bVVCRy
to do with eden?
"E" is an external drive - would that be an issue?
Oh hey you're the author π cool!
No, just fixed some missing things π
Thanks for helping the community.
Your user probably lacks write permissions to root of e:?
Is that your project work dir?
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.
You should use P: then
Arma3P is supposed to target your project drive
Otherwise pboproject wont work
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
I see they have a lot of rest endpoints but workshop uploading is available through cpp only. Any idea what protocol they use there?
Steamworks sdk is a C++ library, not a rest API
Youβre thinking of steam web api
It would require steam to be running with an arma 3 account too
Oh it needs a running game. So dedicated server is the way to go.
https://s.sqf.ovh/explorer_2018-07-18_15-48-32.png Oh man I'm starting to really have fun with this. You can't remove the read-only attribute from the file because.. "There is more data available" XD
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
what exactly is the problem?
π
armake 0.6 release has
Use BI's binarize.exe on Windows
does anyone know why?
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
thanks
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.
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.
sweet π will give it a try tomorrow - did you publish a new build/uploaded latest to github?
nope. I guess @scenic canopy will do after he merged the PR's

performance problems and BSODs was why we didn't pursue using it 2 years ago
but perhaps Dokany is more stable now
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
the time spent explaining how p drive and arma3p works to others... π¦
@scenic canopy stay strong π
@scenic canopy that's the reason I never got into modding :P
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.
@cinder meteor https://github.com/X39/XMS2/blob/master/buildScript.cmd_template try this
not sure if it is still compatible, but that was what i used with normal arma addon builder back when i was still modding
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
Looks complicated but I'll look into that, thanks!
Are general cpp questions unrelated to arma okay in this channel?
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?
I usually do
extern int Varname in the header. That tells the compiler that there is a global Varname variable somewhere.
And then in some cpp file just int Varname = 0 to define it.
https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/1.0/ts/src/task_force_radio.cpp#L14 Declaration (This is supposed to go into the header)
https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/1.0/ts/src/Teamspeak.cpp#L13 Definition
I think C++17 has nicer stuff though. With inline variables
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
LOL. Thank you both, this is a very clean looking solution compared to what I thought it would be lol.
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)
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
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 π )
Intercept cough cough
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?
Did you say something? π
VS community is default C++17 I think?
Should be. otherwise... (Screenshot incoming)
I can't grab a screen right now, but I would imagine this is the case.
https://s.sqf.ovh/devenv_2018-07-24_11-33-07.png
C++ -> Language -> C++-Language standard
Oh, there we go. Okay, I'll have a look here soon.
Static previously meant that:
- A static function isn't visible outside its scope (file where it was created) - the compiler won't link it
- 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 π
Lol. Fair enough.
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
Uhm... What is that @wind coral
@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
@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
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.
The ++ stands for classes
Did you just make that up π ?
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
I am just now learning stuff, gotta make mistakes to learn. π€· . Thx for the comments on git ded, I will look them over soon.
I'd say. If you only have one player. Make it a class. And learn how the "singleton pattern" works in c++
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.
With a singleton with a static getInstance method you can do the same. But you don't need extern anywhere.
dependency injection!
Since we're giving suggestions: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
(if you have a week to spare π )
dependency injection ew
dependency injection is pretty nifty, but hard to wrap your head around it at first.
New release of SQFlint available. Minor bug fixes and improvement of interface. pip install sqflint
π
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
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)
Just updated https://github.com/Lyeed/Build-with-AddonBuilder
It adds addonbuilder in your contextual menu (right-click on a folder)
@tough tapir nice one π what about one for mikero tools (pboproject/makepbo/etc)?
@tough tapir very cool idea π
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 ?
@knotty belfry pastebin your code please and share the link here please
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
What language are we looking at here lol
I can ensure you that the engine calls RVExtensionArgs with the correct params every time
it's C && Go
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?
nope
ok what kind of dll do you get then there
in fact, certainly cause it creates a dll
or do you do it for linux?
or .so
can you send me a compiled .dll there please?
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?
yes i call it one time
the sqf code is only
_result = "armago" callExtension ["John", ["yeahh", "test"]];
hint format ["Resultat: %1", _result];
allright
if i well understand unsafe.Pointer should cast the int variable into int golang variable
actually
try calling it with this: http://killzonekid.com/arma-3-extension-tester-callextension-exe-callextension_x64-exe/
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
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
what value are you getting in hex?
does the same code as c++ code work? Or does it have the same problem
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
Is there a reason why you are treating argc as a pointer value?
Or atleast, sorry, creating a reference just to deref?
in fact i use the a command from manual
hm?
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
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)
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
I wrote its value as a C.int to stdout
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
yes it seems to works
π
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?
in a3 samples there was a physx.hpp update in Test_Car_01
Hey guys, just dropping a new open source PBO packer / unpack supporting archive compression, for those interested: https://github.com/RaJiska/JAPM
good stuff, thanks.
Nice!
looks nicely done. thanks for sharing!
Thanks guys !
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
what in gods name is that
sleepy sleepy
@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
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
π€· 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
@nocturne basin did you code the code beauifier yourself or do you use some lib?
was the private part added after the first dump?
since those local variables have no private declaration
n1. you may want to offers this as cmd line util to update local files
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 π
ive used Uncrustify and c template i think. had to fix some stuff with regex afterwards
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 π π )
I was thinking about the ASSIGNMENTLOCAL switch case
there are two kinds of assignments
which adds private before assignment
yes, shouldn't some of those be considered local?
tool snapshot itself will be available from my webpage soon
I guess you just parse the existing sqf and make no improvements to it
you can do some code improvement if you want to π€· sqf-vm is open-source
a lot of sqf floating around without private declarations
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
looks like so
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
VS Code pretty printer would be be nice. :D
will do so @scenic canopy if i remember to π π
the snapshot capable of pretty-printing is available at https://x39.io/projects?project=SQF-VM
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)
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 π
just prints it to console
perfect
yup
this way you can do whatever you want with it π
does it support configurable indentation?
I need to take a look into prettier plugins. π
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
what do you mean?
What is "how"?
(something is wrong with you btw)
Use it?
it's like some people that like bananas, fucking weirdos honestly
I've used it a bunch, but I hate it everytime i do
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
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 π¦
https://github.com/X39/sqf-vm/blob/master/sqfvm-cpp/virtualmachine.cpp#L300-L398
https://github.com/X39/sqf-vm/blob/master/sqfvm-cpp/Entry.cpp#L73-L106
there you go @orchid shadow
those are the lines you wouldn eed to edit
i'm wondering if there's some magical setting / plugin you gotta use in VS code
I still hope I'll finally find time to fix that intelliJ plugin that that other guy made to also work on pycharm
@karmic niche You mean K-Towns plugin?
I'm talking about https://github.com/kayler-renslow/arma-intellij-plugin
There's a closed ( :/ ) issue of mine there, with a proposed solution/guess to make it work for PyCharm.
What is K-Towns plugin?
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
What has been the issue?
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 :/
π
@karmic niche What was your problem with compiling it?
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>
Full issue here, if you're interested: https://github.com/kayler-renslow/arma-intellij-plugin/issues/48
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
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
Where is the page about parsing on the docs? Could you link it
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)
https://github.com/kayler-renslow/arma-intellij-plugin#some-information-on-the-source-code @fallen stone
Here. Especially the second paragraph
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! π
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
Hi im unable to upload any mods to the steam workshop, getting this error ... https://cdn.discordapp.com/attachments/469424085701623826/481208238734442549/Capture.JPG
Any suggestions for a fix...thx
how long since you first saw it?
for the last 24hrs
make sure you are not alone, but if so, I can't say =\
im gonna upload to my server then access the workshop from there, hope fully its a isolated issue on my end...otherwise π€ π
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
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).
β€
Anyone else having Workshop upload issues?
@vague shard did you ever do an updated cmb repo thingy after withSix shut down their thing?
https://github.com/Varrkan82/ArmA3-MODs-Updater-Downloader
Hope this would be helpful for someone
@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
works with node 0.10 and up
did you install the dependencies?
are you using the steam workshop branch?
yes. I'm using the workshop branch and an all dependencies should be installd by your instruction on Git
@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
I understand, just would've been nice to have π
try launching it using either npm start or node app.js directly
does anyone happen to have a script that unpacks all the arma PBOs with armake?
(on Linux)
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)
but that won't be enough if you want to have the full prefix folder structure
I'll just write a simple python script
but easier to manipulate stuff than with bash
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
no worries, just wanted something similar to Mikero's unpacking thingy
If that's a one-shot script, I'd go with the bash route
true
yep
that's the idea
same for windows and with more features, https://github.com/Dahlgren/DokanPbo
I can add multiple PBOs to the python one if needed
it's a simple fix
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
i can now write proper SQF parsers with my code-generator β€
@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/
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
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
Thanks @glossy inlet
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.,
π
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?
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 π€·
what do you mean by PBO header file? The PBO Header is part of the pbo.
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
it is not plain text
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
only part of it is plain text
Isn't that the main part specifying the offsets of the contained files? And which parts aren't text? π€
Also, check the comments. They say that Asciiz is a null-terminated ascii string
ulong is an unsigned long C type, etc...
@stoic raft I will give you an example. just a second
What are you actually trying to achieve?
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
Below PBO Header Entry
You have: Asciiz filename; //a zero terminated string defining the path and filename,
Ah that comments xD
Thx
A little
There are already a couple open source pbo parsers
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
this is a pbo in a hex viewer. the blue part is the pbo header
@smoky halo thx
the rest is the content of the config.bin
which is the only file contained in this specific pbo
@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 π€·
Just imagine that struct entry reads public class entry and you should be fine π
https://github.com/RaJiska/JAPM/blob/master/include/pbo.h#L31
https://github.com/headswe/SwiftPbo/tree/master/SwiftPbo
That first one might be easier to read for you
wew
That's how efficiently serialized files normally look @sick verge
Just writing the binary representation to memory. Because string would be way too inefficient
rude, something something
let me throw in my API too π
Yeah well that kinda makes sense... Just didn't occur to me @glossy inlet ^^
No wait.. Head that's yours π I thought you felt bad because I didn't link yours π
;)
Okay thank y'all... I will try to wrap my head around the whole thing and might come back with more specific questions π
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)
I also got a PR for you.. Don't know if I actually PR'ed it to your repo
DokanPbo uses your library
You did, just saw.
Wait? Are we throwing in our PBO libraries? Ok! :P
https://github.com/overfl0/yapbol/blob/master/yapbol/pbo.py#L332 (check all the individual parse_from_file methods)
(i'd write it another way if I had the chance to rewrite it but oh well...)
We should make a list of them on biki
Should I link them just at the bottom of PBO file format page?
would make sense there
Should I link them just at the bottom of PBO file format page?```
Yes that'd be great
There was also some JS pbo library I think. @scenic canopy ? You do all the JS stuff π
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.
throwing in some unfinished PAA library in c# then https://github.com/ArmA-Studio/ArmA.Studio/tree/master/RealVirtuality/Media/Drawing/PAA
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]
But there is none for Java, is there? (That might be a good question before I start digging there)
just use the java-c interface and hook one of the C ones
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.
I know that SwiftPbo works on mono ;)
there are also 2 Go APIs ^^
@glossy inlet yeah... actually working on a browser thingy using PBO files so a JS library might appear "soon" π
at this point: PBO might have more support then some zip libraries
I searched on github for "pbo library" None of Dahlgreens and no java ones show up
@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
.... and if it's not noticed elsewhere @smoky halo and Synide are largely responsible for the dll's p3d module.
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
which is fine π
should probably try some more cross platform PNG solution and share some examples to the repo for it
and thx for the "clean" code praise π
i use bitmap coz i haven't the brains to wrestle with windows obtuse image API
yeah, I tried using that but the colors don't match up with the byte array
ummmm, i've had no issue i can recall with paa mipmaps->bmp
ARGB vs RGBA etc
ah ok
haha
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 π
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 π
well, it's a stream of texels
yep
it does not help my sanity that the top, is the bottom of the screen
not sure if there are any bitmap libs in dotnet core/standard
might be worth adding some helper class/method for that if possible
urrgh what's dotNet π
a decent CLI tool instead of msbuild? π
Great?
I like that the recent dotnet binary supports hooking in additional commands with nuget