Open doonze opened 2 months ago
Interesting idea. I will have a look at the simple calender api when i have time to see what can be done.
In Item Pile you mark the "open hours". Say 9am to 6pm (it's in military time tho). At 6pm game time the vendor closes, at 9am it opens.
I suspect he just does a check. So for your mod it would be "is right now between 9am and 6pm? Yes, door is unlocked. No, door is locked." That part is pretty simple I'd think. What I didn't know is what triggers his check. I would think constant checks would eat cpu cycles. Maybe simple calendar sends out an API broadcast that time has changed, and you just listen?
I guess I could look into it. Python and .net are more my bag, but API is API. I have a personal distaste for C derived languages, but I have done Java and PHP when I had to. I can read it so I'll see what I can find.
I have a personal distaste for C derived languages
Same here, sadly they are too fast to ignore
Yeah, there probably (hopefully) is some hook call from simple calendar when hours tick over or something similar, so using that should probably work. When i have time i will take a look at how item piles integrates this.
So, there is a pretty simple hook you can just listen to:
https://simplecalendar.info/docs/developing-with-sc/api/namespaces/SimpleCalendar.Hooks
For me, I'd listen to the READY hook, and trigger an API call to check the time. Then check all doors. That covers door state on server start/log in. Don't know foundry well enough yet to know if you have to also check on scene load. Then I'd listen to the DateTimeChange hook, and that gives you all the info you need to run checks. And all you have to do is listen.
Of course if you want to do it like Item Piles does, you have to be able to set by days of the week as well as incorporate holidays. So, there is some more pulling involved there. While it's more advanced, I have my vendors close on holidays and weekends. So personally I'd like my doors to follow the same schedule. I'm not likely in the majority, as most tables I've played at vendors work 7 days a week. And overall holidays are not a thing.
I was surprised I was the first person to suggest this. Personally, I was kind of blown away someone wasn't already doing it. Maybe most DM's don't run large maps with dozens of doors. Or track time/days/dates in their world. But with a vtt I think this kind of thing is kind of really needed. I run a lot of large maps (90x90) with 100's of windows and doors, one of my current maps also has 5 floors (using levels). So many doors!!! Dozens of vendors, etc. The more I can automate the better!
Anyway, I know this is just a feature request, and you likely have lots more important things with your great mod you need to work on. Just thought I'd do a bit of the leg work for ya if you ever get time to come back around to it. Love the MOD by the way! Still learning it, but dang man, pretty amazing what you've done here. Great job and many Kudos! I like Perceptive too!
I've looked around but not finding anything, where do I buy you a coffee?
Thank you, much appreciated. That looks easy enough to implement, might have to do some work on rideable and perceptive first though. Glad to hear, that you enjoy the modules.
I currently do not have any donation links, thanks for the offer though.
Also, that map sounds crazy. Must have been quite a bit of work setting that up. Must also be quite satisfying to see the players interact with it.
To add the Item Pile merchants ability to have vendors "open" or "closed" and to even vanish when closed, it would be nice to have time based locking and unlocking for their shop doors. I can see other uses as well, mainly area's that would naturally be off limits at certain times. Houses at night. Parts of temples or castles, etc. Could see it being useful and no one seems to be doing it. Item Pile is the closest.
Not a big deal if you have a small map with one or two vendors. But can be a big deal in a marketplace map where there are 20 doors or more you need to unlock/lock manually.
Just a thought.