Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Is possible make a Count"up" Timer ?
[SOLVED] Is possible make a Count"up" Timer ?
Jun 26 2022, 7:20 am
By: Tonblader  

Jun 26 2022, 7:20 am Tonblader Post #1



I think that some kind of hyper trigger could help me with this, but I don't know the exact time that I should use to make the clock go up and not down.

Post has been edited 1 time(s), last time on Jun 28 2022, 2:33 am by Tonblader. Reason: Solved




Jun 26 2022, 7:26 am Oh_Man Post #2

Find Me On Discord (Brood War UMS Community & Staredit Network)

Use death counters.




Jun 26 2022, 7:50 am Tonblader Post #3



Quote from Oh_Man
Use death counters.

mmmmm the thing is that I need when the enemy has 1 remaining building (which is invincible) start a count up and detect different times depending on the amount of opponents in the game.

Now, you will say why I don't use the countdown, I want the time limit not to be predictable by the users (it would be predictable if the clock ticked backwards because the users would know the estimated time).




Jun 26 2022, 9:21 am Oh_Man Post #4

Find Me On Discord (Brood War UMS Community & Staredit Network)

Just use randomise switches to increase the death counter by variable amounts so the time isn't predictable.




Jun 26 2022, 11:37 am NudeRaider Post #5

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Do the actual timing with death counters. Dedicate a unit that is not possible to be killed in game. Unplaceable things like Cantina work best. And manipulate its death counts via triggers.
Timing 1 second: Count to x, adding 1 to the death count every trigger loop when your condition kicked in.

With hyper triggers
real-time: x = 12
in-game time: x = 8

Without hyper triggers
real-time: x ~ 1.5
in-game time: x ~ 1

I don't think you want that, because you want it to be unpredictable. But just in case: If you want to visualize it via the countdown timer or text messages it gets a little complicated. You basically need to apply binary math to do it somewhat efficiently. Just tell us if you want that, and we can show you a system that does it.




Jun 26 2022, 4:09 pm Tonblader Post #6



Quote from NudeRaider
Do the actual timing with death counters. Dedicate a unit that is not possible to be killed in game. Unplaceable things like Cantina work best. And manipulate its death counts via triggers.
Timing 1 second: Count to x, adding 1 to the death count every trigger loop when your condition kicked in.

With hyper triggers
real-time: x = 12
in-game time: x = 8

Without hyper triggers
real-time: x ~ 1.5
in-game time: x ~ 1

I don't think you want that, because you want it to be unpredictable. But just in case: If you want to visualize it via the countdown timer or text messages it gets a little complicated. You basically need to apply binary math to do it somewhat efficiently. Just tell us if you want that, and we can show you a system that does it.

Ah, the idea of using a non-usable unit in the game to count hadn't occurred to me.

look what a good idea for something unpredictable, although what I'm looking for is better I show it in a video (I inverted the video so that they understand that I need the clock to count up)



The problem is that the counter is constantly lowering the number and I don't know how to counteract that.

This is too fast
Quote from name:
Trigger("Player 1"){
Conditions:
Always();

Actions:
Set Countdown Timer(Add, 1);
Set Countdown Timer(Add, 1);
Preserve Trigger();
}


This is too slow
Quote from name:
Trigger("Player 1"){
Conditions:
Always();

Actions:
Set Countdown Timer(Add, 1);
Set Countdown Timer(Add, 1);
Wait(0);
Preserve Trigger();
}


Post has been edited 1 time(s), last time on Jun 26 2022, 4:19 pm by Tonblader.




Jun 26 2022, 6:01 pm NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

As I've said, do the actual timing with death counters. The Countdown timer is just for show.
The idea is setting the countdown timer with triggers all the time instead of letting it count down naturally.

There's basically 2 methods:
1) The "binary countoff method" where you need x triggers for 2x values of your timer. That involves transferring the dc counts into the countdown timer, but as you noticed transferring directly is too fast, so you need a secondary counter that counts up only every second and transfer that via binary countoff.
2) The "brute force method" where you simply make a trigger for every possible value of the death counter. This can easily be done by a trigger generator, like for example Farlap or Trigger Duplicator, which generate text based triggers you can copy and paste into ScmDraft.

Oh and one thing: Never use waits for timers, or you'll run into Wait Blocks.

Post has been edited 1 time(s), last time on Jun 26 2022, 6:07 pm by NudeRaider.




Jun 26 2022, 6:22 pm Tonblader Post #8



Quote from NudeRaider
As I've said, do the actual timing with death counters. The Countdown timer is just for show.
The idea is setting the countdown timer with triggers all the time instead of letting it count down naturally.

There's basically 2 methods:
1) The "binary countoff method" where you need x triggers for 2x values of your timer. That involves transferring the dc counts into the countdown timer, but as you noticed transferring directly is too fast, so you need a secondary counter that counts up only every second and transfer that via binary countoff.
2) The "brute force method" where you simply make a trigger for every possible value of the death counter. This can easily be done by a trigger generator, like for example Farlap or Trigger Duplicator, which generate text based triggers you can copy and paste into ScmDraft.

Oh and one thing: Never use waits for timers, or you'll run into Wait Blocks.

The second method you mention seems the best to me, but I don't know how to use the trigger generator.




Jun 26 2022, 6:48 pm Zoan Post #9

Math + Physics + StarCraft = Zoan

Here's an example of making the timer going up every 8 frames using a deathcounter (I did 8 frames because according to NudeRaider this is about time it takes for the countdown timer to tick down one). I'll use player 8's deaths of cantina, and assume player 8 is a computer in charge of the triggers that makes the timer go up.

Countdown the death counter
Players

  • Player 8
  • Conditions

  • Deaths("Player 8", "Cantina", At least, 1);
  • Actions

  • Set Deaths("Player 8", "Cantina", Subtract, 1);
  • Preserve Trigger();


  • When it hits 0 add 2 to countdown timer
    Players

  • Player 8
  • Conditions

  • Deaths("Player 8", "Cantina", Exactly, 0);
  • Actions

  • Set Countdown Timer(Add, 2);
  • Set Deaths("Player 8", "Cantina", Set To, 8);
  • Preserve Trigger();


  • 8 cycles should sort of work if you are using hyper triggers. Do you know what those are?

    Edit: @everyone else, I'm pretty sure when he says "unpredictable" he means once the countdown timer is at a certain anount dependent on the number of players, do something. No need to use randomizers.

    Edit2: Why not just pause the timer and count up 1 every 8 trigger cycles:

    Pause timer
    Players

  • Player 8
  • Conditions

  • Always();
  • Actions

  • Pause Timer();


  • Countdown the death counter
    Players

  • Player 8
  • Conditions

  • Deaths("Player 8", "Cantina", At least, 1);
  • Actions

  • Set Deaths("Player 8", "Cantina", Subtract, 1);
  • Preserve Trigger();


  • When it hits 0 add 1 to countdown timer
    Players

  • Player 8
  • Conditions

  • Deaths("Player 8", "Cantina", Exactly, 0);
  • Actions

  • Set Countdown Timer(Add, 1);
  • Set Deaths("Player 8", "Cantina", Set To, 8);
  • Preserve Trigger();


  • Post has been edited 4 time(s), last time on Jun 26 2022, 7:57 pm by Zoan.



    \:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

    Jun 26 2022, 8:09 pm Ultraviolet Post #10



    Glad to see you mentioned the Pause Timer trigger Zoan, that makes a big difference in making a count-up timer that doesn't look stupid because it's constantly trying to count back down.




    Jun 27 2022, 1:15 pm IlyaSnopchenko Post #11

    The Curious

    Interesting. Might try that sometime.



    Trial and error... mostly error.

    Jun 28 2022, 2:32 am Tonblader Post #12



    Quote from Zoan
    Here's an example of making the timer going up every 8 frames using a deathcounter (I did 8 frames because according to NudeRaider this is about time it takes for the countdown timer to tick down one). I'll use player 8's deaths of cantina, and assume player 8 is a computer in charge of the triggers that makes the timer go up.

    8 cycles should sort of work if you are using hyper triggers. Do you know what those are?

    Edit: @everyone else, I'm pretty sure when he says "unpredictable" he means once the countdown timer is at a certain anount dependent on the number of players, do something. No need to use randomizers.

    Edit2: Why not just pause the timer and count up 1 every 8 trigger cycles

    By unpredictable, I meant that the countdown timer would be triggered after players eliminated a computer (which is unpredictable dont knowing when in the gameplay it will be).

    Thank you, you understood what i need almost perfectly, all you had to do was add the hyper trigger and your explanation would be complete.

    I understand what to do and what you are explaining because thanks to Teuflischer#1287 from the web discord group we were able to use the idea of constantly pausing the clock and uploading the time in the same way as you explain it.




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [05:05 pm]
    Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
    [04:31 pm]
    Zoan -- where's the option to delete my account
    [04:30 pm]
    Zoan -- goodbye forever
    [04:30 pm]
    Zoan -- it's over, I've misclicked my top right magic box spot
    [2024-4-14. : 9:21 pm]
    O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
    [2024-4-14. : 9:21 pm]
    O)FaRTy1billion[MM] -- there are almost 3k pages
    [2024-4-14. : 9:21 pm]
    O)FaRTy1billion[MM] -- the real members stop around page 250
    [2024-4-14. : 9:20 pm]
    O)FaRTy1billion[MM] -- look at the members list
    [2024-4-12. : 12:52 pm]
    Oh_Man -- da real donwano
    da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
    it's pretty common
    [2024-4-11. : 9:53 pm]
    da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
    Please log in to shout.


    Members Online: Wing Zero, jun3hong, Vrael