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?
|
|
|
|
-
ShadowStarX
- Bronze Yoshi Egg

- Posts: 1751
- Joined: Mon Jan 27, 2014 7:21 am
- Pronouns: he/him
-
Contact:
Postby ShadowStarX » Sun Dec 20, 2015 4:31 pm
Thank you guys for the help, hopefully (and probably) it'll succeed. 
|
|
|
|
|
|
|
|
|
-
TDK
- Phanto

- Posts: 1440
- Joined: Wed Nov 11, 2015 12:26 pm
- Flair: Retired
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

- Posts: 375
- Joined: Sun Jul 27, 2014 8:03 am
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

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

- Posts: 4456
- Joined: Mon Jul 14, 2014 10:44 am
- Flair: sup im lesbiab
- Pronouns: They/She
-
Contact:
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:
|
|
|
|
|
|
|
|
|
-
ShadowStarX
- Bronze Yoshi Egg

- Posts: 1751
- Joined: Mon Jan 27, 2014 7:21 am
- Pronouns: he/him
-
Contact:
Postby ShadowStarX » Mon Dec 21, 2015 11:19 am
Spinda wrote:
Also, I did a thing:
That looks amazing!
Is it going to be a quiz show?
|
|
|
|
|
|
|
|
|
-
Destiny
- Volcano Lotus

- Posts: 572
- Joined: Tue Apr 22, 2014 2:40 pm
Postby Destiny » Mon Dec 21, 2015 11:48 am
ShadowStarX wrote:Spinda wrote:
Also, I did a thing:
That looks amazing!
Is it going to be a quiz show?
I guess it's the battle system from Undertale.
|
|
|
|
|
|
|
|
|
-
PersonNamedUser
- Reznor

- Posts: 2882
- Joined: Fri Feb 27, 2015 8:07 pm
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?
|
|
|
|
|
|
|
|
|
-
PersonNamedUser
- Reznor

- Posts: 2882
- Joined: Fri Feb 27, 2015 8:07 pm
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

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
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:
Thanks Spinda. That actually makes sense!
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

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

- Posts: 4456
- Joined: Mon Jul 14, 2014 10:44 am
- Flair: sup im lesbiab
- Pronouns: They/She
-
Contact:
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.
also menues, oh my.
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
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.
also menues, oh my.
It's all starting to come together. Thanks for all of your help!
|
|
|
|
|
|
|
|
|
-
underFlo
- Wart

- Posts: 4456
- Joined: Mon Jul 14, 2014 10:44 am
- Flair: sup im lesbiab
- Pronouns: They/She
-
Contact:
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

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
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!
|
|
|
|
|
|
|
|
|
-
Lukas Old Account
- Snifit

- Posts: 227
- Joined: Sat Mar 28, 2015 3:01 pm
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

- Posts: 719
- Joined: Sun Dec 29, 2013 6:10 am
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

- Posts: 89
- Joined: Sat Dec 19, 2015 9:58 am
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”
Users browsing this forum: No registered users and 2 guests
|