Pain Skins

edited 2012 Nov 24 in DOOM
How does one set up pain skins for a critter in DED files?

Comments

  • I have been thinking about this recently too. It looks quite involved, I can usually pick away as a DED file and figure most stuff out, but pain skins really do have me scratching my head lol

    I did contact DaniJ a while ago and he said he could help out, but would ideally need to see exactly what it is I wanted to do. Not got back to him yet as busy with other stuff and not at that stage yet.

    It would be good though if there was some kind of rough guide or example of how they work?
  • bcwood16 wrote:
    I have been thinking about this recently too. It looks quite involved, I can usually pick away as a DED file and figure most stuff out, but pain skins really do have me scratching my head lol

    I did contact DaniJ a while ago and he said he could help out, but would ideally need to see exactly what it is I wanted to do. Not got back to him yet as busy with other stuff and not at that stage yet.

    It would be good though if there was some kind of rough guide or example of how they work?

    BASICALLY, you have to have all of them specified in your MD2 or DMD. If you can't do that with your exporting tool, you can use MD2Tool for that like this:
    md2tool -skin # *.* *.*
    
    Where the # is the number of the skin specified (starting at 0 for the first one), the first file is the name of the skin file, and the last file is that model that you're adding or replacing the def to.

    These are the definitions that you will be concerned with when defining pain skins in your DED file:
    Selskin mask = 0;
               # df_selskin chooses the skin to use by looking at the
               # high byte of the selector integer. The selskin mask
               # specifies which bits of the selector special byte should
               # be considered for df_selskin.
           Selskin shift = 0;
               # After doing an AND operation with the selskin mask, the
               # resulting value is shifted to the right this many bits.
               # Negative values shift to the left.
           Selskins { 0 0 0 0 0 0 0 0 };
               # At most 8 skin numbers for df_selskin. After the special
               # byte is AND'd with the selskin mask and shifted, the
               # result is an index to this list. If the df_selskin flag
               # is set for the model, the skins in this list are used.
    

    ANYONE correct me if I'm wrong, but the selskin mask should always be 0x7, since there are only 8 pain skins to choose from at most. Is that correct?

    For Selskins, you must have the "selskin" flag set in your model definition.
    This defines which skins (from 0 upward) defined in your MD2/DMD that you want to use for the varying degrees of damage.

    Now, for the Selskin Shift, I THINK you could use both the "idskin" flag AND the "selskin" flag to make pain states for random model skins.
    For example, say you have four alternate skins types for a monster, and it'll have four skin tones or something, but you want to have the correct pain states that you drew for each skin type. Since the selskin shift can move the selector number left with a negative value, and since in binary, it takes two bits to total 4 (for the amount of skin variations), then you could set that to -2.
    Basically, it will have the bits higher than 4 to select which pain skin.
    If all is as I think (PLEASE CORRECT ME IF I'M WRONG) then you can have you skins numbered something like this:

    ###### | ##
    Pain skins | Alternate Skin

    So, when numbering your skins, say you have 4 states: normal, a little damage, a lot of damage, and dead.
    You'd number them as if they were 1-4, only as if the bit were shifted left, so for instance, 0-3 would be like this:

    skin type 0 = skins 0-3
    skin type 1 = skins 4-7
    skin type 2 = skins 8-11
    skin type 3 = skins 12-15

    Try it out! :) If you still don't understand, reply and say how many pain skins and if there are any variations and I'll try to help more clearly.

    PS - the order of the skins in Selskins { } goes from left to right, dead to normal. For instance, if your skin 0 were normal, 1 is light damage, 2 is heavy damage, and 3 is wrecked, you could do something like this:
    Selskins { 3 3 2 2 1 1 0 0 };
    
  • It has been a while since I last used the model system but that sounds about right to me Psychikon. I'll add that information to our wiki...
  • Thanks guys,

    Some of that I think I guessed or 'nearly' did and other bits now make more sense from the explanations ;)

    I think I may be able to put something together to get it working, but if I get stuck I know I can post here with my DED and get some help - yay

    I have some fully working models, but im not at the stage of adding pain skins in yet as messing about with particle effects. When im ready I shall be sure to to get back to you, really appreciate the offer of help.

    Its very interesting you can have 'alternative' skins for models, not just pain skins. So if I got this right I could have a a robot with a number 1 on its chest and another robot of the same type have number 2 on its chest......ideal for different faces on zombies too? - thats really cool B-)

    Oh and having this info added to the wiki would be great. I have been reading loads of stuff in that recently and it has all helped me get to were I am at the moment - so great job there!!
  • I've spent a little time on the Model doc. It still needs the selskin theory adding to, however.
  • Here's one way how to do random skin variations with damage skins.. I think some old model pack used this method with some model.

    In the model the skins are in this kind of order:

    00: Skintype A
    01: Skintype B
    02: Skintype C
    03: Skintype A Damage Level 1
    04: Skintype B Damage Level 1
    05: Skintype C Damage Level 1
    06: Skintype A Damage Level 2
    07: Skintype B Damage Level 2
    08: Skintype C Damage Level 2

    And the sub model definition:
    Sub { File="modelname.dmd"; Flags = idskin | selskin; Skin range = 3; Selskin mask = 0x7; Selskins { 6 6 6 3 3 3 0 0 }; Frame="framename"; }

    The "Skin range" defines how many skin variations the model has. This works ok with some other sub model in the same model having an animated skin, which would also use the "Skin range". The selskin/idskin flags/stuff seems to override that.
Sign In or Register to comment.