Thread: Rest function
-
September 4th, 2018, 14:25 #1
Rest function
I know just enough about programming to be dangerous. So I'm considering trying to create my first extension.
For my first extension, I want something simple. I want to make a Story note pop up when the Long Rest function is used (preferably making everyone see it, not just me). Just a reminder for us to adjust the date in the calendar, use rations, and other house-keeping chores.
Is this possible? If so, any experienced extension developers willing to point me in the right direction before I begin?
Thanks!
PS Another option is to create a function that forces the Story pop-up and then runs the Long Rest function, but I'd prefer to tie into the Long Rest function is possible. Mostly as a learning experience.Fantasy Grounds Unity Lives! Good job, Smiteworks!
-
September 4th, 2018, 15:14 #2
At a guess Three of Swords I would look at the Message of the Day extension by Trenloe
-
September 4th, 2018, 19:36 #3
That's the extension that gave me the idea. I figured I could use it as a template.
Just hoping someone knows where/how to tie into the Long Rest function.Fantasy Grounds Unity Lives! Good job, Smiteworks!
-
September 4th, 2018, 20:36 #4
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
Call CombatManager.setCustomCombatReset() with your custom function in your onInit() function, and that function should get called whenever there is a rest.
-
September 4th, 2018, 20:55 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
The function that Andraax mentioned is called whenever the initiative is reset, so probably not exactly what you are looking for.
You'd have to override the rest function for the ruleset. Probably having an extension with a global script that does something like this:
Code:local fSavedRestFunction = null; function onInit() fSavedRestFunction = CombatManager2.rest; CombatManager2.rest = rest; end function rest(bLong) fSavedRestFunction(bLong); -- New pop-up message code end
Regards,
JPG
-
September 6th, 2018, 03:53 #6
Thanks for the advice! I appreciate it. Just realized I'm out of town this weekend. But when i get back, I will take a stab at it and come back w/ questions.
Fantasy Grounds Unity Lives! Good job, Smiteworks!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks