Player Properties - GoonHouse/Marin0SE GitHub Wiki
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 pointercharacters[mariocharacter[i]] The reference to the set of images to be used for the player as defined by the character structure. -
size
int1 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
stringsmall A string representation of a player's current powerup state, as of now these are accepted like an enum, with potential values being:deathThis state is never processed explicitly, it is only ever made use of when mario powers down.smallThe player is only one block large.superThe player is two blocks large, can break blocks, usually will revert back to "small" if hit.fireAllows the player to shoot fireballs.
-
powerdowntargetstate
stringdeath Like powerupstate, this is the state the player will transfer to if hit. -
prefermouse
booltrue 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
stringportalgun 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 pointerself.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 tableTLbind instance A local instance of TLbind. -
controls
table pointerself.binds.controls A pointer to just the controls used by TLbind. Despite being available, we useself.binds.controlsin the code and we're not sure why. -
controlsenabled
booltrue Whether inputs are accepted. This is disabled during animations. -
?runframe
intself.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 withrunframe. -
jumpanimationprogress See above.
-
swimanimationprogress See above.
-
animationstate
string enumidle The current state the player is in that influences their animation, which can be any of the following:idleStanding still.runningRunning cycle.jumpingUpwards jumping / holding jump while falling.fallingFreefall.swimmingHands forward / doing breast stroke.slidingWhat happens when you turn around really fast.climbingWhen climbing vines or things of the sort.deadMaking the fun pose at the camera.
-
animationdirection
string enumright Can be either right or left. This is declared twice, we're not sure why. -
?platform
boolfalse Whether or not the player is on a platform. This could potentially be used to reference the last platform the player stood on. -
?combo
int1 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 pointerportals[self.playernumber] Created upon initialization, refers to a global portal object. -
rotation
int0 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
boolfalse Whether the player was moved by something as a result of its physics operation. -
ducking
boolfalse Whether the player is currently ducking. -
invincible
boolfalse 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
booltrue 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 enumglobalanimation OR false The animation sequence the player is to act out, can be any one of the following:pipedowngoing down a pipe (no longer valid)piperightentering a pipe from the left (no longer valid)pipeupexiting a pipe through the top (no longer valid)flagsliding down the flagpolevineriding a vine upwards as a sublevel beginsintermissionthe scene from 1-2vinestartRiding a vine to a coin heaven.pipe_up_outExiting a pipe through the top, formerly "pipeup".pipe_down_outExiting a pipe through the bottom.pipe_left_outExiting a pipe through the left.pipe_right_outExiting a pipe through the right.pipe_up_inEntering a pipe through the ???.pipe_down_inEntering a pipe through the ???.pipe_left_inEntering a pipe through the ???.pipe_right_inEntering a pipe through the ???.axeAxe pause time and walk forward to the princess/toad.deathDying for whatever reason.deathpitDying from being pitted.shrinkMake the player smaller, rapidly switch.invincibleFlashing visible/invisible.grow1Getting the first mushroom from small.grow2Getting 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
boolfalse Whether the player is falling. -
jumping
boolfalse Whether the player is jumping. Could potentially be true while falling is. -
running
boolfalse Whether the player is running, as opposed to walking. -
walking
boolfalse Whether the player is walking, as opposed to standing still. -
starred
boolfalse Whether the player is under the effects of a starman. -
dead
boolfalse Whether the player is dead or in the process of dying. -
?vine
object pointerinstance 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
boolfalse 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
int0 Timer for riding the top of a spring down. -
springb
object pointernil The spring the player last collided with. -
?springhigh
boolfalse This is probably unused, but we can't be certain. -
startimer
intmariostarduration Duration of a starman. -
starblinktimer
intmariostarblinkrate Duration of an individual flash of player color. -
?starcolori
int1 Presumably the index of color sets to switch between while using a starman. -
fireballcount
int0 How many fireballs the player has launched that are active. -
?fireanimationtimer
intfireanimationtime Presumably used to see how long the player strikes the "shoot fireball" pose for. -
?mazevar
int0 The number of gates that the player has passed. -
?bubbletimer
int0 ? -
?bubbletime
intbubblestime[math.random(#bubblestime)] Offset in time to spawn a new bubble. -
underwater
boolunderwater Whether the player is swimming. -
vineanimationclimb
boolfalse OR nil Doing the vine climb animation. -
?vineanimationdropoff
boolfalse OR nil Unknown. -
?vinemovetimer
int0 OR nil Unknown. -
animationmisc
stringnil 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#
intvaries A sequence of properties that are used to pass data to animation states. -
funnel
boolfalse Whether or not a player is colliding with a funnel. -
infunnel
boolfalse Whether a player is currently in a funnel, checked against "funnel" to determine when a player enter/exits. -
dbljumping
boolfalse If a character attribute allows for this, then this is used to track sequential jumping. -
pickup
object pointernil 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
boolfalse ex - active
booltrue ex - category
int3 ex - mask
tableex
{ 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
booltrue 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
booltrue 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
booltrue ex - quad
object pointerself.char.idle[3] The quad to apply to the graphics set. Not sure why we're using 3 instead of anything else. - offsetX
intself.char.*offsetX ex - offsetY
intself.char.*offsetY ex - quadcenterX
intself.char.*quadcenterX ex - quadcenterY
intself.char.*quadcenterY ex - customscissor
scissorfalse ex
Nonstandard Image-Related Attributes
- smallgraphic
object pointerself.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 pointerself.char.biganimations OR .nogunbiganimations_ Same as above. - colors
table pointermariocolors[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 pointerself.*graphic A pointer to the small/big graphic pointers for state-independent graphic draws. - hats
table pointermariohats[self.playernumber] Presumably, a table of hats that the player is wearing. Hats do not influence height. - drawhat
booltrue 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
int1 The enum index of the last portal that this player fired.
Proposed Attributes
- startingmap
string1-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
string1-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
string1-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
stringnil The ID of a checkpoint entity to get information from. - isgiant
boolfalse Instead of piggybacking on thebigmarioglobal, 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
booleantrue Its purpose is unknown. - remote
boolfalse 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.