Editing Creating a simple decoration

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
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 [[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 [[EDF includes|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
     doomednum = 30000                        // This is the thing number used to place the object in a map.
                                            // object in a map.
   
   
     radius = 32                              // The radius and height set the physical size
     radius = 32                              // The radius and height set the physical size of the object,
     height = 56                              // of the object, for collision detection.
     height = 56                              // for collision detection.
   
   
     basictype = SolidDecor                  // The SolidDecor basictype sets the "Solid"
     basictype = SolidDecor                  // The SolidDecor basictype sets the "Solid" flag for the thing.
                                            // flag for the thing.
                                             // You could alternatively set this flag directly, by replacing
                                             // You could alternatively set this flag directly,
                                             // this line with "cflags = SOLID".
                                             // by replacing this line with "cflags = SOLID".
   
   
     spawnstate = CACOLAMP_A                  // This sets the lamp's spawn state to the frame
     spawnstate = CACOLAMP_A                  // This sets the lamp's spawn state to the frame "CACOLAMP_A",
                                             // "CACOLAMP_A", which is a name I arbitrarily
                                             // which is a name I arbitrarily picked and could have been
                                            // picked and could have been anything else
                                             // anything else (as long as no spaces are used in its name).
                                             // (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 CACOLAMP_A  { cmp = "HEAD|D|T|-1" }  // This defines the frame itself, as a Compressed Frame Definition:
                                            // Frame Definition:
   
   
                                             // HEAD is the sprite name, and D is the sprite
                                             // HEAD is the sprite name, and D is the sprite frame.
                                            // frame.
   
   
                                             // T specifies that this frame will be drawn
                                             // T specifies that this frame will be drawn fullbright.
                                            // with full brightness (fullbright).
                                             // (Substituting T for * will leave the fullbright field at its
                                             // (Replacing T with either F or * will leave the
                                             // default of "off".)
                                             // fullbright field at its default of "off".)
   
   
                                             // -1 is the duration of this frame in tics,
                                             // -1 is the duration of this frame in tics, "-1" meaning forever.
                                            // with "-1" meaning forever.
 
Now, you can either create a map and place thingtype 30000 in it, or just open your wad in Eternity and enter "summon CacoLamp" into the console. You should now see your very own domesticated Cacodemon floor lamp!
 
 
 
Let's say, though, that we feel this Cacodemon lamp is just not interesting enough yet and want to make it animate. Leaving the thingtype definition alone, we can modify its frames to put it into a looping animation sequence. I've added a commented header line at the top, for clarity. The spacing is just for the sake of matching up the commented header with the fields, and is not actually necessary to the code.
 
                        // Sprite | Frame | Bright | Duration | Action | Next Frame
frame CACOLAMP_A  { cmp = "HEAD |    A |      * |        6 |      * |      @next" }
frame CACOLAMP_B  { cmp = "HEAD |    B |      * |        6 |      * |      @next" }
frame CACOLAMP_C  { cmp = "HEAD |    C |      T |        6 |      * |      @next" }
frame CACOLAMP_D  { cmp = "HEAD |    D |      T |      12 |      * |      @next" }
frame CACOLAMP_E  { cmp = "HEAD |    C |      T |        6 |      * |      @next" }
frame CACOLAMP_F  { cmp = "HEAD |    B |      * |        6 |      * | CACOLAMP_A" }
 
This frame sequence will cause our CacoLamp to cycle through its sprite frames A through D and back again, looping back to the original frame, CACOLAMP_A, when it's done.
 
[[Category:Tutorials]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)