• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Terrain Clock demo

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
  • Like
Reactions: Bribe
This is a demo map that uses two models (digit.mdx and colon.mdx and some textures (all in in the terrain_clock.w3x map)) to draw a count down and "count up?" clocks on the terrain of the map. In the map script (war3map.j) there are some functions that use these two models to actually implement the clocks.

Edit: As suggested, this was moved from "Map & Resources"/Models section to this section.
Contents

Terrain Clock demo (Map)

Reviews
Wrda
function terrainClockStartTicking takes integer tc, string onTick returns nothing onTick doesn't really describe what kind of string one should use, perhaps "onTickFuncName" is better. function tcOnTickDown takes nothing returns nothing local...

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,890
function terrainClockStartTicking takes integer tc, string onTick returns nothing onTick doesn't really describe what kind of string one should use, perhaps "onTickFuncName" is better.

JASS:
function tcOnTickDown takes nothing returns nothing
  local integer tc = tcGetTimerData(GetExpiredTimer())

  if 0 != tcClockS[tc] then
    set tcClockS[tc] = tcClockS[tc] - 1
    call terrainClockUpdateTime(tc)
    return
  endif

  if 0 != tcClockM[tc] then
    set tcClockM[tc] = tcClockM[tc] - 1
    set tcClockS[tc] = 59
    call terrainClockUpdateTime(tc)
    return
  endif

  if 0 != tcClockH[tc] then
    set tcClockH[tc] = tcClockH[tc] - 1
    set tcClockM[tc] = 59
    set tcClockS[tc] = 59
    call terrainClockUpdateTime(tc)
    return
  endif

  set terrainClockOnExpireTc = tc
  call ExecuteFunc(tcOnExpire[tc])
  call TimerStart(tcTimer[tc], 0.0, false, null)
endfunction
I don't understand what's the goal with call TimerStart(tcTimer[tc], 0.0, false, null) Is it to "pause" the timer? Just use PauseTimer then.
The timers are starting as 22:22:22 even though one of them should be counting from 00:00:00 upwards. Probably wrong animation index.

This should be reworked as JASS, or even vJASS since this code resembles that, which should be a library.
When working with timers and passing data, use TimerUtilsEx instead.
Also needs a clear API for the user and description, both in the library and in this resource.

Looks useful for a nuclear strike type of thing or boss related stuff.
 
Top