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»
relancer
relancer


Hired Hero
posted August 11, 2023 09:12 PM bonus applied by Galaad on 28 Sep 2023.
Edited by relancer at 10:21, 12 Aug 2023.

Hi @Derrick


What I found some things to update. We have in the total list 240+ spell when 24 *8 = only 192. To give all spells I needed to give FF (not 7F) an total amount of spells I count is 188

You still have some wrong spell alignment:
I can proof with screenshot of spells.

[H4Util: public static enum H4Spell: line-9677]
BIND_FLYER(7, "Bind Flyer", H4Alignment.NATURE, 0) -> it's order (spider arrow spell)
COLD_RESISTANCE(20, "Cold Resistance", H4Alignment.ORDER, 0), -> it's life (I was wondered but it's in a list of life spell)
FIRE_RESISTANCE(40, "Fire Resistance", H4Alignment.CHAOS, 0), - > Life
FREEZING_ATTACK(49, "Freezing Attack", H4Alignment.DEATH, 0), -> order (Ice demon/ice hammer ability)
CHOKING_GAS(50, "Choking Gas", H4Alignment.CHAOS, 0), -> death (green throw potion -15% attack/def)
HYDRA_HEALTH(57, "Hydra Health", H4Alignment.CHAOS, 0), -> nature
DEMON_FIRE(67, "Demon Fire", H4Alignment.DEATH, 0), -> chaos (even obvious?)
MAGIC_RESISTANCE(75, "Magic Resistance", H4Alignment.MIGHT, 0), -> nature
MANA(76, "Mana", H4Alignment.ORDER, 0), -> chaos
PANIC(107, "Panic", H4Alignment.CHAOS, 0), -> death
LIFE_WARD(119, "Life Ward", H4Alignment.DEATH, 0), -> life
QUICKNESS(122, "Quickness", H4Alignment.NATURE, 0), -> chaos
REBIRTH(129, "Rebirth", H4Alignment.NATURE,0), -> life (btw pointless spell)
REGENERATION(131, "Regeneration", H4Alignment.LIFE, 3), -> nature (this is spell for +3 map movement)
SMOKE(142, "Smoke", H4Alignment.CHAOS, 0), -> death
SPEED_POTION_EFFECT(146, "Speed Potion Effect", H4Alignment.NATURE, 0), -> chaos
STONE_GAZE(152, "Stone Gaze", H4Alignment.CHAOS, 0), -> death
STUN(154, "Stun", H4Alignment.LIFE, 0), -> order (squire does)

all SUMMON_IMP etc belong to nature (this case does not matter because they can exist only with 2 skills together)

TERROR(180, "Terror", H4Alignment.CHAOS, 0), -> death
FROZEN(186, "Frozen", H4Alignment.DEATH, 0), -> order
ACID(0, "Acid", H4Alignment.DEATH, 0), -> chaos

(also I found 2 spells SUMMON_ICE_DEMON_DEVIL-160 and SUMMON_ICE_DEMON-167 yet not found the difference

What I'm doing is testing spells giving 00 ... FF 00 to certain pos to see which "eight" gives what because I have some suspision.

(spell id = 55 Life.HEAL (2) is something wierd there, will check)

I will update this message with alignment mismatch what I will found and can proof all that spells with a screenshots.

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


Honorable
Famous Hero
posted August 11, 2023 09:50 PM

relancer said:
Hi @Derrick


What I found some things to update. We have in the total list 240+ spell when 24 *8 = only 192. To give all spells I needed to give FF (not 7F) an total amount of spells I count is 188

You still have some wrong spell alignment:
I can proof with screenshot of spells.

[H4Util: public static enum H4Spell: line-9677]
BIND_FLYER(7, "Bind Flyer", H4Alignment.NATURE, 0) -> it's order (spider arrow spell)
COLD_RESISTANCE(20, "Cold Resistance", H4Alignment.ORDER, 0), -> it's life (I was wondered but it's in a list of life spell)
FIRE_RESISTANCE(40, "Fire Resistance", H4Alignment.CHAOS, 0), - > Life
FREEZING_ATTACK(49, "Freezing Attack", H4Alignment.DEATH, 0), -> order (Ice demon/ice hammer ability)
CHOKING_GAS(50, "Choking Gas", H4Alignment.CHAOS, 0), -> death (green throw potion -15% attack/def)
HYDRA_HEALTH(57, "Hydra Health", H4Alignment.CHAOS, 0), -> nature
DEMON_FIRE(67, "Demon Fire", H4Alignment.DEATH, 0), -> chaos (even obvious?)

What I'm doing is testing spells giving 00 ... FF 00 to certain pos to see which "eight" gives what because I have some suspision.

(spell id = 55 Life.HEAL (2) is something wierd there, will check)

I will update this message with alignment mismatch what I will found and can proof all that spells with a screenshots.


This is perfect, thanks so much for this!

I wasn't sure about those spells when I was adding the alignment field to the enum since they aren't available for heroes normally, so I just picked something

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


Hired Hero
posted August 11, 2023 10:34 PM
Edited by relancer at 10:59, 12 Aug 2023.

Really, this matters

I will explain.

If to write hero all the spells - he can use only that one that his skills allow. So you can write Desintegrity to hero but he cannot cast without chaos-5. If he levelups and choose skill - spell will appear in spellbook, but until then - no

If to look for example FREEZING_ATTACK(49), it appears in spellbook in order section and costs 8 mana so I suspect it's level-4 spell. I cannot say more precise, but it seems like that. And it seems hero needs ORDER-4 to use it if I write 49 to spells list.

So if you someway wanna write some specific spells you need to keep in mind their relation

I actually have no idea about random scenario of giving spells except giving random int.to_byte(256) 24 times but that's close to wild random rather then kind of selection (that's better to have with sending array of spell_ids and converting to needed format, the convertion should not be a problem, I just did not get to it yet)

Still look on spells, life's heal looks ok but I still search with count mismatch (I may miscount as well), so I will look more

Hm got it.. Spells after id=187 aren't the spells and has nothing to spellbook. Might be it could be some references like VAMPIRISM(195) to real VAMPIRIC_TOUCH(182) but no bytes for that.

Ok so actually useful spells end on id=187 SUMMON_WASPWORT, this is the last valid spell-id. Other cannot be used. I also had some problem with Life.Heal (55) but it's unknown and I saw that spell in the past. Only updated the relation to magic.




Ok.

So I am done with a generation.
I wanted to fix parsing non-army 190 (to be able to parse other maps properly if for example Armour of Life already worn) but short solution was not succeed, not-short solution I will think if I would do or not.

Well I will refactor code a bit and actually think about generation scenarios, I'll move them to scenarios class to be able to define multiple scenarios to use any of them


people, I ACCEPT IDEAs how you want to see the generated armies (including desired level range, spell set and any other things you might like to see).


I have few ideas for scenarios

1) absolute random on spells, level, army (16 times less x4 creatures, 9 times less x3, 4 times less x2)
2) single race army, hero + 4th, 3th, 2th, 1th, 1th, random or hero
3) yours???

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


Known Hero
posted August 12, 2023 02:26 PM
Edited by Albyx at 14:30, 12 Aug 2023.

relancer said:

people, I ACCEPT IDEAs how you want to see the generated armies (including desired level range, spell set and any other things you might like to see).


I have few ideas for scenarios

1) absolute random on spells, level, army (16 times less x4 creatures, 9 times less x3, 4 times less x2)
2) single race army, hero + 4th, 3th, 2th, 1th, 1th, random or hero
3) yours???



You can use shrines to get random spells and check if there are duplicates with your script. Or place different faction towns with level 5 magic guild in them and nothing else, it requires no scripting at all .



To get exact levels and magic schools of unused spells you can open heroes4.h4r -> spells.h4d table with Resource Editor.

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


Honorable
Famous Hero
posted August 12, 2023 11:32 PM

Albyx said:
To get exact levels and magic schools of unused spells you can open heroes4.h4r -> spells.h4d table with Resource Editor.


It's funny, I totally forgot about the spells table until last night. Went through all the spells and fixed the alignments for the spells enum.

It's cool that you can give heroes the spells from abilities, but they can't be hacked like that to be given via scripts (editor will crash). Definitely something that would be fun to take advantage of.

Also it seems I had Heal and Haste IDs switched.

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


Known Hero
posted August 13, 2023 08:12 AM

iliveinabox05 said:

It's cool that you can give heroes the spells from abilities, but they can't be hacked like that to be given via scripts (editor will crash). Definitely something that would be fun to take advantage of.

Also it seems I had Heal and Haste IDs switched.


Actually it's possible to give them with scripts. Using H4MS you can load modified spell table to the editor where all unused spells are flagged as teachable. They'll become available as starting spells for heroes and in scripts. Adding them in shrines doesn't work in game tho, it gives another random spell instead. Don't remember about town magic guilds, will check and make you know.

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


Honorable
Famous Hero
posted August 13, 2023 09:10 PM
Edited by iliveinabox05 at 22:45, 13 Aug 2023.

Albyx said:

Actually it's possible to give them with scripts. Using H4MS you can load modified spell table to the editor where all unused spells are flagged as teachable. They'll become available as starting spells for heroes and in scripts. Adding them in shrines doesn't work in game tho, it gives another random spell instead. Don't remember about town magic guilds, will check and make you know.


Well of course it's  possible with modding, haha I just wanted to see what could be hacked together using the advanced editor for WoW maps.

Is all that's needed just making the spell teachable in table.Spells? Or is there dll magic needed as well? Might have some time to try it out tonight, but just updating the table is super easy.

For editing spells for duel maps I'll probably have a spells panel like the one heroes have in the editor, but I'll split it up by alignment and spell level so it's easier to navigate. Doing it that way means I'll probably just set the chosen spells on the hero to selected instead of any type of quest hut where you can pick your spells. If no spells are chosen then they are chosen at random.

Edit. Made Fire Shield teachable in the table.Spells file, plopped it in a new.h4r and fired up the editor.. and Fire Shield was available to be given via script. Super nice that the game uses the tables to populate things like that!

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


Known Hero
posted August 14, 2023 05:39 AM

iliveinabox05 said:

Well of course it's  possible with modding, haha I just wanted to see what could be hacked together using the advanced editor for WoW maps.



Great thing is only editor mod required, maps will work on clear H4 version as well!

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


Honorable
Famous Hero
posted August 14, 2023 04:17 PM
Edited by iliveinabox05 at 22:05, 28 Aug 2023.

Edit. I've got heroes that can either be leveled up manually or automatically working, as well as giving creatures based on the selected weekly amount of growth.

Random town for hiring additional creatures added as well, so I'll finally get around to getting the building mask reversed and coded. At least for random towns anyway, though it should be simple after that to reverse the other towns.

The display so far is just a couple of number spinners for you to select starting level and amount of creature growth to start with, and a check box to select whether or not to auto level your hero.

******************************************

Albyx said:
Great thing is only editor mod required, maps will work on clear H4 version as well!


Oh nice, I didn't even check it in game, just assumed it was busted because the editor couldn't open the map with a non-teachable spell being taught.

That's one way to lock a map from being edited

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


Responsible
Supreme Hero
posted September 03, 2023 07:23 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.


Just be sure that the Spears and Clubs isnt listed as bow type due to them being ranged artifacts. I'd be sure to check it keeps those properties if you change it to another type.
____________

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


Honorable
Famous Hero
posted September 04, 2023 10:49 PM bonus applied by Galaad on 28 Sep 2023.

Duel maps coming along



I am also just about finished with a quest shop creator feature, which will be available both in the duel map options (to customize items, spells, etc.) as well as when opening up any quest hut dialog (from the menu).

You can create categories to then add items to, or with a basic quest shop you can just add your items.

I have the advanced quest shop creator done except for a bit more testing, so I just need to add the panel for creating a basic quest shop, which will be quicker and easier than the advanced shop. Then I'll probably put out an update.

Also, I finally took a look at the Throwing Spear artifact in the game resource files and we have the following:

Filename: adv_object.artifacts.weapons.Throwing Spear.h4d
Minor type code: c4 (196)

So, it is correctly classified as a weapon according to the filename, and the id is correct as well, since I actually created a map where I placed all artifacts to scrape their info from the map file and make sure everything was correct.

Now, the artifact type field in the enum wasn't meant to be an artifact slot type, but maybe it should be. In that case yes, the type field would be wrong.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted September 05, 2023 12:22 AM

I have made duel maps long ago



While I cannot speak about the relative quality of the scripting, I can see that the one presented here is not landscaped.

Here's hoping that the final version has a nice aesthetic presentation and not just two boxes of barren
____________
Never changing = never improving

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


Responsible
Supreme Hero
posted September 05, 2023 07:46 PM

NimoStar said:
I have made duel maps long ago



While I cannot speak about the relative quality of the scripting, I can see that the one presented here is not landscaped.

Here's hoping that the final version has a nice aesthetic presentation and not just two boxes of barren


Nimo, you never fail to impress me..
Keep it going
____________

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


Hired Hero
posted September 19, 2023 12:16 AM
Edited by relancer at 00:29, 19 Sep 2023.

Hi people.

played a lot in battles (duels) I tried today to auto-modify someone's big XL map. (updated parser a bit as well).

Well it works fine: I have new kind of armies instead of all the objects (i selected for me to replace all)..


Another thing I want to do - "random_monster" or "random_monster_level_X" - how can we locate this type of objects, is there any information about that?
It is not the same binary as an usual neutral/player army and actually not `{army_indicator}{owner_id}{lead_short=0}{army_slots}`

Mostly question to @Derrick.

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


Honorable
Famous Hero
posted September 19, 2023 06:14 AM
Edited by iliveinabox05 at 06:19, 19 Sep 2023.

relancer said:
Hi people.

played a lot in battles (duels) I tried today to auto-modify someone's big XL map. (updated parser a bit as well).

Well it works fine: I have new kind of armies instead of all the objects (i selected for me to replace all)..


Another thing I want to do - "random_monster" or "random_monster_level_X" - how can we locate this type of objects, is there any information about that?
It is not the same binary as an usual neutral/player army and actually not `{army_indicator}{owner_id}{lead_short=0}{army_slots}`

Mostly question to @Derrick.


Hey there! So the random monsters are actually easier to find than armies because they are actually adventure objects and so after their row, col, level info is the filename, major, and minor type info, which are all strings.

To search by filename, you can scan for "Random creatures", which will take you to the beginning of the adventure object name info.  If you need the major and minor type info, just scan after the filename for "random_random_monster", which will be the random monster object. If there is only "random_monster", then you have one of the random monster level objects. For the level objects the sub type will follow and will be "level x".

The hard part will be finding your way to the end of the object, which is where the strength info is placed. Line 3972 in H4ObjectParser.java is the H4RandomCreature class, which parses these objects, so you'll need to follow along with that.. Actually I just took a look, and as long as none of the random monster objects have any linkage, you can do the following: search for "Random creatures", then from this location, search for "none".

Immediately after "none" are the min / max strength, 4 bytes each. If you need the row / col / level info, start from "Random creatures" and count backwards

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


Responsible
Legendary Hero
Modding the Unmoddable
posted September 19, 2023 06:27 AM

Speaking of that, will/have you added a mechanism to allow random monsters of level X come with an owner? Because by default, they can only be neutral
____________
Never changing = never improving

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


Hired Hero
posted September 19, 2023 06:55 PM
Edited by relancer at 00:16, 20 Sep 2023.

hm fast parsing was quite successful but fast recreation is problematic( Somewhere failed with events or other, however i added 5 random object (1 each) and actually got them.
As I want something to get relatively fast without fixing a lot - At least for now I can try to replace with auto-gen army for a wild mapping for a custom XL map.
(I might misunderstand the min-power value but it seems to be correct)


Pattern seems to be like:
{random_text_length: 2b}{"Random creatures.Random monster"|"Random creatures.RandomLv"{1-4}}...{"none"|"player"|"town"}
       #   {if "player" then owner_id: 1b}{if "town" then {town_name_len: 2b}{town_name: town_name_len*1b}}{min_strength: 4b}{max_strength: 4b}

Even after I fixed all bytes issues it seems I cannot replace raw random_army to neutral exact army - because normal armies are located far above in bytearray than random-armies.
So fast way might not work. Tried with repeatable part of army indicator (0-7 bx00 and 010900 then), even parser collects them ok but game crashes..

In fact what's possible to do is change min-max power to create gigantic army (up to 2**31-1) and might be random type (has no point in practice),
but that's not that good because final army will have 1 or 2 monster types only by default - and it seems it's not change-able.

(but looks like I understand where is issue)

I SUCCEED!
(random_creatures were successfully replaced to neutral multiarmies, code pushed.

Actually some results:
I added XL map Undue_risk1.h4c to git repo (I dont remember where original map came from - it was done by some map-maker guess with a campaign editor).
Actual replacement took 109 seconds - relatively long in comparison with simple map, but not that bad for XL map.

It would might ignore underground because as it comes the army indicator. But you can look to replaced map - https://bitbucket.org/vovavovavova/homm4-things/src/master/Undue%20Risk.h4c.
Originally it has most of armies as random_creatures, but that all can be replaced with generated ones.

Haha) you'll get some fun when you look to this map, and maybe some fun when you play it, try please))))
(use only champion difficulty because otherwice armies will be easy to beat because it's size is cutted down 4 times to be equal with hero army actually on champion)

UPD: put replaced map at 2023-09-19 22:08:44 UTC. Sorry I pushed unchanged original previously
UPD2: as you can see most armies were replaced. In right down corner there are armies 1 megadragon - it's script writer failure.
I will try to fix that tomorrow, but overall it's around 15 of 430 armies were only successfully turned into 1 megadragon and failed to be upgraded after.
Rest 400+ armies are ok.

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


Honorable
Famous Hero
posted September 22, 2023 02:25 AM

relancer said:
I SUCCEED!
(random_creatures were successfully replaced to neutral multiarmies, code pushed.

Actually some results:
I added XL map Undue_risk1.h4c to git repo (I dont remember where original map came from - it was done by some map-maker guess with a campaign editor).
Actual replacement took 109 seconds - relatively long in comparison with simple map, but not that bad for XL map.

It would might ignore underground because as it comes the army indicator. But you can look to replaced map - https://bitbucket.org/vovavovavova/homm4-things/src/master/Undue%20Risk.h4c.
Originally it has most of armies as random_creatures, but that all can be replaced with generated ones.

Haha) you'll get some fun when you look to this map, and maybe some fun when you play it, try please))))
(use only champion difficulty because otherwice armies will be easy to beat because it's size is cutted down 4 times to be equal with hero army actually on champion)

UPD: put replaced map at 2023-09-19 22:08:44 UTC. Sorry I pushed unchanged original previously
UPD2: as you can see most armies were replaced. In right down corner there are armies 1 megadragon - it's script writer failure.
I will try to fix that tomorrow, but overall it's around 15 of 430 armies were only successfully turned into 1 megadragon and failed to be upgraded after.
Rest 400+ armies are ok.


Not quite sure what you're trying to do here, but glad it's working!

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


Hired Hero
posted September 22, 2023 02:02 PM
Edited by relancer at 14:11, 22 Sep 2023.

iliveinabox05 said:
relancer said:


Not quite sure what you're trying to do here, but glad it's working!


That was a test case, i.e there is absolutely custom XL map and actually script does full replacement for existing armies and random creatures to generic 7-slot armies
(with hero if original army is not neutral,
random armies were turned to neutral (could turn to players army but neutral is better here) ).

I also found why that megadragons were not replaced and fixed that, but did not re-uploaded map.
For showing purpose it does not matter that much.

This case is more likely for fun, but maybe real interesting map, because you have hero, basic army and every army on map is hard to beat.
Even this case it's much interesting than average XL map without scripts.

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


Honorable
Famous Hero
posted September 28, 2023 05:11 AM

NimoStar said:
Speaking of that, will/have you added a mechanism to allow random monsters of level X come with an owner? Because by default, they can only be neutral


Currently in progress with the advanced editor:





Just kidding! This is easily done with the normal game's editor. Here's a hint: You need one map timed event with a single script, and one triggerable event on each random monster object with a single script.

Come on buddy, with the amount of H4 experience you have I expect you to be able to solve stuff like this in seconds!

Now you can finish up your new duel map

 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.0896 seconds