Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About Umbrella

  • Rank
  1. Hello, I use harmony to patch GameManager.PlayerSpawnedInWorld, in order to start a global coroutine of mine when the player joins the game. This works very well when I am alone in my game. But I tested my mod with a friend, and there is an issue. The routine starts on his computer when he creates the game, but does not start on my computer when I join his game. Both of us have build the game with the DMT tools applying the patch. So I wonder : are Harmony patches applied when I join an already running game ? Does each player needs to build the game with the tool ? Thank you !
  2. Umbrella

    DMT Modding Tool

    Hi Hal9000, thank you. I understand and agree with your answer. But still: The problem is that each of my file (in the same mod, each implementing IHarmony and requiring someone to call PatchAll once) then needs to make assumption on other file. If I remove PatchAll from one patch, I assume another single patch will apply PatchAll. From a design perspective, it does not make much sens. From a practical perspective, whenever you remove/add some patch to your harmony folder, you need to check for the single call. Agreed, but honestly 99% of modders want to apply each of their patch once. What I suggest is the DMT tool to have an extra method PatchAllOnce, so exotic use cases can do whatever they were doing before, but most users can just call PatchAllOnce() in each of their patch and no longer worry about if it's already done, or what happens when they remove a patch file. Could you add this extra method to the tool ? I know I will use it for every mod I make (and I still have found no use case where I would not) public static class Harmonys { private static bool Applied = false; public static void ApplyOnce(HarmonyInstance harmony, Assembly assembly, Type patch) { /* Important: the call to Assembly.GetExecutingAssembly() need be done by the caller TODO: check method is patched when skipping ? */ Debug.Log(String.Format("Harmonys.ApplyOnce {0} -> {1}", patch.ToString(), Applied)); if (Applied) return; Debug.Log(String.Format("Harmonys.Applying {0}", patch.ToString())); harmony.PatchAll(assembly); Applied = true; } }
  3. Hi, I can no longer see the graphical effect of ring of fire (from the dev item) since A18.4. Is that also the case for you ? Thank you. Sorry, just noticed I was in the wrong section. How can I move my own post ?
  4. Umbrella

    DMT Modding Tool

    Hello, I use 3 IHarmony patches. Each one calls harmony.PatchAll() in its Start() method. As a consequence, all 3 patches are applied 3 times ! How can I make sure all 3 patches only get applied once ? Should I call harmony.PatchAll() a single time (but how to ensure all patches have been seen) ? Is there a Patch() method that would apply the current IHarmony and not the other ones ? Thank you ! The call to PatchAll() is: var harmony = HarmonyInstance.Create(GetType().ToString()); harmony.PatchAll(Assembly.GetExecutingAssembly()); Edit: - Using harmony.Patch(original, null, new HarmonyMathod(postfix)); did not apply the patch. - Using a global bool flag to ensure PatchAll is called once does the trick. - I checked that the problem only occurs within one mod. Calling PatchAll from one mod does not reapply patches in other mods. Using a global bool flag like I did is enough only because the problem does not happen cross-mod. I feel the single-call check should be moved to the DMT library, because other users might run into the same mistake (Am I the only one tricked here ?). I can't see a use case where we want to apply patches multiple times (even then, it could be 2 different methods).
  5. The sound is indeed based on explosion.particleindex, so no easy way for me to keep the initial molotov unaltered. It seems that removing molotov_explode2 is enough.
  6. Thanks a lot Robeloto ! How does the game connects the molotov item with the SoudDataNode ? Is it through some hard-coded connection from the explosion.particleindex to the sound node, or is there a xml property somewhere ? I ask because I would like to change the sound of a custom molotov item, not the base one. Do you mean it exists in all "/molotov_exploden" (n=1,2,3) ? Removing molotov_explode1 is not enough ?
  7. Hello, I have a first buff A with an effect group. I want to define a buff B with the same group, and an extra one. I make B extends A, and add the extra group. However, the group from A seems to show up randomly in B. How does <buff name="B" extends="A"> treats the <effect_group> from A ? Is it overridden with B.<effect_group> ? Does it depend on the name of the effect group ? Thank you !
  8. Hello, I would like to remove the "broken glass sound" when a thrown molotov hits the ground. In he xml, I tried to remove property Action0/Sound_start, or to add SoundTick, but the sound is still there. Do you know how to change/remove it ? Thank you !
  9. Thank you very much Prisma501. I will try use it.
  10. Hello, I am using World.getBiomeAt(x,y) to detemine biomes near the local player (near: something like 200 blocks). However, the function returns null sometimes (I guess the chunk is too far away and not loaded into memory yet). How could I fix it ? 1) Is there another way to query the biome at 2D coordinates ? 1.i) maybe from the image map ? Is that map available in memory ? Can it be recreated ? 2) Can I force a distant chunk to load without messing up with how the game manages chunks ? Thank you !
  11. Hello, I use Harmony to patch GameManager.PlayerSpawnedInWorld(). After that function call, I start a thread of mine. It happens that the thread starts twice, because the Postfix method gets called twice. (NB: I see the patch is loaded once only) I think I saw a recent post on a similar topic. If I remember well, DMT was causing this, and the solution was to use a buff to control the thread. Any thoughts on this ? Thank you
  12. I suggest to instead do it on the bone knife or hunting knife (remove quality, make em stackable, throwable and stickable). This would give the agility skill a very nice weapon diversity !
  13. Thanks ! This sounds very doable, but with more work (for instance make sure no bug occurs if the crate is destroyed). Not sure when I'll have the time.
  14. I finally pushed some improvments, sorry for the delay Available at the same address (https://github.com/Umbrella7D/7Dmods) - Explosion chance is 50% - Explosion destroys the crate - Secondary projectiles spawn better
  15. Hello, Is it possible to split the config/items.xml file into multiple subfiles within the same mod, and have them all loaded ? - Main concern is readability - I know I can split the file over multiple (ordered) mod - It sounds doable because xpath uses eg </items> prefix, so it does not need the file to be called items.xml in order to know it is modifying items. - If it is doable, in which order would they be loaded ? Thank you !
  • Create New...