Need help with lua? - LunaLua General Help

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
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Sat Mar 19, 2016 10:17 am

Enjl wrote:You can only have one function of each name in your lunadll.lua file.
Also, maximum player fall speed is 12, so even if it worked, it wouldn't be noticable if the player was already falling.
But will function for example onKeyDown work if I would rename IT?
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8456
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Sat Mar 19, 2016 10:18 am

Mario_and_Luigi_55 wrote:
Enjl wrote:You can only have one function of each name in your lunadll.lua file.
Also, maximum player fall speed is 12, so even if it worked, it wouldn't be noticable if the player was already falling.
But will function for example onKeyDown work if I would rename IT?
Just throw your two onKeyDown and onLoop functions into one each?
The ABC of Creation
________________________________________________________
Image

User avatar
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Sun Mar 20, 2016 8:21 am

Can I change things that volcano lotus shoots (for example can it shoot springs instead of fireballs)
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8456
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Sun Mar 20, 2016 9:13 am

Yeah, just change the ID of the NPC it's shooting.
http://wohlsoft.ru/pgewiki/NPC_%28class%29
The ABC of Creation
________________________________________________________
Image

User avatar
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Sun Mar 20, 2016 10:06 am

no static mem in NPC.

Thi error is boring. I get in millions of times when i try doing anything...

Code: Select all

function onLoop()
    for k,v in pairs(NPC.get(275,-1)) do
        NPC:mem(0xF8,FIELD_DFLOAT,26)
    end
end
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8456
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Sun Mar 20, 2016 10:08 am

Mario_and_Luigi_55 wrote:no static mem in NPC.

Thi error is boring. I get in millions of times when i try doing anything...

Code: Select all

function onLoop()
    for k,v in pairs(NPC.get(275,-1)) do
        NPC:mem(0xF8,FIELD_DFLOAT,26)
    end
end
NPC refers to your NPC object. If you wrap a table into a for loop which iterates over each object (v) with the key (k), you need to use v.

Code: Select all

function onTick()
   for k,v in ipairs(NPC.get(275, -1)) do
      v.id = 26
   end
end
The ABC of Creation
________________________________________________________
Image

User avatar
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Sun Mar 20, 2016 10:08 am

OK. Thanks
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47

User avatar
Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1437
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Current Project: TBA ;)
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Ness-Wednesday » Sun Mar 20, 2016 8:34 pm

I got a massive error saying that the overload matching candidates couldn't be found.

Is there something wrong here?
Spoiler: show

Code: Select all

function onLoopSection1()
	if(dialogueTime >= 0) then
    dialogueTime = dialogueTime - 1
	end
	local dialogueInSeconds = math.ceil(dialogueTime / 32)
	Graphics.drawImage(image, 0, 0)
		if(dialogueInSeconds <= 30 and dialogueInSeconds >= 27) then
		Graphics.drawImageWP(zlakerboy , 0, 472, 1)
		Text.printWP("Did you see him straining?", 126, 520, 2)
		Audio.playSFX("Zlakerboy quote.ogg")
		elseif(dialogueInSeconds <= 27 and dialogueInSeconds >= 24) then
		Graphics.drawImageWP(nude , 0, 472, 1)
		Text.printWP("Positivley awful design.", 126, 520, 2)
		Audio.playSFX("Bossedit8 quote.ogg")
		elseif(dialogueInSeconds <= 24 and dialogueInSeconds >= 19) then
		Graphics.drawImageWP(princess , 0, 472, 1)
		Text.printWP("Just some garbage.", 126, 520, 2)
		Text.printWP("He should give up and be", 126, 540, 2)
		Text.printWP("disqualified before it's too late.", 126, 560, 2)
		Audio.playSFX("Meme princess quote.ogg")
		elseif(dialogueInSeconds <= 19 and dialogueInSeconds >= 15) then
		Graphics.drawImageWP(sexy , 0, 472, 1)
		Text.printWP("Shut up! You're all jealous.", 126, 520, 2)
		Text.printWP("Wraith's better than any of you!", 126, 540, 2)
		Audio.playSFX("some sexy girl.ogg")
		elseif(dialogueInSeconds <= 15 and dialogueInSeconds >= 11) then
		Graphics.drawImageWP(meme , 0, 472, 1)
		Text.printWP("Yre right, Ski.", 126, 520, 2)
		Text.printWP("Wraith's awl but heil surprise aws all!", 126, 540, 2)
		Audio.playSFX("Sinda meme A.ogg")
		elseif(dialogueInSeconds <= 11 and dialogueInSeconds >= 9) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("If people are gonna....", 126, 520, 2)
		Audio.playSFX("Wraith 1.ogg")
		elseif(dialogueInSeconds <= 9 and dialogueInSeconds >= 4) then
		Graphics.drawImageWP(preach , 0, 472, 1)
		Text.printWP("Come on Wraith, don't let them think", 126, 520, 2)
		Text.printWP("you could never improve, you'll get back to", 126, 540, 2)
		Text.printWP("higher tiers someday.", 126, 560, 2)
		Audio.playSFX("NW Quote 1.ogg")
		elseif(dialogueInSeconds <= 4 and dialogueInSeconds >= 1) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		Audio.playSFX("Wraith 2.ogg")
		elseif(dialogueInSeconds <= 1) then
		Text.printWP("PRESS UP TO CONTINUE", 230, 150, 1)
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		end
end
Edit: SMBX crashes when I go to that same section it's set on.
Last edited by Ness-Wednesday on Sun Mar 20, 2016 8:37 pm, edited 1 time in total.
#Therealmofloveandhate

Join my Discord server!
Spoiler: show
Image
Do you love Villagers? I know I do!
(Image is not by me)
Will Toad truly get an actual project, will something happen who knows?
OR

User avatar
Quantix
Ripper II
Ripper II
Posts: 329
Joined: Tue Jan 26, 2016 5:04 pm

Re: Need help with lua? - LunaLua General Help

Postby Quantix » Sun Mar 20, 2016 8:37 pm

So I've used this specific code from the wiki in a level:

Code: Select all

local SMWCam = loadAPI("SMWcamera")
local t = 0   -- Frame timer
 
function onTickEnd()
	-- Pans the camera to the right, wobbles the camera up and down (like on an airship)
	SMWCam.BeginAutoScroll(2, math.cos(t*math.pi/180))
 
	-- Increment frame timer
	t = t + 1
end
It's supposed to fiddle with the normal camera, but all it does is shove the player to the right. Am I missing something here?

By the way, apologies in advance for any further stupid questions I might make. I'm quite new to this whole thing. :?
viewtopic.php?f=69&p=286856#p286855

Generic Quote Collection:
Spoiler: show
Skant wrote:The egg will fuck you if you don't catch it
rockythechao wrote:f6 is an over-the-counter generic run-of-the-mill store-brand bootleg knockoff f5
some people wrote:The021stYoshiFromThe021stCentury: Who would win, a tophat wearing a tophat, or hoeloe wearing hoeloe?
Hoeloe: yes
glitch4: f6
rockythecomet: that's a trick question
rockythecomet: a top hat wearing a hoeloe
Waffles & Stuff (timocomlita) wrote:No matter what you do, it's impossible to get rid of the impossible.
Petrifying wrote:Piss off with your sex doll SMBX 2.0
Enjl wrote:it puts a twist on classic 4 step level design which i like to call "2 and a half steps backwards design"

arabsalmon
Goomba
Goomba
Posts: 2
Joined: Fri Nov 27, 2015 9:39 pm

Re: Need help with lua? - LunaLua General Help

Postby arabsalmon » Sun Mar 20, 2016 10:06 pm

Quantix wrote:So I've used this specific code from the wiki in a level:

Code: Select all

local SMWCam = loadAPI("SMWcamera")
local t = 0   -- Frame timer
 
function onTickEnd()
	-- Pans the camera to the right, wobbles the camera up and down (like on an airship)
	SMWCam.BeginAutoScroll(2, math.cos(t*math.pi/180))
 
	-- Increment frame timer
	t = t + 1
end
It's supposed to fiddle with the normal camera, but all it does is shove the player to the right. Am I missing something here?

By the way, apologies in advance for any further stupid questions I might make. I'm quite new to this whole thing. :?
This exact same code seems to work for me. Be sure that the section allows enough room for camera movement both vertically and horizontally.

User avatar
Eternity
Pokey
Pokey
Posts: 214
Joined: Fri Dec 20, 2013 3:27 pm

Re: Need help with lua? - LunaLua General Help

Postby Eternity » Sun Mar 20, 2016 10:06 pm

Not really my code or anything but I'm having trouble getting ParalX.lua to work (even on the example level there) :v

Apparently I'm getting some error related to Graphics.draw - I really can't Lua (so it's likely it's just me being stupid lol) but I think it has to do with the version I'm using, the one that comes with SMBX 2.0.

Tried updating (dunno if that would actually change anything though ¯\_(ツ)_/¯) but it didn't work for some reason, it kills the sound and I'm pretty sure Lua completely stops working as well. Did pretty much what was on the first post.

So yeah, I'm super confused and I have no idea if anything here actually helps lol
aka Aeon.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8456
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Sun Mar 20, 2016 10:17 pm

Eternity wrote:Not really my code or anything but I'm having trouble getting ParalX.lua to work (even on the example level there) :v

Apparently I'm getting some error related to Graphics.draw - I really can't Lua (so it's likely it's just me being stupid lol) but I think it has to do with the version I'm using, the one that comes with SMBX 2.0.

Tried updating (dunno if that would actually change anything though ¯\_(ツ)_/¯) but it didn't work for some reason, it kills the sound and I'm pretty sure Lua completely stops working as well. Did pretty much what was on the first post.

So yeah, I'm super confused and I have no idea if anything here actually helps lol
Your lua is likely out of date.
The ABC of Creation
________________________________________________________
Image

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Mar 21, 2016 6:25 am

Ness-Wednesday wrote:I got a massive error saying that the overload matching candidates couldn't be found.

Is there something wrong here?
Spoiler: show

Code: Select all

function onLoopSection1()
	if(dialogueTime >= 0) then
    dialogueTime = dialogueTime - 1
	end
	local dialogueInSeconds = math.ceil(dialogueTime / 32)
	Graphics.drawImage(image, 0, 0)
		if(dialogueInSeconds <= 30 and dialogueInSeconds >= 27) then
		Graphics.drawImageWP(zlakerboy , 0, 472, 1)
		Text.printWP("Did you see him straining?", 126, 520, 2)
		Audio.playSFX("Zlakerboy quote.ogg")
		elseif(dialogueInSeconds <= 27 and dialogueInSeconds >= 24) then
		Graphics.drawImageWP(nude , 0, 472, 1)
		Text.printWP("Positivley awful design.", 126, 520, 2)
		Audio.playSFX("Bossedit8 quote.ogg")
		elseif(dialogueInSeconds <= 24 and dialogueInSeconds >= 19) then
		Graphics.drawImageWP(princess , 0, 472, 1)
		Text.printWP("Just some garbage.", 126, 520, 2)
		Text.printWP("He should give up and be", 126, 540, 2)
		Text.printWP("disqualified before it's too late.", 126, 560, 2)
		Audio.playSFX("Meme princess quote.ogg")
		elseif(dialogueInSeconds <= 19 and dialogueInSeconds >= 15) then
		Graphics.drawImageWP(sexy , 0, 472, 1)
		Text.printWP("Shut up! You're all jealous.", 126, 520, 2)
		Text.printWP("Wraith's better than any of you!", 126, 540, 2)
		Audio.playSFX("some sexy girl.ogg")
		elseif(dialogueInSeconds <= 15 and dialogueInSeconds >= 11) then
		Graphics.drawImageWP(meme , 0, 472, 1)
		Text.printWP("Yre right, Ski.", 126, 520, 2)
		Text.printWP("Wraith's awl but heil surprise aws all!", 126, 540, 2)
		Audio.playSFX("Sinda meme A.ogg")
		elseif(dialogueInSeconds <= 11 and dialogueInSeconds >= 9) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("If people are gonna....", 126, 520, 2)
		Audio.playSFX("Wraith 1.ogg")
		elseif(dialogueInSeconds <= 9 and dialogueInSeconds >= 4) then
		Graphics.drawImageWP(preach , 0, 472, 1)
		Text.printWP("Come on Wraith, don't let them think", 126, 520, 2)
		Text.printWP("you could never improve, you'll get back to", 126, 540, 2)
		Text.printWP("higher tiers someday.", 126, 560, 2)
		Audio.playSFX("NW Quote 1.ogg")
		elseif(dialogueInSeconds <= 4 and dialogueInSeconds >= 1) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		Audio.playSFX("Wraith 2.ogg")
		elseif(dialogueInSeconds <= 1) then
		Text.printWP("PRESS UP TO CONTINUE", 230, 150, 1)
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		end
end
Edit: SMBX crashes when I go to that same section it's set on.
Do you ever load all of those images anywhere?

User avatar
Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1437
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Current Project: TBA ;)
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Ness-Wednesday » Mon Mar 21, 2016 8:17 am

PixelPest wrote:
Ness-Wednesday wrote:I got a massive error saying that the overload matching candidates couldn't be found.

Is there something wrong here?
Spoiler: show

Code: Select all

function onLoopSection1()
	if(dialogueTime >= 0) then
    dialogueTime = dialogueTime - 1
	end
	local dialogueInSeconds = math.ceil(dialogueTime / 32)
	Graphics.drawImage(image, 0, 0)
		if(dialogueInSeconds <= 30 and dialogueInSeconds >= 27) then
		Graphics.drawImageWP(zlakerboy , 0, 472, 1)
		Text.printWP("Did you see him straining?", 126, 520, 2)
		Audio.playSFX("Zlakerboy quote.ogg")
		elseif(dialogueInSeconds <= 27 and dialogueInSeconds >= 24) then
		Graphics.drawImageWP(nude , 0, 472, 1)
		Text.printWP("Positivley awful design.", 126, 520, 2)
		Audio.playSFX("Bossedit8 quote.ogg")
		elseif(dialogueInSeconds <= 24 and dialogueInSeconds >= 19) then
		Graphics.drawImageWP(princess , 0, 472, 1)
		Text.printWP("Just some garbage.", 126, 520, 2)
		Text.printWP("He should give up and be", 126, 540, 2)
		Text.printWP("disqualified before it's too late.", 126, 560, 2)
		Audio.playSFX("Meme princess quote.ogg")
		elseif(dialogueInSeconds <= 19 and dialogueInSeconds >= 15) then
		Graphics.drawImageWP(sexy , 0, 472, 1)
		Text.printWP("Shut up! You're all jealous.", 126, 520, 2)
		Text.printWP("Wraith's better than any of you!", 126, 540, 2)
		Audio.playSFX("some sexy girl.ogg")
		elseif(dialogueInSeconds <= 15 and dialogueInSeconds >= 11) then
		Graphics.drawImageWP(meme , 0, 472, 1)
		Text.printWP("Yre right, Ski.", 126, 520, 2)
		Text.printWP("Wraith's awl but heil surprise aws all!", 126, 540, 2)
		Audio.playSFX("Sinda meme A.ogg")
		elseif(dialogueInSeconds <= 11 and dialogueInSeconds >= 9) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("If people are gonna....", 126, 520, 2)
		Audio.playSFX("Wraith 1.ogg")
		elseif(dialogueInSeconds <= 9 and dialogueInSeconds >= 4) then
		Graphics.drawImageWP(preach , 0, 472, 1)
		Text.printWP("Come on Wraith, don't let them think", 126, 520, 2)
		Text.printWP("you could never improve, you'll get back to", 126, 540, 2)
		Text.printWP("higher tiers someday.", 126, 560, 2)
		Audio.playSFX("NW Quote 1.ogg")
		elseif(dialogueInSeconds <= 4 and dialogueInSeconds >= 1) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		Audio.playSFX("Wraith 2.ogg")
		elseif(dialogueInSeconds <= 1) then
		Text.printWP("PRESS UP TO CONTINUE", 230, 150, 1)
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		end
end
Edit: SMBX crashes when I go to that same section it's set on.
Do you ever load all of those images anywhere?
They're in the graphics folder of the level, I have them set, so I should add the name of the level next to them?
I have them set, but I think that could be the problem now.
#Therealmofloveandhate

Join my Discord server!
Spoiler: show
Image
Do you love Villagers? I know I do!
(Image is not by me)
Will Toad truly get an actual project, will something happen who knows?
OR

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Mar 21, 2016 8:21 am

Ness-Wednesday wrote:
PixelPest wrote:
Ness-Wednesday wrote:I got a massive error saying that the overload matching candidates couldn't be found.

Is there something wrong here?
Spoiler: show

Code: Select all

function onLoopSection1()
	if(dialogueTime >= 0) then
    dialogueTime = dialogueTime - 1
	end
	local dialogueInSeconds = math.ceil(dialogueTime / 32)
	Graphics.drawImage(image, 0, 0)
		if(dialogueInSeconds <= 30 and dialogueInSeconds >= 27) then
		Graphics.drawImageWP(zlakerboy , 0, 472, 1)
		Text.printWP("Did you see him straining?", 126, 520, 2)
		Audio.playSFX("Zlakerboy quote.ogg")
		elseif(dialogueInSeconds <= 27 and dialogueInSeconds >= 24) then
		Graphics.drawImageWP(nude , 0, 472, 1)
		Text.printWP("Positivley awful design.", 126, 520, 2)
		Audio.playSFX("Bossedit8 quote.ogg")
		elseif(dialogueInSeconds <= 24 and dialogueInSeconds >= 19) then
		Graphics.drawImageWP(princess , 0, 472, 1)
		Text.printWP("Just some garbage.", 126, 520, 2)
		Text.printWP("He should give up and be", 126, 540, 2)
		Text.printWP("disqualified before it's too late.", 126, 560, 2)
		Audio.playSFX("Meme princess quote.ogg")
		elseif(dialogueInSeconds <= 19 and dialogueInSeconds >= 15) then
		Graphics.drawImageWP(sexy , 0, 472, 1)
		Text.printWP("Shut up! You're all jealous.", 126, 520, 2)
		Text.printWP("Wraith's better than any of you!", 126, 540, 2)
		Audio.playSFX("some sexy girl.ogg")
		elseif(dialogueInSeconds <= 15 and dialogueInSeconds >= 11) then
		Graphics.drawImageWP(meme , 0, 472, 1)
		Text.printWP("Yre right, Ski.", 126, 520, 2)
		Text.printWP("Wraith's awl but heil surprise aws all!", 126, 540, 2)
		Audio.playSFX("Sinda meme A.ogg")
		elseif(dialogueInSeconds <= 11 and dialogueInSeconds >= 9) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("If people are gonna....", 126, 520, 2)
		Audio.playSFX("Wraith 1.ogg")
		elseif(dialogueInSeconds <= 9 and dialogueInSeconds >= 4) then
		Graphics.drawImageWP(preach , 0, 472, 1)
		Text.printWP("Come on Wraith, don't let them think", 126, 520, 2)
		Text.printWP("you could never improve, you'll get back to", 126, 540, 2)
		Text.printWP("higher tiers someday.", 126, 560, 2)
		Audio.playSFX("NW Quote 1.ogg")
		elseif(dialogueInSeconds <= 4 and dialogueInSeconds >= 1) then
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		Audio.playSFX("Wraith 2.ogg")
		elseif(dialogueInSeconds <= 1) then
		Text.printWP("PRESS UP TO CONTINUE", 230, 150, 1)
		Graphics.drawImageWP(captain , 0, 472, 1)
		Text.printWP("Then I'll prove so that I can", 126, 520, 2)
		Text.printWP("do well and take Lucas-Thursday with me.", 126, 540, 2)
		end
end
Edit: SMBX crashes when I go to that same section it's set on.
Do you ever load all of those images anywhere?
They're in the graphics folder of the level, I have them set, so I should add the name of the level next to them?
I have them set, but I think that could be the problem now.
No. That's not necessary. Do you ever do, for example:

Code: Select all

local memes = Graphics.loadImage("memes")
???

User avatar
Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1437
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Current Project: TBA ;)
Contact:

Re: Need help with lua? - LunaLua General Help

Postby Ness-Wednesday » Mon Mar 21, 2016 8:26 am

PixelPest wrote:
Ness-Wednesday wrote:
PixelPest wrote: Do you ever load all of those images anywhere?
They're in the graphics folder of the level, I have them set, so I should add the name of the level next to them?
I have them set, but I think that could be the problem now.
No. That's not necessary. Do you ever do, for example:

Code: Select all

local memes = Graphics.loadImage("memes")
???
I did, I just didn't show them and they are typed correctly so I don't know why does it happen.
Spoiler: show

Code: Select all

local zlakerboy = Graphics.loadImage("zee_laker.png")
local meme = Graphics.loadImage("ultemmie_spinka.png")
local dev = Graphics.loadImage("deviantart_user.png")
local preach = Graphics.loadImage("prince_north.png")
local princess = Graphics.loadImage("cool_trainer.png")
local hammer = Graphics.loadImage("bossy_edit.png")
local captain = Graphics.loadImage("wraith_as303298.png")
#Therealmofloveandhate

Join my Discord server!
Spoiler: show
Image
Do you love Villagers? I know I do!
(Image is not by me)
Will Toad truly get an actual project, will something happen who knows?
OR

User avatar
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Mon Mar 21, 2016 10:41 am

How can I do fog in the level?
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8456
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Mon Mar 21, 2016 11:00 am

Mario_and_Luigi_55 wrote:How can I do fog in the level?
http://wohlsoft.ru/pgewiki/Particles.lua
If you download the package there are some example ini files which you can use. You just need some kind of white mist sprite to represent fog (I don't think they're included in the download, but they'll be available with the next 2.0 beta. For the time being, you can try making one yourself).
The ABC of Creation
________________________________________________________
Image

User avatar
Hoeloe
Kamikaze Koopa
Kamikaze Koopa
Posts: 1210
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: Need help with lua? - LunaLua General Help

Postby Hoeloe » Mon Mar 21, 2016 11:19 am

Enjl wrote:(I don't think they're included in the download, but they'll be available with the next 2.0 beta. For the time being, you can try making one yourself).
They should be included in the download. One of the example particle systems is a fog effect.

User avatar
Mario_and_Luigi_55
Mega Mole
Mega Mole
Posts: 270
Joined: Sat Feb 27, 2016 12:01 pm
Current Project: Super Mario Bros Adventure

Re: Need help with lua? - LunaLua General Help

Postby Mario_and_Luigi_55 » Mon Mar 21, 2016 2:31 pm

Hoeloe wrote:
Enjl wrote:(I don't think they're included in the download, but they'll be available with the next 2.0 beta. For the time being, you can try making one yourself).
They should be included in the download. One of the example particle systems is a fog effect.

Wait, the example doesn't work

Code: Select all

local particles = loadAPI("particles");
 
local effect = particles.Emitter(0, 0, Misc.resolveFile("particles/p_rain.ini"));
effect:AttachToCamera(Camera.get()[1]);
 
function onCameraUpdate()
    effect:Draw();
end
Why? The / is flipped it should be \, but lua says:

for particles/anythinghere.ini - cannot open
and for particles\anything.ini - invalid escape near 'particles'

I have all the required .lua files from particles.lua (they are in SMBX 2.0 by deafult)
Image
Image

My best levels:
Goomba Lands - 5/10
Stars of the trees - 5.5/10
Koopa Cave - 3.42
Green Grass Hill - 3.42
Grassy Valley - 5.47


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest