I bleed!

1996-06-22 InsideQC tutorials kleskby 0 88
Author: ShockMan
Source: https://www.insideqc.com/qctut/lesson-45.shtml



Step 1

Hi again... another cool tutorial from the one and only ShockMan :)
In this tutorial we will make the player "bleed" if he gets low on health...
First open up combat.qc and add the following to the start of that file.


void(vector org, vector vel, float damage) SpawnBlood;

after that find "void() T_Damage" and in that function find:


if (targ.health <= 0)
{
        Killed (targ, attacker);
        return;
}

before this add:


if (targ.health <= 20) // set 20 to the health you want the bleeding to start
{
        targ.bleed = TRUE; // bleed
}


Step 2

Now we have to open up defs.qc and at the end add:


.float bleed;


Step 3

then open client.qc and find the function "PlayerPreThink" and in that function, find:


WaterMove ();

and after that add:


If (self.bleed == TRUE)
        Bleeding(self);

then go to combat.qc again, and at the end add this:


void(entity org) Bleeding =
{
        SpawnBlood (org.origin, '0 0 0', 70); // make the blood
};


Step 4

That's it.. have fun!


Tags: tutorial, quakec, qc, insideqc, monster, ai
Owned by kleskby#1837
Telegram
Close

You have no new notifications.


You have no new messages.