MethodsGame.Player:Create (index)
Gets the player corresponding to the index number.
Index starts at 1.
Parameters:
index: (int)
Returns:
(Players or nil) Nil if invalid index
Game.Player:Respawn()
The player is respawned.
Game.Player:Kill()
The player dies.
Game.Player:Win (exit)
Player win.
If there is no exit argument, the game ends after the victory.
Parameters:
exit: (optonal bool) Game end after victory
Game.Player:ShowBuymenu()
Shows your favorite weapon purchases.
Game.Player:RemoveWeapon()
Removes all player weapons.
Game.Player:SetGameSave (name, value)
Add a value to store in the group.
This data is stored separately for each player and shared between the same groups.
See the help for details.
Parameters
name: (string)
value: (number, string or bool)
Game.Player:GetGameSave (name)
Gets the value stored in the group.
This data is stored separately for each player and shared between the same groups.
See the help for details. If name is missing, returns nil.
Parameters:
name: (string)
Returns
(number,string,bool or nil) Stored value
Game.Player:SetFirstPersonView()
Changes the player's camera to first-person view.
Game.Player:SetThirdPersonView (minDist, maxDist)
Changes the player's camera to third person view.
Parameters:
minDist: (number) Minimum distance of camera
maxDist: (number) Maximum distance of the camera
Game.Player:SetThirdPersonFixedView (yaw, pitch, minDist, maxDist)
Change the player's camera to third-person view and lock the angle.
The mouse pointer is shown and the user input method is changed to the method using the mouse pointer raycast.
See Player.SetThirdPersonFixedPlane for the raycast calculation.
[Use] and [Acquire] motions are changed from the existing camera viewpoint based on the player position.
Weapons using zoom will raise the camera without foving.
Among the weapons that fire grenades like the M32, weapons whose gravity is applied to the grenade will change their aiming methods.
Parameters:
yaw: (number)
pitch: (number)
minDist: (number)
maxDist: (number)
Game.Player:SetThirdPersonFixedPlane (plane)
Modify how the mouse pointer calculates the raycast in the ThirdPersonFixedView state.
It will not work if it is not ThirdPersonFixedView.
For example, if you set it to XY plane, it will raycast the plane corresponding to the player's Z among the planes parallel to the XY plane and set the collision point as the reference point.
The player character always looks at the base point and fires in the direction of the base point when firing a gun.
GROUND and XY planes are suitable for the top view game genre, while XZ and YZ planes are suitable for the front view game genre.
Parameters:
plane: (Game.THIRDPERSON_FIXED_PLANE) The plane on which the raycast calculation is based
Game.Player:ShowWeaponInven()
Shows the weapon inventory.
Game.Player:ToggleWeaponInven()
Toggles the weapon inventory.
Game.Player:Signal (signal)
Send a random signal to the player.
Upon receiving a signal, the UI.Event.OnSignal event is raised.
Parameters:
signal: (int) Any integer value
Game.Player:SetLevelUI (level, expRate)
Displays and modifies the level / experience UI on the player's screen.
Parameters:
level: (int) Player level
expRate: (number) Length ratio of experience bar. It can be set from 0.0 to 1.0.
Game.Player:SetBuymenuLockedUI (weaponid, uiLocked, level)
Sets the lock mark for each weapon item in the shop window.
Parameters
weaponid: (Common.WEAPON) Weapon id to lock
uiLocked: (bool) Set the lock to true if true and clear it to false.
level: (optional int) Displays level text with a lock. If you omit the value, it is not displayed.
Game.Player:SetWeaponInvenLockedUI (weapon, uiLocked, level)
Set a lock mark for each weapon item in the weapon inventory window.
It should be set to Common.UseWeaponInven.
Parameters:
weaponid: (Common.WEAPON) Weapon id to lock
uiLocked: (bool) Set the lock to true if true and clear it to false.
level: (optional int) Displays level text with a lock. If you omit the value, it is not displayed.
Game.Player:GetPrimaryWeapon()
Take the main weapon that the player is currently holding.
Nil is returned if you are not holding the main weapon, have not used the Game.Weapon class, or are not included in the script weapon list.
Returns:
(Game.Weapon or nil)
Game.Player:GetSecondaryWeapon()
Get the secondary weapon the player is currently holding.
Nil is returned if you are not holding a secondary weapon, have not used the Game.Weapon class, or are not included in the script weapon list.
Returns:
(Game.Weapon or nil)
Game.Player:GetWeaponInvenList()
Gets a list of weapons the player currently has in the weapons inventory.
It should be set to Common.UseWeaponInven. Weapons in hands are not included. The resulting table contains Game.Weapons.
Returns:
(table) weaponList