PDA

View Full Version : Player vs Host issue - know it can be solved just not sure how



SilentRuin
June 21st, 2020, 06:11
To use an "old folks" TV reference, "missed it by 'that' much", a tiny amount.

I was in the final testing run of an extension when I discovered my target charsheet skilllist lookup, which had always worked in all my previous tests - from host or player - suddenly started "not" finding things on the player side. It turns out I had been testing the player side with a set of characters that were all owned by the player. Once I made it where only one character was owned the other combat tracker players no longer worked in the skilllist modification lookup I was doing.

Now I know I can OOB my way out of it - its just a matter of how expensive in rewrite that will be. My previous OOB have all been one way to the host for processing where I don't actually need a result back. In this case I need a number back. So my question is really three fold...


1) I'm hoping I'm just being a novice and don't realize there is magic code out there like what I put below - only for "athletics" where it goes to the host to grab it and comes back with the values. Is there some nice magic out there?



nMod, bADV, bDIS, sAddText = ActorManager2.getCheck(rSourceActor, "dexterity");


2) If not, is there a way to simply do my charsheet lookup - then the skill sheet lookup (as shown below) in an OOB messages where i can some how communicate back the nmod value?



local sCharSheetIdentity = "";
for _,vCharSheet in pairs(DB.getChildren("charsheet")) do
--Debug.console("manager_generic_actions:performGenericActionRoll; sCharSheetIdentity = " .. tostring(vCharSheet.getNodeName()));
if DB.getValue(vCharSheet, "name", "") == sCTName then
sCharSheetIdentity = vCharSheet.getNodeName();
break;
end
end
for _,vSkill in pairs(DB.getChildren(sCharSheetIdentity .. ".skilllist")) do
-- check athletics vs current highest modification
if DB.getValue(vSkill, "name", "") == Interface.getString("skill_value_stealth") then
nMod = DB.getValue(vSkill, "total", 0);
end
end


3) Am I totally screwed and going to have push my dice rolls to the host like a drag/drop on the dice tower does (code is already set for handling this switch over once I found out it happened from players side)?



Hopefully, all my novice questions are not a problem. But as Maxwell Smart used to say...

"missed it by 'that' much"

Moon Wizard
June 21st, 2020, 06:24
To understand, you are best off understanding how the database works in FG. The GM always has full control over the entire database. However, player clients only receive content which has been made public or specifically shared with them. Therefore, since PCs are owned and visible to a single user, you can not perform lookups on other characters without asking the GM client for the information.

You could alternately make all PC records public, which however causes other sharing concerns; especially for people that don't want players to know everyone else's PC details. Also, this has not been tested at all; so you may run into other issues.

Generally, when any information not available on the player client is needed to handle an event triggered by a player, it will need to be sent back to the GM client using OOB messaging to be handled.

Regards,
JPG

SilentRuin
June 21st, 2020, 06:38
As I found out the hard way already. Hence my three questions. You seem to be saying my 2nd one is the way to go but did not answer the question of how I can return a numeric value back to the client from my OOB sent to the host. I’m a novice and don’t know how to pass something back only how to process a no return operation.

SilentRuin
June 21st, 2020, 07:05
Actually, the more I think of it I’ll have to just do the source only die roll and then pass the rest off by OOB to do it all for target. My current architecture of doing source and target checks before die roll will have to be abandoned. Question 3 as I feared.