Author Topic: Feature requestL table entries inheriting properties of other entries  (Read 900 times)

0 Members and 1 Guest are viewing this topic.

Offline Woolie Wool

  • 211
  • Fire main batteries
Feature requestL table entries inheriting properties of other entries
While fiddling with the DECORATE system of the Doom source port ZDoom, which is similar in many ways to FreeSpace tables, I found that DECORATE actor classes can inherit the properties of other classes, allowing you to make a version of another class that is different in only the fields you specify. An example is shown below.

This is the original DECORATE class for the Baron of Hell monster.
Code: [Select]
actor BaronOfHell 3003
{
  spawnid 3
  obituary "%o was bruised by a Baron of Hell."
  hitobituary "%o was ripped open by a Baron of Hell."
  health 1000
  radius 24
  height 64
  mass 1000
  speed 8
  painchance 50
  seesound "baron/sight"
  painsound "baron/pain"
  deathsound "baron/death"
  activesound "baron/active"
  MONSTER
  +FLOORCLIP
  states
  {
  Spawn:
    BOSS AB 10 A_Look
    loop
  See:
    BOSS AABBCCDD 3 A_Chase
    loop
  Melee:
  Missile:
    BOSS EF 8 A_FaceTarget
    BOSS G 8 A_BruisAttack  // See BaronBall
    goto See
  Pain:
    BOSS H 2
    BOSS H 2 A_Pain
    goto See
  Death:
    BOSS I 8
    BOSS J 8 A_Scream
    BOSS K 8
    BOSS L 8 A_NoBlocking
    BOSS MN 8
    BOSS O -1 A_BossDeath
    stop
  Raise:
    BOSS ONMLKJI 8
    goto See
  }
}

The Baron of Hell sprite has green blood, but in the original Doom the blood that spurts out when you shoot it is red. To correct this, a small DECORATE entry can be made that inherits the original monster's properties.

Code: [Select]
//Baron of Hell
actor DEBaronOfHell : BaronofHell replaces BaronofHell
{
BloodColor "20 60 20"
}
If you do not wish to outright replace the original class, you can remove the "replaces BaronofHell" after "actor DEBaronOfHell : BaronofHell". This could be applied to FreeSpace like the following:

Code: [Select]
$Name: GTF Myrmidon#Fast
+inherit: GTF Myrmidon
$Short name:                    TFight2t-05f
$Max Velocity: 0.0, 0.0, 85.0                  ;; in x/y/z -- z only specified forward.  use special tokens for backward movement
$Rotation time: 3.5, 3.2, 4.0
$Max Oclk Speed: 105.0

Of course, ships.tbl need not be the only table that can use this. This could be applied to weapons.tbl, objecttypes.tbl, etc. Especially objecttypes.tbl since no default table is included with newer builds and the only available copies (in older builds) are obsolete.
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Feature requestL table entries inheriting properties of other entries
I'm no table expert but I've been told that this is already possible. You'll have to ask someone who is one how though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]