hi all,
i need some help running love2d programs in intellij
here's what i have so far ~
but when i try and run it this happens ~
any help will be largely appreciated ~ thanks
(yes i think I've posted this topic before but it was in the wrong place and wasn't explained well)
Running love2d programs with intellij idea [closed]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- bobbymcbobface
- Citizen
- Posts: 78
- Joined: Tue Jun 04, 2019 8:31 pm
Running love2d programs with intellij idea [closed]
Last edited by bobbymcbobface on Sun Dec 08, 2019 1:16 pm, edited 1 time in total.
I make games that run on potatoes :P
Re: Running love2d programs with intellij idea
You must pass game directory as an argument, setting working directory does nothing.
Re: Running love2d programs with intellij idea
Setting working directory allows you to use a dot "." as parameter.
- bobbymcbobface
- Citizen
- Posts: 78
- Joined: Tue Jun 04, 2019 8:31 pm
Re: Running love2d programs with intellij idea
ok so i kinda got it working but an error raised concerning my code ~
and it raises the error specifically on this line
but this was working perfectly fine before my run configuration glitched out, here's my run config:
Program:"C:\Program Files\LOVE\love.exe" "C:\path\Documents\Love2-Lua projects\Snake"
Working Dir: .
referring to a post found here: https://love2d.org/forums/viewtopic.php?t=82515
and quoting zorg
and if not then what is wrong with my config?
~thanks
Code: Select all
"\"C:\Program Files\LOVE\love.exe\" \"C:\path\Documents\Love2-Lua projects\Snake\""
Error: Menu.lua:292: bad argument #2 to 'printf' (number expected, got nil)
stack traceback:
[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
[C]: in function 'printf'
Menu.lua:292: in function 'draw'
main.lua:19: in function 'draw'
[string "boot.lua"]:618: in function <[string "boot.lua"]:594>
[C]: in function 'xpcall'
Code: Select all
love.graphics.printf("Begin", A1, 10, 200)
Program:"C:\Program Files\LOVE\love.exe" "C:\path\Documents\Love2-Lua projects\Snake"
Working Dir: .
referring to a post found here: https://love2d.org/forums/viewtopic.php?t=82515
and quoting zorg
would that be an easier way of doing things instead of using a run config and if so how would i achieve this?I personally use a file called "run.bat", that's in all my folders, with the path to the executable in it, and it runs main.lua. simple.
For example:
"e:\Portable Programs\love-0.10.1-win64\love.exe" .\
and if not then what is wrong with my config?
~thanks
I make games that run on potatoes :P
Re: Running love2d programs with intellij idea
Well this has clearly nothing to do with your config because your argument #2 (A1) is nil, as appears in Menu.lua @ line 292. Pay attention to error messages, they tell you exactly what went wrong. You can make error messages point to specific mistakes in your code by adopting defensive programming practices.
- bobbymcbobface
- Citizen
- Posts: 78
- Joined: Tue Jun 04, 2019 8:31 pm
Re: Running love2d programs with intellij idea
Oh I'm an idiot ~ after a quick scan I realise that menu.load() wasn't being called so it was detecting A1 as a nill value
Well anyways thanks for the help and hopefully I'll get better at debugging soon
~ Thanks
Well anyways thanks for the help and hopefully I'll get better at debugging soon
~ Thanks
I make games that run on potatoes :P
Who is online
Users browsing this forum: Google [Bot] and 125 guests