Tool Storm Modding API

Discussion in 'Mods' started by Handsome Matt, Mar 7, 2016.

  1. _Tenshi_

    _Tenshi_ Intergalactic Tourist

    My Problem

    [CecilInjectorFactory] Loaded 1486 injectors.
    [CecilEventCallbackInjector] Instruction 2801 out of bounds
    StardewValley.Game1 Draw (Microsoft.Xna.Framework.GameTime)System.Void
    PostDrawCallback (Storm.StardewValley.Accessor.StaticContextAccessor)Storm.Manipulation.DetourEvent

    System.Int32[]
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.Farmer temporarySpeedBuff System.Single
    TemporarySpeedBuff System.Single False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.Farmer movementMultiplier System.Single
    MovementMultiplier System.Single False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.TerrainFeatures.Flooring whichView System.Int32
    WhichView System.Int32 False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.TerrainFeatures.Flooring isSteppingStone System.Boolean
    IsSteppingStone System.Boolean False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.TerrainFeatures.FruitTree greenHouseTree System.Boolean
    GreenHouseTree System.Boolean False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.Game1 thumbstickMotionMargin System.Int32
    ThumbstickMotionMargin System.Int32 False
    [CecilFieldAccessorMutatorInjector] Could not find field!
    StardewValley.Object health System.Int32
    Health System.Int32 False
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method '_GetThumbstickMotionMargin' in type 'StardewValley.Game1' from assembly 'Storm-Hooked-Game, Version=1.0.5900.15624, Culture=neutral, PublicKeyToken=null' does not have an implementation.
    at StardewValley.Program.Main(String[] args)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Storm.StardewValley.ManagedStardewValleyLauncher.Launch()
    at Storm.Program.Main(String[] args)
     
    • Pinkishu

      Pinkishu Phantasmal Quasar

      Well, if the people getting such big log files would provide at least a section of them that may help
       
      • tonnes

        tonnes Space Hobo

        If you crash when you try to start the game, make sure you don't use the beta version of the game. Make sure that you use the current "stable" version (1.05).
         
        • rzn

          rzn Intergalactic Tourist

          Seems activating beta version and then deactivating it made it work, thanks!
           
          • Zoryn4163

            Zoryn4163 Big Damn Hero

            It's most likely due to a mod throwing an error every frame in an Update tick. AFAIK this is an issue with the API not unloading mods that throw exceptions.
             
            • Fyn

              Fyn Pangalactic Porcupine

              Has anyone else figured out if it's possible to get Storm to run with Windows XP? Want to get rid of fence decay and time moving in the mine (as it's rather silly with how far away from home the mine is :/) but all mods require Storm.
               
              • Undreamed

                Undreamed Scruffy Nerf-Herder

                Cant start ....

                [CecilInjectorFactory] Loaded 1486 injectors.
                [CecilEventCallbackInjector] Instruction 2801 out of bounds
                StardewValley.Game1 Draw (Microsoft.Xna.Framework.GameTime)System.Void
                PostDrawCallback (Storm.StardewValley.Accessor.StaticContextAccessor)Storm.Manipulation.DetourEvent

                System.Int32[]
                [CecilFieldAccessorMutatorInjector] Could not find field!
                StardewValley.Farmer temporarySpeedBuff System.Single
                TemporarySpeedBuff System.Single False
                System.IO.FileLoadException: Die Datei oder Assembly "Storm-Hooked-Game, Version=1.0.5907.31512, Culture=neutral, PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird. (Ausnahme von HRESULT: 0x80070020)
                Dateiname: "Storm-Hooked-Game, Version=1.0.5907.31512, Culture=neutral, PublicKeyToken=null"
                bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
                bei System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
                bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
                bei System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
                bei System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
                bei System.Reflection.Assembly.Load(String assemblyString)
                bei System.UnitySerializationHolder.GetRealObject(StreamingContext context)

                bei System.AppDomain.Load(Byte[] rawAssembly)
                bei Storm.Manipulation.Cecil.CecilInjectorFactory.ToConcrete()
                bei Storm.Manipulation.InjectorFactory.<ParseOfType>b__14_0()
                bei Storm.StardewValley.ManagedStardewValleyLauncher.InitializeStaticContext(InjectionFactoryContext ctx)
                bei Storm.StardewValley.ManagedStardewValleyLauncher.Launch()
                bei Storm.Program.Main(String[] args)

                WRN: Protokollierung der Assemblybindung ist AUS.
                Sie können die Protokollierung der Assemblybindungsfehler aktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) auf 1 festlegen.
                Hinweis: Die Protokollierung der Assemblybindungsfehler führt zu einer gewissen Leistungseinbuße.
                Sie können dieses Feature deaktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] entfernen.


                tryd the latest storm version
                http://storm.handsomematt.co.uk/builds/Storm-0.1.1.0_GIT-335d632.zip

                it works now....
                Dont know why Steam trolling me...
                 
                  Last edited: Mar 13, 2016
                • ADoby

                  ADoby Subatomic Cosmonaut

                  Hey,

                  I tried to port my SMAPI mod to STORM but it seems like the "ObjectItem" from STORM does not have the "ParentSheetIndex" Property.
                  Can someone tell me if its implemented and if, how its called/made :D
                   
                  • ThatNorthernMonkey

                    ThatNorthernMonkey Aquatic Astronaut

                    New video tutorial on how to install Storm:

                     
                    • Pyrii

                      Pyrii Existential Complex

                      Is there a guide for newbies to C# for modding with storm? I've done some small programs in C# but creating a dynamic Link Library for another project is leaps ahead of what I'm used to.
                       
                      • ThatNorthernMonkey

                        ThatNorthernMonkey Aquatic Astronaut

                        I'm trying to get a series of Storm videos on the go, next one was going to be compiling from source using git and VS2015, then I was going to go into beginner modding. Took me two hours to record and edit a 7 minute video before though (argh) so it might take a while to do. Hopefully get quicker with experience.
                         
                        • Pyrii

                          Pyrii Existential Complex

                          Why videos? I know how to compile storm, we already have instructions for that, what I need is set-up, templates and code examples.
                           
                            keyten likes this.
                          • ADoby

                            ADoby Subatomic Cosmonaut

                            Storm Samples are here:
                            https://gitlab.com/Demmonic/Storm/tree/master/Examples

                            My Question: (so it doesn't sink in)
                            I tried to port my SMAPI mod to STORM but it seems like the "ObjectItem" from STORM does not have the "ParentSheetIndex" Property.
                            Can someone tell me if its implemented and if, how its called/made :D
                             
                              Pyrii likes this.
                            • Surker

                              Surker Space Hobo

                              So I installed Storm according to the tutorial for a non-steam folder, but the Storm Loader won't even open the Stardew Valley Exe. Any idea what the issue is?

                              [CecilInjectorFactory] Loaded 1486 injectors.
                              [CecilEventCallbackInjector] Instruction 2801 out of bounds
                              StardewValley.Game1 Draw (Microsoft.Xna.Framework.GameTime)System.Void
                              PostDrawCallback (Storm.StardewValley.Accessor.StaticContextAccessor)Storm.Manipulation.DetourEvent

                              System.Int32[]
                              [CecilFieldAccessorMutatorInjector] Could not find field!
                              StardewValley.Farmer temporarySpeedBuff System.Single
                              TemporarySpeedBuff System.Single False
                              System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
                              at StardewValley.Game1.UnloadContent()
                              at Microsoft.Xna.Framework.Game.DeviceDisposing(Object sender, EventArgs e)
                              at Microsoft.Xna.Framework.GraphicsDeviceManager.OnDeviceDisposing(Object sender, EventArgs args)
                              at Microsoft.Xna.Framework.GraphicsDeviceManager.HandleDisposing(Object sender, EventArgs e)
                              at Microsoft.Xna.Framework.Graphics.GraphicsDevice.~GraphicsDevice()
                              at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Dispose(Boolean )
                              at Microsoft.Xna.Framework.GraphicsDeviceManager.Dispose(Boolean disposing)
                              at Microsoft.Xna.Framework.GraphicsDeviceManager.System.IDisposable.Dispose()
                              at Microsoft.Xna.Framework.Game.Dispose(Boolean disposing)
                              at Microsoft.Xna.Framework.Game.Dispose()
                              at StardewValley.Program.Main(String[] args)
                              --- End of inner exception stack trace ---
                              at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
                              at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
                              at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                              at Storm.StardewValley.ManagedStardewValleyLauncher.Launch()
                              at Storm.Program.Main(String[] args)
                               
                              • ThatNorthernMonkey

                                ThatNorthernMonkey Aquatic Astronaut

                                Were you using any mods at the time? What version of Stardew Valley are you on?
                                 
                                • keyten

                                  keyten Cosmic Narwhal

                                  Yes, this would be perfect.

                                  I am currently trying to get familiar with API but not much luck. Is it currently possible to somehow summon an NPC? I tried making an NPC with XNB files and event managed to add it to the event but couldn't add to any location.
                                  Something like
                                  Game1.locations[Game1.locations.Count - 1].addCharacter(new NPC(new AnimatedSprite(Game1.content.Load<Texture2D>("Characters\\Marnie"), 0, Game1.tileSize / 4, Game1.tileSize * 2 / 4), new Vector2((float)(12 * Game1.tileSize), (float)(14 * Game1.tileSize)), "AnimalShop", 2, "Marnie", false, null, Game1.content.Load<Texture2D>("Portraits\\Marnie")));
                                  ?
                                   
                                  • Handsome Matt

                                    Handsome Matt Aquatic Astronaut

                                    ur literally using 1.04

                                    use 1.05
                                     
                                    • ADoby

                                      ADoby Subatomic Cosmonaut

                                      @Handsome Matt
                                      Do you how i could implement this ?
                                      I need the objects SheetIndex to check its itemType

                                      Quote:
                                      I tried to port my SMAPI mod to STORM but it seems like the "ObjectItem" from STORM does not have the "ParentSheetIndex" Property.
                                      Can someone tell me if its implemented and if, how its called/made :D
                                       
                                        Drogean likes this.
                                      • Pyrii

                                        Pyrii Existential Complex

                                        So I finally got the API to build. Had to revert to an older codebase to get it to. Some of the examples are probably outdated, intellisense is being bitchy about some references.

                                        Now what I'd really like is some sort of documentation of methods etc. So I know what I have access to and can modify and how.
                                         
                                        • shinkaiho

                                          shinkaiho Space Hobo

                                          anyone figure out a way to debug / step through plugin code?

                                          I'm currently making my changes -> deploying dll and running the game then outputting data to the storm log
                                           
                                            Last edited: Mar 14, 2016

                                          Share This Page