Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia - The UNKNOWN Descent Project - NEW THREAD
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Amnesia - The UNKNOWN Descent Project - NEW THREAD

Piggybacking on that question.

Spoiler below!

You could easily track health by using the enemy's name as part of a LocalVarInt or LocalVarFloat.

Simply by writing
PHP Code: (Select All)
GetLocalVarInt(enemyName "_health"); 

For damage the easiest solution would be to create your own adjustment of damage, and damage checks.
You would also need to keep track of collisions with a certain weapon, such as a sword
PHP Code: (Select All)
void AdjustHealth(string enemyint amount)
{
    
AddLocalVarInt(enemy+"_health"amount);
    
CheckHealth(enemy)

PHP Code: (Select All)
int GetHealth(string enemy)
{
    return 
GetLocalVarInt(enemy+"_health");

PHP Code: (Select All)
void CheckHealth(string enemy)
{
    if(
GetHealth(enemy)) <= 0)
    {
       
//Make enemy dead
    
}

PHP Code: (Select All)
void DamageCollision(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
    {
        
AdjustHealth(enemy, -25);
    }




Sorry about being off-topic

Trying is the first step to success.
(This post was last modified: 04-24-2017, 08:10 PM by FlawlessHappiness.)
04-24-2017, 07:38 PM
Find


Messages In This Thread
RE: Amnesia - The UNKNOWN Descent Project - NEW THREAD - by FlawlessHappiness - 04-24-2017, 07:38 PM



Users browsing this thread: 1 Guest(s)