Time for action – Taking care of other function errors.
Let's take a look at some more function errors:
Say we had the following code:
simulated function PostBeginPlay() { `log("PostBeginPlay!"); } simulated function PostBeginPlay() { local int SomeInt; SomeInt = 5; `log("SomeInt is:" @ SomeInt); }
The code seems fine, but if we compile it we get:
[0003.86] Log: R:\UDK\UDK-AwesomeGame\Development\Src\BrokenGame\Classes\BrokenActor.uc(9) : Error, 'PostBeginPlay' conflicts with 'Function BrokenGame.BrokenActor:PostBeginPlay'
This one's easy to avoid. Classes can only have one function with any one name; trying to have more than one with the same name will give us an error.
This next one's a bit obscure, since
static
functions aren't used that much. Suppose we had this code:static function float GetRadius() { local float Radius, Height; GetBoundingCylinder(Radius, Height); return Radius; }
Trying to compile that would give us this error:
[0003.87] Log: R:\UDK\UDK-AwesomeGame...