Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How are separate files read?  (Read 516 times)

RenoFox

  • Bay Watcher
    • View Profile
How are separate files read?
« on: July 12, 2011, 02:13:19 pm »

One of the problems I've encountered is that I have no idea how spreading raws into different files works. While many custom races are in their own text files, when I move even the original dwarves creature definition in another file, the race disappears from the game. Is there something else than just [OBJECT:CREATURE] needed before the [CREATURE:DWARF] and other tags?

Andyfuji

  • Bay Watcher
  • Chocolate Trotskies
    • View Profile
Re: How are separate files read?
« Reply #1 on: July 12, 2011, 02:18:51 pm »

The [OBJECT:CREATURE] tag serves as a header, allowing the use of creature-specific tokens in the raw file.  Without [OBJECT:CREATURE] the game wouldn't recognize [CREATURE:DWARF], nor anything else in that file, as a valid tag.
Logged

_DivideByZero_

  • Bay Watcher
  • Not to be confused with infinity
    • View Profile
Re: How are separate files read?
« Reply #2 on: July 12, 2011, 02:28:48 pm »

You basically need creature_* as the filename and [OBJECT:CREATURE] after the file's name inside the file for it to read creatures. You can't mix creatures, entities, weapons, armors, socks, etc.
Logged
Have I now become your enemy by telling you the truth? (Gal 4:16)

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: How are separate files read?
« Reply #3 on: July 12, 2011, 02:29:25 pm »

Every raw file must start with a single line that gives the name of the file.  If you have created a file 'creature_custom.txt', then the first line of the file must be 'creature_custom'.

This is then followed by a blank line, and then the line '[OBJECT:CREATURE]' which lets DF know what kind of objects are in the file.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Kaos

  • Bay Watcher
    • View Profile
Re: How are separate files read?
« Reply #4 on: July 12, 2011, 02:48:37 pm »

can the custom files be placed inside folders? I've seen some mods that have a "tribe civs" folders or something similar, can you make something like:
myModFolder/creature_custom.txt
myModFolder/entity_custom.txt


etc...
Logged

dree12

  • Bay Watcher
    • View Profile
Re: How are separate files read?
« Reply #5 on: July 12, 2011, 07:03:59 pm »

No. For organization, use creature_ef_benign, where ef becomes your mod and benign because your name. This sorts well.
Logged

_DivideByZero_

  • Bay Watcher
  • Not to be confused with infinity
    • View Profile
Re: How are separate files read?
« Reply #6 on: July 12, 2011, 08:47:00 pm »

If you have ubuntu or some other linux distro, you can manually arrange files so you can group all the files together however you want.
Logged
Have I now become your enemy by telling you the truth? (Gal 4:16)

Caldfir

  • Bay Watcher
    • View Profile
Re: How are separate files read?
« Reply #7 on: July 12, 2011, 11:12:45 pm »

By the by - something ESSENTIAL for creatures that use the [COPY_TAGS_FROM:<creature>], [CREATURE:<creature>] must appear in the same file earlier than the copying creature, OR in another raw file that (alphabetically) comes before the file containing the copying creature. 
Logged
where is up?