Odessey.lua

From Moondust Wiki
Revision as of 04:46, 25 September 2017 by Yoshi021 (talk | contribs)
Jump to navigation Jump to search

DOWNLOAD NOT AVAILABLE

Odessey.lua is an API that mimics the ability to possess enemy in Super Mario Odyssey. The API contains plenty of customizable features.

How to use

To load the API, place this line in your script.

local odesey = API.load("odessey")

This API requires a folder called odessey. The is a required file in this folder must be a PNG file called hat

hat

The hat is an object that is activated with the alt-run key. You can customize the hat by changing some of these values.


Name Default Value Description
img LuaImgResource

"hat.png" found inside the Odessey folder

The image of the hat.
x Number

0 (Automatically moves to the player when the hat is activated)

The X coordinate of the hat.
y Number

0 (Automatically moves to the player when the hat is activated)

The Y coordinate of the hat.
gfxOffsetX Number

0

The X offset of the image.
gfxOffsetY Number

0

The Y offset of the image.
speedX Number

0

The current x-speed of the hat.
speedY Number

0

The current y-speed of the hat.
speedXMax Number

7.5

The maximum x-speed of the hat.

Will automatically cap negative numbers too (setting speed -8 will turn into -7.5)

speedYMax Number

4

The maximum y-speed of the hat.

Will automatically cap negative numbers too (setting speed -8 will turn into -4)

speedXIni Number

6

The initial x-speed of the hat when it is activated.

Will automatically flip the number to negative if the player is facing left.

speedYIni Number

0

The initial y-speed of the hat when it is activated.
width Number

32

The width of the hat.
height Number

32

The height of the hat.
facing Number

1 (Will either turn to -1[left] or 1[right] when activated. The direction facing will match the direction the player is facing.

The initial direction of the hat when it is activated.
frame Number

1

The current frame that is being drawn.
frames Number

8

The total amount of frames.
frameSpeed Number

8

The number of frames it should wait until the next frame appears.
animationTimer Number

0

The timer that counts the frames passed between frames. When this number reaches frameSpeed, it will reset to 0 and increment frame by 1.
timer Number

0

The number of frames that have passed since when the hat was activated.

playerIMG

playerIMG is a table that contains all of the characters images of them in their normal and hatless value.

The structure of the table is as follows:

playerIMG[CHARACTER] = {
  -- All of the images featuring the character with his hat
  [0] = {
    [0] = LuaImageResource  -- Death Effect
    [1] = LuaImageResource  -- Powerup 1
    [2] = LuaImageResource  -- Powerup 2 
    ...    
    [n] = LuaImageResource  -- Powerup n
  }
  -- All of the images featuring the character with his hat
  [1] = {
    [0] = LuaImageResource  -- Death Effect
    [1] = LuaImageResource  -- Powerup 1
    [2] = LuaImageResource  -- Powerup 2 
    ...    
    [n] = LuaImageResource  -- Powerup n
  }
}

By default, it will load the player images inside the "Odyssey" folder. File names with an h stand for files that represent the player hatless. For example, placing an image called "mario-1.png" will make mario be that image when he has a hat, and setting an image called "mario-1h.png" will make Mario turn into that image when he activates his hat. If the image is not found inside the folder, it will automatically use the default player's image. The images supported are all of the powerup files (mario-1.png, luigi-2.png, megaman-1.png), and all of the death effects (3,5,129,130,134,149,150,151,152,153,154,155,156,157,158,159,160,161).