Editor tips for H5

Maps and the art of mapmaking.
User avatar
Pitsu
Round Table Hero
Round Table Hero
Posts: 1830
Joined: 22 Nov 2005

Editor tips for H5

Unread postby Pitsu » 10 Oct 2006, 17:21

How to change a singleplayer map to multiplayer or vice versa

All you need to do is to rename a directory inside the *.h5m file. h5m files are renamed zip archives with a typical structure Maps/maptype/mapname/map_files

maptype is either SingleMissions or Multiplayer.

1. Unpack your *.h5m file. if not possible otherwise, rename it first to a zip file
2. Change the directory to the map type you want
3. Pack it back to a zip file. Be sure to keep the original directories structure and not pack only the subdirectories
4. Rename the obtained zip to h5m

How to add a PWL image?
This function is not working properly in version 1.3 editor.

1. make a 1024x1024 pixels image and convert it to *.dds format. If you have phothoshop, search for nVidia dds plug-in to do the conversion. There are other possibilities saving an image in dds format though. For example http://eliteforce2.filefront.com/file/D ... rter;29412
Edit later: see also this thread
2. Go to the map properties tree in map editor and generate a new reference file for PWLPicture
3. close the editor and unpack the *.h5m file
4. move the dds image file that you created into the unpacked directory where all other unpacked map files are located
5. In the same directory must now be the PWL reference file that you created in the editor. Open it in a text editor (Notepad).
6. Find line <DestName href="/"/> and type the name of your dds fail into it. For example <DestName href="/MyPWL.dds"/>
7. Save and close the text editor
8. Pack all files back to a zip file. Again, do not forget to keep the original structure of directories.
9 Rename the zip back to h5m file

How to add thumbnail images? (credits for finding this method go to Fiur and Alavris)

1. Create 240 x 180 pixel images that you wish to show up. (Remember that you can have text on your images and they do not have to be screenshots)
2. Convert the images to 8888 dds format. If you have nVidia plug-in for Adobe photoshop, you will find the 8888 32 bit mode in a drop-down menu. Not sure about other converters.
2. Unpack your h5m map file
3. Move the dds images to where all other unpacked map files are.
4. For each dds file create a new reference file (use Notepad). Copy pase the following code into them, and pay attention that DDSFILENAME.dds is replaced with your own dds file name. Save all with xdb not txt extension.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Texture>
	<SrcName href="/"/>
	<DestName href="/DDSFILENAME.dds"/>
	<Type>TEXTURE_2D</Type>
	<ConversionType>CONVERT_TRANSPARENT</ConversionType>
	<AddrType>CLAMP</AddrType>
	<Format>TF_8888</Format>
	<Width>240</Width>
	<Height>180</Height>
	<MappingSize>0</MappingSize>
	<NMips>1</NMips>
	<Gain>0</Gain>
	<AverageColor>0</AverageColor>
	<InstantLoad>true</InstantLoad>
	<IsDXT>false</IsDXT>
	<FlipY>false</FlipY>
	<StandardExport>true</StandardExport>
	<UseS3TC>false</UseS3TC>
</Texture>
Note: <AverageColor>0</AverageColor> often have some values, but I (Pitsu) am not sure whether it is necessary to have them. One can always copy the values or entire reference files from data.pak/Maps/SingleMissions. i.e. from the official map catalogues.
6. Find map-tag.xdb file in the same directory and open it in Notepad
7. Replace <thumbnailImages/> with

Code: Select all

	<thumbnailImages>
		<Item href="/NAME_OF_THE_TEXT_FILE_YOU_JUST_CREATED.xdb#xpointer(/Texture)"/>
		<Item href="/NAME_2.xdb#xpointer(/Texture)"/>
	</thumbnailImages>
One line is required for each image (Or in fact for each .xdb reference file that you created before).
8. Save and exit Notepad
9. Pack everything back to a proper h5m file.

How do make scripts working in multiplayer games?

Hehee, may I suggest waiting for Heroes VI?
Last edited by Pitsu on 02 Apr 2007, 06:02, edited 5 times in total.

User avatar
alavris
Scout
Scout
Posts: 164
Joined: 06 Jan 2006
Location: Poland
Contact:

Unread postby alavris » 10 Oct 2006, 18:12


JagoBC
Leprechaun
Leprechaun
Posts: 29
Joined: 29 May 2006

Unread postby JagoBC » 13 Oct 2006, 05:42

Hey Man, I think I followed your instructions to the letter, but the peasant hut still acts like a peasant hut. I am playing in singleplayer, but could the script only work if the map is set up as scenario?

Also, when I check the function, it gets the following errors:
Function not defined line 1
Oldowner not defined line 1
townname not defined line 1

Any thing else you can think of?

User avatar
alavris
Scout
Scout
Posts: 164
Joined: 06 Jan 2006
Location: Poland
Contact:

Unread postby alavris » 13 Oct 2006, 13:40

JagoBC wrote:I am playing in singleplayer, but could the script only work if the map is set up as scenario?
Scripts always work on multiplayer map when playing in singleplayer mode.
Also, when I check the function, it gets the following errors:
Function not defined line 1
Oldowner not defined line 1
townname not defined line 1
Don't worry about these errors. Editor always marks your own functions as undefined. That causes no problems.

It's hard to say what did you do wrong when I don't see the source... I've send you PM with my email adress, where you can send me your map file and I'll tell you what was done wrong.
.

myythryyn
Assassin
Assassin
Posts: 293
Joined: 05 Sep 2006

Unread postby myythryyn » 12 Nov 2006, 22:00

thanks to Pitsu, we now have bigger message boxes !!!

no more having your messages squashed into a small annoying box


here is the post with the link to download the mod, and how to install it....which i eventually figured out

viewtopic.php?t=4612

User avatar
Mesciurius
Leprechaun
Leprechaun
Posts: 13
Joined: 15 Sep 2006
Location: the lands of Ascalon
Contact:

How to Create a new Campaign

Unread postby Mesciurius » 04 Dec 2006, 06:53

Neckie found how to make new campaigns.
http://elrath.com/forums/index.php?showtopic=615
The life is full of excitement, the afterlife is all quiet and peace ,But the passing from one to another is really anoying.

User avatar
Pitsu
Round Table Hero
Round Table Hero
Posts: 1830
Joined: 22 Nov 2005

Unread postby Pitsu » 28 Dec 2006, 12:51

Patch 1.4 removes some objects from the editor. How to get them back can be found: http://www.celestialheavens.com/forums/ ... php?t=4585
Avatar image credit: N Lüdimois

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

Adding PWL image

Unread postby Sarvi » 21 Apr 2007, 05:10

The notes given by Pitsu are very incomplete! You have to enter a number of other factors in the PWL reference file, not just the name of your .dds picture file. Check out someones map which has a PWL picture.
Ach wie schoen das niemand weiss....

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 » 21 Sep 2007, 09:40

Put this small code in your script to watch the AI while you playtest. It clears the fog of war on both floors.
-- Clear fog of war
for i= 0,GetMaxFloor() do
OpenCircleFog (0, 0, i, 9999, GetCurrentPlayer())
end;
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."

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

Unread postby rdeford » 21 Jan 2008, 21:17

No Hump Bridges

It is easy to make bridges with the H5 editor that do not have humps in the land where the bridge meets the shore.

Method #1
First place, then select a bridge segment on the map. Then, over in the object properties, set the value of the Pos Z property to a negative value around -2.4 to -3.1 depending on the terrain tile. When you de-select the bridge segment, it will be positioned even the land instead of floating above it. Repeat these steps for each segment in the bridge. In order to Show AI Passability, you must first Save the map and Reload it.

Disadvantages to this method are that the arch supports under the bridge are mostly submerged, and that the editor sometimes resets the negative value to 0 while you are working on the map so you have to do it again. If you're not happy with these disadvantages, see Method #2.

Method #2
Beginning with a new, blank map, here is how you do it:
  • 1.) Use the x7 Lower tool to make a small body of water anywhere on your map that is 7X7. The location is not important.

    2.) Place a Grass bridge1_end at one side of the water such that the bridge entry ramp is entirely over land, and the bridge support arch just touches the edge of the shore.

    3.) Place the x3 Bulk tool selection rectangle over the bridge entry ramp and set the Strength = 10.

    4.) Turn the Show AI Passablility check off because it makes it hard to see what is happening in the next step.

    5.) Click several times to progressively raise the land under the bridge to make a hump under the ramp. Keep clicking until the top of the hump rises to just barely touch the underside of the entry ramp. Do not bury or cover up the ramp bricks.

    6.) Save the map and use the Reload Map command to reload the map.

    7.) Turn on the Show AI Passability check and confirm that your ramp has one clear passability square directly in front of the ramp, and that the land touches the bottom of the ramp and looks natural and good at the end and sides of the ramp. (Set the strength to = 2 and use the Bulk and Dig tools as necessary.)

    8.) Select the x1 Plato tool and click-and-hold on that one clear passability square of land directly in front of the bridge entrance.

    9.) Drag the mouse away from the bridge while holding the mouse button down to create a plateau of land extending away from the ramp. (Move the mouse in a circular motion to make the plateau at least seven squares wide and long.)

    10.) Select the x7 Plato tool and click-and-hold anywhere on the plateau you just made, then drag the mouse to extend the plateau until the ENTIRE map is the exact same height as the land under the ramp, even filling in the body of water created in step one. (The bridge in will now be floating in the air over the blank landscape. Just delete it.)

    11.) Make your waterways and seas with the Lower tool exactly as if the plateau was the normal land height.

    12.) Begin building bridges across the waterways. You'll notice that you can place the bridge ends up against the shore so that the bridge support arch is embedded in the shore, and that the entry ramp is at the same height as the land without having to make any humps.

    13.) Proceed with shaping your landscape more or less normally, treating the top of the plateau as if it were the normal top of the land. Raise and lower the land to makes mountains and valleys as you wish. Just be careful around the bridge ends with the Lower, Smooth, and Zero tools and you should be fine.
Use the map editor to look at my Vision Quest map to see some of the many possibilities.

Happy map making,
Last edited by rdeford on 12 Dec 2008, 14:08, edited 1 time in total.
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

User avatar
Piercing-Dreams
Leprechaun
Leprechaun
Posts: 1
Joined: 30 Jan 2008

Re: Editor tips for H5

Unread postby Piercing-Dreams » 30 Jan 2008, 10:44

Pitsu wrote: How to add a PWL image?
This function is not working properly in version 1.3 editor.

[...]

2. Go to the map properties tree in map editor and generate a new reference file for PWLPicture

[...]
Could you expand on how to generate a new reference fole for PWLPicture?

User avatar
Pitsu
Round Table Hero
Round Table Hero
Posts: 1830
Joined: 22 Nov 2005

Re: Editor tips for H5

Unread postby Pitsu » 30 Jan 2008, 16:35

Piercing-Dreams wrote:
Could you expand on how to generate a new reference fole for PWLPicture?
Fiur has been more active recently and he is posting at HC
Avatar image credit: N Lüdimois

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 12 Dec 2008, 13:25

Grumpy Old Wizard wrote:Put this small code in your script to watch the AI while you playtest. It clears the fog of war on both floors.
-- Clear fog of war
for i= 0,GetMaxFloor() do
OpenCircleFog (0, 0, i, 9999, GetCurrentPlayer())
end;
GOW
Nice alternative, but I have something a lot better. In fact, I'll make a short guide here how to test maps easier :)

How to test maps easier

The most important thing for easy testing map-related stuff is the Console. To activate it, do the following:

Go to the directory where you installed Heroes 5. Then enter the profiles folder, and open the autoexec_a2.cfg file with Notepad (if you don't have Tribes of the East, open autoexec.cfg)

Add the following line at the beginning of this file:
setvar dev_console_password = schwinge-des-todes

Now go to your My Documents directory (Documents and Settings\user name\My Documents), enter the My Games\Heroes of Might and Magic V - Tribes of the East\profiles folder (without TotE you should enter My Games\Heroes of Might and Magic V\profiles). Now enter the folder with your profile name in the game. Open input_a2.cfg (input.cfg without TotE) with Notepad.

Add the following lines at the beginning of this file:
bind show_console '`'
bind fog_of_war 'CTRL' + 'SHIFT' + 'F'
bind adventure_teleport 'CTRL' + 'SHIFT' + 'T'


Now you activated the console! (you never have to do this again - unless you change your game profile)


To open the Console in game, press the key right to the left of your 1 key (the ` or ~ key). To hide the console, press it again when it is opened.

With the console you can do lots of interesting stuff. First, it shows you errors and some other things (like what AI does each turn). Second, you can execute all functions available in the scripts as well. However, you need to type @ at the start of the line if you want to execute scripting functions.

Here are some examples:

WRONG:
print(GetCurrentPlayer())
@print(@GetCurrentPlayer())

CORRECT:
@print(GetCurrentPlayer())


With the Console you can also cheat. There are many useful cheats described in the .pdf dedicated to cheats (in the same folder where there are the editor documentation ones). However, there are also two more very important cheats (VERY useful when testing a map) that I'll explain below.

In order to cheat, you need to type enable_cheats in the Console after you start the Map. Then you can enter any cheats you like (from that .pdf) and they will work. As for the other 2 very important cheats, here's how to do them and what they do:

Try holding your CTRL and SHIFT keys while pressing F, and you should deactivate the Fog of War on the map.
And for teleporting your hero: select the hero you want to teleport, move the cursor on the place you want him/her to be teleported and then press the T key while holding the CTRL and SHIFT keys. Note that you can't teleport your hero someplace where (s)he can't, e.g. in an unwalkable tile or near an enemy creature or hero.

Those CTRL+SHIFT+R or CTRL+SHIFT+T were actually defined in that file you customized for the cheats, check it again and you'll see the resemblance. :)


No more headaches, you can use the variety of cheats to test almost anything without having to modify the map temporarily for tests. You can even type scripting commands in the Console to test how they work! ;) (but remember the @ at the beginning of the line when writing scripting commands)
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 11 Jan 2009, 19:57

Some more tips I'd like to share, probably you may find them useful. :)

(note I'm talking about TotE)


As you well know, in Multiplayer all scripts are disabled except the Map Script. If you didn't know, then you know now. That's most probably a flaw in their design (since pre-TotE all scripts were disabled in multi, and they enabled the Map Script but forgot about the others)

I have a theory (never tested so not sure if it works) for an alternative to do it manually. You have to disable the normal interaction with the monster, then set a trigger to take action when you interact with the monster and use combat starting functions when that event triggers. All of this in the Map Script (that works in the multiplayer mode as well)

Example:

Code: Select all

function Combat1(hero, monster)
  -- start combat and do other custom combat things here
end

function Combat2(hero, monster)
  -- likewise
end

-- and so on until last custom monster combat function


for i = 1, numMonsters do
  SetObjectEnabled("Monster"..i, nil)

  Trigger(OBJECT_TOUCH_TRIGGER, "Monster"..i, "Combat"..i)
end
In that example numMonsters is obviously the number of monster objects on the map, and they must be named like "Monster1", "Monster2", and they must be consecutively.

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


Also here's a short explanation of those 'weird' random map template names. It is weird because it has a 'code' to make it easier to see its properties.

S is the recommended size
P is the recommended number of players
Z is the number of zones it has

and the others I have no idea (like K, etc)

So, let's take a look in an example: s3-5P2-8z8k2

which means:

S3-5 -> recommended minimum size 3, maximum 5 (don't ask me what these numbers mean, I don't know for sure, they're based on the size of the map + if it has underground or not (obviously underground makes it larger))

P2-8 -> recommended minimum number of players 2, maximum 8.

Z8 -> 8 zones for each player.

K2 -> no idea

If somebody knows what that K means or V or R at times, please share it here, I'd like to know as well :D
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

ReinierK
Leprechaun
Leprechaun
Posts: 39
Joined: 24 Jan 2009

Unread postby ReinierK » 25 Jan 2009, 15:07

Don't know if it has been mentioned before:
If you're experiencing "blurry" graphics in the editor after you initially move the camera do this:

1. Load the map you want to edit.
3. Reload the map (yes, load it twice in a row) from the "Open" menu or the "Recent maps" menu, do NOT use the reload BUTTON.
4. Everything should be fine now ;-)

mweil86
Leprechaun
Leprechaun
Posts: 13
Joined: 11 Sep 2007

creating a PWL

Unread postby mweil86 » 14 Dec 2009, 02:49

Regarding the creation of a PWL: how exactly do I "rename the zip back to h5m file"? Don't I need to convert the file type somehow?

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

Re: creating a PWL

Unread postby rdeford » 14 Dec 2009, 17:05

mweil86 wrote:Regarding the creation of a PWL: how exactly do I "rename the zip back to h5m file"? Don't I need to convert the file type somehow?
No conversion needed. The game simply requires a different extension. Edit the filename, but change only the extension.
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

v1adimir
Leprechaun
Leprechaun
Posts: 10
Joined: 14 Jan 2010

Level cap

Unread postby v1adimir » 14 Jan 2010, 22:38

Hi, everyone!
Could anyone explain me how to set a level cap for a map?
Thanks!

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

Unread postby rdeford » 14 Jan 2010, 23:41

Hi, everyone!
Could anyone explain me how to set a level cap for a map?
Thanks!
  • Open the map in the H5 Editor.
    Look under View/Map Properties/General Map Properties.
    Put a check in the Restrict Hero Level To check box.
    Type the level you wish to restrict the map to in the field.
    Click OK.
    Save your changes.
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

love2winalot
Leprechaun
Leprechaun
Posts: 9
Joined: 20 Feb 2006

Caravans

Unread postby love2winalot » 20 Jan 2010, 16:28

Hiya. How do you all prevent, "custom made maps" the pc from getting so many caravans that they block his own entry/exit from his castle? A human has to downgrade creatures, allow caravan to put them in the full castle, and then re upgrade them. But when a pc castle is full an upgraded, their caravans are stuck at the castle entry. What to do?


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 7 guests