It is currently 17 Aug 2025, 17:37
   
Text Size

Information pending...

Moderator: CCGHQ Admins

Re: Information pending...

Postby thefiremind » 02 Jun 2015, 21:37

spirolone wrote:Maybe, actually, Zed files managing is less important
Actually, given our latest tests, it's possible that illustrations need to be in a ZED file in order to be seen in the card collection and in the deck builder. If that's true, we still have unsolved problems.

spirolone wrote:but I found a bug in my code and I corrected it. It didn't extract correctly uncompressed files: there are few ones in Data archive, but a lot in Movies and Audio zed files. I also added possibility of specifying target file name as argoment (thanks to thefiremind!).
If I use your new version with my run.bat file, I get "Error" with all the DATA files.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby Tejahn » 03 Jun 2015, 01:35

@TFM and RiiakShiNal: I want to add my first Planeswalker to 2015. Can either of you post a ZIP with the files needed to make the Supertype and Subtype changes appear in game? I remember in 2014 there were a few files that needed certain types added to them to make them appear on the cards.

EDIT: When I say add a Planeswalker I mean to view them in game with their types displaying correctly.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby spirolone » 03 Jun 2015, 05:00

thefiremind wrote:...
If I use your new version with my run.bat file, I get "Error" with all the DATA files.
Sorry, I forgot source file in zip: now I uploaded it again editing previous post. However, problem is that it expects only file name in argument, without ".ZED". :oops:
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Information pending...

Postby thefiremind » 03 Jun 2015, 08:30

spirolone wrote:Sorry, I forgot source file in zip: now I uploaded it again editing previous post. However, problem is that it expects only file name in argument, without ".ZED". :oops:
Thanks, with the source it's clear. Anyway I don't like to skip the extension if I have to specify the full path anyway, so I applied my own modification to your new version. :wink:

Tejahn wrote:@TFM and RiiakShiNal: I want to add my first Planeswalker to 2015. Can either of you post a ZIP with the files needed to make the Supertype and Subtype changes appear in game? I remember in 2014 there were a few files that needed certain types added to them to make them appear on the cards.

EDIT: When I say add a Planeswalker I mean to view them in game with their types displaying correctly.
First of all, I already tried to use the Planeswalker type on a card in DotP2015 and the game became stuck on loading screen. So this time, in order to use Planeswalkers, we wouldn't even be able to give them their own type outside of battle. Given that, I would like to discuss the matter with the other modders first (maybe decide a "fake type" different from Basic Snow Enchantment this time?). Anyway, the problem about the card illustrations outside of the duels is the most pressing matter for me at the moment and I'd like to concentrate on that. You could argue that not seeing the card illustrations in the deck builder isn't that important... but aside from the fact that a big part of the cards' appeal comes from the very good illustrations they have, I tend to have a photographic memory that it's better than the other kinds of memories, so I like to browse the cards and choose them by taking a glance at their illustrations.

---------------------------------------

About the illustrations problem:
I had an idea, but I don't know if it's feasible, spirolone and/or merdok will probably answer to that. Note that it would require a bit more effort not just for the modders, but also for the players wanting to use the mods... yet it's the only idea I had.
Would it be possible (and easy enough) to patch the executable so that it uses a different public key in order to decrypt ZED files? If so, we could generate our own pair of keys, spirolone could make a "ZipToZed" tool that uses our pair of keys in order to produce ZED files, we could repack the original ZED files so that they use our pair of keys, and then play with the patched executable and put our data in ZED files rather than WAD files (hopefully solving the illustrations problem).

EDIT: I tried to search for the current public key inside the executable with a hex editor, but I couldn't find it, so it would be not as easy as I hoped it was. I guess it's not plain inside the executable (which would have made its modification trivial).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby merdok » 03 Jun 2015, 11:01

thefiremind wrote:About the illustrations problem:
I had an idea, but I don't know if it's feasible, spirolone and/or merdok will probably answer to that. Note that it would require a bit more effort not just for the modders, but also for the players wanting to use the mods... yet it's the only idea I had.
Would it be possible (and easy enough) to patch the executable so that it uses a different public key in order to decrypt ZED files? If so, we could generate our own pair of keys, spirolone could make a "ZipToZed" tool that uses our pair of keys in order to produce ZED files, we could repack the original ZED files so that they use our pair of keys, and then play with the patched executable and put our data in ZED files rather than WAD files (hopefully solving the illustrations problem).

EDIT: I tried to search for the current public key inside the executable with a hex editor, but I couldn't find it, so it would be not as easy as I hoped it was. I guess it's not plain inside the executable (which would have made its modification trivial).
We already had this idea too but skipped it since the WAD thing came :p Anyway it would theoretically be possible to do that. I am pretty sure it would work. If spirolone can make a ZipToZed tool where we can specify our own private key to encrypt the data, then i would try to patch the public key with our own.
merdok
 
Posts: 24
Joined: 31 May 2015, 20:33
Has thanked: 1 time
Been thanked: 11 times

Re: Information pending...

Postby spirolone » 06 Jun 2015, 12:46

I successfully changed a card inside Zed archive. I wrote an experimental "ZipToZed" program; it take ".METADATA" crypted dir from original Zed file (that is Header.xml and FileData.xml) and content of an uncompressed zip archive, and it creates a new Zed archive.
Example:
I take DATA_000.ZED and I use "ZedToZip" to create DATA_000.zip;
I unzip it and I obtain two folder: ".METADATA" and "DATA_000";
I change ONLY content of some files in second one;
I zip modified "DATA_000" with NO COMPRESSION in a new "DATA_000.zip" file;
I use new (likely bugged!) program "ZipToZed" that, reading "DATA_000.ZED" and "DATA_000.zip", creates a new file named "DATA_000_New.ZED";
I rename it as "DATA_000.ZED" and I put it in game dir;
I try to start game... :mrgreen:
Attachments
ZipToZed.zip
(6.22 KiB) Downloaded 368 times
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Information pending...

Postby thefiremind » 06 Jun 2015, 13:26

spirolone wrote:I successfully changed a card inside Zed archive. I wrote an experimental "ZipToZed" program; it take ".METADATA" crypted dir from original Zed file (that is Header.xml and FileData.xml) and content of an uncompressed zip archive, and it creates a new Zed archive.
You know, this could be a great idea! FileData.xml is probably not used (if I change that data in MOVIES_000.ZED by hex-editing, the intro works anyway) and Header.xml doesn't contain any information about the cards, we just need to keep the original file name, for example by deciding for an expansion ZED to fill with the community cards... and it may work! I haven't done any testing yet, but I'll do as soon as I have time.

EDIT: IT'S ALIIIIVE!!! I mean... it works! :lol:
Image
(Don't pay attention to the white expansion pack which doesn't unlock for me, it's a problem I had already and I'll gladly fix it with this new method. :))
Only one thing bothers me: isn't there a way to use compressed zip files? It will grow very fast with uncompressed data. (For those wondering, yes I tried with a compressed zip file, and spirolone's program doesn't give any error, but the game crashes instantly at startup.)
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby Tejahn » 06 Jun 2015, 17:04

That's excellent news! Thanks spirolone!
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby merdok » 06 Jun 2015, 23:30

Is it possible to modify the lol files? I know that the files can be decompiled to lua code. Can I modify such code and load the modified lol file into the game?
merdok
 
Posts: 24
Joined: 31 May 2015, 20:33
Has thanked: 1 time
Been thanked: 11 times

Re: Information pending...

Postby thefiremind » 06 Jun 2015, 23:48

merdok wrote:Is it possible to modify the lol files? I know that the files can be decompiled to lua code. Can I modify such code and load the modified lol file into the game?
Decompiling LOL files doesn't always work: luadec can only do it for simple scripts (constant declarations, very short functions), or maybe you can get code for more complex scripts but it will be very difficult to understand. All previous DotP games can load LUA files (not compiled) just as well, and I think DotP2015 should be no exception. Add a LUA file to Data_All_Platforms\Functions in your modified ZED file (or maybe in a WAD, since we aren't talking about illustrations) and its contents will be used by the game. If you know a function/constant name from a LOL file you can overwrite it by declaring a function/constant with the same name inside your LUA file.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby Tejahn » 06 Jun 2015, 23:52

I used Sublime Text to modify an .Lol in an attempt to add the subtype Lamia to Thoughtrender Lamia using TFM's method described in a 2014 thread but it didn't work. I'll try again with the new file spirolone uploaded at a later time. Again, I used Sublime Text.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby Tejahn » 07 Jun 2015, 00:55

spirolone wrote:Example:
I take DATA_000.ZED and I use "ZedToZip" to create DATA_000.zip;
I unzip it and I obtain two folder: ".METADATA" and "DATA_000";
I change ONLY content of some files in second one;
I zip modified "DATA_000" with NO COMPRESSION in a new "DATA_000.zip" file;
I use new (likely bugged!) program "ZipToZed" that, reading "DATA_000.ZED" and "DATA_000.zip", creates a new file named "DATA_000_New.ZED";
I rename it as "DATA_000.ZED" and I put it in game dir;
I try to start game... :mrgreen:
thefiremind wrote:
EDIT: IT'S ALIIIIVE!!! I mean... it works! :lol:
Image
(Don't pay attention to the white expansion pack which doesn't unlock for me, it's a problem I had already and I'll gladly fix it with this new method. :))
Can either of you explain the exact steps used to accomplish this? I tried following the steps described but I can't create a ZipToZed. I especially want to know how to make the illustrations appear in the Card Pool.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby thefiremind » 07 Jun 2015, 08:35

Tejahn wrote:Can either of you explain the exact steps used to accomplish this? I tried following the steps described but I can't create a ZipToZed. I especially want to know how to make the illustrations appear in the Card Pool.
OK, I hope I don't forget anything.
  1. Extract the ZED you want to modify, using ZedToZip (the old tool).
  2. Extract the ZIP you created this way, then repack its contents into another ZIP, but be sure to specify that you want no compression (how to do it varies according to the program you use to manage ZIP files on your PC, to be honest I don't know how to do it if you let Windows itself manage ZIP files). Keep the ZIP name the same as the ZED file and put it in the same folder as the ZED file.
  3. Make whatever modifications you want to the new ZIP file, treat it as a WAD. Again, if you add new files, be sure to specify that you want no compression. In my example I added the card XML in Data_All_Platforms\Cards, the picture TDX in Data_All_Platforms\Art_Assets\Illustration, and a card pool XML in Data_All_Platforms\CardPools which lists just my card with an unused ID (look at the highest ID used in your ZED files' CardPools and add 1).
  4. Use ZipToZed (the new tool), specifying the ZED as argument, with its folder path (if you keep the tool in a different folder) but without the extension. If you need a "helper" batch file in order to do this, just tell me and I'll post my version (it has a batch file and I added the possibility to specify the names of all 3 files involved).
  5. You'll see that ZipToZed created a new ZED file called DATA_0xx_New.ZED. Move the original ZED file into another folder, or add a prefix to it so that the game won't find it (I renamed my original ZED file as Backup_DATA_041.ZED), and rename the new one by removing the "_New" suffix, so that its name becomes the original name of the original ZED file.
  6. Start the game.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby merdok » 07 Jun 2015, 08:48

thefiremind wrote:Decompiling LOL files doesn't always work: luadec can only do it for simple scripts (constant declarations, very short functions), or maybe you can get code for more complex scripts but it will be very difficult to understand. All previous DotP games can load LUA files (not compiled) just as well, and I think DotP2015 should be no exception. Add a LUA file to Data_All_Platforms\Functions in your modified ZED file (or maybe in a WAD, since we aren't talking about illustrations) and its contents will be used by the game. If you know a function/constant name from a LOL file you can overwrite it by declaring a function/constant with the same name inside your LUA file.
Hmmm, after i decompile a lol file let's say: UI\Logic\frontend\extras\planes_gallery.lol then the game freezes when i try to open that in-game. The decompiled file looks good to me so i don'T understand why it is freezing, do i have to somehow change the file name after i decompile the lol file or just leave as it was before?
merdok
 
Posts: 24
Joined: 31 May 2015, 20:33
Has thanked: 1 time
Been thanked: 11 times

Re: Information pending...

Postby thefiremind » 07 Jun 2015, 09:01

merdok wrote:Hmmm, after i decompile a lol file let's say: UI\Logic\frontend\extras\planes_gallery.lol then the game freezes when i try to open that in-game. The decompiled file looks good to me so i don'T understand why it is freezing
That's exactly the problem, decompiling LOL files isn't an "exact science", it's a sort of reverse engineering, only simple code gets decompiled 1:1, what you obtained is probably different from what the original file wanted to do.

EDIT: ...Or maybe there's something else I don't know. Only once I meddled with a UI LOL file, and I made it by re-declaring the same function I wanted to modify in a different LUA file, leaving the original untouched. And someone told me it would have worked, otherwise I wouldn't have even attempted. :)
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

PreviousNext

Return to 2015

Who is online

Users browsing this forum: No registered users and 1 guest

Main Menu

User Menu

Our Partners


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 1 guest

Login Form