Modding Help Content Patcher Animations & Random token Issue

Discussion in 'Mods' started by Tanpoponoko, Jan 12, 2020.

  1. Tanpoponoko

    Tanpoponoko Big Damn Hero

    Hello!

    I tried to make an edit of this Easter Egg mod that contains random colored easter eggs for personal use. Here is the code I'm using:

    "Changes": [
    {
    "Action": "EditImage",
    "Target": "Maps/springobjects",
    "FromFile": "assets/{{Random:EasterEgg1, EasterEgg2, EasterEgg3, EasterEgg4, EasterEgg5, EasterEgg6, EasterEgg7, EasterEgg8, EasterEgg9, EasterEgg10, EasterEgg11, EasterEgg12}}.png",
    "FromArea": { "X": 0, "Y": 0, "Width": 16, "Height": 16 },
    "ToArea": { "X": 224, "Y": 288, "Width": 16, "Height": 16 },
    },
    {
    "Action": "EditData",
    "Target": "Data/ObjectInformation",
    When: {
    "HasMod:AnimReb": "false",},
    "Entries": {
    "446": "Easter Egg/565/-300/Basic -18/Easter Egg/A chocolate egg wrapped in foil. Where did it come from?"
    },
    },
    {
    "Action": "EditData",
    "Target": "Data/ObjectInformation",
    "When": {
    "HasMod:AnimReb": "true",
    },
    "Entries": {
    "446": "Easter Egg/600/-300/Basic -18/Easter Egg/A chocolate egg wrapped in foil. Where did it come from?",
    },
    },
    ]
    }


    Now, the randomization works perfectly fine....however, somehow when I set it to draw a random egg, it also stops Content patcher animations from working on the same file (Spring Objects).

    I have Undare's sparkling gems loaded up and they stop being animated when I have a random set of eggs. The gems are specified to each specific area on Spring Objects, and so are the easter eggs. They continue to sparkle if I only have ONE egg that I'm using, and not the random set.

    Is there any way to have these two mods work in harmony? I'll even do a funky workaround if it's possible.

    Thank you!
     
    • Allayna

      Allayna Pangalactic Porcupine

      Do you have a log file? This might be a bug with CP Animations and the random token, not sure....
      Run the game with your random egg mod and your animated gems, then post your log here - https://smapi.io/log
      I'll take a look, but we may need to talk to spacechaser

      also, that random egg thing sounds cool, does it mean if you get two eggs in a day, each one is random? or is it random each time you run the game?
       
      • Tanpoponoko

        Tanpoponoko Big Damn Hero

        As far as I've seen, nothing odd appears in the log. I know it's these two that are interacting with each other because I removed all others mods and still got this result. Here is my log with the random eggs and the animated gems for reference.

        From what I've seen in my tests, every time a 'rabbit's foot' (renamed as easter egg) appears it will randomly draw from the possible options of eggs and replace it with that.

        Hopefully I can get it sorted out and ask the original mod owner if they want to add the different eggs as an option :)
         
        • Allayna

          Allayna Pangalactic Porcupine

          I do notice you need to update some of your mods (though you said you tested with just those two), and SMAPI itself.... I also notice the animations mod hasn't been updated since before 1.4.
          Also it has not been updated since Content Patcher added the ability to use the 'random' token, so there may be something weird there. So yeah, i think contact with spacechase (maker of CP animation) with this issue!
           
            Tanpoponoko likes this.
          • Tanpoponoko

            Tanpoponoko Big Damn Hero

            I downloaded the latest version of CP animations from Spacechase0's website today, which I believe is more current than the one on nexus, so I think that might not be what's doing it. Updated SMAPI just now and the issue still happens.
             
              Last edited: Jan 12, 2020
            • Allayna

              Allayna Pangalactic Porcupine

              hmmm i didn't see that.... yeah, that was updated same day as the 'random' was first added on CP, but there was more stuff and fixed added for 'random' things later... so maybe, maybe not *shrug*
               
              • Tanpoponoko

                Tanpoponoko Big Damn Hero

                Tried to think of a workaround. I created a new item for easter egg with Json assets to try to avoid the issue. Is there a way to edit other mods with content patcher? I was hoping to target the image into the JA mod and make that random.

                Edit: Tried putting the random egg code inside the gemstones content file to see if that would work--still made the gems stop sparkling. Hm!
                 
                  Last edited: Jan 12, 2020
                • Allayna

                  Allayna Pangalactic Porcupine

                  had a funny thought... make a psychedelic egg using cp animations....
                  give me a while, its like 5am so I'm not really awake, ill try later to build a thing myself to test.

                  edit 7 HOURS later....
                  Uhhhhh ok I don't know WHY, but I found where things break.... If you have more than 4 options for the 'random' item, the animations stop....

                  At first I recolored the egg 2 times, having
                  "FromFile": "assets/{{Random:EasterEgg1, EasterEgg2, EasterEgg3}}.png",

                  then i noticed that though the animations still worked! the eggs weren't choosing randomly (at least in the item spawner???), so I did something you can do to make another color more likely, and did
                  "FromFile": "assets/{{Random:EasterEgg1, EasterEgg1, EasterEgg1, EasterEgg2, EasterEgg3}}.png",
                  so 5 options to choose from, and the animations stopped! queue me being confused!

                  Then I went to
                  "FromFile": "assets/{{Random:EasterEgg1, EasterEgg1, EasterEgg2, EasterEgg3}}.png",
                  4 options to choose, and animations worked again!

                  WEIRD
                  Gonna go talk to peeps in the discord (hopefully Pathos :rofl:)
                   
                    Last edited: Jan 12, 2020
                  • Iris Blanche

                    Iris Blanche Master-Pudding Forum Moderator

                    Please stop doubleposting after such a short time. Edit your posts instead if you want to make additions to your previous posts.
                    I merged the posts.
                     
                    • Tanpoponoko

                      Tanpoponoko Big Damn Hero

                      Just did some testing on my end. I had the random token in and to do three eggs - no dice, no animations. Tried with two eggs - didn't work.
                      Used the random token with ONE egg only in the set, and the animation worked.

                      Tried updating the 'format' of both files to 1.11.0, and same exact story.

                      I'm very lost.
                       
                      • Allayna

                        Allayna Pangalactic Porcupine

                        that's wierd.... I did notice that the random part didn't seem to be working on my end, but the animations did work with 4 or less random options....
                        can you try my versions of the files?
                        only extra thing i did was move all the animation files into an 'assests' folder cuz that bugs me personally...
                        just make sure to backup your stuff of course!
                         

                          Attached Files:

                        • Tanpoponoko

                          Tanpoponoko Big Damn Hero

                          Tried those on mine! Random eggs works, no animation.
                           
                          • Allayna

                            Allayna Pangalactic Porcupine

                            huh.... can I try your version of the two mods? maybe I'll spot something in the code, dunno

                            So, i've had it work and not work from day to day...
                            egg color chosen doesn't matter, egg color being the same two days or more doesn't matter

                            Really not sure what's happening here....
                             
                              Last edited: Jan 12, 2020
                            • Tanpoponoko

                              Tanpoponoko Big Damn Hero

                              Here is what I'm using, the easter eggs currently set to only one. The code in the gemstones might look different cause I shuffled some up, but the differences should only relate to which item goes where on the spring objects sheet.
                               

                                Attached Files:

                              • Allayna

                                Allayna Pangalactic Porcupine

                                So I spent a couple weeks in game trying to see if it would work every other day or some junk like that, and I can't see any pattern....
                                it DOES work sometimes, but like over a week apart in-game. I had two weeks when ONLY tuesday worked, and I was like WUT. But then the 3rd tues didn't work so *shrug*
                                I did message spacechase on Nexus, we'll see if I get a reply
                                 
                                  Tanpoponoko likes this.
                                • Tanpoponoko

                                  Tanpoponoko Big Damn Hero

                                  Thank you so much for helping me out with this! I messaged him as well! Hopefully he will be able to help out :)
                                   

                                  Share This Page