CodingAnyone know Unreal script?

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Oscarvarium (OZGUR)  
 To:  ALL
32193.1 

I need to make my guys die but I don't know how... This is the code I have at the moment:

 

code: code:
//=========================================================//
// Eruption - Mutator deals periodic damage to all players //
//=========================================================//
class MutEruption extends Mutator;

#exec OBJ LOAD File=MutatorArt.utx

var() int EruptionDamage;
var() float DamageInterval;

event PreBeginPlay()
{
    SetTimer(DamageInterval,true);
}

function Timer()
{
    local Controller E;

    for (E = Level.ControllerList; E != None; E = E.NextController)
    {
        if (E.Pawn != None && E.Pawn.Health > 0 )
        {
            E.Pawn.Health = Min(E.Pawn.Health - (EruptionDamage + (Rand(20) - Rand(20))), E.Pawn.HealthMax);
            if (E.Pawn != None && E.Pawn.Health <= 0 )
            {
                E.Pawn.Died (None, None, ???); // PROBLEM!!!
            }
        }
    }
}

defaultproperties
{
    EruptionDamage=30.0
    DamageInterval=60.0
    GroupName="Erupt"
    FriendlyName="Eruption"
    Description="All players take random amounts of damage periodically."
}

 


The practical upshot of which is that everyone takes varying amounts of damage (around 30) every 60 seconds or so (it's actually something like 53 for some reason but that's unimportant).

The problem is that when their health drops to 0, they dont die, they just carry on with 0 health, then negative health. That 'PROBLEM!!!' line seems to be correct apart from the third parameter, the ???. It's usually just entered as 'vector HitLocation' which describes the direction the player got shot from so they can go flying in the opposite direction when they die but my guys aren't dying like that so I need to either make a vector up or tell it doesn't need one. I've tried 'None', '0', '1', '0.1', '0,0', '(0,0)' but it always tells me there's a type mismatch in parameter 3 on that line.

0/0
 Reply   Quote More 

 From:  Oscarvarium (OZGUR)  
 To:  Oscarvarium (OZGUR)     
32193.2 In reply to 32193.1 

Fookin' owned it.

 

code: code:
//=========================================================//
// Eruption - Mutator deals periodic damage to all players //
//=========================================================//
class MutEruption extends Mutator;

#exec OBJ LOAD File=MutatorArt.utx

var() int EruptionDamage;
var() float DamageInterval;

event PreBeginPlay()
{
    SetTimer(DamageInterval,true);
}

function Timer()
{
    local Controller E;

    for (E = Level.ControllerList; E != None; E = E.NextController)
    {
        if (E.Pawn != None && E.Pawn.Health > 0 )
        {
            E.Pawn.Health = Min(E.Pawn.Health - (EruptionDamage + (Rand(20) - Rand(20))), E.Pawn.HealthMax);
            if (E.Pawn != None && E.Pawn.Health <= 0 )
            {
                E.Pawn.Died (None, None, vect(0,0,0));
            }
        }
    }
}

defaultproperties
{
    EruptionDamage=30.0
    DamageInterval=60.0
    GroupName="Erupt"
    FriendlyName="Eruption"
    Description="All players take random amounts of damage periodically."
}

 

Fat lot of help you lot were. :P
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  Oscarvarium (OZGUR)     
32193.3 In reply to 32193.2 
Steady on with the language old bean.

"The Iraqi regime possesses biological and chemical weapons."

George W Bush, 28 Sept 2002

"I can say with certainty that the Quds Force, a part of the Iranian government, has provided these sophisticated I.E.D.s."

George W Bush, 14 Feb 2007

0/0
 Reply   Quote More 

 From:  Oscarvarium (OZGUR)  
 To:  Manthorp     
32193.4 In reply to 32193.3 
That has had been buggin me and one of my classmates for days and weeks. I are just so happy.
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  Oscarvarium (OZGUR)     
32193.5 In reply to 32193.4 
I've just finished my report on A Major Art Institution's fuckup for the Arts Council, so I haev teh happies too.

"The Iraqi regime possesses biological and chemical weapons."

George W Bush, 28 Sept 2002

"I can say with certainty that the Quds Force, a part of the Iranian government, has provided these sophisticated I.E.D.s."

George W Bush, 14 Feb 2007

0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Manthorp     
32193.6 In reply to 32193.5 
get you with the double standards :P

Jon
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  JonCooper     
32193.7 In reply to 32193.6 
Parental privilege.

"The Iraqi regime possesses biological and chemical weapons."

George W Bush, 28 Sept 2002

"I can say with certainty that the Quds Force, a part of the Iranian government, has provided these sophisticated I.E.D.s."

George W Bush, 14 Feb 2007

0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Manthorp     
32193.8 In reply to 32193.7 
hehe, I used that excuse myself this week :D

Jon
0/0
 Reply   Quote More 

Reply to All    
 

1–8

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats