PDA

View Full Version : From scratch ruleset question



sloejack
January 23rd, 2008, 12:44
So, I've been plodding through a from scratch ruleset write to try and better understand how FG2 rulesets work and exactly what are the required bits. The area I'm working on at the moment is the chat box which is pretty straight forward.

From the default d20 ruleset it appears that there's actually two chatbox areas in one. chatbox being the main text interface and then a ctbox or statchat area where dice are rolled in the chat box. Ok, I'm not ready to disect that part just yet so I left out any dice reading/reporting bits. However, for giggles I rolled a die in my generic chatbox and FG2 crashes. Not the end of the world, but a little confusing.

Since I didn't set up any droptype or anything else I'm a little confused as to why it is crashing. I can only assume that there is a hard coded requirement for dice to be able to roll and do something when they are rolled in the chat box. I'm just wondering if anyone else out there has worked on a similar effort (chat area rewrite) and determined what that requirement is?

Hamish
January 23rd, 2008, 20:35
I had a go at making the chat box a floating window like character sheets and maps, but also ran into a dice issue. Here's the topic. (https://www.fantasygrounds.com/forums/showthread.php?t=7526)
I had not noticed there are 2 separate definitions for the chatbox, so maybe I'll have a go at making the chat box floating again now that I have more info.

Hamish
January 23rd, 2008, 20:45
Hmmm, the names you mention are not directly related to die rolling in the chatbox. The ctbox is the name of the frame used as background for the chatbox. The statchat is the name of the 'chatbox' when creating local characters, so different functionality.

sloejack
January 24th, 2008, 00:17
I think there's a slight disconnect. You're right that statchat is the local chat box class while chat is the host and client one.

There are three frames that seem to be in play here, in an overlapping manner. chatbox, ctbox, and chatboxhilight.

chatbox and chatboxhighlight are both used in the chat window class (client,host)
ctbox frame and chatboxhilight are both used in the statchat class (local)

So I suppose their purposes are similar and I must have confused them somewhat when I was trying to parse the example xml files. In either case however the requirement that dice be able to roll in the chatwindow or FG crashes, yet there's no real indication of what controls if dice can roll there or not since manipulating the droptypes and associated types doesn't seem to affect the behavior (it crashes with no <droptype><type>dice</type></droptype> and with it). So I'm stumped a bit as to exactly what the requirement is and how to fulfill it without adding in all the bloat of the d20 example. I'll continue hacking at it but if anyone else trips to the solution sooner I'd appreciate some pointers.

Toadwart
January 24th, 2008, 02:44
Can't help with the disection other than that I have noticed that ANY errors which occur within the chat_chat.lua code (or code called from within there) will cause FG to crash on exit (also if you try to do a /reload)
Haven't raised it with SW because it only happens if I have an error in my code . . . not that I ever make do write buggy code ;)

sloejack
January 24th, 2008, 04:04
Can't help with the disection other than that I have noticed that ANY errors which occur within the chat_chat.lua code (or code called from within there) will cause FG to crash on exit (also if you try to do a /reload)
Haven't raised it with SW because it only happens if I have an error in my code . . . not that I ever make do write buggy code ;)
Heh, thanks Toadwart, though in this particular case there are no scripts called, it truely is a from scratch effort so I haven't written in anything fancy, just a raw text window that you can type into.

Hamish
January 24th, 2008, 08:56
I would really like an answer from the devs on this one. I suppose it's got to do with the animation of the rolling dice. With the modifications I made the dice showed up in the top left corner of the screen, wherever I put the chat box. They would stay there (spinning) for about a minute or more and then stop without showing a result, but with an entry on the chatbox.