I've come across the need for a feature like described in #547, and since apparently nobody has done anything on it yet, I decided to give it a try.
As I already mentioned there, the implementation itself shouldn't be hard, but but there is the issue of storing data on the player: For just a new BQ event and condition, a whole new (config/DB/whatever) file seems like too much, yet the IDs of the hidden NPCs need to be stored on the player in some way.
A solution I've considered is using a specific tag pattern to store the data - so for each new hidden NPC, the player would get a tag like hidden-25 where 25 is the ID of the NPC.
But that honestly doesn't look like a "proper" way to do it to me - but I couldn't really come up with a better one.
So my question is: Is there any "proper" way for devs to store BQ data on the player that I didn't see, or are more or less dirty solutions the way to go?
I think the proper way to do this would be creating a new Table in the sql-Database where Betonquest stores its data and savethis there...
The proper way would be like holograms are handled where you can specify conditions in the custom.yml
take a look here:
https://github.com/Co0sh/BetonQuest/wiki/Compatibility#holographicdisplays
@Namnodorel I'd prefer if no-one touched the database. Since I'm not using any reliable framework, all changes to it can accidentally break users' data.
The approach suggested by @MWFIAE is both easier to implement and safer.
So... I'd basically need to save database-like data in a config file? Doesn't seem very elegant to me either. But if there's really no other way, I'll go with it.
Well it is configuration what conditions need to be meet to hide a npc.
The "real" data would be which player has a certain condition/tag, but this would be handled by bq and stored in the database.
You could go the no-config-way with setting up tags in a specific manner like you said yourself:
something like "hidden-25"
But that way you would have to imply knowledge about what tags are to be used and it wouldn't play nice with other quest-packages/addons which don't know that you already are using "hidden-" in such a way. A config would make that much more explicit and flexible (only see the npc if you're carrying meat? why not!) .
If you really want a database (altough that won't be as flexible, but maybe better performancewise if implemented correctly) you could just make your own table and handle that data in your own plugin. (With appropriate questevents to use it from betonquest) [[Commands would work too, but... meh!]]
Basically you're free to do what you like as its your own plugin that handles stuff.
The only thing that is a big nono would be to misuse betonquest tables as that could arise many issues on new betonquest versions etc.
Just my two cents, and I apologize if something sounded rude. english isn't my native language.
Thanks @MWFIAE, I couldn't have explained that better ^^