Page 34 of 76

Re: Need help with lua? - LunaLua General Help

Posted: Mon Sep 05, 2016 8:44 am
by PixelPest
Those were probably deleted by your AntiVirus. You can probably download them somewhere

Re: Need help with lua? - LunaLua General Help

Posted: Mon Sep 05, 2016 9:06 am
by World Star 9
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"

Re: Need help with lua? - LunaLua General Help

Posted: Mon Sep 05, 2016 9:10 am
by Emral
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

Re: Need help with lua? - LunaLua General Help

Posted: Mon Sep 05, 2016 9:23 am
by World Star 9
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?

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 07, 2016 12:09 pm
by Reign
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

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 07, 2016 3:40 pm
by MECHDRAGON777
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.

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 07, 2016 4:21 pm
by PixelPest
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

Re: Need help with lua? - LunaLua General Help

Posted: Thu Sep 08, 2016 1:41 am
by Reign
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. :)

Re: Need help with lua? - LunaLua General Help

Posted: Thu Sep 08, 2016 1:46 am
by MECHDRAGON777
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.

Re: Need help with lua? - LunaLua General Help

Posted: Thu Sep 08, 2016 5:47 pm
by loop
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

Re: Need help with lua? - LunaLua General Help

Posted: Fri Sep 09, 2016 5:10 pm
by World Star 9
Thanks!
I now have finally figured out how LunaLUA works :D
*plays disco music*

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 10, 2016 7:41 pm
by DeMuZ
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)

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 10, 2016 7:53 pm
by Emral
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

Re: Need help with lua? - LunaLua General Help

Posted: Sat Sep 17, 2016 7:41 am
by DeMuZ
THANK YOU SO MUCH FOR YOUR HELP ENJL <3

Re: Need help with lua? - LunaLua General Help

Posted: Tue Sep 20, 2016 3:02 pm
by Reign
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

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 21, 2016 6:42 am
by Art
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

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 21, 2016 6:49 am
by PixelPest
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?

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 21, 2016 7:03 am
by Emral
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.

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 21, 2016 7:24 am
by Reign
That did not occur to me at all, thanks.

Re: Need help with lua? - LunaLua General Help

Posted: Wed Sep 21, 2016 7:30 am
by MECHDRAGON777
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.