PDA

View Full Version : FAQ : How to mod Din's Curse!


heron
08-24-2010, 05:49 PM
Modding 101

1. Where are my installed directory?

A. C:\Program files\Din's Curse\

2. Where are my character saved files?

A. C:\Users\your-name\AppData\Local\DinsCurse\User\chars\

3. How do I change my in game settings?

A. C:\Users\your-name\AppData\Local\DinsCurse\User\user.cfg

4. Where do I install the mods?

A. C:\Program files\Din's Curse\Assets\

5. How do I clear my modded textures?

A. C:\ProgramData\DinsCurse\Assets\Textures

6. How do I convert ctx into tga files?

A. Run the game then hit the tilde key (~) type: buildTgas
Give it a few minutes, then the new converted textures will be dump inside the Assets folder

*This thread will update regularly*

Roswitha
08-25-2010, 03:41 PM
Can I request a Modding 001? As in, how do I make a mod in the first place?

Shadow
08-26-2010, 05:31 PM
Can I request a Modding 001? As in, how do I make a mod in the first place?

The mod SDK on our mod page (http://www.soldak.com/Dins-Curse/Mods.html) has a lot of information on how to make mods in general.

jeremyosborne
12-18-2010, 01:04 PM
Hey Heron,

I'm keeping notes as I'm modding things. Would you mind if I either add to your thread or roll your notes into another thread (only if you aren't around much anymore)?

heron
12-21-2010, 02:50 AM
Sorry for my absence, I do lurk here once a week.
Feel free to add notes to this thread.
It's here for all modders.

jeremyosborne
12-21-2010, 04:56 PM
Sorry for my absence, I do lurk here once a week.
Feel free to add notes to this thread.
It's here for all modders.

Mr. Heron,

No need to apologize. It was my looking through your UI work that made me realize I could dig into Din's Curse and start modding it. I don't have the art skills that you have, but that's okay because I like to take a more minimalist approach to things.

I'll take over a few sections in this thread, give them topics, and add things as I find them. Feel free to leave them where they are, or consolidate in your initial post.

Update: I'm keeping all of my mod notes in a file in the README.txt file at:

https://github.com/jeremyosborne/dinscurse-mods

It's sort of nerdy version controlling a readme/FAQ file, but hey, I'm a nerd.

jeremyosborne
12-21-2010, 05:03 PM
Q: How do I access the in game console?
A: Press the '~' key on your keyboard.

Q: What are the list of in game console commands?
A: (Command listed on one line followed by a description on the next.)

developer 1
Enables extra developer commands.
developer 0
Disables extra developer commands.
reloadMenus
Reloads all .mnu files. Allows one to alt-tab out of the game,
change a .mnu file, alt-tab back into the game, and see the
changes by running the command.
buildTgas
Converts all available ctx files -- compressed textures -- to
tga files. Files will be located inside of your Assets folder.
This process can take a few minutes; just because your game
might look like it is locked up, doesn't mean it is.


Q: Can't get the '~' console key to display the in game console?
A: From the Elder Scrolls Morrowing Forums, originally gained from link:
http://www.gamebanshee.com/forums/the-elder-scrolls-iii-morrowind-29/tilde-key-problem-73734.html
From the post:
I assume most have windows media center since it comes with vista.
That is what is causing the problem. The Infrared Reciever to be exact.
What I had to do:
1: Open up the Device Manager
2: Go to the Universal Serial Bus Controllers tab
3: Maximize the tab to bring up Devices
4: Open the eHome Infrared Reciever (USBCIR).
(NOTE: This might be located in another device tab, like the
Human Interface Devices tab.)
5: Restart your computer if you need to, but you might not need to.

Q: I want to get rid of textures that I have modified or that I just
don't want anymore, but I can't seem to find them?
A: This may happen if you load a mod that has textures in it and then
you unload the mod, but you notice that the textures are still in
use in your games. The location of textures used in the game can
be found at:
C:\ProgramData\DinsCurse\Assets\Textures
In dire cases, just delete the entire Textures directory.

jeremyosborne
12-21-2010, 05:06 PM
Q: Is the mini-map constrained to the upper right area of the screen?
A: Yes, as of version 1.010 the minimap view can be moved around and
resized slightly, but it is constrained to a portion of the upper
right in game screen.

Q: Is there any theoretical limit to the number of files I can store
my UI widgets in?
A: From Shadow's post in the forums (see:
http://www.soldak.com/forums/showthread.php?p=19140#post19140):
There shouldn't be any max files limit.

Q: How can I add a new menu object to the game?
A: Widgets and other UI items should appear in game by simply creating
their entries in a new .mnu file. However, certain menu objects
need to be made specifically available to the game system, like
the objects in the PartyMemberN.mnu files that show the status of
your lackeys along the left hand side of the screen.

If you are making a menu, or overriding a menu, and it just doesn't
seem to appear in the game, try adding it as a GameMenu parameter
to the UISystem database object.

To accomplish this put together something like the following in your
own .gdb file inside of the Database folder of your module. This is
an example from a mod I put together:

// addsTo works better in the case of GameMenu instead of overrides.
// In this case we wish to merely add additional menus to the game,
// not rewrite the entire list of menus, which we would have to
// do if we used overrides.
PartyMemberMenuChanges addsTo UISystem
{
// GameMenu is only for menus that need to be automatically displayed
// by the game engine. PartyMembers is never displayed, as such
// it does not need to be added as a GameMenu.
//GameMenu PartyMembers
// Add additional party status displays to the default displays
// Addition: Partymember0
GameMenu PartyMember0
// PartyMember1-PartyMember10 already exists
// Addition: PartyMember11-15 UI menu
GameMenu PartyMember11
GameMenu PartyMember12
GameMenu PartyMember13
GameMenu PartyMember14
GameMenu PartyMember15
// This increases the total number of lackey menus to 16.
}

jeremyosborne
12-21-2010, 05:09 PM
Q: I'm putting my items in sub-folders below Assets/Database in
my mod, but the items are not loading. What's wrong?
A: In my experiments, it seems that Din's Curse will only search for mod
files one level down. For example, even though the assets003 folder
contains Database/Items/, if I want to add or mod an item, I need to
put the gdb file that I create into just the Database/ folder in
my mod, and not place it in an Items/ sub-folder.


Q: How does the SpawnChance parameter for items work?
A: From Shadow's post in the forums (see:
http://www.soldak.com/forums/showthread.php?p=19148#post19148):
SpawnChance is usually pretty relative. If you have only 2 items
that can spawn and they both have SpawnChance of 1.0 then they
essentially have a real spawn chance of 50% in that situation.

If you had 10 of them then the real chance would be 10%.

However if you had 1 item at SpawnChance 5.0 and 5 other items
at SpawnChance 1.0 then the first would have a 50% real chance
and the others would have 10% each.


Q: How can I increase the chances of a particular item spawning
in game for testing -- or other -- purposes?
A: From Shadow's post in the forums (see:
http://www.soldak.com/forums/showthread.php?p=19148#post19137):
Temporarily add something like
SpawnChance 55555.0
to your item database entry so that it has a really good chance
to spawn the item in question whenever the game tries to
spawn a random item.

Q: How do I load an item that I've created for testing purposes?
A: I can't find any "loadItem XYZ" console command, but here's a
decent workaround in lieu of such console command:
0) Before doing a lot of database modding, I suggest backing up your
characters. As long as you aren't modifying core files, you are
probably safe, but better safe than sorry.
I also recommend that when you are testing items with this
method to not load up any other characters while itemTesterChar.gdb
(see below) is located inside of your Assets/Database folder.
1) Make an Assets/Database/itemTesterChar.gdb file. Despite the extension,
this is just a blank text file. The name of the file is arbitrary,
you could name it "dog.gdb", but it needs to be located in the
Assets/Database/ directory.
2) Inside of the file, place the following:
//
// Used for testing items.
//
// DO NOT INCLUDE IN MOD PACKAGES!
//
// Place this file in your Din's Curse/Assets/Database folder and
// and modify for testing your items.
//

// We are overriding the "Warrior" type character.
// Make sure that the character we create is a "Warrior".
itemTesterChar overrides ClassWarrior
{
// We need something to hold our items
// The starting backpack only holds 16 items.
// This givus us 4 x 16 = 64 total items we can test.
StartingItem Backpack
StartingItem Backpack
StartingItem Backpack
StartingItem Backpack

// For each item we want to see in game,
// add one StartingItem line.
// The name of the starting item must be the identifier
// name you have given to your item.
// The following are examples:
StartingItem ArchitemColdheartChamption
StartingItem ArchitemColdheartElite
StartingItem ArchitemColdheartLegend

// Give ourselves lots of money so we can walk over and
// identify any item, as non-common items start out unidentified.
StartingMoney 100000
}

3) The class we assign "itemTesterChar" is important, in our case it
is the Warrior class. Log into Din's Curse and create a new
character that is, in our case, a Warrior.
4) Load up the starting city. As long as the items made are valid,
no matter the level required for the item, they should show up
as unidentified items in your character's inventory.
5) High level items can take a really long time to identify for
a level 0 character, hence the high starting money for our
itemTester. Walk over to a vendor in town and "Identify All".
6) Now here's the good part. If your items are acting weird, or
something doesn't seem right, quit Din's Curse and modify the
items in the gdb file directly. Save your changes and restart
Din's Curse -- note: it's important to quit/reload each time you
wish to change any .gdb files.
7) Reload your test character, and your item changes should be
visible without needing to create a new character. Since Din's
Curse is data driven, what you set in your item database files
affects all items in existence, immediately, when you load up the
game.
8) With this method, the only time you will need to create new
characters to look at your items is when you wish to create
a whole new item: at that time, go back to your itemTester
and add, or reuse, a StartingItem parameter.
9) When you are done testing items, delete or remove
itemTesterChar.gdb from your Assets/Database directory.

Q: How do I make sure my items have minimum level requirement?
A: Make sure your item has an ItemLevel property. For example:
// A level 47 item
ItemLevel 47
If that alone does not work, add the following boolean property:
LevelRequirement 1
A value of 1 will force users of your item to be at or above the
ItemLevel to use.
A value of 0 will allow users of any level to use your item as long
as they meet the non-level based pre-reqs.

Q: I'm having trouble making the Health Regen modifier on my items
apply correct numbers.
A: If your health regen numbers do not look correct on your item, take
read this note from Shadow from a forum post
(see http://www.soldak.com/forums/showthread.php?t=3081&p=19309):
Internally the health regen stat needs better precision so the value
is assumed to be multiplied by 100. Basically it means that before
it is used or displayed it divides by 100, so your -2 value is just
really small. You want -200.

This was in response to why my following properties were not actually
lowering health regen, or at least not noticeably lowering it:

StatChangeHealthRegenBase -2.0
StatChangeHealthRegenPerLevel 0.0

Q: I've added a new proc special OnHitSkill or WhenHitSkill to the game
but when I put this MagicModifier on an item, the tooltip names the
skill something like, "SkillMaelstrom". I know the skill is in the
game, what's wrong?
A: Din's Curse will look for translations of OnHitSkill and WhenHitSkill
types automatically in the .trn files. For example, I added the
SkillMaelstrom to an item, and when i moused over the item I noticed
that the string on the item said the following:
10.0% chance to cast level 5 SkillMaelstrom when hit
It seems that skills can be named via an entry in the .trn file.
I added the following entry in my .trn file included with the mod:
SkillMaelstrom "Maelstrom"
When I reloaded the game, the item description now has the correctly
translated entry:
10.0% chance to cast level 5 Maelstrom when hit

jeremyosborne
12-22-2010, 03:03 AM
Q: What is the graphics format that Din's Curse uses for most icons,
UI, in game graphics, etc.
A: TARGA, or .tga files. Most graphics programs can output this format.


Q: Why are there no .tga files in the assets folders or the mods?
A: That's because the game uses a compressed format that has the
extension .ctx.


Q: How do I convert my .tga files to .ctx before packaging them in
my mod?
A: The easiest way to do a simple conversion is the following:
* Add a Textures/ folder inside of Din's Curse/Assets folder.
* Drop your .tga files into the folder without your mod.
* Start up Din's Curse. As long as the autoBuildTextures property
is set inside of your Din's Curse/User/defautlt.cfg files,
something like the following:

autoBuildTextures 1 Save

Then your .tga files will be converted to .ctx and you can now
quit the game.
* Now you just need to find the .ctx files. Depending on your
system, the .ctx files will be placed in one of these locations:
Windows XP:
(need to confirm the exact file)
C:\Users\YOUR USER NAME\AppData\Local\VirtualStore\Program Files\DinsCurse\Assets\Textures
Windows Vista:
C:\ProgramData\DinsCurse\Assets\Textures
* Copy the file out of this directory and place it in the
appropriate Textures/ directory in your module.
* You should also delete the Textures directory, unless you
know what you're doing leaving the .ctx files there.



Q: Din's Curse is not converting my .tga files to .ctx files when I go
through the above process. What gives?
A: I'm not sure, but I have noticed that when I use Gimp to create my
tga files, Din's Curse doesn't recognize them using the default
format. If you are using Gimp to edit your tga files, make sure
that when you perform a "save as" to create the .tga file and that
you uncheck the "RLE Compression" box and make sure the drop down
menu has "Bottom Left" selected. Doing this allowed me to get
Din's Curse to recognize the .tga files without any further file
modifications, and even got the alpha transparency working.

totalylost
10-06-2011, 03:26 AM
I played with the editors on the game and it was fun but I could not do any more then play with it I was not able to save what I had created and not only that you can't do anything with the items on the game what you see is what it is I do enjoy the game I just wanted to create a mod that I can play and be able to mess with all the items like weponds and armors and rings and amulets but I can't unless I am missing something, am I? if I am doing this wrong please tell me how please and please put in a way that a small child can understand ok. thanks hope to hear from someone soon.:confused:

Shadow
10-06-2011, 09:09 AM
The best place to start is reading all of the text files in the SDK which is on our mod page (http://www.soldak.com/Dins-Curse/Mods.html).

totalylost
10-06-2011, 10:29 PM
ok I have read everything that I could. I would like to ask u a favor could u please explain it to me in lay men term? I am really new to this modding and I would love to be able to understand it better I would be ever so greatful.

Shadow
10-11-2011, 10:44 AM
There is a lot of stuff you can do while modding the game. You would need to ask much more specific questions for me to be able to give you any useful answers.

PrimeIntellect
02-04-2012, 11:29 AM
Where do I find levels created with the level editor?
Also, how would I make the game be able to choose it?
Thanks in advance.


EDIT: I did some more digging, and wow this seems like needless complexity tbh. There's a "Levels" folder in TWO of the assets.zip in both the default AND the expansion. I can understand the expansion having a separate levels folder, but why the extra split?
Also, the worst part is, I didn't find any of the levels I had created in any of those folders.

I initially had edited the world.gdb in assets003 in the default game (this was the first world.gdb I found, having read the LevelDesign.txt that came with the modding SDK (which was honestly 0 help)). I then made a dummy character and made over 50 towns trying to get one with a level that I had made before noticing the horrendous system in which levels are stored. At that point I had no idea if I was even altering the correct world.gdb.

Is there a way to include a level without having to edit a world.gdb? If not, WHICH god damn world.gdb do I have to edit, since the "help" file did not specify whatsoever.
I apologize for my gruff manner of speaking, but the sheer amount of chaos and complete lack of intuitiveness regarding level creation (which seems like it should be a simple thing to do) is rather annoying.

My next attempt will be gutting the entire level system from Din's Curse and only having my level defined.
I'm honestly pretty disappointed; I had read through this part of the forums and saw a lot of comments regarding how easy it was to add/change stuff in Din's Curse and I had been really looking forward to it.


UPDATE: By selectively removing all other dungeons from both world.gdbs and only having mine defined, I was able to spawn an instance of my dungeon.
However, I would like clarification on the two original questions:

Where do I find levels created with the level editor?
Also, how would I make the game be able to choose without having to go into the main asset zips?

Bluddy
02-04-2012, 11:00 PM
I don't know the answers to all your questions since I've never tried to build a level, but assets01.zip shipped with version 1.0 of the game. assets03.zip represents all the changes from all the patches including the latest patch. Every file in assets03.zip overrides the same files in assets01.zip.

In general, you shouldn't change files in the original assets files. You can make another zip file with an alphanumeric name higher than assets003.zip -- for example, levelmod.zip. Then stick your modified /Database/world.gdb in the zip file. Because the name of your mod file will be alphanumerically higher, your world.gdb will be used instead of the original in assets03.zip.

If you use assets from the expansion in your modded level, I believe you need to place your mod in the expansion directory.

I'm not sure how to mix a created level into a random dungeon or if that's even possible. I think that once you create a level, you need to create the whole dungeon manually. There's no way to choose to play your specific dungeon though -- it'll be randomly chosen from all the random dungeons specified in world.gdb.

PrimeIntellect
02-05-2012, 03:32 AM
Thanks for the response as well as the clarification on the assets (though that seems like a confusing way to handle patches, I can certainly see why shadow did it that way).
Although this line from you bothers me:
If you use assets from the expansion in your modded level, I believe you need to place your mod in the expansion directory.
I think the worst part about the whole thing is that you don't ever know if your changes are doing anything for a long time due to the large number of already existing dungeons.
And it seems like I'm going to have to copy and paste the entire world.gdb file.
I tried messing around with overrides and addsTo but I kept running into it needing the BaseDungeon/BaseArea which then pretty much meant I needed the whole thing.
Then again I'm completely new to the database stuff, so I have no idea if it's even possible to manage to add my dungeon definition without needing the entire file, seeing as it references the base dungeon stuff.

As for mixing a created level into a random dungeon, that wasn't the intent of my question (nor do I know if it's possible), but it's certainly an interesting idea. I wonder if (if it's possible) you could make a town that had ANOTHER town some levels below in the dungeon.

Anyways, here's some screenshots from the level I made as an actual dungeon:
http://i42.tinypic.com/2ag5hxi.jpg
http://i44.tinypic.com/2ltpkdl.jpg
http://i39.tinypic.com/103ehk2.jpg

Bluddy
02-05-2012, 08:40 AM
Very nice dungeon!

If you only want to test your dungeon and don't want other dungeons to appear, the easiest way is to do the following: notice that BaseArea has the command SpawnChance 1.0. This is the chance that a certain town/dungeon will spawn. It doesn't mean 1 percent, it just adds up all the spawn chances and selects from them randomly. Anyway, notice also that BaseAreaDungeon inherits from BaseArea, and that all other dungeons inherit from BaseAreaDungeon. Well, if you put the command SpawnChance 0 in BaseAreaDungeon, all of the dungeons will inherit that value and will have no chance of spawning. Then you just have to put SpawnChance 1.0 (or whatever, it doesn't matter since yours will be the only one that has > 0). You'll be overriding the SpawnChance 0 that you added to BaseAreaDungeon. And presto! With only a couple of changes, you've made it so that only your dungeon can spawn.

I didn't go into detail with the modding interface which uses addsTo and overrides. If you want to do that, you can. It's a little bit trickier in some ways. You have to call your world.gdb file a different name, like worldNew.gdb. Then you only list your changes. Every change must have a new name for the section. To give the example that I detailed above in mod form:

World1SectionNew addsTo World1Section
{
Dungeon MyDungeon
}

BaseAreaDungeonNew overrides BaseAreaDungeon
{
SpawnChance 0
}

MyDungeon // my new dungeon level
{
Base BaseAreaDungeon

SpawnChance 1.0

... // all the rest
}

Notice that you have to use addsTo to add your dungeon to the dungeon list in World1Section. This is because 'Dungeon X' is a multi-line command. If you use overrides, you'll delete the existing dungeon list and have only your dungeon. AddsTo tells game to add to the existing Dungeon commands. Actually, that's another way to accomplish the thing I did with SpawnChance if you want. You could just use the modding interface and override the Dungeon command, so your dungeon is the only one in the list.

In terms of mixing a crafted dungeon level with random dungeons, I really think that's kind of ideal in this game. It'd be awesome to (once in a very very long time) find another town underground as you say, or to find an ancient elf town (like in Kivi). Unfortunately I don't see a way of doing that.

PrimeIntellect
02-05-2012, 09:23 AM
Thanks again for the help. I'm still working on trying what you suggested, but currently all I'm getting is a town with no dungeon spawning. I'll keep at it though now that I know a bit more about how things work (still no idea where my level was actually saved, though).

As for mixing dungeons, it just occurred to me that it might be possible using a ton of connection types (you'd have to have a different connection subtype for each type of floor that you make) but that would take a ton of work.

EDIT: I think I have it working now; I used an "addsTo" instead of an "overrides" somewhere.

Bluddy
02-05-2012, 09:31 AM
Thanks again for the help. I'm still working on trying what you suggested, but currently all I'm getting is a town with no dungeon spawning. I'll keep at it though now that I know a bit more about how things work (still no idea where my level was actually saved, though).

If you have no dungeon spawning and you used SpawnChance 0 for BaseAreaDungeon and overrode it with SpawnChance 1 in your dungeon, it's possible your dungeon isn't listed in the list of possible dungeons in World1Section. Good luck!

PrimeIntellect
02-05-2012, 09:33 AM
I suppose now the only thing left to do is to dig around in all the .zips for my dungeon, seeing as a basic search didn't return any results.

Bluddy
02-05-2012, 09:38 AM
From a quick test, it seems the game saves new levels outside the zip file, in Assets/Levels/name.ara. In general, it's hard to program proper zip file recompression into a game, so you can assume new things will be saved outside zip files.

PrimeIntellect
02-05-2012, 09:52 AM
From a quick test, it seems the game saves new levels outside the zip file, in Assets/Levels/name.ara. In general, it's hard to program proper zip file recompression into a game, so you can assume new things will be saved outside zip files.

uhhhhhhhh....
Din's Curse/Assets/Levels/name.ara?

No such folder exists anywhere in the installation directory.
Is it somewhere else?

EDIT: I've now checked ProgramData/DinsCurse/Assets/ and Program Files/Din's Curse/Assets/ and it's in neither.

Bluddy
02-05-2012, 10:07 AM
uhhhhhhhh....
Din's Curse/Assets/Levels/name.ara?

No such folder exists anywhere in the installation directory.
Is it somewhere else?

EDIT: I've now checked ProgramData/DinsCurse/Assets/ and Program Files/Din's Curse/Assets/ and it's in neither.

Very strange. To create your level, you went into the editor, then either used an existing area or created a new area, and then you saved it and gave it a name that ends with .ara, right?

PrimeIntellect
02-05-2012, 10:12 AM
Very strange. To create your level, you went into the editor, then either used an existing area or created a new area, and then you saved it and gave it a name that ends with .ara, right?

Yup. I've been in and out of the editor a bunch of times now and I always see it in the list of levels, and it properly saves/loads, but I can't find it anywhere.

Bluddy
02-05-2012, 10:41 AM
Yup. I've been in and out of the editor a bunch of times now and I always see it in the list of levels, and it properly saves/loads, but I can't find it anywhere.

Well the only other places I can think of looking are a. in the expansion's Assets/Levels and b. in your userdata folder, specifically in users/your_user_name/Local Settings/Application Data/DinsCurse and thereabouts... Since you've got Din's Curse installed in Program Files which Windows prohibits programs from writing in, it's possible that the game can't save there and has to go to your user directory.

Shadow
02-06-2012, 06:42 PM
It looks like Bluddy is awesome as usual and answered most of your questions.

In my setup the game would save your level to Assets\Levels or the expansion version but it probably can't because of Vista/Win7 protects so it is probably getting redirected to something like C:\Users\YOUR USER NAME\AppData\Local\VirtualStore\Program Files\Din's Curse\Assets\Levels

PrimeIntellect
02-06-2012, 07:13 PM
It looks like Bluddy is awesome as usual and answered most of your questions.

In my setup the game would save your level to Assets\Levels or the expansion version but it probably can't because of Vista/Win7 protects so it is probably getting redirected to something like C:\Users\YOUR USER NAME\AppData\Local\VirtualStore\Program Files\Din's Curse\Assets\Levels

You are amazing; it was there. I would never have found it otherwise.