Skip to content

Player Properties

EntranceJew edited this page Nov 2, 2014 · 1 revision

Forward

Some player properties are simple, others are less so. This page documents those that are currently used. Some "types" don't exist in lua, so we're going to use exotic patterns. Those patterns are:

  • ___ pointer A reference to another table or object, the data does not live here, we only use it as a shortcut to reach it.

  • screen pos This number corresponds to the object's position on the screen, which ranges from 0 to 15 on the x and 0 to 25 on the y

  • decimal (blocks/second) Usually a representation of speed.

  • decimal (world) Represents the object's position in the world. This is usually the top left of the object. If it is X, then the value will be +1 of the corresponding map tile. If it is Y, remember that the map is ±0.5 blocks to draw the half block at the bottom and top in addition to the player's height.

  • decimal (screen) Represents the object's position on the screen. The screen width is 25 blocks long. The screen height is 14 blocks tall. The 14th block is at the bottom of the screen. This is usually used for offsetting the world elements to what's screen-visible.

  • decimal (map) A coordinate component that relates to the X position of the tiles.

  • **** `` __

    • ``

Used Attributes

  • char object pointer characters[mariocharacter[i]] The reference to the set of images to be used for the player as defined by the character structure.

  • size int 1 The size, where 1 is small, 2 is big, and 3 is powerup. This will eventually be depreciated, so do not rely on it for powerup information.

  • powerupstate string small A string representation of a player's current powerup state, as of now these are accepted like an enum, with potential values being:

    • death This state is never processed explicitly, it is only ever made use of when mario powers down.
    • small The player is only one block large.
    • super The player is two blocks large, can break blocks, usually will revert back to "small" if hit.
    • fire Allows the player to shoot fireballs.
  • powerdowntargetstate string death Like powerupstate, this is the state the player will transfer to if hit.

  • prefermouse bool true Whether or not the player will use the mouse if it is available to them. This is only a temporary override so that testing with a controller is easier.

  • t string portalgun The "type" of the player. As of now, it represents the type of weapon the player is given.

  • weapons table {"weaponname": weaponinstance} A table of instances to weapons, loaded from /weapons/weaponname.lua.

  • activeweapon object pointer self.weapons[self.t] A reference to the currently selected weapon in the player's own weapons table.

  • portalsavailable table {unpack(portalsavailable)} A truth table of which portals the player is allowed to use, indexed by portal number. 1=blue, 2=orange.

  • binds object table TLbind instance A local instance of TLbind.

  • controls table pointer self.binds.controls A pointer to just the controls used by TLbind. Despite being available, we use self.binds.controls in the code and we're not sure why.

  • controlsenabled bool true Whether inputs are accepted. This is disabled during animations.

  • ?runframe int self.char.runframes How many frames the player has in his character's run animation.

  • ?jumpframe How many frames the player has when jumping.

  • ?swimframe See above.

  • ?climbframe See above.

  • runanimationprogress int (frame) 1 How far along the player is in the run animation. Used in tandem with runframe.

  • jumpanimationprogress See above.

  • swimanimationprogress See above.

  • animationstate string enum idle The current state the player is in that influences their animation, which can be any of the following:

    • idle Standing still.
    • running Running cycle.
    • jumping Upwards jumping / holding jump while falling.
    • falling Freefall.
    • swimming Hands forward / doing breast stroke.
    • sliding What happens when you turn around really fast.
    • climbing When climbing vines or things of the sort.
    • dead Making the fun pose at the camera.
  • animationdirection string enum right Can be either right or left. This is declared twice, we're not sure why.

  • ?platform bool false Whether or not the player is on a platform. This could potentially be used to reference the last platform the player stood on.

  • ?combo int 1 The number of things a player has comboed in his current streak. This could also be an index to an enum of combo scores.

  • portal object pointer portals[self.playernumber] Created upon initialization, refers to a global portal object.

  • rotation int 0 Used for portaling -- how much to rotate the player. Not certain the unit type.

  • pointingangle int (radians) -math.pi/2 The angle the player is pointing, not influenced by his rotation.

  • passivemoved bool false Whether the player was moved by something as a result of its physics operation.

  • ducking bool false Whether the player is currently ducking.

  • invincible bool false Whether the player takes damage. This is primarily modified by animations, therefore, setting it outside of an animation will leave the player in that state until something else influences it. The player still processes collisions while active.

  • rainboomallowed bool true Whether the player will make a horse-related effect trigger when they go fast enough.

  • ?looktimer int (timer) 0 No idea what this does.

  • ?raccoonstarttimer int (timer) 0 ^

  • ?raccoontimer ^

  • ?raccoonascendtimer ^

  • ?tailwagtimer ^

  • ?tailwagframe int (frame) 1 The frame the player is currently in in their tail wag animation.

  • gravitydirection int (radians) math.pi/2 The angle to apply gravity on the player from.

  • animation string enum globalanimation OR false The animation sequence the player is to act out, can be any one of the following:

    • pipedown going down a pipe (no longer valid)
    • piperight entering a pipe from the left (no longer valid)
    • pipeup exiting a pipe through the top (no longer valid)
    • flag sliding down the flagpole
    • vine riding a vine upwards as a sublevel begins
    • intermission the scene from 1-2
    • vinestart Riding a vine to a coin heaven.
    • pipe_up_out Exiting a pipe through the top, formerly "pipeup".
    • pipe_down_out Exiting a pipe through the bottom.
    • pipe_left_out Exiting a pipe through the left.
    • pipe_right_out Exiting a pipe through the right.
    • pipe_up_in Entering a pipe through the ???.
    • pipe_down_in Entering a pipe through the ???.
    • pipe_left_in Entering a pipe through the ???.
    • pipe_right_in Entering a pipe through the ???.
    • axe Axe pause time and walk forward to the princess/toad.
    • death Dying for whatever reason.
    • deathpit Dying from being pitted.
    • shrink Make the player smaller, rapidly switch.
    • invincible Flashing visible/invisible.
    • grow1 Getting the first mushroom from small.
    • grow2 Getting a fireflower.
    • ``
  • animationx decimal (world) false The position to draw the "animated" player, which differs from their physical position to loosely evade physics calculations.

  • animationy See above.

  • animationtimer int (timer) 0 The duration of the given animation.

  • falling bool false Whether the player is falling.

  • jumping bool false Whether the player is jumping. Could potentially be true while falling is.

  • running bool false Whether the player is running, as opposed to walking.

  • walking bool false Whether the player is walking, as opposed to standing still.

  • starred bool false Whether the player is under the effects of a starman.

  • dead bool false Whether the player is dead or in the process of dying.

  • ?vine object pointer instance of tile-vine OR false The vine a player is currently climbing.

  • vineside string "left" or "right" The side the player is on while climbing a vine.

  • vinex int (map) nil The position of the vine's origin.

  • viney See above.

  • **** `` __

  • ?spring bool false Whether the player is being influenced by a spring. Potentially doubles as a reference to the spring a player is on?

  • springx int (world) 0 The location of the spring to correct the player's position to.

  • springy int (world) 0 See above.

  • ?springtimer int 0 Timer for riding the top of a spring down.

  • springb object pointer nil The spring the player last collided with.

  • ?springhigh bool false This is probably unused, but we can't be certain.

  • startimer int mariostarduration Duration of a starman.

  • starblinktimer int mariostarblinkrate Duration of an individual flash of player color.

  • ?starcolori int 1 Presumably the index of color sets to switch between while using a starman.

  • fireballcount int 0 How many fireballs the player has launched that are active.

  • ?fireanimationtimer int fireanimationtime Presumably used to see how long the player strikes the "shoot fireball" pose for.

  • ?mazevar int 0 The number of gates that the player has passed.

  • ?bubbletimer int 0 ?

  • ?bubbletime int bubblestime[math.random(#bubblestime)] Offset in time to spawn a new bubble.

  • underwater bool underwater Whether the player is swimming.

  • vineanimationclimb bool false OR nil Doing the vine climb animation.

  • ?vineanimationdropoff bool false OR nil Unknown.

  • ?vinemovetimer int 0 OR nil Unknown.

  • animationmisc string nil This is usually a temporary store of the existing animationstate to revert to after a given animation. This is sometimes a table that passes a payload in place of the thousand of animationmisc elements.

  • animationmisc# int varies A sequence of properties that are used to pass data to animation states.

  • funnel bool false Whether or not a player is colliding with a funnel.

  • infunnel bool false Whether a player is currently in a funnel, checked against "funnel" to determine when a player enter/exits.

  • dbljumping bool false If a character attribute allows for this, then this is used to track sequential jumping.

  • pickup object pointer nil If the player is holding something, this is the thing that he is holding.

Physics Attributes

This section will only make explicit notes that differ from the standard physical attributes defined in the enemies guide.

  • speedx decimal (blocks/second) 0 Despite the name, this is the x component of the player's velocity.
  • speedy decimal (blocks/second) 0 See above.
  • x decimal (world) 0 The player's X position, specifically, the position of the player's left side.
  • y decimal (world) y+1-self.height The player's Y position, of the top of the player's head. This changes with the player's height.
  • width decmial (blocks) 12/16 The width of the player. This is never changed, and large portion of the codebase expects this to be unchanging so it uses a constant instead of this attribute.
  • height decimal (blocks) 12/16 The size of the player. If the player is not "small" then it will be 24/16.
  • static bool false ex
  • active bool true ex
  • category int 3 ex
  • mask table ex
{	true, 
	false, true, false, false, false,
	false, true, false, false, false,
	false, true, false, false, false,
	false, false, false, false, false,
	false, false, false, false, false,
	false, false, false, false, false}
  • emancipatecheck bool true The player's emancipate method only relays the signal to whatever is being held, which in other circumstances, would emancipate an object indiscriminately.
  • gravity int (blocks/second^2) yacceleration This isn't defined in the init method, so if this value is altered, then it will immediately be re-set in the update method.

Nonstandard Physical Attributes

  • previouslyonground bool true Used to check if the player is jumping or if the player is falling.
  • lastground coordinate (world) {0,0} The last place the player touched the ground at.

Image-Related Attributes

Like above, this will only note what differs from what is already defined in the enemies document.

  • drawable bool true ex
  • quad object pointer self.char.idle[3] The quad to apply to the graphics set. Not sure why we're using 3 instead of anything else.
  • offsetX int self.char.*offsetX ex
  • offsetY int self.char.*offsetY ex
  • quadcenterX int self.char.*quadcenterX ex
  • quadcenterY int self.char.*quadcenterY ex
  • customscissor scissor false ex

Nonstandard Image-Related Attributes

  • smallgraphic object pointer self.char.animations OR .nogunanimations Shortcut property to reach the small graphics of a character. Changes on initialization based on portal availability, not by weapon.
  • biggraphic object pointer self.char.biganimations OR .nogunbiganimations_ Same as above.
  • colors table pointer mariocolors[self.playernumber] A table of colors, this usually has 3 indexes. In order: hat, hair, skin.
  • customscale ??? self.char.customscale Presumably to draw a player larger or smaller than their physical representation.
  • graphic object pointer self.*graphic A pointer to the small/big graphic pointers for state-independent graphic draws.
  • hats table pointer mariohats[self.playernumber] Presumably, a table of hats that the player is wearing. Hats do not influence height.
  • drawhat bool true Whether or not the hats should be drawn in the draw operation.
  • portal1color table {60,188,252} OR portalcolor[self.playernumber][1] The color to use for this player's portals.
  • portal2color table {232,130,30} OR ... See above.
  • lastportal int 1 The enum index of the last portal that this player fired.

Proposed Attributes

  • startingmap string 1-1 The map that the player began on. This is useful for putting a player back where they entered a level from if the map they traveled to has its own starting point defined. Think of the cross-level pipe secrets from SMW.
  • currentmap string 1-1 The map that the player is on. This would allow a player to be in a sublevel while another player is not yet in that sublevel.
  • checkpointmap string 1-1 The map the player last checkpointed in.
  • checkpointx decimal (map) nil The x coordinate of the last achieved checkpoint OR nil. This will only be used temporarily to make the values a property of a player before transferring to an ID system.
  • checkpointy decimal (map) nil Same as above.
  • checkpointid string nil The ID of a checkpoint entity to get information from.
  • isgiant bool false Instead of piggybacking on the bigmario global, use this in its place so that all players can be individually giant.
  • maxrunspeed Global import.
  • maxwalkspeed Global import.
  • yacceleration Global import.
  • horbounceminspeedx Global import.
  • horbouncemaxspeedx Global import.
  • horbouncemul Global import.
  • horbouncespeedy Global import.
  • spacerunroom Global import. Distance a player is allowed to run over.
  • passivespeed Global import. Moved via portal closing, etc.
  • mariocoincount Global import.
  • mariolives[i] Global import.
  • arcade Global import.
  • userange Global import.
  • usesquaresize Global import.
  • starcolors Global import.
  • maxfireballs Global import.
  • rainboomspeed Global import.
  • spawnx/y Global import.
  • startx/y Global import.
  • uwgravity Global import.
  • waterjumpforce Global import.
  • **** `` __

Unused Attributes

  • alwaysactive boolean true Its purpose is unknown.
  • remote bool false Whether or not this player instance is a remote-controlled player. This is currently implemented in code branches but is underutilized due to uncertainty with new-netplay compatibility.