Hi! XD
What are formal arguments and can I pass a number variable to take in for the argument?
I only hope you're not talking about an argument done in suits and ties... but that's the only one I'm familiar with in this case. x.x
More description, please?
Like this below:
def moveto_target(px = 0 , py = 0,jump = false )where px = 0 and py = 0. For some reason its not taking any number variables that I pass in?
EDIT:
I tried changing it with an instance variable such as this
def moveto_target(@movetox , @movetoy,jump = false )and it throws me the Formal arguments cannot be instance variable
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
You need to explain what you are trying to do, not how you are trying to do it, because obviously the way you are trying to do it is not working.
There is no moveto_target method, which means you are writing your own. How do you know it's not taking the values you pass in? How do you know it's not what's happening inside that's flawed? Show us the whole thing, not just a tiny little bit that may or may not be the problem.
But how can I reference x and y from another method?
def method(x,y)Like, for example, from another method thats calling def method(x,y) has the x and y values and want to use those x and y values for the def method argument?
see my post above. You are not giving us enough information to help you. The method definition you had above is correct. It's either the way you're calling it, or what the method is doing, that has the bug. We can't help you if you don't give us more.
Alright - let's keep it to one thread, then, shall we? Not getting an answer as quickly as you would like is not a reason to start a new thread, especially when people are still helping you in the other one.
Closing.