PDA

View Full Version : The state of the /mood Switch in 2.8+



Oberoten
January 17th, 2012, 19:17
Since 2.8 and upwards the /m or /mood switch has been broken on the GM-side.
Quoting Phantomwhale

" To clarify, the /m command when followed by either a single word mood parameter or a multi-word mood parameter that was surround by parentheses, but without any chat words, would set that mood as the persistent mood. This would apply the mood to all future chat until a simple "/m" command was run. "

Confirmed for GURPS, Ars Magica, 4e, 35e.

- Obe

Oberoten
January 21st, 2012, 20:29
Anyone got any suggestions for how to fix this?

- Obe

Zeus
January 21st, 2012, 20:53
@Obe: I'm afraid as /mood is built into and handled by the FGII client itself and not the ruleset, the only way this can be addressed is by JPG and the other Smiteworks devs.

Hopefully, the bug will get addressed in the next release.

Oberoten
January 21st, 2012, 21:14
From 2.8 and up if you set 2.8 compatibility in the base-file all slash functions have been moved out into the rulesets.

... it caused some problems with colliding such at first. But that has since been resolved.

- Obe

Zeus
January 22nd, 2012, 00:09
OK. 4E is still keyed to 2.7. That explains why I could find no reference to /mood being handled in the 4E ruleset.

However from reviewing 3.5E which is keyed to 2.8 I can still find no reference to /mood?

What am I missing?

Oberoten
January 22nd, 2012, 00:18
In the 3.5E

scripts\manager_chat.lua



function processChatMood(params)
local sMood = string.match(params, "^%(.+%)");

if not sMood then
sMood = string.match(params, "^[^ ]+");
end
if not sMood then
SystemMessage("No mood string found.\rUsage:\r/mood [mood] [message]\r/mood ([multi-word mood]) [message]");
return;
end

local sText = string.sub(params, #sMood);
sText = StringManager.trimString(sText);

if sText == "" then
Comm.setChatMood(sMood);
else
local msg = { font = "chatfont", mode = "chat" };
msg.mood = sMood;
msg.text = sText;

Comm.deliverChatMessage(msg);
end
end



Comm.setChatMood(sMood);

Seems to be the problem.
Most likely because it was never moved out of the hardcoded functions.

- Obe

Zeus
January 22nd, 2012, 00:28
OK, I am now officially freaked out.

Just checked my 3.5E ruleset files and scripts/manager_chat.lua. No processChatMood() method in the file!!!!

I am running 2.8.1 Ultimate and am bang upto date as far as I can tell with versions. The update process appears to run cleanly.

Weird.

However from reviewing the code you posted. Either Comm.setChatMood(sMood) isn't working as it should or the chat manager is not checking for the existence of a mood before it sends messages to the chat window.

phantomwhale
January 22nd, 2012, 03:14
I've got the following in my SWEX code for "built in" functions (e.g. ones I have NO code for, but they do still magically work)



SystemMessage("/clear");
SystemMessage("/console");
SystemMessage("/day");
SystemMessage("/emote <message>");
SystemMessage("/export");
SystemMessage("/mood [mood] <message>");
SystemMessage("/mood ([multiword mood]) <message>");
SystemMessage("/ooc <message>");
SystemMessage("/night");
SystemMessage("/reload");
SystemMessage("/save");
SystemMessage("/story <message>");
SystemMessage("/vote <message>");

So the /mood functionality that comes as part of v2.8 compatibility behaves as described above (e.g. no persistent moods)

I've got nothing calling into the Comm.setChatMood() (https://www.fantasygrounds.com/refdoc/Comm.xcp#setChatMood) function yet (the Comm package was added in v2.8 FGII to "open up" some of the private chat window functionality) so maybe the answer is for all rulesets to add the code chunk shown, and register a /mood handler, if you want this extra behaviour?

[EDIT] Added this as a wishlist item for SW : https://savagefgii.idea.informer.com/proj/?ia=40845

Zeus
January 22nd, 2012, 11:29
I am still perplexed as to how Obe's 3.5E contains a processChatMood() method in his copy of scripts/manager_chat.lua when my up to date copy of 3.5E (as far as I can tell) doesn't.



I've got nothing calling into the Comm.setChatMood() function yet (the Comm package was added in v2.8 FGII to "open up" some of the private chat window functionality) so maybe the answer is for all rulesets to add the code chunk shown, and register a /mood handler, if you want this extra behaviour?

My copy of 3.5E also doesn't have a call to Comm.setChatMood(). The /mood functionality I have tested also appears to not handle persistent moods (as described above).

Trenloe
January 24th, 2012, 07:07
I am still perplexed as to how Obe's 3.5E contains a processChatMood() method in his copy of scripts/manager_chat.lua when my up to date copy of 3.5E (as far as I can tell) doesn't.

Me too - it even doesn't have the "processChatMood" function referenced by Obe!

Oberoten
January 24th, 2012, 11:29
I have double-checked the state of the pak-file I unpacked...

Turns out this was a very old one. Even so, removing the code fully the mood command is still working the same way. So yes, I do believe this is entirely Moon's table to work with.

- Obe