Latest revision |
Your text |
Line 21: |
Line 21: |
| spawnhealth 30 // The amount of health the monster spawns with. | | spawnhealth 30 // The amount of health the monster spawns with. |
| painchance 128 // The likelihood that the monster goes to a pain state if it is hit. | | painchance 128 // The likelihood that the monster goes to a pain state if it is hit. |
| // Percentage chance is (painchance/255)*100, so for this monster it would be roughly 50%. | | // Percentage chance is (painchance/256)*100, so for this monster it would be 50%. |
| | | |
| speed 8 // The monster moves an amount relative to this value each time it uses the Chase codepointer. | | speed 8 // |
| | | |
| radius 20.0 // The radius and height set the physical size | | radius 20.0 // The radius and height set the physical size |
Line 37: |
Line 37: |
| | | |
| obituary_normal "was turned to goo by a mutated zombie" // The message displayed when the player is killed by this | | obituary_normal "was turned to goo by a mutated zombie" // The message displayed when the player is killed by this |
| // monster, using a projectile or other miscellaneous attack. | | // monster, using a a projectile or other miscellaneous attack. |
| | | |
| acs_spawndata // The identification number used by various parameterised specials, like Thing_Spawn. | | acs_spawndata // The identification number used by various parameterised specials, like Thing_Spawn. |
| { // it also limits the number to a game namespace. Heretic objects use "modes heretic" | | { // it also limits the number to a game namespace. Heretic objects use "modes heretic" |
| num 255 // instead of "modes doom". Do note that the number must be <256. | | num 255 // instead of "modes doom". |
| modes doom | | modes doom |
| } | | } |
| | | |
| states // This declares that the following block is the thingtype's states. | | firstdecoratestate S_POSS_STND |
| @" // The equivalent to an opening curly brace. | | states |
| Spawn: // State the thing is spawned at. | | @" |
| POSS AB 10 A_Look // Call the function A_Look, using sprites POSSA and POSSB, each for 10 frames. | | Spawn: |
| loop // Loop back to the start of this label.
| | POSS AB 10 A_Look |
| See: // State the monster goes into after seeing a target.
| |
| POSS AABBCCDD 4 A_Chase // Call the function A_Chase, calling it twice for sprites POSSA-D, each time for 4 frames.
| |
| loop | | loop |
| Missile: // State the monster goes into when deciding to shoot its target. | | See: |
| POSS E 10 A_FaceTarget // Call the action function A_FaceTarget. | | POSS AABBCCDD 4 A_Chase |
| POSS F 8 A_MissileAttack(MBFBetaPlasma1) // Call the action function A_MissileAttack with parameter MBFBetaPlasma1, | | loop |
| // and leave the rest of the parameters as default (all 0 in this case).
| | Missile: |
| | POSS E 10 A_FaceTarget |
| | POSS F 8 A_MissileAttack(MBFBetaPlasma1) |
| POSS E 8 | | POSS E 8 |
| goto See // Jump to state See. Note that the next line after a goto MUST be labelled, | | goto See |
| // unlike ZDoom.
| | Pain: |
| Pain: // State it goes into when hit by attack that successfully triggers this pain state. | |
| POSS G 3 | | POSS G 3 |
| POSS G 3 A_Pain | | POSS G 3 A_Pain |
| goto See | | goto See |
| Death: // State it goes into when killed or otherwise destroyed. | | Death: |
| POSS H 5 | | POSS H 5 |
| POSS I 5 A_Scream | | POSS I 5 A_Scream |
Line 71: |
Line 70: |
| POSS L -1 | | POSS L -1 |
| stop | | stop |
| XDeath: // Optional state it goes into when killed with very high damage. | | XDeath: |
| POSS M 5 | | POSS M 5 |
| POSS N 5 A_XScream | | POSS N 5 A_XScream |
| POSS O 5 A_Fall | | POSS O 5 A_Fall |
| POSS PQRST 5 | | POSS PQRST 5 |
| POSS U -1 // This frame has infinite duration as it has been given a length of -1. | | POSS U -1 |
| stop // This is the equivalent of setting the next frame to 0. If the last frame | | stop |
| // has a finite duration (not -1), then it will disappear. otherwise it's often
| | Raise: |
| // used after -1 duration frames when nothing is expected to follow.
| |
| Raise: // Optional state that the corpse goes into when revived by an Arch-vile. | |
| POSS KJIH 5 | | POSS KJIH 5 |
| goto See | | goto See |
| "@ // The equivalent to a closing brace.
| |
| }
| |
|
| |
| Now either type "summon MutatedZombie" (not case-sensitive) in the console, or place a thing with doomednum 30001 in the map, and we should have a Mutated Zombie walking around the map, making chainsaw noises and firing beta plasma balls at you. With this out of the way we can move on to defining a new monster that doesn't use IWAD assets. For the purposes of this tutorial we will be using [http://www.realm667.com/index.php/en/component/docman/?task=doc_download&gid=285 the aracnorb] from the Realm667 bestiary by [[doom_wiki:James Paddock (Jimmy)|James Paddock (Jimmy)]].
| |
|
| |
| Start by copying over the contents of the wad from SS_START to SS_END inclusive into whatever wad you were previously working in. To follow this up you will need to convert the three sound files provided into Doom Sound Format, and place them in the wad. Now we will start by editing EARACORB. This example won't use comments in areas already covered by the previous one. The ACNFI states will need to be changed so that all I's are replaced with H's and ACNF is replaced with ACNB. Don't focus too much on the AracnorbBall thingtype, as we will look further into that in [[Creating a projectile]].
| |
|
| |
| thingtype Aracnorb
| |
| {
| |
| doomednum 30002
| |
| basictype FlyingMonster // This uses a predefined set of flags for this object. basictype FlyingMonster is equivalent
| |
| // to setting cflags as SOLID | SHOOTABLE | COUNTKILL | NOGRAVITY | FLOAT | SPACMONSTER | PASSMOBJ.
| |
| addflags FLOATBOB // This makes it so that on top of the already defined flags, this thingtype also has the flag FLOATBOB.
| |
|
| |
| spawnhealth 170
| |
| painchance 150
| |
|
| |
| speed 12
| |
| radius 24.0
| |
| height 56.0
| |
| mass 400 // Represents mass factor for the thingtype. This determines thrust when damaged, or how much an
| |
| // Arch-vile's attack will affect it.
| |
| xscale 0.85 // How much the horizontal component of this sprite is to be scaled.
| |
| yscale 0.85 // How much the vertical component of this sprite is to be scaled.
| |
|
| |
| // This thingtype drops nothing when it dies, so no droptype is defined and it uses the default value (nothing).
| |
|
| |
| seesound "aracnorb/sight" // This uses sound mnemonics defined at the bottom of this EDF file, as well as pre-defined
| |
| attacksound "aracnorb/melee" // Arachnotron sounds from the IWAD.
| |
| painsound dmpain
| |
| deathsound "aracnorb/death"
| |
| activesound bspact
| |
|
| |
| obituary_normal "suffered psychic trauma from an aracnorb's brainwaves."
| |
| obituary_melee "had their skull chewed by an aracnorb." // The message displayed when killed by the thingtype's melee attack.
| |
|
| |
| acs_spawndata
| |
| {
| |
| num 254
| |
| modes doom
| |
| }
| |
|
| |
| States
| |
| @"
| |
| Spawn:
| |
| ACNB A 1 A_Look
| |
| Loop // Note that you can capitalise keywords if you so wish.
| |
| See:
| |
| ACNB A 2 A_Chase
| |
| Loop
| |
| Melee:
| |
| ACNB AB 5
| |
| ACNB C 6 A_Scratch(3, 6, "aracnorb/melee") // This calls a generalised melee function. The parameters tell it to use the
| |
| // 2nd parameter as damage, do 6 damage, and call the sound "aracnorb/melee".
| |
| Goto See
| |
| Missile:
| |
| ACNB B 12 Bright A_FaceTarget // The "Bright" keyword causes this thing to light up when performing this action.
| |
| ACNB C 2 Bright A_MissileAttack("AracnorbBall", 1) // Attack spawning a projectile "AracnorbBall", and allow
| |
| // ball to trace (home in on) its target.
| |
| ACNB B 2 Bright
| |
| ACNB D 0 A_Jump(32,"See") // Have a 32/255 chance to jump to the state "See".
| |
| ACNB D 0 A_SpidRefire
| |
| Goto Missile+1 // This skips the first line of Missile, and goes straight to attacking.
| |
| Pain:
| |
| ACNB I 2
| |
| ACNB I 2 A_Pain
| |
| Goto See
| |
| Death:
| |
| ACNB D 0 A_UnSetFlags(0, "FLOATBOB") // Set the flag FLOATBOB to false, so that once it dies it stops bobbing.
| |
| ACNB D 0 A_Scream
| |
| ACNB D 6 A_Fall
| |
| ACNB D 1
| |
| Wait
| |
| Crash: // Optional state that is called when the corpse falls and hits the floor.
| |
| ACNB EFG 6
| |
| ACNB H -1
| |
| Stop
| |
| Raise:
| |
| ACNB HGFEDA 8
| |
| ACNB A 0 A_SetFlags(0, "FLOATBOB") // Set the flag FLOATBOB back to true, so that it bobs once resurrected.
| |
| Goto See
| |
| "@
| |
| }
| |
|
| |
| thingtype AracnorbBall
| |
| {
| |
| basictype Seeker // This uses a predefined set of flags for this object. basictype FlyingMonster is equivalent
| |
| // to setting cflags as NOBLOCKMAP | NOGRAVITY | DROPOFF | MISSILE | NOCROSS | SEEKERMISSILE.
| |
| radius 13.0
| |
| height 8.0
| |
| speed 8.0
| |
| damage 3
| |
| seesound plasma
| |
| deathsound firxpl
| |
| addflags TRANSLUCENT|SPACMISSILE // This adds the flags so that the projectile is translucent and can activate
| |
| // generalised linedefs marked with the MISSILE special activation flag
| |
| States
| |
| @"
| |
| Spawn:
| |
| ACNF AABB 1 Bright A_GenTracer // This causes the projectile to trace its target.
| |
| Loop
| |
| Death:
| |
| ACNF CDEFG 5 Bright
| |
| Stop
| |
| "@ | | "@ |
| } | | } |
|
| |
| sound "aracnorb/sight" { lump = "DSARACST"; } // Define the sound "aracnorb/sight" as the lump DSARACST.
| |
| sound "aracnorb/death" { lump = "DSARACDT"; }
| |
| sound "aracnorb/attack" { lump = "DSARACFR"; }
| |
| sound "aracnorb/melee" { lump = "DSARACML"; }
| |
|
| |
| Now just type "summon Aracnorb" into the console or place a thing with doomednum 30002 on the map and you should see your brand new monster that fires a custom homing projectile.
| |
|
| |
| [[Category:Tutorials]]
| |