Modding Discussion A place to discuss map editing and other related stuff

Discussion in 'Mods' started by QuantumConcious, Apr 1, 2016.

Thread Status:
Not open for further replies.
  1. Nishtra

    Nishtra Big Damn Hero

    @Entoarox My experience with C# is rather limited so I'll ask. What if rather than monitoring counter using reflection, you monitor the list of sprites for current location while checking the source rectangle and current position of each sprite? I understand that it is unoptimized and a big waste of resources for a purely cosmetic change, but would it be faster/slower than reflection? And would it really visibly affect the game, since it should be used only in one small location without large amount of objects?
     
    • Entoarox

      Entoarox Oxygen Tank

      It would impact the game quite greatly because you would need to perform the reflection every game tick. The only way it could impact performance more would be if it was every draw tick as well.

      I've looked at the code again, while looking through the sprites list would likely be cheaper in computation time, I cant think of any reliable way to filter only the unmoved cauldron sprites since the bubble effects move by themselves...
       
      • TenkoKuugen

        TenkoKuugen Scruffy Nerf-Herder

        So I found out that you can't use Action Warp X Y <location> from point X to X1 in a dynamic location (building that can be placed)
        Is there a way around that?
         
        • Entoarox

          Entoarox Oxygen Tank

          The only way around that is installing SMAPI, EntoFramework and AdvancedLocationLoader, this adds the `ALLShift` tile action, a special version of Warp that works only within the current location, and due to that works for every location.
           
          • rodrigovaz

            rodrigovaz Lucky Number 13

            Sincerely, I think I found another way to do this, after taking a look at the game code I noticed something:

            the code that rules this behavior is this one:

            this.cauldronTimer = this.cauldronTimer - time.ElapsedGameTime.Milliseconds;
            if (this.cauldronTimer > 0)
            return;

            As long as cauldronTimer is bigger than 0, it won't trigger the sprites thus it becomes as easy as using SMAPI to, once the player enters the wizard_tower location change the cauldronTimer to an obnoxious value like int.MaxValue() and we are done. And while I know that is not a perfect solution, I doubt anyone will spend 596 hours and 30 minutes inside the wizard tower to actually see the animations trigger. In fact, the cauldron timer remains set through the day so it can be reset every morning and there's absolutely no chance you will see it.

            The fire did remain though, are you sire it is a temporary sprite?

            [​IMG]
             
            • Nishtra

              Nishtra Big Damn Hero

              @rodrigovaz To use cauldronTimer you still would need to use refection, though your method is much less resource heavy. The 4 fire sprites are set in the resetForPlayerEntry method (and they have quite annoying positioning on the map).

              I'll run a little test tomorrow and see if it is possible to make it work without much hassle.
               
              • rodrigovaz

                rodrigovaz Lucky Number 13

                Using reflection is not a problem, the problem is having to use it at least 10 times per second(even though the cauldron timer at map start is set to 250 it is later reset to 100 milliseconds). Using reflection once per game day is not a problem at all.

                I found the fire sprites, I think I found a solution for it but gotta test it. Will test it later and post here.
                 
                  Greengrasses likes this.
                • rodrigovaz

                  rodrigovaz Lucky Number 13

                  Yeah, I managed to remove the fire just by reseting the temporarySprites. It is safe as the smoke and fire are the only temporary sprites there and if you do it upon map entry, it won't destroy posterior temporary sprites.
                  ss+(2017-01-07+at+05.44.23).jpg
                   
                  • Entoarox

                    Entoarox Oxygen Tank

                    Hmmm, yes, if you go at it from this angle you can indeed erase existing sprites, and if you reset the timer to int.MaxValue once a in-game day, that would be MORE then enough (It takes more then 24 real-life days before the timer will get anywhere near 100 ms again :p)
                    If you then reset temp sprites on entry, all you need to do is add your own sprites where you want them, and everything will work.

                    You will still need a update hook and a custom ms counter to create the cauldron effect at the new location, but the overal impact should be near nill.
                     
                    • rodrigovaz

                      rodrigovaz Lucky Number 13

                      SMAPI already has a event that gets triggered every 8th tick, that's 133 ms, the animation would just look a little slower. This saves the hassle of a counter.
                       
                      • Entoarox

                        Entoarox Oxygen Tank

                        Tick speed is not guaranteed! While it never should, a tick can take longer then it should if extraordinary situations occur....
                         
                        • rodrigovaz

                          rodrigovaz Lucky Number 13

                          Of course, then we can use 4 ticks or even 6 ticks(count three times the 2 ticks event..). Still, a bit of delay in a (rather useless) animation is better than abusing of the processor to do that.
                           
                          • tinywolves

                            tinywolves Seal Broken

                            Hi I was wondering if anyone knows if there is a way of making the flowers walk throughable but not front.
                            This is my current redesign, as you can see, flowers everywhere. I made all grass diggable besides corner/edge pieces to preserve the layout now is there i can make my decorational flowers diggable and walkthrough-able without them going overtop my character?
                            Like I can use the front player but i have that problem. I think I need to make an additional layer (A second background layer?0 but how do I get the game to recognize the layer?
                             

                              Attached Files:

                            • TenkoKuugen

                              TenkoKuugen Scruffy Nerf-Herder

                              Flowers have transparent background, which means if you pose them as a background, you'll have white ground.
                              Instead of making another layer and mutilating the game, just create a back layer tile. Edit your tilesheet, copy a grass tile, and if need be, pixel for pixel, copy a flower over the grass tile and voila, back layer flower
                               
                              • tinywolves

                                tinywolves Seal Broken

                                That's what I was thinking, I'll just go over one of the weedy looking ones I don't like, thanks that's hell of a lot easier!
                                 
                                • TenkoKuugen

                                  TenkoKuugen Scruffy Nerf-Herder

                                  You don't actually have to replace it, you can just add a cloned tilesheet to your farm.tbin / yaml that has the necessary tile
                                  that way you don't mess with that tile in any other maps
                                   
                                  • apenimon

                                    apenimon Space Hobo

                                    need help bad i can do a fair bit with tide editor but for the life of me i cant walk over my goddamn bridge i placed im just about to smash my pc up and throw it out of a window ive made the bridge tiles passable, they are on building layer, i am stuck i even loaded the farm_fishing.xnb that has an ass ton of bridges and the one i have placed is identical to those so ive completely lost the will to live.
                                     
                                    • TenkoKuugen

                                      TenkoKuugen Scruffy Nerf-Herder

                                      You need to make them passable as a property on the tilesheet itself, not as a individual tile property
                                       
                                      • apenimon

                                        apenimon Space Hobo

                                        thanks for your reply it is in the tilesheet properties it must of added itself when i added it as a property to the individual tiles? im not sure but its on there
                                         
                                        • TenkoKuugen

                                          TenkoKuugen Scruffy Nerf-Herder

                                          open your tilesheet list, right click the sheet with the tiles you use for the bridge, click properties... then you need to make an entry like this
                                          @TileIndex@781@Passable T
                                          @TileIndex@781@Passable is the Name, T is the value
                                           
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page