- Create A class and Named it what ever you want. and Inherit it from the Actor
- After that add "placeable" key word so it will be placeable in our level. (You can drag and drop it to your map)
Inside that function type `log("Hello World")
'log( ) Function is outputs what ever string passed as parameter, to the function into the log file.
You can find the log files in UDK installation directory UDKGame\Logs. You will see lots of 2 log files and bunch of backups depending on how many times you launch games. open "Launch.log" and Find our "Hello World" string.
(If you open it up in the notepad you can search the string by pressing ctrl+f )
Compile The code.
Open Up the UDK and Find our Class. It called HelloWorld. Drag and Drop the Class into our editor. and Run the Game.
You Should Find the HelloWorld String In the log files.
Final Code:
//Create a class and inherit it by the base class called Actor.
class HelloWorld extends Actor
//Add placeable key word so it can be placeable in the level
placeable;
//Then create PostBeginPlay function and inside it call `log function and pass "Hello World" as string
function PostBeginPlay()
{
`log("Hello World!");
}
//Default property block is something like a constructor method if you comes from a OOP language such as java or c++
//But inside it, only you can is initialize values
//In this Case nothing is Initialezed
defaultproperties
{
}
Any Question? Comment Me.
Thank You!
No comments:
Post a Comment