Editing Creating a pickup
From Eternity Wiki
Jump to navigationJump to search
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 1: | Line 1: | ||
Creating a pickup is effectively [[creating a simple decoration]], but with a few more steps. You should read that tutorial first before continuing on here. In this tutorial we will define several pickups, each with its own section. In addition, the multiple ways in which a pickup can be defined will also be explored. | Creating a pickup is effectively [[creating a simple decoration]], but with a few more steps. You should read that tutorial first before continuing on here. In this tutorial we will define several pickups, each with its own section. In addition, the multiple ways in which a pickup can be defined will also be explored. | ||
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. | |||
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 | |||
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. | ||
'''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 18: | ||
Now, start editing EHEALTH. | Now, start editing EHEALTH. | ||
thingtype UglyKit | |||
{ | { | ||
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 28: | ||
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 56: | ||
Now, start editing EARMOR. | Now, start editing EARMOR. | ||
thingtype RedArmor | |||
{ | { | ||
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). | |||
message "Picked up the HyperArmor!" // The message given when picked up. | |||
sound itemup // The sound made when the item is picked up. | |||
} | } | ||
Line 85: | Line 80: | ||
{ | { | ||
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 | savefactor 2 // The numerator for the damage absorption fraction (2/n). | ||
savedivisor 3 // The denominator for the damage | savedivisor 3 // The denominator for the damage absorption fraction (n/3). | ||
// These two properties combine to the | // These two properties combine to the armor absorbing 2/3 the damage the player would usually would take (66%). | ||
} | } | ||
Line 99: | Line 94: | ||
Now, start editing EAMMO. | Now, start editing EAMMO. | ||
thingtype RedAmmoBox | |||
{ | { | ||
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 128: | Line 123: | ||
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. | ||
===Power-up=== | ===Power-up=== | ||
===Weapon=== | |||
===Artifact=== | ===Artifact=== | ||
==Sprite-based pickup== | ==Sprite-based pickup== | ||
Sprite-based pickups are what almost all IWAD pickups use, and are mostly there for backwards-compatibility. | Sprite-based pickups are what almost all IWAD pickups use, and are mostly there for backwards-compatibility. |