-
Posts
18 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Nat_VS's Achievements
-
Collectible & Entity Tags (from 1.22.0) Hi all, The team has had some questions about the new tag system that is being used throughout the assets, so I have collated some information about what they are, what they do, and how/why you should be using them. What are tags? A tag is, simply put, a small piece of text (a string for the coders) that can be attached to an itemtype, blocktype, or entity type. Tags are quite arbitrary, and their purpose is usually determined through other JSON assets or specific pieces of code. In general, tags are being used to describe an object’s use, shape, size, color, crafting capabilities, and more. An item, block, or entity can have a number of tags listed in its appropriate JSON file. What do they do? Currently, tags are being used for satisfying certain conditions in other systems. The two primary examples of this are to satisfy items for recipes, and to satisfy valid entities for AI tasks that require a target. A set of one or more tags (called a ‘TagSet’) can be compared against other TagSets. Specifically, TagSets can either use a basic matching system (e.g. does TagSet A have any of the tags in TagSet B), or tags can be compared against a “ComplexTagCondition”. This allows a group of tags to be matched like boolean properties, using JSON properties like “anyOf”, “allOf”, or “noneOf. The capabilities of the tag system, however, go much further, and I am personally excited to see what directions this new system may take us in. Why should we use them? There are three major reasons that you should be using tags. Runtime efficiency, mod compatibility, and expandability Runtime Efficiency On the surface, tags may appear to be a set of strings that are compared with each other. However, they are programmed in such a way that makes them extremely efficient to be compared, with some parts of the system using a highly efficient method called SIMD. By restricting the maximum number of tags allowed (255 for entities and 65535 for collectibles), tags can be compared extremely quickly, much faster than matching codes and variants. Compatibility Mods can make great use of the tag system. As the tag system develops, certain functionality that requires multiple steps to add to an object may be done with a single tag. Take an example: Before 1.22, to make an axe that worked in the current axe recipes, you would have to either register the new axe item in the game domain, or create an entire new set of recipes for your modded axe. This is not ideal. It takes a lot of time to do, and is much more susceptible to bugs. Now, in 1.22, the new axe can have the “tool-axe” tag. All recipes that need an axe will now be satisfied by that item. No extra recipes, no changing domain, no problems later on. This isn’t all. Mods can define their own tags in recipes for other mods to make use of. In the same example, if Mod A created a recipe that required an object with the “tool-axe” tag, then the recipe will work for any vanilla axes, as well as any other mod that uses the “tool-axe” tag. Looking for a different tag in the recipe is simple, and mods can begin interacting with each other in much more effective ways by using the tags system. Expandability As mentioned earlier, tags allow the team and modders to add content much faster and easier than other implementations. By using tags instead of variants, we can satisfy lists of objects without having to search for block codes and variants. How can you use them? In Content Mods Content mods are likely going to see the most benefit from the tag system right now. As mentioned earlier, tags can be used in recipes for pattern matching, target-able AI tasks, and some others. See the “Using Tags (Content)” page on the wiki for more information and examples on how to use them in a content mod. This page also contains some relevant technical information. In Code Mods Code mods can define their own tag sets in code and use these to check for conditions, but all tags must be registered during or before RunPhase.AssetsReady. See the “Using Tags (Code)” page on the wiki for more information and examples on how to use them in a code mod. This page also contains some relevant technical information. Conclusion Tags are a new system that is quite different to how things have been working in the past, but they are worth using. Over time, more systems may end up using tags and I am hopeful that the advantages of using tags will outweigh the changes to the older systems. Lastly, make sure to take a read of the following pages for more information on using tags: https://wiki.vintagestory.at/Modding:Using_Tags_(Content) https://wiki.vintagestory.at/Modding:Using_Tags_(Code) If you have any questions about tags, or would like to give your opinion on the new system, then please reply to this post. Thanks, Nat
-
[Tested] What happens when two mods patch the same file?
Nat_VS replied to AmethystZhou's topic in Guides
Thanks for writing this! Could you please move the post to https://www.vintagestory.at/forums/forum/35-modding-guides/?- 2 replies
-
- json patch
- load order
-
(and 1 more)
Tagged with:
-
Custom Handbook Widgets
Nat_VS replied to bababuoy's topic in Mod Development Questions/Troubleshooting
Hmm... There appears to be two ways you can do this - The first is to, as you've said, use the HarvestableBlockBehavior. There is code inside of CollectibleBehaviorHandbookTextAndExtraInfo.cs that controls it being added to the handbook. Perhaps this will give you an idea as to why your previous code did not work?: List<ItemStack> harvestedStacks = []; if (stack.Block.GetBehavior<BlockBehaviorHarvestable>()?.harvestedStacks is BlockDropItemStack[] hStacks) harvestedStacks = [.. hStacks.Select(hStack => hStack?.ResolvedItemstack)]; if (harvestedStacks?.Count > 0) { bool haveText = components.Count > 0; AddHeading(components, capi, "handbook-dropswhen-harvested", ref haveText); components.Add(new ClearFloatTextComponent(capi, TinyPadding)); while (harvestedStacks.Count > 0) { ItemStack hstack = harvestedStacks[0]; harvestedStacks.RemoveAt(0); if (hstack == null) continue; SlideshowItemstackTextComponent comp = new SlideshowItemstackTextComponent(capi, hstack, harvestedStacks, 40, EnumFloat.Inline, (cs) => openDetailPageFor(GuiHandbookItemStackPage.PageCodeForStack(cs))); components.Add(comp); } components.Add(new ClearFloatTextComponent(capi, TinyPadding)); } The second option appears to be to use the 'ICustomHandbookPageContent' interface on your collectible. I haven't personally used it, but it appears to be able to do what you need it to do. It contains a single function 'OnHandbookPageComposed' that is called by the CollectibleBehaviorHandbookTextAndExtraInfo.cs. It appears you may be able to edit the components of the harvested stacks to add in what you need. Take a look at BlockFruitTreeBranch.cs for an example. Good luck! -
[Community Poll] Video Tutorials for Modding Tutorials
Nat_VS replied to Nat_VS's topic in Official Modding API/Doc Updates
Indeed; Most of these videos will be one-shot tutorials that are not linked to each other. Perhaps, in the future, we could do some long videos of zero to full mod kind of thing, but it will never be a particularly huge mod. -
I'm not 100% sure if it's leaves or grass. Either way, something is using a solid quad rather than its texture.
-
Mod Development FAQ Please check the following before posting your question! This is a growing list; please feel free to reply to this post for recommendations on any questions that should be added. (Coming soon, thanks for being patient.)
-
- 2
-
-
Mod Development Questions/Troubleshooting - Posting Rules, Guidelines & Templates This board is for enquiring about how to achieve something with modding, or for troubleshooting certain issues when making a mod. Rules Either search on the forum or google your issue to try and find if it has been asked before! See the (not yet existent) pinned FAQ post to see if it is on there. If not, then.... Please clearly state what version of the game you are modding. This can be done in the post title or body. Please use the 'solve' feature for when your issue is resolved! If you figure out the issue yourself, or answer your own question, please reply to your own post or edit the post with the answer. Guidelines If you are asking a question, use the 'question' tag. Otherwise, if troubleshooting an issue, use the 'troubleshooting' tag. If you have already tried certain things to solve your issue, note these in your post. It'll help people know what kind of issue you're facing. Template The following is a template that can be used for this channel. You don't have to use it, just as long as you follow the rules. Mod Version: _ Summary: _ Detailed description: _ Already Tried: _
- 1 reply
-
- 1
-
-
@Arisilde I think you're close but not exactly correct - If you take a look at the grass blocks, they are appearing as complete black panes, rather than a completely unlit texture. If it was just lighting, that wouldn't effect the transparency of such blocks. My suggestion is that this is a shader mod, if you have any installed. Specifically, I would say the standard.fsh/vsh shaders appear broken (with the premise that the water is rendering fine, which uses a different shader).
-
Mod Requests - Posting Rules, Guidelines & Templates This board is for enquiring about paid or unpaid mods that you would like someone to make. Rules Please use post reactions to give support to a mod idea. Do not use comments to do this. Please clearly state whether your mod is a commission or unpaid request. Please be careful when/if doing any sort of financial transaction. Guidelines If your mod is a commission, use the 'commission' tag on your post. Give as many details as possible about your request, in their simplest form. I.e., what should the finished product do from the player's perspective? Template The following is a template that can be used for this channel. You don't have to use it, just as long as you follow the rules. Mod Title: _ Mod Version: _ Commission: Yes/No (If commission) Price Range: $0 to $1 Required Features: Feature 1 Feature 2 ... Further Description: _
-
- 1
-
-
Modding Guides - Posting Rules and Guidelines This board is to allow people to create guides and information dumps about certain modding topics. This board is less strict in terms of templates, since it will vary depending on topics. Rules Please provide the version number that the guide was last updated for. Please ensure that all information posted here is correct at the time of writing. Speculation or guesses on how something works is allowed, but please state this for each speculative point. One post per topic. If you are writing about multiple unlinked topics, please use multiple posts. Guidelines It is recommended to provide sources to any information - Whether in the form of inline links, or a sort of bibliography at the end of your post that gives relevant links. It is recommended to use some of the following tags, and you can add more if needed: C# Guide JSON Guide Content Mod Guide Code Mod Guide Blocks Items Entities Misc. Have fun writing your guides! You're doing a service to all modders
-
A Mod to add Dyed Fletching Redux
Nat_VS replied to Heart_Afire's topic in Mod Development Questions/Troubleshooting
I had a quick look at your current zip file. What you're trying to do will require the use of variants. Variants are basically multiple versions of items inside a single asset file. For your purposes, you'll want to have a single 'dyedfletching.json' asset, with a 'color' variant. The states for the color variant should be the same as your barrel recipe. After that, you'll want to add a 'color' variant to your 'fletchedarrow.json' item. It may be worth taking a look at the following wiki tutorials, which deal with creating and using variants: https://wiki.vintagestory.at/Modding:Content_Tutorial_Item_Variants https://wiki.vintagestory.at/Modding:Content_Tutorial_Complex_Grid_Recipes I hope this helps to get you started and gives you an idea of the direction that you need to go in!- 1 reply
-
- 1
-
-
Hi all! A while ago, I hosted a poll over on Discord about the usage of the forum, and it was agreed that we were all hoping for some improvements to be made to the forum to allow it to be used more efficiently, as well as provide a long-term solution to modding queries. Forum Structure To compare, the following is the old structure of the forum, with categories in bold: Vintage Story Modding Mod Releases Modpack Releases Mods & Mod Development The main issue with this is that "Mods & Mod Development" is ultimately the go-to for any and all development queries or updates. The following is the new structure of the forum, with categories in bold: Vintage Story Modding Using Mods Mod Releases WIP Mods Using Mods Troubleshooting Modding Chat Making Mods Official Modding API/Doc Updates Mod Development Questions/Troubleshooting Mod Requests/Ideas Modding Guides [Legacy] [Legacy] Mods & Mod Development [Legacy] Modpack Releases Note that the 'Modpack Releases' and 'Mods & Mod Development' boards are now 'legacy' boards. This means that new posts cannot be created but old posts can still be replied to. One major goal of the new boards is to allow a problem to be searched on Google, and the appropriate results will be displayed. Posting Rules, Guidelines, and Template Each board that can be posted on in the Vintage Story Modding category will now have a pinned 'Posting Rules, Guidelines, and Template'. Following these not only helps us keep the wiki clean, but they are there to help you with posting and ensuring that you give relevant information, and also allows you to receive the information that you want if in a help channel. It is highly recommended to use the attached template for your post. How To Help The forum is a community-based environment, so here's how you can help: Engage with posts - Replying, liking, and sharing posts helps us make a better and more inclusive community. Follow the Board Guidelines - These will help everyone in the long-term. It may seem a little pointless, but it'll help you get the results you want. Recommend the forums - If you're helping someone or talking a lot about a specific problem on Discord, consider asking the author to make a forum post. If one person has struggled with something, you can be sure that someone else will struggle with it too. Use the 'Solved' feature - Certain boards will have a feature where you can mark an issue as solved. Using this will help keep the troubleshooting boards organized. Thanks everyone