Heroes 4 Advanced Options Map Editor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Greetings. A few screen captures from my previous update. Here's a look at the Event Group Panel, which is part of the Events panel. It's not tied to any particular map so it might make more sense to put it on its own tab, but we'll see.
To create a new event group, simply click "New," and then give your new event group a name and select the type.
We've created our first event group! It is a Map event group, with the shown event types.
Now, lets load up a map that has some utility events that we can copy to our event group. I chose one of my template maps which has all of my utility scripting, and starts covered in water so I can raise the elevation of the entire map as I see fit (now made obsolete by the H4MG). I'll copy the triggered events here.
Now we'll switch back to the Event Group tab and paste our events under the "Triggerable" type.
Bam, now our event group has our triggerable scripts. I'll copy / paste the rest over as well.
Finally, we can save our Utility Events by clicking on the save button, and then navigating to the location you want to save the file, or - recommended - save it here. On startup, this is where the H4MG checks for event groups and automatically loads them.
Now we are able to copy and paste these events to any map of our choosing - we don't have to open up a particular map and copy / paste those events. I'll probably need to gzip these files to reduce their footprint, even though they aren't all that big.
The load button isn't implemented yet, but that will be simple I also have some more work to do with being able to open a frame to look at carryover heroes / etc. so that we can copy and paste those events as well. I'll likely include some of my utility events with the H4MG.
To create a new event group, simply click "New," and then give your new event group a name and select the type.
We've created our first event group! It is a Map event group, with the shown event types.
Now, lets load up a map that has some utility events that we can copy to our event group. I chose one of my template maps which has all of my utility scripting, and starts covered in water so I can raise the elevation of the entire map as I see fit (now made obsolete by the H4MG). I'll copy the triggered events here.
Now we'll switch back to the Event Group tab and paste our events under the "Triggerable" type.
Bam, now our event group has our triggerable scripts. I'll copy / paste the rest over as well.
Finally, we can save our Utility Events by clicking on the save button, and then navigating to the location you want to save the file, or - recommended - save it here. On startup, this is where the H4MG checks for event groups and automatically loads them.
Now we are able to copy and paste these events to any map of our choosing - we don't have to open up a particular map and copy / paste those events. I'll probably need to gzip these files to reduce their footprint, even though they aren't all that big.
The load button isn't implemented yet, but that will be simple I also have some more work to do with being able to open a frame to look at carryover heroes / etc. so that we can copy and paste those events as well. I'll likely include some of my utility events with the H4MG.
Re: Heroes 4 Map Generator / Utility
Might I suggest that if people has some utility scripts they would like to share, they could add them to a script library? There was a lot of discussion about various scripts to help improve AI and if he interested in it, PatFx could share his easy testing script. Scripts like these might be useful to compile in an included script library. People could the choose to delete them if they don't need them.
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
Sure, that would be a nice idea, and it could be released / updated separately from the H4MG, like maps now. All you'd have to do is copy the various group files to your data/event_groups directory (wherever the H4MG lives). That could maybe just be a zipped file with the various groups hosted here on CH.
We could either have people send me the map and tell me which scripts to copy, or once the H4MG is released for testing they can send me their events group files.
We could either have people send me the map and tell me which scripts to copy, or once the H4MG is released for testing they can send me their events group files.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Okay, I can display events for armies, heroes, carryover heroes, and prisons. For armies and carryover heroes you can see most of the fields that you can in the H4 editor, but for prisons and heroes only the events tab is functional.
I think I'll work on displaying quest huts / gates / guards next. Once I get that up and running, I'll work on saving / loading quest hut info between quest huts.
I think I'll work on displaying quest huts / gates / guards next. Once I get that up and running, I'll work on saving / loading quest hut info between quest huts.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I'm now able to display quest huts, guards, and gates (I forgot to actually test viewing a gate and a guard, but they should work). Time to sleep!
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
We can save / load quest huts, guards, and gates I added a file menu with save and load options to the frames for viewing quest huts / guards / gates. I'll post some screen caps later, but it's very simple
- 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.
Who is online
Users browsing this forum: No registered users and 1 guest