Heroes 4 Advanced Options Map Editor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Update: I have implemented the ability to view and edit most scripts. I have also implemented the ability to "step into" and view / edit custom events from a separate event. Here are some screen shots to illustrate what I'm talking about.
First, open up a map that has event scripting which calls a custom event via the "Trigger custom event" script. Then navigate to an event which has one of these scripts in it.
View the event (by double clicking it) and select the "Trigger custom event" script.
Open it (by double clicking) and you will see the following:
I've added a button "Edit Event". Clicking it will open up an Event Properties dialogue for the selected custom event and default to the "Script" tab.
No more hunting around to find a custom event when you're trying to trace your events to debug or see how another map maker did his/her scripting, simply open it from the event you are looking at
I'm likely going to add a context menu so that right clicking on a "Trigger custom event" script in the script viewer will give you the option to go to the custom event so that we don't have to open the script dialogue first (fewer clicks).
First, open up a map that has event scripting which calls a custom event via the "Trigger custom event" script. Then navigate to an event which has one of these scripts in it.
View the event (by double clicking it) and select the "Trigger custom event" script.
Open it (by double clicking) and you will see the following:
I've added a button "Edit Event". Clicking it will open up an Event Properties dialogue for the selected custom event and default to the "Script" tab.
No more hunting around to find a custom event when you're trying to trace your events to debug or see how another map maker did his/her scripting, simply open it from the event you are looking at
I'm likely going to add a context menu so that right clicking on a "Trigger custom event" script in the script viewer will give you the option to go to the custom event so that we don't have to open the script dialogue first (fewer clicks).
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Another update: I've begun copying and pasting scripts between events! We can also copy and paste scripts to the same event. I'll probably work on adding new scripts and changing the type of other scripts next. Then I'll look at moving scripts by dragging them (and allow scripts to be moved into or out of other scripts, such as a conditional).
Then the area selection tool, although I think before that I may update my old copy / paste implementation to use the system clipboard, which is significantly easier and better than what I initially implemented. In fact, I may do that first..
Then the area selection tool, although I think before that I may update my old copy / paste implementation to use the system clipboard, which is significantly easier and better than what I initially implemented. In fact, I may do that first..
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Okay, I fixed the copy / paste implementation to use the system clipboard, which cleaned up a LOT of code, besides being the correct way to do things. It will be a simple thing to implement copying / pasting of pretty much anything else useful now that I know how to use the clipboard
Re: Heroes 4 Map Generator / Utility
Maybe something like a pen to draw copied area borders?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Baronus, I do plan to make it so you can draw on the map to create the area to copy, so you will be able to see the borders on the map you copy from I should also be able to put the same outline on any map you paste to.
Re: Heroes 4 Map Generator / Utility
Those are great news. Brilliant to come up with an easy solution, of tracking triggered scripts. Will be very useful. Also can't wait to try out the map copying part.
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
Hi CTPAHHuK, there isn't an exe file since I'm using Java to create this application. So unfortunately, when I release the H4MG, it will require anyone who wishes to use it to download and install Java. Once that's done, all you have to do is double click the java icon in the H4MG folder
I think I will ask Kalah to do an initial release once I finish with the scripting stuff I'm currently working on (adding new scripts, changing script type, and dragging / dropping).
Glad you like it Michael I just recalled how annoying it was to try to locate scripts when I haven't looked at them in a while!
Once I finish with the scripting stuff and get the initial release out, I'll focus on copying parts of one map to another (or copying to the same map in a different location / moving the selected area around).
I think I will ask Kalah to do an initial release once I finish with the scripting stuff I'm currently working on (adding new scripts, changing script type, and dragging / dropping).
Glad you like it Michael I just recalled how annoying it was to try to locate scripts when I haven't looked at them in a while!
Once I finish with the scripting stuff and get the initial release out, I'll focus on copying parts of one map to another (or copying to the same map in a different location / moving the selected area around).
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Alright, well yesterday I found a good example of how to add drag and drop to a JTree and so I have drag and drop currently working I thought that was going to be the difficult part, but it was actually pretty easy with an example. I'm just going to have to tweak some things so they fit a little better.
Then, the hard part, will be updating the list of scripts based on the JTree, since the JTree itself isn't backed by the list that I pass in, so I'll just have to play around with some debug to figure out the best way to get that linked in. Then, I'll test as much as possible and message Kalah to make an initial release of the H4MG available here
Then, the hard part, will be updating the list of scripts based on the JTree, since the JTree itself isn't backed by the list that I pass in, so I'll just have to play around with some debug to figure out the best way to get that linked in. Then, I'll test as much as possible and message Kalah to make an initial release of the H4MG available here
Re: Heroes 4 Map Generator / Utility
Problems are defeat...It will very good MG as I see :-)
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Well, I think I have all the cases for drag and drop in the script tree covered. Basically, you can drag a script to any other sequence script or change the order of scripts within a sequence script. You cannot drag a script if it is the first script under a "Then" / "Else", "Yes" / "No", or "Victorious" / "Defeated" block. I also added a case to prevent things like dragging an Ask script into its "Yes" or "No" sequence scripts.
I still have the difficult task of determining the best way to translate these tree node movements into an actual change in the script list, which is the next item on my list
I also realized that I didn't show a little example of copying and pasting scripts, so I'll take a couple screen caps for that later today. Admittedly it's pretty much the same as copying / pasting events, but I'll show it anyway
I still have the difficult task of determining the best way to translate these tree node movements into an actual change in the script list, which is the next item on my list
I also realized that I didn't show a little example of copying and pasting scripts, so I'll take a couple screen caps for that later today. Admittedly it's pretty much the same as copying / pasting events, but I'll show it anyway
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Here's a quick example of copying and pasting scripts.
First, open up two events, and go to their script tabs.
Next, select the scripts you would like to copy, then right click and select copy.
Finally, go to the other event, right click in the window, and select paste.
Make sure you click the "OK" button for your changes to take effect, and you've copied scripts between events Although I just found a bug if you highlight part of a script which contains more scripts >.<
Edit: Fixed the bug.
First, open up two events, and go to their script tabs.
Next, select the scripts you would like to copy, then right click and select copy.
Finally, go to the other event, right click in the window, and select paste.
Make sure you click the "OK" button for your changes to take effect, and you've copied scripts between events Although I just found a bug if you highlight part of a script which contains more scripts >.<
Edit: Fixed the bug.
Re: Heroes 4 Map Generator / Utility
You're truly a wiz
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
- Steven Aus
- War Dancer
- Posts: 350
- Joined: 08 Feb 2006
- Location: Perth, Australia
- Contact:
Re: Heroes 4 Map Generator / Utility
A WizInABox.
My Life Purpose Is To Teach The World To Fish For Life. I AM Steven Russell Lynch Abundance That I AM. Empowerment And Fostering Self-Responsibility Is My Game.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
~_~
Found and fixed a couple more bugs in the implementation of dragging and dropping scripts in the tree view.
Unfortunately I didn't have a lot of time to work on things this weekend, so I didn't get much done. I do, however, think that I have come up with the solution for updating the scripts when we drag / drop so I'll try to get that in place soon
Found and fixed a couple more bugs in the implementation of dragging and dropping scripts in the tree view.
Unfortunately I didn't have a lot of time to work on things this weekend, so I didn't get much done. I do, however, think that I have come up with the solution for updating the scripts when we drag / drop so I'll try to get that in place soon
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Good news! It appears I have the drag and drop ability working so that it also moves the scripts to their proper location! Turned out to not be as hard as I thought, since really you can only move scripts around inside of a sequence, or to another sequence.
I'll try to get some screen captures of this feature in action tomorrow
I think that just leaves adding / removing scripts on the list of what needs to be somewhat working before the initial release
I'll try to get some screen captures of this feature in action tomorrow
I think that just leaves adding / removing scripts on the list of what needs to be somewhat working before the initial release
Re: Heroes 4 Map Generator / Utility
Good. Easy ways are better for all. Map creating process will be nice...
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Okay! So here's a quick example of drag and drop in play. Open up a map, and select / open an event and its scripts. Highlight the script(s) to move.
Next, click and drag the script(s) to the sequence node (or under a sequence node if there are already scripts there) you want to move them to. In the example below, I have dragged to the highlighted sequence (can't see the mouse in the screen capture).
Now, release the mouse button to drop the script(s) in place. The scripts will be moved, and right now the node will collapse and you will have to hit the expand icon to see the scripts.
Finally, hit the save button (or save as somewhere else), and view the editor to see that the script or scripts were moved. In the example below, I have to click and open MANY scripts in order to get to the script in question. No more need to do that if I just want to move a script
Here's an example of when this feature would be really helpful: Say you have created several scripts, but forget that the scripts should only be run for a particular hero. No! We used to have to create a conditional, and then redo the scripts under the conditional. Now all we have to do is create the conditional, and then drag and drop the scripts where they need to be.
And I just found a bug with drag and drop that I'll have to address >.< It happens when you select one or more scripts and try to drag and drop them into the same sequence. I probably introduced that bug when I was fixing another.. Oh well I'll get it taken care of.
Edit: I believe I have fixed the bug mentioned above.
Next, click and drag the script(s) to the sequence node (or under a sequence node if there are already scripts there) you want to move them to. In the example below, I have dragged to the highlighted sequence (can't see the mouse in the screen capture).
Now, release the mouse button to drop the script(s) in place. The scripts will be moved, and right now the node will collapse and you will have to hit the expand icon to see the scripts.
Finally, hit the save button (or save as somewhere else), and view the editor to see that the script or scripts were moved. In the example below, I have to click and open MANY scripts in order to get to the script in question. No more need to do that if I just want to move a script
Here's an example of when this feature would be really helpful: Say you have created several scripts, but forget that the scripts should only be run for a particular hero. No! We used to have to create a conditional, and then redo the scripts under the conditional. Now all we have to do is create the conditional, and then drag and drop the scripts where they need to be.
And I just found a bug with drag and drop that I'll have to address >.< It happens when you select one or more scripts and try to drag and drop them into the same sequence. I probably introduced that bug when I was fixing another.. Oh well I'll get it taken care of.
Edit: I believe I have fixed the bug mentioned above.
Re: Heroes 4 Map Generator / Utility
Super! Good thing will be copy this forum guide to pdf? format and add to MG. The best learning is using examples... Very, very good!:-)
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Got deleting scripts working and am now working on adding new scripts.
Who is online
Users browsing this forum: No registered users and 0 guests