Starfinder Playlist
Page 16 of 20 First ... 61415161718 ... Last
  1. #151
    i was thinking about creating an excel macro that would auto create the code for copy and pasting in to the mod files, if any one is interested in this let me know

  2. #152
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,270
    Blog Entries
    9
    Quote Originally Posted by Marquis_de_Taigeis View Post
    i was thinking about creating an excel macro that would auto create the code for copy and pasting in to the mod files, if any one is interested in this let me know
    I've been curious about this possibility and would love to see a working example. I poked at doing this years ago (but not for a calendars) but never figured it out.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  3. #153
    Grrrr!

    I had to reload CoreRPG.pak due to some corruption and it messed my calendar up! ARG!!!
    I had notes on every step except one, which to my shame, I forgot to log as it was the last thing I figured out, the weekday.

    I got everything, well almost everything back to normal, but for some reason only two of my days show up properly now like in this photo:

    Capture 1.PNG

    The other five days are showing up as such:

    Capture 3.PNG

    Here is my code from the mod file for the names of the weekdays:

    <lunardaycalc type="string">Twilight</lunardaycalc>
    <lunarweek>
    <day1 type="string">Resdor</day1>
    <day2 type="string">Sendor</day2>
    <day3 type="string">K'zyldor</day3>
    <day4 type="string">Mildor</day4>
    <day5 type="string">T'yandor</day5>
    <day6 type="string">Freldor</day6>
    <day7 type="string">Cel'myrdor</day7>
    </lunarweek>

    Note: Only days six and seven are showing up.

    Here is the function block from the manager_calendar.lau from the CoreRPG.pak file function that I customized:

    function getDateString(sEpoch, nYear, nMonth, nDay, bAddWeekDay, bShortOutput)
    local sDateFormat = DB.getValue("calendar.data.dateformat");
    if sDateFormat and aDateDisplay[sDateFormat] then
    return aDateDisplay[sDateFormat](sEpoch, nYear, nMonth, nDay, bAddWeekDay, bShortOutput);
    end

    local sMonth = CalendarManager.getMonthName(nMonth);
    local sDay = StringManager.ordinalize(nDay);

    local sOutput;
    if bShortOutput or (nYear == 0) then
    sOutput = sDay .. " " .. sMonth;

    --*************************************************--
    -- This is where I am testing my custom variable! --
    --*************************************************--

    else
    sOutput = " the "..sDay .. " day of " .. sMonth .. ", Year " .. nYear .. ", Era of " .. sEpoch;
    end

    if bAddWeekDay then
    local nWeekDay = CalendarManager.getLunarDay(nYear, nMonth, nDay);
    local sWeekDay = CalendarManager.getLunarDayName(nWeekDay);
    sOutput = sWeekDay .. ", " .. sOutput;
    end
    return sOutput;
    end


    Any help would be most appreciated!

    ChipDancer

  4. #154
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Please try with the ' in the names?
    Also please dont edit CoreRPG.pak - this file gets regularly updated - you should make your calendar in a mod/ext.

  5. #155
    I'll echo what Damned said. Never edit the corerpg.pak directly. it gets updated and will wipe out whatever you do. Instead, create an extension for your code and register it. In your code, you can set up your custom handlers by using the following functions.

    CalendarManager.registerLunarDayHandler() - used to override the default behavior of calculating what day of the week it is: used instead of getLunarDay()
    CalendarManager.registerMonthVarHandler() - used to override the default behavior of how many days in a month: used instead of getDaysInMonth()
    CalendarManager.registerDayDisplayHandler() - Used to override the default behavior of how to format the day value: used instead of getDayString()
    CalendarManager.registerDateDisplayHandler() - used to override the default behavior of how to format the date string: used instead of getDateString()
    Last edited by mattekure; August 23rd, 2022 at 02:09.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  6. #156

    Calendar still broken...

    Mattekure,

    I hate to bother you, but could you please take a look at my calendar mod for me? I simply cannot see what was changed and I'm betting it's something stupid, but I'm not seeing any code errors that are obvious. I would be most appreciated.



    ChipDancer
    Attached Files Attached Files

  7. #157
    Quote Originally Posted by ChipDancer View Post
    Mattekure,

    I hate to bother you, but could you please take a look at my calendar mod for me? I simply cannot see what was changed and I'm betting it's something stupid, but I'm not seeing any code errors that are obvious. I would be most appreciated.



    ChipDancer
    Question, does your calendar have leap years?
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  8. #158
    Quote Originally Posted by ChipDancer View Post
    Mattekure,

    I hate to bother you, but could you please take a look at my calendar mod for me? I simply cannot see what was changed and I'm betting it's something stupid, but I'm not seeing any code errors that are obvious. I would be most appreciated.



    ChipDancer
    The only issue I observed was in the extension itself, and likely stems from not understanding the purpose of the function. The LunarDayHandler that is registered is designed to return a number representing the day of the week, with 1 being the first day of the week. By default, the calendar starts at Year 0, Day 1 which is set on the first day of the week. In order to properly calculate what day of the week Thursday, May 5, 2082 falls on, we run through a series of calculations to sum up all the days from year 0 day 1, to the targeted date. See comments in code below

    Code:
    function calcTwilightLunarDay(nYear, nMonth, nDay)
    	local rYear = nYear * 362; -- Since we know that every year contains 362 days on this calendar, we can calculate the total number of days since year 0 by multiplying the current year by 362.  That gives us the number of days up to the first day of the current year.
    	local arrayMonthDays = {0,28,58,89,120,150,178,209,239,269,300,331,362};  -- you do not need the last entry 362 as that number will never be reached.  if you ever hit it, you would be restarting at a new year at 0.
            -- These next three lines are not needed.  
    	if (nMonth == 0)  then  
    	  nMonth = 1; --sets current month?
    	end
            -- We use the nMonth variable as an indices to the arrayMonthDays table to determine the number of days that have occurred up to the current month.  
    	local rMonthDays = arrayMonthDays[nMonth];
    -- The following line calculates the total number of days since Year 0 Day 1.  It has rYear and rMonthDays calculated above, which are the number of days up to the first of the current month, and nDay which is the day of the current month.  Adding them all together gives us the total number of days.  The week is exactly 7 days long, and starts on day 0.  So we use the modulus operator to get a number 0-N which represents the day of the week.  This does not have anything to do with spacing.
    	local rDay = (rYear + rMonthDays + nDay)%7; --not sure what this does yet, but looks to control vertial column spacing ???
    -- The following is incorrect because you are adding additional days beyond the week definition of 7.  with this code, The first day of the month would fall on the 7th day of the week, and so on.  So you end up with weird blank weeks.
    	return (rDay+6); --sets start day of the year
    end
    A simple fix that appears to work is as follows.

    Code:
    function calcTwilightLunarDay(nYear, nMonth, nDay)
    	local rYear = nYear * 362; -- Calculate the total number of days from Year 0 to First day of current year.
    	local arrayMonthDays = {0,28,58,89,120,150,178,209,239,269,300,331};  -- index to lookup number of days passed this year up to the current month, but not including the current month.
    	local rMonthDays = arrayMonthDays[nMonth]; -- lookup the number of days passed in the current year up to the current month.
    	local rDay = (rYear + rMonthDays + nDay)%7; -- Add up all the days from the years, months, and days of the current month to get the grand total number of days from Year 0 Day 1 to Current Year/Month/Day.  Use the % operator to divide the total number of days by the number of days in a week
    	if rDay == 0 then
    		rDay = 7   -- this ensures that we are working with day of the week values from 1-7 and not 0-6.  In this instance, a modulus of 0 means that it is the exact number of days in a week, so represents the last day of the week.    
    	end
    	return rDay; -- return the value 1-7 of which day of the week that the date specified in nYear/nMonth/nDay should fall on.
    end
    With this code, I get a calendar that looks like this.
    Last edited by mattekure; August 23rd, 2022 at 21:22.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  9. #159
    You sir rock!

    Thank you so very much for pointing that out as I had been focused on thinking it was the mod file! LOL!!!

    (^_^)

    'bows low'

    ChipDancer

  10. #160

    Anyone see or know of any weather mods/exts that could be used with the Calendar?

    I was rereading one of the posts in this thread and thought wouldn't it be interesting if there was a mod/ext for generating weather with your calendar. Anyone know if such exists?

    Thanks in advance,

    ChipDancer

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in