Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Project Showcase
  3. Anything I can add/fix? - Bot Test

Anything I can add/fix? - Bot Test

Scheduled Pinned Locked Moved Project Showcase
29 Posts 2 Posters 6.3k Views 1 Watching
  • 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.
  • Tyller_T Tyller_

    @011830-0a42ef84 You should add a sound hearing system (where certain actions make the ai hear something) you’d be able to make it very dynamic since you could just spawn a sound sprite with a variable/thing in the clone id to indicate how loud it is, and therefore how far the ai can notice it from

    TheNicknameGovT Offline
    TheNicknameGovT Offline
    TheNicknameGov
    trusted helpers
    wrote on last edited by
    #3

    @tyller_, There’s a slight issue with that.

    I have problems with cloning because it never seems to work properly and there are always bugs. I end up just coding everything in the main sprite instead of a clone.

    If you want, you could help me with this problem and show me how to re-code it.

    Tyller_T 1 Reply Last reply
    0
    • TheNicknameGovT TheNicknameGov

      @tyller_, There’s a slight issue with that.

      I have problems with cloning because it never seems to work properly and there are always bugs. I end up just coding everything in the main sprite instead of a clone.

      If you want, you could help me with this problem and show me how to re-code it.

      Tyller_T Offline
      Tyller_T Offline
      Tyller_
      trusted helpers
      wrote on last edited by
      #4

      @011830-0a42ef84 sure, share it (I think Im friended so if you really don’t want it public you can share with friends) my idea would either be a custom block that adds data to a list and/or sends a broadcast with parameters, then the ai receives that and process it, so for the broadcast it would be (assuming you want a custom block to format the data and be repeatable easy)

      PS: as I’m typing this out I realize it’s hard to understand if you don’t have experience reading script code or using broadcast blocks to put data in a string and using part number of string to get that data

      The custom block:
      define makeSound(x, y, loudness) /
      broadcast (sound) with parameter (x, y, loudness) // use something like join text with separator

      In the ai sprite:
      When I receive (sound) with parameter [inputs] /
      if (distance between sound x sound y and x position y position < loudness) then
      ---- // do the stuff

      IF that was confusing I Think if you tell xo chat what I described it as they can make an example or just make it (so if you tell xo chat something like “make a custom block that takes an x and y position as well as a loudness value and broadcast it, then a receiving broadcast block to handle the sound” infact you might be able to ask it to implement the sound system as a whole

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

      TheNicknameGovT 1 Reply Last reply
      0
      • Tyller_T Tyller_

        @011830-0a42ef84 sure, share it (I think Im friended so if you really don’t want it public you can share with friends) my idea would either be a custom block that adds data to a list and/or sends a broadcast with parameters, then the ai receives that and process it, so for the broadcast it would be (assuming you want a custom block to format the data and be repeatable easy)

        PS: as I’m typing this out I realize it’s hard to understand if you don’t have experience reading script code or using broadcast blocks to put data in a string and using part number of string to get that data

        The custom block:
        define makeSound(x, y, loudness) /
        broadcast (sound) with parameter (x, y, loudness) // use something like join text with separator

        In the ai sprite:
        When I receive (sound) with parameter [inputs] /
        if (distance between sound x sound y and x position y position < loudness) then
        ---- // do the stuff

        IF that was confusing I Think if you tell xo chat what I described it as they can make an example or just make it (so if you tell xo chat something like “make a custom block that takes an x and y position as well as a loudness value and broadcast it, then a receiving broadcast block to handle the sound” infact you might be able to ask it to implement the sound system as a whole

        TheNicknameGovT Offline
        TheNicknameGovT Offline
        TheNicknameGov
        trusted helpers
        wrote on last edited by
        #5

        @tyller_ I shared it.

        I made the sound (when you shoot) by subtracting the X and Y distance between the bot and the player. If the X distance is less than 150 and Y distance less than 100 when you shoot the bot will hear it and target you.

        Tyller_T 2 Replies Last reply
        0
        • TheNicknameGovT TheNicknameGov

          @tyller_ I shared it.

          I made the sound (when you shoot) by subtracting the X and Y distance between the bot and the player. If the X distance is less than 150 and Y distance less than 100 when you shoot the bot will hear it and target you.

          Tyller_T Offline
          Tyller_T Offline
          Tyller_
          trusted helpers
          wrote on last edited by
          #6

          @011830-0a42ef84 you shouldn’t do anything different based on x and y, since i ts top down x and y should be pretty much treated the same as mechanics

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

          1 Reply Last reply
          0
          • TheNicknameGovT TheNicknameGov

            @tyller_ I shared it.

            I made the sound (when you shoot) by subtracting the X and Y distance between the bot and the player. If the X distance is less than 150 and Y distance less than 100 when you shoot the bot will hear it and target you.

            Tyller_T Offline
            Tyller_T Offline
            Tyller_
            trusted helpers
            wrote on last edited by
            #7

            @011830-0a42ef84 something to add, please try resharing it or un sharing and putting sharing back on, it shows a remix button but I can’t see inside and I tried just adding /editor?version=1 to the end and it showed hte editor for a second before kicking me bakc out (the version=1 is just something it adds, it did have that on the end when I got sent back to the main page)

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

            TheNicknameGovT 1 Reply Last reply
            0
            • Tyller_T Tyller_

              @011830-0a42ef84 something to add, please try resharing it or un sharing and putting sharing back on, it shows a remix button but I can’t see inside and I tried just adding /editor?version=1 to the end and it showed hte editor for a second before kicking me bakc out (the version=1 is just something it adds, it did have that on the end when I got sent back to the main page)

              TheNicknameGovT Offline
              TheNicknameGovT Offline
              TheNicknameGov
              trusted helpers
              wrote on last edited by TNG
              #8

              @tyller_ I just added share to all,
              here’s the link:
              https://play.creaticode.com/projects/67a22b077b46e6c9fc9dc409

              A lot of things might be confusing with how I code it in, so added notes/comments to many of the code chunks

              Tyller_T 1 Reply Last reply
              0
              • TheNicknameGovT TheNicknameGov

                @tyller_ I just added share to all,
                here’s the link:
                https://play.creaticode.com/projects/67a22b077b46e6c9fc9dc409

                A lot of things might be confusing with how I code it in, so added notes/comments to many of the code chunks

                Tyller_T Offline
                Tyller_T Offline
                Tyller_
                trusted helpers
                wrote on last edited by
                #9

                @011830-0a42ef84 I’m going to just go through and see how it works, I’ll probably try making it scalable (able to have multiple zombies/ai’s) and ig because you already have so many sprites I’ll try to make them all work in conjunction (it’s probably good practice to use multiple sprites, I just tend to for some reason unknown to me use very few sprites, though ig sometimes it’s okay but then sometimes I make an entire project in one sprite and don’t mean to) I increased the canvas size and locked the viewport to the player so stuff can be tested with that, now that I type this I kinda wanna try doing ray casting stuff but idk, sry Im rambling

                TLDR: I might rework it or just make it compatible with clones

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

                TheNicknameGovT 1 Reply Last reply
                1
                • Tyller_T Tyller_

                  @011830-0a42ef84 I’m going to just go through and see how it works, I’ll probably try making it scalable (able to have multiple zombies/ai’s) and ig because you already have so many sprites I’ll try to make them all work in conjunction (it’s probably good practice to use multiple sprites, I just tend to for some reason unknown to me use very few sprites, though ig sometimes it’s okay but then sometimes I make an entire project in one sprite and don’t mean to) I increased the canvas size and locked the viewport to the player so stuff can be tested with that, now that I type this I kinda wanna try doing ray casting stuff but idk, sry Im rambling

                  TLDR: I might rework it or just make it compatible with clones

                  TheNicknameGovT Offline
                  TheNicknameGovT Offline
                  TheNicknameGov
                  trusted helpers
                  wrote on last edited by
                  #10

                  @tyller_, Lol
                  I added a lot more variables and sprites than what I originally anticipated because I wanted to have a better AI than one that just either goes toward you constantly or doesn’t feel as realistic as the one I created.

                  Tyller_T 1 Reply Last reply
                  0
                  • TheNicknameGovT TheNicknameGov

                    @tyller_, Lol
                    I added a lot more variables and sprites than what I originally anticipated because I wanted to have a better AI than one that just either goes toward you constantly or doesn’t feel as realistic as the one I created.

                    Tyller_T Offline
                    Tyller_T Offline
                    Tyller_
                    trusted helpers
                    wrote on last edited by
                    #11

                    @011830-0a42ef84 I understand what you mean, I think I’ve thought of a way where you can make all the detectors one sprite, then have it spawn clones for each detector and on a when touching it gets the clone id of the one touching the player and broadcasts stuff based off that

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

                    TheNicknameGovT 1 Reply Last reply
                    0
                    • Tyller_T Tyller_

                      @011830-0a42ef84 I understand what you mean, I think I’ve thought of a way where you can make all the detectors one sprite, then have it spawn clones for each detector and on a when touching it gets the clone id of the one touching the player and broadcasts stuff based off that

                      TheNicknameGovT Offline
                      TheNicknameGovT Offline
                      TheNicknameGov
                      trusted helpers
                      wrote on last edited by TNG
                      #12

                      @tyller_, That sounds good.
                      Feel free to make one if you want so I can see what idea you have in mind because I doubt I can make that happen. I kind of just stop at cloning, IDs, lists and all that stuff.

                      If you could, I would also like to know how to scroll (viewport) the map because the CreatiCode AI doesn’t help explain it.

                      Tyller_T 1 Reply Last reply
                      0
                      • TheNicknameGovT TheNicknameGov

                        @tyller_, That sounds good.
                        Feel free to make one if you want so I can see what idea you have in mind because I doubt I can make that happen. I kind of just stop at cloning, IDs, lists and all that stuff.

                        If you could, I would also like to know how to scroll (viewport) the map because the CreatiCode AI doesn’t help explain it.

                        Tyller_T Offline
                        Tyller_T Offline
                        Tyller_
                        trusted helpers
                        wrote on last edited by
                        #13

                        @011830-0a42ef84 you have to click edit in the top left of the screen then change the canvas size, put it at like 1000 1000, then in the player sprite get the “lock viewport to sprite” block and set it to Player, then you have it

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

                        TheNicknameGovT 1 Reply Last reply
                        1
                        • Tyller_T Tyller_

                          @011830-0a42ef84 you have to click edit in the top left of the screen then change the canvas size, put it at like 1000 1000, then in the player sprite get the “lock viewport to sprite” block and set it to Player, then you have it

                          TheNicknameGovT Offline
                          TheNicknameGovT Offline
                          TheNicknameGov
                          trusted helpers
                          wrote on last edited by
                          #14

                          @tyller_ Do you have a remixed version? I just deleted a core sprite by accident and i don’t have any backups :c

                          Tyller_T 1 Reply Last reply
                          0
                          • TheNicknameGovT TheNicknameGov

                            @tyller_ Do you have a remixed version? I just deleted a core sprite by accident and i don’t have any backups :c

                            Tyller_T Offline
                            Tyller_T Offline
                            Tyller_
                            trusted helpers
                            wrote on last edited by Tyller_
                            #15

                            @011830-0a42ef84 yeah, also if you have the tab still open click edit and try clicking restore sprite, if that isn’t there then try refreshing without saving

                            edit:https://play.creaticode.com/projects/67a4fb9137d5f05663875c86

                            edit 2: I touched some stuff so make sure everything is connected (I was going to disable some stuff to rework it)

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

                            TheNicknameGovT 3 Replies Last reply
                            0
                            • Tyller_T Tyller_

                              @011830-0a42ef84 yeah, also if you have the tab still open click edit and try clicking restore sprite, if that isn’t there then try refreshing without saving

                              edit:https://play.creaticode.com/projects/67a4fb9137d5f05663875c86

                              edit 2: I touched some stuff so make sure everything is connected (I was going to disable some stuff to rework it)

                              TheNicknameGovT Offline
                              TheNicknameGovT Offline
                              TheNicknameGov
                              trusted helpers
                              wrote on last edited by
                              #16
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • Tyller_T Tyller_

                                @011830-0a42ef84 yeah, also if you have the tab still open click edit and try clicking restore sprite, if that isn’t there then try refreshing without saving

                                edit:https://play.creaticode.com/projects/67a4fb9137d5f05663875c86

                                edit 2: I touched some stuff so make sure everything is connected (I was going to disable some stuff to rework it)

                                TheNicknameGovT Offline
                                TheNicknameGovT Offline
                                TheNicknameGov
                                trusted helpers
                                wrote on last edited by
                                #17

                                @tyller_ I got lucky. Thanks

                                1 Reply Last reply
                                0
                                • Tyller_T Tyller_

                                  @011830-0a42ef84 yeah, also if you have the tab still open click edit and try clicking restore sprite, if that isn’t there then try refreshing without saving

                                  edit:https://play.creaticode.com/projects/67a4fb9137d5f05663875c86

                                  edit 2: I touched some stuff so make sure everything is connected (I was going to disable some stuff to rework it)

                                  TheNicknameGovT Offline
                                  TheNicknameGovT Offline
                                  TheNicknameGov
                                  trusted helpers
                                  wrote on last edited by
                                  #18

                                  @tyller_ When I added a viewport, the looking at mouse trigger bugged and it won’t properly.

                                  Tyller_T 1 Reply Last reply
                                  0
                                  • TheNicknameGovT TheNicknameGov

                                    @tyller_ When I added a viewport, the looking at mouse trigger bugged and it won’t properly.

                                    Tyller_T Offline
                                    Tyller_T Offline
                                    Tyller_
                                    trusted helpers
                                    wrote on last edited by
                                    #19

                                    @011830-0a42ef84 oh yeah , I added stuff to fix that, you have to do

                                    point in direction(direction from x (0) y (0) x(mouse x) y(mouse y))

                                    in order to do it, its a weird bug, I think what it’s doing is pointing from player x y to the mouse (which makes sense) but the mouse x y is relative to the screen, so you could be 500 pixels right and if you click in the middle of the screen, instead of showing 500 mouse x 0 mouse y it shows 0 mouse x 0 mouse y, and if you want something that isn’t the player to look at hte mouse I can make an example if you really need i t

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

                                    TheNicknameGovT 2 Replies Last reply
                                    1
                                    • Tyller_T Tyller_

                                      @011830-0a42ef84 oh yeah , I added stuff to fix that, you have to do

                                      point in direction(direction from x (0) y (0) x(mouse x) y(mouse y))

                                      in order to do it, its a weird bug, I think what it’s doing is pointing from player x y to the mouse (which makes sense) but the mouse x y is relative to the screen, so you could be 500 pixels right and if you click in the middle of the screen, instead of showing 500 mouse x 0 mouse y it shows 0 mouse x 0 mouse y, and if you want something that isn’t the player to look at hte mouse I can make an example if you really need i t

                                      TheNicknameGovT Offline
                                      TheNicknameGovT Offline
                                      TheNicknameGov
                                      trusted helpers
                                      wrote on last edited by
                                      #20

                                      @tyller_ Can you screenshot the blocks?

                                      1 Reply Last reply
                                      0
                                      • Tyller_T Tyller_

                                        @011830-0a42ef84 oh yeah , I added stuff to fix that, you have to do

                                        point in direction(direction from x (0) y (0) x(mouse x) y(mouse y))

                                        in order to do it, its a weird bug, I think what it’s doing is pointing from player x y to the mouse (which makes sense) but the mouse x y is relative to the screen, so you could be 500 pixels right and if you click in the middle of the screen, instead of showing 500 mouse x 0 mouse y it shows 0 mouse x 0 mouse y, and if you want something that isn’t the player to look at hte mouse I can make an example if you really need i t

                                        TheNicknameGovT Offline
                                        TheNicknameGovT Offline
                                        TheNicknameGov
                                        trusted helpers
                                        wrote on last edited by
                                        #21

                                        @tyller_ I’m using this as a pointer:
                                        1dfa4819-7f26-4f5b-beb2-3dee9fba6434-image.png
                                        the problem is, it starts bugging when I go near or on the edge

                                        Tyller_T 1 Reply Last reply
                                        0
                                        • TheNicknameGovT TheNicknameGov

                                          @tyller_ I’m using this as a pointer:
                                          1dfa4819-7f26-4f5b-beb2-3dee9fba6434-image.png
                                          the problem is, it starts bugging when I go near or on the edge

                                          Tyller_T Offline
                                          Tyller_T Offline
                                          Tyller_
                                          trusted helpers
                                          wrote on last edited by
                                          #22

                                          @011830-0a42ef84 it always bugs like that, I don’t know how to fix that since yo can’t use viewport x/y because that is not relative to the real x y position of the viewport (its some weird shortened one)

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

                                          TheNicknameGovT 1 Reply Last reply
                                          1

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • CreatiCode