Jump to content

Untested [6.2] Tags for NPCs, Items and Maps integrated in the event system (Based on Shenmue's)


Cheshire

Recommended Posts

[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:

 

Media:

Spoiler

Events in Action:

371ef13d48be459e07000918be2f2eaf.gif

0cc08751c0daa170083dcfc181528a6f.gif

 

Editor Shots:

48a2c37893e3c240884ab0d60f65d56f.png

0e8c2f1e47d4d16f72927e6c2d61cbd5.png

 

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!

  1. Download and install the main patch file
  2. Download and install any update patches IN THE ORDER THEY ARE LISTED.
  3. MAKE A BACKUP OF YOUR GAME AND PLAYER DATABASES, THE NEXT STEP IS NOT REVERSIBLE IF YOU WANT TO GO BACK.
  4. Compile and run the server, it should automatically prompt you to migrate the database to the new format.
  5. Start your editor, and get cracking with the new system!
  6. 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.

 

 

Link to comment
Share on other sites

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).

 

0cc08751c0daa170083dcfc181528a6f.gif

 

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!

 

Link to comment
Share on other sites

  • 4 weeks later...

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

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)

Link to comment
Share on other sites

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

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

  • 2 weeks later...

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

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...