Char (TeaScript)

From PGE Wiki
Jump to navigation Jump to search

Char is a class in TeaScript.vbs that allows you to read/write values for the player.

To read the value of Char use:

Char(id).name

id stands for the player (1: player 1; 2: player 2). If the ID is higher than 2, then it will stand for one of the clone characters spawned when using a clone cheat. Note: the name is not case sensitive.


To change the value of Char use:

Char(id).name = value
Name Type Description
X R&W The X-scene coordinate of the player.
Y R&W The Y-scene coordinate of the player.
Xsp R&W The X-speed of the player.
Ysp R&W The Y-speed of the player.
id R&W The current character

0: Mario

1: Luigi

2: Peach

3: Toad

4: Link

Status R&W The current power-up of the player.

1: Small

2: Mushroom

3: Fire Flower

4: Leaf

5: Tanooki Suit

6: Hammer Suit

7: Ice Flower

8: Frog Suit

9: Blue Shell

10: Propeller Suit

11: Mini Mushroom

12: Penguin Suit

ItemSlot R&W

The current mount or transformation of the player.

0: None

-150: Fairy

-20: Coin Box

-19: Cannon Box

-18: Propeller Box

-17: Spiny Helmet

-16: Goomba Hat

-15: Buzzy Helmet

-14: Invisible mask

-13: Rocket F.L.U.D.D.

-12: Turbo F.L.U.D.D.

-11: Hover F.L.U.D.D.

-10: Makes the player invisible

-9: Makes the player invisible

-8: Makes the player invisible

-7: Makes the player invisible

-6: Makes the player invisible

-5: Mega Mushroom

-4: Clown Car

-3: Lakitu's Shoe

-2: Fire's Shoe

-1: Kuribo's Shoe

1: Green Yoshi

2: Blue Yoshi

3: Yellow Yoshi

4: Red Yoshi

5: Black Yoshi

6: Purple Yoshi

7: Pink Yoshi

8: Cyan Yoshi

Setting an invalid number can crash the game.

ItemRsrv R&W This is the value of the NPC ID in the player's reserve box. Use 0 to empty the reserve box. Unused with Toad, Peach, and Link. Setting an invalid ID crashed the game.
InvTime R&W The invincibility timer for a star. When the value is larger than 0, it decreases by one every frame, until it reaches 0. The timer will not move if set to a negative number. Note: collecting an invincibility star sets this value to 800.
HitPoint R&W The amount of hearts the player has. Only used with Toad, Peach, and Link. Note: if you set the amount of hearts more than 3 or less than 0, the game will still remember that value, and setting this less than 0 does not kill the player.
Facing R&W The side the player is facing. 1: Left; 0: Right. Note: can be temporarily overridden using a spin jump.
Bombcnt R&W The number of bombs the player has primarily used in Link. Can be used to force the counter to show up for the other players, but only Link can use the bombs. If set to a negative number, the game will save that number and the player needs to collect more bombs until it reaches 0.
Keycnt R&W The number of keys the player currently has as Link. If set to a negative number, the player can't collect keys anymore.
Fluddcap R&W The total amount of liquid F.L.U.D.D. has. Max is 1001 and minimum is 1. If set to anything less than 0, it is automatically sets to 0. If set to anything larger than 1000, it caps at 10000. 500 units are used per max F.L.U.D.D. use.
Brightness R&W The radius of light made when using sysval(EnableLighting). The unit is in pixels. Making this value 0, or a negative number will cause the player to not emit light.
PWidth R&W The width of the player's hitbox.
PHeight R&W The height of the player's hitbox.
Flytime R&W The flight timer for raccoon leaf and tanooki suit. This value is always forced to a high value if a P-Wing was used before entering the stage.
Ynpcid R&W Stands for the ID of the NPC that Yoshi has in its mouth.
Sjumping R Determines whether the player is spin jumping or not. 1 is yes, 0 is no.
grabbing R The NPC ID the player is holding.
walljumptimer R Determines whether the player is sliding against a wall if wall jumping is enabled.
icetimer R The timer that determines how long the player is frozen for.
pulling R Determines wether the player is grabbing an NPC from above/grabbing diggable block or not. 1 is yes, 0 is no.
sliding R Determines whether the player is sliding or not. 1 is yes, 0 is no.
weapon R&W The NPC ID that the player shoots as Fire, Hammer, Ice, and Penguin states. -1 is for no NPC, and 0 is for the default NPC.
alive R&W Determines whether the player is alive or not.
climbing R Determines if the player is climbing or not.
forecolor R&W Determines the color/transparency of the player. Best used with RGBA.
inwater R Determines if the player is in water or not.
stand R Determines if the player is standing or not.
warping R Determines if the player is using a warp or not.
scriptid ? Unknown effect. Returns a "Too few/many arguments for function." script error, interestingly.
jmpchance R&W Determines if the player has already jumped in midair. Forcing this value to 1 will allow the player to switch between jump and spin jump states in midair.