Navigation

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

    Where does print() print to?

    Help
    6
    12
    478
    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.
    • pianofire
      pianofire Fuze Team last edited by

      There is a good debug function here: https://fuzearena.com/forum/topic/123/debugger-support/4

      1 Reply Last reply Reply Quote 0
      • spt games
        spt games last edited by

        I think "Unrecognised type" is when Fuze cannot convert your data into the string type needed by the print() function. I've encountered this when trying to print out a file handle (see "File Handling" commands in Fuze Help). It crashes the program.

        1 Reply Last reply Reply Quote 0
        • pianofire
          pianofire Fuze Team last edited by

          I have just had a look and type 4 seems to be a void (or nil pointer) which basically means an undefined or unassigned value

          1 Reply Last reply Reply Quote 1
          • J
            Jack_Blue last edited by

            Using print() has never printed anything to my screen!

            pianofire 1 Reply Last reply Reply Quote 0
            • PickleCatStars
              PickleCatStars F last edited by

              I’ve just been making all my variables global and drawtext() ing them right at the end before my update(), otherwise it seems they just got covered up. In 2d, you could do the same with print(), probably, but it might be smarter to write a debug() function with a list that you just add whatever you want to that all gets printed out right at the end..

              1 Reply Last reply Reply Quote 1
              • pianofire
                pianofire Fuze Team @Jack_Blue last edited by

                @Jack_Blue On it's own it doesn't:

                try the following:

                loop
                  clear() 
                  print("Hello World")
                  update()
                repeat
                

                clear() - clears the frame buffer

                print() - prints a message to the framebuffer

                update() - outputs the framebuffer to the screen every 1/60 th of a second

                1 Reply Last reply Reply Quote 1
                • J
                  Jack_Blue last edited by

                  Thanks!

                  What if I want to do this:

                   loop
                        clear()
                        for i = 0 to 100 loop
                             print(i)
                        repeat
                        update()
                   repeat
                  

                  Not all of this will be able to fit on the screen at once!

                  Martin 1 Reply Last reply Reply Quote 0
                  • Martin
                    Martin Fuze Team @Jack_Blue last edited by

                    @Jack_Blue said in Where does print() print to?:

                    What if I want to do this:

                    That will work fine

                    1 Reply Last reply Reply Quote 0
                    • pianofire
                      pianofire Fuze Team last edited by

                      So you can use printat(x,y, value) to print at a particular screen location:

                       loop
                            clear()
                            for i = 0 to 100 loop
                                 printat( i % 10 * 5, int ( i / 10), i)
                            repeat
                            update()
                       repeat
                      
                      1 Reply Last reply Reply Quote 1
                      • P
                        petermeisenstein F @Jack_Blue last edited by

                        @Jack_Blue pycharm is good so print does the same like in Python but its more like the print from python 3 and you have to use update()
                        To update your screen.

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