Heroes 4 Map Generator / Utility

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Sep 28 2016, 14:44

At least we have it now :)

I could have used it as well for the part of my second map that is the beginning of my third map. Oh well, I'll probably copy the starting point of my third map and then paste it onto my second map to make them exactly the same :)

We're going to do the next H4MG release very soon. I've wrapped up a lot of the AI enhancing stuff to the point where that's ready to be tested by others. Still a few more of the events to get done, but there is plenty right now for people who like to play vs AI to give it a try.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 7 2016, 21:52

I just had another thought of a nice feature to add: a sort of advanced scripting system.

For example, if you wanted to do something and then ask a question, where yes would run the event again and no would exit the event, the H4MG could create the scripting template for you, and then you would only have to fill in the blanks, rather than script the entire thing yourself.

Copying and pasting of scripts sort of alleviates this issue, but I think it would be cool to be able to just add a new script to your event which contains the control logic for some of the more advanced scripting techniques :)

If anyone has ideas of general advanced scripting that would be nice to be able to add with one click, please post your ideas here!
Last edited by iLiVeInAbOx05 on Oct 7 2016, 22:02, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 10 2016, 5:16

The H4MG has been updated to include AI enhancing events and copying / pasting a selected area. Please see the news article here for more information or just see the original post for the download link and let me know if you experience any bugs or have thoughts and feedback.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 10 2016, 22:45

Currently I'm working on a renaming feature for variables and triggerable events, so that they can be renamed within an event, or within a map.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Heroes 4 Map Generator / Utility

Postby Taro » Oct 15 2016, 14:53

Well, everything is ok except one thing - reduce neutrals script. This one should setup a group of object events (mostly on neutral stacks) and time event. But this time event doesn't apper after aplying the script. Furthermore, if you chose several other scripts AND reduce neutrals then none of time events will appear. Pretty bad because I feel this is one of the most important enhancments.

Another thing - in my scenarios I set players importance to vital AND cities importance to high/ vital. It's increasing agressivnes of the AI more than vital players only. Could you add the option to set importance to cities as well?

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 15 2016, 15:45

Hi Taro. The Reduce neutrals script works similar to your AI neutral slayer script. The scripting is placed on the neutrals, and gets called on encounter to reduce the neutral stack.

I originally tried to reduce the neutrals for the AI turn - and restore them for the player turn, but it just took too long to do for every neutral on the map, so it was changed to only be called when the AI actually attacks a neutral.

Please check the encountered script of a neutral and verify that you see the reduce neutrals event being called. If that is missing then there is something that I need to fix :)

As far as none of the others appearing, can you give me exact steps so that I can try to reproduce? Could you post a screen shot of the AI panel when you hit the apply button? Did you remember to save the map after you clicked "apply" ?

Edit: Which map are you trying to apply the events to? Please send it to me if possible.
Last edited by iLiVeInAbOx05 on Oct 15 2016, 15:59, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 16 2016, 7:42

Finished implementing renaming of numeric and boolean variables within an event or the entire map. I'm thinking it would also be nice to rename variables within an object as well.

I also incorporated Namerutan's updates to support standard version maps

Once I implement renaming of a triggerable event (which also renames anywhere the triggerable event is called), I'll get the next release out :)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 16 2016, 23:47

I got renaming a variable within an object working as well. It probably still needs more testing, but appears to be working right now. Since I need to switch gears this week and work on the Unity project, I may release the next update without renaming of triggerable events in place.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 20 2016, 15:46

Quick update: The next release of the H4MG is available for download (same place, see original post).

With Namerutan's help, the H4MG should now support standard version maps. Please let us know if you encounter any problems with standard version maps.

Also in this release is the ability to rename variables (numeric or boolean). You can specify the scope of the rename: event, object, or map. If you choose event, then all instances of the variable in an event will be renamed; in object, all instances of the variable in the object being edited will be renamed; in map, all instances of the variable in the map will be renamed.

Only thing to be careful of with the renaming feature: If you have a boolean and numeric variable with the same name, do not use this feature to rename one of these variables. Right now I don't have a way to determine if a variable is numeric or boolean type when it's in a condition or is part of a set command, so all are captured and renamed right now.

To avoid this, use good programming practices and make sure you don't name a boolean and numeric variable the same thing ;)

User avatar
jeff
Moderator
Moderator
Posts: 3713
Joined: 06 Jan 2006

Re: Heroes 4 Map Generator / Utility

Postby jeff » Oct 20 2016, 20:25

Since this thread is so long; it would be helpful if you posted the link in the post announcing the new update. Sorry I am old, and I have no idea where I downloaded it last time. :(
Last edited by jeff on Oct 20 2016, 20:25, edited 1 time in total.
Mala Ipsa Nova :bugsquash:

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 20 2016, 21:13

The link is in the original (first) post ;)

But, here it is again anyway: link. Go to the bottom of the page to download the new zip file.

For future reference, all links and important info are in the first post of this thread for easy access, and I try to keep it as up to date as possible :)

Thanks for trying it out and let me know if anything is broken!

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1099
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Oct 21 2016, 16:20

Well it would be nice if some CH staff could either move the link or place a link to it under the Usefull Files/download menu. I recall the link has a similar text in it, but it's not easy to locate unless you find it in the News post or in this tread.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 21 2016, 16:58

Karmakeld wrote:Well it would be nice if some CH staff could either move the link or place a link to it under the Usefull Files/download menu. I recall the link has a similar text in it, but it's not easy to locate unless you find it in the News post or in this tread.


I agree. I did find it a little odd that there isn't any link under downloads for H4 and you have to find it under "all articles" for H4 or something like that.

The actual download link is at the bottom of the article page, but I can also post the direct download link in the original post of this thread.

User avatar
Pol
Admin
Admin
Posts: 9033
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: Heroes 4 Map Generator / Utility

Postby Pol » Oct 21 2016, 21:58

Link added to the Usefull files.
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 22 2016, 4:55

Thanks Pol!

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Heroes 4 Map Generator / Utility

Postby Taro » Oct 23 2016, 7:13

So, I tested it more and results are pretty funny. It seems H4MG opens all maps despite their version BUT only S size :| At least on my PC.

When I try to save M or bigger maps MG just "freezes". And about this reducing neutrals event, it shows it in MG as TIMED EVENT. You can download scenarios I tested, scenarios which were saved and some screenshots where you can see reducing script as timed event here:

https://drive.google.com/open?id=0B-htY ... kNfTVY1SU0

https://drive.google.com/open?id=0B-htY ... mRFdFQxcDA

https://drive.google.com/open?id=0B-htY ... DJDc09SRmc

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 23 2016, 7:27

Hmm, I'll take a look at the maps! Thanks for providing them and thanks for giving feedback!

As far as the reducing neutrals events and scripting, the Timed Event you are referring to is just to initialize some variables that the main events need. If you select and edit any army object, then look at each of the standard events (encountered, victorious, and defeated), you will see the reducing and restoring of the neutral stack being called there.

If you would like to verify that they are indeed working, edit the "If player is AI" to be "if true" or "if player is human" on a neutral stack near your starting location (in the H4 editor), and then you can attack this neutral yourself to see that they are being properly reduced.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Oct 26 2016, 4:23

Taro wrote:So, I tested it more and results are pretty funny. It seems H4MG opens all maps despite their version BUT only S size :| At least on my PC.

When I try to save M or bigger maps MG just "freezes". And about this reducing neutrals event, it shows it in MG as TIMED EVENT.


Hmmmmm, so I downloaded all the maps you posted and had no issues opening and saving them. I was able to add the AI neutral reducing scripts and both the H4MG and H4 Editor were able to open the updated maps.

If you can get the error to happen again with maps 2 and 4, please grab the log file for me and email or add it to drive. The file is "H4GeneratorLog.txt" and it is located in the H4MG folder. You can take a look in there and search for "Exception" if you would like, but I'd still like to take a look.

I also wonder if maybe it's just taking a while to apply the neutral reducing events. It's possible that the H4MG is in the process of applying the events when you try to click save / save as, and seems to be frozen. Is the "Apply" button still highlighted when you are trying to save the map? Even on my fairly powerful laptop it can take anywhere from 2 to 5 seconds to add the neutral reducing events. Opening a map with the neutral reducing events can also take some time to open (2 - 10 seconds). It can also take a moment to add them all and then to save the file.

I definitely need to get a progress bar added.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1099
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Nov 10 2016, 14:59

I have a small request. It seems your current version doesn't read in Quest huts and their scripts. Could you please enable that?
Namerutan has been so kind as to enable me to use Trees of Knowledge as quest huts, and to save myself from a lot of work, I wanted to copy my script from one of my maps to this new quest hut, using the H4MG, but it seems I can't do that, yet..
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 578
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Nov 10 2016, 15:29

You can read quest huts and their scripts (but you can't view the requirement scripting yet), just possibly not the newly added ones because I've hard-coded checking for a particular string in the object name (maybe seer_hut or something, I don't recall at the moment).

What I need to do is look into checking the object's major type code, and then read in the rest of the object based on that.

And, of course, figure out and implement the best way to view the requirement scripts.
Last edited by iLiVeInAbOx05 on Nov 10 2016, 15:29, edited 1 time in total.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests