Need help with lua? - LunaLua General Help

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?
PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Sep 05, 2016 8:44 am

Those were probably deleted by your AntiVirus. You can probably download them somewhere

World Star 9
Swooper
Swooper
Posts: 63
Joined: Wed Jun 29, 2016 12:52 am

Re: Need help with lua? - LunaLua General Help

Postby World Star 9 » Mon Sep 05, 2016 9:06 am

I still have an error issue :(
When I open the software it says "The application was unable to start correctly (0xc000007b). Click OK to close the application"

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Need help with lua? - LunaLua General Help

Postby Emral » Mon Sep 05, 2016 9:10 am

World Star 9 wrote:I still have an error issue :(
When I open the software it says "The application was unable to start correctly (0xc000007b). Click OK to close the application"
Run vcredist_86.exe

World Star 9
Swooper
Swooper
Posts: 63
Joined: Wed Jun 29, 2016 12:52 am

Re: Need help with lua? - LunaLua General Help

Postby World Star 9 » Mon Sep 05, 2016 9:23 am

Finally! It works!
Thank you PixelPest and Enjl! :D

EDIT: I got the modified smbx application to work, I just have one question? Where is the Lunalua software?

Reign
Chain Chomp
Chain Chomp
Posts: 327
Joined: Tue Jan 21, 2014 4:22 am

Re: Need help with lua? - LunaLua General Help

Postby Reign » Wed Sep 07, 2016 12:09 pm

Could there be a way to prevent the Peach throwing bug with Lunalua (for example if the speed of the key/mushroom block is too high, it will be destroyed)?

I mean the kind of situation like in this video at 33:57 where the npc gets thrown through the wall.

https://www.youtube.com/watch?v=3D3Frgh6t3I

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

Re: Need help with lua? - LunaLua General Help

Postby MECHDRAGON777 » Wed Sep 07, 2016 3:40 pm

Reign wrote:Could there be a way to prevent the Peach throwing bug with Lunalua (for example if the speed of the key/mushroom block is too high, it will be destroyed)?

I mean the kind of situation like in this video at 33:57 where the npc gets thrown through the wall.

https://www.youtube.com/watch?v=3D3Frgh6t3I
It is not just Peach. Any character can do that. Speed has nothing to do with it. Just have 2 or three hearts with Peach or Toad, then let go of what ever they are holding while facing left. If the ceiling is low enough, you can get the item to clip into the wall... 999,999 times out of a million, it does not help the player though. Usually the opposite. Only one screen puzzles can utilize that glitch, or anytime a warp does not allow items, but warps to the left on the exact set up you had their. An easy fix is to raise the ceiling by 32 pixels, or 64 in terms of the larger items. Depends on the item. I do not think lua can fix that.

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

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Wed Sep 07, 2016 4:21 pm

Reign wrote:Could there be a way to prevent the Peach throwing bug with Lunalua (for example if the speed of the key/mushroom block is too high, it will be destroyed)?

I mean the kind of situation like in this video at 33:57 where the npc gets thrown through the wall.

https://www.youtube.com/watch?v=3D3Frgh6t3I
You could always find a way to check if the object is fully colliding with a wall on all sides and then destroy it if it is. As you mentioned, there might be a way to check speed if it's faster than throwing it. Either way you can use NPC:kill() to destroy it

Reign
Chain Chomp
Chain Chomp
Posts: 327
Joined: Tue Jan 21, 2014 4:22 am

Re: Need help with lua? - LunaLua General Help

Postby Reign » Thu Sep 08, 2016 1:41 am

PixelPest wrote:You could always find a way to check if the object is fully colliding with a wall on all sides and then destroy it if it is.
Thanks, this sounds like the most sensible route to go. I'm really unfamiliar with the collision detection though, any pointers how to get started?

And Mech, considering the levels are one screen in size (there is very limited space that you have to utilize well) and you can jump, I'm not sure if raising the ceiling is a working solution here. :)

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

Re: Need help with lua? - LunaLua General Help

Postby MECHDRAGON777 » Thu Sep 08, 2016 1:46 am

Reign wrote:
PixelPest wrote:You could always find a way to check if the object is fully colliding with a wall on all sides and then destroy it if it is.
Thanks, this sounds like the most sensible route to go. I'm really unfamiliar with the collision detection though, any pointers how to get started?

And Mech, considering the levels are one screen in size (there is very limited space that you have to utilize well) and you can jump, I'm not sure if raising the ceiling is a working solution here. :)
By the way, it only works right to left.

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » Thu Sep 08, 2016 5:47 pm

World Star 9 wrote:Finally! It works!
Thank you PixelPest and Enjl! :D

EDIT: I got the modified smbx application to work, I just have one question? Where is the Lunalua software?
Code in the LunaLUA language. There is a website that keeps archives of each field. Here is the link: http://wohlsoft.ru/pgewiki/Category:LunaLua_API

World Star 9
Swooper
Swooper
Posts: 63
Joined: Wed Jun 29, 2016 12:52 am

Re: Need help with lua? - LunaLua General Help

Postby World Star 9 » Fri Sep 09, 2016 5:10 pm

Thanks!
I now have finally figured out how LunaLUA works :D
*plays disco music*

DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Sat Sep 10, 2016 7:41 pm

Is there any way to attach a gfx to player using lunalua?

I tried this code but the gfx is being drawn offscreen.

Code: Select all

Graphics.drawImage(gfx, player.x, player.y)

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Need help with lua? - LunaLua General Help

Postby Emral » Sat Sep 10, 2016 7:53 pm

drawImageToScene is what you want. drawImage draws relative to the screen. Use drawImageToSceneWP(img,x,y,z) to draw with priority:
http://wohlsoft.ru/pgewiki/LunaLua_Render_Priority

DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Sat Sep 17, 2016 7:41 am

THANK YOU SO MUCH FOR YOUR HELP ENJL <3

Reign
Chain Chomp
Chain Chomp
Posts: 327
Joined: Tue Jan 21, 2014 4:22 am

Re: Need help with lua? - LunaLua General Help

Postby Reign » Tue Sep 20, 2016 3:02 pm

Is there a way to get rid of the 0/1 text when standing next to a door that leads to a level that has a star? I don't want to make the whole font invisible.

Image

Art
Shy Guy
Shy Guy
Posts: 5
Joined: Sat Aug 15, 2015 10:06 pm

Re: Need help with lua? - LunaLua General Help

Postby Art » Wed Sep 21, 2016 6:42 am

I was wondering if someone here could help me. I found a code by MECHDRAGON777 that should make Peach spin-jump, but I don't understand how to get it to load, I've been trying for the past couple of hours, but I just don't seem to get it. Can someone tell me what I need to put in the lunaworld.lua file to get this to load?
MECHDRAGON777 wrote:

Peach Spin-jump

Code: Select all

function onInputUpdate()
    if player.altJumpKeyPressing == true and player:mem(0x12E, FIELD_WORD) == 0 and (player:mem(0x146, FIELD_WORD) ~= 0 or player:mem(0x48, FIELD_WORD) ~= 0 or player:mem(0x176, FIELD_WORD) ~= 0) then
        player:mem(0x50, FIELD_WORD, -1)
        local myTailSound = Audio.SfxOpen("tail.ogg")
        Audio.sounds[1].sfx = myTailSound
    end
    if player.jumpKeyPressing == true then
        Audio.sounds[1].sfx = nil
    end
end

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

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Wed Sep 21, 2016 6:49 am

If it's for a level, it should be in a lunadll.lua file in the custom graphics folder of your level. If it's for an episode, make sure that lunaworld.lua file is in the same folder as all of your levels. Also, which version of SMBX do you have?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Need help with lua? - LunaLua General Help

Postby Emral » Wed Sep 21, 2016 7:03 am

Reign wrote:Is there a way to get rid of the 0/1 text when standing next to a door that leads to a level that has a star? I don't want to make the whole font invisible.

Image
Make the star friendly and make it unfriendly once your level starts. Also make sure you're using PGE to save your levels.

Reign
Chain Chomp
Chain Chomp
Posts: 327
Joined: Tue Jan 21, 2014 4:22 am

Re: Need help with lua? - LunaLua General Help

Postby Reign » Wed Sep 21, 2016 7:24 am

That did not occur to me at all, thanks.

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

Re: Need help with lua? - LunaLua General Help

Postby MECHDRAGON777 » Wed Sep 21, 2016 7:30 am

Art wrote:I was wondering if someone here could help me. I found a code by MECHDRAGON777 that should make Peach spin-jump, but I don't understand how to get it to load, I've been trying for the past couple of hours, but I just don't seem to get it. Can someone tell me what I need to put in the lunaworld.lua file to get this to load?
MECHDRAGON777 wrote:

Peach Spin-jump

Code: Select all

function onInputUpdate()
    if player.altJumpKeyPressing == true and player:mem(0x12E, FIELD_WORD) == 0 and (player:mem(0x146, FIELD_WORD) ~= 0 or player:mem(0x48, FIELD_WORD) ~= 0 or player:mem(0x176, FIELD_WORD) ~= 0) then
        player:mem(0x50, FIELD_WORD, -1)
        local myTailSound = Audio.SfxOpen("tail.ogg")
        Audio.sounds[1].sfx = myTailSound
    end
    if player.jumpKeyPressing == true then
        Audio.sounds[1].sfx = nil
    end
end
Also, with that code, you need to copy the sound effect from ../SMBX/sound into your custom graphics folder.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari