Essentials Series/Timers

From Heavy Iron Modding
Essentials Series
  1. Introduction
  2. Industrial Park basics
  3. Editing Assets
  4. Templates
  5. Links
  6. Dispatchers
  7. Tikis and Enemies

This page is part of the Essential Series modding tutorials. In this guide, you will learn how to use TIMR assets. Timers are one of the simplest asset types.

Using a Timer

Industrial Park has a Timer template. When placing the template, you can choose the amount of time in seconds you want the timer to run for (it can be any real number, such as 5.75). These are the events used by a timer:

  • Run: send this to a timer to make it start running.
  • Expired: after receiving Run, the timer will run for the amount of seconds it was set to, then will receive Expired.
  • Reset: after the timer has expired, you must send Reset to it to be able to use it again! A common setup is having an Expired => Reset in the timer with the timer itself as the target, so the timer will always be reset after expiring. Sending Run to an expired timer without resetting will cause it to expire immediately. You can also use this to reset a timer before it has finished running.
  • Stop: if you send Stop to a running timer, it will stop running, essentially pausing the timer. Sending Run again without sending Reset will cause it to continue from where it stopped.

You can also use the RandomRange property in timers (not present in Scooby) to set a random value for the timer. If a timer's time is 30 and the RandomRange is 5, for example, the timer will actually be reset to a random value between 25 and 35.

Timer Textbox

Timers are normally silent and invisible, but you can use a timer textbox to display the timer to the player. This is used in various points of the original game.

MNU5 Textbox Setup

There is a global timer textbox called TIMER_TEXTBOX in MNU5.HIP, so make sure to keep this HIP archive and your level open during setup (Note: You do not need to edit MNU5.HIP during this setup).

Industrial Park has a Text template. After placing the template, use the following format to have it compatible with a textbox:

{timer:YOUR_TIMER_NAME}

Now that your text is ready, you'll need to make the textbox visible.

Textbox Events

  • Visible: send this to TIMER_TEXTBOX to make it appear. By default, the textbox will be blank.
    • To display a specific text, type the name of your text asset in Argument 1 of the Event Link while the 'HEX' checkbox is filled. This overwrites the textbox's DefaultTextID to display your desired text.
  • Invisible: send this to TIMER_TEXTBOX to make it disappear. It's recommended to do this when the timer is sent Expired or Stop.

Sounds

Now that you have your textbox set up, you are free to assign sounds to it. The following SFXs can be found in SM02 and are a decent set of assets to copy to your level. Make sure to copy their respective sounds as well.

  • RACE_TIMER_APPEAR_SFX: Play when the textbox is Visible.
  • RACE_TIMER_TICKING_SFX: Play when the timer is Run. (Send Stop to end looping).
  • RACE_FAIL_SFX: Play when the timer has Expired.
  • TRIUMPH_SFX: Play when the task has been cleared and the timer is sent Stop.