Fantasy Grounds Classic

Fantasy Grounds Classic

Torg Smith 14. mai 2014 kl. 12.26
Creating Custom Calendars
I am messing around with the demo until the Ultimate license is on Steam.

I am trying to create a custom calendar for Dark Sun as I want something different than what is in there right now. I want three periods of 125 days that have and the lunar week at 15 days.

I have read the following threads.
http://www.fantasygrounds.com/forums/showthread.php?17059-Creating-new-Calendar-2-9-1&s=f8fad466fc7aa6e9fde8f36c7892ae66
http://www.fantasygrounds.com/forums/showthread.php?20274-Calendar-modules-documentation&s=f8fad466fc7aa6e9fde8f36c7892ae66

I have updated the Calendar.mod files db.xml with this.
<darksunCustom> <name type="string">Custom Calendar of Tyr</name> <setting type="string">Dark Sun</setting> <lunarweek> <day01 type="string"> </day01> <day02 type="string"> </day02> <day03 type="string"> </day03> <day04 type="string"> </day04> <day05 type="string"> </day05> <day06 type="string"> </day06> <day07 type="string"> </day07> <day08 type="string"> </day08> <day09 type="string"> </day09> <day10 type="string"> </day10> <day11 type="string"> </day11> <day12 type="string"> </day12> <day13 type="string"> </day13> <day14 type="string"> </day14> <day15 type="string"> </day15> </lunarweek> <periods> <period1> <days type="number">125</days> <name type="string">High Sun</name> </period1> <period2> <days type="number">125</days> <name type="string">Sun Descending</name> </period2> <period3> <days type="number">125</days> <name type="string">Sun Ascending</name> </period3> </periods> </darksunCustom>

I can’t find the manager_calendar.lua file to modify the getDateString and create custom functions for lunardaycalc and periodvarcalc.

I would also like to include the King’s Year name if possible. I would not have a problem putting the combined names in advance or if it is possible to do it in the lua function.

I will probably create a separate custom module after the purchase.
Sist redigert av Torg Smith; 14. mai 2014 kl. 12.27
< >
Viser 110 av 10 kommentarer
Trenloe 14. mai 2014 kl. 12.49 
manager_calendar.lua is in the CoreRPG ruleset.

You can modify that script, but you will have to be careful to make sure it gets updated if/when the CoreRPG file gets updated in future so that you are keeping compatibility.

The best way to do this is to write an extension so that just the files you modify are used (and you can enable/disable the modification on a campaign by campaign basis) and the only update the extension if manage_calendar.lua changes in future releases of the CoreRPG ruleset.

You can find some example extensions here: http://www.fantasygrounds.com/forums/showthread.php?20320-FG-3-0-CoreRPG-Extensions
Sist redigert av Trenloe; 14. mai 2014 kl. 12.50
Torg Smith 14. mai 2014 kl. 15.49 
Thank you for the location and that link.

I am getting this error when calling strlen().

Script Error: [string "scripts/manager_calendar.lua"]:304: attempt to call global 'strlen' (a nil value)

Here is my syntax at line 304.

local nDayLen = strlen("TestString");

I am positive it is not a nil value. Is there a chance that it is saying strlen is a nil value? If so, is there a preferred method to get the length of a string?
Trenloe 14. mai 2014 kl. 15.56 
FG uses LUA 5.1, more info here: http://www.fantasygrounds.com/modguide/scripting.xcp

So, you need to use string.len("TestString");

http://www.lua.org/manual/5.1/manual.html#pdf-string.len
Torg Smith 14. mai 2014 kl. 16.04 
Thank you. I just located the manager_string.lua

Thanks for the scripting link. I had just the refdoc and main wiki links before.
Torg Smith 14. mai 2014 kl. 19.10 
Alright, I have the date working as far as the full date string and short date string go. I have some graphical issues to deal with tomorrow.

Here is a sample of the long date.
The date is the 12th day past the High Sun in the year of Desert’s Reverence in the 194th King’s Age.

The short date shows as.
The 12th after High Sun

I am using the year for a value between 1 and 77 to get the name of the year in the King's Age and using the Epoch to represent the current King's Age.

I just need to pretty up the periods to make it look good.

I think I get how to make my custom files and have them call the functions in the CoreRPG that I believe loads by default even if you load another ruleset.
Trenloe 14. mai 2014 kl. 21.24 
Opprinnelig skrevet av Torg Smith:
I think I get how to make my custom files and have them call the functions in the CoreRPG that I believe loads by default even if you load another ruleset.
Only rulesets that are built on CoreRPG do this. Look in the ruleset base.xml file, if it says "<importruleset source="CoreRPG" />" then it will build on top of CoreRPG. Some, but not all, use CoreRPG.
damned 14. mai 2014 kl. 21.32 
Good stuff Torg Smith :)
Hope you are enjoying some of the cool features.
Torg Smith 15. mai 2014 kl. 5.28 
Opprinnelig skrevet av Trenloe:
Opprinnelig skrevet av Torg Smith:
I think I get how to make my custom files and have them call the functions in the CoreRPG that I believe loads by default even if you load another ruleset.
Only rulesets that are built on CoreRPG do this. Look in the ruleset base.xml file, if it says "<importruleset source="CoreRPG" />" then it will build on top of CoreRPG. Some, but not all, use CoreRPG.

I am using the 3.5 ruleset and I verified it does include CoreRPG.


Opprinnelig skrevet av damned:
Good stuff Torg Smith :)
Hope you are enjoying some of the cool features.

Well, I am using the demo right now. Since I can't save, I am just learning how to mod it for my campaign. I plan on getting the Ultimate licence when they get that on Steam. I have watched a bunch of videos on it already.
DiLLiGaF 15. mai 2014 kl. 6.23 
I'm confused. Can you not upgrade the steam version to ultimate through their website with the key you get through steam. . . ?
damned 15. mai 2014 kl. 6.48 
yes you can. but many people will prefer to do it all on steam and keep it simple.
< >
Viser 110 av 10 kommentarer
Per side: 1530 50

Dato lagt ut: 14. mai 2014 kl. 12.26
Innlegg: 10