PDA

View Full Version : Hiding player rolls



Archmage
March 6th, 2008, 02:53
I am wondering if there is any way to hide a player's die roll from other players, but not the DM. I know that the DM's die rolls can be hidden from the players, and I would like to know if this functionality can be added to the player die rolls as well. Essentially, I would like for Player_A to be able to roll dice, and have the results be reported only to the DM and Player_A. I don't want any other players to know the result of the die roll, or even that a die has been rolled.

I played around with the "diesecret" property a little bit, but I couldn't get the results I was looking for. Can anybody offer assistance or a clue as to what I would need to do to get this functionality?

joshuha
March 6th, 2008, 03:29
Basically on the onDiceLanded event in chat_chat.lua you would process the die roll message yourself and do a deliverMessage but only put the host name in as the receiver.

Make sure you return true at the end of your block to let FG not to do any other processing.

Tokuriku
March 6th, 2008, 11:55
I have also seen a ruleset mod called "The Box" enabling you to have the player roll the dice and only the GM can see it. It is not exactly what you want but the player still makes the roll and the players cannot see the result.

Archmage
March 6th, 2008, 22:30
Thanks for the tips guys. I will look into them. :)

Archmage
March 8th, 2008, 11:24
Is there a way that I can essentially extend the functionality of the onDiceLanded function in chat_chat.lua, rather than having to edit that file? I ask because I'd rather not have to make all these modifications again each time Smiteworks pushes a new update out.

Archmage
March 21st, 2008, 11:50
Ok, so in an attempt to get the most basic functionality for this idea working, I changed the deliverMessage(entry) line in onDiceLanded() to read:
deliverMessage(entry, "");

Now, according to the documentation on this site, it should work just like the original, except that the host should deliver the message to nobody. What it actually does, is just show the full attack label, and completely omit the die roll result. Obviously, that's not what I'm looking for.

It seems as though specifying any recipient for the message causes the program to omit the actual die result. I can even hard code the usernames, and it still has the same erroneous result.

What do I have to do to make it display the actual roll result? I am completely lost here, and the documentation is not in-depth enough to be of any help.

joshuha
March 21st, 2008, 14:30
Ok, so in an attempt to get the most basic functionality for this idea working, I changed the deliverMessage(entry) line in onDiceLanded() to read:
deliverMessage(entry, "");

Now, according to the documentation on this site, it should work just like the original, except that the host should deliver the message to nobody. What it actually does, is just show the full attack label, and completely omit the die roll result. Obviously, that's not what I'm looking for.

It seems as though specifying any recipient for the message causes the program to omit the actual die result. I can even hard code the usernames, and it still has the same erroneous result.

What do I have to do to make it display the actual roll result? I am completely lost here, and the documentation is not in-depth enough to be of any help.

What is happening is since the message never hits the chatwindow for full dice processing (like a whisper) its not processing the dielist. Will submit this to be looked at.

However, there is probably an easy way around this. Let me stat up some code to test out.

joshuha
March 21st, 2008, 15:00
What is happening is since the message never hits the chatwindow for full dice processing (like a whisper) its not processing the dielist. Will submit this to be looked at.

However, there is probably an easy way around this. Let me stat up some code to test out.


Ok I did this in the full attack as proof of concept but you could do the same for just the general "dice" section as well.

Basically the deliver message portion I replaced with the following:


if User.isHost() then
deliverMessage(entry);
else
results = {}
results = draginfo.getDieList();
for i=1, table.maxn(results) do
if i == 1 then
entry.text = entry.text .. " rolled " .. results[i].type .. ":" .. results[i].result;
else
entry.text = entry.text .. " ," .. results[i].type .. ":" .. results[i].result;
end
end
entry.text = entry.text .. " + " .. entry.diemodifier;
deliverMessage(entry, "");
entry.text = "You rolled: " .. draginfo.getStringData();
addMessage(entry);
end

What it does is check if the user is the host and if so don't do anything special. If its a player, it constructs a text message with the results and then does a local addMessage so only that player can see his results. If you wanted them hidden from the player to you could remove that or just put a "You rolled something" mesage to let them know.

While this isn't as pretty as its just a text message it does work. If you wanted to make this pretty you would have to put in way to do a whisper of data (or use the DB) that the GM could do an addMessage to get it to show locally.

Archmage
March 22nd, 2008, 00:28
That was extremely helpful. I have it working now, and it more or less does what I want. I still have one problem though.

I would like the DM to be able toggle the hiding on and off with a slash command. I was modeling the functionality on the /die hide command, but I can't seem to get the game to recognize a variable that tracks the state of the toggle switch. How might I go about doing that?

joshuha
March 22nd, 2008, 00:30
The best way is to use the CampaignRegistry which stores variables in a file for access and storage.

So you can do CampaignRegistry.hidetoggle = true;

Oberoten
March 22nd, 2008, 05:30
The best way is to use the CampaignRegistry which stores variables in a file for access and storage.

So you can do CampaignRegistry.hidetoggle = true;

This sounds very useful... could we please get an example on how to set and retrieve an option like that?

... I see possibilities like perhaps a GM set Difficulty for Stealth-Rolls etc. :)

Archmage
March 22nd, 2008, 11:49
The best way is to use the CampaignRegistry which stores variables in a file for access and storage.

So you can do CampaignRegistry.hidetoggle = true;
Can I actually just put "CampaignRegistry.hidetoggle = true;" in the ChatManager script? Or is there something I have to do to declare the variable first? There seems to be no documentation on using the registries. It basically just says that they exist.

Oberoten
March 22nd, 2008, 12:02
My point exactly. Nothing in there as to how to handle them...

joshuha
March 24th, 2008, 14:31
The registry file is actually only seen by the local client so not sure if it was actually the best example here. Although you could use it still for the GM for the master toggle and create a custom type hander but in this case a DB handler would be better.

The registry works better for local toggles that could vary by player. Responding in the other thread about registries in general.

Archmage
March 25th, 2008, 00:16
Ok, I've been trying a different approach to this, because it seems as though there's no way to prevent FG from showing all player rolls in the chat window to every other player. I can hide the total result, but everyone still sees what dice were rolled, and the die results. If I'm wrong about this, please inform me as to how I should go about hiding the actual roll from other players.

Assuming my statements above are correct, what I'd like to know is, is there a way to get another window to utilize the onDiceLanded function? So far, I've only been able to get a response with the onDrop function, and as such, it seems as though I can't get actual die roll results from that.

This is more or less an aesthetic thing, because I could easily just get die types and generate random numbers. But rolling dice and getting real results that are different from the die results kind of destroys the "warm fuzzy" of dice rolling that FG does so well.

Xorn
March 27th, 2008, 17:45
I have also seen a ruleset mod called "The Box" enabling you to have the player roll the dice and only the GM can see it. It is not exactly what you want but the player still makes the roll and the players cannot see the result.

Anyone have details on this ruleset mod? That is EXACTLY what I want for active skill checks like Perception, etc.

Jingo
April 2nd, 2008, 03:12
Xorn there's some info here when I posted this same question a couple of days ago:

https://www.fantasygrounds.com/forums/showthread.php?t=8176

I tried the mod and it works great.