PDA

View Full Version : Creating maps with HERO PORTALS



Hapuga
January 4th, 2010, 00:01
Okay, finally after 10 years of silence this one is beaten. Well, at least partly.

I want to warn you immediately that you will not be able to change one thing:

Globals.

You will also need a Hex editor for this process. I suggest Hex Workshop as a very convenient and reliable program.

Changing all the other things is fine. Now, how is it done:

Step One

Download the map I provided. Extract it wherever you want, you will only really need one file from it:

SampleHeroPMap.kwd

You can delete the rest. The names are a bit weird and long, this is done on purpose, so you would know the approximate length of an allowed map name. You will need it later.

You also need the map HeroPool provided by DragonsLover below. Extract it into your DK2 Maps folder. You will need for the next step.

Step Two

Open the HeroPool map you just extracted and, now it's important: leave it open in the editor. Then, open an existing map or create a map you want. Do whatever you want with it. You will notice that in the Keeper's properties window, you will now be able to add heroes into the Creature Pool of the Keepers, a thing that would be normally impossible to do without the presence of the HeroPool map. Also note that Hero Portal is only supported by 4 Keepers maximum. You can make a 5 Keepers map, but you'll have to give him a normal creature portal, because DK2 does not support Hero Portal for 5th Keeper or more.

Save the map to your maps folder.

Step Three

Now, take the provided .KWD file, rename it to your map name and replace the existing .KWD file of your map. Here is when you'll need a Hex Editor. With the HE, open the renamed SampleHeroPMap.kwd file and scroll to the very bottom of it. You will see some lines starting with Data\Editor\Terrain and going to the very end to Data\Editor\Maps\SampleHeroPMapThings.kld.

Now, we will only need the lines that have the SampleHeroPMap name in them. Those start from Data\Editor\Maps\SampleHeroPMapPlayers.kld. Put the cursor behind the first letter (S) in the map name. Now, OVERWRITE the map name with your own map name, and add the suffix at the end. So, if it was Data\Editor\Maps\SampleHeroPMapPlayers.kld, and your map name is Goody, it will be GoodyPlayers.kld (no spaces, and don't forget the extension at the end).

Continue with the other 4 lines. Do not touch Data/editor/globalvariables.kwd.

Take note, these are case sensitive! If you have them in capital, keep them all in capital! You can't have one "Goody" and second "goody".

Now, if the name of your map is shorter than the original:
Put the cursor on the Hex column, so that it would be right after the last letter of your map name. For example, GoodyPlayers.kld is shorter than SampleHeroPMapPlayers.kld, so when rewriting you will get GoodyPlayers.kldayers.kld.

Now, keep adding zeros (0) till you cover all the unnecessary letters. It will appear as dots or squares on the right column.

DO NOT delete the letters! You will change the CHECKSUM of the file and it will not be recognized any more.

Save the modifications.

Step Four

Finally, delete the GoodyGlobals.kld file (in our example). You don't need that file anymore. Also, keep a copy of your new .KWD file if the editor would change it back after you save the map again.

You are done! Congratulations!


Post edited by DragonsLover

DragonsLover
January 6th, 2010, 11:18
There's just a little problem: it becomes impossible to edit the level anymore.

Anyway, for now, I have found how to add the amount of heroes into the pool in the level editor by doing some hex editing, but the problem is that they come out from the normal creature portal instead of the mercenary one, even with "Available Via H. Portal" activated. How to specify which creature should get out from the normal portal and which one should get out from the mercenary one?

Madkill
January 6th, 2010, 12:54
So what was wrong with setting attractions for heroes in the variables and then giving the keepers a hero portal?

Hapuga
January 6th, 2010, 18:28
There's just a little problem: it becomes impossible to edit the level anymore.

Anyway, for now, I have found how to add the amount of heroes into the pool in the level editor by doing some hex editing, but the problem is that they come out from the normal creature portal instead of the mercenary one, even with "Available Via H. Portal" activated. How to specify which creature should get out from the normal portal and which one should get out from the mercenary one?

This is very weird. I can edit every map I create with such method.

And with your question, I am sorry, I do not know. We have to study the variables file because it has all the answers. variables.kwd I mean, the one in the editor folder. All map variables are made based on this file.

We should also try to find out why globals override variables. When you have a map with globals, hero portals will be disabled.

Metal Gear Rex
January 6th, 2010, 20:34
Anyway, for now, I have found how to add the amount of heroes into the pool in the level editor by doing some hex editing, but the problem is that they come out from the normal creature portal instead of the mercenary one, even with "Available Via H. Portal" activated. How to specify which creature should get out from the normal portal and which one should get out from the mercenary one?

I found out how to do that without Hex Editing. I have an old map that has some really weird data and basically I load it up, and create a new map from it. Then when I go to the Creature Pool of the New Map, I have access to all creatures AND Heroes, even Uniques. I can make the Imp available. :D

Then I close out the old (Making sure I accidentally don't screw up its data) and tell the editor to return to DK2 defaults (No matter how crappy they are) and then I go into the Creature Data and tell it so that the Heroes are available via Portal.

One trick I will try (I don't know if it works) is going into the Pro Editor and messing with the rooms to see if I can make the Evil Portal look like the Mercenary Portal. Could work. :P

---

Only thing is it works with perticularly that map, I have no idea why. I can give it to you if you want.

DragonsLover
January 7th, 2010, 05:12
Madkill : heroes come from the evil portal instead of the mercenary one.


When you have a map with globals, hero portals will be disabled.

Here, XXX is the name of the map.

"XXXGlobals.kld" file stores all the .KWD files from the Editor folder into one, excepted for "GlobalVariables.kwd" where its contain is read first then modified by reading the data from "XXXVariables.kld" file.

When we do what you have written below, we ask the level to take the data straight from the .KWD files that are inside the Editor folder instead of the "XXXGlobals.kld" file while the rest is similar ("GlobalVariables.kwd" is read then modified by "XXXVariables.kld"), excepted that this time, heroes have been added into the pool from the modified "XXXVariables.kld" file.

I tested to tell the level to take the data from the "XXXGlobals.kld" file by changing the "XXX.kwd" file, leaving to tell the level to take the modified "XXXVariables.kld" file. The result: no mercenaries. This means that the problem doesn't come from the variables, but from the "XXXGlobals.kld" file or the "XXX.kwd" file.


I found out how to do that without Hex Editing. I have an old map that has some really weird data and basically I load it up, and create a new map from it. Then when I go to the Creature Pool of the New Map, I have access to all creatures AND Heroes, even Uniques. I can make the Imp available. :D

I can do the same for every level without having to load a particular level, just with hex editing. But it would avoid the heroes to go through the Mercenary Portal if I do so. So I guess it'd be better to use an alternative map to allow to add heroes into the pool. Don't send it, I'd be able to do that on my own.

Hapuga
January 7th, 2010, 08:41
The problem comes from both Variables and Globals.

What you have written is correct, I just want to repeat that the Editor creates a different Variables file. You can create a simple map and include no Globals, change variables and xxx.kwd and portals will work, or you can create the same map in editor, change only xxx.kwd and it won't work.

The problem is in how editor interprets and builds these two files.

DragonsLover
January 8th, 2010, 05:58
Globals, yes. But Variables, no.

It doesn't work with Variables because there's no heroes into the pool. That's all.

As for Globals, it seems that the level requires the global .KWD files from the Editor folder in order to make the Mercenary Portal to work. At the moment where we tell the level to use the Global.kld data file instead, it doesn't work anymore.

That way, you aren't forced to use the Variables from the sample map you provided. I simply did a little trick similar to what Metal Gear Rex said to bypass that: use a map that allows to add heroes into the pool and create a new map from it. Then, once the level is done, just save it and do the Step Three like you mentioned above by either using the sample map you provided or any of the Frosty's levels. I guess you can even use any of the "official" levels. Then, once done, delete the useless Globals.kld file amongst the level files and voila!

I did that level that allows to add all heroes to the pool with some hex editing, excepted for the Stone Knight, Lord of the Land, King Reginald and Princes because they don't require rooms to be attracted and are too much powerful. However, I did an exception for the Dwarf, but still, it's not recommended. My level also contain some slightly little modifications of the beginning of my unofficial patch, but if you use the map simply for the Mercenary Portal, then it's not really a problem.

To add a hero into the pool, just do it as if you wanted to add an evil creature: Edit Keeper Properties... >>> Creature Pool.

Hapuga
January 9th, 2010, 17:58
Ah, I understand.

Well, good trick, I tried it and it, indeed, works.

BTW, you can choose not to save GLOBALS, so you won't have to delete anything.

However, You've missed the point of my post a bit. My main concern is why does Editor screw up the whole map by crashing kwd, variables and disabled globals? I wish there could be a possible fix for this.

DragonsLover
January 10th, 2010, 00:46
BTW, you can choose not to save GLOBALS, so you won't have to delete anything.

However, You've missed the point of my post a bit. My main concern is why does Editor screw up the whole map by crashing kwd, variables and disabled globals? I wish there could be a possible fix for this.

The reason why the level crashes when we don't include the Globals is because, inside the level .KWD file, even if we answer no to include the Globals, the editor saves the level and still tell it to seek for the Globals.kld file instead of specifying to use the different .KWD files from the Editor folder. Because we decided not to include Globals, the file isn't saved and thus, causes the game to crash for not getting the data properly as the file doesn't exist. I wish that a fix could be made as well, but I'm not highly qualified to modify the editor executable and solve that problem. But for now, it's preferable to always answer Yes.

As for why does the Editor do that, I have no idea. Perhaps Bullfrog didn't wanted to allow us to do that to difference user-made levels from the official ones?

Keldaryth
June 15th, 2010, 19:38
Okay, new to making anything DK2 and I'm now confused.

So... we can make maps with working hero portals without hex editing? Or not? And what exactly is this 'new map' from old technique?

Also, is it or is it not possible to modify game variables and have working hero portals in a level? And if so which technique needs to be used?

I'm interested in building a campaign (or linked scenarios) around a hero style dungeon, but that's either going to need merc portals with a creature pool.

Dragonslover - I tried opening the map you posted and editing creature properties didn't show me heroes in the creature pool, and I'm not sure if it was meant to?

Sorry in advance if I should be posting this elsewhere, but I'm completely confused.

DragonsLover
June 16th, 2010, 02:59
So... we can make maps with working hero portals without hex editing? Or not? And what exactly is this 'new map' from old technique?

Yes, you can make maps with working hero portals, but you WILL HAVE to hex edit.


Also, is it or is it not possible to modify game variables and have working hero portals in a level? And if so which technique needs to be used?

Yes, it is possible to modify game variables and working hero portals in a level. You just simply have to edit variables without special techniques. Modify them normally.


Dragonslover - I tried opening the map you posted and editing creature properties didn't show me heroes in the creature pool, and I'm not sure if it was meant to?

It's not the "Creature properties" you have to open, but the "Keeper properties".

Here's what you have to do:
First, open the "HeroPool" map and click on "OK" to load the global data. Then, leave that map open and open YOUR map. Right-click on the "Player" in the script tree and select "Edit Keeper Properties". Select the "Creature Pool" dropdown list and you should be able to add heroes into the pool. :)

Now, for the Hero Portal to work, let me edit the first post by Hapuga to avoid confusions. Edit : the post has been edited. It explains clearly what you have to do.

Keldaryth
June 16th, 2010, 07:28
Whoops sorry, I meant keeper properties. That's what I get for staying up to 5 AM.

I tried the hex editing, and the map opens fine now in the editor with the replaced file, but it crashes the game when I try to load it... I've obviously done something wrong, but I'm not sure what...

DragonsLover
June 16th, 2010, 20:54
Hmmm... yeah, I also got a crash once, but in the editor. I guess it was because I didn't hex edit the file properly. You have to be sure that, by using the hex editor, you didn't erase (by Delete or Backspace keys) in the .KWD file of the map. If you did, the checksum of the file would be broken.

Yeah, I know, it sucks to have to hex edit files to make the Hero Portal working, but I don't see other solutions. Hero Portals only work when the Global Variables of the game are used without using those of the map.

Madkill
September 3rd, 2010, 05:28
I just thought of something. 1.7 had many faults, but it added the maiden to the 'creature listings', maybe there are hero sliders? By default they're all on 0 (to prevent them coming out of regular portals) and without the ability to manually change it you won't be getting any unless its an official map where the variables change the default setting.

Just a thought, there could already be sliders there and its all down to some screwed-with code that makes it invisible.


...Or maybe, just maybe, there's broken code in the map editor so when you place a hero portal it only registers it as 'some room'.


I've also figured out a way around this whole scenario, though it destroys the random factor. Still.

Step 1.
Place a hero portal.

Step 2.
Place a Action Point around the hero portal. (3x3)

Step 3.
If Keeper X > builds Lair > generate creature (Alignment Keeper X) > at Action Point X

Step 4.
Profit.

-----------

Now, you might be asking yourself "But it has to be the same for all keepers! Otherwise it'll be unfair"
This is very true! But you can place other portals that offer an extra 3-4 heroes and it is in this that a player must do what he can to make sure he outnumbers his enemy!

I've also just thought up a new 'mode' for map, excuse me for a second. You're going to love this...

Metal Gear Rex
September 3rd, 2010, 12:15
I just thought of something. 1.7 had many faults, but it added the maiden to the 'creature listings', maybe there are hero sliders? By default they're all on 0 (to prevent them coming out of regular portals) and without the ability to manually change it you won't be getting any unless its an official map where the variables change the default setting.

Just a thought, there could already be sliders there and its all down to some screwed-with code that makes it invisible.


...Or maybe, just maybe, there's broken code in the map editor so when you place a hero portal it only registers it as 'some room'.


I've also figured out a way around this whole scenario, though it destroys the random factor. Still.

Step 1.
Place a hero portal.

Step 2.
Place a Action Point around the hero portal. (3x3)

Step 3.
If Keeper X > builds Lair > generate creature (Alignment Keeper X) > at Action Point X

Step 4.
Profit.

-----------

Now, you might be asking yourself "But it has to be the same for all keepers! Otherwise it'll be unfair"
This is very true! But you can place other portals that offer an extra 3-4 heroes and it is in this that a player must do what he can to make sure he outnumbers his enemy!

I've also just thought up a new 'mode' for map, excuse me for a second. You're going to love this...

Wouldn't work, I tried it. It conflicts because say you can get multiple heroes at the same time. Unless you want an immediate adding in, which wouldn't be very fair. You'd have a max limit of how many you can add in, otherwise you make it repeat but that also wouldn't be fair as with an immediate attraction. Say you meet the attraction for a Thief, well, you'd get nothing but Thieves until you reach a limit (If you remember to add a limit, otherwise, you're screwed as there's no copy and paste of triggers so you'd have to do it ALL OVER AGAIN)

Needless to say, it is uselessly complex and too much work to be worth the effort. It might work with say only a few amount (3-) but wouldn't be the best solution. If you plan to use most of the Heroes, it might just be too much work for the mapmaker and end up killing his will to continue on (Possibly mapmaking in general as well)

Madkill
September 3rd, 2010, 14:28
So you can get several heroes at the same time, what's the problem? It'd just be a case of this room attracts this hero every few seconds until you have x amount of that hero. Essentially, you're 'coding' how portals are meant to work anyway. It'd be very DKI in the end; you could set it so with every few slabs you attract an extra 1 of that hero.

Too much effort? Not at all, you could say this about Hapuga's way too. Yes, there would end up being -a lot- of triggers but in the end, solve how to do it properly for one and from there it'd just be a case of repeating the same thing again and again but with different variables, wouldn't take that long.

Metal Gear Rex
September 3rd, 2010, 16:25
So you can get several heroes at the same time, what's the problem? It'd just be a case of this room attracts this hero every few seconds until you have x amount of that hero. Essentially, you're 'coding' how portals are meant to work anyway. It'd be very DKI in the end; you could set it so with every few slabs you attract an extra 1 of that hero.

Too much effort? Not at all, you could say this about Hapuga's way too. Yes, there would end up being -a lot- of triggers but in the end, solve how to do it properly for one and from there it'd just be a case of repeating the same thing again and again but with different variables, wouldn't take that long.

You clearly have never even tried this, or even have any idea of what you're talking about. I'm talking about this from my own experiance at creating a Hero Map, I already thought of this a few years ago, it isn't very effective. Instead, a better idea is this:

Step 1: Create some new global data. (Doesn't have to change anything, just save new global data I think)
Step 2: Create a new map with this global data present. The result is that you'll be able to add Heroes to the Creature Pool. (If you did change anything in the global data, obviously you'd have to reset things using the "Return to DK2 Defaults" option.
Step 3: Modify the Creature Portal to look like the Hero Portal. Note that this step is completely optional, as it only changes the appearance (They'll still need to be plucked from the Portal due to their entrances not designed for that portal type)

Simple, and only needs to be done once as you can simply reload the global data for a new map.

I do think DL or Hapuga mentioned this once, but, to be fair to myself, I thought of the idea before I they mentioned it (Or if they mentioned it before, then before I heard them mention it) therefore, it is probably impossible to tell who came up with if first, not that it matters anyways. I tend to keep quiet as I feel this should be common knowledge, like that DK1 Protect Spell, but apparently not.

Madkill
September 7th, 2010, 18:45
I did try it, was moderately effective. Its fun to play around with the style of play. But those steps are probably simpler I guess. :P

Metal Gear Rex
September 9th, 2010, 07:30
I did try it, was moderately effective. Its fun to play around with the style of play. But those steps are probably simpler I guess. :P

Don't forget that my own steps aren't repeatable. For your's, you have to do it over and over again for every map, unless you keep it exactly the same and simply re-use the same map but modify the level (Limiting >.>)

Madkill
September 10th, 2010, 03:30
The more you do something, the faster one will be at doing it and though it may feel like a chore it'd be worth it in my opinion. :D

Dungeon_Bird
January 6th, 2011, 05:54
hmmm this is interesting.

done sucessfully. Pitty that it messes up the Enemy Heros who spawned through gates on regular base. With hero portals enemy heroes dont spawn anymore.

rakrotay
May 8th, 2013, 17:50
Hi I`m new to the forum and I was just wondering if some of you guys that are expert with this kinda of stuff could please share some Hero maps/Hero multiplayer maps with me, because I`m trying to understand how it is done but I think I`m too dumb to understand it :(

Stone_Knight
September 14th, 2014, 12:46
I followed your instruction step by step, but it seems the hero portal still doesn't work.

I don't know if that was already discussed. I tried it a second time and this time I create a normal portal with the result that it works perfect :D. It's important that you have to put number of evil creatures down to 0 to have only good creatures and there is a little problem that the heroes don't come out from the portal by themselves. You should help they ;) !!!