PDA

View Full Version : How can I call current user identity and portrait? [Question]



Sibelius
January 16th, 2017, 11:39
Greetings. I am a beginner doing extensions for FG, and would appreciate some help.

I am trying to use Comm.deliverchatmessage in a LUA function to show up what is the identity of the current user, and his (or her) portrait. I am willing to use the "sender" field of the chat table for the identity, and the "icon" for the portrait. Is there any way I can call those? Are they global variables?

Thank you so much for your help!

Sibelius

Trenloe
January 16th, 2017, 17:03
Welcome to the forums Sibelius

Have a look at the CoreRPG file scripts\manager_chat.lua - the function createBaseMessage does what you're looking for - sets the portrait (stores in msg.icon) and the identity name (stored in msg.sender). It uses various commands from the User package, details here: https://www.fantasygrounds.com/refdoc/User.xcp

Sibelius
January 16th, 2017, 19:08
Thank you for your help! Best regards,

Sibelius