Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Basic Modding Information  (Read 1646 times)

adamdesty

  • Bay Watcher
    • View Profile
Basic Modding Information
« on: April 08, 2011, 09:57:45 pm »

Okay guys so I'll make this brief. I am brand new in the modding world and need some basic information for modding. Right now I'm in the process of making a duck so info on creatures would be most helpful. I'd like to know where to put my created files and such to make my duck appear in game and also the mechanics of why/how it works if you possess that knowledge. I will post my code below so you can see my progress and point out any errors. If anyone is really motivated to help me I would like a "modding mentor" if you will because i have many questions, but right now i just wanna make a damn duck! so here's my code:

(I'm pretty sure this is called the body text)


body_duck

[OBJECT:BODY]

[BODY:DUCK]
[BP:UB:upper body][UPPERBODY]
[BP:LB:lower body][CONTYPE:UPPERBODY][LOWERBODY]
[BP:LL:left leg][CONTYPE:LOWERBODY][LIMB]
[STANCE]
[BP:RL:right leg][CONTYPE:LOWERBODY][LIMB]
[STANCE]
[BP:RW:right wing][CONTYPE:UPPERBODY][LIMB]
[FLIER]
[BP:LW:left wing][CONTYPE:UPPERBODY][LIMB]
[FLIER]

[BODY:HEAD]
[BP:HD:head][CONTYPE:UPPERBODY][HEAD]
[BP:BEAK:beak][CONTYPE:HEAD][MOUTH][SMALL][APERTURE]
---------------------------------------------------------------------------------------------------
and here is the creature file (idk if that's the proper name but you'll know what i mean when you see it):

creature_duck

[OBJECT_CREATURE]

[CREATURE:DUCK]
   [NAME:duck:ducks:duck]
   [TILE:'d'][COLOR:0:0:225]
   [LARGE_ROAMING][BIOME:ANY_WETLAND]
   [BIOME:SWAMP_TEMPERATE_FRESHWATER]
   [BIOME:MARSH_TEMPERATE_FRESHWATER]
   [BIOME:SWAMP_TROPICAL_FRESHWATER]
   [BIOME:MARSH_TROPICAL_FRESHWATER]
   [BIOME:RIVER_TEMPERATE_FRESHWATER]
   [BIOME:RIVER_TROPICAL_FRESHWATER]
   [BIOME:RIVER_TEMPERATE_BRACKISHWATER]
   [BIOME:RIVER_TROPICAL_BRACKISHWATER]
   [FREQUENCY:100]
   [CLUSTER_NUMBER:7:15]
   [CHILD:12][BABY:1]
   [MEANDERER][MUNDANE][FLIER][FANCIFUL]
   [POPULATION_NUMBER:20:35]
   [NATURAL][PET]
   [PREFSTRING:beak]
   [PREFSTRING:feathers]
   
[BODY:DUCK:HEAD:2EYES:2EARS:THROAT:NECK:BRAIN:HEART:2LUNGS:ORGANS:GUTS:SPINE]
   [SIZE:2]
   [MAXAGE:20:50]
   [ATTACK:MAIN:BYTYPE:HEAD:peck:pecks:1:1:BLUDGEON][ATTACKFLAG_WITH][ATTACKFLAG_CANLATCH]
   [FAT:1]
   [STANDARD_FLESH]
   [HOMEOTHERM:10067]
   [SWIMS_INATE][SWIMSPEED:3000]
   [SPEED:500]
---------------------------------------------------------------------------------------------------
So if you have any knowledge about this please please reply via this tread or a message to my email.
any help will be very appreciated.

                                                                              -Sincerely
                                                                                     -Adam

p.s. sorry if the code is misplaced its all aligned in my txt.
try to make the best of it would you?

   
   
   
   
« Last Edit: April 08, 2011, 10:20:22 pm by adamdesty »
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

dree12

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #1 on: April 08, 2011, 10:00:02 pm »

I don't think you are allowed to have two separate objects in one file, so you might need body_duck.txt as well as creature_duck.txt. Make sure to remove the game's default duck, or duplication errors will occur.
Logged

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #2 on: April 08, 2011, 10:14:07 pm »

yeah they are different files. i guess i shoulda said that. idk where to place them in the rar files tho. also i didn't know they had ducks! wow. but thank you. do you happen to know where to place the files? i made the duck in the temperate biomes and placed the creature_duck txt in there but they were nowhere to be found. any ideas as to placing the files?
« Last Edit: April 08, 2011, 10:17:11 pm by adamdesty »
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

Chaoseed

  • Bay Watcher
    • View Profile
    • Chaoseed Software
Re: Basic Modding Information
« Reply #3 on: April 08, 2011, 11:07:41 pm »

In your Dwarf Fortress folder, there should be a directory called "raw", and in that directory should be "objects". That's where you put the raw files. (Each save directory also has its own copy of raw files, which you can modify, but modifying a game in progress doesn't always work...)

("folder" and "directory" are really the same thing. You know that, right? I tend to use both words because I used DOS years ago and now I use Windows...anyway, whenever you read my instructions and see "directory", you can substitute "folder", or vice versa if you like. ;) )

You can have any number of files. However, make sure nothing is duplicated in the files. (Some editing programs make backups of the text files, and those MAY be counted...Toady said he was going to fix that, but be careful anyway!)

I'm not TOO experienced modding myself; I glanced over the files and nothing jumped out at me...except the "duck body"; is it possible there's already a "bird body" you could use? That might save time. Just look at how it's done in the files.

Do the FLIER tags have to be put on the limbs AND on the creature? I haven't worked with flying creatures before, so I really don't know.

ALSO - A VERY USEFUL TIP! In your Dwarf Fortress directory there should be a file called "errorlog.txt". It's a text file that holds any sort of errors that occur. (If there's no errorlog.txt, that means you've never had any errors...yet. ;) ) So, keep an eye on your errorlog.txt; if your raws have a problem, a message will show up here.  One thing I like to do is go into errorlog.txt and, at the end of the file, write "Note - This is the end of the file". Then, when NEW errors appear, they are put in AFTER my "This is the end of the file" message. (Modifying your errorlog.txt file doesn't harm anything...you can probably delete it if you like, it will just get remade when there are errors.)
« Last Edit: April 08, 2011, 11:12:55 pm by Chaoseed »
Logged
Surprisepalace! Overseers wanted!
But they never would have given up either. And compared to sitting around in this prison for the rest of my life? Losing is fun.

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #4 on: April 08, 2011, 11:11:52 pm »

okay sounds good but my real question is in what file? there are around 30 txt files in the objects directory. do i place my personal txt inside another txt file or do place the entire txt file by itself in the directory? like do i rewrite my own code and place it into another txt file already in the directory or do i make a new txt file inside the objects and name it "duck" or something like that? sorry if this isn't too clear its hard to explain :p 
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

Chaoseed

  • Bay Watcher
    • View Profile
    • Chaoseed Software
Re: Basic Modding Information
« Reply #5 on: April 08, 2011, 11:14:12 pm »

It depends! ;)

If you want to modify an existing creature, you modify the file that's there. (It's a very good idea to keep backup copies!)

If you want to create a new creature, all you have to do is create a new file and put it in the directory. That makes it easy to keep track of which creatures you've made.

Like I said in the first post, you can have as many raw files as you want! (As long as they're not duplicated—that's bad. ;) )

You COULD modify existing files and put new creatures in them. But that makes things harder to keep track of...
Logged
Surprisepalace! Overseers wanted!
But they never would have given up either. And compared to sitting around in this prison for the rest of my life? Losing is fun.

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #6 on: April 08, 2011, 11:16:40 pm »

Thank you soooo much!! i have the rars made but i placed them in temperate and what not! thank you very much. also im under the impression that you have to make a creature_body and a creature_template (two different txt files). so do i put these together in one txt file or create two seperate ones for each inside the directory? (Im making my own beastly creature)
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

Chaoseed

  • Bay Watcher
    • View Profile
    • Chaoseed Software
Re: Basic Modding Information
« Reply #7 on: April 09, 2011, 12:33:58 am »

You only need to create a new body file if you need new body parts. For example, if you wanted to create something that was exactly like a cow, you wouldn't need to do that because all the body parts are already defined in body_default: A quadruped body, head, tail, etc.. So, think about if you actually need more body part entries.

But maybe you do need more body entries. So here's how you do that.

Each file has a specific format. Here's part of the creature_standard.txt file:
Code: [Select]
creature_standard

[OBJECT:CREATURE]

[CREATURE:DWARF]
...and so on

1) First there's the filename. It has to be the same as the filename, minus the .txt part.
2) Next is the type of object--Whether it's creatures, bodies, civilizations, etc.. This is always [OBJECT:something].
3) After that you have the actual data.

So, if you have body parts, you start the file with [OBJECT:BODY]. If you have creatures, you have [OBJECT:CREATURE]. You can only have ONE type in each file. So, if you have both body parts and creatures, you must put them in separate files.

Of course, you CAN put multiple types of object in each file. You can put multiple creatures in one creature file; you can put multiple body parts in one body part file. Or you can put them in separate files! At this point it's up to you how you want to organize them.

A lot of this is talked about in the Modding Guide on the wiki.

Logged
Surprisepalace! Overseers wanted!
But they never would have given up either. And compared to sitting around in this prison for the rest of my life? Losing is fun.

!!crundle!!

  • Bay Watcher
  • EVERYONE, I AM ON FIRE
    • View Profile
Re: Basic Modding Information
« Reply #8 on: April 09, 2011, 12:59:25 am »

Seeing your RAWs, those appear to be 40d raws.

As you never said what version you were using, what version are you using?
Logged
w̷̦̬̹̣͕̙͖͑̓̌̓̑̄͒͋͜͝h̙̩͈̱͚̳̳̪͖̙͕̥̳ͥ̍̔͂̑̿̓̍̑ͣ͆̅̀͢y̧̼̭͎͓̟̺͉̰͎̱̜ͫ̂́͗̐̑́w̢̬̪͈̲̽̋́̈̓ͨ̄͐̿̓ͧ̇ͩ̏ͫ̑̎͟͡ḩ̡͍̫̣̹̬̙̭͊ͯͯ̉͡y̔ͥ̏͛̀̂̎̆ͥͮ̐̍̈̏͆̓̅̒҉̢̘͚͎̠̻̣̯̥̠̙̤̪̮̝̲̜̪́̕̕ͅw̸̗̻̱ͭͣͦͤ̇̑̅͗ͨͬ͋̉͊ͨ͂͜hͩͪ̋ͣ̇̔͂ͧ̍̾͂͏̨̠͕̼̟͙̳̺͕̥͔̜̮̩̰̲̞̼y̴̸̵̪͕̜̪̙̦̘ͧ̽̇ͭͭͬͯ̾̈́̐̂̉͆͒ͤ̌̀̕w̺̟͙͙̭͇̟̮͉̯͈͖̩͔͊͛ͧͯ̀̿ͣͪ͂ͪ͘̕͠ͅh̷̴̷̢͉͖̺̦̣͙̓ͧ̅͋ͪ̾̓͒̌̒ͯ̇́ͯ̕y̋ͪ̓̒̈́͞͏̤̗̞̲̪͚̮̤̫̪̺̪̫̕w̸͔̺̱̼̪̮̘̟͖̭̱͓͈̜͇͚͉̙͊̈́ͦ̅̋̂ͩ̓͗́̚͡ͅĥ̶̨̟̺͕̌͆͒͑ͦͨ̉͆͜͜ý̧͓̼̘̯͉̘̺̩͇̻͈͔̖͎̜͍ͭ̌ͩ͟͝͞

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #9 on: April 09, 2011, 09:25:53 am »

thank u very much chaoseed u r a lifesaver. ive been trying to find tht info all week! it is version 40d :) . sorry 4 not posting tht ill edit the main page. so another question. can u create a folder inside the object directory and place all ur c user created codes there?
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: Basic Modding Information
« Reply #10 on: April 09, 2011, 10:58:29 am »

Where did you get that duck from? 40d is quite old now. Also, there are ducks in the new version.

Not sure what a 'c user created code' is, but as Chaoseed said you can create new text files so long as they have the right format.

About those ducks in the new version... Modding is more difficult because multiple files are involved and some things need to be in order within the creature entry, but there's a lot more you can do with it. Spoilered for length.

Spoiler (click to show/hide)

And that's how ducks are made. I've omitted everything but the body itself.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #11 on: April 09, 2011, 02:26:05 pm »

yea sorry for the bad spelling i wrote that in psn. i meant lik if i write a code for a duck and whatnot. yes i have 40d. my computer is extremely slow and can only run that version for now. right now i just wanna mod 40d because ill be using it for awhile. okay so you put your codes in objects got it. thanks guys. your help has launched my modding career :p. but i have just a few new questions about weapon modding.

1)what does the [TWO_HANDED] tab mean? like i expected to to be either one or two for a one handed weapon or a two handed weapon but the number is a three on a whip and hell knows how many it is on a long sword so what exactly does it mean? apparently it doesn't mean hand count.
2)what is the [MINIMUM_SIZE]?
3)is there a cap for how much damage a weapon can do? also is there a size-to-weight-to-damage ration? im basically asking if the size/weight/damage/anything else interact with each other as a ratio. i.e. any weapon weighing over 50r must be a two handed weapon.
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide

3

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #12 on: April 09, 2011, 02:38:28 pm »

TWO_HANDED is the minimum size the creature has to be to use the weapon one-handed. If it's smaller than that size, it'll have to use two hands.

MINIMUM_SIZE specifies the size the creature has to be before it can use the weapon at all.

As to the other stuff, there's nothing that I know of. You can just specify whatever and it'll turn out as you put it.
Logged

Nidokoenig

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #13 on: April 09, 2011, 03:08:21 pm »

Blunt weapons have a weight-to-damage ration, so a hammer made from silver is awesome, but edged weapons use shear statistics, which means they're calculating how sharp and edge they can have and how much force it takes to deform them. There are no hard rules about two handedness outside of what you set on the weapon, but if a kobold picks up a two hundred ton unobtanium god-of-warhammer, he's overencumbered big time and ain't going nowhere fast, but he'll still wield it one handed if there's no weight limit.
Logged

adamdesty

  • Bay Watcher
    • View Profile
Re: Basic Modding Information
« Reply #14 on: April 09, 2011, 03:24:07 pm »

okay thanks guys that clears up weapon modding for my :D. but im still very confused about creature modding if you're making up your own body parts and a whole new creature. can someone write the syntax down and then explain the process step by step? i tried wiki and it just told me what he did, not really what it was doing. i need to know what you're writing/what it does/and how to format it.
Logged
If My Name Was Urist I'd Kill Myself-Urist McSuicide
Pages: [1] 2