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. Fast Sync Variables Lib

Fast Sync Variables Lib

Scheduled Pinned Locked Moved Project Showcase
projectlibrarylib
5 Posts 2 Posters 1.6k 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 Offline
    Tyller_T Offline
    Tyller_
    trusted helpers
    wrote on last edited by Tyller_
    #1

    I have made a project that uses the multiplayer blocks to sync any amount of (positive whole) numbers tied to labels pretty fast.
    It’s like a library (coding libraries are files that you import into a project containing pre-programmed general purpose functions to make coding easier), you drag two custom blocks that don’t take up too much space into any sprite where you need to use it.
    You can add any number of labels that will be across all clients in the sprite you backpack.
    Everything you need to touch is in the upper left corner of the workspace.

    I plan on making more projects that act as libraries, provide any feedback in replies! (if somebody wants to understand what it doing I can add comments to the project and explain in replies, but you would only need them if you want to understand how it works, you don’t need comments if you just wanna use it)

    https://play.creaticode.com/projects/67320febbf68856fe984969b

    “Did you mean for it to say “Lib”?” - Catty
    ”Yes, lib is the standard abbreviation for library across all programming languages” - Tyller

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

    CreatiCodeI 1 Reply Last reply
    2
    • Tyller_T Tyller_

      I have made a project that uses the multiplayer blocks to sync any amount of (positive whole) numbers tied to labels pretty fast.
      It’s like a library (coding libraries are files that you import into a project containing pre-programmed general purpose functions to make coding easier), you drag two custom blocks that don’t take up too much space into any sprite where you need to use it.
      You can add any number of labels that will be across all clients in the sprite you backpack.
      Everything you need to touch is in the upper left corner of the workspace.

      I plan on making more projects that act as libraries, provide any feedback in replies! (if somebody wants to understand what it doing I can add comments to the project and explain in replies, but you would only need them if you want to understand how it works, you don’t need comments if you just wanna use it)

      https://play.creaticode.com/projects/67320febbf68856fe984969b

      “Did you mean for it to say “Lib”?” - Catty
      ”Yes, lib is the standard abbreviation for library across all programming languages” - Tyller

      CreatiCodeI Offline
      CreatiCodeI Offline
      CreatiCode
      wrote on last edited by
      #2

      @tyller_

      This is a great idea. Thank you for sharing.

      Can you explain a bit more how it works internally? Most people are not familiar with the multiplayer blocks, and this can be a good example for learning about them.

      Tyller_T 1 Reply Last reply
      1
      • CreatiCodeI CreatiCode

        @tyller_

        This is a great idea. Thank you for sharing.

        Can you explain a bit more how it works internally? Most people are not familiar with the multiplayer blocks, and this can be a good example for learning about them.

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

        @info-creaticode well it’s an iffy example for learning, I use the synchronously set direction block (because it’s the only multiplayer block where you directly set the value of the block, and multiplayer blocks use web sockets I believe, which i know are the fastest communication method) to set the direction of several clones precisely.
        I use some math to turn the value that is supposed to be synced to several directions and vice versa.
        (The person using the lib manually sets how many extra clones there are for each value, though 2 are likely only ever needed because 2 clones alone is 12600 max value)

        edit: Ig I’ll add comments because if people want to learn more technical details (or they know how technical stuff works and just need some explaining)

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

        CreatiCodeI 1 Reply Last reply
        1
        • Tyller_T Tyller_

          @info-creaticode well it’s an iffy example for learning, I use the synchronously set direction block (because it’s the only multiplayer block where you directly set the value of the block, and multiplayer blocks use web sockets I believe, which i know are the fastest communication method) to set the direction of several clones precisely.
          I use some math to turn the value that is supposed to be synced to several directions and vice versa.
          (The person using the lib manually sets how many extra clones there are for each value, though 2 are likely only ever needed because 2 clones alone is 12600 max value)

          edit: Ig I’ll add comments because if people want to learn more technical details (or they know how technical stuff works and just need some explaining)

          CreatiCodeI Offline
          CreatiCodeI Offline
          CreatiCode
          wrote on last edited by
          #4

          @tyller_

          Yes, comments would be helpful. Also, you might want to clean up the blocks so it’s easier to read.

          BTW, your code does not create or join any multiplayer game. Is that done separately?

          Tyller_T 1 Reply Last reply
          1
          • CreatiCodeI CreatiCode

            @tyller_

            Yes, comments would be helpful. Also, you might want to clean up the blocks so it’s easier to read.

            BTW, your code does not create or join any multiplayer game. Is that done separately?

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

            @info-creaticode it does that in the backdrop, the lib is intended to have the setup ran after the user has joined a game, everything in backdrop is for demonstration purposes

            <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

            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