I have 2 classes:
class PRN_Projectile expands projectile
class PRN_Chunk expands PRN_projectile;
for some reason the function hitwall() is not called in the 'prn_chunk'
instead the function is called in its parent class
why is this?
there is no super.hitwall() in prn_chunk
function not called in subclass
Re: function not called in subclass
- What is your code?
- How have you proved it is not getting called?
- Are you testing in a standalone game, or in a client/server setting?
- How have you proved it is not getting called?
- Are you testing in a standalone game, or in a client/server setting?
-
- Godlike
- Posts: 3774
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: function not called in subclass
Do you understand the difference between a simulated function and a non-simulated one? It makes all the difference in the world when it comes to child classes:
//=============================================================================
// Projectile.
//
// A delayed-hit projectile moves around for some time after it is created.
// An instant-hit projectile acts immediately.
//=============================================================================
class Projectile extends Actor
abstract
native;
<SNIP>
simulated function HitWall (vector HitNormal, actor Wall)
{
if ( Role == ROLE_Authority )
{
if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');
MakeNoise(1.0);
}
Explode(Location + ExploWallOut * HitNormal, HitNormal);
if ( (ExplosionDecal != None) && (Level.NetMode != NM_DedicatedServer) )
Spawn(ExplosionDecal,self,,Location, rotator(HitNormal));
}
So long, and thanks for all the fish
Re: function not called in subclass
as far as I know , simulated function is called client side aswell as server side.
I didnt know that child classes are called different in simulated functions.
I didnt know that child classes are called different in simulated functions.