PDA

View Full Version : 4e Calendar Conversion to Older Rules



S Ferguson
February 28th, 2013, 23:59
Has anyone in the community ported the 4e calendars to an older system? I'm in the process of conversion, and have it to the point where the window shows up and the string appears. Then I get a "button_add, a global variable is nil" error. In the XML code, however, button_add is defined both globally and explicitly in the XML code. Has anyone run into a similar error? Any help would be appeciated. I'm just trying to add this as an extension for older rulesets that aren't blessed with this functionally.

Any help would be greatly appreciated.

Ikael
March 1st, 2013, 00:28
Conversion log in SWFI extension (in the extension.xml file) states that at least following this should be extracted from 4E ruleset:


<script name="CalendarManager" file="scripts/manager_calendar.lua" />
<includefile source="utility_calendar.xml" />
<includefile source="utility_calendar_log.xml" />


I bet that you lack the CalendarManager global script. I can also see that you should be adding all loggedin players to have watcher permission for calendar node. You can do this in onLogin(username, bActivated) function, wherever it's used (ie. DB.addHolder("calendar", username)). I would recommend that you to also download any 4E calendar or my SW sample calendars to have some real content.

S Ferguson
March 1st, 2013, 00:33
Actually, all those files are there. I made sure nothing was left out (actually it's your code I'm modifying). I'll check oveer the code again, but I'm still at an impasse without that button functionality. Thanks for the insight though.

Zeus
March 1st, 2013, 20:16
I dropped you a PM after investigating and locating the problem. Basically the older rulesets do not have a template call button_text which button_listadd is defined from.

You need to either copy this template to the base rulesets in question or (probably easier) copy them to the extension. It should then work.

I tested it with SR4 and BRP, both work with no error.

Ikael
March 2nd, 2013, 08:29
I dropped you a PM after investigating and locating the problem. Basically the older rulesets do not have a template call button_text which button_listadd is defined from.


Indeed! S Ferguson, if you're looking pieces of these template definitions from SWFI they are in new_templates.xml file. I haven't tagged that file with changes because templates are used in so many places itself so it's considered to be place where you seek for new templates. Also remember to get these template's scripts with you