Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Woolie Wool on November 10, 2006, 11:16:48 pm

Title: Feature requestL table entries inheriting properties of other entries
Post by: Woolie Wool on November 10, 2006, 11:16:48 pm
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.
Title: Re: Feature requestL table entries inheriting properties of other entries
Post by: karajorma on November 11, 2006, 05:37:44 am
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.