Editing Creating a pickup

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:
Before starting out you should grab the resources for this tutorial from [[File:Pickup Assets.7z]], and make sure to either rename or delete all the EDF files currently present (as it's already completed).
Before starting out you should grab the resources for this tutorial from [[File:Pickup Assets.7z]], and make sure to either rename or delete all the EDF files currently present (as it's already completed).


Much like creating a simple decoration, we will start by creating a text lump named EDFROOT, but for this tutorial each pickup will have its own unique lump which contains the necessary EDF. We will include these lumps in EDFROOT so that the relevant pickups defined in the files can be used. For this tutorial we will use [[DECORATE state syntax]] when defining the thingtypes that our pickups require, as well as [[EDF_thing_reference#Eternity_Alfheim_syntax|Alfheim syntax]].
Much like creating a simple decoration, we will start by creating a text lump named EDFROOT, but for this tutorial each pickup will have its own unique lump which contains the necessary EDF. We will include these lumps in EDFROOT so that the relevant pickups defined in the files can be used. For this tutorial we will use [[DECORATE state syntax]] when defining the the thingtypes that our pickups require.


  stdinclude("root.edf") // Includes the file base/root.edf, which in turns includes the other files
  stdinclude("root.edf") // Includes the file base/root.edf, which in turns includes the other files
                         // that are required for definition of all sprites, sounds, things etc.
                         // that are required for definition of all sprites, sounds, things etc.
setdialect("Alfheim") // Sets the dialect to Alfheim, which will impact all the lumpincluded files.
                      // This means that the syntax "thingtype Whatever : Mobj, doomednum" can be used.


'''Please note that you can call the lumps whatever you want. The lump names used here (besides EDFROOT) are just example lump names.'''
'''Please note that you can call the lumps whatever you want. The lump names used here (besides EDFROOT) are just example lump names.'''
Line 23: Line 20:
Now, start editing EHEALTH.
Now, start editing EHEALTH.


  // This defines the thingtype UglyKit as a thing with doomednum 30001. Mobj is currently a dummy value.
  thingtype UglyKit
thingtype UglyKit : Mobj, 30001
  {
  {
  doomednum  30001  // This is the thing number used to place the object in a map.
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   
   
Line 33: Line 30:
     message "You got health, but you didn't like it..." // The message given when picked up.
     message "You got health, but you didn't like it..." // The message given when picked up.
     sound  itemup    // The sound made when the item is picked up.
     sound  itemup    // The sound made when the item is picked up.
   }
   }  
   
   
   states
   states // This declares that the following block is the thingtype's states.
   @"
   @"
   Spawn:
   Spawn:
Line 61: Line 58:
Now, start editing EARMOR.
Now, start editing EARMOR.


  // This defines the thingtype RedArmor as a thing with doomednum 30002. Mobj is currently a dummy value.
  thingtype RedArmor  
thingtype RedArmor : Mobj, 30002
  {
  {
  doomednum  30002  // This is the thing number used to place the object in a map.
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   
   
   pickupeffect        // This defines what happens when the item is picked up.
   pickupeffect        // This defines what happens when the item is picked up.
   {
   {
    effects RedArmor  // The actual effects that happen when the item is picked up (can be a comma separated list).
    effects RedArmor  // The actual effects that happen when the item is picked up (can be a comma separated list).
    message "Picked up the HyperArmor!" // The message given when picked up.
    message "Picked up the HyperArmor!" // The message given when picked up.
    sound  itemup    // The sound made when the item is picked up.
    sound  itemup    // The sound made when the item is picked up.
   }
   }
   
   
Line 85: Line 82:
  {
  {
   saveamount  150 // The number the armor % is set to.
   saveamount  150 // The number the armor % is set to.
   savefactor  2  // The numerator for the damage multiplier fraction (2/n).
   savefactor  2  // The numerator for the damage absorption fraction (2/n).
   savedivisor 3  // The denominator for the damage multiplier fraction (n/3).
   savedivisor 3  // The denominator for the damage absorption fraction (n/3).
                   // These two properties combine to the player taking 2/3 times the damage they usually would (66%).
                   // These two properties combine to the armor absorbing 2/3 the damage the player would usually would take (66%).
  }
  }


Line 99: Line 96:
Now, start editing EAMMO.
Now, start editing EAMMO.


  // This defines the thingtype RedAmmoBox as a thing with doomednum 30003. Mobj is currently a dummy value.
  thingtype RedAmmoBox
thingtype RedAmmoBox : Mobj, 30003
  {
  {
  doomednum  30003    // This is the thing number used to place the object in a map.
   flags      SPECIAL  // Sets flags for item, which in this case means it's a collectable item.
   flags      SPECIAL  // Sets flags for item, which in this case means it's a collectable item.
   
   
Line 129: Line 126:
Now either type "summon RedAmmoBox" (not case-sensitive) in the console, or place a thing with doomednum 30003 in the map. When you pick it up, it should give you 75 bullets, regardless of difficulty.
Now either type "summon RedAmmoBox" (not case-sensitive) in the console, or place a thing with doomednum 30003 in the map. When you pick it up, it should give you 75 bullets, regardless of difficulty.


===Weapon===
===Power-up===
Create a new lump, called EWEAPON. Add the following to EDFROOT, on a line after the stdinclude.
Create a new lump, called EPOWER. Add the following to EDFROOT, on a line after the stdinclude.


  lumpinclude("EWEAPON") // A new ammo pickup
  lumpinclude("EPOWER") // A new ammo pickup


Now, start editing EWEAPON.
Now, start editing EPOWER.


  // This defines the thingtype BlueLauncher as a thing with doomednum 30004. Mobj is currently a dummy value.
  thingtype Torch
  thingtype BlueLauncher : Mobj, 30004
  {
  {
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   doomednum  30005  // This is the thing number used to place the object in a map.
  addflags  SPECIAL|COUNTITEM|FLOATBOB // Sets flags for item, which in this case means it's a collectable item, counts in the items end tally, and floats.
   
   
   pickupeffect        // This defines what happens when the item is picked up.
   pickupeffect        // This defines what happens when the item is picked up.
   {
   {
     effects BlueLauncher // The actual effects that happen when the item is picked up (can be a comma separated list).
     effects Torch        // The actual effects that happen when the item is picked up (can be a comma separated list).
     message "You got an offensively blue missile launcher." // The message given when picked up.
     message "You got a hideous torch." // The message given when picked up.
     sound  wpnup        // The sound made when the item is picked up.
     sound  getpow      // The sound made when the item is picked up.
   }
   }
   states
   states
   @"
   @"
   Spawn:
   Spawn:
     BLUL A -1
     TRCH ABC 3 bright
     stop
     loop
   "@
   "@
  }
  }
   
   
  weapongiver BlueLauncher
  powereffect Torch
  {
  {
   weapon MissileLauncher // The weaponinfo given by the weaponinfo
   duration 120        // How long the power lasts in seconds.
   ammogiven AmmoMissile, 2, 1, 5, 2 // Ammo type given, and values in order, normal, dropped,
   type    PowerTorch // The type of power given, in this case Heretic's flickering torch.
                                    // DM w/ weapons stay, coop w/ weapons stay
  ammogiven AmmoCell, 10 // You can define as many as you want. In this case, it gives 10 cells always
                          // (but is doubled for certain skill levels).
  }
  }


Now either type "summon BlueLauncher" (not case-sensitive) in the console, or place a thing with doomednum 30005 in the map. When you pick it up, it should give you a rocket launcher, some rockets, and cells.
Now either type "summon Torch" (not case-sensitive) in the console, or place a thing with doomednum 30005 in the map. When you pick it up, it should provide you with the Heretic-style


===Power-up===
===Weapon===
Create a new lump, called EPOWER. Add the following to EDFROOT, on a line after the stdinclude.
Create a new lump, called EWEAPON. Add the following to EDFROOT, on a line after the stdinclude.


  lumpinclude("EPOWER") // A new ammo pickup
  lumpinclude("EWEAPON") // A new ammo pickup


Now, start editing EPOWER.
Now, start editing EWEAPON.


  // This defines the thingtype Torch as a thing with doomednum 30005. Mobj is currently a dummy value.
  thingtype BlueLauncher
thingtype Torch : Mobj, 30005
  {
  {
   doomednum 30005 // This is the thing number used to place the object in a map.
   doomednum   30005   // This is the thing number used to place the object in a map.
   addflags  SPECIAL|COUNTITEM|FLOATBOB // Sets flags for item, which in this case means it's a collectable item, counts in the items end tally, and floats.
   flags      SPECIAL // Sets flags for item, which in this case means it's a collectable item.
   
   
   pickupeffect        // This defines what happens when the item is picked up.
   pickupeffect        // This defines what happens when the item is picked up.
   {
   {
     effects Torch        // The actual effects that happen when the item is picked up (can be a comma separated list).
     effects BlueLauncher // The actual effects that happen when the item is picked up (can be a comma separated list).
     message "You got a hideous  torch." // The message given when picked up.
     message "You got an offensively blue missile launcher." // The message given when picked up.
     sound  getpow      // The sound made when the item is picked up.
     sound  wpnup        // The sound made when the item is picked up.
   }
   }
   states
   states
   @"
   @"
   Spawn:
   Spawn:
     TRCH ABC 3 bright
     BLUL A -1
     loop
     stop
   "@
   "@
  }
  }
   
   
  powereffect Torch
  weapongiver BlueLauncher
  {
  {
   duration 120        // How long the power lasts in seconds.
   weapon MissileLauncher            // The weaponinfo name given by the weapongiver.
   type    PowerTorch // The type of power given, in this case Heretic's flickering torch.
   ammogiven AmmoMissile, 2, 1, 5, 2 // Ammo type given, and values in order, normal, dropped,
                                    // DM w/ weapons stay, coop w/ weapons stay.
  ammogiven AmmoCell, 10            // You can define as many as you want. In this case, it gives 10 cells always
                                    // (but is doubled for certain skill levels).
  }
  }


Now either type "summon Torch" (not case-sensitive) in the console, or place a thing with doomednum 30005 in the map. When you pick it up, it should provide you with the Heretic-style
Now either type "summon BlueLauncher" (not case-sensitive) in the console, or place a thing with doomednum 30005 in the map. When you pick it up, it should give you a rocket launcher, some rockets, and cells.


===Artifact===
===Artifact===
Line 209: Line 205:
Now, start editing EKEY.
Now, start editing EKEY.


  // This defines the thingtype GreyCard as a thing with doomednum 30002. Mobj is currently a dummy value.
  thingtype GreyCard
thingtype GreyCard : Mobj, 30006
  {
  {
  doomednum  30006    // This is the thing number used to place the object in a map.
   flags      SPECIAL  // Sets flags for item, which in this case means it's a collectable item.
   flags      SPECIAL  // Sets flags for item, which in this case means it's a collectable item.
   
   
Line 247: Line 243:
   require  GreyCard
   require  GreyCard
   mapcolor "#AAAAAA" // This is matched as closely as possible to the current palette
   mapcolor "#AAAAAA" // This is matched as closely as possible to the current palette
   
 
   message      "You need a grey card to activate this door"
   message      "You need a grey card to activate this door"
   remotemessage "You need a grey card to activate this object"
   remotemessage "You need a grey card to activate this object"
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)