Navigation

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

    Help with arrays and structures I think.

    Coding
    2
    8
    167
    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

      So I'm making a catching game kind of like Pokémon but when ever I get a monster I have it display the name of the monster along with the state of a bool. But the problem is it always displays the same line even if it's another monster. I'm using an array but I'm finding it hard to get to work.Video of problem
      Screenshots of code

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

        If I'm understanding right, it looks like

        if c.zr and battleStarted and OrbRNG < 5 and NumMon < 3 and EnemyMonsters[0].id == 0 then
        

        will always be true, therefore always changing battleStarted to false and so the next two ifs don't get read.
        I'm guessing you have a variable that stores which enemy you've come across? In which case perhaps your ifs should look like this:

        if c.zr and battleStarted and OrbRNG < 5 and NumMon < 3 and EnemyMonsters[0].id == enemyEncountered then
        
        poof92 1 Reply Last reply Reply Quote 1
        • poof92
          poof92 last edited by

          Thanks a bunch I'll give it a try!

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

            @kat hi sorry I'm having some trouble understanding how I would set up the enemy encounter variable

            Kat 1 Reply Last reply Reply Quote 0
            • Kat
              Kat Fuze Team @poof92 last edited by

              @poof92 apologies, I meant enemyEncountered to be a placeholder for a variable I'm guessing you have already. Do you have one which picks the enemy you encounter? For example in the video you shared it picks the Whisp.

              poof92 1 Reply Last reply Reply Quote 1
              • poof92
                poof92 @Kat last edited by

                @kat yes I think I do, I have a variable called R which is equal to random to randomly pick a monster

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

                  It works thanks so much for the help

                  Kat 1 Reply Last reply Reply Quote 0
                  • Kat
                    Kat Fuze Team @poof92 last edited by

                    @poof92 Great! You're welcome :) Glad I could help!

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