Modding 101 - For Beginners

Discussion forum for Devil Whiskey 3rd Party MODS.

Moderator: Admin

User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Okay, I'm a little pissed about this now, as I just lost my second post, which described the main cfg file. So, I will post that again later, as I am not in the mood to do this again.
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Um, I thought I heard a terrible rumbling of thunder last night brightening the Northern sky!

Cut'n'paste is my friend..?

Quick Quest ion to get ya back in the good, moody loot :D

Can ya make a 1-way door/passage by making one cell with a Door to its West, then an ajacent cell with a Wall to its East?
And/or is it a matter of how you define the Collison-integer on each side...as in, '0' (can pass) on one side & a '1' (can't pass) on the other side?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

To answer your specific question about a 1 way door, I don't have the answer yet. I tried to make one, but it originally was not successful. I need to experiment more to get it to work properly, if it even is possible.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Well, lets try this again. I just need to remember to copy before I submit, just in case.

So, we have made our cells, walls, and a blank monsters file. That leaves only 2 files left. We will start with the main configuration file, which will use the information that we defined in our cells cfg. For the main file, you can name it whatever you want (ie jail.cfg) and do not have to worry about any special ending such as wall, cells, or mon.

The format for this file is:

Code: Select all

<map name> <map width> <map height> <default floor> <default ceiling> <title bar image>
<walls file> <cells file> <events file> <monsters file>
SPECLITS fr fg fb fd lr lg lb
audio/config <number of audio files>
<audio file name> <audio start time> &#40;repeat once for each audio file.  Must match number of files in the line above&#41;
SPECCELL <stair x> <stair y> <number of traps>
<trap x> <trap y> <trap type> <trap number> &#40;repeat once for each trap.  Must match the number of traps in the line above&#41;
RANDITEMS <number of random items>
<item name with underscores> <relative frequency> &#40;repeat once for each item.  Must match the number of items in the line above&#41;
<map x> <map y> <cell name> &#40;repeat for each cell in your map&#41;
Originally, I gave my own descriptions for each of these files, but I will just copy from the tutorial, since they did a good job with this part.


First Line:
Map name – the name to represent this map (unique from other maps)
map width – the width in cells of the map
map height – the height in cells of the map
default floor – path to a default floor texture – will be used in all cells unless a floor texture is specified for a cell in the walls.cfg file
default ceiling – the default ceiling texture for all cells
title bar image – this is an image that contains text or whatever you’d like to go above the Upper Left window (navigation window)

Second Line:
Walls file – the name of the walls.cfg file for this map (ie – maps/mywalls.cfg)
Cells file – the name of the cells.cfg file for this map (ie – maps/mycells.cfg)
events file – the name of the events.cfg file for this map (ie - maps/myevents.cfg)
monster file – the name of the monster.cfg file for this map (ie - maps/mymon.cfg)

SPECLITE line:
The keyword SPECLITE followed by the lighting values, 7 real numbers ranging from 0.0 to 1.0 (inclusive) - with values for the following fog/colors:
fr - fog color – red
fg – fog color – green
fb – fog color – blue
fd – fog density (0.0 is no fog)
lr - ambient light – red
lg – ambient light – green
lb – ambient light – blue

audio/config 1: This line states that the audio config files for this map are contained in the audio/config directory, and that there is only one audio config. It can be ‘0’ if no ambient audio is used, or more than 1 if you use multiple time-based audio config files (see ‘rennibister.cfg’ for an example).
audio file name/ start time – the name of the audio config file, and the time to start this config. If there is only one audio config, then the value will be ‘0’ (for ‘start at midnight’). If there is more than one, then this is the hour (24-hour day) that the particular config will become ‘active’. There will be exactly the same number of config-file lines as specified in the config count (on the line above).

SPECCELL line:
The Keyword SPECCELL
stairX – the x location (cell wise) of the ENTRY stairs
stairY – the y location (cell wise) of the ENTRY stairs
numOfTraps – the total number of traps in this map
special note – the stairX and stairY line are needed for the RELO spell

Trap Lines:
trapX – the x location of the trap
trapY – the y location of the trap
trapType – the type of trap, 1 for normal (script based), 2 for spinners, 4 for anti-magic, and 8 for darkness traps
trapNum – needed if trap is of type 1, calls the corresponding numbered trap script (trap000x) so setting this to 2 would call script: trap0002.py

RANDITEMS line:
The keyword RANDITEMS
numOfRandItems: an integer value, that specifies the total number of unique items you are about to list

Item lines:
The name of the item, as given in bl2d_items.txt, with spaces replaced by
underscores ‘_’ so a Dwarven War Axe is listed as Dwarven_War_Axe.
Spelling and capitalization matter
relativeFreq - The relative frequency of the item drop. A larger number relative to the numbers given for other items listed means this item drops
more often.

The actual map definition:
mapX – the x coordinate of the cell
mapY – the y coordinate of the cell
cellName – the name of the cell to place at this x/y location


Here are some hints and tips:
1. When you are first making the map, do not include any random item drops or traps. Test the way the map looks first, and add these features later.

2. Give some extra room around the edge of the map. I usually number the bottom left corner of my maps 10, 10. I also add an extra 10 spaces to the total number of cells. For example, if my map is 22 x 22, I would set my map width and height at 50 x 20. This would give me plenty of room around the edge of the map that I can use for wrap-around, or anything else I may need.

3. Wrap-around magic is done by using scripts, which we will get into later. While testing your maps, the wrap-around is not necessary, as long as you understand that anything you see outside of your normal map are will not be seen by the normal users.

4. Any blank cell does not need any definition. It will use the default that you set up in the cells.cfg file.

5. When first testing a map, set your lights to a high number, so you don't have to worry about casting light spells.

6. The trap scripts are defined as follows:
  • 1-falling rocks
    2-poison needles in floor
    3-poison darts
    4-non-poison darts
    5-poisinous gas
    6-noxious gas (from Growler?)
    7-spiked hammer
    8-spiked roller
    9-jets of flame
That is all for this file. This would leave us with only 1 more map file to define. Pretty soon, we will be able to test the maps we made, and see what we did wrong.
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

GRAAAHH! I lost a long post just now for not following the "copy before submit" rule myself. :x :!:

Quickly then, some advanced topic sidebars:
1. One-way doors and walls that appear behind the party are possible, but I did it using a teleporter defined in the file that Origen hasn't gotten to yet and another piece of map. If there's another way, please tell us.
2. Title bar image starts as 420*40 pixels but needs to be flipped vertically so it will come out correct in DW. I'd like to have the font and background used in the game so our mods will look consistent, but haven't heard anything yet.
3. Additional traps can be written in scripts named trap####.py, but I don't know if all the way up to 9999 is supported.
1 point 21 jigawatts!
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Tis a lot to digest...but you've laid it out nicely.

Couple o' ?'s:
Origen sez: "Give some extra room around the edge of the map. I usually number the bottom left corner of my maps 10, 10. I also add an extra 10 spaces to the total number of cells. For example, if my map is 22 x 22, I would set my map width and height at 50 x 20."

If your map is 22x22, then how do you get 50 x 20 for the map W x H?
(typo?)
50 W seems too big & 20 H seems too small??

Seems like it would be roughly set to 32 x 32 if your starting point is 10,10.
-----------
Also, don't quite know what/how ya "add extra 10 spaces to total # of cells"??
Like if you multiply (W x H) + 10 = (22x22) + 10 = 484 + 10 = 494 ?
But if so, then how/where do you put/add that?

..or is the extra '10' spaces added as 10 extra 'cell-code-lines' in this part:

Code: Select all

<map x> <map y> <cell name> &#40;repeat for each cell in your map&#41;
..so you have 10 extra lines like the above...basically blank for future fill-in?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

HGamer wrote:..Additional traps can be written in scripts named trap####.py, but I don't know if all the way up to 9999 is supported.
Now that would be a devilicious dungeon...one big & bad 'nuf to 'support' 9,999 Berserker traps! :o

One might hope to pick up a few clean loincloths after all that.. :roll:
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Okay, here are a few answers:

I set my maps at 50 x 50, not 50 x 20. This is 22 for the Map, and 10 to each the North, South, East, and West. So the exact size of the map will actually be 42x42 (22+10+10), but I like round numbers. This gives me a lot or extra room to work with, which I like.

In order to get the extra "buffer room", I don't start my map at 0, 0, but at 10, 10. That is how you get the extra spaces (by not defining anything less than a 10. So you don't have to actually "add" anything, just leave that extra room unprogrammed.

I tried defining back to back walls for a one way door, but that didn't work, as HGamer said. The only downfall about his method of creating them is that if messes up the automap, because you are being teleported to a place where you haven;t been before, instead of actually just taking 1 step.

I found a font called "Celtic Garamond the 2nd" online somwehre, and that is as close as I found. The T's and O's look exactly the same. I also did some phoneshop editing of the background file, so all you have to do is put the words on the file and then Mirror the words (but not the image). I will e-mail the pic to Growler so he can host it (we will fill all of those links, yet!!!)
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

here's the link to the file Origen sent:

Title Bar image template (.psd ~ photoshop file format)
http://www.notheresistor.com/324.html
(only 400+ links to go!)

Confused about whether to 'flip vertically' (as HGamer sez above) or 'mirror' (as Origen sez, as mirror typically means to flip horizontally)?
Maybe, 1+1, we're supposed to do both!?
Oy, feel like I'm 'bout to flip out. :o

Either way, I've got to go back to my 'practice sample' title bar image, cuz I mirrored (flipped horiz) the Whole image & not just the text as Origen specifies above..
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

ork pudding ork pudding ork pudding! That's twice it got me... :x

- Please post a .PNG version of the image, as I have no software that will open a .PSD.

- In Micro$oft Paint, it's Flip Vertical. Changes a "V" to a "^".

- I was using fonts called "FinalRoman" and "Kelmscott Regular" before. CG2 looks good except for "T". Still want to know what the DW devs used, though.

- Extra room on all sides is a good idea, as it's essentially free and also the DW display engine starts to do strange things if you can see off an outdoor map.

- Any trap script can be used multiple times on a map, as long as you're willing to put entries for it in the trap list in the map's .cfg file. I hope Growler was just joking.
1 point 21 jigawatts!
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Here's yer PiNG version...

Title Bar image template (.psd ~ photoshop file format)
&, new'n'improvered PinGie versionary mod/e:
http://www.notheresistor.com/324.html

So...right now I take it that Origen is a bit daft re: the meaning of mirror?
(vaguely recall an extended disgustion re: this very issue on old forum)

My first modest dungeon will have a spatial Berserker-trap* in every single square of its 101x99 floorplan.
And that's just the warm-up lev.. :twisted:

*basically, each square will hit you first with a random booby-trap (not the soft, life-giving kind--the Other sort), then you'll be attacked by 4 groups of 9,999 Berserkers, then before you can say, "Whoo-weejus!" -BLAM-A-LAMA! -yer crew will suffer a 2ndary BT (Booby-Trap) ...ready for the next square?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Well, as you may have figured out, mirror was not the right word. You should flip it vertically, as HGamer said. :oops:

As for the font, it seems to use the same cross type "T" as in the game. Maybe I am mistaken, though.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Are we ready for the next steps, yet? Or are we still working on the main cfg file?
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

Press on, man! They'll catch up eventually.

- Your font is actually better than the one used in DW. There's a "text test" in the Cheater's Stronghold that finally proved to be useful, and it's obvious that the DW font has no descenders; characters like "y" don't extend below the rest like you'd expect.
- Probably a MSIE glitch, but the PNG file doesn't display properly in the browser. If saved, it can be used though.
1 point 21 jigawatts!
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

The PNG image pops up fine in FireFox--but, yeah, IE (my 5.5v anyway) can't render it...you guys should def. be using FireFox...more secure & tabs are more useful/fun than barrels of beggans.

Speaking of game-text: at some point my DW stopped showing Caps for the char's names! :? It did for my original crew, but along the way decided that all lowercase worked for it. Even with a fresh install (for playing Origen's BT mod) from original v2.0 download files.

Origen, I'm afraid you've managed to separate the men from the boy-monkeys here! :roll: Getting my head 'round that main config file may require multiple life-cycles.. So please move ahead at your own pace & rest assured you're doing the Lord's work for the Devil's whiskey.. :P
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
Post Reply