Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Basic ToTE modding help?
Thread: Basic ToTE modding help?
phoenixreborn
phoenixreborn


Promising
Legendary Hero
Unicorn
posted October 18, 2007 03:00 PM

Basic ToTE modding help?

Hello modders.

In 1.5 and 2.1 I was able to change starting resources and some other values simply by changing the numbers in the data.pak file (or dataa1 for hof).

For 3.0 trying to change the data.pak file crashes winrar.  I noticed that the pak file appears to be locked, but when I click it asks for a password.  Can anyone tell me the correct method?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 18, 2007 07:36 PM

Using WinRAR, I extracted the contents of the data.pak file. One thing I noticed about the files is that they all have their file attributes set to "Read Only". Could that be the blocking issue?

If so, the work-around is simple: extract the files, make them editable, make the changes you want, make them read-only again and then zip them up again. Could it be that simple?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
phoenixreborn
phoenixreborn


Promising
Legendary Hero
Unicorn
posted October 18, 2007 07:55 PM
Edited by phoenixreborn at 20:23, 18 Oct 2007.

I was aware that they were read-only, but the way I was changing them before didn't really change it.

Now that I have unchecked read-only it allows me to save the changes.

Unfortunately I can't figure out the zip it back up part.  When I try to put the changed defaultstats.xdb file back into the data.pak I still get a crash.

If I archive the file I have a data.rar, or a defaultstats.rar (or .zip)...

Were you able to effect in game changes Maurice?

edit: for some reason there is a userMODs folder, any info on that?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 18, 2007 08:42 PM
Edited by Maurice at 20:43, 18 Oct 2007.

No, I have only extracted the files so far, and looked into it (I was mainly interested in the scripts and maps). Also, I haven't used WinRAR before, so I have no clue how that works. I was merely tossing out an idea .

Were the files in the data.pak file of the original game (and HoF) not marked as read-only?

By the way, when you have a data.rar file, just change the extension to pak, so you get a data.pak file. That should work (considering that in order to check it as a zip file, I named it data.zip ).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
VokialBG
VokialBG


Honorable
Legendary Hero
First in line
posted October 18, 2007 08:49 PM
Edited by VokialBG at 20:50, 18 Oct 2007.

I get the same errors, some said that they don't have problems... and just edit like in HoF.

And yes most of the files were read only. but you get them out, unchech the read-only and edit them then you can add them again. in TotE you simply can't do this. So how you guys mod this? I can't to even a single change!
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 18, 2007 10:57 PM
Edited by Maurice at 23:01, 18 Oct 2007.

Ok, I just extracted a campaign mission and packaged the thing up again. One important thing to note here is that I needed to archive the whole lot as a ZIP file (not RAR!) and besides, I have to use zero compression (in WinRAR, use the "Store" option). Otherwise the editor simply wouldn't read the file. I think something similar applies to the data.pak as a whole.

When you add files to an existing archive, can you still set the compression for it? If so, you might want to look into setting it properly.

Edit: I think you can ... so choose the "Store" compression option under WinRAR (which is no compression at all).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
sfidanza
sfidanza


Promising
Supreme Hero
posted October 19, 2007 02:43 AM

It seems some of you are having difficult times modding. Let's try to solve that.

First of all, PhoenixReborn, what do you mean with
"When I try to put the changed defaultstats.xdb file back into the data.pak I still get a crash."?
Do you edit the file and put it back on data.pak, thus replacing the original?!! What weird modding is this!!
You should just repack the edited file in a mod, that's all. Leave the data.pak as is. It works: no lock, no bug, no crash.

The files in data.pak have always been read-only. Remove the read-only attribute and edit. It's indeed that simple.

To create a mod (as Maurice just said), it HAS TO BE a ZIP file. A rar file won't work. Once you have my_mod.zip, you can rename it to my_mod.h5u and place it in the new UserMODs/ folder. Yes, that's how it works.

Alternatively, you can rename it to my_mod.h5m, and place it into Maps/. It works the same. I elaborated a little more on that in the GotP thread.

About maps and zip compression: I usually use the normal compression, and the maps are always recognized. The problem with the editor (which indeed doesn't want to open some maps) is another issue: for example, it doesn't want to open a campaign map (in the Scenario/ folder), but just rename Scenario/ to SingleMissions/ inside the archive and voilą!
Actually, I think it only agrees to open maps when their inside path is either SingleMissions/ or Multiplayer/.

Does this solve all your (modding) problems? If not, detail what's happening, and we'll try again.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
phoenixreborn
phoenixreborn


Promising
Legendary Hero
Unicorn
posted October 19, 2007 04:26 AM
Edited by phoenixreborn at 06:56, 19 Oct 2007.

Alright, I shall explain what I have done and you can tell me what I'm doing wrong.

1. I extracted from the data.pak the file

data/gamemechanics/rpgstats/defaultstats.xdb

2. I unchecked read only in the properties of defaultstats.xdb

3. I made my changes (changed startinghuman resources for normal difficulty) and saved defaultstats.xdb

4. I right clicked the defaultstats.xdb file, selected add to archive (compression store, type zip) and titled it resources.h5u inside the winrar program.

I was sure it was going to work because the icon changed to look like a .pak file.  Renaming it to .h5m also made the icon look like a map file.  It was 205 kb the size of the defaultstats.xdb file.

Unfortunately when I put the files into the userMODs folder, or the map folder, nothing changes in the game.

What step am I missing?

I appreciate the efforts to help me.

edit: For 2.1 I had two copies of the data.pak.  I had one that I went into the pak and changed the resource numbers etc. and saved and I had one unmodified.  If I was playing online I put the unmodified one into the data folder, if I was playing sp I would put the mod one in.  The important thing is I could work right inside the big data.pak and it didn't crash my winrar.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 19, 2007 09:39 AM

Quote:
About maps and zip compression: I usually use the normal compression, and the maps are always recognized.


When I used normal compression, the editor failed to load the map. When I used store compression (i.e. no compression at all), the editor loaded it just fine.

One thing I noticed though, was that in store format, the map I extracted from the campaigns was about 2.8 Mb in size. Once I opened it in the editor, however, it got reduced to 275 Kb or so - a reduction by a factor of 10 in size. Did WinRAR just use excessive amounts of HD space to create the zip file, or does the editor automatically compress the file, even when no changes are made to it?

Odd behaviour, I'll keep an eye on that with other attempts.

One thing I'm curious about, not sure, but something I suspect: when the game starts, it loads up ALL .pak, .h5m, .h5u, etc ... files as long as they're in the right folders, regardless of actual file names? Of course, the internal file format has to be correct for its type, but it loads them then?

And which file takes precedence? Phoenix is trying to mod a file that occurs in the data.pak file; once you create a mod file from it that you offer to the game outside of the data.pak file, which one will overrule the other?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 19, 2007 09:41 AM

Quote:
The important thing is I could work right inside the big data.pak and it didn't crash my winrar.


Could it be a size issue? I believe the original data.pak file is around 1Gb. The one from TotE is 1.3Gb. Could it be that WinRAR has a size limitation for the thing you're trying to do?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
CrazyPill
CrazyPill


Hired Hero
posted October 19, 2007 11:32 AM

Quote:
4. I right clicked the defaultstats.xdb file, selected add to archive (compression store, type zip) and titled it resources.h5u inside the winrar program.


I think problem is in this step. You have to rightclick on the gamemechanics folder.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Homer171
Homer171


Promising
Supreme Hero
posted October 19, 2007 01:49 PM

How can i run old Mods on 3.0?

New Pak files works just fine but if i try to add old Death Knight Mod in the game and it does not work. I haven't found any difference in paths although that might be the problem if any. The fact that Dead Knights don't have alternative shouldn't be the problem when it should still change Wraiths and Wights. Could be that the Mod haven't been working on last patches but what i need to change to make it work again?
____________
Don't be too proud of this technological terror you've constructed. The ability to destroy a planet is insignificant next to the power of the Force.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
phoenixreborn
phoenixreborn


Promising
Legendary Hero
Unicorn
posted October 19, 2007 02:52 PM

Quote:

I think problem is in this step. You have to rightclick on the gamemechanics folder.


That was it, it worked!

Once again, thanks to everyone for the help.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
sfidanza
sfidanza


Promising
Supreme Hero
posted October 19, 2007 07:15 PM

@PhoenixReborn: glad we could find it.
By the way, I feel better about your modding method.

Quote:
When I used normal compression, the editor failed to load the map. When I used store compression (i.e. no compression at all), the editor loaded it just fine.


When the editor opens a map, he first unpacks it in Editor\H5MMods\. Check if it manages to do that before blocking. If it does, then it's not the unzipping causing the problem.
Of course, if you zip the same map with both methods and one works and not the other, there's obviously something. On the other hand, my editor opens maps I packaged with normal compression, so it's not that simple I guess. You can send me test files if you have some.

The 10 to 1 ratio is indeed what I get between normal compression and store. Which seems to indicate that the editor itself compresses the maps.

Quote:
One thing I'm curious about, not sure, but something I suspect: when the game starts, it loads up ALL .pak, .h5m, .h5u, etc ... files as long as they're in the right folders, regardless of actual file names? Of course, the internal file format has to be correct for its type, but it loads them then?

And which file takes precedence? Phoenix is trying to mod a file that occurs in the data.pak file; once you create a mod file from it that you offer to the game outside of the data.pak file, which one will overrule the other?


Yes, as far as I know, it loads all files (actually it may load only one file when there are several versions, to be more effective, but at least it takes all into account). The file that takes precedence is the one with the latest modified date. That's why older mods don't work, until you update the modified date (of the files inside the archive, not the archive itself). The name of the mod/map... has no importance.

@Homer171: this modified date thing is exactly why your mod doesn't work. If you're talking about Arstahd's DarkKnight mod, then I've updated it on AoH: just re-download and you should be fine.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted October 19, 2007 08:56 PM

I'll check the Editor/H5MMods directory next time I try it. Wonder what's up . At least it's nice that the editor compresses it automatically, even when you're not making any changes - just loading is enough.

The date thingy is also good to know. Now I don't have any older mods installed, but it's quite important when using those .

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0410 seconds