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

TurtleP

Well-Known Member
Member
Joined
Oct 7, 2015
Messages
140
Trophies
0
Age
28
Website
TurtleP.github.io
XP
308
Country
United States
@Blu-Ray did you check that it has a main.lua at the root of the directory? It's an odd question seeing as how it works as a 3DSX but. . who knows.

Code:
LovePotion/game/main.lua
LovePotion/game/someotherfile.lua
LovePotion/game/somedirectory/somegraphic.png

Are you sure this is your layout?
 

TurtleP

Well-Known Member
Member
Joined
Oct 7, 2015
Messages
140
Trophies
0
Age
28
Website
TurtleP.github.io
XP
308
Country
United States
@Blu-Ray did you use your own source files? It looks like you haven't which is why it keeps giving you the 'no-game' screen. Remove all files in there and place your game's source files inside LovePotion/game/
 

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
I can't get my game into romfs when compiling to cia. I just get the supertoast "no game" screen, even though I do have my game folder in the LovePotion-master directory. It works perfectly as 3dsx, so I'm probably doing something wrong in the compiling. It is correct that I just have to put the game folder in the same directory as the rest of the files from the zip, so the same directory as the makefile, right?

Yes, does your game have a main.lua?

Edit: oops, my phone's derpy. TurtleP can probably help you better lol.
 
Last edited by XavyrrVaati,

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
@TurtleP @XavyrrVaati I tried it with my own game first yeah, but that gave me the supertoast "no game"-screen, so I thought it might be my game that was an issue, so I tried this one, which is included as an example, and shows a "no game" screen with bubbles and a different character, but it gives the supertoast message as well.

My own game is just a main.lua file, no external assets
 
Last edited by Blu-Ray,

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
@TurtleP
It's a simple 2 player snake game, not entirely finished yet. I excuse any awful code, I'm not a pro programmer :P
Code:
function love.load()
    love.graphics.setScreen('bottom')

    players = 2

    lose = {}

    oldSquare = {}
    direction = {}
    startx = {}
    starty = {}

    snake1 = {}
    lose.snake1 = false

    if players == 2 then
        snake2 = {}
        lose.snake2 = false
    end

    startx.snake1 = 40
    startx.snake2 = 270
    starty.snake1 = 110
    starty.snake2 = 110

    createSnake(snake1, 'snake1')
    createSnake(snake2, 'snake2')

    direction.snake1 = 'right'
    direction.snake2 = 'left'

    framecount = {}
    framecount.snake1 = 0
    framecount.snake2 = 0

    love.graphics.setColor(255, 255, 255)
end

function love.draw()

    for i, square in ipairs(snake1) do
        love.graphics.setColor(255, 255, 255)
        love.graphics.setScreen('bottom')
        love.graphics.rectangle('fill', square.x, square.y, 10, 10)
    
    end

    if players == 2 then
        for i, square in ipairs(snake2) do
            love.graphics.setColor(127, 127, 127)
            love.graphics.setScreen('bottom')
            love.graphics.rectangle('fill', square.x, square.y, 10, 10)
        end
    end
    love.graphics.setColor(255, 255, 255)
    love.graphics.setScreen('top')
    love.graphics.print(direction.snake1, 0,0)

    love.graphics.setScreen('top')
    love.graphics.print(direction.snake2, 300,0)

    if lose.snake1 == true then
        love.graphics.print('you lose', 0, 20)
    end

    if lose.snake2 == true then
        love.graphics.print('you lose', 300, 20)
    end

end

function love.update(dt)
    moveSnake(snake1, 'snake1')
    moveSnake(snake2, 'snake2')


end

function love.keypressed(key)

    if key == 'start' then
        love.event.quit()
    end
    if key == 'select' then
        love.load()
    end

    if key == 'a' and direction ~= 'left' then
        direction.snake2 = 'right'
    end
    if key == 'y' and direction ~= 'right' then
        direction.snake2 = 'left'
    end
    if key == 'x' and direction ~= 'down' then
        direction.snake2 = 'up'
    end
    if key == 'b' and direction ~= 'up' then
        direction.snake2 = 'down'
    end

    if key == 'dright' and direction ~= 'left' then
        direction.snake1 = 'right'
    end
    if key == 'dleft' and direction ~= 'right' then
        direction.snake1 = 'left'
    end
    if key == 'dup' and direction ~= 'down' then
        direction.snake1 = 'up'
    end
    if key == 'ddown' and direction ~= 'up' then
        direction.snake1 = 'down'
    end
end

function love.quit()

end

function createSnake(snake, snakeName)

    local newSquare = {x = startx[snakeName], y = starty[snakeName]}

    table.insert(snake, newSquare)

    _G['oldSquare' .. snakeName] = newSquare
end

function moveSnake(snake, snakeName)
    if framecount[snakeName] == 20 and lose[snakeName] == false then
    
        local oldSquareName = _G['oldSquare' .. snakeName]
    
        local newSquare = {x = 0, y = 0}
    
        if direction[snakeName] == 'right' then
            newSquare.x = oldSquareName.x + 10
        elseif direction[snakeName] == 'left' then
            newSquare.x = oldSquareName.x - 10
        else
            newSquare.x = oldSquareName.x
        end
    
        if direction[snakeName] == 'down' then
            newSquare.y = oldSquareName.y + 10
        elseif direction[snakeName] == 'up' then
            newSquare.y = oldSquareName.y - 10
        else
            newSquare.y = oldSquareName.y
        end
    
        if newSquare.x < 0 or newSquare.x >= 320 or newSquare.y < 0 or newSquare.y >= 240 then
            lose[snakeName] = true
        end
    
        for i, square in ipairs(snake1) do
            if square.x == newSquare.x and square.y == newSquare.y then
                lose[snakeName] = true
            end
        end
        for i, square in ipairs(snake2) do
            if square.x == newSquare.x and square.y == newSquare.y then
                lose[snakeName] = true
            end
        end
        framecount[snakeName] = 0
        table.insert(snake, newSquare)
    
        _G['oldSquare' .. snakeName] = newSquare
    end
    framecount[snakeName] = tonumber(framecount[snakeName]) + 1
end
 
Last edited by Blu-Ray,
  • Like
Reactions: DutchyDutch

TurtleP

Well-Known Member
Member
Joined
Oct 7, 2015
Messages
140
Trophies
0
Age
28
Website
TurtleP.github.io
XP
308
Country
United States
Code seems fine. Can you give me a screenshot of your directory? Perhaps your file extension is bad. Turn off 'hide extensions of known file types' in Windows and see if it's a .lua.txt.
 

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
Q4kbCFg.jpg
 

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
@TurtleP Yes. You can even see it in the screenshot, in the top there is a checkbox with file name extensions. txt files also default to regular notepad and not notepad++

But this issue is not just with my own game. It does it with the example program as well, which I tested. I had that program in the game folder instead to eliminate variables to facilitate troubleshooting
 
Last edited by Blu-Ray,

TurtleP

Well-Known Member
Member
Joined
Oct 7, 2015
Messages
140
Trophies
0
Age
28
Website
TurtleP.github.io
XP
308
Country
United States
The only thing I can see as to why it no-game screens is this:

Code:
if (fileExists("main.lua")) {
     if (luaL_dofile(L, "main.lua")) displayError();
   } else {
     if (luaL_dobuffer(L, nogame_lua, nogame_lua_size, "nogame")) displayError();
   }

Basically it checks if your main.lua exists in the romfs game folder. It's weird that it's not finding it. Have you tried my cia branch of Love Potion? https://www.github.com/TurtleP/LovePotion/tree/cia
 

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
@TurtleP with your fork it just crashes immediately when running on my 3ds. The make process said "RomFS packaged" though, which the original doesn't, but that may also just be down to a difference in implementation, idk.
 

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
The file extensions are definitely correct. I'll play around with some different stuff and see if I can get it to work somehow by some kind of magic.
 

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
Hey, grab my love potion game in my Sig, download the whole thing as a zip from github and try building it(not with your files, with mine.) I know for certain that mine builds. That way you know if it's your computer and not your project/Lovepotion.
 
  • Like
Reactions: DutchyDutch

Blu-Ray

Member
Newcomer
Joined
Jun 22, 2016
Messages
10
Trophies
0
Age
34
XP
64
Country
There's definitely something weird going on, because with your game it's giving me a lua error! That means it has gotten your game into romfs and executed it, but from the error message it seems like it can't find the intronoise even though the compiling process says that is in romfs as well.
Code:
./start.lua:10: attempt to index field 'noise' (a nil value)

EDIT:
I replaced your game folder with mine, and it worked! :o Are you using a fork of Lövepotion? If so, it seems that fork actually works for me for some reason!

EDIT 2:
Read through your thread on LOVE, and saw that I needed to dump the DSP binary in order to make it work. I did that, and your game runs without errors as well :)
 
Last edited by Blu-Ray,
  • Like
Reactions: XavyrrVaati

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
There's definitely something weird going on, because with your game it's giving me a lua error! That means it has gotten your game into romfs and executed it, but from the error message it seems like it can't find the intronoise even though the compiling process says that is in romfs as well.
Code:
./start.lua:10: attempt to index field 'noise' (a nil value)

EDIT:
I replaced your game folder with mine, and it worked! :o Are you using a fork of Lövepotion? If so, it seems that fork actually works for me for some reason!

EDIT 2:
Read through your thread on LOVE, and saw that I needed to dump the DSP binary in order to make it work. I did that, and your game runs without errors as well :)
In order to use some homebrew CIAs with sound, you gotta dump the dspfirmware. Also my 'fork' is almost 100% the same as the official Lovepotion. The only modified parts are the makefile and gitignore. I'm guessing you either grabbed the wrong copy of Lovepotion or something went funny with the download. Glad to see it works though!
 

haazet

Well-Known Member
Newcomer
Joined
Dec 15, 2015
Messages
64
Trophies
0
XP
159
Country
United States
Where can I find some info about setting the unique ID in the make file when building a CIA so they can be on the 3DS together

I think default is 00x0143 and I've used that and 00x0144 and 00x1144. I'm afraid I might install over a system title or something.
 

XavyrrVaati

Hobbyist programmer?
Member
Joined
Feb 23, 2014
Messages
385
Trophies
0
XP
478
Country
United States
Where can I find some info about setting the unique ID in the make file when building a CIA so they can be on the 3DS together

I think default is 00x0143 and I've used that and 00x0144 and 00x1144. I'm afraid I might install over a system title or something.
Check the makefile! I'm 90% sure it's there. It's one of the declared variables.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: i think im a bad person