Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    So, There is a bug here. Can anyone fix it?

    Help
    2
    16
    272
    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.
    • SirBots
      SirBots last edited by

      So, this is the version 2 of the current movement script for the AI of This New Ocean. I ran into a bug where the bot won’t change their target coordinates when approaching it. Any help?

      Screenshot 2025-03-24 12.15.27 PM.png

      Your local coder who is working around the clock to make sure great games are made

      Tyller_ 1 Reply Last reply Reply Quote 0
      • Tyller_
        Tyller_ Best Forum Helpers @SirBots last edited by

        @sirbots try adding a console.log or set variable to with the distance block, I dont see an issue here sso that’s the main way to debug

        <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
        </div>

        SirBots 2 Replies Last reply Reply Quote 1
        • SirBots
          SirBots @Tyller_ last edited by

          @tyller_ Here is the full movement code if you want to look at it.

          Note: Scroll X and Y changes based on the player’s movement. Not X and Y cords.

          Your local coder who is working around the clock to make sure great games are made

          1 Reply Last reply Reply Quote 0
          • SirBots
            SirBots @Tyller_ last edited by

            @tyller_ Screenshot 2025-03-24 12.34.08 PM.png

            Your local coder who is working around the clock to make sure great games are made

            SirBots 1 Reply Last reply Reply Quote 0
            • SirBots
              SirBots @SirBots last edited by

              @sirbots The say block is for the debugging.

              Your local coder who is working around the clock to make sure great games are made

              Tyller_ 1 Reply Last reply Reply Quote 0
              • Tyller_
                Tyller_ Best Forum Helpers @SirBots last edited by Tyller_

                @sirbots copy and/or take the distance block and make it so a variable sets itself to the distance (or make it say the distance) or just drag it out, that way you cna see what hte distance is each frame

                edit: The only thing I can think of rn is maybe you mixed up cos and sin (like got them backwards) cus I dont know that off the top of my head

                <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                </div>

                SirBots 1 Reply Last reply Reply Quote 0
                • SirBots
                  SirBots @Tyller_ last edited by

                  @tyller_ So, have a separate variable for the distance?

                  Your local coder who is working around the clock to make sure great games are made

                  Tyller_ 1 Reply Last reply Reply Quote 0
                  • Tyller_
                    Tyller_ Best Forum Helpers @SirBots last edited by

                    @sirbots yes, do that or just copy the distance block and put it in a varibel set in the forever loop, then set so that variable is shown, or just make it say the distance in the forever loop. The intent is to see whats changing with teh distance

                    <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                    </div>

                    SirBots 2 Replies Last reply Reply Quote 0
                    • SirBots
                      SirBots @Tyller_ last edited by

                      @tyller_ Got it!

                      Your local coder who is working around the clock to make sure great games are made

                      1 Reply Last reply Reply Quote 0
                      • SirBots
                        SirBots @Tyller_ last edited by

                        @tyller_ The Distance is going down at very small increments. Note that the Scroll X and Y serves as the Player’s X and Y cords. Maybe that might play a part.

                        Your local coder who is working around the clock to make sure great games are made

                        Tyller_ 1 Reply Last reply Reply Quote 0
                        • Tyller_
                          Tyller_ Best Forum Helpers @SirBots last edited by

                          @sirbots can you add a thing to draw a circle on the target? does the bot appear to be not moving anymore/on the target when its going down slowly? whats the distance showing (rounded)?

                          <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                          </div>

                          SirBots 3 Replies Last reply Reply Quote 0
                          • SirBots
                            SirBots @Tyller_ last edited by

                            @tyller_ Let me send you a copy of the game version, so you can look at it.

                            Your local coder who is working around the clock to make sure great games are made

                            1 Reply Last reply Reply Quote 0
                            • SirBots
                              SirBots @Tyller_ last edited by

                              @tyller_ https://play.creaticode.com/projects/67e19d92628c7a862450d3cc

                              Your local coder who is working around the clock to make sure great games are made

                              1 Reply Last reply Reply Quote 0
                              • SirBots
                                SirBots @Tyller_ last edited by

                                @tyller_ WAIT! I fixed it. Variables were in the wrong places.

                                Your local coder who is working around the clock to make sure great games are made

                                Tyller_ 1 Reply Last reply Reply Quote 0
                                • Tyller_
                                  Tyller_ Best Forum Helpers @SirBots last edited by

                                  @sirbots Im curious, was it misplaced blocks elsewhere? or did you accidentally set something like box or the change thing to something else

                                  <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                                  </div>

                                  SirBots 1 Reply Last reply Reply Quote 0
                                  • SirBots
                                    SirBots @Tyller_ last edited by

                                    @tyller_ I used the wrong operators, and I didn’t have the proper distance variable in the movement scripts.

                                    Your local coder who is working around the clock to make sure great games are made

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