Fire Damage Problem

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

GlassBoy

Nano-augmented Modder
Jan 6, 2004
169
0
0
I did a search for this on these forums, but nothing popped up related to my problem.

I've got a rocket launcher that launches incendiary rockets. It spawns flames in the area it hit for 2 seconds, which are supposed to do damage when players pass through them or stand too close to them. However, I'm pretty stumped as to how to do this. anyone know how to do it?

I thought about using a timer that calls the hurtradius function, it seems like the most logical way to do it. But the Incendiary rocket proj already has a timer that it inherits from RocketProj, which is active the whole time the rocket is live.

If i were to use a timer (if that is the best way), where would i use it?
 

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
Or make a state, try not to spawn any more objects than needed, as spawning is an expensive solution to things. Or try to incorporate your timers together, it all depends what the timer is doing. You are allowed to change Timer settings such as the interval between timers...
 

GlassBoy

Nano-augmented Modder
Jan 6, 2004
169
0
0
I suceeded with spawning an actor that repeatedly called hurtradius.

Is there better performance solution? I see that you mentioned a state. I'm not sure how I'd use a state to do what this actor is doing. Isn't a state server-side only code?

My code looks like this:

Code:
class RocketExplosionFlameHurt extends Actor;
var Float DamageAmount, DamageRadius, MomentumTransfer;
var class<DamageType> DamageTypeFlames;

Simulated function PostbeginPlay()
{
    Super.PostBeginPlay();
    SetTimer(0.1, true);
}

Simulated function Timer()
{
    HurtRadius(DamageAmount, DamageRadius, DamageTypeFlames, MomentumTransfer, Location);
    /*    Hurtradius sets this value to true every time it is called if it's false,
          and aborts if it's true, So it constantly needs to be reset to false.     */
    bHurtEntry = False;
}

DefaultProperties
{
    DamageAmount = 4.00
    DamageRadius = 280.00
    DamageTypeFlames = class'DamageTypeIncendiaryFlames'
    MomentumTransfer = 0.00

    LifeSpan = 2.3  // Lifespan needs to be slightly longer than the flames'.
    DrawType=DT_None
    bReplicateMovement=False
    bMovable=false
    bShadowCast = False
}
 
Last edited: