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



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.




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



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);





  • 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



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

    Hyper Triggers




    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



    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);





  • 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



    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.




    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



    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.




    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.
    [09:38 pm]
    NudeRaider -- Ultraviolet
    Ultraviolet shouted: NudeRaider sing it brother
    trust me, you don't wanna hear that. I defer that to the pros.
    [07:56 pm]
    Ultraviolet -- NudeRaider
    NudeRaider shouted: "War nie wirklich weg" 🎵
    sing it brother
    [06:24 pm]
    NudeRaider -- "War nie wirklich weg" 🎵
    [03:33 pm]
    O)FaRTy1billion[MM] -- o sen is back
    [01:53 am]
    Ultraviolet -- :lol:
    [2024-4-26. : 6:51 pm]
    Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
    [2024-4-26. : 6:50 pm]
    NudeRaider -- Vrael
    Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
    sounds like moisture control is often a pressing concern in your city
    [2024-4-26. : 6:50 pm]
    Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
    [2024-4-26. : 6:49 pm]
    Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
    [2024-4-26. : 6:48 pm]
    Vrael -- On this Topic, I could definitely use some Introductions.
    Please log in to shout.


    Members Online: Ultraviolet