Its now possible to make own preset areas

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Its now possible to make own preset areas

Post by kingpin » Sun Jun 01, 2003 11:47 pm

Part I: Change random cave into a preset cave.

I have succeed with making a completly new preset level.

We, knew that Treasure Level does only have one exit and they are 4 as a number. I have made one extra tresure level and can turn any underground level into a treasure level if i want ;)

How does this work?

We have a very important and logical file that handles the preset levels.

LvlPrest.txt

In LvlPreset we have a column that tells if this level is used as a preset level or not. Its like how lvlMaze id works. This LevelId is connected to levels.txt.

So if we want to have Den of Evil as a treasure level.

Go down to row 105, there are already an unused treasure level in that row. The important here is that we have the correct graphics loaded, and that get we for free here.

Change LevelId to 8 (this is Den of Evil's ID).

Next we need to do is to load the Levels.txt.

Go down to row 10 (Den of Evil). We need to change its SizeX/SizeY, since we already knew that preset use only one ds1 file and a normal ds1 treasure file is 24/24, so put SizeX = 24 and SizeY = 24.

next go over to DrlgType and change it to have value 2 (this is to tell that is preset).

Last we need to change is what vis/warp column it use. Preset level use Vis1/Warp1. So, first change Vis0 to 0 and Warp0 to -1. Next change Vis1 to 2 and Warp1 to 4.

We have now an extra treasure level ;)


Part II: Change a preset level into a random level.

If we want to do the opposite and turn a preset level into a random cave level this is possible also.

Once again we need to open up LvlPrest.txt.

Go down to row 106 (Act 1 - Cave Treasure 2). Here we see the LevelID 13. This is treasure level #2's id, remove this id and set it to have value of 0 (0 means it will not use as a preset level).

Change SizeX to 24 and SizeY to 24. This is the same size as we can see in LvlMaze.txt.

Next we need to do is to open up Levels.txt.

Go down to row #15 and change SizeX to 200 and SizeY to 200.

Change DlrgType to 1 (we want to use random level generation).

Change Vis1 to 0 and Warp1 to -1.

Change Vis0 to 9 and Vis4 to 14 and Warp 0 to 4 and Warp4 to 5. We have now treasure level #2 connected to Cave Level1 (cold Plain) and Act 1 - Cave 3 Treasure. We add the cave3 treasure level so we have correct number of entrances linked.

Now, at last change the Row #16 vis1 to 13.

I will write a tutorial on the past later when i have researched more into this ;)

I belive also we can change any overground areas into a preset area like Graveyard and also in the opposite change a preset area into a wilderness random area (the only that prevents a preset area to turn into a random area is hardcoded stuff. As an example the rouge encamplemnt cant be turned into like this, i have already tried ;) ).

EDIT:

I have succeed with turning Buried Ground to a normal wilderness area, you can see a screenshot here
Last edited by kingpin on Mon Jun 02, 2003 12:42 am, edited 1 time in total.

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada

Hand-picked

Re: Its now possible to make own preset areas

Post by Alkalund » Mon Jun 02, 2003 1:17 am

This is good stuff kingpin, awesome discovery! So, we have more control over the game areas than previously thought :D

A tutorial on this is certainly appreciated, even though your post was already very thorough on the method :)

User avatar
DragonBane
Junior Member
Champion of the Light
Posts: 410
Joined: Fri May 31, 2002 6:16 am
Location: Minnesota

Re: Its now possible to make own preset areas

Post by DragonBane » Mon Jun 02, 2003 1:23 am

Instead of asking what this actually does (I'm a bit confused), I should probably just try it and see what happens, huh?
"Cold be heart and hand and stone, cold be traveller's far from home."

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada

Hand-picked

Re: Its now possible to make own preset areas

Post by Alkalund » Mon Jun 02, 2003 1:29 am

Read it carefully, it isn't so hard to understand:
Part I: Change random cave into a preset cave.
Part II: Change a preset level into a random level.
Even more with kingpin's example screenshot at the end ;)

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Re: Its now possible to make own preset areas

Post by kingpin » Mon Jun 02, 2003 1:49 am

Well, i just realised that buired ground is not a preset area ;)

What i did was to change what it loaded, it loads the same graphics as a normal wilderness level does. It's strange that i havn't seen that before, when you resize the area "graveyard (gravey.ds1)" seems to be randomly placed in Buried Ground.

User avatar
DragonBane
Junior Member
Champion of the Light
Posts: 410
Joined: Fri May 31, 2002 6:16 am
Location: Minnesota

Re: Its now possible to make own preset areas

Post by DragonBane » Mon Jun 02, 2003 2:12 am

The Den of Evil from the first part's map is still messed up, though. ;)
"Cold be heart and hand and stone, cold be traveller's far from home."

User avatar
TheWizard
Junior Member
Paladin
Posts: 160
Joined: Mon Oct 21, 2002 1:13 pm
Location: Kansas

Re: Its now possible to make own preset areas

Post by TheWizard » Mon Jun 02, 2003 10:47 am

I have been doing this for close to a year now. Once you understand the columns in LvlPrest.txt, LvlTypes.txt, and Levels.txt it is not too difficult to do. My current mod has 11 levels of an underground dungeon off the cold plains called The Festering Pit. This is one mean nasty place, but if you can survive the loot is super :twisted:
One neat twist is the areas mostly are ice caves graphics with the normal cave colors, resulting in a sort of grayish area. Also, on the very last level there is a warp to The Secret Cow level, complete with a warp back to The Festering Pit from the cow level.
The Black Marsh's Fortress warp takes you to a completely new preset level that I am working on with Paul's editor. It is about 20% finished, but I am not that good with patience when it comes to level editing. However, the main point is, you can do it. :)

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Re: Its now possible to make own preset areas

Post by kingpin » Tue Jun 03, 2003 1:48 am

Well,

It's now also possible to add more rows into LvlPrest.txt.

I have with Hammerman help removed this limit, thanx Hammerman ;)

in D2Common.dll for 1.09d we need to increase the table size.

It has an assertion error at

:6FD58BBD 817C241042040000 cmp dword ptr [esp+10], 00000442

442 is the assertion check for Def as we can se here we have 1089 as max def (1089 = 442). We can nop this one out safely if we want. I prefer to have the check left instead an change it's max.

We can change this to:

:6FD58BBD 817C241042040000 cmp dword ptr [esp+10], 000004A5

Now we can add 100 more lines, that should be enough. othervise increase it ;)

Next it does loop to retrieve a txt ptr. This was found by Hammerman.

We will found it here

:6FD58DD7 3D42040000 cmp eax, 00000442

We will change this to have 100 more lines.

:6FD58DD7 3D42040000 cmp eax, 000004A5


Now, we can have a lot of preset areas ;)

You can now add Def value from 1090 to 1189.

EDIT:

You need to add lines that use Def 1090 to 1189 othervise this would not work. Since it has another (at the moment unknown) check. That checks if this Def number exist. But, this is no problem for us if we add a def for each line.

So, it would be easier to increase the limit of this file at the time we add new rows.
Last edited by kingpin on Tue Jun 03, 2003 2:12 am, edited 1 time in total.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Its now possible to make own preset areas

Post by Myhrginoc » Tue Jun 03, 2003 2:27 am

Excellent work! We'll need additional presets to fill out the 100+ new levels Sir_General's work offers.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
TheWizard
Junior Member
Paladin
Posts: 160
Joined: Mon Oct 21, 2002 1:13 pm
Location: Kansas

Re: Its now possible to make own preset areas

Post by TheWizard » Tue Jun 03, 2003 3:44 am

Superb work you two!! Copied your post on how to do this to a txt document on my desktop. After I grab a much needed nap, I am going to play with this awesome discovery.

*hat's off* to you guys :)

User avatar
DragonBane
Junior Member
Champion of the Light
Posts: 410
Joined: Fri May 31, 2002 6:16 am
Location: Minnesota

Re: Its now possible to make own preset areas

Post by DragonBane » Tue Jun 03, 2003 5:04 am

I have to agree, awesome discovery. Maybe we can find out how to nullify that check so we don't have to worry about it, eh?
"Cold be heart and hand and stone, cold be traveller's far from home."

User avatar
goro3d
Forum Regular
Angel
Posts: 537
Joined: Wed May 29, 2002 12:35 pm
Location: Loudon NH 6 miles from nascar speedway

Re: Its now possible to make own preset areas

Post by goro3d » Tue Jun 03, 2003 5:51 am

I don't know what to say but awesome. This will be useful to many other people although i may not do it its still a great tut/idea well done kingpin well done my friend.
No more support for my mod is around sorry my friends.

User avatar
Black Heart
Retired staff
Angel
Posts: 748
Joined: Tue Sep 10, 2002 11:58 pm

Re: Its now possible to make own preset areas

Post by Black Heart » Tue Jun 03, 2003 8:22 am

:?: Would it be possible to combine the changes made by kingpin and by Sir_General's into a downloadable version of the modified dlls for us who’s hex editing skills are still not up to par with this level of modding. :oops:
Sometimes we win with greater firepower, through sheer numbers or more powerful weapons, but for the most part it is knowledge that defines our victories. Know something and it has lost its power over you.

The Shadow Has risen!!!! Warped Tiles

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Re: Its now possible to make own preset areas

Post by kingpin » Tue Jun 03, 2003 8:29 am

Yes, it would be possible to do ;)

I can make a pluggin that includes the both version with increased levels/lvlprest. For both 1.09b and d.

User avatar
Black Heart
Retired staff
Angel
Posts: 748
Joined: Tue Sep 10, 2002 11:58 pm

Re: Its now possible to make own preset areas

Post by Black Heart » Tue Jun 03, 2003 8:41 am

That would be great! :)

How will the changes made in 1.10 effect this work?
Will it have to be redone?
Sometimes we win with greater firepower, through sheer numbers or more powerful weapons, but for the most part it is knowledge that defines our victories. Know something and it has lost its power over you.

The Shadow Has risen!!!! Warped Tiles

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Re: Its now possible to make own preset areas

Post by kingpin » Tue Jun 03, 2003 8:49 am

How will the changes made in 1.10 effect this work?
Will it have to be redone?
Probably is needed to be modified for 1.10. But, that one will be easy to do.


Here are this needed info for 1.09b modders.

I have marked the changes like i did for 1.09d (this has been the same increased 100 lines as in 1.09d).

1.09b:
:6FD58BAD 817C241042040000 cmp dword ptr [esp+10], 000004A5

:6FD58DC7 3D42040000 cmp eax, 000004A5

User avatar
TheWizard
Junior Member
Paladin
Posts: 160
Joined: Mon Oct 21, 2002 1:13 pm
Location: Kansas

Re: Its now possible to make own preset areas

Post by TheWizard » Wed Jun 04, 2003 8:03 am

Okay, got that done and can add rows, but how do you tell the game to actually use them? Guess I shouldn't have taken such a long vacation from modding ;)

User avatar
mouse
Retired staff
Angel
Posts: 520
Joined: Mon Aug 12, 2002 8:51 pm
Location: near Portland, OR, USA

Re: Its now possible to make own preset areas

Post by mouse » Mon Mar 15, 2004 6:47 am

:n: -> :morning: *revive*

Any update on where this stands in 1.10?

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Its now possible to make own preset areas

Post by Myhrginoc » Mon Mar 15, 2004 8:22 am

You mean you haven't used the Extended Levels Plugin? Get thee to the download page immediately!

The technique described above should work for 1.10 as well. Neither LvlPrest.txt nor the applicable part of Levels.txt changed much between versions. There is always one way to find out, of course...

There has been a lot of water under the bridge since this thread had last been updated.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
mouse
Retired staff
Angel
Posts: 520
Joined: Mon Aug 12, 2002 8:51 pm
Location: near Portland, OR, USA

Re: Its now possible to make own preset areas

Post by mouse » Mon Mar 15, 2004 9:04 am

[quote=Myhrginoc";p="160908"]You mean you haven't used the Extended Levels Plugin? Get thee to the download page immediately!

The technique described above should work for 1.10 as well. Neither LvlPrest.txt nor the applicable part of Levels.txt changed much between versions. There is always one way to find out, of course...

There has been a lot of water under the bridge since this thread had last been updated.[/quote]

lol. thanks!
well, you know - me and water - i often fall in.

Return to “General Mod Making”