Magikoopa.lua

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Magikoopa.lua

Postby TDK » Tue Mar 15, 2016 4:47 pm

This is my first LunaLua API. This was from my first LunaLua level, Lemmy's Tower, that I've made a few months ago. I've edited the code to make it into an API.
You can use this API for magikoopa, and you can choose which section which the magikoopa can appear.

To use:

1. Extract the files from the download, and copy it into the level's custom graphics folder.

2. Make a new file in the custom graphics folder called "lunadll.lua" (make sure the extension is .lua)

3. Then add this to your lunadll.lua code:
magikoopa =API.load("magikoopa")

4. However the magikoopa will only appear in section 1 by default, so if you want it to appear in other section you would need to add this:
magikoopa.section = {list of sections}
For example if you want the magikoopa to appear in section 5 and 6, then you need to do this:
magikoopa.section = {4,5}

5. Also if you want to change the enemies that appear from the blocks, you would need to add this line of code:
magikoopa.enemy_list = {list of npc ids}
For example if you just want SMB3 goombas and koopas you could use:
magikoopa.enemy_list = {1,2,4,6}

6. You can also edit which blocks will be affected by the magic:
magikoopa.block_list = {list of block ids}
For example you want the SMB3 wood block to be affected, you can use:
magikoopa.block_list = {1}

An image (quite outdated):
Spoiler: show
Image
Example Level:
Spoiler: show
Download and enjoy:
https://www.mediafire.com/?z53dpubkx02unqk
Last edited by TDK on Wed Jan 10, 2018 1:21 pm, edited 16 times in total.

snoruntpyro
Snifit
Snifit
Posts: 226
Joined: Sun Oct 11, 2015 9:36 am
Pronouns: she/her
Contact:

Re: Magikoopa API

Postby snoruntpyro » Tue Mar 15, 2016 8:38 pm

Looks a bit awkward with the magic just hanging there. Might want to just change its ai1 value to 1 when you spawn it (assuming it's a Rinka). It'd also be neat if there was a teleportation effect.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Magikoopa API

Postby TDK » Thu Mar 17, 2016 3:51 pm

snoruntpyro wrote:Looks a bit awkward with the magic just hanging there. Might want to just change its ai1 value to 1 when you spawn it (assuming it's a Rinka). It'd also be neat if there was a teleportation effect.
The image is a bit outdated since I made it in December. I have improved the rinka's ai since then.
However, I updated the API, and the magikoopa now has a fading effect when it appears and disappears.

PROX
Van De Graf
Van De Graf
Posts: 1978
Joined: Sun Jul 06, 2014 8:50 pm

Re: Magikoopa API

Postby PROX » Thu Mar 17, 2016 9:28 pm

I really like this. I think it should have a sound effect when it teleports though. (birdo beat sound or tanooki statue sound)

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Magikoopa API

Postby PixelPest » Thu Mar 17, 2016 10:18 pm

Or you could see if you could find a custom sound from NSMBWII or SMG

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Magikoopa API

Postby TDK » Fri Mar 18, 2016 3:28 pm

PROX wrote:I really like this. I think it should have a sound effect when it teleports though. (birdo beat sound or tanooki statue sound)
PixelPest wrote:Or you could see if you could find a custom sound from NSMBWII or SMG
I have now added a sound effect.

Super Mario Channel
Tweeter
Tweeter
Posts: 147
Joined: Sun Dec 06, 2015 8:08 am

Re: Magikoopa API

Postby Super Mario Channel » Mon Mar 21, 2016 7:42 pm

Too much 1x1 Pixels... try saving as PNG and coverting to GIF with PGE Converter

PROX
Van De Graf
Van De Graf
Posts: 1978
Joined: Sun Jul 06, 2014 8:50 pm

Re: Magikoopa API

Postby PROX » Tue Mar 22, 2016 12:04 am

Super Mario Channel wrote:Too much 1x1 Pixels... try saving as PNG and coverting to GIF with PGE Converter
the image shown has 1x1 pixels, but the graphic itself doesn't

Alagirez
Ludwig von Koopa
Ludwig von Koopa
Posts: 3624
Joined: Tue Dec 02, 2014 2:28 am
Flair: Legalize Awooo!
Pronouns: He/Him/That wolf
Contact:

Re: Magikoopa API

Postby Alagirez » Tue Mar 22, 2016 12:07 am

Super Mario Channel wrote:Too much 1x1 Pixels... try saving as PNG and coverting to GIF with PGE Converter
I recommend you download the graphic, then open and zoom the graphic, then see every detail of the graphic.
I didn't see any 1x1 pixels.
-----------------------------------------
Hey the magikoopa looks nice, it reminds me to the real SMW magikoopa. I will use this later.

Kyo Saito
Blooper
Blooper
Posts: 153
Joined: Sun Jun 08, 2014 4:58 pm

Re: Magikoopa API

Postby Kyo Saito » Tue Mar 22, 2016 12:10 am

Super Mario Channel wrote:Too much 1x1 Pixels... try saving as PNG and coverting to GIF with PGE Converter
It appears to have 1x1 pixels only because of the quality of the animated .gif image.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Magikoopa API

Postby TDK » Tue Mar 22, 2016 3:42 pm

Super Mario Channel wrote:Too much 1x1 Pixels... try saving as PNG and coverting to GIF with PGE Converter
The image quality is low that's why there's 1x1 pixels. The magikoopa's graphics has 2x2 pixels.
Also wouldn't it be easier use Paint.NET when saving GIF images with 2x2 pixels.

pal4
Swooper
Swooper
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Magikoopa API

Postby pal4 » Mon May 02, 2016 4:57 pm

I have it downloaded, but it doesn't much different from a rinka. It just stays in one place and the magic has no effect on blocks.

underFlo
Wart
Wart
Posts: 4456
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Pronouns: They/She
Contact:

Re: Magikoopa API

Postby underFlo » Mon May 02, 2016 5:16 pm

Looks like you're not using LunaLua or not loading the API.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Magikoopa API

Postby TDK » Tue May 03, 2016 3:18 pm

pal4 wrote:I have it downloaded, but it doesn't much different from a rinka. It just stays in one place and the magic has no effect on blocks.
Did you copy everything into the level's graphic folder?
Did you load the API and set the section like this in your lunadll.lua file:

Code: Select all

magikoopa = loadSharedAPI("magikoopa")
magikoopa.section = {0}

pal4
Swooper
Swooper
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Magikoopa API

Postby pal4 » Thu May 05, 2016 6:58 pm


Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Magikoopa API

Postby Hoeloe » Fri May 06, 2016 3:19 am

You can't set the parameters of the API before you load it, that just makes no sense.

You need to think about what your operations mean - when you say:

Code: Select all

a = b
That means you are assigning the value of b to the variable a. If a already has information, it will be lost when you do this.

Similarly, there's no point in defining the API as a blank table first - just load it directly. Also you should use API.load when loading APIs in LunaLua. The other functions are outdated.

TDK
Phanto
Phanto
Posts: 1440
Joined: Wed Nov 11, 2015 12:26 pm
Flair: Retired

Re: Magikoopa API

Postby TDK » Fri May 06, 2016 2:35 pm

... umm, you just posted my code.

Did you read my previous post?

pal4
Swooper
Swooper
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Magikoopa API

Postby pal4 » Fri May 06, 2016 4:07 pm

TheDinoKing432 wrote:
... umm, you just posted my code.

Did you read my previous post?
Oops. Sorry. :oops:
I tried renaming the lua file to lunadll.lua and ended up with an error message.

S1eth
Bot
Bot
Posts: 54
Joined: Sat Apr 23, 2016 10:44 am

Re: Magikoopa API

Postby S1eth » Fri May 06, 2016 4:16 pm

TheDinoKing432 wrote:
... umm, you just posted my code.

Did you read my previous post?
He just took your API .lua file and pasted

Code: Select all

magikoopa = loadSharedAPI("magikoopa")
magikoopa.section = {0}
into it assuming it would magically work.

@pal4: You can't just put the loading code into the same file as the code you want to load.

You have your main script file called lunadll.lua and ANOTHER file called magikoopa.lua
You want to put the loading code inside the lunadll.lua which LOADS and runs the code from the other file.

These are all the things you have to do:

1. Open PGE editor and create a new level file. Name it "MyLuaTest"
2. Save the level. Check "Make a custom folder"
3. Open the explorer and navigate into the "MyLuaTest" folder.
4. unzip "magikoopa API.zip" into this folder
5. rightclick --> create new text document --> rename it from "New Text Document.txt" to "lunadll.lua" (!!! EXTENSION .lua is important !!!)
6. rightclick on "lunadll.lua" --> open with --> notepad (or notepad++)
7. paste this code into the text file:

Code: Select all

magikoopa = API.load("magikoopa")
magikoopa.section = {0}
8. Save.
9. Play your level.

pal4
Swooper
Swooper
Posts: 63
Joined: Wed Dec 23, 2015 7:57 pm

Re: Magikoopa API

Postby pal4 » Sun May 08, 2016 12:00 pm

S1eth wrote:
TheDinoKing432 wrote:
... umm, you just posted my code.

Did you read my previous post?
He just took your API .lua file and pasted

Code: Select all

magikoopa = loadSharedAPI("magikoopa")
magikoopa.section = {0}
into it assuming it would magically work.

@pal4: You can't just put the loading code into the same file as the code you want to load.

You have your main script file called lunadll.lua and ANOTHER file called magikoopa.lua
You want to put the loading code inside the lunadll.lua which LOADS and runs the code from the other file.

These are all the things you have to do:

1. Open PGE editor and create a new level file. Name it "MyLuaTest"
2. Save the level. Check "Make a custom folder"
3. Open the explorer and navigate into the "MyLuaTest" folder.
4. unzip "magikoopa API.zip" into this folder
5. rightclick --> create new text document --> rename it from "New Text Document.txt" to "lunadll.lua" (!!! EXTENSION .lua is important !!!)
6. rightclick on "lunadll.lua" --> open with --> notepad (or notepad++)
7. paste this code into the text file:

Code: Select all

magikoopa = API.load("magikoopa")
magikoopa.section = {0}
8. Save.
9. Play your level.
What PGE editor? The Lunalua set I have is a 1.3.0.1 edition.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari