Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Graphic Question  (Read 1056 times)

TDSS02

  • Bay Watcher
    • View Profile
Graphic Question
« on: February 24, 2012, 04:42:17 pm »

Hello everyone, had another question. This one i actually was thinking about while i was looking in the graphics folder.
1. How do you assign a specific sprite to a creature, for instance if i made a Orc race, how would i be able to add its own graphic? How does the game know that that particular sprite goes with that particular creature?

Thanks in advance
Logged
Quote from: piecewise on March 14, 2010, 06:22:02 am
  Dwarf Fortress: Beat children with children.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Graphic Question
« Reply #1 on: February 24, 2012, 04:49:18 pm »

Hello everyone, had another question. This one i actually was thinking about while i was looking in the graphics folder.
1. How do you assign a specific sprite to a creature, for instance if i made a Orc race, how would i be able to add its own graphic? How does the game know that that particular sprite goes with that particular creature?

Thanks in advance

You might want to try just downloading Phoebus or Ironhand, and just copying what they did, since you can pretty much just make your own graphics in the same order that they made theirs, and change a few lines to make your graphics work right alongside theirs.

Anyway, specifically, here's what you do:
Code: [Select]
repeat_the_filename_here_minus_the_.txt_at_the_end

[OBJECT:GRAPHICS]

[TILE_PAGE:ARBITRARY_NAME_HERE]
[FILE:Whatever your graphic file is named.png]
[TILE_DIM:16:16] * This is the number of pixels each tile occupies
[PAGE_DIM:12:22] * this is the number of tiles that are in the picture - x dimension and then y dimension

[CREATURE_GRAPHICS:THE_RAW_NAME_FOR_YOUR_RACE_HERE]
0 - Defaults & Criminals
[DEFAULT:ARBITRARY_NAME_HERE:0:0:ADD_COLOR:DEFAULT]
[STANDARD:ARBITRARY_NAME_HERE:1:0:AS_IS:DEFAULT]
[BABY:ARBITRARY_NAME_HERE:2:0:AS_IS:DEFAULT]
[CHILD:ARBITRARY_NAME_HERE:3:0:AS_IS:DEFAULT]
[DRUNK:ARBITRARY_NAME_HERE:4:0:AS_IS:DEFAULT]
[DEFAULT:ARBITRARY_NAME_HERE:5:0:AS_IS:GHOST] *for ghosts

etc. etc. etc. down the line
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

TDSS02

  • Bay Watcher
    • View Profile
Re: Graphic Question
« Reply #2 on: February 24, 2012, 04:56:39 pm »

Yea that's what i was trying to figure out, lets just use Phoebus pack as an example, my problem is i don't understand how the game knows which sprite to use with those big sprite sheets labeled "animals", "dwarves", "goblins" etc. How does it know that for instance the militia captains graphic is at the bottom of the sheet? Im guessing there is some kind of numbering system?

Think i figured it out, thanks NW_Kohaku, appreciate it.
« Last Edit: February 24, 2012, 05:00:50 pm by TDSS02 »
Logged
Quote from: piecewise on March 14, 2010, 06:22:02 am
  Dwarf Fortress: Beat children with children.

TDSS02

  • Bay Watcher
    • View Profile
Re: Graphic Question
« Reply #3 on: February 24, 2012, 06:19:04 pm »

Having some trouble,

[CHILD:ARBITRARY_NAME_HERE:3:0:AS_IS:DEFAULT] in this example what does the "0" represent, i know the 3 is the position of the sprite but whats the 0?


figured it out, 3 is horizontal and the 0 is vertical. awesome.
« Last Edit: February 24, 2012, 06:24:10 pm by TDSS02 »
Logged
Quote from: piecewise on March 14, 2010, 06:22:02 am
  Dwarf Fortress: Beat children with children.

Mike Mayday

  • Bay Watcher
  • gfx whr
    • View Profile
    • Goblinart
Re: Graphic Question
« Reply #4 on: February 24, 2012, 06:25:10 pm »

3:0 are both positions: x:y - horizontal and vertical

EDIT: well... ninja'd
Logged
<3

TDSS02

  • Bay Watcher
    • View Profile
Re: Graphic Question
« Reply #5 on: February 24, 2012, 06:35:01 pm »

HAHA, thanks Mike Mayday
Logged
Quote from: piecewise on March 14, 2010, 06:22:02 am
  Dwarf Fortress: Beat children with children.