Pipecannon.lua
Jump to navigation
Jump to search
| This is the archived page of the old LunaLua documentation The rest of LunaLua related articles in this wiki contain a lot of outdated documentation preserved for historical purposes and may be used with legacy versions of the LunaLua.
Please visit the SMBX2 Documentation Page to access the latest documentation for the LunaLua scripting system of the SMBX2 Project. Adding LunaLua contents into this Wiki is not advised. |
Download the last preserved version
A library which lets you create pipe cannons.
Documentation
This API stores all warps in your level in a table and lets you customise them using the fields below:
| pipecannon.exitspeed | Table of values corresponding to warp IDs. Sets speed at which the player will get launched. When set to 0, the warp behaves like normal. |
|---|---|
| pipecannon.angle | Table of values corresponding to warp IDs. Defines the angle of deviation in which the player should be shot, clockwise from perpendicular. Must be between -90 and 90. See visual aids below. |
| pipecannon.SFX | Set sound effect for exiting the warp. Default value is 22 (bill blaster). |
| pipecannon.effect | Set visual effect for exiting the warp. |


The fields angle and exitspeed can also be defined for each warp individually.
Example
local pipecannon = API.load("pipecannon")
-- You can set firing speeds for each warp.
pipecannon.exitspeed = {10,20,30,10,20,15,25,10,20,50,10,30,0,40}
-- Will ignore speeds set for doors/instant warps. When set to 0, the warp behaves like normal.
-- Firing angles, clockwise from perpendicular
pipecannon.angle = {[10]=-3, [11]=13} -- Warp IDs can be specified more easily with this syntax
pipecannon.angle[12] = 45 -- Also can be set individually. 12 - warp number; 45 - firing angle
pipecannon.angle[14] = -10
-- Any of the three syntax styles shown will work for either exitspeed or angle
-- Sound effect for firing
pipecannon.SFX = 22 -- default value (bullet bill sfx), set to 0 for silent
-- Visual effect for firing
pipecannon.effect = 10 -- set to 0 for none
Example level: https://smbxarchive.wohlsoft.ru/LunaLua-SMBX%20(pre-SMBX2)/Scripts/Pipe%20Cannon/pipecannon-API-Test.zip