Announcement

Collapse
No announcement yet.

Flag Values for Models

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Guys:

    Tried messing with that DP command to change the model flafs on a model in the QC, and could not get it to work. Also stumbled on this archived old QC, but cant be certain what it means? Is this a way to define the models in the code, like macros behave?

    Quake Macros? - Pastebin.com

    Comment


    • #17
      http://icculus.org/twilight/darkplac...91008beta1.zip

      I use this

      Then in command/cmd

      modeltool --flags ## modelname.mdl (or md3)

      Comment


      • #18
        Originally posted by Cobalt View Post
        Tried messing with that DP command to change the model flafs on a model in the QC, and could not get it to work. Also stumbled on this archived old QC, but cant be certain what it means? Is this a way to define the models in the code, like macros behave?
        Hello Cobalt,

        Thank you for your question.

        OoPpEe explained how you can change the flag on a single model (outside QC).


        If you want to change the flag inside QC:
        According your questions (if I understood you correctly) you want to know how to change the flag of models with the help of QC.
        First of all, please read the posts about this topic here and here.

        Now, to go into details:
        Knowing that you are using DarkPlaces yourself...
        LordHavoc gave us a function, that handles exactly this:
        Code:
        //DP_SV_MODELFLAGS_AS_EFFECTS
        //idea: LordHavoc, Dresk
        //darkplaces implementation: LordHavoc
        //field definitions:
        .float modelflags;
        //constant definitions:
        float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
        float MF_ROCKET  =   1; // leave a trail
        float MF_GRENADE =   2; // leave a trail
        float MF_GIB     =   4; // leave a trail
        float MF_ROTATE  =   8; // rotate (bonus items)
        float MF_TRACER  =  16; // green split trail
        float MF_ZOMGIB  =  32; // small blood trail
        float MF_TRACER2 =  64; // orange split trail
        float MF_TRACER3 = 128; // purple trail
        //description:
        //this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc.
        //setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS.
        //
        //silly example modification #1 to W_FireRocket in weapons.qc:
        //missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail
        //silly example modification #2 to W_FireRocket in weapons.qc:
        //missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail
        //
        //note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm.
        //
        //note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values.

        As you can see, you can set every standard flag to a model via QC, independent to the "hardcoded flag" it has set to it.
        LordHavoc gave funny examples, what can be done with it

        Furthermore, you can of course use his function DP_ENT_TRAILEFFECTNUM.
        This makes it possible to create your own custom effects for every model.
        So you are NOT binded to the standard flag effects.
        The good thing is, you can code it inside your mod, but you are NOT forced to use it in the game.
        Example:
        You can stick a new custom effect "ring_effect" to the ring via QC.
        But if you dont have a "ring_effect" entry in your effectinfo.txt, you will not see any difference in-game.
        If you have this entry in your effectinfo.txt, you can modify it just the way you like it and you will see it in-game.

        I hope this answeres your question a little bit.

        Best wishes,
        Seven

        Comment

        Working...
        X