Lyynix / MoreJournalEnrichers

This is a module for FoundryVTT. With this module you can use more @enrichers in your journals
MIT License
2 stars 2 forks source link

@Var enricher does not work when used to store a UUID of another document #23

Open lrclucas opened 7 months ago

lrclucas commented 7 months ago

Steps to reproduce:

  1. Create a variable with any chosen name (ex: myVariable)
  2. Put in the value of the variable the UUID of any other document (ex: .gY3ojnDGy7zEeT4p)
  3. Save the variable
  4. In any journal page, insert the notation: @UUID[@Var[myVariable]]

Expected result: I expect to see in my journal a link to the referred document, just as if I have inserted the notation with the UUID directly (Ex: @UUID[.gY3ojnDGy7zEeT4p]

Actual result: I get a broken link with a undefined label image

Motivation: I was really hoping that this would work, because I was planning to have variables to my most referred documents with it's Ids, so I can just use them as variables, instead of having to navigate through my tabs and folders to get their IDs everytime.

Lyynix commented 7 months ago

Hey, Thank you for your feedback

So, the problem is, that enrichers normally don't evaluate their content. in this case, @UUID tries to create a link to the document with the uuid "@Var[myVariable" for this special case i can't do anything, because the @UUID enricher is added by core-Foundry

However I will look into that and make my own enrichers evaluate their content, so that you could use any added enrichers in that combinations (ex: @SceneFull[@Var[myVariable]])

lrclucas commented 7 months ago

Thanks for the feedback. If this is the case, then please do not priorize this bug too much. My idea was to reference npc's, map locations, etc...

But thanks anyway for the response =)

Lyynix commented 7 months ago

It just came to me, that i might be able to overwrite the core enrichers if that is the case, then i might be able to solve your problem

this needs some testing, but ill let you know if ill be able to

lrclucas commented 7 months ago

Another thing I noticed is that if I store the whole notation in the variable @UUID[.gY3ojnDGy7zEeT4p]. It renders it as a text image

But if you look closely, it seems that the variable text is formatted differently, and I know that these handlers do not support formatted text. Maybe if the @Var enricher does not apply any format to it, it may work

Lyynix commented 7 months ago

Thanks, ill look into that!

Just out of curiosity: Why do you want to store the Ids as Variables?

lrclucas commented 7 months ago

Lets say I have a journal page for a very important NPC called John that I refer to him a lot.

Everytime that I am in any other place, writing journals for my adventure, and I want to reference John, I have to go find his page between the tabs and folders. It seems not too much effort, but having to do it frequently adds up in the end, and also breaks my focus on the content that I am working on.

If I can have it on a variable, I can just write @Var[John], everytime that I want to reference him. It gives a more fluid writing experience, and does not break my focus on the content.

I gave the example with NPC, but it can be applied to anything important to my story. Treasures, Locations, NPCs, Items, etc...

Lyynix commented 7 months ago

I will definitely try to make enrichers evaluate their content before using it, to make chained enrichers possible.

I also hope, that my module helps you in your way of creating journals!

To help you with your specific problem for now, I have a few other options available:

lrclucas commented 7 months ago

I am still new to Foundry, so I dont know what are the document names to reference with yet. Do you know where I can find a list of them? Also I will take a look at this module, thanks for the suggestion!

Your module has already helped me a lot in my session planning. Specially the scenes, roll tables and whispers. =) absolute love the convenience of them

lrclucas commented 7 months ago

Update: The suggested module worked fine for my needs! Thanks a lot! You can close here if you want =)

Lyynix commented 7 months ago

Hey, glad I could help

Ill keep the issue for now, because of the content evaluation :)