Skip to content

Request - Module Event hooks - OnDusk and OnDawn

I think this would be an easy addition that would be so helpful for persistent world builders. I made a pseudo OnDusk/OnDawn event, in my lycans script, which computes the dusk/dawn and then sets a delay to fire the event. It would be much easier to have a module hook for this instead. I know a heartbeat could be used to do this, but ..well you know...

It would add a lot of possibilities...roosters crowing at dawn, town criers, werewolves compulsively changing, vampires taking damage in the morning light...etc..

Comments

  • sandronejmsandronejm Member Posts: 70
    It's already possible using instead OnHeartBeat event, so it is ok.
  • ZwerkulesZwerkules Member Posts: 112
    It's likely that everybody who wants something like that has used a workaround including heartbeats, but you never know how much heartbeats might affect performance, so OnDusk and OnDawn events would be a nice addition. Good idea, Diavlen!
  • FreshLemonBunFreshLemonBun Member Posts: 909
    Likely OnDusk and OnDawn only fire once per day meaning that they miss anything between, in which case it's still done by heartbeat or OnDusk and OnDown are heartbeats in which case it can be done by heartbeat.
  • Dark_AnsemDark_Ansem Member Posts: 992

    It's already possible using instead OnHeartBeat event, so it is ok.

    But onHeartbeat means that you lock more important stuff out.
  • SherincallSherincall Member Posts: 387

    It's already possible using instead OnHeartBeat event, so it is ok.

    But onHeartbeat means that you lock more important stuff out.
    Could you elaborate on that? You can do more than one thing in the event.
  • Dark_AnsemDark_Ansem Member Posts: 992

    It's already possible using instead OnHeartBeat event, so it is ok.

    But onHeartbeat means that you lock more important stuff out.
    Could you elaborate on that? You can do more than one thing in the event.
    You can but running on heartbeat is performance-affecting. Wouldn't it check every 6 seconds "is it dawn"?
  • SherincallSherincall Member Posts: 387
    A check for dawn costs on the order of 100ns. That is 0.0000001 seconds every 6 seconds. I really don't think that is significant enough to warrant worry about optimizations.
  • Dark_AnsemDark_Ansem Member Posts: 992
    Not optimisation: specification.
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,753
  • FreshLemonBunFreshLemonBun Member Posts: 909
    I don't see how multiple events and multiple script calls is better performance than a single event and single script call.
Sign In or Register to comment.