Hello guys. I am dev on a wiki for a game that uses spine. I have access to all of the files, but I'd like some help using the spine web player. For starters, when I try to use some of the modifiers like animation or showControls, the player breaks. Besides that, the place where the Spine files are doesn't have CORS enabled and I'd like some tips on how to use BIT64 encoding since last time I tried using that the player also broke.

Could someone help me out?

    Related Discussions
    ...

    LeinadNoscaj

    We are more than happy to help you, but your request is too generic.
    I strongly advise you to share the code you attempted so we can point out where you are making mistakes 🙂

    Have you gone through the web player documentation and examples?
    Most of the answers are probably already there.

      Davide
      Hey Davide, Thanks for your reply.
      So first, before I was going to try inputting my spine data, I wanted to experiment with the default one
      I used this string in HTML

      <script src="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/iife/spine-player.js"></script>
      <link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/spine-player.css">
      
      <div id="player-container" style="width: 100%; height: 100vh;"></div>
      
      <script>
      new spine.SpinePlayer("player-container", {
      	skeleton: "https://esotericsoftware.com/files/examples/4.2/spineboy/export/spineboy-pro.json",
      	atlas: "https://esotericsoftware.com/files/examples/4.2/spineboy/export/spineboy-pma.atlas"
      	animation: "walk"
      });
      </script> 

      and it stopped working when I added the animation string.
      Once I figure out how to get that working, I would like to be able to use these spine files to create a working web player on fandom for more skins then the one I am about to describe
      https://https://www.gimkit.com/assets/map/characters/spine/snowman.json
      https://www.gimkit.com/assets/map/characters/spine/snowman.atlas
      https://www.gimkit.com/assets/map/characters/spine/snowman-v2.41.png

      i figured out how to define the animations properly. Is there a way to get them to cycle through certain animations after a set number of seconds/repititions?

        Davide
        i would also like to figure out what is wrong with the spine files for the files I gave
        it pulls up blank whenever I plug the files into any online spine preview, or even the web viewer when I had CORS disabled

          LeinadNoscaj Is there a way to cycle through certain animations after a set number of seconds or repetitions?

          You need to handle that programmatically, as described in the Advanced playback section of the player documentation.

          LeinadNoscaj I’d also like to figure out what’s wrong with the Spine files I provided.
          Whenever I load them into any online Spine preview or even the web viewer (with CORS disabled), they appear blank.

          Try inspecting the contents of your skeleton file and comparing it to Spineboy’s file.

          It looks like your skeleton file is not in the correct format. Where did you export it from?

            Davide
            I never exported the skeleton. That's the location of the file being used by the actual game.
            I've seen multiple sites using this exact file through a runtime player to get the animation they want. How, I'm not sure

              Besides the main gimkit.com?
              it renders a preview on gimkit.com/rewards/item-shop

                LeinadNoscaj

                I'm sorry, but I don't see anything consuming that file. If you can point me to one of those

                multiple sites using this exact file,

                I'd be happy to take a look at how that file format is being used.

                the specific file is used in my locker
                since I forgot you won't have access to that specific Gim(name of the character using the spine) try this:
                https://www.gimkit.com/assets/map/characters/spine/detective.json
                https://www.gimkit.com/assets/map/characters/spine/detective.atlas
                https://www.gimkit.com/assets/map/characters/spine/detective-v2.41.png

                This Gim can be found here https://www.gimkit.com/rewards/item-shop
                when you scroll down and click on detective baka, then click the Gim. Once clicked it will start running.
                If you need an account to see it and don't want to make one, I can give you the username and password to a shared account if you could change this thread to private

                  LeinadNoscaj

                  As far as I can see, that seems to me a compressed/encrypted/encoded version of the actual skeleton file. I don't know the reason about that, but I assume the website owner does not want those assets to be used outside their website.

                  after I do that, I still need to set the animation loops
                  Unfortunately I didn't really understand the documentation, can you explain how to set an animation to loop for 2 seconds, start another for 2 seconds, then run one once and restart?

                    Davide
                    also, rq before I message the owner of Gimkit I need to make sure it is something he would have actually had control over. He has been using spine through Https://www.Phaser.io, do you know if they format Spine differently?

                    LeinadNoscaj

                    Unfortunately, I didn't really understand the documentation. Can you explain how to set an animation to loop for 2 seconds, start another for 2 seconds, then run one once and restart?

                    Carefully read the Advanced Playback section. In the success callback, you should call setAnimation and addAnimation, using the appropriate delay parameter based on the mix duration you set.

                    I found some resources that might help with decoding. Before I contact the creator of Gimkit, do any of these seem relevant for processing code in a specific way?
                    https://www.gimkit.com/index.f94d18b6.js
                    https://www.gimkit.com/App.bd3a6d62.js
                    https://www.gimkit.com/App.3d7597ef.js
                    https://www.gimkit.com/App.5c2d4074.js

                    Sorry, but I won’t analyze that code for you.

                    Also, before I message the owner of Gimkit, I need to confirm whether it's something he would actually have control over. He has been using Spine through Phaser. Do you know if Phaser formats Spine differently?

                    All the Spine Phaser runtimes I’m aware of, including our spine-phaser, use assets directly exported from the Spine Editor.

                      Davide I'm not great at coding, could you provide an example that uses multiple animations and the delay? I'm trying to plug stuff in, but it's not working right.

                      • Luke replied to this.