LunaLua Offical Thread - SMBX Usermod Framework

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?

Shall I steam some LunaLua live development?

Yes
200
92%
No
17
8%
 
Total votes: 217
ShadowStarX
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 1751
Joined: Mon Jan 27, 2014 7:21 am
Pronouns: he/him
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby ShadowStarX » Sun Dec 20, 2015 4:31 pm

Thank you guys for the help, hopefully (and probably) it'll succeed. ;)

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby TDK » Mon Dec 21, 2015 7:36 am

God Mode doesn't seem to work when I use LunaLua on the editor.

Kevsoft
Ripper II
Ripper II
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Mon Dec 21, 2015 7:44 am

TheDinoKing432 wrote:God Mode doesn't seem to work when I use LunaLua on the editor.
This is an issue, which is already solved in the dev version. You can still activate godmode with the cheat "donthurtme".

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 10:58 am

Can someone please help me with this? I have no idea where to start. I'm trying to create a system where you talk to NPCs, and then they disappear. After you talk to x number of NPCs (increasing amount in each level), an event is triggered.
So pretty much, I know I need some code called when an NPC is talked to and then a counter of some type that has a value of +1 added to it each time you talk to an NPC, then when the value is equal to a set number, the event is triggered.
Please help. I have no idea how to code this. (You will be given credit on the episode for your help.)

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby underFlo » Mon Dec 21, 2015 11:11 am

PixelPest wrote:Can someone please help me with this? I have no idea where to start. I'm trying to create a system where you talk to NPCs, and then they disappear. After you talk to x number of NPCs (increasing amount in each level), an event is triggered.
So pretty much, I know I need some code called when an NPC is talked to and then a counter of some type that has a value of +1 added to it each time you talk to an NPC, then when the value is equal to a set number, the event is triggered.
Please help. I have no idea how to code this. (You will be given credit on the episode for your help.)
http://hastebin.com/ezenekehej.lua

Also, I did a thing:
Spoiler: show
Image

ShadowStarX
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 1751
Joined: Mon Jan 27, 2014 7:21 am
Pronouns: he/him
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby ShadowStarX » Mon Dec 21, 2015 11:19 am

Spinda wrote: Also, I did a thing:
Spoiler: show
Image
That looks amazing!
Is it going to be a quiz show?

Destiny
Volcano Lotus
Volcano Lotus
Posts: 572
Joined: Tue Apr 22, 2014 2:40 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Destiny » Mon Dec 21, 2015 11:48 am

ShadowStarX wrote:
Spinda wrote: Also, I did a thing:
Spoiler: show
Image
That looks amazing!
Is it going to be a quiz show?
I guess it's the battle system from Undertale.

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Mon Dec 21, 2015 12:07 pm

After messing with lua for a little bit i managed to make a currency system:

Code: Select all

local Coins = 0;
local Counter = Graphics.loadImage("coincounter.png")

function onLoop()
      Text.print(Coins, 280, 80)
end

function onHUDDraw()
     Graphics.drawImage(Counter, 230, 80)

	end

function onNPCKill(eventObj,npcID,killReason)
    if npcID.id == 10 then
	    Coins = Coins + 1;
	end
	UserData.save()
end 
But the only thing wrong with it is that i don't know how to make your coin count carry over to other levels, could someone
help me?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Mon Dec 21, 2015 12:13 pm

I think your primary concern with that code is that coins will add to your counter when they despawn. For the other thing:
http://engine.wohlnet.ru/pgewiki/Data_%28class%29

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Mon Dec 21, 2015 1:23 pm

I messed with the data class a little bit, but i got stuck on this code:

Code: Select all

local Coins = 0;
local Counter = Graphics.loadImage("coincounter.png")

function onLoop()
      Text.print(Coins, 280, 80)
	  Coins = Data(Data.DATA_WORLD)
	  Data:set("Coins", 0;)
end

function onHUDDraw()
     Graphics.drawImage(Counter, 230, 80)

	end

function onNPCKill(eventObj,npcID,killReason)
    if npcID.id == 10 then
	     Data:get(Coins + 1;)
	 end
	 Data.save()
  end

Could someone please help me insert the correct code?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 2:08 pm

Spinda wrote:
PixelPest wrote:Can someone please help me with this? I have no idea where to start. I'm trying to create a system where you talk to NPCs, and then they disappear. After you talk to x number of NPCs (increasing amount in each level), an event is triggered.
So pretty much, I know I need some code called when an NPC is talked to and then a counter of some type that has a value of +1 added to it each time you talk to an NPC, then when the value is equal to a set number, the event is triggered.
Please help. I have no idea how to code this. (You will be given credit on the episode for your help.)
http://hastebin.com/ezenekehej.lua

Also, I did a thing:
Spoiler: show
Image
Thanks Spinda. That actually makes sense!

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 3:05 pm

Code: Select all

events = {"count"}
counter = 0
gotRun = false

function onEvent(eventname)
	for _,v in pairs(events) do
		if eventname = v then
			counter = counter + 1
		end
	end
end

function onLoop()
	if counter == 1 and not gotRun then
		gotRun = true
	end
end
if gotRun = true
	then ...
end
So now that I have this (the first level only has one NPC that needs to be talked to), how do I trigger an event to happen? I have an event named "end" that shows the SMB3 star to end the level. Or, would it be easier to spawn an SMB3 star; if so how would I do so?

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby underFlo » Mon Dec 21, 2015 3:08 pm

PixelPest wrote:

Code: Select all

events = {"count"}
counter = 0
gotRun = false

function onEvent(eventname)
	for _,v in pairs(events) do
		if eventname = v then
			counter = counter + 1
		end
	end
end

function onLoop()
	if counter == 1 and not gotRun then
		gotRun = true
	end
end
if gotRun = true
	...
end
So now that I have this (the first level only has one NPC that needs to be talked to), how do I trigger an event to happen? I have an event named "end" that shows the SMB3 star to end the level. Or, would it be easier to spawn an SMB3 star; if so how would I do so?
http://hastebin.com/ruzuzitoya.lua

pretty much this.
Spoiler: show
Image
also menues, oh my.

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 3:11 pm

Spinda wrote:
PixelPest wrote:

Code: Select all

events = {"count"}
counter = 0
gotRun = false

function onEvent(eventname)
	for _,v in pairs(events) do
		if eventname = v then
			counter = counter + 1
		end
	end
end

function onLoop()
	if counter == 1 and not gotRun then
		gotRun = true
	end
end
if gotRun = true
	...
end
So now that I have this (the first level only has one NPC that needs to be talked to), how do I trigger an event to happen? I have an event named "end" that shows the SMB3 star to end the level. Or, would it be easier to spawn an SMB3 star; if so how would I do so?
http://hastebin.com/ruzuzitoya.lua

pretty much this.
Spoiler: show
Image
also menues, oh my.
It's all starting to come together. Thanks for all of your help!

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 3:24 pm

Now I'm getting "7: 'then' expected near '='. What could be a mistake with the code?

http://hastebin.com/ruzuzitoya.lua

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby underFlo » Mon Dec 21, 2015 3:26 pm

oh rip it should be == (as a matter of fact, = is used for declaring stuff and == is used for comparing stuff)

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PixelPest » Mon Dec 21, 2015 3:40 pm

Spinda wrote:oh rip it should be == (as a matter of fact, = is used for declaring stuff and == is used for comparing stuff)
Yes! It works!
Spoiler: show
Image

Lukas Old Account
Snifit
Snifit
Posts: 227
Joined: Sat Mar 28, 2015 3:01 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Lukas Old Account » Tue Dec 22, 2015 8:07 am

I need a code for a health bar of a boss i made, it has to work on mother brain tough. Each time you hit him, 1hp will be taken away. When the boss is defeated. te bar goes up and disappears.

litchh
Eerie
Eerie
Posts: 719
Joined: Sun Dec 29, 2013 6:10 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby litchh » Tue Dec 22, 2015 1:35 pm

Is there a way to switch in 1-player mode without lunaforcing cheating?

Creasion
Buster Beetle
Buster Beetle
Posts: 89
Joined: Sat Dec 19, 2015 9:58 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Creasion » Wed Dec 23, 2015 2:14 pm

There's this thing I want to do that involves the ghost npc's.

I want the ghost's ''hunting phase'' to have 2 frames, as well as I want the ghost to be ''heat seeking'' aka I want it to be vicious in it's pursuit of you, following your every move. I also want the npc to instead of seeking you when your back is turned, I want it to always seek you.

Can lunalua do all these things?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari