Heroes 4 Advanced Options Map Editor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Alrighty, time for some screen caps for saving and loading quest huts. First load up a map that has a quest hut you would like to save, navigate to the Events tab, then navigate to the Object Events sub tab, then right click your quest hut and select edit.
Here's the quest hut frame, which is just emulating the one from the H4 editor. Still haven't gotten to showing scripts with the H4MG yet, so only the tabs which display text currently do anything.
Now we go to the file menu, and select Save Quest.
Now we can name it what we want (the default that comes up is the site name of the quest hut), and then save.
Now, open up a second map with a quest hut of a different type, navigate to the Object Events tab, and select and edit the quest hut.
Next we go to File and select Load Quest.
We'll select the quest hut "The Curious Chemist" shop that we just saved, and then open.
Now this different type of quest hut has all of the information and scripting of the other Don't forget to save! (Still only "Save as" implemented).
Lastly, we can go to the H4 editor to verify that the quest hut info has indeed been copied over. I copied from the quest hut type on the left (in a different map), to the quest hut on the right.
This also works for both quest guards and toll gates. I also made some tweaks to the terrain colors so that they're closer to the mini-map colors in the H4 editor.
I think next I'm going to work on putting a hero onto a triggered combat script to see if that can work. After that, I'll start working on a selection tool so we can start trying to copy / paste / move portions of one map to another map (or just somewhere else on the same map).
Here's the quest hut frame, which is just emulating the one from the H4 editor. Still haven't gotten to showing scripts with the H4MG yet, so only the tabs which display text currently do anything.
Now we go to the file menu, and select Save Quest.
Now we can name it what we want (the default that comes up is the site name of the quest hut), and then save.
Now, open up a second map with a quest hut of a different type, navigate to the Object Events tab, and select and edit the quest hut.
Next we go to File and select Load Quest.
We'll select the quest hut "The Curious Chemist" shop that we just saved, and then open.
Now this different type of quest hut has all of the information and scripting of the other Don't forget to save! (Still only "Save as" implemented).
Lastly, we can go to the H4 editor to verify that the quest hut info has indeed been copied over. I copied from the quest hut type on the left (in a different map), to the quest hut on the right.
This also works for both quest guards and toll gates. I also made some tweaks to the terrain colors so that they're closer to the mini-map colors in the H4 editor.
I think next I'm going to work on putting a hero onto a triggered combat script to see if that can work. After that, I'll start working on a selection tool so we can start trying to copy / paste / move portions of one map to another map (or just somewhere else on the same map).
Re: Heroes 4 Map Generator / Utility
Description is very important.
And I think about situation when you generate random map and after 2 months playing you see you cant finished it because eg. there is no road, becouse all are hills. And will be good if editor can read saves and you can replace hills to road and finish scenario...
And I think about situation when you generate random map and after 2 months playing you see you cant finished it because eg. there is no road, becouse all are hills. And will be good if editor can read saves and you can replace hills to road and finish scenario...
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I'll eventually get to looking at the save file format I'm hoping that when I do get to working on the random generation side of things, that I'll be able to come up with a way to make sure all players can reach each other so you don't get into a situation like that.
Re: Heroes 4 Map Generator / Utility
Ofcourse. Good RMG first.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Okay, so before I can easily try to put a hero on a combat script, I need to actually be able to view scripts in the H4MG, so that's currently what I'm working on. I'm probably going to use a Tree View to show the scripts (like a file system where you can expand and collapse nodes) and eventually add options to copy and paste individual scripts, as well as the ability to move scripts in and out of conditionals / ask.
Are there any suggestions on a better way to show / add scripts than what is currently in the editor? Meaning, if you could change the editor where scripting is concerned, what would you like to see, if anything?
Are there any suggestions on a better way to show / add scripts than what is currently in the editor? Meaning, if you could change the editor where scripting is concerned, what would you like to see, if anything?
Re: Heroes 4 Map Generator / Utility
I think it would be a good and reasonable solution to display scripts similar to the editor, as it might make it easier to maneuver around, if the RMG and the editor look alike with a similar setup/display. So no better suggestion from my side. I still gotta test it, though before I can give you proper feedback.
But I actually intended to ask if you'd make an option to copy/paste individual scripts within a script aswell, but you just gave that away
But I actually intended to ask if you'd make an option to copy/paste individual scripts within a script aswell, but you just gave that away
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I think a tree view of the scripts will be a lot better than what is in the H4 editor. I'm thinking the tree will start completely expanded so that you can see all scripts, and then you can click the minus to hide scripts under conditionals and other scripts that contain scripts.
It looks like I'm going to have to create my own custom behavior, with some help from google, for dragging and moving scripts around inside of the tree.
It looks like I'm going to have to create my own custom behavior, with some help from google, for dragging and moving scripts around inside of the tree.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Got scripts displayed in tree form, with some minor things I still need to fix as far as what is displayed on some script nodes.
The tree view has the following advantages over the H4 editor way: 1) If you have a lot of nested scripts (scripts inside of scripts), you don't have to open a million windows to finally reach the script you're looking for, you can scroll right to it. 2) The H4 Editor bug that doesn't allow you to see all nested scripts is fixed by default.
I also added buttons to show or hide all scripts.
And now the sad news: I was able to put a hero on a triggered combat script, BUT, the game doesn't recognize the hero and only the creature will show up in the actual combat I tried removing the creature so only the hero was present, but that just resulted in a battle against no enemies No crash, but no workie either
The tree view has the following advantages over the H4 editor way: 1) If you have a lot of nested scripts (scripts inside of scripts), you don't have to open a million windows to finally reach the script you're looking for, you can scroll right to it. 2) The H4 Editor bug that doesn't allow you to see all nested scripts is fixed by default.
I also added buttons to show or hide all scripts.
And now the sad news: I was able to put a hero on a triggered combat script, BUT, the game doesn't recognize the hero and only the creature will show up in the actual combat I tried removing the creature so only the hero was present, but that just resulted in a battle against no enemies No crash, but no workie either
Re: Heroes 4 Map Generator / Utility
I think the best is a pack of typical scripts to choice and people who cant write scripts will change only numbers. Eg. give AI 1000 gold a day. They can change to 2000.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Well, as far as the AI scripting is concerned, the user will probably be able to set custom values, such as the amount of gold to give the AI per turn (or per week), or they can just use the default values. There should be no need, at least in this particular case, for someone to actually have to go into a script and edit it
As far as other types of scripts, I agree. I'll be including a lot of the scripts that I use, most of which don't require any editing, but some will require the name of the hero to be changed to the hero it will apply to. In that case, I'm going to add functionality to the H4MG that will simply let the user change the name, and then the H4MG will change the name everywhere needed in the script.
As far as other types of scripts, I agree. I'll be including a lot of the scripts that I use, most of which don't require any editing, but some will require the name of the hero to be changed to the hero it will apply to. In that case, I'm going to add functionality to the H4MG that will simply let the user change the name, and then the H4MG will change the name everywhere needed in the script.
Re: Heroes 4 Map Generator / Utility
Perhaps the Equilibris team might be able to find a way to include a hero in a triggered Battle?
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
That would certainly be nice
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Okay, so here are a couple screens showing the event and script displays. I've added an "Edit" option to the event tables like so:
Navigate to the script tab and voila, we have the scripts in a tree view. We can collapse or expand as needed (all scripts are expanded by default).
By clicking the "Hide All" button, we can collapse all scripts down to open only the path that we wish to see. This can be helpful for a script with lots of conditionals and conditionals within conditionals.
To manually expand a node, simply click the little expand icon next to the script info.
As I said before, with the tree view, there's no more need to open several scripts before you finally get to the one you want to edit, you simply go right to it
All for now
Navigate to the script tab and voila, we have the scripts in a tree view. We can collapse or expand as needed (all scripts are expanded by default).
By clicking the "Hide All" button, we can collapse all scripts down to open only the path that we wish to see. This can be helpful for a script with lots of conditionals and conditionals within conditionals.
To manually expand a node, simply click the little expand icon next to the script info.
As I said before, with the tree view, there's no more need to open several scripts before you finally get to the one you want to edit, you simply go right to it
All for now
Re: Heroes 4 Map Generator / Utility
Script tree? Good idea! Now all looks cleary. Thats it what we need.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Glad you like it Baronus
Update:
I've added the ability to view castle objects and their scripts, and the triggered / completion scripts for quest objects.
I've also done some work with editing heroes: Can change the class, gender, portrait, name, and bio. That took some work, since I had to record the code for each hero. I want to get the skills setup so we don't have to use the H4 editor "trick" to give any hero type any starting skill.
I think I want to finish getting viewers setup for the other garrison objects (garrisons and mines), and then I'll get started on an area selection tool (select and copy/paste parts of a map)
Update:
I've added the ability to view castle objects and their scripts, and the triggered / completion scripts for quest objects.
I've also done some work with editing heroes: Can change the class, gender, portrait, name, and bio. That took some work, since I had to record the code for each hero. I want to get the skills setup so we don't have to use the H4 editor "trick" to give any hero type any starting skill.
I think I want to finish getting viewers setup for the other garrison objects (garrisons and mines), and then I'll get started on an area selection tool (select and copy/paste parts of a map)
Re: Heroes 4 Map Generator / Utility
The scripting tree is something which everyone wanted, I presume. When will be a release?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Hi Duzeom.
The scripting tree is something I decided to do because, as you said in the Megom thread, clicking around is such a waste of time. Hopefully others will find this feature useful as well
What kind of ideas were you thinking as far as editing scripts? For some of the simple ones I was thinking about keeping them as they are in the editor (such as increase / decrease), but for the more complicated ones, such as the conditional, I'm not sure how I want them to be edited.
For conditionals, it's annoying to have to plan out the logic before you start scripting it. Make one mistake in the ordering and you have to back out and redo it, so I'm trying to think of a way to make that easier and not require things to be scripted in order. I was thinking about making it kind of code oriented, but that might take some time to design and implement. Maybe it wouldn't be too bad though..
Unfortunately the scripting feature is not very far along. Right now I can only edit combat scripts (since I wanted to try putting a hero on it), so there is a lot more work to be done (setting up viewers for different script types).
Right now you can open an existing .h4c map or create a new one, copy / paste events between maps and objects, save / load events and quest huts to / from file (which you can copy to your map and objects), paint terrain with various brush sizes (including a really large size good for high level map design), paint "void" terrain anywhere, and edit some properties on objects (army, hero, castle, etc.).
If you would find any of that useful right now, I can send you the current version of the H4MG, but an actual release is still a little ways away. I guess I could remove the things that currently aren't implemented and release that, and then just release more features as things progress
The scripting tree is something I decided to do because, as you said in the Megom thread, clicking around is such a waste of time. Hopefully others will find this feature useful as well
What kind of ideas were you thinking as far as editing scripts? For some of the simple ones I was thinking about keeping them as they are in the editor (such as increase / decrease), but for the more complicated ones, such as the conditional, I'm not sure how I want them to be edited.
For conditionals, it's annoying to have to plan out the logic before you start scripting it. Make one mistake in the ordering and you have to back out and redo it, so I'm trying to think of a way to make that easier and not require things to be scripted in order. I was thinking about making it kind of code oriented, but that might take some time to design and implement. Maybe it wouldn't be too bad though..
Unfortunately the scripting feature is not very far along. Right now I can only edit combat scripts (since I wanted to try putting a hero on it), so there is a lot more work to be done (setting up viewers for different script types).
Right now you can open an existing .h4c map or create a new one, copy / paste events between maps and objects, save / load events and quest huts to / from file (which you can copy to your map and objects), paint terrain with various brush sizes (including a really large size good for high level map design), paint "void" terrain anywhere, and edit some properties on objects (army, hero, castle, etc.).
If you would find any of that useful right now, I can send you the current version of the H4MG, but an actual release is still a little ways away. I guess I could remove the things that currently aren't implemented and release that, and then just release more features as things progress
Re: Heroes 4 Map Generator / Utility
It is pain in the ass if you want to change the conditional. So maybe some drag and drop? If you have implemented copying piece of script somewhere else, which is great functionality and I could just use it immediately, this shouldn't be very difficult, does it? I think all scripts should be implicitly in sequence script and they should draggable in that way:iLiVeInAbOx05 wrote: For conditionals, it's annoying to have to plan out the logic before you start scripting it. Make one mistake in the ordering and you have to back out and redo it, so I'm trying to think of a way to make that easier and not require things to be scripted in order. I was thinking about making it kind of code oriented, but that might take some time to design and implement. Maybe it wouldn't be too bad though..
Unfortunately the scripting feature is not very far along. Right now I can only edit combat scripts (since I wanted to try putting a hero on it), so there is a lot more work to be done (setting up viewers for different script types).
Right now you can open an existing .h4c map or create a new one, copy / paste events between maps and objects, save / load events and quest huts to / from file (which you can copy to your map and objects), paint terrain with various brush sizes (including a really large size good for high level map design), paint "void" terrain anywhere, and edit some properties on objects (army, hero, castle, etc.).
conditional {
conditional clause
} then {
sequence { <-- drag it from here
...
}
} else {
... <-- to here for example
}
I used to make lot of event inside custom heroes as triggerable events because of lack of ability to copy placed events through different maps. I also had to make a first map of my last campaign a not part of the story because I made all scripts in carryover hero and I needed a dummy map in the beginning to have a carryover hero in the second ;p.
What is void terrain?
I could use a functionality which paints whole land with given terrain eg. dirt.
Are you implementing it in java? If yes, then maybe I could help a bit.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Ah, I meant when scripting the conditional requirement, such as: If count == 0 AND (total number of creatures in army < 1 OR hero is dead)Duzeom_ wrote:It is pain in the ass if you want to change the conditional. So maybe some drag and drop? If you have implemented copying piece of script somewhere else, which is great functionality and I could just use it immediately, this shouldn't be very difficult, does it? I think all scripts should be implicitly in sequence script and they should draggable in that way:
conditional {
conditional clause
} then {
sequence { <-- drag it from here
...
}
} else {
... <-- to here for example
}
If the requirements were entered in the wrong order (the parentheses above), then you have to pretty much redo the logic. I was thinking about coming up with some way to make entering and adjusting this logic in a better way, but so far I haven't come up with anything.
As far as dragging and dropping scripts within an event, that will definitely be a feature as you described. Being able to drag a script into or out of a conditional (or sequence or any other nested script) would be extremely useful.
The only problem is that java's JTree doesn't have any native support for drag and drop, so I'm going to have to create that from scratch
Haha I ran into that when going from my second to third map and had to recreate all of my scripting on a carryover hero. I didn't even think about hiding a carryover hero on my first map, that would have certainly saved me some time.Duzeom_ wrote:I used to make lot of event inside custom heroes as triggerable events because of lack of ability to copy placed events through different maps. I also had to make a first map of my last campaign a not part of the story because I made all scripts in carryover hero and I needed a dummy map in the beginning to have a carryover hero in the second ;p.
Fortunately, with this tool we won't have to do things like that anymore, since we can copy / paste events between heroes
Void terrain is the pure black terrain that you get when you paint cave or stone. With this tool we can put that black terrain wherever we want, and without the stone / cave boundaries.Duzeom_ wrote:What is void terrain?
You can easily do that with this tool Just set the "brush size" to ludicrous, select your terrain type, and you can paint an XL map in a of couple secondsDuzeom_ wrote:I could use a functionality which paints whole land with given terrain eg. dirt.
I sure am. I'll take a look and see what I could use some help with. Right now I'm still creating the various viewers. I still have garrisons and mines to replicate, and then the various script viewers, along with editing abilities.Duzeom_ wrote:Are you implementing it in java? If yes, then maybe I could help a bit.
After I get through those, I could probably use some help with some of the random generation algorithms, mostly the design, such as zones and what can potentially go where, etc.
Right now, I could use some non-java help coming up with ideas for editing the conditional logic requirements (AND, OR, NOT, etc.). The way the H4 editor handles editing conditional requirements is time consuming and can be unforgiving if you make any mistakes, so I'd like to create an alternative that's more user friendly
Just to be completely clear, here are a couple screen shots of what I'm talking about.
And then if I select the top edit button to edit the If condition.
If you have any amount of AND's, OR's, or NOT's, it can be extremely annoying if you have to change the logic, not to mention that you have to enter it in the correct order, which can sometimes be difficult if you have somewhat complex logic to deal with.
Re: Heroes 4 Map Generator / Utility
You could write a parser for a user scripting:
AND, OR, NOT, FALSE, TRUE, () <- function
then user could write a conditional like that:
IF ( (func1) AND (func2 OR NOT (func3)) )
func1: hero level >= 4
func2 hero colour == blue
func3: day >= 10
I could write a random map generator engine. I was doing some research about it. You can find my topic about rmg long time ago. The main problem with it that I don't have a lot of spare time, so I could tweak something or write a little functionality. If I had a lot of time I would started writing rmg myself... but life's brutal
AND, OR, NOT, FALSE, TRUE, () <- function
then user could write a conditional like that:
IF ( (func1) AND (func2 OR NOT (func3)) )
func1: hero level >= 4
func2 hero colour == blue
func3: day >= 10
I could write a random map generator engine. I was doing some research about it. You can find my topic about rmg long time ago. The main problem with it that I don't have a lot of spare time, so I could tweak something or write a little functionality. If I had a lot of time I would started writing rmg myself... but life's brutal
Who is online
Users browsing this forum: No registered users and 3 guests