Time for action - creating a spawn point

The CryENGINE acts out of the box, as you would expect the real world to act, with gravity and physics affecting the human player. For this reason, it is best to place the spawn points where the player can physically stand when they are started within the level:

  1. Open the level example_4 inside the Editor.exe application.
  2. In the RollupBar, select the Objects tab and click on Entity option.
  3. Open the Multiplayer folder in the Entity List window.
  4. Click-and-drag the SpawnPoint entity into the perspective viewport, and then release the mouse button.
  5. Finalize the initial placement by clicking on it again.
  6. Move the SpawnPoint entity to the location you wish to spawn the player.
  7. Note that the direction of the SpawnPoint entity helper icon represents the direction the player will face when spawned, as seen in the following screenshot:
    Time for action - creating a spawn point

    For this example, a suitable location to start our player is along the surface of the terrain. As you place the Spawn Point entity, you will want to test it, and this can be done by quickly running the test from within the editor.

  8. Click on the Switch to Game mode, and press F2 on the keyboard to instantly spawn at the SpawnPoint entity.
  9. Save the .cry file.
  10. Under the File menu, select the Export to Engine option.

    This will send a command to the CryENGINE application to package and compress the information within the level into an optimized format, which can be run from the launcher application. As a reminder, the launcher application should always be considered as the end user application, which means that our players will use this to play our game and its levels. See the Exporting to engine section of this chapter for further information on this process.

  11. For now, close the sandbox editor and open the launcher.exe application.
  12. Launch the example_4 map using the map's Console command or by selecting from the list of maps in the menu.

    Note that this first SpawnPoint entity will automatically function as the default spawn location for your map in the launcher application.

    Note

    You can quickly cycle between multiple spawn points in the editor and pure game by repeatedly pressing the F2 keyboard shortcut.

What just happened?

You have now created a SpawnPoint from where the player can begin his/her journey into your level.

Though we did not use multiple SpawnPoint objects in the previous example, it is important to realize that some level configurations may require multiple SpawnPoint objects. Using multiple SpawnPoint objects can be useful if you want to spawn two opposing teams of players in different locations, in multiplayer. However, when using multiple SpawnPoint objects in multiplayer, it is good practice to not place them in identical locations, as this will potentially pose a problem if two players are spawned concurrently.

Multiple SpawnPoint objects could even be used in single player mode, as checkpoint or save locations, to allow the player or designers to skip portions of the levels.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.247.196