1 Attachment(s)
Extension[CoreRPG]: display NPC tokens as portraits in chat
This is a fairly straightforward extension for CoreRPG in FGU (I haven't tested in FGC, no idea if it would work) to add NPC tokens to the chat when speaking as NPCs. I have wanted that feature for a while, but from some searches on the forums I couldn't find anyone else having done an extension for that.
I saw some other posts from people asking is such an extension existed though, so I decided to share this since some other people seem to have wanted the same feature.
I have only tested it with basic CoreRPG, 5e and a couple of Modiphius 2d20 rulesets. But in theory, it should work for other rulesets that extend CoreRPG as long as they store NPC names under the "name" element and the token string under the "token" element. And as long as they don't implement their own chat handling that changes the tokens back via a ChatManager message handler.
And as a usage note: It only works as long as the chat identity exactly matches the NPC name (so as long as you don't modify the NPC name after activating the identity, that is no issue).
It also applies when the GM speaks with a player character's identity (their chats will have the appropriate portrait).
As of v2.0, it also supports dice rolls, entities in the combat tracker, and NPCs imported from modules.
The current version is available here:
https://github.com/bakermd86/NPCPort...eleases/latest
https://forge.fantasygrounds.com/shop/items/509/view
Attached is an example of what the extension looks like when in use.
--Edit--
I added an option to also register additional datatypes with the portrait extension so that you can have tokens in chat for any datatypes that have a "name" field for their speaking identity, and a "token" field containing a token. To use that in your own extensions/rulesets/whatever, you just need to call: NPCPortraitManager.registerDataType("class")
In an onDesktopInit function. The simplest way is just to have a global script set an Interface.onDesktopInit callback:
Quote:
Interface.onDesktopInit = onDesktopInit
And then register any data types from within that callback. For example (taken from my STA ruleset):
Quote:
function onInit()
Interface.onDesktopInit = onDesktopInit
end
function onDesktopInit()
-- Register crewmate record type with NPCPortraitManager
if NPCPortraitManager and NPCPortraitManager.registerDataType then
NPCPortraitManager.registerDataType("crewmate")
end
end
Attachment 50843
- Updated 01/08/22 to work with Savage Worlds ruleset after being told it didn't work
- Updated 01/30/22 to add link to Github release page
- Updated 02/18/22 to add link to the Forge