Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: Heroes 4 Advanced Options Map Editor
Thread: Heroes 4 Advanced Options Map Editor This thread is 7 pages long: 1 2 3 4 5 6 7 · «PREV / NEXT»
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 09, 2023 03:51 PM
Edited by iliveinabox05 at 15:52, 09 Aug 2023.

relancer said:
However I have doubts that's weapon type of artifact id = 196 is correct:

196: {'name': 'THROWING_SPEAR', 'art_type': 'WEAPONS'}

that was copied and adjusted from your artifacts list


Feel free to figure out the correct code and report it back here so I can fix it. Sometimes there is a difference between codes in the resource files and codes in the .h4c files. I had to go through each one of them, so it's entirely possible that I missed fixing one or two.

Also, I took a look at your readme. If you're just trying to create a duel map generator, you realize that could easily be done in the advanced editor, right? (and without needing to supply any sort of template) The entire thing could probably be written in a couple of days and work with no issues. It's going to take you a lot longer since you're going to have to port a lot of my code in addition to the duel map stuff.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
relancer
relancer


Hired Hero
posted August 09, 2023 04:37 PM
Edited by relancer at 17:42, 09 Aug 2023.

hi @iliveinabox05

I have very nice info you do not expect to read!!!

When testing stuff I wrote my hero with 36 bytes of 04 (full skills)

In map editor I see all 9 *4 skills in selection (in spite usual allowed maximum is 5). But in the battle I have only 4 "battle skills" and Life magic that seems to be ok and real maximum is really 5 skills, also having (all 9 hero skills) without giving spells I had only 1 1st level life spell - so that's ok there.

But i have more wonderful news!!! about spells
I wrote 127 to each of 24 bytes, I got all the spells including those are not reachable in normal conditions so when I have a life I see the following spell screen and can cast Fire Resistance to any army not only for self-hero!!!

Please look the screen!!! It worth your attention

https://cdn.discordapp.com/attachments/917849808767705150/1138842063035699230/image.png

So nominally usually not-allowed spells are controllable (Yes I have Rebirth spell in spellbook too, because it LIFE-5 spell, also I have Immortality spell (without picture same as in the screen below) for same reason)!!! I did not know that
Feel free to download and view/load the map at

https://bitbucket.org/vovavovavova/homm4-things/src/790ed9e12bff5c762efb2ac7ceb9dac45f6d6a2a/syka_updated.h4c

Because I might overwrite it later


When you try to cast some of the new spells, it can show message that it's not applicable in the battle (like Visions does), however part of new spells are applicable.

Allowed spells appear in spellbook only if level of Magic allows, that work also for normal usual spells. So If I set 5 magics skills at 5th level and write 24 spell-bytes with 127 (eight bits 1) I will see all the spells.

The RED-heal spell - in the screen - restores full health and can be applicable not only to self-hero, but to megadragon restoring 700+ health just until full (like healing potion for allies).
Rebirth does not work like it works for a phonies, if hero falls and has mana, he does not stand up.


ABOUT porting code, no, I dont need more) I might need spell or artifact config (ids and types,data,level etc), but I already took almost everything I needed ))


Currect todos left are: implement things to create spellset and skillsets for hero, and - think how-to-do(!) and implement the generator scenario + config.
And that's all there.

About possible error it's originally there:

[H4Util.java: 7379] THROWING_SPEAR(196, "Throwing Spear", H4ArtifactType.WEAPONS),

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 09, 2023 07:09 PM

Question


I would like to know how I can edit my starting heroes from the editor and how to unlock the campaign heroes. For example, if I want to play a map but I want my starting character to be Lysander instead of just any character. Thanks!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Albyx
Albyx


Known Hero
posted August 09, 2023 07:16 PM

Sybille said:

I would like to know how I can edit my starting heroes from the editor and how to unlock the campaign heroes. For example, if I want to play a map but I want my starting character to be Lysander instead of just any character. Thanks!


It's in Campaign -> Map Properties -> Heroes. Heroes selected there will appear in the tavern.

To have specific hero portrait choose him in army properties and select portrait you like

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 09, 2023 07:23 PM
Edited by Sybille at 19:24, 09 Aug 2023.

Don't work

Albyx said:
Sybille said:

I would like to know how I can edit my starting heroes from the editor and how to unlock the campaign heroes. For example, if I want to play a map but I want my starting character to be Lysander instead of just any character. Thanks!


It's in Campaign -> Map Properties -> Heroes. Heroes selected there will appear in the tavern.

To have specific hero portrait choose him in army properties and select portrait you like


Thanks for answering, but I already did both and it doesn't work for me. I do not know why. Maybe I am overlooking something.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 10, 2023 01:39 AM

Sybille said:
Thanks for answering, but I already did both and it doesn't work for me. I do not know why. Maybe I am overlooking something.


He told you exactly how to do it.

1. Open the map in the editor.
2. Find the hero you want to change.
3. Double click the hero on the map.
4. Double click the hero in the troops window
5. Change the base class to the one the hero you want belongs to.
   - For Lysander, change the base class to Knight and gender to male
6. Click the arrows next to the portrait to switch between portraits until you find Lysander. Generally you want to click the up arrow as campaign heroes are usually near the top of the lists. You might need to uncheck custom for the name field so that you can see the names of the heroes as you switch portraits.
7. Save the map.
   - If the map you are editing is not in the maps folder in your H4 directory, move it there.

If you think you did all this and it still didn't work, try listing out what you actually did step by step. Otherwise it's impossible to help.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
relancer
relancer


Hired Hero
posted August 10, 2023 10:30 AM
Edited by relancer at 15:48, 10 Aug 2023.

hi @Derrick

I found yet another thing, we are able to write skill Tactics-5 without perks and it will work - we'd have hero with no percs so can avoid limitations

By the way, if to create random hero for example 35 level with only the tactics5, the map will give him 34 random skills assuming he chose them on levelups. 1st level hero will have only Tactic-5.

Also I tried 6th level of skills, unfortunately this wont work and editor/game will crash, that's sad

If you maybe know some another wierd options that are not expected in normal gameplay, related to spells, skills or creatures -  please tell me


Also I have something to show actually one of generations:

https://bitbucket.org/vovavovavova/homm4-things/src/30ef402a5ef9f0c4734bef06bab3a41ee42661db/syka_updated.h4c

Screenshots:

https://cdn.discordapp.com/attachments/917849808767705150/1139135119333007390/image.png
https://cdn.discordapp.com/attachments/917849808767705150/1139135246508507236/image.png
https://cdn.discordapp.com/attachments/917849808767705150/1139135533570867311/image.png
https://cdn.discordapp.com/attachments/917849808767705150/1139135639636418690/image.png


TODOs left: an artifact selection scenario, spell selection and give_spell implementation. + maybe something about skills because level gives additional hero_skills. After that I will need only to think about generation scenario and limits and balance scenario + controllable random. Also I cannot bring hero-level more than 40, it's confirmed by a crash.


I cannot find immortality potion in your potions list (found, name's not usual, id=137)

What's strange I was able to write Staff to shields slot when defined it as shield by mistake and it works. Probabbly we baggily can set any artifact to any slot )))


I implemented giving artifact sets as well. As I got my parser is not that good, so he detects armies correctly but rarely sometimes can fail. THis wont happen at this map unless adding artifact armour of life (id = 9)

so previous byte is 01 (byte slot armour.has_art), art_id is short 9 (09 00) and  this produces combo 01 09 00 that is used to be an army detector..


So unfortunately parsing maps with "Armour of Life" can be problematic and I cannot give Armour of Life to hero due to this logical bug. But in all you can actually yet enjoy the Duel For current case but does not matter that much. But globally that my bug could be serious.

Todo left is to apply spellset and adjust random including creature race.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 10, 2023 04:14 PM

iliveinabox05 said:
Sybille said:
Thanks for answering, but I already did both and it doesn't work for me. I do not know why. Maybe I am overlooking something.


He told you exactly how to do it.

1. Open the map in the editor.
2. Find the hero you want to change.
3. Double click the hero on the map.
4. Double click the hero in the troops window
5. Change the base class to the one the hero you want belongs to.
   - For Lysander, change the base class to Knight and gender to male
6. Click the arrows next to the portrait to switch between portraits until you find Lysander. Generally you want to click the up arrow as campaign heroes are usually near the top of the lists. You might need to uncheck custom for the name field so that you can see the names of the heroes as you switch portraits.
7. Save the map.
   - If the map you are editing is not in the maps folder in your H4 directory, move it there.

If you think you did all this and it still didn't work, try listing out what you actually did step by step. Otherwise it's impossible to help.


When I'm on the PC and I open the editor I'll do the steps and I'll tell you something, thanks for the help.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 10, 2023 05:44 PM

iliveinabox05 said:
Sybille said:
Thanks for answering, but I already did both and it doesn't work for me. I do not know why. Maybe I am overlooking something.


He told you exactly how to do it.

1. Open the map in the editor.
2. Find the hero you want to change.
3. Double click the hero on the map.
4. Double click the hero in the troops window
5. Change the base class to the one the hero you want belongs to.
   - For Lysander, change the base class to Knight and gender to male
6. Click the arrows next to the portrait to switch between portraits until you find Lysander. Generally you want to click the up arrow as campaign heroes are usually near the top of the lists. You might need to uncheck custom for the name field so that you can see the names of the heroes as you switch portraits.
7. Save the map.
   - If the map you are editing is not in the maps folder in your H4 directory, move it there.

If you think you did all this and it still didn't work, try listing out what you actually did step by step. Otherwise it's impossible to help.


I enter to the campaign editor, I've opened the ''Revolution'' scenario for example and I find 2 heroes on the stage, one red and the other blue. I double click on red and edit the hero, open the portrait section and choose Lysander as an example. I click ''Ok'' and overwrite the scenario that is saved in the maps folder. Then, I open the game, I open the Revolution scenario, I am the red player but instead of Lysander appearing another random one. What has gone wrong?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 10, 2023 05:51 PM

Sybille said:
I enter to the campaign editor, I've opened the ''Revolution'' scenario for example and I find 2 heroes on the stage, one red and the other blue. I double click on red and edit the hero, open the portrait section and choose Lysander as an example. I click ''Ok'' and overwrite the scenario that is saved in the maps folder. Then, I open the game, I open the Revolution scenario, I am the red player but instead of Lysander appearing another random one. What has gone wrong?


Open the map you edited and make sure the red hero's portrait is still set to Lysander.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 10, 2023 06:39 PM

Yes, in the editor there is Lysander, I also marked Lysander in the map properties. But he doesn't appear in the game. How strange everything. Hahaha

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 10, 2023 07:04 PM

Sybille said:
Yes, in the editor there is Lysander, I also marked Lysander in the map properties. But he doesn't appear in the game. How strange everything. Hahaha


That just tells me that the map you are playing in game is NOT the map that you are editing

I can't remember if it's in map properties or campaign properties, but one of them has the name of the scenario. Change the name by adding something like "test" at the end of it, and save it back to your maps directory.

When you look for the scenario in game, it should have "test" in the name (or whatever you added). That will at least tell you that you're playing the correct map with your changes.

You might also upload your map file somewhere and post the link here so that we can take a look at it.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Sybille
Sybille

Tavern Dweller
posted August 10, 2023 08:03 PM

iliveinabox05 said:
Sybille said:
Yes, in the editor there is Lysander, I also marked Lysander in the map properties. But he doesn't appear in the game. How strange everything. Hahaha


That just tells me that the map you are playing in game is NOT the map that you are editing

I can't remember if it's in map properties or campaign properties, but one of them has the name of the scenario. Change the name by adding something like "test" at the end of it, and save it back to your maps directory.

When you look for the scenario in game, it should have "test" in the name (or whatever you added). That will at least tell you that you're playing the correct map with your changes.

You might also upload your map file somewhere and post the link here so that we can take a look at it.


Now I'm not with the computer, before when I wanted to show the steps I was doing I wanted to send a photo I took with my mobile but I didn't know where to upload it to share it. Sorry, I'm new to the web.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 10, 2023 09:42 PM
Edited by iliveinabox05 at 21:44, 10 Aug 2023.

relancer said:
hi @Derrick

I found yet another thing, we are able to write skill Tactics-5 without perks and it will work - we'd have hero with no percs so can avoid limitations


Cool find there

relancer said:

Also I cannot bring hero-level more than 40, it's confirmed by a crash.



You can start a hero at most at level 40 using the level field in the hero data, that is correct, but you can level a hero up to 70 using scripts. You can use the increase level script with a level increase of 1, and do it 30 times. Using a single increase level script and using 30 as the number of level increases is bugged and won't increase the hero by 30 levels.

relancer said:

What's strange I was able to write Staff to shields slot when defined it as shield by mistake and it works. Probabbly we baggily can set any artifact to any slot )))



Another interesting find.

I actually think the duel map stuff is pretty cool, so I'm looking at having the advanced editor be able to generate duel maps in the style of H5, where you start with a set amount of creatures (6 weeks growth by default, based on chosen faction before starting the map), a set amount of money, there is a nearby level up object, random creature dwellings linked to chosen faction for additional troops, artifact shops, skill shops objects, and spell shops / objects.

I'll need to come up with settings that can be tweaked when generating the map, such as how many level ups the hero gets, artifacts available, starting amount of creatures, etc.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
relancer
relancer


Hired Hero
posted August 10, 2023 09:56 PM
Edited by relancer at 22:49, 10 Aug 2023.

Also

My parser is not good enough and I'll be unable to make it better in valid amount of time (nor have such a goal), so by generation some params It make fail, when random generation can bring bytes 01 09 00

THis most likely wont happen

known cases

1) giving hero the Armour of Life
2) giving creature (not to hero) 9 artifacts
3) gender 1, level 9, stats attack, def, speed, manapoints 0, x,x,x
    level 1, stats 9, 0, x, x
    1,9,0 one after one in stat bonuses
    stats [x,x,1,9] with no hero name.

Still to reproduce that I had to pick up numbers specially, because random did not want to fail me everywhere except Armour of Life

I might can have rare match when I will implement giving spells by config, but I'm ready to that

About artifacts - look this screenshot Normal generation works fine in the code, I just show chaotic one.

https://cdn.discordapp.com/attachments/917849808767705150/1139291844627398737/image.png

I mis-understand potion in list but other artifacts are chaotic generation and you can see 1 luck from "weapon" if you drag mouse and click but not remove - you will see luck changes to 0 and back - so artifact works.

Also you need to fix artifact types, that spear is a "bow type" and that is not only one mismatch I found in your artifact list in a matter of artifact type.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 10, 2023 10:52 PM

relancer said:
Also you need to fix artifact types, that spear is a "bow type" and that is not only one mismatch I found in your artifact list in a matter of artifact type.


List out the ones you think are wrong and what the correct type is.

Everything came straight out of the game's resource files.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
relancer
relancer


Hired Hero
posted August 10, 2023 11:50 PM
Edited by relancer at 00:37, 11 Aug 2023.

iliveinabox05 said:


I actually think the duel map stuff is pretty cool, so I'm looking at having the advanced editor be able to generate duel maps in the style of H5, where you start with a set amount of creatures (6 weeks growth by default, based on chosen faction before starting the map), a set amount of money, there is a nearby level up object, random creature dwellings linked to chosen faction for additional troops, artifact shops, skill shops objects, and spell shops / objects.

I'll need to come up with settings that can be tweaked when generating the map, such as how many level ups the hero gets, artifacts available, starting amount of creatures, etc.


I think for this purpose you can use what I have.
About stuff I need to implement is giving spells.

Other is done.
Only just you need to build a proper algoritm of random generation (I have weekly growth in config, it's vanilla growth but you can edit I think)

Writing 6*growth, filtering "HashMap" by belongs_to to make single-race army (dont forget about hero-type 0-10, base skills does not matter but race matters for a morale) is not a problem in all (I also have such a plan but with bigger number than 6). My scenario of generation is wild random because it was not ready yet and I still do the code, but you can write your own scenario and use it.

For creating hero or creature by config with parameters there are examples in
       def create_test_random_config

(only left to do are spells, because now it's full zeros or full spells or nothing without algoritm and actual transform array to required bytes.)


--------------------------------------------------
Actually, you might misunderstand the misadvantage of thing you want to do.

There are a lot of "good" (enough good for editor opportunities) duel maps itself with all these objects and creatures for selection (example one of Faerie dragons and Phoniex)

Problem there is you need to click that all
To buy all the spells, to select between creatures, to buy/learn scrolls etc, click EVERY levelup, select skills on levelup and many other unneeded things.

To set up your hero in good cases you can waste time ~ same to play the battle. Especially if you want to play with a computer. With player also it almost doubles your duel time for a partie.

It's better to have army loader that will bring all of that to you with maximum few clicks, for my case to regenerate 6*6 armies I need to run python script that takes at max 30 seconds (yes not everyone has python but you converted your code to exe and the same is not a problem for me if I decide to share)! And I have ready armies heroes and whatever I want, it just depenent on algoritm of random generation you choose and write.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 11, 2023 03:02 AM

relancer said:
I think for this purpose you can use what I have.
About stuff I need to implement is giving spells.


Thanks, but the advanced editor already has everything it needs to do anything it wants with h4c files (except for elevation, someday I'll get to that).

relancer said:
Only just you need to build a proper algoritm of random generation (I have weekly growth in config, it's vanilla growth but you can edit I think)

Writing 6*growth, filtering "HashMap" by belongs_to to make single-race army (dont forget about hero-type 0-10, base skills does not matter but race matters for a morale) is not a problem in all (I also have such a plan but with bigger number than 6). My scenario of generation is wild random because it was not ready yet and I still do the code, but you can write your own scenario and use it.


Weekly growth is in the game resource file text.h4r in table.creatures.

Don't need hero type, and it will be a random hero on the map. The hero's faction will be chosen by the player before starting the game. Scripting will then check the alignment, and add troops accordingly.

relancer said:
Actually, you might misunderstand the misadvantage of thing you want to do.

There are a lot of "good" (enough good for editor opportunities) duel maps itself with all these objects and creatures for selection (example one of Faerie dragons and Phoniex)


There isn't any disadvantage to adding an H5 like duel map generator to the advanced editor. In fact, since the advanced editor has use of the fully reversed .h4c file format, it has no disadvantage and can do anything it's coded to do.

Sure there are (one or two) duel maps out there, but how easy are they for someone to modify if they want something different? My guess is too difficult for the average user.

relancer said:
Problem there is you need to click that all
To buy all the spells, to select between creatures, to buy/learn scrolls etc, click EVERY levelup, select skills on levelup and many other unneeded things.

To set up your hero in good cases you can waste time ~ same to play the battle. Especially if you want to play with a computer. With player also it almost doubles your duel time for a partie.

It's better to have army loader that will bring all of that to you with maximum few clicks, for my case to regenerate 6*6 armies I need to run python script that takes at max 30 seconds (yes not everyone has python but you converted your code to exe and the same is not a problem for me if I decide to share)! And I have ready armies heroes and whatever I want, it just depenent on algoritm of random generation you choose and write.


This is entirely your opinion. I would much rather set my hero up real time in game and make my own choices. Also I would hardly say selecting skills up to something like level 20 is at all time consuming.

You or someone else would still have work to do to create the configurations if you/they wanted to play something different, which would take at least as much time as a few clicks in the advanced editor to generate something new

It is super simple to allow for a custom setup if that's what the person wants to do. I can just add an option for a custom setup, and whoever is creating the map can specify what units, skills, artifacts, spells, etc. that they want.. In fact, the advanced editor already has army and hero panels that could be used, just like the game's editor, to fill out.

What you're looking to do is more of a battle simulator which needs an input h4c file. This would also be pretty simple for the advanced editor to do, while not needing an h4c file for input. It's just another setting that could be selected.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
relancer
relancer


Hired Hero
posted August 11, 2023 07:19 AM
Edited by relancer at 07:22, 11 Aug 2023.

by the way I fixed 190 issue (yes, fixed) and script do not reparse the map every time which speeded up it a lot, and armour of life or any other combinations are valid and checked

Armour is giving correctly, the side effect that the output map cannot be reparsed (if Armour of Life was given or other) but it does not needed, only need the first time parse, that most likely will fail only if hero wears Armour of Life or other sudden combo of data that gives 010900

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted August 11, 2023 04:03 PM

relancer said:
by the way I fixed 190 issue (yes, fixed) and script do not reparse the map every time which speeded up it a lot, and armour of life or any other combinations are valid and checked

Armour is giving correctly, the side effect that the output map cannot be reparsed (if Armour of Life was given or other) but it does not needed, only need the first time parse, that most likely will fail only if hero wears Armour of Life or other sudden combo of data that gives 010900


Good job!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 7 pages long: 1 2 3 4 5 6 7 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0787 seconds