Easy LunaLua (NPC Code-style System; 1.1--1/1/2018)

This is the place for discussion and support for LunaLua and related modifications and libraries.
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?
User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Easy LunaLua (NPC Code-style System; 1.1--1/1/2018)

Postby PixelPest » Sun Aug 20, 2017 8:49 pm

If you can use NPC codes, you can use this!

Make sure to use SMBX2-Beta3. It requires various versions of specific APIs that are packaged with it.

This is a useful asset that allows use of various LunaLua elements without the need for any coding whatsoever. It allows for easy autoscroll, filters, timers, general level settings, visual effects, physics effects, pipecannons, and more. It's highly intuitive and will have many more features added to it.

How it Works

When placed in your level's custom graphics/assets folder a pref.txt file along with the provided assets does all of the work for you. Write each command on a separate line with no spaces or capital letters anywhere. Decimal numbers are supported. To use any command, first write the name, an equal sign, and the value, such as:

Code: Select all

startpowerup=2
When entering fields with names, many values are accepted. For example, the following three lines do the same thing and are all accepted:

Code: Select all

character=ninjabomberman
character=bomberman
character=nb
You'll be notified in the engine if you enter a value that is not recognized though most variants with correct spelling will work. (Example: boot, greenboot, kuriboboot, kuribosboot, shoe, greenshoe, kuriboshoe, and kuribosshoe all are recognized for NPC 35). Fields that require a yes or no answer (known as boolean) accept 1 or true for "yes" and 0 or false for "no". If a command is has no real specification, such as clearmount, any value will suffice besides nil if it is typed in your pref.txt file. (Example: clearmount=1, clearmount=true, and clearmount=banana would all be recognized, you just need to have some value).

Installation

Download the .zip file here: https://www.dropbox.com/s/lzky8pjhscq1z ... a.zip?dl=0
  1. After downloading the file unzip it using 7zip, WinZip, etc.
  2. For a level, create a custom graphics (assets) folder for your files unless one already exists; create a new folder with the same name as your level in the same directory as your .lvl file
  3. For a level copy the files from inside the "Level Files" folder into your custom graphics (assets) folder, which contains all of the needed files including an empty pref.txt file
  4. For an episode copy the files from inside the "World Files" folder into the same directory as your .wld file, which contains all of the needed files including an empty pref.txt file
Comparison and Example

Image
Image

This small section is also included in the download package.

Features

Filters: Force certain player settings for a level
  • startcharacter: who the player starts the level as; character name (such as mario or peach) or id (1 to 18)
  • startpowerup: what powerup the player starts the level with; powerup name (such as fire, fireflower, or leaf) or state ID (1 to 7)
  • character: who the player must play as for the whole level; character name or ID
  • powerup: what powerup the player must have for the whole level; powerup name or state ID
  • reserveitem: what item the player starts with in the (reserve) item box; item name (such as mushroom) or NPC ID (such as 1 or 9)
  • clearreserve: clear the player's reserve powerup at the start of the level
  • mount: the name of the mount the player starts the level with (such as greenyoshi or redboot)
  • clearmount: removes the player's mount
  • costume: the name of a costume folder containing the alternate graphics of a certain character (find them in SMBX2/data/graphics/costumes/character name)
Timers: Various types of timers and timer settings
  • time: the time the leveltimer starts at
  • galaxytime: the time the SMG-style leveltimer starts at
  • timeroutevent: the name of a level event to be triggered when the timer hits zero
  • timeroutkill: whether or not to kill the player when the timer runs out
  • timetrialtimer: starts a time trial (speedrun) timer for the level
General Level Settings
  • fallspeed: max. speed at which the player falls
  • walkspeed: max. speed at which the player walks
  • runspeed: max. speed at which the player runs
  • gravity/gravitymodifier: general gravity modifications for players and NPCs (use a number greater than zero)
  • playergravity: direct modification of the gravitational forces acting on the player (use a number greater than zero)
  • npcgravity: direct modification of the gravitational forces acting on the player (use a number greater than zero)
  • jumpheight: upward force for the player when jumping
  • bounceheight/jumpheightbounce: upward force for the player when jumping off of a squashed enemy
  • lowgravity: creates general low-gravity settings for a level
  • pswitchmusicoff: turns off the p-switch music
  • onelife: kills the player when hurt (works well in conjunction with the powerup tweak)
Visual Effects: Full-screen particle presets for cool effects
  • snowstorm: set to true, or a number which will act as the max. number of particles (lower number reduces lag but also density)
  • snowflakes: set to true, or a number which will act as the max. number of particles (lower number reduces lag but also density)
  • sandstorm: set to true, or a number which will act as the max. number of particles (lower number reduces lag but also density)
  • fog: set to true, or a number which will act as the max. number of particles (lower number reduces lag but also density)
  • fogcolor/fogcolour: the hex number of the fog's color/colour (example: 996699); http://www.cloford.com/resources/colours/500col.htm
Physics Effects
  • winddirection: the direction of the wind (-1 or left for blowing left, 1 or right for blowing right); set the wind tweak too
  • wind: the power of the wind which changes the player's max. speeds based on the direction they are moving (0 to 2.2 or so is best)
Various: Picked and chosen pieces from various APIs
  • trackdeaths: shows icons where the player has died in a level (set true, or the name of an icon: standard, standard2x, arrow, arrow2x, player1, player2, player3, player4, player5, trump, sweat, cat)
  • nsmbdshitsystem: makes the player powerdown like in NSMB (example: Fire to big then to small Mario)
  • nsmbwiihitsystem: makes the player powerdown like in NSMB plus disables the reserve power-up system
  • smwhitsystem: makes the player powerdown like in SMW (and NSMB) and force-drops the reserve item
  • hidedeathanim: does not show player death animations
  • breathmeter: some breath meter shenanigans from SM64
  • smwcamera: modifcations to background scrolling to simulate SMW
The following features only work with sections/warps 0-9. This will be fixed in the next update!

Autoscrolls: Makes the screen scroll automatically in a certain direction at the specified speed
  • To set a scrolling section in a pref.txt file (remember that the first section is number zero!):

    Code: Select all

    scroll<section #><direction>=<speed>
  • Example:

    Code: Select all

    scroll2right=0.75
Pipecannons: Launches the player out of a pipe at a specified speed, with the option of an angle
  • To set a pipecannon in a pref.txt file:

    Code: Select all

    pipe<warp #><speed>=<speed>
    pipe<warp #><angle>=<angle>
  • Example:

    Code: Select all

    pipe2speed=16
    pipe3angle=45
Questions, issues, or bug reports? Please leave them in this thread
Last edited by PixelPest on Sun Jan 21, 2018 12:19 pm, edited 6 times in total.

User avatar
superfido2
Fighter Fly
Fighter Fly
Posts: 68
Joined: Sat Jun 10, 2017 11:40 pm
Current Project: WAHHHHHHHHHHHHHHHH
Location: Nowhere and everywhere
Chat Username: Superfido2

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby superfido2 » Sun Aug 20, 2017 9:23 pm

PixelPest, you are a godsend. This would help SO MANY PEOPLE AND BOOST SO MUCH QUALITY!
Signed by: A person

Things that you should support as well
Image
Quotes: show
Enjl wrote: like why is the cutscene sparking the adventure set up by someone teleporting behind the main character, stabbing him in the back and saying an equivalent to "nothin personell kid"
Memes: show
ImageImageImage

User avatar
The0x539
Nipper Plant
Nipper Plant
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm
Current Project: SMBX2

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby The0x539 » Sun Aug 20, 2017 9:38 pm

Image

User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Sun Aug 20, 2017 9:39 pm

The0x539 wrote:Image
Yeah basically

User avatar
AndrewPixel
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 328
Joined: Sun Mar 12, 2017 8:07 am
Flair: The Italian that likes time travel
Current Project: ???
Location: Italy
Chat Username: AndrewPixel#2486
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby AndrewPixel » Tue Aug 22, 2017 8:44 am

1) Where should I put the easyLuna.lua file?
2) All the features can be used in an episode so I can apply it to any level of it?

Anyway, this is an awesome project, It will be really useful for me
ImageImageImageImageImageImageImageImageImage
ImageImage
Switch Friend Code: SW-2755-4824-8495
[PGE Italian Translator] [I make logos for your episodes, ask me]

User avatar
glitch4
Ludwig von Koopa
Ludwig von Koopa
Posts: 2532
Joined: Tue Dec 31, 2013 3:43 pm

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby glitch4 » Tue Aug 22, 2017 10:54 am

Very very good, will definetly use this.

User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Tue Aug 22, 2017 4:59 pm

AndrewPixel wrote:1) Where should I put the easyLuna.lua file?
2) All the features can be used in an episode so I can apply it to any level of it?

Anyway, this is an awesome project, It will be really useful for me
1. It goes along with the other included files in either your custom graphics (assets) folder of your level.
2. Yes for sure!

You can also refer to the Installation section of the OP for more information

User avatar
RhysOwens
Lakitu
Lakitu
Posts: 423
Joined: Fri Apr 22, 2016 2:53 am
Location: UK

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby RhysOwens » Fri Aug 25, 2017 9:16 am

I might find some use in this one.

User avatar
Sancles-Chan
Silver Yoshi Egg
Silver Yoshi Egg
Posts: 1788
Joined: Wed Jan 01, 2014 6:50 am
Flair: BetterifiVed is happening

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Sancles-Chan » Tue Aug 29, 2017 8:59 am

This is pretty great for people who aren't interested in devoting time into learning lua. Like don't get me wrong, if you're at all interested in learning lua this is not going to help you, but if you're someone who doesn't have the time to learn coding but still want to mess around with autoscroll or something, this is what you want.

User avatar
ShadowStarX
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 1385
Joined: Mon Jan 27, 2014 7:21 am
Location: Hungary, Europe
Chat Username: ShadowStarX
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby ShadowStarX » Tue Aug 29, 2017 9:41 am

I was messing around with this and the level timer pops up this message when time's out:
Image
It works but it pops up this error message still, so I thought that reporting this is a good idea.
"Look me in the eyes and tell me that ad isn't funny." - Joey, 2015
"hitaswitchtohitanotherswitchandseewhathappens" syndrome - Waddle Derp, 2016
"I am in a call with a Natsu" - MECHDRAGON777, 2016
"I know who designed Camacho's level" - bossedit8, 2016
"Waddle Derp is a great minigame" - bossedit8, 2016
"Technically I'm not a voice memer" - bossedit8, 2016

Image
Image


User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Tue Aug 29, 2017 12:19 pm

Sanct wrote:This is pretty great for people who aren't interested in devoting time into learning lua. Like don't get me wrong, if you're at all interested in learning lua this is not going to help you, but if you're someone who doesn't have the time to learn coding but still want to mess around with autoscroll or something, this is what you want.
Exactly the idea of this.

Also ShadowStarX thanks for reporting that. I'll look into it

User avatar
Mudkip
Lakitu
Lakitu
Posts: 465
Joined: Mon Jan 06, 2014 11:35 pm
Current Project: Something
Location: Germany
Chat Username: ZA BARUDO

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Mudkip » Sun Nov 26, 2017 6:53 am

This should be stickied. Thank you, Pixel Pest.
And with her heart of silver, Silva!

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1129
Joined: Mon Jun 19, 2017 11:35 am
Flair: Beta 4 beta be here soon jk
Current Project: Mario's Kingdom Adventure
Chat Username: Taycamgame
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Taycamgame » Sun Nov 26, 2017 1:44 pm

Where do i write the codes such as Character etc.? Is there a window in PGE? Or how do i access LunaLua?
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Check out my Episodes:
ImageImage
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.

User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Sun Nov 26, 2017 1:51 pm

Taycamgame wrote:Where do i write the codes such as Character etc.? Is there a window in PGE? Or how do i access LunaLua?
You need to place the included files in your custom graphics/assets folder for your level. Inside that, place a text file named "pref" (no quotation marks in the filename) and place the codes from this API in there.

There is no window in PGE at the moment.

LunaLua itself is an API of the Lua programming language added to SMBX2 for various functionalities. easyLuna.lua is a crutch made to allow the use of some features of LunaLua without any needed programming experience. More information can be found here: http://wohlsoft.ru/pgewiki/Main_Page#LunaLUA

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1129
Joined: Mon Jun 19, 2017 11:35 am
Flair: Beta 4 beta be here soon jk
Current Project: Mario's Kingdom Adventure
Chat Username: Taycamgame
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Taycamgame » Sun Nov 26, 2017 3:24 pm

Got it installed correctly. Can this be used to create "Dark Levels", where the area is dark like a cave? If not, how do i make that happen?
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Check out my Episodes:
ImageImage
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.

User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Sun Nov 26, 2017 4:47 pm

Taycamgame wrote:Got it installed correctly. Can this be used to create "Dark Levels", where the area is dark like a cave? If not, how do i make that happen?
Are you just wanting to make everything darker?

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1129
Joined: Mon Jun 19, 2017 11:35 am
Flair: Beta 4 beta be here soon jk
Current Project: Mario's Kingdom Adventure
Chat Username: Taycamgame
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Taycamgame » Sun Nov 26, 2017 4:52 pm

Yeah, so a dark area with torches that lighten it up.
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Check out my Episodes:
ImageImage
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1129
Joined: Mon Jun 19, 2017 11:35 am
Flair: Beta 4 beta be here soon jk
Current Project: Mario's Kingdom Adventure
Chat Username: Taycamgame
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Taycamgame » Mon Nov 27, 2017 4:33 pm

For the pipecannons, is the speed equal to the number of blocks that it launches at? So if i wanted the cannon to launch the player up 10 blocks, would i set the speed to 10?
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Check out my Episodes:
ImageImage
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.

User avatar
PixelPest
Edward
Edward
Posts: 6778
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby PixelPest » Mon Nov 27, 2017 10:02 pm

Taycamgame wrote:For the pipecannons, is the speed equal to the number of blocks that it launches at? So if i wanted the cannon to launch the player up 10 blocks, would i set the speed to 10?
Idk off-hand but you could easily test it and find out quickly

User avatar
Taycamgame
Gold Yoshi Egg
Gold Yoshi Egg
Posts: 1129
Joined: Mon Jun 19, 2017 11:35 am
Flair: Beta 4 beta be here soon jk
Current Project: Mario's Kingdom Adventure
Chat Username: Taycamgame
Contact:

Re: Easy LunaLua (NPC Code-style System; 1.0)

Postby Taycamgame » Wed Nov 29, 2017 2:25 pm

So i'm pretty sure that the timer is broken. When i use either the "time" or "galaxytime", they seem to work fine, until the timer reaches 0. The player is killed, but an error message does come up saying something like "attempt to perform arithmetic on local 'currtime'", or "bad argument #1 to 'ceil' (number expected, got nil)". How do i fix this? The code i put in, as an example, was "time=10", or "galaxytime=10". I get the error either way.
EDIT: Also, another problem: The fog works except no matter what colour i try to change it to, it is always white. Example, i put "fogcolour=#B0171F" expecting it to go a tint of red, but it was still white. "fogcolour=B0171F" does the same thing (white).
Official Level Reviewer (My Gold Yoshi Egg rank replaced the level reviewer icon, but i am still a level reviewer).
Check out my Episodes:
ImageImage
Check out the World Map Service that i host:
viewtopic.php?p=316733#p316733
Check out the projects i support:
Spoiler: show
ImageImageImage
Image
Image
Quotes: show
xDestroy wrote:
Wellington Games wrote:Taycamgame, I know how to take screenshots in the SMBX.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests