PDA

View Full Version : GM rolls not hide



Larhalt
December 9th, 2015, 10:29
I'm using a 2E ruleset modified by Idabrius based on Piscodelix ADD ruleset.

When I rolls dice on the chat as GM, no matter wich option I select (Chat: Show GM rolls) on/off, the rolls are always visible.

That's the code in manager_chat.lua


-- Set the hidden dice option, if the GM has it set
if User.isHost() then
if OptionsManager.isOption("REVL", "on") then
msg.dicesecret = false;
end
end


All the other options working fine, if someone want to spend few minutes to help me to understand where I can search the problem, I'll be grateful :)

Zacchaeus
December 9th, 2015, 18:07
Hang on; are you viewing that as the GM or as a player? The GM always sees the rolls; they are only hidden or unhidden on the player's side.

Larhalt
December 9th, 2015, 18:09
Of course I'm talking about player. But even if I'm GM's side, there's no "?" in chat.

Trenloe
December 9th, 2015, 21:17
Your code is incomplete. There is nothing in your code that sets msg.dicesecret = true if the campaign options is set to "on".

Larhalt
December 9th, 2015, 21:39
Thank you Trenloe, I've modified the value in "true", but still not working

Trenloe
December 9th, 2015, 22:02
Thank you Trenloe, I've modified the value in "true", but still not working
Then you need to trace through the process in your code - perhaps use some Debug.console (https://www.fantasygrounds.com/refdoc/Debug.xcp#console)commands to write what the value of msg.dicesecret or msg.secret (see here: https://www.fantasygrounds.com/refdoc/Comm.xcp) to the console, as something else in the code might be changing it. Check this value just before the chat message is delivered with Comm.deliverChatMessage (https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverChatMessage)

leozelig
December 10th, 2015, 02:33
From manager_actions in CoreRPG


function createActionMessage(rSource, rRoll)
local sDesc = rRoll.sDesc;

-- Build the basic message to deliver
local rMessage = ChatManager.createBaseMessage(rSource, rRoll.sUser);
rMessage.type = rRoll.sType;
rMessage.text = rMessage.text .. sDesc;
rMessage.dice = rRoll.aDice;
rMessage.diemodifier = rRoll.nMod;

-- Check to see if this roll should be secret (GM or dice tower tag)
if rRoll.bSecret then
rMessage.secret = true;
if rRoll.bTower then
rMessage.icon = "dicetower_icon";
end
elseif User.isHost() and OptionsManager.isOption("REVL", "off") then
rMessage.secret = true;
end

-- Show total if option enabled
if OptionsManager.isOption("TOTL", "on") and rRoll.aDice and #(rRoll.aDice) > 0 then
rMessage.dicedisplay = 1;
end

return

Larhalt
December 10th, 2015, 09:40
Maybe I didn't understand very well how Debug.console must be used, but with this code, nothing happened



Debug.console("msg.dicesecret:")
Debug.console(msg.dicesecret);
Debug.console("msg.secret:")
Debug.console(msg.secret);
-- Set the hidden dice option, if the GM has it set
if User.isHost() then
if OptionsManager.isOption("REVL", "off") then
msg.dicesecret = true;
end
end


Thank you Leo, I tried that too, but didn't work

dulux-oz
December 10th, 2015, 09:46
Let's see if I can help

Debug.console("msg.dicesecret:") will print the string "msg.dicesecret:" (without the quotes) to the console window - as I'm sure you're aware. :)
Debug.console(msg.dicesecret) will print the contents of the variable msg.dicesecret as a string proceeded by the type of the variable (S for string, etc) to the console window.

If nothing was printed in the console window then the code was not run (execution didn't reach that part of the code).

If "msg.dicesecret:" was printed but nothing else then the code was executed but the variable msg.dicesecret was empty ie null.

Does that help explain what's going on?

Cheers

Larhalt
December 10th, 2015, 09:51
Thank you dulux, but nothing is printed in the console, only a width problem with a field

dulux-oz
December 10th, 2015, 10:09
Then I'd hazard a guess that the section of code where the Debugs are isn't being reached at all. If that's the case they I'd track back through the code to see why and where.

One of the techniques I use is to include a simple

print("got to here");

or a

print("got to 1");

line where ever I need to see if that bit of code is reached. The relevant string will appear in the console window.

Cheers

Larhalt
December 10th, 2015, 19:09
I tried to make it working, but I'm not familiar with LUA or programming in general.

I've used


print("385");


print('385');


print("msg.dicesecret");


print('msg.dicesecret');

but nothing works.

I know that I'm newbie about coding, so please be gentle :D

Nickademus
December 10th, 2015, 19:49
Try

Debug.console("385");

Larhalt
December 10th, 2015, 20:09
Try

Debug.console("385");

Thank you Nickademus, I've tried this way, rolling a dice and modify the option, but nothing pop-up :(

damned
December 11th, 2015, 11:21
Thank you Nickademus, I've tried this way, rolling a dice and modify the option, but nothing pop-up :(

Then your code is not being executed.
Why isnt it being executed? Because whatever actions you are doing in FG are not linked to the code you are writing. There is a logic gap somewhere...

Larhalt
December 11th, 2015, 11:30
I understand that there's a problem in this ruleset, but what I'm trying to explain is that I don't have the skill to fix it.

Here is full of wise people that can understand the problem better than me, since I'm not able to do it by myself, there's someone that can
give me a solution, or for playing a non official ruleset created by FG, I have to learn coding?

damned
December 11th, 2015, 11:43
I understand that there's a problem in this ruleset, but what I'm trying to explain is that I don't have the skill to fix it.

Here is full of wise people that can understand the problem better than me, since I'm not able to do it by myself, there's someone that can
give me a solution, or for playing a non official ruleset created by FG, I have to learn coding?

Hi Larhalt - I think weve been thru this already :)
https://www.fantasygrounds.com/forums/showthread.php?26059-ADD-2E-ruleset
https://www.fantasygrounds.com/forums/showthread.php?25938-Need-help-with-many-issues-Ruleset-2E
If you want to use a ruleset that is not covered by FG use CoreRPG. If you want more than that - yes - you have to learn coding.
You are not making trivial changes. You are making changes to how the code works so you have to learn the code/coding.

leozelig
December 11th, 2015, 11:48
Well, you seem to have done a good job with it for not knowing how to code.

I have considered working on AD&D in the past but the rules are so complex, and I don't have the time. I am a major hack, not a professional at all, but the ADD2 code is very difficult for me to follow. I think I am just spoiled by how well CoreRPG is organized. My personal opinion is to just use CoreRPG for now. It doesn't have all of the automation or fancy layout, but you can definitely run a game with it. If I was going to work on AD&D though, I would use CoreRPG as a base, or even 3.5E, but I know we have had that discussion before. I just think problems like this would not happen and would save time and frustration in the end. Plus, most people here are very familiar with that code. I know that doesn't really help you, sorry! :)

Larhalt
December 11th, 2015, 11:51
Good to hear that.

You know better than me that if anyone of those that replied in this post have downloaded and view the code, will use 10-15 minutes for found the problem, right?
But ok, it's not a big problem. If I find an external help from this forum to fix it, then I continue to pay for FG, if not, I'll use another emulator.

Thank you to all the good community.

Trenloe
December 13th, 2015, 18:17
You know better than me that if anyone of those that replied in this post have downloaded and view the code, will use 10-15 minutes for found the problem, right?
The work would probably be longer than 10-15 minutes (as leozelig mentions above the ADD2 ruleset is hard to follow) and it will need coding in a number of places. And then what happens next? Something else needs fixing, then something else and suddenly it is hours of work, not 10-15 minutes.

If a developer who understands FG wants to spend hours of work on the ADD2 ruleset then that's fine. Usually this is a developer who wants to play the ruleset as well. Otherwise, we're trying to teach you how to make the changes - because those of us who have replied *don't* want to spend hours on this ruleset. Sorry.

I hope you find someone who is willing to spend the hours needed to make an AD&D ruleset operational.