Cheshire Posted April 25, 2020 Share Posted April 25, 2020 [6.2] Tags for NPCs, Items and Maps integrated in the event system (Based on Shenmue's) Description: This patch is a fairly heavily modified version of @Shenmue his patch with additional features and some fairly hefty rewrites in the logic. (Hopefully enough to at some point perhaps become a baseline addition for the engine?) Currently the following additional features are available through this patch: Gives you the ability to add multiple tags to an NPC, Item or Map through their respective editors. Adds the following additional conditions to the event editor: Player has Item(s) with Tag X Player has Item(s) Equipped with tag X Map has tag X Map contains NPC with Tag X Adds the following additional commands to the event editor: Change Item(s) with tag X from Player. - Changed Credits: @Shenmue for the original patch. Media: Spoiler Events in Action: Editor Shots: Downloads: Patch V1.2: Download WARNING: There is no upgrade path from older versions of this patch! You're on your own trying to work out which event Id's to use internally if you upgrade your dev branch from an older version! Setup: WARNING(s): There is a very distinct possibility that this may break compatibility with any other mod that edits the event editor! Please backup your Game and Player databases before applying this modification, there is no going back after installing this if you want to remove it unless you edit your database manually! The following steps are REQUIRED before this will work properly! Download and install the main patch file Download and install any update patches IN THE ORDER THEY ARE LISTED. MAKE A BACKUP OF YOUR GAME AND PLAYER DATABASES, THE NEXT STEP IS NOT REVERSIBLE IF YOU WANT TO GO BACK. Compile and run the server, it should automatically prompt you to migrate the database to the new format. Start your editor, and get cracking with the new system! Optionally, edit the new editor language files to fit your language! FAQ: Q. Why are you releasing this as your own mod, you were updating his before? A. This is less annoying when I feel like something deserves to be added or changed. It'll also stop him from getting requests or bugreports regarding changes I've made. Q. Can I upgrade to this system from Shenmue's patch? A. Yes and no, while the database can be transported to this mod there is no direct source upgrade path and you will have to start by removing his mod and adding mine. Q. Will you offer an upgrade patch from Shenmue's patch? A. No, I've rewritten the logic a fair few times and changed things too much for me to go back to his mod and backport my own changes. Q. How do I add more than one tag to something? A. Add a Semi-Colon ( ; ) inbetween each Tag you want to add to an object. For example: Tag1;Tag2;Tag3; Q. How does changing items by tag work? A. Okay, this one is a bit more complicated, but I'll try to simplify it.. Giving Items works relatively simple, the server will simply pick a random item to give the player up to the quantity you've set in the event. For example, a quantity of 50 could give you 3 gold, 1 sword, 32 twigs and 14 helmets. Taking Items is a little more complex in terms of code, however works relatively simple.. The server makes a list of ALL applicable items with the correct tags in your inventory and goes through them slot by slot to attempt to remove the required amount. So if you say, want to remove gold and books as in my examples and your books come after your gold in the inventory, there will be no books taken until you run out of gold. Blestro, Guite Emortal, wishy and 2 others 5 Link to comment Share on other sites More sharing options...
Beefy Kasplant Posted April 25, 2020 Share Posted April 25, 2020 Cool stuff! Hopefully this will be added in the engine soon. Kamus 1 Link to comment Share on other sites More sharing options...
Cheshire Posted April 26, 2020 Author Share Posted April 26, 2020 I've modified the take item by tag command to allow for CHANGING items by tag, much like the original change item command. (ie both give and take commands). The update to the patch is in the first post. WARNING: Remove any and ALL take item by tag commands from events before applying this update or your server WILL crash! Shenmue and Vhaeriel 2 Link to comment Share on other sites More sharing options...
Klarwasser Posted May 23, 2020 Share Posted May 23, 2020 Nice! i would love to use it but i getting a few errors when i try to check apply on the latest development branch. is it supported? what am i doing wrong? (sorry i'm a beginner) git apply --check 5822c3f6e5f8ec07ec70f104e1fb2752.patch error: patch failed: Intersect (Core)/GameObjects/Events/Condition.cs:38 error: Intersect (Core)/GameObjects/Events/Condition.cs: patch does not apply error: patch failed: Intersect (Core)/Intersect (Core).csproj:221 error: Intersect (Core)/Intersect (Core).csproj: patch does not apply error: patch failed: Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs:32 error: Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs: patch does not apply error: patch failed: Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.cs:329 error: Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.cs: patch does not apply error: patch failed: Intersect.Editor/Forms/Editors/frmNpc.Designer.cs:71 error: Intersect.Editor/Forms/Editors/frmNpc.Designer.cs: patch does not apply error: patch failed: Intersect.Editor/Forms/Editors/frmNpc.resx:125 error: Intersect.Editor/Forms/Editors/frmNpc.resx: patch does not apply error: patch failed: Intersect.Editor/Localization/Strings.cs:1791 error: Intersect.Editor/Localization/Strings.cs: patch does not apply Link to comment Share on other sites More sharing options...
Cheshire Posted May 23, 2020 Author Share Posted May 23, 2020 This was built against an older version of the development branch, before I started adding new official events and the like. It'll take a little work getting it functional again and work with the new event changes. I'll see if I can do that over the weekend. (No promises though, I'm out most of the weekend) Klarwasser 1 Link to comment Share on other sites More sharing options...
Klarwasser Posted May 23, 2020 Share Posted May 23, 2020 Thanks very much no hurry dont rush Link to comment Share on other sites More sharing options...
Cheshire Posted May 23, 2020 Author Share Posted May 23, 2020 Updated this to work with the newest dev build (0.6.2.420). Note that this DOES NOT include any extra features introduced to the dev branch such as the changes to the regular change item command. This simply updates the mod to be compatible. Download Link to comment Share on other sites More sharing options...
Guite Emortal Posted May 24, 2020 Share Posted May 24, 2020 This would make a pretty cool addition to the engine. Link to comment Share on other sites More sharing options...
Cheshire Posted May 24, 2020 Author Share Posted May 24, 2020 40 minutes ago, Guite Emortal said: This would make a pretty cool addition to the engine. Unfortunately, to make it a baseline addition there's some requirements that I'm not 100% sure how to manage. Currently tags are aggregated from all objects and then made distinct.. what would be preferable would be a new table that functions as a lookup table. I'm just not sure how to work the ef to reference unique collections of columns rather than an Id. So for the time being, it's a mod like this. Link to comment Share on other sites More sharing options...
Lathander Posted June 6, 2020 Share Posted June 6, 2020 Hey Joyce-- Noticed a small blip with this code. My partner has been doing some heavy spell development and I realized this tag system would be just what we needed. We added archer abilities that require you have bow equipped, and instead of listing every bow in the game, decided to use tags to check for item tagged as bow. Amazing system for sure, huge thank you to both you and Shenmue! I noticed however, that when you use the command "Change Items By Tag" that there is no passing of the current saved value for the command to the editor. This can cause an issue when first adding the command, because the user believes they are adding a give command, when really it actually defaults to take, but doesn't show that in the window. It also doesn't present the correct value when opening to edit the command. Under the function EventCommandChangeItemsBytag I just added: cmbAction.SelectedIndex = Convert.ToInt32(!mMyCommand.Add); The second thing to note is that this defaults to a false value which would be the take action. So I set: public bool Add { get; set; } = true; in the ChangeItemsByTag : EventCommand That way, it defaults to the give action when first making a command to match the combolist. Figured I'd just throw this in here for anyone working with this system. Link to comment Share on other sites More sharing options...
PyroTech03 Posted October 28, 2023 Share Posted October 28, 2023 I know this is old, but would love to see this make it into the core engine. It's so useful and looks like it could solve a few of the issue's I've been having trying to find some workarounds in my project! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now