PDA

View Full Version : Fantasy backGrounds



Bidmaron
January 29th, 2011, 16:41
Working hard on it, but I have a question. The background is that I am putting in a real clock time feature (in the future, I'd like to support a game time feature where you can dynamically go in and say that game time is running at some factor of real time [e.g. two minutes of real time = 1 minute of game time] and to set 'alarms' that would go off for reminders or what-have-you. I'd also like to support callbacks to allow module/extension/ruleset programmers to use time-based events (as someone requested, e.g., to auto-advance the turn indicator after x number of seconds if the player doesn't do his turn). So, my question is, is there a way in lua to call a function within my backGrounds extension to register a callback, so that when the time event fires (getting this to work has been fun [hah!] and it is a kluge, but it works) I can call whoever has registered.

Zuess, I'd like to borrow some of your table code at some point to support the fantasy game time setup so you could specify the time units for your campaign, as well as the ratio of real-world minutes to a corresponding game-time unit, similar to how you've done your calendar setup. I am envisioning a sundial-like gui interface for game time (with perhaps a clock skin for a modern game) to mark major time units [e.g. hours] and then an hourglass-like control for minor time units [e.g. seconds]. The gm and players could drop one or more 'alarm tokens' on these controls to set up alerts. Anyway, that's my vision/concept at this point.

Bidmaron
January 29th, 2011, 16:53
On a somewhat-related note, for those of you who have implemented a messaging system through the chatbox, can you point me to the relevant ruleset files where this exists so I can steal it (with attribution) and avoid re-inventing the wheel. My event mechanism only works on the host invocation, so I have to handle client events through messaging (that is, I can tell Fantasy backGrounds whatever I want in even the local version, but the only way I can get info back to FG2 works only on the host, so client events [local is out of luck] have to get return data (such as time-based event firing) through the host and chat box messaging.

By the way, Spudman, I'll see if I can implement a programmatic copy-to-clipboard through Fantasy backGrounds for you. I presume it is text you want put into the clipboard, right? I can't think of a reason why I can't provide a code module function that you can pass text to and then Fantasy backGrounds can put the text into the system clipboard. I presume you want the user to then be able to paste whatever you've put in the clipboard to some location, right?

Bidmaron
January 29th, 2011, 17:03
Another one:
I only use d20_jpg, so I am not familiar with other rulesets. Does anyone know where someone has implemented a popup menu. What I am wanting to do to save panel real-estate on the right-hand panel (whatever you call that) is have it where when you click on my extension graphic, it pulls up a menu to ask you what you want to do rather than adding several more graphics to the right-hand panel. I could implement it with a window that dismisses itself, but I thought such a thing might already exist.

Zeus
January 29th, 2011, 17:29
Time automation has the making for all sorts of issues, it may end up being tricker than you think. I opted for calendar and clock controls but with manual user control for forwarding time, this way the DM can pace as appropriate.

Having said that.

i) Feel free to re-use my Tables code and adapt as you need
ii) You could check out chatmanager.lua in the 4E ruleset for an example of a framework for handling
special messages through the chat system e.g. sendSpecialMessage(), handleSpecialMessage(), registerSpecialMessage(), processSpecialMessage() etc. etc. and the onMessageReceived() method in 4E's chat_chat.lua to handle the detection and calling to processSpecialMessage().
III)Whilst not quite a pop-up menu, the 4E Partysheet Skills and Main tabs have a pop-up selection list (scrollable) that could be used a template to get you going. At the moment selecting an entry populates a field but you could adapt it to do pretty much anything you like.

Bidmaron
January 29th, 2011, 18:11
As for time, I intend for manual control to be the default, but there may be times where the gm wants to (usually for the sake of enhancing suspense or fear) tie game time to real time ("Okay, the fissure is closing and it looks like the party has five minutes to decide how to proceed or deal with being trapped in the underworld" and the game timer commences to tick down....)