PDA

View Full Version : [programming] chatmessage strings/player CT



pr6i6e6st
October 9th, 2019, 06:33
Ok so these are two separate questions, and I’m just missing a piece to each puzzle, I believe.

1) how do I program the ct to allow players to drop numbers on an entry to alter the “health” field of that entity? It works just fine as a GM but I seem to be missing something for a player to achieve this. “If not User.isHost” isn’t working as it does for deliverChatMessage() functions.

2)how do I use a string resource for a deliverChatMessage() function? Want to make it easier to translate, and that’s the last hurdle.

Trenloe
October 9th, 2019, 12:12
1) Players can only modify the database records they own. Whereas the GM can modify all records.

You could look at using OOB messaging that passes the execution of some code to the GM, so that the GM instance could change the data.

OOB messaging can be a little complex to get your head round at first, as you need to setup and register a OOB message handler, a message structure, call the OOB messaging and code in the handler. See the 5E scripts\manager_action_damage.lua file for an example - the OOB_MSGTYPE_APPLYDMG OOB messaging in there is used for players to pass the handling of damage damage application to the GM.

2) Get the contents of the FG string resource with Interface.getString and concatenate that in your chat message: https://www.fantasygrounds.com/refdoc/Interface.xcp#getString

pr6i6e6st
October 9th, 2019, 19:18
thank you. i got #2 working with your advice. #1 is going to take some studying it seems.