Pipe Cannons! (pipecannon.lua test)

This is the place to post levels that are made just for fun.

Moderator: Userbase Moderators

h2643
Reznor
Reznor
Posts: 2890
Joined: Sat Dec 21, 2013 7:23 am
Contact:

Pipe Cannons! (pipecannon.lua test)

Postby h2643 » Sat Jan 16, 2016 7:51 am

Did you got tired of the glitchy and usable-only-once Pipe Cannons? I sure did. With LunaLua out, we can finally forget about these issues!
Here I present you a level with completely working and usable Pipe Cannons.



You need SMBX 2.0 to play this level!!!

Download actual level here:
http://www.mediafire.com/download/dfif4 ... I+Test.zip

Big thanks to arabsalmon for the Pipe Cannon LunaLua API.

Black Mamba
Boss Bass
Boss Bass
Posts: 1253
Joined: Thu May 29, 2014 6:11 pm
Pronouns: They/Her

Re: Pipe Cannons! (pipecannon.lua test)

Postby Black Mamba » Thu Jan 21, 2016 6:06 pm

I can honestly say that this is the best thing ever.

h2643
Reznor
Reznor
Posts: 2890
Joined: Sat Dec 21, 2013 7:23 am
Contact:

Re: Pipe Cannons! (pipecannon.lua test)

Postby h2643 » Mon Feb 15, 2016 2:45 pm

I just updated the level by adding and fixing some graphics (just some minor stuff really). Download updated level here:
http://www.mediafire.com/download/dfif4 ... I+Test.zip

Creepermon
Hoopster
Hoopster
Posts: 46
Joined: Sun Dec 20, 2015 12:55 pm

Re: Pipe Cannons! (pipecannon.lua test)

Postby Creepermon » Fri Feb 19, 2016 12:49 pm

Can you explain how it's formatted. I'm trying to set it up, but I can't work out what every bit means. I'm a bit of a novice with Lunalua, so it's probabally quite obvious...

Fuyu
Fry Guy
Fry Guy
Posts: 3137
Joined: Sat Dec 21, 2013 2:40 pm
Pronouns: He/Him

Re: Pipe Cannons! (pipecannon.lua test)

Postby Fuyu » Fri Feb 19, 2016 1:20 pm

Awesome, this is really cool. I have actually spotted out this thread before but never posted anything ... so hi(?). It's a great contribution and one that will help spice level design a bit. Thanks for posting it, and tbig thanks to arabsalom for creating this API.

h2643
Reznor
Reznor
Posts: 2890
Joined: Sat Dec 21, 2013 7:23 am
Contact:

Re: Pipe Cannons! (pipecannon.lua test)

Postby h2643 » Fri Feb 19, 2016 2:00 pm

Creepermon wrote:Can you explain how it's formatted. I'm trying to set it up, but I can't work out what every bit means. I'm a bit of a novice with Lunalua, so it's probabally quite obvious...
You can look at the code of my level to see how it works. Also did you downloaded the Pipe Cannon API (link to it can be found in the first post)? And if you did, did you put it in the level folder?

Anyway this is how it works:

1) First you load the Pipe Cannon API with this piece of code put in lunadll.lua (put both pipecannon.lua and lunadll.lua in a level folder):

Code: Select all

pipeAPI = loadAPI("pipecannon")
2) Next thing to do is set the exit-shooting speeds for each warp. Yes, even if your level has doors or instant warps, you still should set shooting speeds for them. The API will ignore all shooting speeds set for doors and instant warps, as without the shooting speeds set Pipe Cannons just won't work properly.

If 0 is set = the pipe won't launch you, if >0 is set = the pipe will launch you. Here's the code example from my level:

Code: Select all

pipeAPI.exitspeed = {18, 0, 22, 22, 32, 18, 10, 12, 12, 15, 0, 0, 20}
As you can see in the code, my level has only 10 'real' Pipe Cannons which are Warps #1, 3-10 and 13 Image

3) Now here's something that I only used once in the level - a diagonal Pipe Cannon. Here I set the shooting angle for the cannon. Keep in mind that you don't need to set the angles for every warp - they will work without them. There's a picture that shows how angles work:
http://wohlsoft.ru/pgewiki/Pipecannon.lua#Documentation

Again, here's an example code from my level:

Code: Select all

pipeAPI.angle = {}
pipeAPI.angle[13] = 45
Even if you don't have any angled pipe cannons, you still need to put that first line of the piece of code above into your code. 13 - warp number; 45 - angle for shooting (in my level it shoots right, but if I'd change the number to -45, it would shoot left).

4) Some minor stuff like shooting SFX (sound) and the effect GFX (graphics) for shooting can be also modified! These changes, however, will affect ALL the Pipe Cannons.

Code: Select all

pipeAPI.SFX = 22
pipeAPI.effect = 10
Here you can see that all Pipe Cannons in my level use: ID of 22 for SFX (which is a Bullet Bill Shooting sound) and ID of 10 for effect GFX (which is a SMW 'poof' effect graphic). If values are set to 0, no SFX/GFX will be played/shown. Of course you can change the values to whatever you want.

SFX ID reference:
http://wohlsoft.ru/pgewiki/SFX_list_(SMBX64)
Reference for effect GFX can be found in your "effects" folder which is in your SMBX folder.

5) And the last thing we need to put is this:

Code: Select all

function onLoop()
	
end
This is very important as the code won't work without this!!!

And we're done! I pretty much covered everything that the API has to offer.

---------------------------------------------

Anyway I hope this helped. All of the codes above are directly taken from my level's code, so they will work.
Natsu wrote:I have actually spotted out this thread before but never posted anything ... so hi(?).
yo long time no see

Creepermon
Hoopster
Hoopster
Posts: 46
Joined: Sun Dec 20, 2015 12:55 pm

Re: Pipe Cannons! (pipecannon.lua test)

Postby Creepermon » Fri Feb 19, 2016 4:48 pm

h2643 wrote:
Creepermon wrote:Can you explain how it's formatted. I'm trying to set it up, but I can't work out what every bit means. I'm a bit of a novice with Lunalua, so it's probabally quite obvious...
You can look at the code of my level to see how it works. Also did you downloaded the Pipe Cannon API (link to it can be found in the first post)? And if you did, did you put it in the level folder?

Anyway this is how it works:

1) First you load the Pipe Cannon API with this piece of code put in lunadll.lua (put both pipecannon.lua and lunadll.lua in a level folder):

Code: Select all

pipeAPI = loadAPI("pipecannon")
2) Next thing to do is set the exit-shooting speeds for each warp. Yes, even if your level has doors or instant warps, you still should set shooting speeds for them. The API will ignore all shooting speeds set for doors and instant warps, as without the shooting speeds set Pipe Cannons just won't work properly.

If 0 is set = the pipe won't launch you, if >0 is set = the pipe will launch you. Here's the code example from my level:

Code: Select all

pipeAPI.exitspeed = {18, 0, 22, 22, 32, 18, 10, 12, 12, 15, 0, 0, 20}
As you can see in the code, my level has only 10 'real' Pipe Cannons which are Warps #1, 3-10 and 13 Image

3) Now here's something that I only used once in the level - a diagonal Pipe Cannon. Here I set the shooting angle for the cannon. Keep in mind that you don't need to set the angles for every warp - they will work without them. There's a picture that shows how angles work:
http://wohlsoft.ru/pgewiki/Pipecannon.lua#Documentation

Again, here's an example code from my level:

Code: Select all

pipeAPI.angle = {}
pipeAPI.angle[13] = 45
Even if you don't have any angled pipe cannons, you still need to put that first line of the piece of code above into your code. 13 - warp number; 45 - angle for shooting (in my level it shoots right, but if I'd change the number to -45, it would shoot left).

4) Some minor stuff like shooting SFX (sound) and the effect GFX (graphics) for shooting can be also modified! These changes, however, will affect ALL the Pipe Cannons.

Code: Select all

pipeAPI.SFX = 22
pipeAPI.effect = 10
Here you can see that all Pipe Cannons in my level use: ID of 22 for SFX (which is a Bullet Bill Shooting sound) and ID of 10 for effect GFX (which is a SMW 'poof' effect graphic). If values are set to 0, no SFX/GFX will be played/shown. Of course you can change the values to whatever you want.

SFX ID reference:
http://wohlsoft.ru/pgewiki/SFX_list_(SMBX64)
Reference for effect GFX can be found in your "effects" folder which is in your SMBX folder.

5) And the last thing we need to put is this:

Code: Select all

function onLoop()
	
end
This is very important as the code won't work without this!!!

And we're done! I pretty much covered everything that the API has to offer.

---------------------------------------------

Anyway I hope this helped. All of the codes above are directly taken from my level's code, so they will work.
Natsu wrote:I have actually spotted out this thread before but never posted anything ... so hi(?).
yo long time no see
Thanks for explaining this. It's something that I think should be integrated, so it's quite stupefying to think this is all made by a fan. Anyone else struggling to use this will hopefully have a guide too now, so that's an added bonus.


Return to “Casual Levels”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari