So i have been making this little game this week, every issue i've found i've been able to solve, except this:
The game file is too big to fit in to this post and it being reasonable, so i have included an attachment with game files, ty.
Virus Total, just for security.https://www.virustotal.com/lv/file/0235 ... 395418972/,
Requesting help: game crashing without any reason.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Requesting help: game crashing without any reason.
- Attachments
-
- Zombies!.zip
- (564.72 KiB) Downloaded 104 times
- moikmellah
- Prole
- Posts: 12
- Joined: Fri Jan 31, 2014 8:31 pm
- Location: USA
- Contact:
Re: Requesting help: game crashing without any reason.
I'm getting the following error when running it:
In main.lua, your definition of G_Print() includes x and y arguments, but when you call it you aren't providing those values, so love.graphics.print() is throwing an error. Try this for your definition of G_Print():
That'll guarantee that if X or Y aren't valid numbers, it'll use a default of 0.
Code: Select all
Error: main.lua:206: bad argument #2 to 'print' (number expected, got nil)
stack traceback:
[C]: in function 'print'
main.lua:206: in function 'G_Print'
main.lua:99: in function 'draw'
[string "boot.lua"]:410: in function <[string "boot.lua"]:373>
[C]: in function 'xpcall'
Code: Select all
function G_Print(text, x, y)
local myX = tonumber(x) or 0
local myY = tonumber(y) or 0
love.graphics.print(text, myX, myY)
end
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: Requesting help: game crashing without any reason.
Alternatively, since you're not doing anything special with the function, just do this:
Code: Select all
G_Print = love.graphics.print
Re: Requesting help: game crashing without any reason.
Oh sorry, i am a moron ^.^
Who is online
Users browsing this forum: Google [Bot] and 3 guests