Control the timer ticking

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
Fedaykin
Posts: 6
Joined: 28 Aug 2012, 08:23

Control the timer ticking

Post by Fedaykin »

Hi,

I'm trying to achieve the same effect as in Elite : when the timer first approaches 0 it doesn't tick.

But if my EndTime is in 45 seconds, it starts ticking at 15 seconds left. Is there anyway to mute this ticking ? Or choose from which seconds remaining it starts ticking ? Or to have an EndTime different from the time displayed ?

Thanks
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: Control the timer ticking

Post by Eole »

You can use two different timers in ManiaScript

Code: Select all

// Countdown turn red under 15 seconds
// For all players
EndTime = 60000;

// For one specific player
Player.EndTime = 60000;

// Countdown turn green under 5 seconds
// For all players
UIManager.UIAll.CountdownEndTime = 60000;

// For one specific player
declare UI <=> UIManager.GetUI(Player);
if (UI != Null) UI.CountdownEndTime = 60000;
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
Fedaykin
Posts: 6
Joined: 28 Aug 2012, 08:23

Re: Control the timer ticking

Post by Fedaykin »

Indeed I can set the EndTime to 60000. But in this case players won't see the timer approaching 0.

The behaviour I'm trying to achieve is the following, exactly the same as in Elite :

45 => 0 (with no ticking sound) then 15 => 0 (with ticking)

Edit : My bad I never paid attention that the 45 => 0 timer was the one turning green :)
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: Control the timer ticking

Post by Eole »

The 60000 value was just here as an example, I didn't thought it would be confusing with Elite. ^^'

And indeed, in Elite the first timer use CountdownEndTime with a value of 45000, then the second timer use EndTime with a value of 15000 milliseconds.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Control the timer ticking

Post by steeffeen »

i know it's a quite old thread but my question fits to the topic

when using UI.CountdownEndTime instead of EndTime the end of the countdown isn't announced really well
with EndTime the tick sound will become much louder so that everybody notices the end of the countdown but with CountdownEndTime the end is most likely to be not noticed

it would be great if CountdownEndTime would announce the end of the countdown just like EndTime
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    Eole
    Nadeo
    Nadeo
    Posts: 1265
    Joined: 26 Apr 2011, 21:08

    Re: Control the timer ticking

    Post by Eole »

    The two timers don't serve the same purpose. One is more for announcing the end of something and must be heard. The other is used for a transition to another phase, and should be less intrusive. That's why they sound so different. But maybe the volume of CountdownEndTime can be tweak a little.
    Contribute to the ManiaPlanet documentation on GitHub
    A question about ManiaScript? Ask it here!
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: Control the timer ticking

    Post by steeffeen »

    Thanks for your response.
    I totally get your point but my problem is that the players won't recognize that the phase is about to change because there is no proper announcement =/ EndTime can't be used for that as the players get invincible at EndTime >= Now and i need that the timer counts up after reaching its end, that would need StartTime to be set to Now but then the players are invincible again..
    in Elite it's no problem that the end isn't announced that much as the round only lasts 45 seconds and you kind of feel when it's about to end, but in other modes the round lasts usually longer, like 4 minutes in mine

    do you have any suggestions for a workaround? i tried to announce the end of the countdown by myself but the usual tick sounds can't be accessed and there is no proper sound available if you ask me, maybe if EUISound::Warning would have more variants..
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      Eole
      Nadeo
      Nadeo
      Posts: 1265
      Joined: 26 Apr 2011, 21:08

      Re: Control the timer ticking

      Post by Eole »

      You can try to combine several feedbacks. If the players don't pay attention to the timer, you can display a BigMessage 15 seconds before the end of the timer for a few seconds. Something like: "Phase change in 15 seconds" with UI.BigMessageSound = CUIConfig::EUISound::Warning or something like that. Then the players will pay attention to the timer and see it's close to 0.
      Contribute to the ManiaPlanet documentation on GitHub
      A question about ManiaScript? Ask it here!
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Control the timer ticking

      Post by steeffeen »

      I will try something like that, thanks for the input! :thx:
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        Post Reply

        Return to “ManiaScript”

        Who is online

        Users browsing this forum: No registered users and 2 guests