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

Discussion in '3DS - Homebrew Development and Emulators' started by VideahGams, Sep 17, 2015.

  1. TurtleP

    TurtleP GBAtemp Regular

    Member
    139
    210
    Oct 7, 2015
    United States
    XavyrrVaati likes this.
  2. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
  3. TurtleP

    TurtleP GBAtemp Regular

    Member
    139
    210
    Oct 7, 2015
    United States
    @XavyrrVaati haha no problem! :V
    I try to show the cia branch I've got since it has the most up-to-date stuff.
    @VideahGams did add some stuff recently but I need him to take my udp code/cia filesystem code to merge it in already! :V
     
    XavyrrVaati likes this.
  4. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
    @TurtleP now that the SDK is pretty much free, what are the odds of LP being ported to it ;)
     
  5. TurtleP

    TurtleP GBAtemp Regular

    Member
    139
    210
    Oct 7, 2015
    United States
    I have no idea, honestly. It's doable but then it wouldn't be open source to others in homebrew due to the NDA.
     
    XavyrrVaati likes this.
  6. LiamTheHackermon

    LiamTheHackermon GBAtemp Regular

    Member
    130
    78
    Jul 22, 2016
    United States
    how to make game into cia?
    tried and got error
     
  7. VideahGams
    OP

    VideahGams Advanced Member

    Newcomer
    91
    76
    Aug 29, 2015
    Glasgow, Scotland
    What error did you get? If you're using the latest ctrulib from Github this won't compile because the legacy GPU API got removed :P
     
  8. LiamTheHackermon

    LiamTheHackermon GBAtemp Regular

    Member
    130
    78
    Jul 22, 2016
    United States
    you should make a converter
     
  9. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    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.
     
  10. VideahGams
    OP

    VideahGams Advanced Member

    Newcomer
    91
    76
    Aug 29, 2015
    Glasgow, Scotland
    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.
     
    XavyrrVaati likes this.
  11. Pecrow

    Pecrow GBAtemp Maniac

    Member
    1,137
    418
    Jun 23, 2015
    United States
    So has anyone made any games with this so far? I alway like playing people's games.
     
  12. olec04

    olec04 Working on Project Heaven!

    Banned
    851
    142
    Apr 10, 2015
    United States
    Trying to downgrade on 11.0 via AM services
    Time to rek the 3ds
     
  13. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
    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.
    YOU CAN DO IT! :O
     
  14. DutchyDutch

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    874
    431
    Nov 16, 2014
    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)

    Warning: Spoilers inside!
    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, Aug 15, 2016
  15. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
    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, Aug 16, 2016
  16. DutchyDutch

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    874
    431
    Nov 16, 2014
    Netherlands
    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, Aug 17, 2016
  17. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
    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).
     
  18. DutchyDutch

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    874
    431
    Nov 16, 2014
    Netherlands
    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) :
    Warning: Spoilers inside!

    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, Aug 17, 2016
    XavyrrVaati likes this.
  19. hoksyjp

    hoksyjp Member

    Newcomer
    35
    29
    Aug 20, 2016
    United States
    Boston
    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
     
  20. XavyrrVaati

    XavyrrVaati Hobbyist programmer?

    Member
    384
    422
    Feb 23, 2014
    United States
    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.