Time for action – Breaking the class itself
Another common mistake is a class name mismatch. Let's take a look.
At the top of our class, let's change the class declaration:
class Borked extends Actor placeable;
Now try to compile the code. We'll get this in the log:
[0004.13] Log: R:\UDK\UDK-AwesomeGame\Binaries\..\Development\Src\BrokenGame\Classes\BrokenActor.uc : Error, Script vs. class name mismatch (BrokenActor/Borked)
What just happened?
The names of the classes in each file must match the file name. In our case, since the file is called BrokenActor.uc
, the class must be declared as BrokenActor
. Let's change it back:
class BrokenActor extends Actor placeable;
It's a minor error, but you may encounter it from time to time. It's easy to forget to rename a class if you've copied it from another of your projects, for example.
Another common error that breaks the class file itself is saving the text file in the wrong format. If you ever encounter an error such as this:
[0004.03] Log: R...