A lot of Unrealscript source code ships with Unreal, and it's hard to know where to begin. This tutorial is to get you started and point out the major classes to extend, and methods to override. Its intended for programmers who already know one decent langauge like JavaScript, C++ or Java, to let them quickly locate key classes and methods and show how they fit together. The example centres round a simple level full of bubbles that keep continouosly spawning, with a a material, size and speed that varies per bubble.
The most central one is probably GameInfo. So, lets start there. GameInfo is the class that defines the Game rules and creates, tracks and destroys objects in the game world itself, and controls the game flow, as outlined on UDN
The very basic version of GameInfo needs to know only two things - the class which is used to implement the player Pawn and Controller. This is added in a defaultproperties section that usually comes after any code and is used to initialise variables at instance creation time. The PostLogin() is called by the engine after the player has been spawned and is meant to call StartMatch(), StartHumans(), RestartPlayer(), and SpawnDefaultPawnFor() in order to run the game. We override PostLogin() in our demo as we are implementing a demo and not a game, and do not want death and restart logic to apply to the player.
0 comments:
Post a Comment