Time for action – Component compiler error
The problem happens when we declare a Component that has already been created in our parent class. To see it we'll create a new class with a Component:
Create a new file in
Development/Src/AwesomeGame/Classes
calledAwesomeInfo.uc
.Open
AwesomeInfo.uc
in ConTEXT and write the following code in it:class AwesomeInfo extends Info placeable; defaultproperties { Begin Object Class=SpriteComponent Name=Sprite Sprite=Texture2D'EditorResources.S_Keypoint' HiddenGame=true End Object Components.Add(Sprite) }
Compile the code and we'll get the following error:
[0004.20] Log: R:\UDK\UDK-AwesomeGame\Development\Src\AwesomeGame\Classes\AwesomeInfo.uc(6) : Error, BEGIN OBJECT: The component name Sprite is already used (if you want to override the component, don't specify a class): Begin Object Class=SpriteComponent Name=Sprite
This error is telling us that the name
Sprite
is already being used by a Component, and if we take a look atAwesomeInfo...