There are different types of timers I would like to have in a simple game to expand on for more complex games.
How would I go about doing the following;

1. When holding down the Spacebar start a "Power Meter" that ping-pongs from 0-10.
For each second 1 power is added up to 10, and on 10 subtracts back down to 0 this would repeat
until Spacebar is released ending the ping-pong timer with a value it ended with 0-10.
Example https://youtu.be/nLBc4nH1Gk4?t=24s

2. When a player steps on a platform with a box trigger collider on it have a door open and a Timer count down from 15 seconds. The player would then have 15 seconds to pass through the door before time runs out otherwise the player would have to step on the platform and start the timer once more.
Example https://youtu.be/vvZZwOEoaM4?t=46m40s

3. Displaying current real time in game.

I have an idea with using game variables and setting them with the event system, just wondering if anyone has a nice clean way of setting this all up.

Any help is greatly appreciated!

Thanks,
=]
Post edited by gamingislove on
Portfolio - My Website
Follow my project on Reddit - My Game DevLog
relentingVids - My YouTube Channel
Half Super Shop - My Shop
  • Is this an ORK or Makinom question? Makinom would be better suited for this.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I have both ORK and Makinom, but I try to do everything in ORK before importing any other asset.

    I haven't really done much in Makinom yet so maybe this could be a door opener with using the ORK/Makinom plugin.

    What would be the ideal way of using both if possible?
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
  • edited July 2016
    Well, you can do it in both, but Makinom is probably easier as it already has built-in stuff like timers.

    If you want to do it in ORK:

    1) You need 2 variables for that, a float variable for the ping-pong value and a bool variable to mark the direction you're currently going.
    E.g. if direction is false, add 1 to pingpong and check if it reached 10. If it reached 10, set direction to true.
    If direction is true, subtract 1 from pingpong and check if it reached 0 - set direction to false.
    In any case, add a 1 second wait where you want (i.e. either before or after the whole add/sub stuff).
    The event can be started either by a global event using the Key event type, or by an event interaction using the Key Press start type. Both would use an input key using the spacebar with either Hold or Any input handling.

    2) The general mechanic here is no problem in ORK - you'd set a game variable to the current game time + an offset of 15 seconds and check the variable against the current game time to see if the timer ran out.
    What's a bit tricky is displaying a running timer, this would be available in Makinom out of the box. See the Value > Timer nodes for that. Since timers just use float variables, you can display them in a HUD using text codes (e.g. with a custom format, like 00.0).

    3) In ORK/Makinom you can store the current real time into a float variable using the Time of Day (i.e. real time since midnight in seconds) and Date and Time (i.e. real date and time since 1.1.1970 in seconds) float value types.
    I'm not sure if displaying a float variable with custom format is able to display a date/time - you'd have to search for a C# float format string for that. If that's not possible, you can calculate the different parts of the time you want to display from the seconds you stored in a game variable.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Awesome response time as usual!
    I'll give Makinom a try with the ORK plugin and try these all out.

    Thanks GIL!!!
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
  • Yeah, I definitely recommend Makinom for most timer-related stuff as well; I converted all of my somewhat-hacky ORK timer events in Dead Gear to Makinom timers and it's just so much easier to manage.
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
Sign In or Register to comment.