Creating a simple decoration: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(New page: Creating a simple decoration in EDF is a relatively basic task. In this tutorial, we will define a simple floor lamp. For the sake of simplicity, we will (for now) assume that this la...)
 
No edit summary
Line 3: Line 3:
For the sake of simplicity, we will (for now) assume that this lamp is using one of the sprites that already exists within Doom.wad, to create a stylish Cacodemon lamp decoration. We can change that later.
For the sake of simplicity, we will (for now) assume that this lamp is using one of the sprites that already exists within Doom.wad, to create a stylish Cacodemon lamp decoration. We can change that later.


To start, create a text lump named EDFROOT in your lump editor of choice. Later on, you can learn to use [[EDF includes|includes]] to better organize your definitions, but for our purposes we can just put everything directly into EDFROOT.
To start, create a text lump named EDFROOT in your lump editor of choice. Later on, you can learn to use [[includes]] to better organize your definitions, but for our purposes we can just put everything directly into EDFROOT.


  thingtype CacoLamp
  thingtype CacoLamp
  {
  {
     doomednum = 30000                        // This is the thing number used to place the object in a map.
     doomednum = 30000                        // This is the thing number used to place the
                                            // object in a map.
   
   
     radius = 32                              // The radius and height set the physical size of the object,
     radius = 32                              // The radius and height set the physical size
     height = 56                              // for collision detection.
     height = 56                              // of the object, for collision detection.
   
   
     basictype = SolidDecor                  // The SolidDecor basictype sets the "Solid" flag for the thing.
     basictype = SolidDecor                  // The SolidDecor basictype sets the "Solid"
                                             // You could alternatively set this flag directly, by replacing
                                            // flag for the thing.
                                             // this line with "cflags = SOLID".
                                             // You could alternatively set this flag directly,
                                             // by replacing this line with "cflags = SOLID".
   
   
     spawnstate = CACOLAMP_A                  // This sets the lamp's spawn state to the frame "CACOLAMP_A",
     spawnstate = CACOLAMP_A                  // This sets the lamp's spawn state to the frame
                                            // which is a name I arbitrarily picked and could have been
                                            // "CACOLAMP_A", which is a name I arbitrarily
                                             // anything else (as long as no spaces are used in its name).
                                            // picked and could have been anything else
                                             // (as long as no spaces are used in its name).
  }
  }
   
   
  frame CACOLAMP_A  { cmp = "HEAD|D|T|-1" }  // This defines the frame itself, as a Compressed Frame Definition:
  frame CACOLAMP_A  { cmp = "HEAD|D|T|-1" }  // This defines the frame itself, as a Compressed
                                            // Frame Definition:
   
   
                                             // HEAD is the sprite name, and D is the sprite frame.
                                             // HEAD is the sprite name, and D is the sprite
                                            // frame.
   
   
                                             // T specifies that this frame will be drawn fullbright.
                                             // T specifies that this frame will be drawn
                                             // (Substituting T for * will leave the fullbright field at its
                                            // with full brightness (fullbright).
                                            // default of "off".)
                                             // (Replacing T with either F or * will leave the
                                            // fullbright field at its default of "off".)
   
   
                                             // -1 is the duration of this frame in tics, "-1" meaning forever.
                                             // -1 is the duration of this frame in tics,
                                            // with "-1" meaning forever.

Revision as of 01:10, 21 April 2009

Creating a simple decoration in EDF is a relatively basic task. In this tutorial, we will define a simple floor lamp.

For the sake of simplicity, we will (for now) assume that this lamp is using one of the sprites that already exists within Doom.wad, to create a stylish Cacodemon lamp decoration. We can change that later.

To start, create a text lump named EDFROOT in your lump editor of choice. Later on, you can learn to use includes to better organize your definitions, but for our purposes we can just put everything directly into EDFROOT.

thingtype CacoLamp
{
   doomednum = 30000                        // This is the thing number used to place the
                                            // object in a map.

   radius = 32                              // The radius and height set the physical size
   height = 56                              // of the object, for collision detection.

   basictype = SolidDecor                   // The SolidDecor basictype sets the "Solid"
                                            // flag for the thing.
                                            // You could alternatively set this flag directly,
                                            // by replacing this line with "cflags = SOLID".

   spawnstate = CACOLAMP_A                  // This sets the lamp's spawn state to the frame
                                            // "CACOLAMP_A", which is a name I arbitrarily
                                            // picked and could have been anything else
                                            // (as long as no spaces are used in its name).
}

frame CACOLAMP_A   { cmp = "HEAD|D|T|-1" }  // This defines the frame itself, as a Compressed
                                            // Frame Definition:

                                            // HEAD is the sprite name, and D is the sprite
                                            // frame.

                                            // T specifies that this frame will be drawn
                                            // with full brightness (fullbright).
                                            // (Replacing T with either F or * will leave the
                                            // fullbright field at its default of "off".)

                                            // -1 is the duration of this frame in tics,
                                            // with "-1" meaning forever.