[H5 EDITOR] Troubleshooting topic

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

Unread postby Pitsu » 16 Jun 2007, 07:29

Snow is in expansion. IIRC there were some hidden/disabled snow textures in the original editor too, but do not remember how to activate them and were they any use at all.
Avatar image credit: N Lüdimois

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 » 16 Jun 2007, 16:37

Under Conquest Objects you can find some snow skins for mountains. Other than that you need the HOF expansion as Pitsu said.

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
Wolfsburg
Demon
Demon
Posts: 316
Joined: 19 Apr 2007
Location: Chräiebuerg

Unread postby Wolfsburg » 12 Jul 2007, 04:11

Salve guys,

I checked some of the previous pages in this thread and I know this is a quite frequent question, but I regret to inform that the old links/answers didnt help me much. Here it goes:

I want to be able to edit the multiplayer maps (or even the single player-custom maps from Ubi). But I dont seem to find the goddamn .h5m files! I assumed they were all probably packed in a .pak file. And indeed it was so. I've unpacked the .pak files but the maps are still not .h5m! Instead they are mini folders with crazy files which I cannot understand or access.

Is there a logical yet simple solution for this?

Thanks,
W.

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

Unread postby Pitsu » 12 Jul 2007, 07:32

Wolfsburg wrote: I want to be able to edit the multiplayer maps (or even the single player-custom maps from Ubi). .
download the maps in h5m format from http://www.heroesofmightandmagic.com/he ... maps.shtml
Avatar image credit: N Lüdimois

User avatar
Drax
Leprechaun
Leprechaun
Posts: 10
Joined: 21 Jun 2006
Location: Texas
Contact:

Help with message parameters

Unread postby Drax » 13 Jul 2007, 01:28

I posted this under another thread, but this might be the place to ask for help so here goes. I am trying to pass a number to a message for display.
I have the following in my "GotnMages.txt resource text file

You have trained <value=level_mages> new mages.

And below is what is in the script, but I get no display at all, nothing! What am I missing here? Help.

MessageBox({path.."GotnMages.txt"; level_mages = 5});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Imagination is more important than intelligence.' - Albert Einstien

silvergecco
Leprechaun
Leprechaun
Posts: 1
Joined: 09 Aug 2007

Unread postby silvergecco » 09 Aug 2007, 20:54

Please oh please someone let me know why the sample below doesn't wanna work :mad:

function dwellings()
if GetObjectiveState("PreTaskDwelling",OBJECTIVE_COMPLETED) then
OpenCircleFog(50,7,0,14,0);
OpenCircleFog(46,25,0,14,0);
OpenCircleFog(28,50,0,14,0);
end;
end;

Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"PreTaskDwelling","dwellings")

thanks in advance

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

Unread postby Pitsu » 10 Aug 2007, 07:59

Code: Select all

 

function dwellings()
if GetObjectiveState("PreTaskDwelling") == OBJECTIVE_COMPLETED then -- this line was certainly not as it should have been
	OpenCircleFog(50,7,0,14,0); --- Is 0 a valid value for the last parameter?1 to 8 ?
	OpenCircleFog(46,25,0,14,0);
	OpenCircleFog(28,50,0,14,0);
end;
end;

Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"PreTaskDwelling","dwellings")
Avatar image credit: N Lüdimois

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 10 Aug 2007, 10:50

Pitsu wrote:

Code: Select all

 

function dwellings()
if GetObjectiveState("PreTaskDwelling") == OBJECTIVE_COMPLETED then -- this line was certainly not as it should have been
	OpenCircleFog(50,7,0,14,0); --- Is 0 a valid value for the last parameter?1 to 8 ?
	OpenCircleFog(46,25,0,14,0);
	OpenCircleFog(28,50,0,14,0);
end;
end;

Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"PreTaskDwelling","dwellings")
Thanks here too Pitsu. I was too tired to have an idea of wrong ID ;|

... and so it works but there was an other problem which I let You know here: always read at least 5 times what name of object(ive) U're working with!!! ;) So Razzak is on his march now and no one can stop him any more! Thanks again a lot Pitsu! :-D
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 10 Aug 2007, 13:26

bargh... scripting is a mess with this game...
SetRegionBlocked("border1",true,1); doesn't work. Things I've tried:
- tried false instead of true but I guess true is for blocking and false is unblocking
- tried PLAYER_1 instead of ID '1'
- name of the region is fine
- tried to trigger the event for first day

Should hero really stop so simple when reaching the area? But if I use REGION_ENTER_AND_STOP then it is passable just it stops by every step in the area, am I right?
Is it OK without triggering?

An other question I have... is there an offical/legal way to run editor and game at the same time? Would fasten up testing. :wall:
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

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

Unread postby Pitsu » 10 Aug 2007, 13:54

cgsilver wrote: - tried false instead of true but I guess true is for blocking and false is unblocking
Do not remember by heart, but try 1 and nil or 1 and 0 instead of true/false.
Should hero really stop so simple when reaching the area? But if I use REGION_ENTER_AND_STOP then it is passable just it stops by every step in the area, am I right?
Is it OK without triggering?
A hero cannot enter blocked region at all - horse cursor does not even appear when hovering over blocked area or beyond. A enabled region with ENTER_AND_STOP trigger causes hero to stop when *entering* the region (not every tile when in the region)
An other question I have... is there an offical/legal way to run editor and game at the same time? Would fasten up testing. :wall:
As far as i know not. However, since scripts, unlike map objects etc, are not loaded with game but when a map is started you can edit the scripts without quiting the game. At least it was possible a few patches ago. Forget the editor and open map with winzip or winrar archiver. Do not unpack it but just open and find the mapscript.lua file. Edit (notepad text editor) it as you wish and compress it back. Edited script should now run when restarting the map, no need to quit and restart entire game.

For debugging, I strongly recommend to allow show console in order to see error messages.
Avatar image credit: N Lüdimois

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 10 Aug 2007, 14:20

Pitsu wrote: Do not remember by heart, but try 1 and nil or 1 and 0 instead of true/false.
Pretty strange but it works with 1 though I swear I tried it first. Anyway it's fine now... maybe somewhere there was an intersection in regions?? I thought true and false are OK but now I tried again with true and it doesn't works.
Thanks for the rest of the tips too. Try them ASAP.

:hail: :hail: :hail:
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 10 Aug 2007, 16:13

well at the end everything is just f***d up... I noticed that I have so many unnecessary files in the resource directory (4 files for the scripts as every time I've cleared and later started again writing script this s**t created a new file). After that those script wich were fine didn't work anymore. I now put back the old files (are in my h5m files too) - still no work.
I tried to start new script (it created a fifth file for that) but again script did not work.
So I think that was my few-day-map-creator-career... if someone needs a map to finish and has the time and energy to find out what's wrong I can send him gladly. The map is about Razzak who is heading for a far-away town for the secrets of 'how to make obsidian golems'.
All adventure elements are made. Might need some balance and some text and of course scripting...

Peace be with all
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

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 » 10 Aug 2007, 18:25

Don't give up! Unwanted files are easy to get rid of. Click on one to highlight it and hit the delete button. The file may appear to still be there but when you save and reload the map it will be gone.

Experiments, trial and error, question asking, reading through the forum and examing maps made by others are all ways to learn.

Scripting is frustrating when you are learning it but like all things in life, it will become much easier when you get some experience. :)

I recommend making frequent backups of your map so you can easily undo things.
After that those script wich were fine didn't work anymore.
Post your script and we'll see what is wrong. I will probably be out of town for a couple of days though (not sure if I'm leaving tonight or in the morning.)

As far as messages, the most common problem is that the slashes are in the wrong direction in the path. The editor sometimes saves them facing in the wrong direction.

Slashes should be facing as in the direction in this tidbit:
path = "Maps/SingleMissions/Shadow Dreams/"; -- shorthand
Here is an example from the map I am currently working on about blocking regions.
--Only allow human Academy acces to The Grey Tower
SetRegionBlocked("rgnTheGreyTower", 1, 1);
SetRegionBlocked("rgnTheGreyTower", 1, 2);
SetRegionBlocked("rgnTheGreyTower", 1, 3);
SetRegionBlocked("rgnTheGreyTower", 1, 4);
SetRegionBlocked("rgnTheGreyTower", 1, 5);
SetRegionBlocked("rgnTheGreyTower", 1, 6);
SetRegionBlocked("rgnTheGreyTower", 1, 7);

if whoishuman == 1 then --unblock for human Academy
SetRegionBlocked("rgnTheGreyTower", off, 1);
end;
In the above example the region is initially blocked for all 7 players. Then it is unblocked for the human player if he is playing the Academy. "whoishuman" is a variable that stores the player position that is human (4 positions are playable by humans.)

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

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 11 Aug 2007, 09:18

Thanks for rooting for me. But this wasn't about not being able writing scripts or making the map. Thanks for CH and Pitsu I could find lots of help here and after the difficult beginning I really understood the way scripting in H5 (I guess) and I could spot my failures.
But!!! After dipping into the fileresources of my map and deleting some files scripts stop working. After putting back the deleted files the scripts didn't work anymore.
However I really forgot that I had a backup of the file before I digged inside so thanks to U'r wizardry this fact came to my mind. SO here are some working scripts of mine:

-- ||mapstart events|| --
EnableHeroAI(Aberrar,true) --Zoltan
EnableHeroAI(Oddrema,true) --Jezebeth

-- Player1Limits
SetRegionBlocked("border1",1,1);
SetRegionBlocked("border2",1,1);

-- Player2Limits
SetRegionBlocked("aiclose1",1,2);
SetRegionBlocked("aiclose2",1,2);
SetRegionBlocked("aiclose3",1,2);
SetRegionBlocked("aiclose4",1,2);

-- Player3Limits
SetRegionBlocked("aiclose1",1,3);
SetRegionBlocked("aiclose2",1,3);
SetRegionBlocked("aiclose3",1,3);
SetRegionBlocked("aiclose4",1,3);


--||The Rest||--

-- show dwellings to capture --
function dwellings()
if GetObjectiveState("PreTaskMine") == OBJECTIVE_COMPLETED then
OpenCircleFog(50,7,0,8,1);
OpenCircleFog(46,25,0,8,1);
OpenCircleFog(28,50,0,8,1);
end;
end;

Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"PreTaskMine","dwellings")
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 12 Aug 2007, 15:09

getting along the way I do have some scripts now working ;) thanks to console however editing script while running the game seems impossible as after starting the game no modify can be made on the map files.
anyway my problem is that I have a MessagBox script which the console tells me about: "empty message text"
the script is:
function REStriggers()
MessageBox({"Maps/SingleMissions/Golem/sandsed.txt"},nil);
end;
Trigger must be OK cuz' it's a REGION_ENTER_AND_STOP_TRIGGER and heroe stops. File does exist. I tried without '.txt'. Tried without {} and also without nil at place of callback. File is not empty contains just a few characters. Name is OK.

Any idea?

Pitsu! You can't call a non-existing player into game (at least changing a town owner to a brand new ID makes it become neutral).
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

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 » 12 Aug 2007, 23:17

cgsilver wrote:anyway my problem is that I have a MessagBox script which the console tells me about: "empty message text"
the script is:
function REStriggers()
MessageBox({"Maps/SingleMissions/Golem/sandsed.txt"},nil);
end;
Trigger must be OK cuz' it's a REGION_ENTER_AND_STOP_TRIGGER and heroe stops. File does exist. I tried without '.txt'. Tried without {} and also without nil at place of callback. File is not empty contains just a few characters. Name is OK.

Any idea?
Here is a working region message script similar to the one you want to do.
function BadlandsMessage()
if GetCurrentPlayer() == whoishuman then
MessageBox("Maps/SingleMissions/Seize The Throne/Badlands.txt");
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Badlands", nil );
end;

end;

Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Badlands", "BadlandsMessage");
You don't need the brackets. Do you need the "nil" in MessageBox("Maps/SingleMissions/Golem/sandsed.txt",nil); ??

I didn't see a trigger statement within your function.

Did you doublecheck sandsed.txt to make sure it is spelled correctly?

Is anything displayed when the heroe stops in the region?

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

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 13 Aug 2007, 15:41

I found the solution for my problem (see above).

Grumpy Old Wizard wrote: I didn't see a trigger statement within your function.
There was no problem with triggering based on console, then I tried to get it on first day without triggering at all but had the same message in the console: empty message text.
Then I deleted the file both in the map file and in the resource in the editor dir. I copied an existing file which was created by the editor and renamed that file (of course changed the text) and now it works. So it seems it's not enough to create a simple txt file but You have to have a kind of txt which was created by the editor - does this have a sense??? Anyway it works now.

Anyway thanks.. I think I wil have such problems in the future :)
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons

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

Unread postby Pitsu » 13 Aug 2007, 16:04

cgsilver wrote: however editing script while running the game seems impossible as after starting the game no modify can be made on the map files.
It WAS possible, but as an "improvement" was removed in last patches. A workaround (haven't tested myself)
http://heroescommunity.com/viewthread.php3?TID=23315
Pitsu! You can't call a non-existing player into game (at least changing a town owner to a brand new ID makes it become neutral).
You indeed need to place a hero into reserve for the "new" player and prior converting the town DeployReserveHero somewhere on the map (in front of the town for excample). This player will appear on the first game creation screen, but does not have any turn until the hero is deployed.
Avatar image credit: N Lüdimois

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

Unread postby Pitsu » 13 Aug 2007, 16:10

cgsilver wrote: I copied an existing file which was created by the editor and renamed that file (of course changed the text) and now it works. So it seems it's not enough to create a simple txt file but You have to have a kind of txt which was created by the editor - does this have a sense???
When i programmed the scripting utility i had the same problem that newly created txt files had a few extra bytes in file code that preludes the file txt content. Solved it the same way that used editor created files - copied and overwrote original text.
Avatar image credit: N Lüdimois

cgsilver
Leprechaun
Leprechaun
Posts: 10
Joined: 10 Aug 2007
Location: Hungary/Budapest
Contact:

Unread postby cgsilver » 22 Aug 2007, 19:46

Pitsu wrote: You indeed need to place a hero into reserve for the "new" player and prior converting the town DeployReserveHero somewhere on the map (in front of the town for excample). This player will appear on the first game creation screen, but does not have any turn until the hero is deployed.
Thanks for the advice indeed I made changes so the map is fine with town becoming neutral but next time I'll be more wise:)

Anyway am here again with a few questions.
- I use a QuestHut now for a secondary quest wich is totally scripted (I refused to use the Quest-Creator in the ObjectProperty and everything works just fine but when a hero interacts with the hut there's a flying message that it's empty. However I use MessageBox to tell the message the flyer appears only for a moment but if it's removable pls someone let me know.
--> found the solution: SetObjectEnabled("objectname",nil)


- How to build a building with a script in a neutral town? I found only script functions that checks a building or sets the level but none of to erect a building... did anyone find a solution for it? What's up with the non-publicated script-functions? Like this I found in the scripteditor: RemoveAllMonsters but it's not publicated in the pdf...

Thanks in advance!

I'm very happy by the way that I could get along with scripting:)
Last edited by cgsilver on 27 Aug 2007, 13:34, edited 1 time in total.
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 6 guests