Help with functions!
-
I have a function for my battle setup it's an rpg! But for some reason I can't use an if statement in a function!
-
@poof92 also how would you break out of a function early? Perhaps on the push of a button
-
@poof92 said in Help with functions!:
I have a function for my battle setup it's an rpg! But for some reason I can't use an if statement in a function!
That sounds weird. Maybe you need to show your code? Do you get an error message?
-
@poof92 said in Help with functions!:
@poof92 also how would you break out of a function early? Perhaps on the push of a button
If you function consists of a loop, then you can break out of the loop using
break
, otherwise you will have to solve it using flags and if statements.Unfortunately, you can’t call
return
early in Fuze. -
I figured out how to run from the battle I forgot that I could put a loop in a function sorry
But now I can't seem to get a variable to work in a function -
If you want to use a variable in your main loop as well as in your function, you need to either pass it as an argument to the function, or declare it as a global variable.