Announcement

Collapse
No announcement yet.

Creating dead versions of enemies

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

  • Creating dead versions of enemies

    Say the player arrives on the scene and some enemies are already dead. How would I create a dead version of a monster? I assume it'd be finding the right animation frame for it and creating a new entity or something. Could someone please guide me with this? Thanks.

  • #2
    in normal quake without QC i dont think you can place dead enemies

    but if you dun wanna hassle with QC and the enemy which is supposed to be death isnt anywhere near player,
    you could always make said enemy get killed by something like a nailshooter i suppose

    .

    seven's SMC also supports adding models with any frame in a map through usage of ent-files.
    http://quakeone.com/forums/quake-mod...mpilation.html

    you could place an enemy-model in a map and set the frame-number to be one of the death-frames.
    can find tut on how to do so here: http://quakeone.com/forums/quake-hel...arkplaces.html (halfway down first post)

    i used this feature from the SMC to make groupshot i posted here
    http://quakeone.com/forums/quake-tal...er-i-made.html

    if you can work with QC you could perhaps take the place-model code from SMC and implent it into your own mod
    .
    are you curious about what all there is out there in terms of HD content for quake?
    > then make sure to check out my 'definitive' HD replacement content thread! <
    everything that is out there for quake and both mission-packs, compiled into one massive thread

    Comment


    • #3
      @Darth_Stewie

      Are you wanting the monster that is already dead to come back to life? Or do you want a spirit version of him to rise up and attack? Both are doable. You can see an example of this in Seven's great SMC 5.0 mod.

      His version will require Darkplaces to work properly but the effect is very cool. You'll need to make sure to have the death type active in your smc_config.cfg.

      But to give you the basics of doing it with a "ghost" version of the dead monster I will point you in the right direction. We will use the fiend as an example.

      So open up the fiend qc file. Depending on your source it will be demon.qc or fiend.qc.

      Scroll down to where you see demon_die1:

      Code:
      
      void()	demon1_die1		=[	$death1,		demon1_die2	] {
      sound (self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM);};
      void()	demon1_die2		=[	$death2,		demon1_die3	] {};
      void()	demon1_die3		=[	$death3,		demon1_die4	] {};
      void()	demon1_die4		=[	$death4,		demon1_die5	] {};
      void()	demon1_die5		=[	$death5,		demon1_die6	] {};
      void()	demon1_die6		=[	$death6,		demon1_die7	]{self.solid = SOLID_NOT;};
      void()	demon1_die7		=[	$death7,		demon1_die8	] {};
      void()	demon1_die8		=[	$death8,		demon1_die9	] {};
      void()	demon1_die9		=[	$death9,		demon1_die9 ] { [COLOR="Lime"]undead_demon ();[/COLOR]};
      The green highlight is what we will be adding to the end of die9. This will activate the new animations we will be making to make the ghost rise from the grave.

      Now above the die code you will need to place this.


      Code:
      [COLOR="lime"]// This gets called last to remove the monster after the jump attack. [/COLOR]
      void() vengeance_demon_end1 = {self.nextthink = time + 0.2; self.think = SUB_Remove;};
      
      [COLOR="lime"]// This sets up additional run animations for the dead demon to run at you.[/COLOR]
      void() undead_demon_run1 =[	$run1,	undead_demon_run2 ]   {ai_face();movetogoal (10);};
      void() undead_demon_run2 =[	$run2,	undead_demon_run3 ]   {ai_face();movetogoal (10);};
      void() undead_demon_run3 =[	$run3,	undead_demon_run4 ]    {ai_face();movetogoal (10);};
      void() undead_demon_run4 =[	$run4,	undead_demon_run5 ]    {ai_face();movetogoal (10);};
      void() undead_demon_run5 =[	$run5,	undead_demon_jump1 ]    {ai_face();movetogoal (10);};
      
      [COLOR="lime"]//This sets up animations for a jump attack! And at the end calls to remove the entity[/COLOR]										
      void() undead_demon_jump1 =[	$leap1,	undead_demon_jump2 ]    {ai_face();};
      void() undead_demon_jump2 =[	$leap2,	undead_demon_jump3 ]    {sound (self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM);	ai_face();};
      void() undead_demon_jump3 =[	$leap3,	undead_demon_jump4 ]    {ai_face();movetogoal (10);};
      void() undead_demon_jump4 =[	$leap4,	undead_demon_jump5 ]    {ai_face();movetogoal (10);};
      void() undead_demon_jump5 =[	$leap5,	undead_demon_end1 ]    {ai_face();movetogoal (10); 
       makevectors (self.angles);
      [COLOR="lime"]//give him a push in the right direction. :) [/COLOR]
      self.origin_z = self.origin_z + 1;
      self.velocity = v_forward * 280 + '0 0 250';
      };
      
      [COLOR="lime"]// This little beauty runs the death sequence in reverse :) So it looks like he rises from the grave. [/COLOR]
      void() undead_demon1 =[	$death8,	undead_demon2 	]  {};
      void() undead_demon2 =[	$death7,	undead_demon3 	]  {};
      void() undead_demon3 =[	$death6,	undead_demon4 	]  {};
      void() undead_demon4 =[	$death5,	undead_demon5 	]  {sound (self, CHAN_WEAPON, "demon/sight2.wav", 1, ATTN_NORM);};
      void() undead_demon5 =[	$death4,	undead_demon6 	]  {};
      void() undead_demon6 =[	$death3,	undead_demon7 	]  {};
      void() undead_demon7 =[	$death2,	undead_demon8 	]  {};
      void() undead_demon8 =[	$death1,	undead_demon_stand1 ]  {};
      void() undead_demon_stand1 =[$attacka1, undead_demon_run1 ]  {};
      
      
      [COLOR="lime"]// This will set the  the new model, and make it not solid. Tho you could make it solid if you wanted it to be able to hurt you (But you'll need a touch action to do that). [/COLOR]
      void() undead_demon =
      {
      local vector v; 
      v_x = (self.origin_x);
      v_y = (self.origin_y);
      v_z = (self.origin_z);
      
              self.origin = v;                
      	self.movetype = MOVETYPE_FLY;
      	setmodel (self, "progs/demon.mdl");  
      	setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
      	self.solid = SOLID_NOT;
             [COLOR="lime"]// This will run the rest of the frames above[/COLOR]	
      	undead_demon1 ();   	
      };
      So basically all of this code will run a sequence of death animations in reverse, use some basic mosnter ai like ai_face and movetogoal to get the ghost monster to face your direction and move in that direction towards you. Then sets a jump attack. At the end of the attack the entity will be removed. That is the basic stuff you need. Of course as it is this will not be a cool effect. You can either use a custom model for the undead monster or, if you want to use Darkplaces, take a look at Seven's code for a cool way to display the monster. For instance in Darkplaces you can use .alpha to make an entity slightly invisible. Here is an example of how Seven does it in his mod.

      Code:
      [COLOR="lime"]self.alpha = 0.4;
      self.glow_color = 75;
      self.glow_size = 600;[/COLOR]
      He uses the above code throughout the different frames to change the model to be see-through using alpha 0.4 (like a ghost would be) and then gives it a red color and some glow for effect. These all of course require Darkplaces or FTE to work but you will get a much more interesting effect.

      This method can be applied to any monster upon it's death. Now if you wanted it to happen say only when you touched the monster after death you could do so using a solid_trigger that would turn the model into a solid_not while immediately spawning the new model and animation routines for the ghost attacker. You don't even have to have it attack. Maybe have it walk around a bit or whatever.

      This should be enough to get you started. Seven includes source with his mod so open it up and take a look for a bit more information. Be warned, he uses alot of var floats all over the place so it may seem overwhelming to look at his code but those are to make his mod extremely customizable. If you need any additional help or this wasn't exactly what you meant let me know.


      Youtube vid from Seven showing the feature.

      [ame]http://www.youtube.com/watch?v=PxJ5vz7Gp0o&list=UUbX7uVIXqMzBza0YmLJuMdw[/ame]
      Last edited by PrimalLove; 10-04-2014, 09:59 PM.

      Comment


      • #4
        @PrimalLove

        These are very detailed instructions, thanks! To be more specific, what I would like is for an enemy (monster_army) to appear dead, only for them to rise up upon being triggered and attack the player. Would this sort of thing work outside of DarkPlaces, and if so, what are the steps needed to achieve this? Thanks again.

        Comment


        • #5
          @Darth_Stewie

          Oh so you mean placing dead bodies on the map via the map editor or .ent? Then talisa's explanation is going to do this for you. You can follow seven's tutorial to get you started. But at the very least you'll have to use an engine that supports using .ent loading. So likely DP or FTE is going to be your engine of choice for such an effect. Tho I assume it can be done with other engines that support .ent file loads. Now if you wanted to add them to your map without .ent files this may be possible by adding the model as a spawn able item in qc code. Lets start with the ent method as this is easiest.


          Basically you'll need to create an ent file for the map you want to add the model to and add something like this to it:

          Code:
          {			
          "classname" "dead_fiend"
          "origin" "300 100 10"	  [COLOR="lime"]// This will depend on the coords in your map[/COLOR]	
          "model" "progs/demon.mdl"						
          "solid" "SOLID_TRIGGER"	[COLOR="lime"]// Make it a trigger[/COLOR]
          "frame" "$death9"	// The frame you want the model to start in.
          "touch" "undead_demon" [COLOR="Lime"] // Once touched will run this function to rise from dead.[/COLOR]
          "sizemin" "VEC_HULL2_MIN"	[COLOR="lime"]// So it can move correctly[/COLOR]	
          "sizemax" "VEC_HULL2_MAX"		
          }
          So the above code in the ent should place a dead demon on your level at the origin coords. Once you touch it it will run the code I provided earlier as long as its defined in your qc somewhere and should run the animations after that.
          I could be wrong on some of this tho. Seven may have more insight into these features. But in theory the above should allow for a touched dead fiend to have a ghost come back to life. Or you could just make a similar function that just simply runs the death animations in reverse and then give the monster all the properties it needs to become a fully working monster! This same principle I believe could be applied to adding it directly to your map in the map editor as long as you have the qc to support it. But I am not a mapper so this is speculation. If you could do it that way then you wouldn't need to rely on a ent file. But you'll need to add the classname and model to your fgd file or make a custom one for your mod.

          If you do it the ghost method you'll probably want to use a DP or FTE engines so you can make the effect more interesting and real. If you simply want the monster to get back up again and fight you could feasibly do that without the need for DP or similar.

          Comment


          • #6
            any mod that requires fields like solid or touch or mins/maxs set in map entities has an absolute hatred for mappers.
            mappers that specify that junk anyway use sledge hammers where all they need is to know how to not break their new phone, or whatever.
            you have a classname. let the qc set up everything it needs without requiring everyone to go out of their way to fuck over any fowards compatibility.

            </rant>
            Some Game Thing

            Comment


            • #7
              @Spike those fields are really only require if he uses the ent file method. If he does this by adding the entity to the map then yes the qc can basically handle everything like any spawned entity and fields. I suppose the beauty of ent files is you don't have to edit a bsp to add new content to it. It's essential a hack I suppose but I was just laying out both options. Admittedly to make this as compatible as possible its best to create the undead_demon in qc and just add the classname and model to the fgd file. Tho this still requires an altered fgd file it should all work fine in most engines assuming you don't use any dpextension added effects to the entity. So basically he could just run the animations in reverse and set all the monster properties for walk, run, etc. and have it set to FoundTarget and should be mostly good to go. Tho this will not add a monster count if you were planning on having these undead creatures return also count as monster kills. If so you'd need to bump the monster count. I figured setting this as a trigger made the most amount of sense but I guess you could also add a delay timer to in in the map editor so at a specific amount of time passes the dead will rise again.

              It seems like a cool idea to me so I see no reason why it could not be done without the need of DP or FTE.

              Comment


              • #8
                those fields are not needed AT ALL in ent files. there is absolutely no difference between an ent file and the entities lump inside bsps. open up your bsp in notepad and copy out that bit of text if you don't believe me. there is absolutely no need for it.
                the *one* time that such fields are useful in bsp/ent files is when you're hacking around omissions in the progs.dat itself, and that isn't relevant/reliable with complex monster behaviours on acount of the classname issue being unsolvable.
                Some Game Thing

                Comment


                • #9
                  Thanks for the clarification.

                  Comment


                  • #10
                    Couldn't you simply define the monsters standing routine as a death animation frame, and also only wake up when the player is in RANGE_MELEE via spawnflag? This could be done for any engine as well. Of course, if you shoot what appears to be a dead monster, that would wake him up as well. But that would make sense I suppose.

                    You could make some dead body static entities so players won't always be sure which ones wake up and which ones don't. Just an idea.
                    'Replacement Player Models' Project

                    Comment


                    • #11
                      <placeholder for my final response>

                      can you specify $frame in world spawn yet?

                      create a new ent (via qc), lay it at $frame dead*, solid not, done?

                      cmon this doesnt have to be MAP issue.
                      www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                      Comment


                      • #12
                        Yyou can put some dead bodies without qc works, using func_illusionary https://www.dropbox.com/s/uhhvo8yrkc...dbody.bsp?dl=0

                        aniway you need "precache" the models (using alive monster)
                        the invasion has begun! hide your children, grab the guns, and pack sandwiches.

                        syluxman2803

                        Comment

                        Working...
                        X