[H5 EDITOR] Troubleshooting topic

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

Unread postby Franzy » 25 Oct 2007, 06:37

As far as I could make it out, if you change hero's luck and morale by means of the function ChangeHeroStat, luck/morale will change permanently (at least in version 2.1). How to modify hero's luck/morale only till the next battle, like Rally Flag or Fountain if Fortune do?

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

Unread postby rdeford » 25 Oct 2007, 13:29

Hummmm... interesting question. Have you done an experiment yet to confirm that the change to luck is permanent? I have this feeling that both luck and morale are sort of dynamic stats that change around according to many factors. However, a battle may not be one of those factors. I just haven't done the experiments yet.

Assuming you are correct that a battle does not change them, I believe the only way to get around it is by writing some script. I have not tried this approach yet, but you might be able to write a hero combat script that decrements luck at the end of a battle, or that uses a game variable to flag a battle completion that you can monitor with a thread.

This is not much of an answer. Sorry. Hopefully, some scripting master out there will know more than I do and give you a better answer. If I ever do figure it out, I will post the solution.
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
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Unread postby Grumpy Old Wizard » 25 Oct 2007, 13:55

Franzy wrote:As far as I could make it out, if you change hero's luck and morale by means of the function ChangeHeroStat, luck/morale will change permanently (at least in version 2.1). How to modify hero's luck/morale only till the next battle, like Rally Flag or Fountain if Fortune do?
Yes, those are changed permanently. There is no function for temporary change. I have not tested ChangeHeroStat under TOTE yet however.

However, TOTE has added a new function that adds some interesting possibilities:
MakeHeroInteractWithObject
MakeHeroInteractWithObject – makes the hero interact with the specified object immediately,
even if the hero is not close to the object.
Syntax
{{{
MakeHeroInteractWithObject( heroName, objectName )
}}}
Description
The hero "heroName" interacts with the object "objectName" in the moment of the
command’s execution, regardless of his current position on the map.
You should be able to use this to make temporary changes by making the heroe interact with a custom building that you place in an area that the player can't access. For example, a faery ring (to change luck temporarily). You'll want to change the text messages for the ring obviously.

rdeford wrote: Assuming you are correct that a battle does not change them, I believe the only way to get around it is by writing some script. I have not tried this approach yet, but you might be able to write a hero combat script that decrements luck at the end of a battle, or that uses a game variable to flag a battle completion that you can monitor with a thread.
Have you figured out a way to attatch combat scripting to a player controlled heroe? To my knowledge combat scripting can only be applied to AI heroes.


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 » 25 Oct 2007, 14:50

The map i'm working at is for HoF.

Combat scripts CAN be assigned to human controlled heroes. Don't understand why you can't do that. Or we are talking about different things?

For example, I have a script that makes the hero cast four mass spells in the begining of the combat (like the armour of the damned used to do in Homm3 :))

User avatar
Metathron
Round Table Hero
Round Table Hero
Posts: 2704
Joined: 29 Jan 2006
Location: Somewhere deep in the Caribbean...
Contact:

Unread postby Metathron » 25 Oct 2007, 15:39

rdeford wrote: all you have to do is to open the map in the HOF editor.
I'm using the TotE editor. Sorry, I thought it was apparent from the mention of barbarian heroes.
Click the Main Town check box to put a check mark there (a Inferno or Dwarf town will be automatically shown). And now, here is the magic step that will resolve the problem-- click the Generate Hero In Town check box to put a check mark there. Repeat for each town you desire to select heroes in.
There already are check marks in both those boxes.
If this doesn't work let me know the name of the map and I'll figure something out for you on the map itself.
Thag you very buch. The map is Rise to Power. What seems strange is that when I save the map and run the game, there are two Rise to Power maps available from the scenario pool (but I don't see two files in the Maps folder), one is the original where, if you choose dwarves or barbarians you get a hero for your respective faction, whereas the other one is my modified version with larger choke point armies but no starting dwarven/barbarian heroes. :mad:
Last edited by Metathron on 25 Oct 2007, 22:22, edited 1 time in total.
Jesus saves, Allah forgives, Cthulhu thinks you'd make a nice sandwich.

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 » 25 Oct 2007, 22:15

Franzy wrote:The map i'm working at is for HoF.

Combat scripts CAN be assigned to human controlled heroes. Don't understand why you can't do that. Or we are talking about different things?

For example, I have a script that makes the hero cast four mass spells in the begining of the combat (like the armour of the damned used to do in Homm3 :))
Well, I only tried for the original HOMM5. When I made a HOF map I didn't try it again. Evidently either I screwed up my original effort or it changed under HOF. Would you mind describing how you did it?

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 » 25 Oct 2007, 22:29

The simplest way is:
1) Click-space any monster, open tab "Script" and write the script you want to use for your hero.
2) New files should appear, xdb and lua. Rename them if you want. E.G. MyCombat.lua/xdb. If you do so, make sure to correct the file reference inside xdb-file (it's a text file).
3) To set a script, use command SetHeroCombatScript(hero,path.."MyCombat.xdb#xpointer(/Script)");
4) That's all. To disable script, use command ResetHeroScript.
One thing: if two heroes engage in a battle and both have scripts, only attacker's script will be executed.

And here is my combat script I talked about:
--------------
function Start()
myhero = GetAttackerHero();
x = GetUnitManaPoints(myhero) + 26;
SetUnitManaPoints(myhero,x);
UnitCastGlobalSpell(myhero,SPELL_MASS_CURSE);
sleep(12);
UnitCastGlobalSpell(myhero,SPELL_MASS_WEAKNESS);
sleep(12);
UnitCastGlobalSpell(myhero,SPELL_MASS_SLOW);
sleep(10);

end;
---------------
Works perfectly.
Last edited by Franzy on 26 Oct 2007, 08:11, edited 1 time in total.

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 » 26 Oct 2007, 04:43

Thanks. :) Combat scripts on a player controlled heroe bring up lots of possibilities, even if they are only executed when he is the attacker.

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 » 30 Oct 2007, 16:54

Thag you very buch. The map is Rise to Power. What seems strange is that when I save the map and run the game, there are two Rise to Power maps available from the scenario pool (but I don't see two files in the Maps folder), one is the original where, if you choose dwarves or barbarians you get a hero for your respective faction, whereas the other one is my modified version with larger choke point armies but no starting dwarven/barbarian heroes. :mad:
I just bought TOTE a few days ago. I have a question for you and any resident expert who is reading this thread:

I cannot find the Rise To Power map in the user-level Maps folder, so I'm assuming it's inside the data.pak/Maps folder. I've extracted the files from that folder but cannot make sense out of what I find in the Maps folder, which is all aaa.xdb files. Where did you get your editable copy of Rise To Power? Has someone extracted the stock maps and posted them somewhere?

Regarding the trouble with two maps showing in the scenario pool but only one map in the Maps folder. I have a hunch that one of the maps is inside the data.pak/Maps folder while the other is inside the user-level Maps folder. I'm not sure how to resolve the issue yet. Hopefully, the modified map is the one in the user-level folder. (See my question above.)

Help? Anybody?
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
Metathron
Round Table Hero
Round Table Hero
Posts: 2704
Joined: 29 Jan 2006
Location: Somewhere deep in the Caribbean...
Contact:

Unread postby Metathron » 03 Nov 2007, 20:34

Awww, shucks.

GOW? Anyone? GOW?
Jesus saves, Allah forgives, Cthulhu thinks you'd make a nice sandwich.

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 » 03 Nov 2007, 22:50

You have 2 versions of the map because you have the one in the zipped file and the one you extracted to modify. Have you tried taking the original zipped up file out?

Alternately, remove the single Rise to Power map from the archive and insert the file you modified into the archive.

You could always rename the Rise to Power map that you modified so you would have both the original and modified version to chose from.

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
Metathron
Round Table Hero
Round Table Hero
Posts: 2704
Joined: 29 Jan 2006
Location: Somewhere deep in the Caribbean...
Contact:

Unread postby Metathron » 03 Nov 2007, 23:06

The problem is not that I have 2 files, it's that the modified one does not want to fully bend to my wishes. :)

I just wanted increased choke point armies so that the AI would not barge out of its area and let me explore my bit of land at leisure. I increased that successfully but when I wanted to play the map with either the dwarves or the barbarians, I could not choose a hero to match nor get one at the start of the game a.k.a. the same problem that occured with HoF if you wanted to play original HoMM V vanilla maps with the dwarves, you could not choose a dwarven hero.
Jesus saves, Allah forgives, Cthulhu thinks you'd make a nice sandwich.

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 » 03 Nov 2007, 23:25

Metathron wrote:The problem is not that I have 2 files, it's that the modified one does not want to fully bend to my wishes. :)

I just wanted increased choke point armies so that the AI would not barge out of its area and let me explore my bit of land at leisure. I increased that successfully but when I wanted to play the map with either the dwarves or the barbarians, I could not choose a hero to match nor get one at the start of the game a.k.a. the same problem that occured with HoF if you wanted to play original HoMM V vanilla maps with the dwarves, you could not choose a dwarven hero.
Well, I haven't unzipped the files yet but have you tried

View --> Map Properties --> Heroes and checking all of the boxes and then unchecking any you don't want? Maybe also use the Reset button and check them again?

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
Metathron
Round Table Hero
Round Table Hero
Posts: 2704
Joined: 29 Jan 2006
Location: Somewhere deep in the Caribbean...
Contact:

Unread postby Metathron » 04 Nov 2007, 01:09

View --> Map Properties --> Heroes and checking all of the boxes and then unchecking any you don't want? Maybe also use the Reset button and check them again?
That did the trick. So simple, too! 8|

Thank you, kind sir.
Jesus saves, Allah forgives, Cthulhu thinks you'd make a nice sandwich.

King Imp
Swordsman
Swordsman
Posts: 570
Joined: 06 Jan 2006

Unread postby King Imp » 08 Nov 2007, 18:54

I have a couple of questions since asking on the official forums is like pulling teeth to get an answer.

1) Does anyone know if there is any way to shut off the Map Properties Tree box from opening every time you load a map?

This is really getting annoying because it makes it harder for maps to load up because it has to also load that as well. I've looked everywhere, but I can't find any way to tell the editor not to start with it open every time.

2) Is there any way to change the properties of the new Outpost? I'm not talking about the properties when you place creatures inside it to guard. I'm talking about the type of Outpost it is.

I was hoping that it would automatically change based upon the type of terrain it was on, but unfortunately no matter where you place it, it still looks like you are fighting in a Haven siege on the grass. Would be nice if there was a way to change this since Nival obviously didn't think to either A) give us 8 different Outposts, or B) make it so it changed based upon the terrain.

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 » 08 Nov 2007, 23:27

King Imp wrote: 1) Does anyone know if there is any way to shut off the Map Properties Tree box from opening every time you load a map?

This is really getting annoying because it makes it harder for maps to load up because it has to also load that as well. I've looked everywhere, but I can't find any way to tell the editor not to start with it open every time.
I don't know about this one.
King Imp wrote:I have a couple of questions since asking on the official forums is like pulling teeth to get an answer.

2) Is there any way to change the properties of the new Outpost? I'm not talking about the properties when you place creatures inside it to guard. I'm talking about the type of Outpost it is.

I was hoping that it would automatically change based upon the type of terrain it was on, but unfortunately no matter where you place it, it still looks like you are fighting in a Haven siege on the grass. Would be nice if there was a way to change this since Nival obviously didn't think to either A) give us 8 different Outposts, or B) make it so it changed based upon the terrain.
1) Click on the outpost to highlight it. Click on the Object Properties Tree Button.

2) Click on the "Shared" field. Click the "new" button. Type anything in the name field. Click OK. This creates a folder and a file that we will talk about below.

3) Click the "..." button. Now on the left hand side you see a folder that has the name of your map and the name of the dummy file you just created (that was needed to create the folder.)

4) If the MapObjects folder is not expanded, click on the "+" sign in front of it to expand it. You see a folder H5A2. Expand the folder if necessary. The file inside it is the outpost, "Fopost" Right-click on Fopost and choose "copy."

5) Go down to the folder that has the name of your map. Right-click on it and chose paste. Now right click on the dummy file above it and chose delete. It will still show as being there, but will disappear when we are done.

6) Now left click on the file you just copied, the one in the folder with the name of your map. This is the file that you will be altering in order to avoid changin all outposts in this map and in every map in your TOTE folder.

7) You will notice there are a number of things over to the right that make up the outpost. You can change the model to make it look like anything you want it to look like for example. If you change the model you may need to change the blocked tiles to make it accessable. You can alo change the messages to customize your new outpost, which is highly recommended.

8) Now click on "OK" at the bottom right hand corner of the window. If you don't see the button, drag the window up a little or contract it by putting your mouse at the top of the window, left clicking, and dragging down.

That dummy file you deleted will continue to show up (if you happen to take a peek) until you save and close the map file.

You can use this same method to altar many things in the game. Just make sure you create the dummy file that creates a new folder (as in step 2) and that you work with a file you copy to that new folder so you don't create a mod that affects all the maps in your game folder.

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

King Imp
Swordsman
Swordsman
Posts: 570
Joined: 06 Jan 2006

Unread postby King Imp » 09 Nov 2007, 06:09

Grumpy Old Wizard wrote:
King Imp wrote:I have a couple of questions since asking on the official forums is like pulling teeth to get an answer.

2) Is there any way to change the properties of the new Outpost? I'm not talking about the properties when you place creatures inside it to guard. I'm talking about the type of Outpost it is.

I was hoping that it would automatically change based upon the type of terrain it was on, but unfortunately no matter where you place it, it still looks like you are fighting in a Haven siege on the grass. Would be nice if there was a way to change this since Nival obviously didn't think to either A) give us 8 different Outposts, or B) make it so it changed based upon the terrain.
1) Click on the outpost to highlight it. Click on the Object Properties Tree Button.

2) Click on the "Shared" field. Click the "new" button. Type anything in the name field. Click OK. This creates a folder and a file that we will talk about below.

3) Click the "..." button. Now on the left hand side you see a folder that has the name of your map and the name of the dummy file you just created (that was needed to create the folder.)

4) If the MapObjects folder is not expanded, click on the "+" sign in front of it to expand it. You see a folder H5A2. Expand the folder if necessary. The file inside it is the outpost, "Fopost" Right-click on Fopost and choose "copy."

5) Go down to the folder that has the name of your map. Right-click on it and chose paste. Now right click on the dummy file above it and chose delete. It will still show as being there, but will disappear when we are done.

6) Now left click on the file you just copied, the one in the folder with the name of your map. This is the file that you will be altering in order to avoid changin all outposts in this map and in every map in your TOTE folder.

7) You will notice there are a number of things over to the right that make up the outpost. You can change the model to make it look like anything you want it to look like for example. If you change the model you may need to change the blocked tiles to make it accessable. You can alo change the messages to customize your new outpost, which is highly recommended.

8) Now click on "OK" at the bottom right hand corner of the window. If you don't see the button, drag the window up a little or contract it by putting your mouse at the top of the window, left clicking, and dragging down.

That dummy file you deleted will continue to show up (if you happen to take a peek) until you save and close the map file.

You can use this same method to altar many things in the game. Just make sure you create the dummy file that creates a new folder (as in step 2) and that you work with a file you copy to that new folder so you don't create a mod that affects all the maps in your game folder.

GOW


Holy Christ! Was it really that hard for Nival to just give us Outposts already set up? I'm sorry, but it is truly ridiculous that they expect us to go through all of this and risk messing something up just to get a simple result.

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 » 09 Nov 2007, 06:55

It is not quite as complicated as it seems. I just tried to spell out the steps in detail. Once you change a couple of buildings you'll be doing it easily.

You can do things like make dwellings for wolves (which I did in Shadow Dreams using the cyclops stockpile) or make a town that looks like a light house (which is also in Shadow Dreams as a wizard's tower.) The editor is really pretty powerful but, yeah, it could be a lot more friendly.

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 » 17 Nov 2007, 15:37

Thanks GOW. It is good to see the steps in this process documented with such clarity. Each time I have created a custom object, I have just floundered around until I got it done. Due to the time lag between my map creations, I've had to reinvent the process several times.

Oh, and I agree that all objects in the map editor should automatically mutate to reflect the terrain they are placed on. It is a break in the player's immersion experience to have the battle arena not be correct for the terrain or an object's appearance match its surroundings. I believe that, given the current state of the editor's power and the limited property set for map objects, it is impossible to completely eliminate this problem, no matter how many hours of time the mapmaker spends. However, I must add that it is possible to create great maps in HOMM5 that give a player experience that goes beyond anything possible in previous HOMM games, it just takes a lot of work. Good thing it's fun, eh?
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

King Imp
Swordsman
Swordsman
Posts: 570
Joined: 06 Jan 2006

Unread postby King Imp » 18 Nov 2007, 08:02

Okay, I really need your help on this one guys. I have no clue where I would even look to fix this.

I recently went in to edit a bunch of maps I downloaded from here, but after saving and then playing a map, I am getting this problem on all maps.

Image

Image


The message box that used to be small is now huge like you can see. I have no idea what the hell changed these settings or how to revert them back to normal.


For as powerful as this editor is, I really find it pathetic and annoying that they didn't safeguard against stuff like this. Editing a map should not change the settings for all maps.


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests