Slopes.lua
Posted: Sun Jul 02, 2017 9:35 am
With this API, you can have a more dynamic slope physics.
How to use:
1. First put everything provided into your level folder.
2. Make a lunadll.lua file and type this in the lunadll.lua file:
A. Activate steep slope physics:
On default the steep slopes will not have the correct physics, so you have to type this in the lunadll.lua file:
For example if you're using block-305 and block-307 as steep slopes, you would have to type:
B. If you want to revert back to original SMBX slope physics, just type:
C. To make jump through slopes, just type:
For example if you're using block-299 and block-300 as jump through slopes, you would have to type:
You need to have the slope graphics in your level folder and it must be .png.
Note that npc-92.txt is required for jump through slopes. Also that this only works for slopes at 45° slopes.
Don't have too many jump-through slopes as each slope uses quite a lot of NPC slots which can cause issues if there's too many jump-through slopes.
(Please note that due to how SMBX work jump-through slopes going at / direction are buggier than \ direction, when NPCs are on top of it)
D. To make slopes slippery, type:
If you find any bugs please comment.
Here's a level that uses this.
Download and enjoy:
https://www.dropbox.com/s/6q8tb70yq6bn4 ... s.zip?dl=0
Alternative download link: https://www.mediafire.com/?mb3plo2zi5r9m7m
How to use:
1. First put everything provided into your level folder.
2. Make a lunadll.lua file and type this in the lunadll.lua file:
Code: Select all
local slopes = API.load("slopes")
On default the steep slopes will not have the correct physics, so you have to type this in the lunadll.lua file:
Code: Select all
slopes.steep = {list of block-id of all the steep slopes in your level}
Code: Select all
slopes.steep = {305,307}
Code: Select all
slope.physics = false
Code: Select all
slopes.jump_through ={list of block-id of all the jump through slopes}
Code: Select all
slopes.jump_through ={299,300}[
Note that npc-92.txt is required for jump through slopes. Also that this only works for slopes at 45° slopes.
Don't have too many jump-through slopes as each slope uses quite a lot of NPC slots which can cause issues if there's too many jump-through slopes.
(Please note that due to how SMBX work jump-through slopes going at / direction are buggier than \ direction, when NPCs are on top of it)
D. To make slopes slippery, type:
Code: Select all
slopes.slippery = {list of block-id of any slippery slopes}
Here's a level that uses this.
Download and enjoy:
https://www.dropbox.com/s/6q8tb70yq6bn4 ... s.zip?dl=0
Alternative download link: https://www.mediafire.com/?mb3plo2zi5r9m7m