New error: [string "lev1.lua"]:10: bad argument #4 to 'circle' (number expected, got no value).
I must be REALLY bad at this...
Nothing happens when I call function in other script/file?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Nothing happens when I call function in other script/fil
It means that, in the file 'lev1.lua', at the 10th line, you didn't type the 4th argument of the 'circle' function... In other words, you tell LOVE where to draw the circle, but you don't tell it its radius[string "lev1.lua"]:10: bad argument #4 to'circle' (number expected, got no value).
Last edited by Nixola on Thu Feb 23, 2012 10:23 pm, edited 1 time in total.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Nothing happens when I call function in other script/fil
Oh...I really should pay attention to how many arguments I have to put in. I made this mostly by combining tutorials, and I KIND of understand the code. Thank you!
Re: Nothing happens when I call function in other script/fil
Uh...I put in , but I still get the error
edit:
I even tried replacing that with an actual number, still get the error
Code: Select all
objects.ball.shape:getRadius()
edit:
I even tried replacing that with an actual number, still get the error
Re: Nothing happens when I call function in other script/fil
OKAY, so, I managed to stop all errors, but, upon pressing enter it just flashes. If it's clearing, then redrawing everything, that's bad. Because I want it to just draw back the ball and the ground. As far as I know, that's all I told it to do. When I call a function from another file, does it go back and run main again? I'm confused.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Nothing happens when I call function in other script/fil
You might want to read love.run. It explains what happens when you run a game, what functions are called. (Hint: it's all in a big ol' loop.)
Help us help you: attach a .love.
Re: Nothing happens when I call function in other script/fil
Hmm, I can see how that might be a problem...any way for me to make it stay on the "lev1" file?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Nothing happens when I call function in other script/fil
I don't think I understand your question. Could you clarify?
Help us help you: attach a .love.
Re: Nothing happens when I call function in other script/fil
Are you using "requires" for loading different levels? Do you will "require" a lot of levels? IMHO I think it's a better tecnique use
to pump the files and replace with new level data or new functions needed instead of require multiples levels files.
Code: Select all
load_level = love.filesystem.load( wanted_level_file )
run_level = load_level()
to pump the files and replace with new level data or new functions needed instead of require multiples levels files.
Re: Nothing happens when I call function in other script/fil
Um...I'm kind of new, so I'm not sure what to type to ACTIVATE those variables, if that's even what I'm supposed to do...
Who is online
Users browsing this forum: Google [Bot] and 3 guests