-
Posts
62 -
Joined
-
Last visited
The Insanity God's Achievements
-
JimiKitti started following The Insanity God
-
https://mods.vintagestory.at/morehudbars
-
I can't say much about what you did wrong but this is not an engine limitation. `OnBeforeRender` runs for every ItemStack (not to be confused with ItemClass, which contains the shared data). I for instance use this method for rendering Ice Cubes in BrainFreeze (there is only 1 ItemClass instance, but each ItemStack renders differently depending on the liquid stored in the ItemStack attributes). If those variants are fixed (as in you have to chose from a list such as wood types) and not dynamic like with this post then I would recommend looking into Attribute Rendering
-
Fairly sure there isn't any command for that. Not sure why you would even need this but would be fairly simple to make a custom hotkey for this from code. public class SandBoxModModSystem : ModSystem { [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "CameraMode")] internal static extern ref EnumCameraMode CameraMode(Camera instance); public override void StartClientSide(ICoreClientAPI api) { base.StartClientSide(api); api.Input.RegisterHotKeyFirst("toggle-first-third-person", Lang.Get("Toggle between first and third person"), GlKeys.M, shiftPressed: true); api.Input.SetHotKeyHandler("toggle-first-third-person", input => { if(api.World is ClientMain client) { ref EnumCameraMode cameraModeRef = ref CameraMode(client.MainCamera); cameraModeRef = cameraModeRef switch { EnumCameraMode.FirstPerson => EnumCameraMode.ThirdPerson, _ => EnumCameraMode.FirstPerson }; } return true; }); } }
-
Well you could add a listener to the chunk dirty event instead but point taken. Multiblocks in particular are indeed rather lacking in regards to this. What I mostly meant with that under the hood there is still a "tick-based system" is that for a variety of reasons (consistency and concurrency for instance) events are often triggered by something tick based (like physics, where every tick the player moves a bit based on their velocity) and/or result in enqueuing a task that is then run by a tick based system. For instance RegisterCallback just registers the delegate to a shared list which is then checked every tick to see if they should be called.
-
The Insanity God started following Big Tech mods in Vintage Story
-
Yup, they are working on this though. Harmony allows for changing almost anything in code (except you can't edit generic methods and you can't add fields, though there are workarounds for the later), for most stuff you can just make Behaviors though. There is the IEventAPI for mods to push/listen to events and some base game events you can attach to but for the most part stuff is intended to be done through Behaviors. (Personally I'd say the distinction between "tick-based system" and "event-based systems" is always a bit weird though, since usually "event-based systems" still run a "tick-based system" under the hood to actually trigger those events so it's really more of an abstraction layer on top then a replacement system) Actually a lot of the framework for dimensions is already in place and in fact even used in some places already albeit with limitations (MiniDimensions) I haven't messed with this myself but I know there is a lot of possibilities in regards to this... not only from code, where you can straight up register your own ChunkGeneration steps using the IServerEventAPI but also from JSON using landforms. Someone with experience with terrain generation can probably tell you more about this. Idk about futuristic tech but I definitely think steampunk level tech is coming to VS, if not by the developers then by modders... it's only a matter of time.
-
Wait the modmaker puts stuff in game domain folder? I'm surprised I haven't seen this one before then.
- 8 replies
-
- compatibilty
- mod
-
(and 1 more)
Tagged with:
-
For as far as I can see your alloy recipe works just fine even with that other mod (though you are lacking a language string for material-ancientgold) Your real problem lies elsewhere, namely in the combustibleProps that are required to exist and have a melting point that is reachable with existing fuel sources for it to show up as moldable, which disappears once you add "spearexpantion". The reason why this happens is because both your mod and "spearexpantion" put patches inside the game domain folder with the same name (meaning the files themselves end up overriding each other). This is why you never put anything inside the game domain folder unless absolutely necessary. Simply move the patch files from "assets/game/patches" into "assets/heavyforlonarmor/patches" and prefix the target file with "game:" (some already have this) and problem is solved.
- 8 replies
-
- 2
-
-
- compatibilty
- mod
-
(and 1 more)
Tagged with:
-
clothing attributes/conditions
The Insanity God replied to Micah Holmes's topic in Mod Development Questions/Troubleshooting
And so should drinking I'd say... but here we are -
Handbook Game Mech
The Insanity God replied to Micah Holmes's topic in Mod Development Questions/Troubleshooting
I think that was just meant as a short form for "Game Mechanic Information" not an actual domain The issue is actually precisely that the domain was not specified... those language strings defined in the handbook config don't automatically get the domain added (they aren't even considered AssetLocations but just plain strings) so when it ends up looking for the code it actually ends up looking for "game:gamemechanicinfo-mushroomgrowing" On the other hand... the language file does automatically add the domain so it ends up searching in the wrong domain, simply prefixing this stuff with "craftsmanship:" should do the trick. -
clothing attributes/conditions
The Insanity God replied to Micah Holmes's topic in Mod Development Questions/Troubleshooting
The base game "warmth" is purely about keeping yourself warm, there is no benefit to cooling as there are only penalties for being too cold and not for being too warm. Are you thinking of HiedrateOrDiedrate's cooling attribute, or some other mod by chance? This is how it is for all clothing but you could just change your `creativeinventory` into a `CreativeInventoryStacks` and set the attribute manually: "CreativeInventoryStacks": [ { "Tabs": [ "general", "items", "clothing" ], "Stacks": [ { "Code": "craftsmanship:blouse-{category}-{upperbody}-{color}", "Type": "Item", "Attributes": { "condition": 1 } } ] } ], -
Bread Crash
The Insanity God replied to Micah Holmes's topic in Mod Development Questions/Troubleshooting
It's because of the attributes yes, the game automatically generally adds your domain as a default when loading an `AssetLocation` field... problem being that the attributes are not loaded as `AssetLocation` but as a `JsonObject` and then later read by other code which often does not do this, like in this case. You should be able to fix the error by prepending `craftsmanship:` to your `initialCode` and `resultCode`. (I don't have your `dough` itemtype so I can't test that)- 1 reply
-
- 1
-