PDA

View Full Version : Ingame Gregorian Calendar



Maspalio
October 28th, 2013, 14:28
Hi all,

I'm new to FG2 and i try to bring back the Calendar features in the World of Darkness Ruleset.
Actually, the calendar.mod is active in the module window and i can activate it (by opening the small book icon).
But i don't get the calendar button in the upper part of the interface, so i just can't open the calendar window...

I tried to copy the calendar utilities and calendars scripts files (5+3 files) from the core Ruleset into my ruleset. Nothing happens.

Anyone could tell me how to get the calendar module to be active, same as in the 3.5Ed. ruleset ?

Thanks

Moon Wizard
October 28th, 2013, 18:36
The calendar feature is only supported in the 3.5E and 4E rulesets at this point. (It may also be available in Savage Worlds and Rolemaster as well, but I would need to check.)

We've been slowly incorporating the calendar feature into all of the SmiteWorks provided rulesets, and it will be part of our generic base ruleset which can be built on top of in the next version (v3.0).

The older calendar extension may work with the World of Darkness ruleset, but I haven't tried it. It can be found in this thread (https://www.fantasygrounds.com/forums/showthread.php?9942-Date-time-extension)

Both the NWoD ruleset and the calendar extension are community projects, and supported by the community.

Regards,
JPG

Trenloe
October 28th, 2013, 18:58
But i don't get the calendar button in the upper part of the interface, so i just can't open the calendar window...

I tried to copy the calendar utilities and calendars scripts files (5+3 files) from the core Ruleset into my ruleset. Nothing happens.

Anyone could tell me how to get the calendar module to be active, same as in the 3.5Ed. ruleset ?
You need some LUA code in the ruleset to register the button as a "Stack Shortcut". Look for a script called something like desktop.lua and there will be an onInit function in there that has a bunch of registerDockShortcut commands (probably DesktopManager.registerDockShortcut). You will need to add a new line that adds a button for the calendar with the relevant graphic, tooltip, class and record entries.

The createStackShortcut code takes the following parameters as input:

createStackShortcut(iconNormal, iconPressed, tooltipText, className, recordName)

This is how the 3.5e ruleset registers the calendar button:

DesktopManager.registerStackShortcut("button_calendar", "button_calendar_down", "Calendar", "calendar", "calendar");

You will need to make sure that the first 2 parameters (the graphic recourse reference for the button icon when not pressed and when pressed) are present in the ruleset.

Hope this helps you get a little further along... There may be more coding you need to do to make the calendar function work completely in the ruleset.

JohnD
October 28th, 2013, 20:07
Calendar is in C&C and RMC as well.

Maspalio
October 29th, 2013, 01:07
Thanks for your help. It still doesn't work properly but i'll try again.

Maspalio
November 2nd, 2013, 23:41
I almost got it, but it's still buggy. The button appears henceforth and triggers the calendar, but i get a .lua error :
Ruleset Error: No vertical anchor defined for 'sub_main'
Ruleset Error: No vertical anchor defined for 'sub_select'
Ruleset Error: No vertical anchor defined for 'sub_empty'
Script Error: [string "utility/scripts/calendar_top.lua"]:20: attempt to call field 'getString' (a nil value)

Trenloe
November 3rd, 2013, 01:56
I almost got it, but it's still buggy. The button appears henceforth and triggers the calendar, but i get a .lua error :
Ruleset Error: No vertical anchor defined for 'sub_main'
Ruleset Error: No vertical anchor defined for 'sub_select'
Ruleset Error: No vertical anchor defined for 'sub_empty'
Script Error: [string "utility/scripts/calendar_top.lua"]:20: attempt to call field 'getString' (a nil value)
Sounds like some of the XML templates the calendar is using are not in your ruleset - or they definition of them is different to the 3.5e definition.

Sorry, but this is a case of going through the XML you have migrated from 3.5e, seeing which XML template classes they use and then making sure that those classes have all of the definitions for other classes. It can get a bit difficult as templates can use other templates...

For example, the "sub_main" error - this is defined in calendar.xml:

<subwindow_details name="sub_main">
<class>calendar_main</class>
</subwindow_details>

Which uses the class "calendar_main" which has a bunch of controls - you'd have to try to identify which control is actually causing the error. It is complaining that a control has an anchor which does not have a vertical anchor. There is some info about anchor here: https://www.fantasygrounds.com/refdoc/windowcontrol.xcp