Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Help with functions!

    Help
    2
    6
    305
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • poof92
      poof92 last edited by

      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 vinicity 2 Replies Last reply Reply Quote 0
      • poof92
        poof92 @poof92 last edited by

        @poof92 also how would you break out of a function early? Perhaps on the push of a button

        vinicity 1 Reply Last reply Reply Quote 0
        • vinicity
          vinicity F @poof92 last edited by

          @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?

          1 Reply Last reply Reply Quote 1
          • vinicity
            vinicity F @poof92 last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • poof92
              poof92 last edited by

              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

              1 Reply Last reply Reply Quote 0
              • vinicity
                vinicity F last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post