Möan.lua - A simple messagebox system.

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Möan.lua - A simple messagebox system.

Post by yetneverdone »

grump wrote: Sat Jun 30, 2018 9:26 am
yetneverdone wrote: Sat Jun 30, 2018 8:53 am Actually, aftwr checking the repo. It should be

```
local Moan = require("moan")
```

Not

```
require("moan")
```
I checked it too and Moan.lua declares a global Moan table. OP's Moan.speak call should work as is with the current Moan.lua from the repo.

Code: Select all

require('Moan')
Moan.speak('Test', { 'test' })
Oh yeah, it's global.

OP, are you using the latest version?
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

alright after changing the require line i now have a different error

Code: Select all

Error

main.lua:10: attempt to index upvalue 'Moan' (a boolean value)


Traceback

main.lua:10: in function 'draw'
[C]: in function 'xpcall'
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

yeah i am using the latest version i just downloaded it
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

here is the latest code btw

Code: Select all

require("lovesplash/lovesplash")
local Moan = require("Moan")

state = "lovesplash"

function love.draw()
  if state == "lovesplash" then
    lovesplash.draw()
  else if state == "menu" then
    Moan.speak("Title", {"Hello world!", "It's me;--Möan.lua"})
  end
end
end

function love.update(dt)
  if state == "lovesplash" then
    lovesplash.update(dt)
    if lovesplash.done() then
      state = "menu"
    end
  end
end

function love.keypressed()
  if state == "lovesplash" then
    lovesplash.stop()
  else if state == "exit" then
    love.event.quit()
  else
  end
end
end

function love.mousepressed()
  if state == "lovesplash" then
    lovesplash.stop()
  else if state == "exit" then
    love.event.quit()
  else
  end
end
end

grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Möan.lua - A simple messagebox system.

Post by grump »

These errors do not match the current state of that lib. Check again if you didn't do any modifications to it, or whether you're using an older version.

If you can't find the error, post a love file. The code you posted is not the culprit.

And don't triple post, edit your comments to add new info.
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

here is the .love file of the project

edit: now has a conf.lua file
Attachments
Project 1.love
(987.33 KiB) Downloaded 480 times
Last edited by Titanor on Sat Jun 30, 2018 11:16 am, edited 1 time in total.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Möan.lua - A simple messagebox system.

Post by grump »

There is no error.
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

well on my computer the message box is not showing up after the splash screen
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Möan.lua - A simple messagebox system.

Post by grump »

...and you didn't feel like telling us that the errors you made this thread for magically solved themselves and that you have a different problem with it now?

You're not using it correctly, you have to call Moan.draw to see something. And calling Moan.speak in every frame may also not be correct, but I don't know that lib.
Titanor
Prole
Posts: 8
Joined: Sat Jun 30, 2018 5:57 am

Re: Möan.lua - A simple messagebox system.

Post by Titanor »

ok so now i have updated it a bit and it now continually beeps without the message showing up
Attachments
Project 1.love
(1.24 MiB) Downloaded 465 times
Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests