Jump to content

Untested Tags on NPCs, Items and Maps for Event Editor


Shenmue
Message added by jcsnider

Warning! There be dragons!: This mod introduces new field(s) into the games' databases. Database migrations are one-way upgrades. Make database backups before applying! If you later decide that you want to remove this mod you will likely have to restore from those backups or manually make dangerous edits to your database in order to get your game running again. 

Recommended Posts

Tags on NPCs and Items for Event Editor

 

Description:

Instead of adding multiple items for the execution conditions "has item" or "Item equipped is" of an event, you can now add a tag to all identical items and just put one condition. Moreover, there are conditions that make possible the execution of an event depending of the map or the NPCs on the map.

 

Features:

Four new conditions for the execution of an event

1. The player has an item with x tag in his inventory
2. The player equipped an item with x tag
3. The map has NPCs with x tag

4. The map has x tag

Multiple tags per entity (seperated by semi-colons ( ; ) )

For an improved mod with more features, go check @Joyce version of the tag system.

 

V1 to V1.4 : download this patch, be sure to clear all existing tags before applying this as it re-use that field in a different way!

You can also download the zip file in order to be sure you have not missed an update patch.

 

If you have installed the new patch without removing existing tags, you will have to manually modify your database or your server will crash.

Here is a procedure to follow:

Spoiler

1. Download a database (DB) browser for SQLite since Intersect Engine uses SQLite.

This tuto use DB Browser for SQLite

2. Open the DB browser and open your "gamedata.db" file with it. DBs files are located in the server's resources directory. (server\resources\gamedata.db).

3. Go to the "Browse Data" tab and select "Items" table.

4. Remove all texts in the "Tag" column.

5. Redo the step 3 and 4 with "Npcs" Table. 

 

Step 3 and 4:

80dac143b5e1f5e23bcc7e2fad64a391.gif

 

Note: If your server keeps crashing, try to replace the value in the tag columns by this: [""]

 

Note:

This mod adds fields to the database.

You have to add a tag on an Item or an NPC first.
Tags are case sensitive and don't have default value.
NPCs, items and maps tags are not related.

Special thanks to @Aesthetic and @Joyce, MVP

 

Media:

ceffb5843ad0ed023471c45a9efdc04e.gif

ade96f832893453f94f31040f5b0c72a.gif

Spoiler

937b965caee4da9d784f57a3fd66b09f.pngefe118837b7c4e48d53b9011dbba164f.png6f6458283b1452f3b73eb04bf473c3e4.png877028d928c00cf8dfee0527d81e99f6.pnga165b008132913c75e7ad588e328ddbb.png

 

Git Patch: V1.4

Download Joyce's version (more features)

Download full mod

Download zip file with all patches used (separated)

 

Based On:

Version 0.6.2.415

 

Last official working commit with the patch:

ID: 0137cf54

From: JC Snider 

Date: 4/21/2020 12:32:45 AM

Message: Fixing ghost players 160 (#166)

Spoiler

To see the history of commits of your branch, right click on your current branch, then on history.

300f12524b20386e65ab084208b29734.png

 

 

Setup:

The patch should do it. Be sure to build your project after.

How to apply a patch

How to solve patch conflicts

About diffy.org



 

Link to comment
Share on other sites

That looks like a nifty mod, haven't looked at the source yet though. 

 

Out of curiosity, is it possible to add multiple tags per item by adding commas in between them? (or make it a combobox that stores tags? However the ui implementation for that would work it might be handy to tag items as say Ingredient and Food) 

 

Would it also be possible to add an option to remove items with a specific tag through events from the inventory? Think a seasonal event ended and you want to wipe everyone's seasonal items from their inventory. Could just make a call to remove all items tagged with Seasonal. Or several quest items (ie loaner tools from a crafting tutorial) being removed in one go. 

Link to comment
Share on other sites

1 hour ago, wishy said:

Good to see you like it that much :)

 

14 minutes ago, Joyce said:

Out of curiosity, is it possible to add multiple tags per item by adding commas in between them? (or make it a combobox that stores tags? However the ui implementation for that would work it might be handy to tag items as say Ingredient and Food) 

Right now it's not possible. I was thinking about it, and I will probably update the patch with this functionality (use of commas for multiple tags). I don't know when, but probably soon.

 

16 minutes ago, Joyce said:

Would it also be possible to add an option to remove items with a specific tag through events from the inventory? Think a seasonal event ended and you want to wipe everyone's seasonal items from their inventory. Could just make a call to remove all items tagged with Seasonal. Or several quest items (ie loaner tools from a crafting tutorial) being removed in one go. 

It looks pretty cool. I might look into it when I will be done with the other mods I am currently working on.

Link to comment
Share on other sites

I've made a small adjustment to this already.. Allowing you to add multiple tags seperated by semi-colons ( ; ).

877028d928c00cf8dfee0527d81e99f6.png

 

I've also made some adjustments to the code that combines all tags into a selectable list.. Honestly, why check whether something exists yourself when you can get the language to do it for you. :P

 

10676c9835b3c74efefc79d3bb601e33.png

 

This does not require additional database changes on top of the original mod.

HOWEVER, CLEAR ALL EXISTING TAGS BEFORE APPLYING THIS AS I RE-USE THAT FIELD IN A DIFFERENT WAY!

YOU HAVE BEEN WARNED!

 

Download removed because it's implemented in the base patch.

Link to comment
Share on other sites

2 minutes ago, Joyce said:

I've made a small adjustment to this already.. Allowing you to add multiple tags seperated by semi-colons ( ; ).

877028d928c00cf8dfee0527d81e99f6.png

 

I've also made some adjustments to the code that combines all tags into a selectable list.. Honestly, why check whether something exists yourself when you can get the language to do it for you. :P

 

10676c9835b3c74efefc79d3bb601e33.png

 

This does not require additional database changes on top of the original mod.

HOWEVER, CLEAR ALL EXISTING TAGS BEFORE APPLYING THIS AS I RE-USE THAT FIELD IN A DIFFERENT WAY!

YOU HAVE BEEN WARNED!

 

Download the patch HERE

Thanks Joyce, really appreciated <3
I will update the post with your mod

Link to comment
Share on other sites

No problem, just something I really felt like the tag system could use. :)

 

EDIT: Just realised I did a dumbdumb, it works.. But some of my .Any() sections could probably be replaced with a .Contains().

 

EDIT2: 

Made another change.. Added the ability to add tags to maps in the map editor the same way as you can with items and NPCs. Also changed some of my code around that wasn't quite right.. AND made a method more generic so it's easier to add new tag event editor stuff.

 

890afb965f57963bc7cac2be9316de02.png

 

Figured this could be used for items/spells not being allowed in certain regions (ie teleport spells and scrolls not working inside dungeons/caves)

 

a165b008132913c75e7ad588e328ddbb.png

 

ceffb5843ad0ed023471c45a9efdc04e.gif

 

Download removed because it's implemented in the base patch.

Link to comment
Share on other sites

Made another mod, the ability to take items away by tag through the event system.. Ended up cleaning up a ton of the code and rewriting some sections of it entirely.

 

Not sure if at this point I should just release it as my own. lol

Link to comment
Share on other sites

7 hours ago, Joyce said:

Made another mod, the ability to take items away by tag through the event system.. Ended up cleaning up a ton of the code and rewriting some sections of it entirely.

 

Not sure if at this point I should just release it as my own. lol

All is good for me, well done :91_thumbsup:

Link to comment
Share on other sites

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