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.
    [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.
    [2024-4-11. : 4:18 pm]
    IlyaSnopchenko -- still better than "Pakistani hookers in Sharjah" that I've seen advertised in another forum
    [2024-4-11. : 4:07 pm]
    Ultraviolet -- These guys are hella persistent
    [2024-4-11. : 3:29 pm]
    Vrael -- You know, the outdoors is overrated. Got any indoor gym and fitness equipment?
    [2024-4-10. : 8:11 am]
    Sylph-Of-Space -- Hello!
    [2024-4-09. : 7:59 am]
    kesexib477 -- hi
    [2024-4-05. : 9:24 am]
    Sylph-Of-Space -- I just very barely got SCMDraft to work with crossover, if anyone is still interested in making maps I wanna make terrain again!!
    [2024-4-05. : 12:00 am]
    Vrael -- like I'm not even canadian
    [2024-4-04. : 9:24 pm]
    NudeRaider -- :awesome:
    Please log in to shout.


    Members Online: Excalibur, Roy