Jump to content

Spear and Fang

Very Important Vintarian
  • Posts

    425
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by Spear and Fang

  1. Oh oops yeah I forgot about this.
    Also, I have no plans on continuing to work on it.
    Here's the source code and seal of approval from Jake.  If someone wants to take over, feel free.
    Original repo is up on Jake's Github if you would rather start from there.

    jakecool.png

    farmlife2.zip

  2. 1. Locate this file:
    %appdata%\Vintagestory\assets\survival\blocktypes\plant\fruittreebranch.json

    2. Edit the attributes/fruittreeProperties section directly. i.e. the dieBelowTemp values for each tree type

    3. Run the game to test.  When you are happy with your changes, run modmaker to generate your mod
    %appdata%\Vintagestory\ModMaker.exe

    4. Reinstall the game directly over itself to restore your changes in #2 to their original values

    5.  Publish your mod on the modDB

    6. Profit!

    • Haha 1
  3. 11 hours ago, pencilgame said:

    World Interaction! You're a legend. That link will also be a treasure trove of examples. What a class act. Thank you.

    For anyone who doesn't have github:
    https://apidocs.vintagestory.at/api/Vintagestory.API.Client.WorldInteraction.html

    fwiw, I never direct anyone to the api docs because they are auto-generated and difficult to navigate.  And while the Anegostudios github is convenient for pointing people towards and searching, it is missing half of the resources that one might want to look at (and also pretty clunky).

    Using a decompiler like dnSpy or ILSpy (or Visual Studio has a plug in apparently) is so much better than the other two resources.  I use dnSpy myself. Run it, drag and drop all the relevant .dll files into it (i.e. VintagestoryAPI, VintagestoryLib, VintagestoryServer, plus everything in the Vintagestory\mods folder), and Bob's your uncle.

  4. " failing to render something in a tree hollow and crashing"
    for the record (and to clarify), this mod only ever puts vanilla items, items from this mod, and items from the old version of Wildcraft trees (if it's installed) in a tree hollow.  But that doesn't prevent another mod from modifying vanilla items in such a way that they would no longer render correctly in a hollow. 

    Also, if your existing world used to include the old version of wildcraft trees and that same world now uses the new version of wildcraft trees, that could explain why it's crashing.

    • Like 1
  5. 1 hour ago, Mineymonkey said:

    Hey Spear and Fang, wanted to poke you about a crash I get running Wildcraft Fruit and Primitive Survival. I finally have been able to log in here, but Wildcraft Trees works with PS, just not fruit. Here's the pastebin with the log

     

    https://pastebin.com/QJYG6z9m

    Hi Mineymonkey,

    The error message does indeed indicate that my mod is failing to render something in a tree hollow and crashing.  The problem is that I simply can't recreate the issue.  To expedite testing on my end I jacked up tree hollows a lot by editing my modconfig file

      "TreeHollowsMaxPerChunk": 12,
      "TreeHollowsSpawnProbability": 0.5,



    Then I created a new world with this loadout
    primitivesurvival@3.4.5, game@1.19.3, herbarium@1.0.4, creative@1.19.3, survival@1.19.3, wildcraftfruit@1.1.0
    I mucked with a lot of hollows, and no crash.

    So I tried another new world with this loadout
    primitivesurvival@3.4.5, game@1.19.3, herbarium@1.0.4, creative@1.19.3, survival@1.19.3,wildcrafttree@1.0.0
    and once again, I mucked with a lot of hollows, and no crash.

    My best guess is that the problem lies within your existing world, and it may be tricky to recover from this situation.  To confirm or deny this claim, you *could* start a brand new world and see if it crashes...

    I read recent modDB comments for all the mods involved and did a quick dive into the json files for those other mods and can't find any other clues.  Tree hollows should be pretty far removed from those other mods, as I've already taken many steps to ensure this.

  6. That crash is happening in the game engine itself so it doesn't reveal much.  Looks like an entity (typically a creature) is causing the crash though.  I'd start by updating the game to 1.19.1 - lots of bugs fixed there.  Beyond that, I guess I'd check the comments in the individual mod pages to see if any similar reports have popped up, or new releases.

    I can tell you that I've been playing with Buzzwords, Primitive Survival, and Hudclock (across many 1.19 releases), and haven't had any serious crashes with those.  That's not to say it isn't a mod conflicting with one of those though.

  7. oh are you talking about shape overlays for the player model?  I think they are unique and only apply to the player, not other creatures
    See ..\game\entities\humanoid\player.json
    shape overlays are defined in attributes\skinnableParts - the type: "shape" sections.

    Just spitballing - I've never mucked with these in json or c#.

  8. a search of the vanilla assets for "overlays" reveals that they are used almost exclusively with blocks, and just a couple of times with items.  This tells me that they have not been implemented (via json at least) for entities.

    if you saw an entity.Properties.Client.Shape.Overlays then I bet that is actually shader overlays (i.e. the thing that makes entities all frosty looking in the winter)


  9. Now I'm no expert on storage flags but my gut tells me that you need to stick to one of the predefined ones on the list that's less than 1024. Or combine some that are less than 1024 (if I remember correctly it's a bitwise thing). If you use one of the custom ones then you'll likely need some supporting c# code to make it function properly

    EDIT: Oh maybe you don't need any c#, just try adding 1 to your existing values (so bitwise that's your new storage option AND General). For your patches of course, not your bags.


            General = 1,
            /// The item can be placed into a backpack slot
            Backpack = 2,
            /// The item can be placed in a slot related to mining or smithing
            Metallurgy = 4,
            /// The item can be placed in a slot related to jewelcrafting
            Jewellery = 8,
            /// The item can be placed in a slot related to alchemy
            Alchemy = 16,
            /// The item can be placed in a slot related to farming
            Agriculture = 32,
            /// Moneys
            Currency = 64,
            /// Clothes, Armor and Accessories
            Outfit = 128,
            /// Off hand slot
            Offhand = 256,
            /// Arrows
            Arrow = 512,
            /// Reserved for vanilla
            Reserved2 = 1024,
            /// Custom storage flag for mods
            Custom1 = 2048,
            /// Custom storage flag for mods
            Custom2 = 4096,
            /// Custom storage flag for mods
            Custom3 = 8192,
            /// Custom storage flag for mods
            Custom4 = 16384,
            /// Custom storage flag for mods
            Custom5 = 32768,
            /// Custom storage flag for mods
            Custom6 = 65536,
            /// Custom storage flag for mods
            Custom7 = 131072,
            /// Custom storage flag for mods
            Custom8 = 262144,
            /// Custom storage flag for mods
            Custom9 = 524288,
            /// Custom storage flag for mods
            Custom10 = 1048576

    • Like 1
  10. On 11/29/2023 at 5:23 PM, Dr B said:

    Not sure if you want this here or elsewhere, but just had a crash with the following message:

     

    Running on 64 bit Windows with 32698 MB RAM
    Game Version: v1.18.15 (Stable)
    11/29/2023 8:21:57 PM: Critical error occurred in the following mod: primitivesurvival@3.3.0
    Loaded Mods: aculinaryartillery@1.0.15, advancedsmithing@1.3.0, africanmonitorlizards@1.0.6, asianmonitorlizards@1.0.0, attributer@1.0.5, autoclose@1.0.1, autopanning@1.0.1, bandedgeckos@1.2.0, betterruins@0.2.4, bettertraders@0.0.2, bushmeat_meals@1.0.7, cavecontent@1.0.1, conquestnaturepack@0.0.4, hqzlights@1.1.1, dungeonsandshafts@0.2.3, extraclayforming@1.0.0, extrainfo@1.5.3, fancysky@1.0.6, FarmSurvival@1.3.0, fixroads@1.3.1, capreolinae@1.0.5, giantgouramis@1.0.1, gravelsandfix@1.0.2, HangingOilLamps@1.0.1, healingwhilesleepingfix@1.0.1, burntimetimes2@1.0.0, itemlights@1.0.2, juicyores@1.0.0, mannequinstand@1.0.1, mcd1@1.0.0, meteoricexpansion@1.2.4, millwright@1.1.1, moremolds@1.4.2, newworldgianttortoises@1.0.3, pondfrogsi@1.2.3, primitivesurvival@3.3.0, rainfrogs@1.2.1, roas@1.0.0, rpgitemrarity@1.0.4, she1fish@1.1.0, smokychimneys@1.0.0, spyglass@0.4.5, stacks@1.0.4, temporal_gears_stack@1.0.0, usefuldrifterloot@1.0.3, game@1.18.15, weaponpackalphaunoff@1.4.0, wildcrafttrees@1.2.4, wildcraft@1.6.6, ancienttools@1.5.11, ar-class@0.0.6, egocaribautomapmarkers@2.6.0, betterfirepit@1.1.2, betterjonasdevices@1.0.1, canbeignited@1.1.0, carryon@1.6.1, composter@1.1.0, expandedfoods@1.6.8, fancyplanters@1.2.0, glowingprojectiles@1.1.3, hudclock@3.3.0, knifecut@1.2.0, loreweapons@1.0.1, metaltongs@1.1.0, morestickcrafting@1.0.2, petai@1.8.1, prospectorinfo@4.3.0, simplestep@1.0.8, stepup@1.2.0, stonebakeoven@1.1.1, stonerailings@1.1.0, storageoptions@1.0.1, updatedtexturesandmodels@0.8.2, creative@1.18.15, vsquest@0.4.1, survival@1.18.15, xlib@0.7.4, bugnetcompatibility@1.0.1, bullseye@2.5.1, feverstonewilds@1.4.3, shellpan@1.0.0, xinvtweaks@1.5.7, xskills@0.7.5
    System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Vintagestory.Client.NoObf.TextureAtlasManager.get_Item(AssetLocation textureLocation) in VintagestoryLib\Client\Render\Atlas\TextureAtlasManager.cs:line 53
       at Vintagestory.GameContent.BlockEntityDisplay.getOrCreateTexPos(AssetLocation texturePath) in VSSurvivalMod\BlockEntity\BEContainerDisplay.cs:line 112
       at Vintagestory.GameContent.BlockEntityDisplay.get_Item(String textureCode) in VSSurvivalMod\BlockEntity\BEContainerDisplay.cs:line 87
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShapeElement(Int32 indexForLogging, MeshData meshdata, ShapeElement element, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 394
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShapeElements(MeshData meshdata, ShapeElement[] elements, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 306
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShapeElements(MeshData meshdata, ShapeElement[] elements, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 306
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(Shape shapeBase, MeshData& modeldata, Vec3f wholeMeshRotation, Vec3f wholeMeshOffset, Single wholeMeshScale, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 302
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(String type, AssetLocation name, CompositeShape compositeShape, MeshData& modeldata, ITexPositionSource texSource, Int32 generalGlowLevel, Byte climateColorMapIndex, Byte seasonColorMapIndex, Nullable`1 quantityElements, String[] selectiveElements) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 51
       at Vintagestory.Client.NoObf.ShapeTesselator.TesselateItem(Item item, MeshData& modeldata, ITexPositionSource texSource) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 620
       at Vintagestory.GameContent.BlockEntityDisplay.getOrCreateMesh(ItemStack stack, Int32 index) in VSSurvivalMod\BlockEntity\BEContainerDisplay.cs:line 204
       at Vintagestory.GameContent.BlockEntityDisplay.updateMesh(Int32 index) in VSSurvivalMod\BlockEntity\BEContainerDisplay.cs:line 179
       at PrimitiveSurvival.ModSystem.BETreeHollowGrown.updateMeshes()
       at Vintagestory.GameContent.BlockEntityDisplayCase.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldForResolving) in VSSurvivalMod\BlockEntity\BEDisplayCase.cs:line 203
       at PrimitiveSurvival.ModSystem.BETreeHollowGrown.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldForResolve)
       at Vintagestory.Client.NoObf.ClientChunk.AddOrUpdateBlockEntityFromPacket(Packet_BlockEntity p, ClientMain game) in VintagestoryLib\Client\Model\ClientChunk.cs:line 429
       at Vintagestory.Client.NoObf.GeneralPacketHandler.HandleBlockEntities(Packet_Server packet) in VintagestoryLib\Client\Systems\GeneralPacketHandler.cs:line 414
       at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks(Single deltaTime) in VintagestoryLib\Client\ClientMain.cs:line 757
       at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 200
       at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 668
       at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 643
       at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 77
       at OpenTK.Windowing.Desktop.GameWindow.Run()
       at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 313
       at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 129
       at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

    Event Log entries containing Vintagestory.exe, the latest 3
    ==================================
    { TimeGenerated = 11/29/2023 7:18:52 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 2007150627803250050, type 4
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0

    Problem signature:
    P1: Vintagestory.exe
    P2: 1.18.15.0
    P3: 64e841c5
    P4: openal32.dll
    P5: 1.23.0.0
    P6: 63dd31ad
    P7: 40000015
    P8: 00000000000df046
    P9: 
    P10: 

    Attached files:
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER636B.tmp.mdmp
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER6FEF.tmp.WERInternalMetadata.xml
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER705D.tmp.xml
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER706B.tmp.csv
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER708B.tmp.txt

    These files may be available here:
    \\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Vintagestory.exe_3278c09e339ad58fdb4a48929ddf95e5f2060ca_ee8069fc_ed29da80-fa95-456e-8b32-f8ef1d54150b

    Analysis symbol: 
    Rechecking for solution: 0
    Report Id: e666b118-a9b4-40e9-b4b4-37eb2ff93628
    Report Status: 268566528
    Hashed bucket: 38dd2bbe130a69d3fbdad4dc94ea3d82
    Cab Guid: 0 }
    --------------
    { TimeGenerated = 11/29/2023 7:18:48 PM, Site = , Source = Application Error, Message = Faulting application name: Vintagestory.exe, version: 1.18.15.0, time stamp: 0x64e841c5
    Faulting module name: openal32.dll, version: 1.23.0.0, time stamp: 0x63dd31ad
    Exception code: 0x40000015
    Fault offset: 0x00000000000df046
    Faulting process id: 0x5444
    Faulting application start time: 0x01da22fbb9086cfc
    Faulting application path: F:\Games\Vintagestory\Vintagestory.exe
    Faulting module path: F:\Games\Vintagestory\Lib\openal32.dll
    Report Id: e666b118-a9b4-40e9-b4b4-37eb2ff93628
    Faulting package full name: 
    Faulting package-relative application ID:  }
    --------------
    { TimeGenerated = 11/29/2023 2:38:59 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 2007150627803250050, type 4
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0

    Problem signature:
    P1: Vintagestory.exe
    P2: 1.18.15.0
    P3: 64e841c5
    P4: openal32.dll
    P5: 1.23.0.0
    P6: 63dd31ad
    P7: 40000015
    P8: 00000000000df046
    P9: 
    P10: 

    Attached files:
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER2A57.tmp.mdmp
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3322.tmp.WERInternalMetadata.xml
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER3390.tmp.xml
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER338E.tmp.csv
    \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER33BE.tmp.txt

    These files may be available here:
    \\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Vintagestory.exe_3278c09e339ad58fdb4a48929ddf95e5f2060ca_ee8069fc_107c74b7-bbaa-4485-a843-9815591af47d

    Analysis symbol: 
    Rechecking for solution: 0
    Report Id: 53f93248-c63a-4b90-ba88-181b6b6755b5
    Report Status: 268566528
    Hashed bucket: 38dd2bbe130a69d3fbdad4dc94ea3d82
    Cab Guid: 0 }

    Hmmm.  A lot of mods and not much to go on in the log file I'm afraid, so any supporting info might help.
    First and foremost, can this crash be recreated, or was this just a one off?  If it just happened once I can think of a few reasons why such a thing might happen.
    If it's an ongoing issue, does it happen when you're just walking around ,or perhaps when are you interacting with a tree hollow?

  11. The wiki is probably your best resource for getting started - it's got a lot of info packed in there. Maybe I'm biased since I released my first mod using that resource alone.

    Other resources...
    1. VintageStory official Discord and VSWorks Discord
    2. Anego Studios Github  https://github.com/anegostudios (which is searchable) in conjunction with the installed game's assets i.e. use a "grep" like tool like Visual Studio Code to search for json asset keys to understand how they work and link to the code on the github.
    3. Decompiling the dll's that ship with the game (with ILSpy, dnSpy, or similar) - very searchable, somewhat documented, and much better than the online API docs (which I won't even link to)
    4. All of the mods and their source links available on the modDB 
    5. This forum
    6. Buggi's videos https://www.youtube.com/playlist?list=PLkA9Q5ltQPCK-9zPxYAnWKY4TF3YE1e8o
    7. Vies' videos https://www.youtube.com/@viescraft/videos

    I'm sure I'm missing something valuable. Maybe it's this worldedit video https://www.youtube.com/watch?v=we2WyxKSRuc&ab_channel=VintageStory

  12. 10 minutes ago, Meowsers said:

    I can't find a single answer to this, so I may as well just ask directly

     

      Hide contents

    How in the world are you meant to activate the Dagon and Hydra statues? I've done quite literally everything I can think of, but it just tells me that "The surrounding conditions aren't quite right"

     

    There is a hint in the necronomicon for this but it is rather vague. 

    altar.jpeg

  13. I don't think anything has changed with respect to class registrations.  For entities I AM using this though:
    api.RegisterEntity()

    The rest looks good. i.e.
    https://github.com/SpearAndFang/primitive-survival/blob/main/PrimitiveSurvival/ModSystem/PrimitiveSurvivalSystem.cs#L109
    called from
    https://github.com/SpearAndFang/primitive-survival/blob/main/PrimitiveSurvival/ModSystem/PrimitiveSurvivalSystem.cs#L287

    • Like 1
  14. Well the easiest way is to create a brand new characterclasses.json file and put it in a folder called game in your mod.  Files in "game" will completely replace files in vanilla.

    ../assets/game/config/characterclasses.json

    This is a mod that replaced all classes like above.
    https://mods.vintagestory.at/show/mod/8445

    personally, I don't think it's ever a good idea to outright remove stuff from vanilla, as it may have unexpected consequences, not only for vanilla but for other mods.

  15. I'm not near a VS installation so I may make some mistakes, but.... I typically start by
    1. locating the json asset that I want to change, so if it's the bed ...assets/game/blocktypes/wood/bed.json
    2. look at keys like "class", "entityclass", "behaviour(s)", "entityBehaviors", that sort of thing.  These are attaching c# code to the json asset
    3. track those classes down on the anegostudio github, i.e.
    https://github.com/search?q=org%3Aanegostudios bed&type=code
    and familiarize yourself with the bed
    4.  Now you decide if you want to do

    a. something heavy handed like add or replace one of those classes entirely (class or entityclass) via a json patch i.e.
    - replace an existing class
    https://github.com/SpearAndFang/primitive-survival/blob/main/PrimitiveSurvival/PrimitiveSurvival/assets/primitivesurvival/patches/ps-oreminingbomb.json
    - add where one doesn't exist
    https://github.com/SpearAndFang/primitive-survival/blob/main/PrimitiveSurvival/PrimitiveSurvival/assets/primitivesurvival/patches/ps-pelt.json

    b. something much more light touch like extend one of those classes by adding a behavior or entitybehavior (or append one to a list of already existing behaviors) via a jjson patch i.e.
    https://github.com/SpearAndFang/buzzwords/blob/main/assets/buzzwords/patches/bebwildbeehive.json

    c. or circumvent all of that by using a harmony patch.
    https://harmony.pardeike.net/articles/patching.html
    https://github.com/SpearAndFang/wildfarmingrevival/blob/main/WildFarmingRevival/ModSystem/WildFarmingRevivalSystem.cs#L109
    note: definitely check out other people's harmony patches, mine are well blech.

    In the case of a. and b. above, you then register your new classes in c# when your mod first starts, several i.e.
    https://github.com/SpearAndFang/primitive-survival/blob/main/PrimitiveSurvival/PrimitiveSurvival/ModSystem/PrimitiveSurvivalSystem.cs#L108

    and then do the same sorts of things that the vanilla game does inside your new classes, or entirely different things ;). Plenty of examples of this on the wiki, the anego studios github, the moddb.

    The modding section of the VS wiki is where I started.  It's a little outdated at times but contains a lot of invaluable information.

  16. I am also a little confused as to your end goal here.  In general I'd say to approach it differently - don't collect an array of all bed variants, but rather attach a c# class of some sort to the bed block itself - so that that class impacts all beds, regardless of the variant - especially the rather irrelevant direction variant .  Or use harmony to attach your code to one of the existing bed classes.

    On the API documentation front - if you're referring to this
    https://apidocs.vintagestory.at/api/index.html
    I'd highly recommend using DNSpy or ILSpy or Visual Studio and opening the games shipped DLL's with that instead.  It's much more searchable and just as informative.  

  17. Quite a bit of the modding section of the wiki - start at the start, but pay close attention to the stuff related to blocks
    https://wiki.vintagestory.at/index.php/Main_Page

    The see how Zig did it.  His source code is on github:
    https://github.com/ZigTheHedge/vsmods/blob/1.14/mods/necessaries/assets/necessaries/blocktypes/grindstone.json
    https://github.com/ZigTheHedge/vsmods/tree/1.14/mods/necessaries/src/SharpenerStuff

    The VS source can also be quite helpful
    https://github.com/anegostudios

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.