Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[FEATURE/FIX] Dynamic Timers
#1
This patch intends to add a system to easily allow developers to create dynamic proc calls that need to happen after a given amount of time, the main usecase for this is to get rid of a lot of awful and bad code that heavily relies on spawn() to do it's work.

This patch does NOT refactor the entire codebase to use this new system, but I'm more than willing to provide a patch that refactors all current sleeps into proper call_after calls.

A simple example can be found below, and timer.dm contains basic documentation.



Code:
            target.bioHolder.AddEffect("bad_eyesight")
            spawn(450)
                if (target) target.bioHolder.RemoveEffect("bad_eyesight")

this could easily be replaced with

Code:
            target.bioHolder.AddEffect("bad_eyesight")
            call_after(target.bioHolder, "RemoveEffect", 450, "bad_eyesight")

CODEhttps://github.com/DoomStation/doom/comp...formance-3
Reply
#2
well the link is broken so welp anyways
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)