Announcement

Collapse
No announcement yet.

Help with a trigger

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with a trigger

    Ok, here is the concept- two opposing forces simultaniouly fight for a city that is already occupied by a third faction.

    What trigger can I use to do for:

    The Idependent team holds the city against both forces?
    The East captures and holds the city?
    The West captures and holds the city?

    I have spent a long time on this one and all I really need is a end trigger..


    Thanks!
    "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

  • #2
    Re: Help with a trigger

    Could you use a combination of triggers that have BLUEFOR Not Present, OPFOR Not Present, and Independent Not Present? With variables, you could tie these to another trigger that ends the mission.

    For example...

    OPFOR Triggers (two): Set one to "BLUEFOR Not Present" and another to "Independent Not Present". Each trigger should cover the area you want held/defended. Let each trigger have a variable in its Activation that becomes true when the trigger condition is met. Then tie these variables to another trigger that ends the mission when it evaluates to true.


    You'd need similar triggers for the Independents and the BLUEFOR. You could likely include a percent calculation as well, so that the trigger variables would become true only if 10% or less of a certain faction remained.

    Comment


    • #3
      Re: Help with a trigger

      That is the exact way I have it setup now! There are three triggers for that condition. But what I think I need is two of the conditions to be met. For example: if the East and Independent are not present, the West wins. That is the thing I am struggling through now is to combine them. And of any knows the variables for a condition to be a % like Strag mentioned, please do post..

      Thanks!!
      "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

      Comment


      • #4
        Re: Help with a trigger

        Originally posted by TheBigC View Post
        That is the exact way I have it setup now! There are three triggers for that condition. But what I think I need is two of the conditions to be met. For example: if the East and Independent are not present, the West wins. That is the thing I am struggling through now is to combine them.
        Couldn't variables handle this?


        West Triggers

        Trigger 1:

        East Not Present
        (Condition) this;
        (Activation) Variable1 = 1;


        Trigger 2:

        Independents Not Present
        (Condition) this;
        (Activation) Variable2 = 1;


        Trigger 3:

        (Condition) Variable1 == 1 and Variable2 == 1;
        (Activation) West Wins



        You'd need similar trigger setups for the East and for the Independents.

        Comment


        • #5
          Re: Help with a trigger

          That will probably be better than what I have currently. I was also looking at going a little deeper using the:

          if (alive player) && (enemycount == 0) then {hint "you win"}

          I may be able to manipulate that to set conditions with %. Anybody messed with the "&&" stuff?
          "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

          Comment


          • #6
            Re: Help with a trigger

            Nice call Strag, the triggers worked perfectly with the variables you gave. now all I have to do is create it with that % I really want, I hate looking for 1 guy to finish a mission.
            "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

            Comment


            • #7
              Re: Help with a trigger

              Okay, C, I found a thread here that has something kinda like what you want to do with percentage of players remaining. A few alterations should get you what you need. Something this, maybe:

              For the East
              Make a trigger that covers the entire area of/around Bagango. In its Init field, put townarray = thisList;

              Create a script aliveeast.sqs that looks something like this:


              _percentage = 100;

              ; calculate how many east players are within the trigger area
              _totaleast = {side _x == east} count townarray

              #CheckAlive
              ? _percentage < 11 : goto "Done"

              ; calculate how many live east players are within the trigger area
              _aliveeast = {(alive _x) and (side _x == east)} count townarray

              ; calculate a percentage based on _aliveeast and _totaleast
              _percentage = (_aliveeast / _totaleast) * 100

              ; do calculation every ten (more?) seconds to save CPU cycles
              ~10
              goto "CheckAlive"

              #Done
              Exit



              I believe this script would be called from the trigger's Activation field.


              For your mission, I'd think you'd need this same thing for West, and also for Independent.

              This may not be exactly correct, but I believe the gist is right. I haven't tested it, so it'll probably take a bit of tweaking.
              Last edited by Strag; 02-26-2007, 02:32 PM.

              Comment


              • #8
                Re: Help with a trigger

                The 1.05 patch might add a function to make this simpler:

                # 5124 - New: New trigger types "Seized by ..."
                Not sure what this new trigger type will do, but it sounds like it could be used in this kind of mission.

                Comment


                • #9
                  Re: Help with a trigger

                  If your still working on this I have some sector control scripts that you can use as reference:


                  the scoreBoard.sqf is included to show how I call the sector control script
                  [corazolOPFORWEST, corazolBLUFORWEST, "CorazolWest"] execVM "TGSHI_scoreSectorControl.sqf";

                  corazolOPFORWEST is a trigger that detects the presence of OPFOR soldiers
                  corazolBLUFORWEST is a trigger that detects the presence of BLUFOR soldiers
                  "CorazolWest" is simply the marker that shows the players who is in-control.

                  For your situation you could add a third trigger for the guerillas and then modify the test accordingly.

                  BTW my script only grants control at > 65%.
                  Attached Files


                  Comment

                  Connect

                  Collapse

                  TeamSpeak 3 Server

                  Collapse

                  Advertisement

                  Collapse

                  Twitter Feed

                  Collapse

                  Working...
                  X