FORUM ARCHIVED

MonsterDB structuring

Discussion in 'Modding' started by tentacled-godqueen, Aug 17, 2012.

  1. Okay so, I think I get how it works; looking at the monDB files it appears you have a monster, and then any subsequent monsters inherit sprites, etc. from the last monster with defined sprites?

    Is this correct?

    And then if I want to make more monsters in the same family, is there a way to do that or do you just copy-paste the first monster and set in to a new family?

    And will the game recognize this for taxa purposes if I add a new sort of diggle? (For that matter, if this isn't true, does this mean that eg Diggle Harbinger is not recognized as a diggle by "taxa" tags?)

    Also: Can anyone explain how tinting monsters works? 'cause like. I can't just eyeball this to see if its right because colorblind. Odds are we'll end up with like, purple ice demons, green sunflowers, or orange lettuce if I try that :p I need to know the mathematics of how the colors are determined >.<
     
  2. Rhadamante

    Rhadamante Member

    Interesting questions that I'd like to have the answers too.
     
  3. Also noticing Dredmorpedia is implying secondarybuffs from the root monster are inherited too? IE in the XML enraged diggle has +1 armor only as secondarybuffs, but the enraged diggle in dredmorpedia has -10 crit, +4 dodge, and -2 health, which are the stats of the base diggle, on top of that.

    How exactly DOES the game determine what the root monster is though? Last monster with defined sprites?

    And do they inherit ALL stats unless overwritten?
     
  4. Rhadamante

    Rhadamante Member

    I can at least answer that I think. If you take a monster :

    Code:
    <monster name="Diggle" level="0" tiny="1" splat="blood" taxa="Animal" diggleHell="1">
      <idleSprite left="sprites/monster/diggle/diggle_run_l.spr"
        right="sprites/monster/diggle/diggle_run_r.spr"
        up="sprites/monster/diggle/diggle_run_u.spr"
        down="sprites/monster/diggle/diggle_run_d.spr"/>
      <attackSprite left="sprites/monster/diggle/diggle_atk_l.spr"
        right="sprites/monster/diggle/diggle_atk_r.spr"
        up="sprites/monster/diggle/diggle_atk_u.spr"
        down="sprites/monster/diggle/diggle_atk_d.spr"/>
      <hitSprite left="sprites/monster/diggle/diggle_hit_l.spr"
        right="sprites/monster/diggle/diggle_hit_r.spr"
        up="sprites/monster/diggle/diggle_hit_u.spr"
        down="sprites/monster/diggle/diggle_hit_d.spr"/>
      <morphsprites
        eatSprite="sprites/monster/diggle/diggle_eat.xml"
        drinkSprite="sprites/monster/diggle/diggle_drink.xml"
        levelupmSprite ="sprites/monster/diggle/diggle_levelup_male.xml"
        levelupfSprite ="sprites/monster/diggle/diggle_levelup_female.xml"
        vanishSprite="sprites/monster/diggle/diggle_vanish.xml"
        longidleSprite="sprites/monster/diggle/diggle_long_idle.xml"/>
     
      <dieSprite name="sprites/monster/diggle/diggle_die_r.spr"/>
     
      <sfx attack="diggle_attack" hit="diggle_damage" die="diggle_die" spell="diggle_cast"/>
     
      <ai aggressiveness="4" span="10" />
      <sight cone="90" modifier="1.00" />
     
      <stats numFig="3" xpValue="10" />
      <damage slashing="1" piercing="2"/>
      <secondarybuff id="4" amount="-10"/>
      <!-- crit -->
      <secondarybuff id="6" amount="4"/>
      <!-- dodge -->
      <secondarybuff id="0" amount="-2"/>
      <!-- hp -->
      <info latin="(Poingus Poingus)" text="A strange little bird-thing that tunnels through walls with its odd, rubbery nasal appliance."/>
     
      <monster name="Sickly Diggle" level="0" diggleHell="1">
        <palette tint="40"/>
        <onhit spell="Diggle Flu" onechancein="5"/>
        <resistances toxic="2"/>
        <damage slashing="1" piercing="1" toxic="2"/>
        <stats numFig="2" numRog="1" xpValue="7"/>
        <secondarybuff id="0" amount="-4"/> <!-- hp -->
        <secondarybuff id="4" amount="-5"/> <!-- crit -->
        <secondarybuff id="6" amount="4"/> <!-- dodge -->
        <info latin="(Poingus Poingus)" text="A strange little bird-thing that tunnels through walls with its odd, rubbery nasal appliance. This one looks like it has some kind of disease."/>
        </monster>
     
    </monster>  <!-- diggle -->

    ...and you look at the <monster> tags, it goes like this :

    Code:
    <monster Parent monster>
        ...Parent monster stats
     
        <monster Child monster>
        ...Child monster stats
        </monster> end of Child monster
     
    </monster> End of Parent monster
    In short, there's a "main" monster, and any monster contained within him inherits the same stats.

    For that though I'd like the details too. For example, is it possible to change one of the sprites for one of the child monsters or once they inherits from the parent monster we can't change it ? Also, if the parent has a spell, is there a way to to remove it from one of the child ?
     
  5. Oh I missed that part of the structure. (Thanks for pointing it out ^_^) Well that makes everything make more sense.

    I'd assume then that they inherit EVERYTHING from the parent monster unless a different value is specified, which is the usual way inheritance works in programming.

    Also I think I figured out how the tinting works through excessive use of the eyedrop tool. (It just shifts the hue of the monster, which means I can figure this out using the raw numbers :p)

    This still leads to the question of, can we make monsters inherit from monster classes in other files or are we stuck making all modded in monsters be in seperate families?
     
  6. Vitellozzo

    Vitellozzo Member

    Yeah, I know. Necroing and stuff. But I'm good at this. And I want this to be a scripta remnant information (and I want to know if tentacled godqueen still lurk those forums).
    Just copy the base parent monster from the corrispective monDB and give its official childred some new little devilish bro/sis.