Homebrew [Release] - LövePotion - LÖVE API for 3DS Homebrew - BETA

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
So which fork of LovePotion should I use now?? XD It seems like the two have different things now. TurtleP has worked on spritebatches and audio streaming, versus the Videah's having changes with dependencies and stuff.
 

VideahGams

Well-Known Member
OP
Newcomer
Joined
Aug 29, 2015
Messages
91
Trophies
0
Age
25
Location
Glasgow, Scotland
Website
videah.xyz
XP
146
Country
So which fork of LovePotion should I use now?? XD It seems like the two have different things now. TurtleP has worked on spritebatches and audio streaming, versus the Videah's having changes with dependencies and stuff.

With the new sf2dlib/ctrulib changes, I don't think Turtle's fork compiles anymore ;v
Sorry for the lack of progress, I keep hitting obstacles then lose motivation. I'll try to merge Turtles audio changes, add Canvases and Spritebatches, then make another stable release.
 
  • Like
Reactions: XavyrrVaati

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
So has anyone made any games with this so far? I alway like playing people's games.
I'm making a not really game with LovePotion, and after that I'm probably going to learn Unity and try and make something with the SDK.
With the new sf2dlib/ctrulib changes, I don't think Turtle's fork compiles anymore ;v
Sorry for the lack of progress, I keep hitting obstacles then lose motivation. I'll try to merge Turtles audio changes, add Canvases and Spritebatches, then make another stable release.
YOU CAN DO IT! :O
 

DutchyDutch

COPYRIGHT LOLOLOLOL
Member
Joined
Nov 16, 2014
Messages
954
Trophies
0
Age
24
XP
862
Country
Netherlands
This is pretty awesome, finally tried to make a simple hello world in it and button input works fine too. Learned this really quickly, it's pretty easy! I might make my first public app in it soon :D The only problem I have is, I can't get
audio to work, which is what my project will mostly be using :(. This is my code (and yes fartSound is exactly what it sounds like)

fartSound = love.audio.newSource('fart-01.wav')

function love.load()
love.graphics.set3D(true)
love.graphics.setScreen('top')
end

function love.draw()
love.graphics.setScreen('top')
love.graphics.print("Hello World",100,100)
end


function love.update(dt)
function love.draw()
love.graphics.print("Hello World",100,100)
end


end

function love.keypressed(key)
if key == 'x' then
function love.draw()
love.graphics.setScreen('top')

love.graphics.print("Waddup m8",240,200)
end
function love.update(dt)
function love.draw()
love.graphics.print("Waddup m8",240,200)
end
end
end
function love.keypressed(key)
if key == 'select' then
fartSound:Play()

end
end

function love.keypressed(key)

-- start returns you to the homebrew menu :3
if key == 'start' then
love.event.quit()
end

end
end
As you can see pressing X will print waddup m8 bottom left of the screen. Works fine, but another problem is that whenever you press any other key before that one, nothing besides start works. AND select won't play the audio at all.
 
Last edited by DutchyDutch,

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
This is pretty awesome, finally tried to make a simple hello world in it and button input works fine too. Learned this really quickly, it's pretty easy! I might make my first public app in it soon :D The only problem I have is, I can't get
audio to work, which is what my project will mostly be using :(. This is my code (and yes fartSound is exactly what it sounds like)

fartSound = love.audio.newSource('fart-01.wav')

function love.load()
love.graphics.set3D(true)
love.graphics.setScreen('top')
end

function love.draw()
love.graphics.setScreen('top')
love.graphics.print("Hello World",100,100)
end


function love.update(dt)
function love.draw()
love.graphics.print("Hello World",100,100)
end


end

function love.keypressed(key)
if key == 'x' then
function love.draw()
love.graphics.setScreen('top')

love.graphics.print("Waddup m8",240,200)
end
function love.update(dt)
function love.draw()
love.graphics.print("Waddup m8",240,200)
end
end
end
function love.keypressed(key)
if key == 'select' thens
fartSound:Play()

end
end

function love.keypressed(key)

-- start returns you to the homebrew menu :3
if key == 'start' then
love.event.quit()
end

end
end
As you can see pressing X will print waddup m8 bottom left of the screen. Works fine, but another problem is that whenever you press any other key before that one, nothing besides start works. AND select won't play the audio at all.
It's actually pretty simple. First off, you're re-defining the function love.keypressed(key) because you have it more than once.
You need to combine all of them to make it work for anything. Second, you need to tell your code to keep printing the string, since it will disappear the second you let go of X (assuming you want it to stay there, I recommend creating a flag variable to keep track of whether it should print or not. Unless you only want it while it is pressed, then ignore me haha.
Anyways, you should consolidate your keypressed function to look something like this:
Code:
if key == 'select' then
    fartSound:play()
elseif key == 'x' then
    (code for X here)
elseif key == 'start' then
    love.event.quit()
end
Make sure you tab properly! Lua requires it!

Anyways, I recall having trouble with the keypressed function, so I just don't use it. I personally just use:
Code:
if love.keyboard.isDown("KEY YOU WANT HERE") then
     PUT YOUR CODE YOU WANT TO DO WHILE PRESSED
end
Just stick it in your love.update().
 
Last edited by XavyrrVaati,

DutchyDutch

COPYRIGHT LOLOLOLOL
Member
Joined
Nov 16, 2014
Messages
954
Trophies
0
Age
24
XP
862
Country
Netherlands
It's actually pretty simple. First off, you're re-defining the function love.keypressed(key) because you have it more than once.
You need to combine all of them to make it work for anything. Second, you need to tell your code to keep printing the string, since it will disappear the second you let go of X (assuming you want it to stay there, I recommend creating a flag variable to keep track of whether it should print or not. Unless you only want it while it is pressed, then ignore me haha.
Anyways, you should consolidate your keypressed function to look something like this:
Code:
if key == 'select' then
    fartSound:play()
elseif key == 'x' then
    (code for X here)
elseif key == 'start' then
    love.event.quit()
end
Make sure you tab properly! Lua requires it!

Anyways, I recall having trouble with the keypressed function, so I just don't use it. I personally just use:
Code:
if love.keyboard.isDown("KEY YOU WANT HERE") then
     PUT YOUR CODE YOU WANT TO DO WHILE PRESSED
end
Just stick it in your love.update().
Thanks for the detailed response! I had learned a lot since I made that post, but this stilll helped me clean up my code and fix the audio.
Is there any other file other than .wav that I can use for audio? .wav files are really big compared to .mp3 for some reason, yet LovePotion doesn't seem to support MP3. I tried it
and got an error.

EDIT: And is it possible to use anAL (animations and love) with LovePotion, so I can animate my sprites? Or is there a built-in feature in this?
 
Last edited by DutchyDutch,

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
Thanks for the detailed response! I had learned a lot since I made that post, but this stilll helped me clean up my code and fix the audio.
Is there any other file other than .wav that I can use for audio? .wav files are really big compared to .mp3 for some reason, yet LovePotion doesn't seem to support MP3. I tried it
and got an error.

EDIT: And is it possible to use anAL (animations and love) with LovePotion, so I can animate my sprites? Or is there a built-in feature in this?
Currently, only .wav files work, but eventually .ogg might be supported. As for other Love plugins, they don't usually work since LovePotion isn't complete yet. Therefore LovePotion has missing features and potentially different behavior when compared to Love. You can always try though. The Github page has a list of implemented Love functions. It can be as simple as modifying some parts of the Love 'plugin' (for lack of a better word).
 

DutchyDutch

COPYRIGHT LOLOLOLOL
Member
Joined
Nov 16, 2014
Messages
954
Trophies
0
Age
24
XP
862
Country
Netherlands
Currently, only .wav files work, but eventually .ogg might be supported. As for other Love plugins, they don't usually work since LovePotion isn't complete yet. Therefore LovePotion has missing features and potentially different behavior when compared to Love. You can always try though. The Github page has a list of implemented Love functions. It can be as simple as modifying some parts of the Love 'plugin' (for lack of a better word).
Thanks a lot! I've found a way to make .wav files smaller, so it's okay now. Thanks to this forum my game is getting better and better. Movement already worked before, but now my "camera" and sound work
perfectly too :D I'm still working on everything, now mostly of the art, but here's a Citra screenshot of my game in its current state (bottom screen is a quick placeholder, trust me) :
d3d5af43da674131992f6abc1853ec8e.png

I'm not really good at drawing but I try my best. It looked a LOT worse in it's first state obviously, so I'm very happy with how it looks now :D I'll release the first build once the first 3 objectives are made and of course when it has as little bugs as possible.
 
Last edited by DutchyDutch,
  • Like
Reactions: XavyrrVaati

hoksyjp

Active Member
Newcomer
Joined
Aug 20, 2016
Messages
39
Trophies
0
Age
26
Location
Boston
Website
illteteka.itch.io
XP
141
Country
United States
Hey I'm working on a homebrew game using LovePotion and I was wondering if I can call functions directly from crtulib in lua. I'm trying to make use of features that a homebrew game could only do, such as using the 3d depth slider as part of the controls. Does anyone know if this is possible?

I would try to add hooks in myself, but I can't get LovePotion to compile
 

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
Hey I'm working on a homebrew game using LovePotion and I was wondering if I can call functions directly from crtulib in lua. I'm trying to make use of features that a homebrew game could only do, such as using the 3d depth slider as part of the controls. Does anyone know if this is possible?

I would try to add hooks in myself, but I can't get LovePotion to compile
You would have to fork LP and add those functions yourself. Though that requires compiling it. Also not being able to compile is too vague.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @salazarcosplay, Morning