sysval (TeaScript)

From PGE Wiki
Revision as of 01:12, 16 September 2019 by Executor-the-bat (talk | contribs) (Player Lives in Battle mode can now be written to as of 1.4.5.)
Jump to navigation Jump to search



sysval is a function in TeaScript.vbs 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 writeable use:

sysval(name) = value

...to change the value of the sysval.

Name Description
NCount Read Only

The number of NPCs in the level.

BCount Read Only

The number of blocks in the level.

BGOCount Read Only

The number of background objects in the level.

WCount Read Only

The number of warps in the level.

LCount Read Only

The number of liquids in the level.

ECount Read Only

The number of warps in the level.

ActNCount Read Only

The number of NPCs in the screen.

ActBCount Read Only

The number of blocks in the screen.

Disablejump Write Only

To change the player's ability to jump.

0: Enable the player's ability to jump.

1: Disable the player's ability to jump.

Disablespinjump Write Only

To disable the spin jump ability.

0: Enable Spinjump.

1: Disable Spinjump.

ScrSplitstyle Read Only

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 Read Only

The camera's top left X-scene coordinate of player 1.

Player1scrY Read Only

The camera's top left Y-scene coordinate of player 1.

Player2scrX Read Only

The camera's top left X-scene coordinate of player 2.

Player2scrY Read Only

The camera's top left Y-scene coordinate of player 2.

GameMode Read Only

The current game mode.

0: 1 player mode.

1: 2 player mode.

2: Battle mode.

lvltimer Read and Write

The current number in the level timer.

Playerhealth Read and Write

The current number of 1-Ups collected.

CoinCount Read and Write

The current number of coins collected.

Score Read and Write

The current score.

StarCount Read Only

The current number of collected stars.

Starcoincount Read Only

The current number of collected star coins.

WldInvCount Read Only

The current number of items in the world map inventory.

Coinsforextralife Write Only

The limit of coins the player can store.

BPlayer1Health Read Only (Read and Write in 1.4.5)

The current number of 1-ups for player 1 in battle mode.

BPlayer2Health Read Only (Read and Write in 1.4.5)

The current number of 1-ups for player 2 in battle mode.

EnableLighting Write Only

To change the light system.

0: Turn off the light system.

1: Turn on the light system.

Disablesave Write Only

To change the player's ability to save.

0: Enable the player's ability to save.

1: Disable the player's ability to save.

Enablepause Write Only

To change the player's ability to pause.

0: Enable the player's ability to pause.

1: Disable the player's ability to pause.

Showhud Write Only

To hide the hud.

0: Hide hud.

1: Show hud.

Param1 Read and Write

The first parameter transmitted when called.

Param2 Read and Write

The second parameter transmitted when called.

Param3 Read and Write

The third parameter transmitted when called.

GameTime Read Only

The current amount of frames the level has been playing.

Second Read Only

The current amount of seconds on the user's computer.

Minute Read Only

The current amount of minutes on the user's computer.

Hour Read Only

The current hour on the user's computer. It uses a 24-hour system.

Day Read Only

The current day on the user's computer.

Month Read Only

The current month on the user's computer.

Year Read Only

The current year on the user's computer.