# Unter Help = With Grenade

**URL:** <https://forum.lowcaliber.com/t/unter-help-with-grenade/1398>\
**Category:** Work in Progress\
**Created:** [October 11, 2003, 3:55pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398 "2003-10-11T15:55:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReaperCreeper](https://forum.lowcaliber.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@ReaperCreeper](https://forum.lowcaliber.com/u/ReaperCreeper)\
**Post date:** [October 11, 2003, 3:55pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/1 "2003-10-11T15:55:23Z")

</div>

unter im in the process of making a grenade well its already done but im wondering if u can tell me what im doing wrong it doesnt wanna summon in rune.I also just want it to be summoned.

[grenade.zip](https://forum.lowcaliber.com/uploads/short-url/9mXli7rUGUI952RhpIFB4mAs9BX.zip) (30.1 KB)

Original thread: [https://lowcaliber.com/eve/forums/a/tpc/f/3886011002/m/4996026054](https://lowcaliber.com/eve/forums/a/tpc/f/3886011002/m/4996026054)

---

<div class="post-metadata">

**Author:** ![WoOdY](https://forum.lowcaliber.com/user_avatar/forum.lowcaliber.com/woody/32/49_2.png) [@WoOdY](https://forum.lowcaliber.com/u/WoOdY)\
**Post date:** [October 11, 2003, 4:24pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/2 "2003-10-11T16:24:14Z")

</div>

ok i got a great grenade mod ill look for it when i find it ill give it to you.

---

<div class="post-metadata">

**Author:** ![ReaperCreeper](https://forum.lowcaliber.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@ReaperCreeper](https://forum.lowcaliber.com/u/ReaperCreeper)\
**Post date:** [October 11, 2003, 4:42pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/3 "2003-10-11T16:42:11Z")

</div>

thanks woody but i dont want a mod, i wanna get mine working.

---

<div class="post-metadata">

**Author:** ![WoOdY](https://forum.lowcaliber.com/user_avatar/forum.lowcaliber.com/woody/32/49_2.png) [@WoOdY](https://forum.lowcaliber.com/u/WoOdY)\
**Post date:** [October 12, 2003, 2:30am UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/4 "2003-10-12T02:30:34Z")

</div>

k  
i think i know what u need to summon them give me till tomorow

---

<div class="post-metadata">

**Author:** ![ReaperCreeper](https://forum.lowcaliber.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@ReaperCreeper](https://forum.lowcaliber.com/u/ReaperCreeper)\
**Post date:** [October 12, 2003, 1:51pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/5 "2003-10-12T13:51:43Z")

</div>

thanks woody :lcc_up: :lcc_beer:

---

<div class="post-metadata">

**Author:** ![Unter\_den\_Uebrigen](https://forum.lowcaliber.com/user_avatar/forum.lowcaliber.com/unter_den_uebrigen/32/40_2.png) [@Unter\_den\_Uebrigen](https://forum.lowcaliber.com/u/Unter_den_Uebrigen)\
**Post date:** [October 12, 2003, 4:58pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/6 "2003-10-12T16:58:17Z")

</div>

Sup Reap,

Do you mind posting the code uncompressed, preferably in text?

---

<div class="post-metadata">

**Author:** ![ReaperCreeper](https://forum.lowcaliber.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@ReaperCreeper](https://forum.lowcaliber.com/u/ReaperCreeper)\
**Post date:** [October 12, 2003, 5:21pm UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/7 "2003-10-12T17:21:35Z")

</div>

// Grenade.  
//  
// RunePower or fire damage sets it alight. Once lit, there’s a five second fuse.  
// 1% chance for a grenade that explodes instantly when lit.  
// 1% chance for a grenade with halved fuse length.  
// 1% chance for a grenade with doubled fuse length.  
// 3% chance for a grenade that does not explode.  
//=============================================================================  
class Grenade expands NonStow;

var() bool bFuseLit;  
var() float TimeToBlow;  
var() sound ExplodeSound;  
var() int GrenMomentum;  
var float FuseTimer;

var() enum EGrenadeType  
{  
GNormal,  
GDud,  
GLongFuse,  
GShortFuse,  
GNoFuse  
} GrenadeType;

Function PostBeginPlay()  
{  
local int i;

bCanBePoweredUp = True;

i = Rand(100);  
if (i == 0)  
GrenadeType = GNoFuse;  
if (i == 1)  
GrenadeType = GShortFuse;  
if (i == 2)  
GrenadeType = GLongFuse;  
if (i \> 2 && i \< 6)  
GrenadeType = GDud;

Super.PostBeginPlay();  
}

function PowerupInit()  
{  
SetOnFire(Pawn(Owner),0);  
}

event bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)  
{  
if (DamageType == ‘fire’)  
SetOnFire(EventInstigator,joint);

return Super.JointDamaged(Damage,EventInstigator,HitLoc,Momentum,DamageType,joint);  
}

function ZoneChange(ZoneInfo newZone)  
{  
local int i;

if(newZone.bWaterZone)  
{  
for (i=0; i\<16; i++)  
SkelGroupSkins[i] = Default.SkelGroupSkins[i]; // Force the weapon to use the default skin  
SetDefaultPolygroups();  
if (bPoweredUp)  
PowerupEnd();  
}

// Since there is no ‘LavaZone’ I get to use a cheap hack.  
if (newZone.DamagePerSec \> 0)  
SetOnFire(None,0);  
}

// Light this sucker.  
function SetOnFire(Pawn EventInstigator, int joint)  
{  
local PawnFire F;

if (!bFuseLit)  
{  
bFuseLit = True;

Switch(GrenadeType)  
{  
case GNoFuse:  
TimeToBlow = 0;  
break;  
case GShortFuse:  
TimeToBlow \*= 0.5;  
break;  
case GLongfuse:  
TimeToBlow \*= 2;  
break;  
case GDud:  
bFuseLit = False;  
FuseTimer = 0;  
break;  
default:  
break;  
}  
}  
}

Simulated Function Tick(Float DeltaTime)  
{  
if (bFuseLit && !IsInState(‘Sleeping’))  
{  
FuseTimer += DeltaTime;  
if (FuseTimer \>= TimeToBlow)  
{  
// Explosion Code.  
Spawn(class’GrenadeBlastRadius’,Self,Location,RotRand(True));  
Spawn(class’GrenadeBlastRadius’,Self,Location,RotRand(True));  
HurtRadiusAll(0,320,‘sever’,GrenMomentum/2,Location);  
HurtRadiusLimbs(120,320,‘sever’,0,Location);  
HurtRadiusAll(45,320,‘sever’,0,Location);  
HurtRadiusAll(0,320,‘sever’,GrenMomentum/2,Location);  
// DoRadiusEffect();  
PowerupEndingPulseOn();  
if (Level.Game.ShouldRespawn(self))  
{  
FuseTimer = 0.0;  
bFuseLit = False;  
GoToState(‘Sleeping’);  
}  
else  
Destroy();  
}  
}

Super.Tick(DeltaTime);  
}

function PowerupEndingPulseOn()  
{  
PlaySound(ExplodeSound,SLOT\_Talk,255,True,3200,0.85 + FRand()\*0.3);  
}

//  
// Hurt actors within the radius.  
//  
final function HurtRadiusAll( float DamageAmount, float DamageRadius, name DamageType, float Momentum, vector HitLocation )  
{  
local actor Victim;  
local float damageScale, dist;  
local vector dir;  
local int bp;  
local bool bHadLimb;

foreach VisibleCollidingActors( class ‘Actor’, Victim, DamageRadius, HitLocation )  
{  
if( Victim != self)  
{  
dir = Victim.Location - HitLocation;  
dist = FMax(1,VSize(dir));  
dir = dir/dist;  
damageScale = 1 - FMax(0,(dist - Victim.CollisionRadius)/DamageRadius);

if (Victim.Skeletal != None && Victim.DrawType == DT\_SkeletalMesh)  
bp = Victim.BodyPartForJoint(Victim.ClosestJointTo(HitLocation));  
else  
bp = 0;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);

Victim.AddVelocity(damageScale \* Momentum \* dir);

if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}

Victim.JointDamaged(damageScale \* DamageAmount,  
Instigator,  
Victim.Location - 0.5 \* (Victim.CollisionHeight + Victim.CollisionRadius) \* dir,  
(damageScale \* Momentum \* dir),  
DamageType,  
\0);  
}  
}  
}

//  
// Hurt actors within the radius.  
// This deals the damage once to each of their limbs, so it deals triple damage.  
//  
// This function assumes that all Pawns have skeletal meshes.  
final function HurtRadiusLimbs( float DamageAmount, float DamageRadius, name DamageType, float Momentum, vector HitLocation )  
{  
local actor Victim;  
local float damageScale, dist;  
local vector dir;  
local int bp;  
local bool bHadLimb;

foreach VisibleCollidingActors( class ‘Actor’, Victim, DamageRadius, HitLocation )  
{  
if( Victim != self)  
{  
dir = Victim.Location - HitLocation;  
dist = FMax(1,VSize(dir));  
dir = dir/dist;  
damageScale = 1 - FMax(0,(dist - Victim.CollisionRadius)/DamageRadius);

bp = BODYPART\_LARM1;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}

bp = BODYPART\_RARM1;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}

bp = BODYPART\_HEAD;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}

}

Victim.JointDamaged(damageScale \* DamageAmount,  
Instigator,  
Victim.Location - 0.5 \* (Victim.CollisionHeight + Victim.CollisionRadius) \* dir,  
(damageScale \* Momentum \* dir),  
DamageType,  
\0);  
Victim.JointDamaged(damageScale \* DamageAmount,  
Instigator,  
Victim.Location - 0.5 \* (Victim.CollisionHeight + Victim.CollisionRadius) \* dir,  
(damageScale \* Momentum \* dir),  
DamageType,  
\0);  
Victim.JointDamaged(damageScale \* DamageAmount,  
Instigator,  
Victim.Location - 0.5 \* (Victim.CollisionHeight + Victim.CollisionRadius) \* dir,  
(damageScale \* Momentum \* dir),  
DamageType,  
\0);  
}  
}  
}

function DoRadiusEffect()  
{  
local actor A;  
local int i;  
local bool bCollisionJoints;  
local float dist,damageScale;  
local vector dir;

foreach VisibleCollidingActors(class’actor’, A, 320, Location)  
{  
if (A != None && A != self && !A.bHidden  
&& (A.IsA(‘Carcass’) || A.IsA(‘Pawn’)))  
{  
if (A.IsA(‘Carcass’))  
{  
dir = A.Location - Location;  
dist = FMax(1,VSize(dir));  
dir = dir/dist;  
damageScale = 1 - FMax(0,(dist - A.CollisionRadius)/320);

A.AddVelocity(damageScale \* GrenMomentum \* dir);  
}  
if (A.IsA(‘Pawn’))  
{  
// Set on fire  
Pawn(A).PowerupBlaze(Pawn(Owner));

// Do some damage  
A.JointDamaged(5, Pawn(Owner), A.Location, Normal(A.Location-Location)\*50, ‘fire’, 0);  
}  
}  
}  
}  
­= \>0 ’ .‚›% 9 z//=============================================================================  
// GrenadeBlastRadius.  
//=============================================================================  
class GrenadeBlastRadius expands BlastRadius;

simulated function Spawned()  
{  
TimePassed=0.0;  
ScaleGlow = EffectTime;  
} € á S1//=============================================================================  
// FubarGrenade.  
//=============================================================================  
class FubarGrenade expands Grenade;

Simulated Function Tick(Float DeltaTime)  
{  
if (bFuseLit && !IsInState(‘Sleeping’))  
{  
FuseTimer += DeltaTime;  
if (FuseTimer \>= TimeToBlow)  
{  
// Explosion Code.  
Spawn(class’GrenadeBlastRadius’,Self,Location,RotRand(True));  
Spawn(class’GrenadeBlastRadius’,Self,Location,RotRand(True));  
HurtRadiusLimbsNoDmg(120,320,‘sever’,0,Location);  
HurtRadiusAll(0,320,‘sever’,GrenMomentum,Location);  
// DoRadiusEffect();  
PowerupEndingPulseOn();  
if (Level.Game.ShouldRespawn(self))  
{  
FuseTimer = 0.0;  
bFuseLit = False;  
GoToState(‘Sleeping’);  
}  
else  
Destroy();  
}  
}

Super(NonStow).Tick(DeltaTime);  
}

//  
// Hurt actors within the radius.  
// This deals damage to limbs, but not to health.  
//  
final function HurtRadiusLimbsNoDmg( float DamageAmount, float DamageRadius, name DamageType, float Momentum, vector HitLocation )  
{  
local actor Victim;  
local float damageScale, dist;  
local vector dir;  
local int bp;  
local bool bHadLimb;

foreach VisibleCollidingActors( class ‘Actor’, Victim, DamageRadius, HitLocation )  
{  
if( Victim != self)  
{  
dir = Victim.Location - HitLocation;  
dist = FMax(1,VSize(dir));  
dir = dir/dist;  
damageScale = 1 - FMax(0,(dist - Victim.CollisionRadius)/DamageRadius);

bp = BODYPART\_LARM1;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}

bp = BODYPART\_RARM1;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}

bp = BODYPART\_HEAD;

if (Pawn(Victim) != None && Pawn(Victim).BodyPartSeverable(bp))  
bHadLimb = (Pawn(Victim).BodyPartHealth[bp] \> 0);  
if (Pawn(Victim) != None && bHadLimb && Pawn(Victim).BodyPartSeverable(bp))  
{  
Pawn(Victim).BodyPartHealth[bp] -= damageScale \* DamageAmount;  
if (Pawn(Victim).BodyPartHealth[bp] \< 1)  
{  
Pawn(Victim).BodyPartVisibility(bp, false);  
Pawn(Victim).BodyPartCollision(bp, false);  
Pawn(Victim).LimbSevered(bp, (damageScale \* Momentum \* dir));  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Unter\_den\_Uebrigen](https://forum.lowcaliber.com/user_avatar/forum.lowcaliber.com/unter_den_uebrigen/32/40_2.png) [@Unter\_den\_Uebrigen](https://forum.lowcaliber.com/u/Unter_den_Uebrigen)\
**Post date:** [October 13, 2003, 12:04am UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/8 "2003-10-13T00:04:47Z")

</div>

The problem doesn’t look like it’s in the code itself; did you add “grenade” to your list of serverpackages in rune.ini?

---

<div class="post-metadata">

**Author:** ![ReaperCreeper](https://forum.lowcaliber.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@ReaperCreeper](https://forum.lowcaliber.com/u/ReaperCreeper)\
**Post date:** [October 13, 2003, 12:23am UTC](https://forum.lowcaliber.com/t/unter-help-with-grenade/1398/9 "2003-10-13T00:23:30Z")

</div>

yeah, it might be something wrong with my rune can any of u lcc members or who ever wants, to give it a try in ur server, and let me know what happenes thanks
