Extends Chat Message, issue with model data
I intend to extends ChatMessage to add a field to the schema. and then add it to the renderTemplate data to be shown.
But during the "getHTML" function the value that I added to the schema is always empty.
Do I have to setup something else to make it reach getHTML with the proper value ?
The class extending the ChatMessage
Inside my "init" hook
The calling code
6 Replies
I am using FoundryVTT 11.315, if it is relevant
You cannot ever change the base document schema, only the
system
's.ChatMessage does not have a 'system' field, should I create it or does it mean I can't alter its model and need to find another way to store the data ?
v12 gives chat messages system fields that you can use. If you absolutely have to stay with v11, you have to resort to storing data in flags.
Ok, thank you for the informations. I will have to use flag then. 🙂
@Wildos gave :vote: LeaguePoints™ to @Ethaks (#7 • 392)