[H5] Custom objects tutorial

Maps and the art of mapmaking.
Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

[H5] Custom objects tutorial

Unread postby Franzy » 07 May 2008, 07:30

After downloading a bunch of recent maps I found out that most mapmakers don't know how to make "safe" maps. Safe map is a map that doesn't affect other maps. In the editor you can change shared properties of objects. But if you change them just like that, you will change the properties of ALL objects of that type on ALL maps, including official campaigns. I know, it's cool to make a quest hut look like a threant, but if you do that in a *wrong way* (by simply changing shared properties) you will affect other maps and maybe ruin them.

Here I will explain how to customize objects in the *right way*.

First of all, how to tell a nonsafe map? Simply open it in any program that can open zip-archives as folders (WinZip, WinRar, Total Commander, Far, etc) and see if there are any folders or files inside besides folder "Maps". If there are some (i.e. folder "MapObjects"), map is NONSAFE. In a safe map, there could be only one folder, "Maps", and no other files.

Now, how to convert a nonsafe map to a safe one. Follow these simple steps:

1. Open the map as folder (not in editor) and locate xdb-file of the changed object. NOTE: editor and game should be closed when you do that!
2. Copy it to your map containment folder (Maps/SingleMissions/YourMapName) - in other words, where all other files of your map are.
3. Rename it to anything you like. If the name of original xdb-file had any suffixes like .(Effect). or .(AdventureObject). renamed file also should have this suffix.

Do that for all "outsider" xdb-files.

4. Open the map in mapeditor. Locate the changed object and open it's properties (click it then press ctrl+space). Find the property "Shared". Now, change the path by replacing path with the path to your containment folder. This should be done by hand, "..." button won't help you. If the path starts with any definition, you should not remove it. For example:
WAS: AdvMapMonsterShared:MapObjects\Random\Random-Monster-L1.(AdvMapMonsterShared)
NOW: AdvMapMonsterShared:Maps\SingleMissions\MyTestMap\MyRandomMonster.(AdvMapMonsterShared)

NB: If you do something wrong, the path will change to NULL.

Do that for all changed objects.

5. Save the map and close editor.

6. Open map as folder again. Remove all folders and files that are not inside containment folder.

DONE. Now you have a SAFE map!

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 07 May 2008, 07:52

OK, now a practical example. Let's take a map "Vampire lover" by Sarvi. On that map several objects were changed. One of them is Ruined Tower which should allow you to hire Manes but instead gives you Vampires.

Let's keep the change but make it safe.

1. Open map as folder and copy file "MapObjects\Necropolis\Ruined_Tower.xdb" to folder "Maps\SingleMissions\Vampire Lover" and rename it to My_Ruined_Tower.xdb

2. Open map in editor. Locate any ruined tower (there is a couple of them). Click it, then press ctrl+space to open its properties. Find "Shared" property and change value from "AdvMapDwellingShared:MapObjects\Necropolis\Ruined_Tower" to
"AdvMapDwellingShared:Maps\SingleMissions\Vampire Lover\My_Ruined_Tower".

3. Save the map and close editor.

4. Open the map as folder and remove file "MapObjects\Necropolis\Ruined_Tower.xdb" from the map. DONE.

Now the same should be done with "MapObjects\TombOfTheWarrior.(AdvMapBuildingShared).xdb".
There is also a texture necro.xdb for loading screen in the folder, but it looks obsolete and should be simply removed as trash.

P.S. I hope the map's author does not hold any grievance against me, I just took as an example the very map I play now :)

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 07 May 2008, 17:36

This is good information Franzy.

I wish to point out that the mapmaker technique for creating safe objects is given in the official HOMM5_A2_Script_Functions.pdf that comes with the editor on page 40. The location of this information is neither obvious or logical, unfortunately, so many mapmakers never see it when they are learning how to script maps. It is so short that I will post a copy of it here:
Warning!
The modifications made in the "Shared" properties of an object will affect all the objects of that
kind in the game.
If you want your modification to be effective only on a specific map follow these steps:
1)Place on the map the desired object.
2)Go to the Shared field of that object.
3)In the Objects list create a new folder (Right click-New Folder) with the name of your
map.
4)Place in this folder a copy of the object you want to modify.
5)Make the desired modifications to the copy.
For the modifications to be in effect make sure that the path of the shared property leads to
the copy.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 07 May 2008, 17:47

The method suggested in official guide has one great drawback: when you press that button you create AN EMPTY OBJECT. It means you will have to fill in all the fileds manually. There are over 20 properties, and that's a whole lot of work!!! It's a lot easier to make copies, as I suggested.

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Unread postby Grumpy Old Wizard » 07 May 2008, 20:48

It is interesting to see another way to do it. Here is how I do mine. Look down at my Nov 8 post.

viewtopic.php?t=3793&start=390

GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 07 May 2008, 23:06

Hmm. Didn't try copy-paste. This actually could be easier :) Well, it's never late to learn, right? %)

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Unread postby Grumpy Old Wizard » 07 May 2008, 23:56

I've learned plenty from other map makers here. Keep your observations coming. :)

GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."

JagoBC
Leprechaun
Leprechaun
Posts: 29
Joined: 29 May 2006

Unread postby JagoBC » 08 May 2008, 00:31

This tutorial doesn't make any sense to me. I am always changing object properties, and I begin by making a copy of the object (expand the shared field, highlight the file name of the object, and press Ctrl + C), creating a new folder within MapObjects, and then pasting the copy into the new folder (press Ctrl + V). I then edit this copy in the new folder and the original object remains unchanged in the current map as well as all others (only the object referenced to the edited copy is changed).

However, when I open the map up in Winrar (which i do to make some edits because a text editor is sometimes simply easier) there are two file folders: "Maps" and "MapObjects" which would mean my map was "unsafe" by your standards... But because inside the "MapObjects" folder there is a subfolder which I created, and that holds my edited object files, the edited objects only effect that specific map. ONLY if the edited object files are directly inside the "MapObjects" and NOT in a subfolder do they have global effects.

I think the tone of this tutorial is a bit alarming. And should basically be boiled down to: if you download a map that contains edited objects placed directly in its "MapObjects" folder, play the map and then delete all instances of it before trying to play any other maps." You might also want to send a brief (but friendly) message to whoever made the map and tell him/her to clean up their shoddy craftsmanship.

And you don't need any special programs (Winrar, Winzip, whatever) to find out if a map has edited object files. As soon as you open a map in the editor, it creates all the files, folders and subfolders in the Heroes of Might and Magic V folder, under Editor/H5MMods.

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 12 May 2008, 18:58

@ JagoBC and Franzy

Basically, I use the same method as JagoBC does, with the same results--custom objects that do not affect other maps, and a sub-folder inside the Maps Objects folder. Consequently, I think that Franzy's criteria for unsafe maps is a little too broad. But, I am not sure. Hopefully, Franzy can spread a little more light on the subject.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 13 May 2008, 05:19

Well, if you use subfolder, it's also safe, as no game files are "overwritten".

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

Unread postby Sarvi » 24 Oct 2008, 10:41

Franzy wrote:OK, now a practical example. Let's take a map "Vampire
P.S. I hope the map's author does not hold any grievance against me, I just took as an example the very map I play now :)
Thanks Franzy! Its amazing how much more there is to learn in map-making with the H5 editor!
:) Sarvi
Ach wie schoen das niemand weiss....

User avatar
mctronic
Peasant
Peasant
Posts: 64
Joined: 06 Jan 2006
Location: mctronic

Re: [H5] Custom objects tutorial

Unread postby mctronic » 16 Oct 2016, 22:44

Can someone help me.

I downloaded the Abysmal and I can't revert back to the old manticore and wolf.

Can someone list what I need to do ?

Thx

User avatar
markkur
Demon
Demon
Posts: 335
Joined: 14 Oct 2011

Re: [H5] Custom objects tutorial

Unread postby markkur » 18 Oct 2016, 14:05

mctronic wrote:Can someone help me. Can someone list what I need to do ?Thx
Quickly...I've removed unwanted added-objects by opening the map in 7zip and looking at folders. A Typical map will have a folder named the map's name and then opening it will show you many files i.e. the "map.xdb".

What I have done myself always appears as a folder "at the same level" as the map folder. Looking at others maps some added folders will say "Lights" or "Objects" and if you open these you should see files that have a name that matches whatever creature-name (new changed)

Any added folder at this level = Multiplayer/Map + (added folder) will overwrite the original games files. If you want no modifications than delete any folders appear here.

Milos Gajic
Peasant
Peasant
Posts: 50
Joined: 18 Feb 2015
Location: Serbia

Re: [H5] Custom objects tutorial

Unread postby Milos Gajic » 22 Oct 2016, 19:30

Changing maps from "unsafe" to "safe" is in my opinion way too much work. The safest thing you can do when adding a new map into the map folder is:
-remove all other maps (delete or copy to another folder outside of the Maps folder)
-copy the new map inside
-remove it after playing

The changes made by added "unsafe" maps are not permanent and there is no need to avoid such maps (most of them are great) just remove them or put them into different folder after playing.


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 1 guest