Difference between revisions of "Engine.SpawnPlayer"

From Tomb Raider Mod Launcher Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
== Function ==
+
== Overload 1 ==
  
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
function Engine.SpawnPlayer(player);
 
function Engine.SpawnPlayer(player);
function Engine.SpawnPlayer(player, room, x, y, z, rotation, startingHealth = 1000);
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Arguments ==
+
=== Arguments ===
  
 
* player
 
* player
 
** The player to spawn.
 
** The player to spawn.
  
== Optional Arguments ==
+
=== Description ===
  
 +
This way of spawning the player will maintain where the player currently is. It will however still have implications such as resetting of the inventory.
 +
 +
== Overload 2 ==
 +
 +
<syntaxhighlight lang="javascript">
 +
function Engine.SpawnPlayer(player, room, x, y, z, rotation = 0, startingHealth = 1000);
 +
</syntaxhighlight>
 +
 +
=== Arguments ===
 +
 +
* player
 +
** The player to spawn.
 
* room
 
* room
 
** The room index the player should spawn in.
 
** The room index the player should spawn in.
Line 21: Line 32:
 
* z
 
* z
 
** The z position to spawn at.
 
** The z position to spawn at.
 +
 +
=== Optional Arguments ===
 
* rotation
 
* rotation
 
** The rotation to spawn with.
 
** The rotation to spawn with.
 
* startingHealth
 
* startingHealth
 
** The starting health the player will spawn with, 1000 is full health.
 
** The starting health the player will spawn with, 1000 is full health.
 +
 +
=== Description ===
 +
 +
Using this overload will cause the player to be somewhere else. You can also set the rotation and starting health this way.
  
 
== Notes ==
 
== Notes ==
  
Calling Engine.SpawnPlayer with only the player will just respawn the player in the same position and rotation.
+
Calling Engine.SpawnPlayer with only the player will just respawn the player in the same place.
  
 
Calling Engine.SpawnPlayer <strong>will create a new player</strong> this means that your <strong>inventory will be reset</strong>.
 
Calling Engine.SpawnPlayer <strong>will create a new player</strong> this means that your <strong>inventory will be reset</strong>.

Latest revision as of 03:17, 9 August 2014

Overload 1

function Engine.SpawnPlayer(player);

Arguments

  • player
    • The player to spawn.

Description

This way of spawning the player will maintain where the player currently is. It will however still have implications such as resetting of the inventory.

Overload 2

function Engine.SpawnPlayer(player, room, x, y, z, rotation = 0, startingHealth = 1000);

Arguments

  • player
    • The player to spawn.
  • room
    • The room index the player should spawn in.
  • x
    • The x position to spawn at.
  • y
    • The y position to spawn at.
  • z
    • The z position to spawn at.

Optional Arguments

  • rotation
    • The rotation to spawn with.
  • startingHealth
    • The starting health the player will spawn with, 1000 is full health.

Description

Using this overload will cause the player to be somewhere else. You can also set the rotation and starting health this way.

Notes

Calling Engine.SpawnPlayer with only the player will just respawn the player in the same place.

Calling Engine.SpawnPlayer will create a new player this means that your inventory will be reset.