Sysval (TeaScript)

From PGE Wiki
Revision as of 19:10, 23 December 2019 by Yoshi021 (talk | contribs)
Jump to navigation Jump to search


sysval is a function in TeaScript that allows you to read and write system variables.

To read the value of a sysval use:

sysval(name)

This will return the value of the sysval used. Note that name is not case-sensitive.


When using a sysval that is writable use:

sysval(name) = value

...to change the value of the sysval.

R: Read Only

W: Write Only

R&W: Read and Write

Name Type Description
NCount R The number of NPC objects in the level
BCount R The number of block object in the level
BGOCount R The number of BGO objects in the level
WCount R The number of warp objects in the level
LCount R The number of liquid objects in the level
ECount R The number of effect objects in the level
ActNCount R The number of active NPC objects in the screen
ActBCount R The number of active block objects in the screen
ScrSplitstyle R&W The status of the camera's split mainly used for 2 player mode
  • 0: The camera is not split or 1 player mode is on
  • 1: Player 1 is on the top and player 2 is on the bottom
  • 2: Player 1 is on the bottom and player 2 is on the top
  • 3: Player 1 is on the left and player 2 is on the right
  • 4: Player 1 is on the right and player 2 is on the left
Player1scrX R The camera's top left X-scene coordinate of player 1
Player1scrY R The camera's top left Y-scene coordinate of player 1
Player2scrX R The camera's top left X-scene coordinate of player 2
Player2scrY R The camera's top left Y-scene coordinate of player 2
GameMode R The current game mode
  • 0: 1 player mode
  • 1: 2 player mode
  • 2: Battle mode
lvltimer R&W The current number in the level timer
Playerhealth R&W The current number of 1-Ups collected
CoinCount R&W The current number of coins collected
Score R&W The current score
BPlayer1Health R&W The current number of 1-ups for player 1 in battle mode
BPlayer2Health R&W The current number of 1-ups for player 2 in battle mode
Starcoincount R The current number of collected star coins
WldInvCount R The current number of items in the world map inventory
Coinsforextralife W The limit of coins the player can store
EnableLighting W To change the light system
  • -1: Turn light system on
  • 0: Turn light system off
Enablepause W To change the player's ability to pause
  • 0: Enable ability to pause
  • -1: Disable ability to pause
Showhud W To hide the hud
  • -1: Show hud
  • 0: Hide hud
fluddrestorespeed R How fast FLUDD's restore speed is
playerbasestatus R The starting status of the player given after losing a life.
grabshellinsmb3way R Stands for if the player is able to grab shells while falling on one. (Does not work in 1.4.5, possible bug)
GameTime R The current amount of frames the level has been playing
Second R The current amount of seconds on the user's computer
Minute R The current amount of minutes on the user's computer
Hour R The current hour on the user's computer. It uses a 24-hour system
Day R The current day on the user's computer
Month R The current month on the user's computer
Year R The current year on the user's computer
disableshelldash W To disable the shell dash ability using the rainbow shell
  • -1: Disable
  • 0: Enable
disablehammershield W To disable ability to the protection from fireballs while crouching with the hammer suit
  • -1: Disable
  • 0: Enable
disablelinkshield W To disable Link's shield ability
  • -1: Disable
  • 0: Enable
disablelinksword W To disable Link's sword ability (Sword animations still play)
  • -1: Disable
  • 0: Enable
disablejump W To disable the jump ability
  • -1: Disable the player's ability to jump
  • 0: Enable the player's ability to jump
disablespinjump W To disable the spin jump ability
  • -1: Disable
  • 0: Enable
disableduck W Stands for if the player is allowed to crouch or not. (NOTE: Penguin Sliding is buggy, and Link's downward stab will not work if enabled.)


To disable the duck ability

  • -1: Disable
  • 0: Enable
Disablesave W To change the player's ability to save.
  • 0: Enable the player's ability to save.
  • -1: Disable the player's ability to save.
Param1 R&W The first parameter transmitted when called
Param2 R&W The second parameter transmitted when called
Param3 R&W The third parameter transmitted when called