Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: WWII Reoccurring Specific National Triggers
WWII Reoccurring Specific National Triggers
Aug 24 2023, 7:27 pm
By: overmind25  

Aug 24 2023, 7:27 pm overmind25 Post #1



If anyone is willing, I have a question on how to resolve the last major issue with a WWII map. I am trying to set special, reoccurring specific national triggers. I will link Germany's as an example. This is one of the ones that I am trying to have reoccur at a certain time on the countdown timer, but to have the trigger start and then reoccur after a certain period has elapsed in game. For some reason the national triggers are working but not reoccurring. I will post the text of the setting up of the trigger and then the actual trigger (which was my understanding of what needed to be done). Please let me know what I am doing wrong. I will link the map.


Setup Trigger:


Trigger("Player 2"){
Conditions:
Always();
Elapsed Time(At least, 1300);

Actions:
Set Switch("Switch132", set);
Comment("Set Switch for German Tanks 1");
}



Trigger Specifics:


Trigger("Player 2"){
Conditions:
Switch("Switch132", Set);
Always();
Bring("Player 2", "Buildings", "berlin", At least, 1);
Bring("Germany, Axis Minors", "Buildings", "bucharest", At least, 1);
Bring("Italy", "Buildings", "bucharest", Exactly, 0);
Countdown Timer(At most, 120);

Actions:
Set Switch("Switch132", clear);
Create Unit("Player 2", "<04>Tiger <07>Tank", 2, "dresden");
Create Unit("Player 2", "<06>Panther <07>Tank", 4, "dresden");
Display Text Message(Always Display, "\x007 Elite German Panzers have been trained");
Preserve Trigger();
Comment("Elite German Panzers Spawn 1");
}



None.

Aug 24 2023, 8:59 pm Ultraviolet Post #2

We do a little trolling

You don't have anything in place to set Switch132 after it is cleared the first time so it's not going to repeat. Also not related to your question, but putting "Always" as a condition in triggers with other conditions is meaningless. Consider using Current Player instead of Player 2 in the body of triggers. The effect is basically the same, but makes it easier if you want to copy and paste the trigger to function for a different player.



My Projects:

Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
Mercenaries 2020 | Mercenaries III
Squad Defense

Legacy Projects (No guarantee of functionality in modern SC):

Pixel Adventure 2 | Space Snipers | Control the Ball

______________________________________________

Join me in Torn City

Aug 24 2023, 9:41 pm overmind25 Post #3



Thank you, so would adding "set switch 132" right above Preserve Trigger fix the issue?



None.

Aug 24 2023, 9:49 pm Ultraviolet Post #4

We do a little trolling

Absolutely not. That would just invalidate the previous clear Switch 132 making the trigger run continuously while the countdown timer is at most 120. Using a countdown timer with hyper triggers is tricky because even if you change your "Countdown Timer(At most, 120);" condition to "Countdown Timer(Exactly, 120);" the trigger will run several times while the countdown timer is at 120s. On the other hand, if you aren't using hyper triggers, then it might miss altogether since triggers only run approximately every 2 seconds without hypers. A better practice is to use Death Counter timers for timing things. Alternatively if you do want to stick to the countdown timer system, you could add a trigger like this:

Set Switch
Players

  • Player 2
  • Conditions

  • Countdown Timer(Exactly, 121);
  • Actions

  • Preserve Trigger();
  • Set Switch("Switch132", set);


  • This will only reliably work with hyper triggers. If you aren't using hypers you would need to detect a range for the countdown timer, that would look more like:

    Set Switch
    Players

  • Player 2
  • Conditions

  • Countdown Timer(At least, 121);
  • Countdown Timer(At most, 125);
  • Actions

  • Preserve Trigger();
  • Set Switch("Switch132", set);




  • My Projects:

    Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
    Mercenaries 2020 | Mercenaries III
    Squad Defense

    Legacy Projects (No guarantee of functionality in modern SC):

    Pixel Adventure 2 | Space Snipers | Control the Ball

    ______________________________________________

    Join me in Torn City

    Aug 24 2023, 9:54 pm 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

    In principle yes, but you'll also need a better timer or it would fire immediately again, assuming you're using hyper triggers, which you should. Use death counters for timing, use the countdown timer for show.

    EDIT:
    UV sniped me with a more elaborate answer. :massimo:




    Aug 24 2023, 10:03 pm overmind25 Post #6



    Thank you both. What is a hyper trigger?



    None.

    Aug 24 2023, 10:04 pm Ultraviolet Post #7

    We do a little trolling

    Quote from overmind25
    Thank you both. What is a hyper trigger?

    Hyper Triggers



    My Projects:

    Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
    Mercenaries 2020 | Mercenaries III
    Squad Defense

    Legacy Projects (No guarantee of functionality in modern SC):

    Pixel Adventure 2 | Space Snipers | Control the Ball

    ______________________________________________

    Join me in Torn City

    Aug 24 2023, 10:22 pm overmind25 Post #8



    Thank you. It seems there may not be a solution that I understand how to do. Would it be easier if I linked the map?



    None.

    Aug 24 2023, 10:30 pm Ultraviolet Post #9

    We do a little trolling

    What do you mean? I gave you a plug and play solution in my previous post. This trigger should work with your current setup:

    Set Switch
    Players

  • Player 2
  • Conditions

  • Countdown Timer(At least, 121);
  • Countdown Timer(At most, 125);
  • Actions

  • Preserve Trigger();
  • Set Switch("Switch132", set);




  • My Projects:

    Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
    Mercenaries 2020 | Mercenaries III
    Squad Defense

    Legacy Projects (No guarantee of functionality in modern SC):

    Pixel Adventure 2 | Space Snipers | Control the Ball

    ______________________________________________

    Join me in Torn City

    Aug 24 2023, 10:55 pm overmind25 Post #10



    Sorry I am still confused. I don't understand how that would fit into the elapsed time issue. I guess I am not sure if that post is saying that is all I should have or if I should take anything out of this:

    Setup Trigger:


    Trigger("Player 2"){
    Conditions:
    Always();
    Elapsed Time(At least, 1300);

    Actions:
    Set Switch("Switch132", set);
    Comment("Set Switch for German Tanks 1");
    }



    Trigger Specifics:


    Trigger("Player 2"){
    Conditions:
    Switch("Switch132", Set);
    Always();
    Bring("Player 2", "Buildings", "berlin", At least, 1);
    Bring("Germany, Axis Minors", "Buildings", "bucharest", At least, 1);
    Bring("Italy", "Buildings", "bucharest", Exactly, 0);
    Countdown Timer(At most, 120);

    Actions:
    Set Switch("Switch132", clear);
    Create Unit("Player 2", "<04>Tiger <07>Tank", 2, "dresden");
    Create Unit("Player 2", "<06>Panther <07>Tank", 4, "dresden");
    Display Text Message(Always Display, "\x007 Elite German Panzers have been trained");
    Preserve Trigger();
    Comment("Elite German Panzers Spawn 1");
    }



    None.

    Aug 25 2023, 12:14 am Ultraviolet Post #11

    We do a little trolling

    The first trigger is basically meaningless in a recurring trigger system because it only happens once. You can delete it and put the trigger I proposed instead.



    My Projects:

    Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
    Mercenaries 2020 | Mercenaries III
    Squad Defense

    Legacy Projects (No guarantee of functionality in modern SC):

    Pixel Adventure 2 | Space Snipers | Control the Ball

    ______________________________________________

    Join me in Torn City

    Aug 25 2023, 5:20 am overmind25 Post #12



    Thank you, your solution worked. I kept both trigers, added what you have but I had to make the least and most only a second apart so that it didnt repeat more than once. I also put the (re) set switch above perserve.



    None.

    Aug 25 2023, 12:37 pm Ultraviolet Post #13

    We do a little trolling

    Glad it worked. FYI, the order you place Preserve Trigger doesn't matter. If Preserve Trigger shows up anywhere in the actions, the trigger will be preserved. Order matters for the other actions, but not preserve or comment. I used to always put Preserve at the bottom of the list thinking it mattered and that I could theoretically put anything I only wanted to run once after the preserve, but it doesn't work that way. Once I found out it doesn't, I decided I like having it at the top so it's quicker to identify if a trigger is preserved or not when reading it.

    P.S. Not sure why the interval between at least and at most for the countdown timer would matter as long as the at least is greater than 120 since the other trigger only activates after the countdown is at most 120 and setting a switch more than once just leaves it in the set state. Regardless, glad it's working for you.



    My Projects:

    Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
    Mercenaries 2020 | Mercenaries III
    Squad Defense

    Legacy Projects (No guarantee of functionality in modern SC):

    Pixel Adventure 2 | Space Snipers | Control the Ball

    ______________________________________________

    Join me in Torn City

    Aug 27 2023, 7:43 am overmind25 Post #14



    Thank you!



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [12:07 am]
    Vrael -- NudeRaider
    NudeRaider shouted: Vrael ranting still is though
    you're a gentleman and a scholar, thank you
    [10:07 pm]
    NudeRaider -- ya why phone people when you can just write letters
    [09:37 pm]
    IskatuMesk -- I have never and will never own a phone
    [09:15 pm]
    NudeRaider -- Vrael ranting still is though
    [09:14 pm]
    ClansAreForGays -- anticapitalism isnt edgy anymore
    [03:31 pm]
    Vrael -- it only costs 50% of my post-tax salary for life and in return I get to also become a drone whose sole purpose is CAPITALISM
    [03:30 pm]
    Vrael -- pssht, you're still using a phone? I just record 100% of my life using my ElonBrainChip
    [2026-4-13. : 2:13 pm]
    NudeRaider -- bro I don't go anywhere without my phone to record anything significant
    [2026-4-13. : 1:28 pm]
    Vrael -- Zoan
    Zoan shouted: not if u wer there
    id say even if you were there its tricky, human memory can be very faulty
    [2026-4-12. : 11:55 pm]
    Zoan -- not if u wer there
    Please log in to shout.


    Members Online: Zycorax