Tired of always going through the main menu scene to test your game? You can use the Game Starter to quickly test your game in the scene you’re currently working.
To get this going, we need three things:
- a Game Event used as start event (i.e. adding and spawning the player)
- a Spawn Point in the scene
- a Game Starter in the scene
But let’s get into details.
Start event and spawn point
A start event is a Game Event that adds a combatant to the player group and spawns it in the scene. You most likely already have a start event for your game. If not, you can create an event in the ORK Framework editor in the Events section. The event should consists at least of two event steps:
- Active Group Steps > Join Active Group
This event step adds a combatant to the active player group.
The active player group is the group currently controlled by the player.
- Spawn Steps > Spawn Player
This event step spawns the player (i.e. the combatant added previously) at the position of a spawn point.
The spawn point is identified by the Spawn Point ID.
Naturally, you can also add other steps, like adding more combatants to the player group or adding additional items to the inventory.
Once you have your start event, we’ll set it up as the game’s start event in Menus > Main Menu. This way, the event will automatically be used when starting a new game, we don’t need to set it up in every scene where we need it for our test. Simply select your event in the Start Event field.
Now, all the event needs to work is a Spawn Point with a matching Spawn Point ID. You can learn more about spawn points in this how-to.
The game starter is needed to initialize ORK correctly. You can learn more about the game starter in this how-to.
Beside initializing the game and optionally calling the main menu, the game starter can also start a new game in scene. You only need to enable Start Game in the game starter’s inspector. And don’t worry about having a game starter in every scene – it won’t do any harm.
And that’s it – to test your game in every scene you like, all you need to do is add a game starter (with Start Game enabled) and a spawn point with a matching Spawn Point ID.