Time for action – Mal-function
First, we'll take a look at what can go wrong in function declarations.
Let's add a new function to our class:
simulated function HitWall() { }
Compile the code and we'll get this error:
[0003.93] Log: R:\UDK\UDK-AwesomeGame\Development\Src\BrokenGame\Classes\BrokenActor.uc(4) : Error, Redefinition of 'function HitWall' differs from original; different number of parameters
If we look at
Actor.uc
we can see the original declaration of this function:event HitWall( vector HitNormal, actor Wall, PrimitiveComponent WallComp )
When overriding a function, you must use the same parameters as the original. You can change the names if you want, for instance this would work:
simulated function HitWall( vector Norm, actor HitActor, PrimitiveComponent Prim ) { }
The number and type of parameters must stay the same though.
This type of error usually results from misreading the parameters when overriding a function, or accidentally making up a function that already exists in a superclass...