[H5 EDITOR] Troubleshooting topic

Maps and the art of mapmaking.

Moderator: Moderators

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

Postby alavris » Sep 27 2006, 20:45

Thanks Pitsu! That was helpful :)

edit: How do you convert TGA to DDS? I was searching for some freeware program, but found nothing...
.

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

Postby Pitsu » Sep 28 2006, 7:27

alavris wrote:edit: How do you convert TGA to DDS? I was searching for some freeware program, but found nothing...
.


I used http://eliteforce2.filefront.com/file/DDS_Converter;29412 but there might be better ones available.

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

Postby alavris » Sep 28 2006, 8:34

Pitsu wrote:I used http://eliteforce2.filefront.com/file/DDS_Converter;29412 but there might be better ones available.


I've known this application before, but it didn't work. Here's error message screen:

Image

Do you havy any idea what could be wrong?
.

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

Postby Pitsu » Sep 28 2006, 8:43

Are you sure your tga image is exactly 1024 x 1024 pixels? The "not a power of 2" error should mean that your image does not have 2^n x 2^m pixels.

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

Postby alavris » Sep 28 2006, 9:46

Pitsu wrote:Are you sure your tga image is exactly 1024 x 1024 pixels? The "not a power of 2" error should mean that your image does not have 2^n x 2^m pixels.


LOL! I was wondering what "not a power of 2" could mean, but it simply is "2^x". :) I resized this picture to 1024x1024 and it works fine now. Thanks!
.

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

Postby Pitsu » Sep 28 2006, 11:32

Did you also get the image working in the game? I do not have the possibility to test right now, but i am curious also whether it actually needs *both* images. Especially since the tga format takes almost 3 MB...

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

Postby alavris » Sep 28 2006, 13:31

Pitsu wrote:i am curious also whether it actually needs *both* images. Especially since the tga format takes almost 3 MB...

I tried it without TGA file and worked ok. I also deleted this line from my 111.(Texture).xdb file:

Code: Select all

<SrcName href="111.tga"/>

I've not tried yet if it works without deleting this line.
.

User avatar
fiur
Pixie
Pixie
Posts: 129
Joined: 06 Jan 2006

Postby fiur » Sep 29 2006, 15:59

Pitsu wrote:
Evenshade wrote:Has anyone succeeded in getting their own PWL image to work for their map? I seem to have the procedure right (according to the tutorial), but whenever I go to provide the SrcName (i.e., the .tga file) for the texture, it just simply refuses to put the text of the filename in or load the file. I always just get a pure grey PWL background when I start the map ingame...


Looks like the editor does not want to convert the tga and create proper references. By manually creating a dds file and proper reference files and adding them into h5m archive it can be done.

Image

1. Create tga and dds files of the image and place them into unpacked map directory where you have all other map files.

2. Create text file named for example PWL.(Texture).xdb with the following text (the parameters can later be edited in editor if i am not mistaken): Note the references to image files ("filename.tga or dds"). EDIT: in fact this is the file you can create in editor already. The editor simply refuses to put the image file references into it and leaves the "href=" blank.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Texture>
   <SrcName href="filename.tga"/>
   <DestName href="filename.dds"/>
   <Type>REGULAR</Type>
   <ConversionType>CONVERT_TRANSPARENT</ConversionType>
   <AddrType>CLAMP</AddrType>
   <Format>TF_DXT1</Format>
   <Width>1024</Width>
   <Height>1024</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>


3. pack everything into a h5m archive again.

If it does not work like that, then i have forgotten to mention something. ;|


oh..... plz help me with this one....
I've done all you describe above... first make an tga file coverted it to dds... saved both file in my \map folder
then created an PWL.(Texture).xdb with your code within (and yes both my tga and dds file are in there.....)
then I've put this PWL.... file into my h5m file...... when I now start my map I only get a "grey" screen..... what's wrong.....
(when I put this PWL file into my map file I must change it to .pak right??? and then back to .h5m after...)
anyway I'm stucked on this.....

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

Postby alavris » Sep 29 2006, 16:18

fiur wrote:saved both file in my \map folder

Both graphic files must be put into h5m file.
.

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

Postby alavris » Sep 29 2006, 16:25

fiur wrote:when I put this PWL file into my map file I must change it to .pak right??? and then back to .h5m after...

First rename map.h5m to map.zip, then extract it. Now, add TGA, DDS and (Texture).XDB files into the extracted folder. Pack this folder into map.zip. Rename map.zip to map.h5m.
.

User avatar
fiur
Pixie
Pixie
Posts: 129
Joined: 06 Jan 2006

Postby fiur » Sep 29 2006, 17:11

wow fast reply... well now I've got all 3 files in my name.h5m file...
(dragon.tga, dragon.dds and the PWL.(Texture).xdb

when I start the map I guess I maybe get my image for 1 ms or so not sure... after that I get the "griffin" back again...
:(
oh my god I'm stupid :'(

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

Postby alavris » Sep 29 2006, 17:32

So, lets make it this way... Here is my test-map, with working PWL:

http://d.turboupload.com/de/1029817/79qpi4h5fd.html#

Study structure of this file... and I think everything should be clear then. :)
.

User avatar
fiur
Pixie
Pixie
Posts: 129
Joined: 06 Jan 2006

Postby fiur » Sep 29 2006, 17:46

thanx alot.....
now I can se that I'm missing the "path" to my tga and dds file
(maps\multiplayer\"mapname"\)
all other files got the right path exept these two files....
how do I make the path right ?

Okay I've got it right now.... just needed to open the file with "winrar" then add the files and then they got the right "path"
thanx alot for all your effort.... :)

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

Postby alavris » Sep 29 2006, 18:17

Hmmm.... I'm not sure if I understand clearly what you are trying to say :) But if I'm going the right path... Unpack your h5m file and just copy TGA and DDS files into unpacked [maps\multiplayer\"mapname"\] folder. Then zip this whole path again into h5m format.

But if the problem is in other thing, just tell me, because as I said, I'm not sure if I understood you the right way. :)
.

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

Postby Grumpy Old Wizard » Sep 30 2006, 10:09

My map is a single player map with all 6 positions playable. I am trying to determine which heroe the player selects at the start of the map. The heroe is generated in the player's town. Here is the script I have tried.

--determine human player
whoishuman = GetCurrentPlayer(); --determine human player, always goes first
humanheroelist = GetPlayerHeroes(whoishuman);
humanmainheroe = humanheroelist(0);
LevelUpHero (humanmainheroe); --debug routine


I know from other code that the variable "whoishuman" is set correctly. Am I referencing the array correctly? Below is how the manual describes GetPlayerHeroes.

GetPlayerHeroes
GetPlayerHeroes – return the names of the heroes belonging to the player
Syntax
GetPlayerHeroes(playerID);
Description
This function returns an array that contains the names of the heroes belonging to the specified player.
playerID – the player’s number


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."

Othmaar
Leprechaun
Leprechaun
Posts: 22
Joined: 27 Sep 2006
Location: Oslo, Norway

Postby Othmaar » Sep 30 2006, 10:25

It would help to know what error message you get, if any. I always reference arrays with brackets:

Code: Select all

humanmainheroe = humanheroelist[0];


It is also worth mentioning that LUA starts indexes for arrays at the number 1, but the function GetPlayerHeroes() returns an array with index starting at 0, as you have correctly used.
O.

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

Postby Grumpy Old Wizard » Sep 30 2006, 12:58

Othmaar wrote:It would help to know what error message you get, if any. I always reference arrays with brackets:

Code: Select all

humanmainheroe = humanheroelist[0];


It is also worth mentioning that LUA starts indexes for arrays at the number 1, but the function GetPlayerHeroes() returns an array with index starting at 0, as you have correctly used.


Thanks! Changing the paranthesis to brackets worked!

The error I had been getting was that the heroe was not leveling up.

I had put
LevelUpHero (humanmainheroe);

in the script to level up the heroe so I would know whether or not
humanmainheroe = humanheroelist(0);

was working. It was not, and you found the cause. Thanks again. :)

Edit: The information about arrays starting with element 1 will also probably save me some headache!

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
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Postby Grumpy Old Wizard » Sep 30 2006, 15:29

GetDifficulty() does not show up in the editor as red and I could not get it to work so I'm guessing the function was disabled. Looks like we need to look at the gold values to determine difficulty like was necessary in HOMM4....unless I'm missing something.

difficultylevel = GetDifficulty();
if difficultylevel == "DIFFICULTY_HARD" then
MessageBox ("Maps\SingleMissions\Seize The Throne\debugmess1.txt");
end;

if difficultylevel == "DIFFICULTY_HEROIC" then
MessageBox ("Maps\SingleMissions\Seize The Throne\debugmess2.txt")
end;



GetDifficulty
GetDifficulty – determine the game’s difficulty level
Sytax
GetDifficulty(void);
Description
This function returns the game’s difficulty level. The following constants are set to identify the difficulty levels: DIFFICULTY_NORMAL, DIFFICULTY_HARD, DIFFICULTY_HEROIC. The constants are sorted by growth, which makes it possible to use constructions like GetDifficulty() > DIFFICULTY_NORMAL, etc.

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
fiur
Pixie
Pixie
Posts: 129
Joined: 06 Jan 2006

Postby fiur » Sep 30 2006, 19:22

alavris wrote:Hmmm.... I'm not sure if I understand clearly what you are trying to say :) But if I'm going the right path... Unpack your h5m file and just copy TGA and DDS files into unpacked [maps\multiplayer"mapname"\] folder. Then zip this whole path again into h5m format.

But if the problem is in other thing, just tell me, because as I said, I'm not sure if I understood you the right way. :)
.


I got it right (when I start my map now the PWL are loading......)
But today I've been working with the PWLTutorialHinttrigger
that's a hard one here is what I found in the Heritage.pak file:
<?xml version="1.0" encoding="UTF-8"?>
<AdvMapDescTag>
<AdvMapDesc href="/M4.xdb#xpointer(/AdvMapDesc)"/>
<NameFileRef href="/Name.txt"/>
<DescriptionFileRef href="/Description.txt"/>
<TileX>136</TileX>
<TileY>136</TileY>
<Goal>OBJECTIVE_KIND_DEFEAT_ALL</Goal>
<teams>
<Item>4</Item>
<Item>4</Item>
</teams>
<thumbnailImages>
<Item href="/mM4_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_2_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_3_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_4_pic.xdb#xpointer(/Texture)"/>
</thumbnailImages>
<HasUnderground>true</HasUnderground>
</AdvMapDescTag>

(map-tag.xdb for Heritage)
----------------------------------------------------------------------------


<?xml version="1.0" encoding="UTF-8"?>
<Texture>
<SrcName href="/texture/Interface/PWL/Multipayer/mM4_4.tga"/>
<DestName href="/mM4_4_pic.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>-29812472</AverageColor>
<InstantLoad>true</InstantLoad>
<IsDXT>false</IsDXT>
<FlipY>false</FlipY>
<StandardExport>true</StandardExport>
<UseS3TC>false</UseS3TC>
</Texture>

(mM4_pic.xdb for Heritage)
-----------------------------------------------------------

</AvailableHeroes>
<MapRumours/>
<Music/>
<MoonCalendarModifications>
<BlockMonstersWeeks>false</BlockMonstersWeeks>
</MoonCalendarModifications>
<thumbnailImages>
<Item href="/mM4_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_2_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_3_pic.xdb#xpointer(/Texture)"/>
<Item href="/mM4_4_pic.xdb#xpointer(/Texture)"/>
</thumbnailImages>
<PWLPicture/>

(parts of M4.xdb for Heritage)

I did the same on my name.h5m file.... (only ofcourse used my file names ;) )
coverted all my dds file into the correct size (240*180)
and put it all into my name.h5m file
but when I'm in the selection screen I don't get any images beside the description of the map..... :(
I've been working on this for about 5 hours now and think I'm giving up by now... ;|

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

Postby alavris » Sep 30 2006, 21:02

fiur wrote:I did the same on my name.h5m file.... (only ofcourse used my file names ;) )
coverted all my dds file into the correct size (240*180)
and put it all into my name.h5m file
but when I'm in the selection screen I don't get any images beside the description of the map..... :(
I've been working on this for about 5 hours now and think I'm giving up by now... ;|

Could you upload your map file somewhere (for example on turboupload.com) that I can check what's inside? I think it would be easier way to find the solution...
.


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 3 guests