Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: One simple way to avoid wait blocks
One simple way to avoid wait blocks
May 28 2011, 12:37 pm
By: Wormer  

May 28 2011, 12:37 pm Wormer Post #1



I've just thought of this very simple concept to failsafe yourself from getting into wait blocks. Whenever there is a trigger which uses a wait we do the following (uMutex is any unused unit):

Trigger
Players
  • Whatever
  • Conditions
  • Current player has suffered exactly 0 deaths of uMutex.
  • The rest of conditions...
  • Actions
  • Set deaths for current player: set to 1 of uMutex.
  • The rest of actions with waits...
  • Set deaths for current player: set to 0 of uMutex.




  • Some.

    May 28 2011, 6:02 pm Roy Post #2

    An artist's depiction of an Extended Unit Death

    It seems more appropriate to use a switch, because you're just flipping a bit. It's a nice concept, but impractical for complex maps. Sure, this would clearly show if you have wait blocks, but most people want to run triggers simultaneously, including those which would normally use waits. Therefore, death counters are still the most appropriate way of avoiding wait blocks.

    TL;DR: It doesn't stop wait blocks, it stops the whole trigger, which causes the same problem. Death counters ftw.




    May 28 2011, 6:35 pm Wormer Post #3



    Since waits are player-specific, a player-specific death counter looks more appropriate than a global switch. Yeah simultaneously, well... What I had in mind when I was posting this was the following. Waits are useful due to their specific to have a memory of their trigger. Sometimes I'm using waits just to skip a trigger cycle and then return to execution of the trigger. Of course everything may be done with death counters, but waits alike current player help to keep triggers number reasonable. Then, if I have some amount of such triggers there is a possibility they will run altogether, but due to the waits specific this will cause exponential growth of wait time. Since I only wanted to skip one cycle I found practical to use a mutex to manually separate their execution.

    Another thing I found waits extremely useful is displaying information to the player in complex maps. Let's say there is a number of events which may repeatedly happen during the game. When several events happen at a time it might be useful to delay incoming messages for the player (anyways he can't read them all at once). So I split the actual handling of the event and the player notification in different triggers. And then I got a wait in the "notification" triggers: wait(0) before notification and wait(time) afterwards. That way, waits subsystem automatically queues incoming messages and displays them one after another (maybe in the other order though).



    Some.

    May 28 2011, 6:51 pm The Starport Post #4



    Methinks an ASM mod just to allow parallel waits would almost be worth it.



    None.

    May 29 2011, 5:22 am Heinermann Post #5

    memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes

    That's easy. You don't even have to manage any data, just use the padding space ("unknown/unused" in the chk specs) for each trigger performing the wait.




    May 29 2011, 5:49 am Wormer Post #6



    Plus with the ability to run triggers every frame and disjunction in conditions. Settled then! Who makes it? :P



    Some.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [2026-6-04. : 3:42 am]
    RIVE -- Hellooooo, Nurse
    [2026-6-03. : 4:19 pm]
    NudeRaider -- Hello World!
    [2026-6-01. : 4:03 pm]
    IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
    [2026-5-31. : 10:02 pm]
    Symmetry -- I was really just figuring out how to compile
    [2026-5-31. : 10:02 pm]
    Symmetry -- I didn't make it do anything
    [2026-5-31. : 9:17 pm]
    Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
    [2026-5-31. : 8:29 pm]
    Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
    [2026-5-31. : 8:07 pm]
    Ultraviolet -- Symmetry
    Symmetry shouted: I did my first EUD thing today. Feels like me finding arsenal at age 8 again
    haha for sure. in some ways it's even more exciting because you can play EUD maps on regular battle.net, don't need to convince someone to download your mod to play with you. what did you do?
    [2026-5-31. : 6:47 pm]
    Symmetry -- I did my first EUD thing today. Feels like me finding arsenal at age 8 again
    [2026-5-31. : 3:20 pm]
    l)ark_ssj9kevin -- le reddit
    Please log in to shout.


    Members Online: Dem0n, Symmetry