Announcement

Collapse
No announcement yet.

King of the Hill Trigger?

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

  • King of the Hill Trigger?

    Question mark means I need you to make me one.

    Essentially, I need a trigger for a king-of-the-kill type match. It waits until a unit enters its perimeter, then adds +1 to a variable until that player leaves, or until another player not in his group enters the perimeter.

    Caveat: no more than one group may be present in order for the trigger to start adding "points" to that player's total. As soon as another player enters the trigger, all points stop. The variable also needs to look for which group that player belongs to, so that it adds points only to the right team.

  • #2
    Re: King of the Hill Trigger?

    Oh I know what you might want, in 1.05 BI added a siezed by variable to triggers:

    http://community.bistudio.com/wiki/Triggers

    Sweet huh?

    Comment


    • #3
      Re: King of the Hill Trigger?

      Note that it was added in ArmA 1.05, not ArmA2 1.05, Hotmachina ;)
      It is indeed a beautiful trigger type, however!



      Comment


      • #4
        Re: King of the Hill Trigger?

        Unfortunately, I think the Seized By... trigger is too complicated for what I want. Since it calculates things like how many players are present, how long the players have been present there, and how many opposing forces threaten the target, it doesn't have a "nobody's winning" variable. Any other ideas?

        Comment


        • #5
          Re: King of the Hill Trigger?

          Hmmm... In that case I think you'll need two triggers covering the same zone, one for OPFOR and one for BLUFOR that count the units in thisList and add points depending on that.

          Example Condition:
          Code:
          ( {side _x == "WEST"} count thisList ) > ( 2 * ( {side _x == "EAST" count thisList ) )
          Would make the trigger true as long as there are more than twice as many BLUFOR as OPFOR in a zone. Just set it to ANYBODY PRESENT and it should trigger properly for all factions.

          Could start runnig a simple script with a named script handle that adds points. Easier (in my eyes) than trying to repeatedly trigger scripts.

          For example have an On Activation that looks like:
          Code:
          addWest = [] spawn addPointsWest;
          Simply have the On Deactivation look like:
          Code:
          terminate addWest
          That will instantly stop the script from running on the spot, without waiting for any loops or stuff to finish like a While-clause would.



          Comment


          • #6
            Re: King of the Hill Trigger?

            Alright, so I'm back to trying this. Seized By... doesn't work, so I'm on to Inko's suggestion.

            Unfortunately, it doesn't seem to work right now. I don't totally understand it, so I can't totally fix it, either.
            Code:
            ({side _x == "WEST"} count thisList) > (2 * ({side _x == "EAST"} count thisList)) && ({side _x == "WEST"} count thisList) > (2 * ({side _x == "GUERILLA"} count thisList));

            Comment


            • #7
              Re: King of the Hill Trigger?

              You are running it as a script correct? Correct me if im wrong but what you have there is the script. And you need to call it on activation with:

              Code:
              addWest = [] spawn addPointsWest;
              is that correct Inko? Or am I too noobish and need to go back to my hole in the wall? lol

              [unit][squadl][command2]

              KnyghtMare ~You could always tell the person holding the gun to your head you would like to play on a different server...

              Comment


              • #8
                Re: King of the Hill Trigger?

                Nah. What he has there is the condition for the trigger to activate. What you have in your code-block is the On Activation-code, which would run the script to add points. Scope's code simply checks if the script should run at all.

                And Scope, the code looks fine to me with one little correction. As far as I know the defining string for the Guerilla side is "GUER" and not "GUERILLA" (or maybe "GUERILLA" is valid in ArmA2? Correct me if that's the case). Other than that it looks right to me.



                Comment


                • #9
                  Re: King of the Hill Trigger?

                  I'd assumed that the SIDE parameter was the same one I use in the briefing.sqf. I'll try changing it.

                  Comment


                  • #10
                    Re: King of the Hill Trigger?

                    Well, if it works in the briefing it'll work in a trigger's condition check too since it's the same command. Just that the biki said "GUER" and I've never done a side-check for that faction in ArmA2. Nice if the entire word written out works. Makes things easier :)



                    Comment


                    • #11
                      Re: King of the Hill Trigger?

                      With the help of cctoide, I fixed it! Turns out side returns a variable, not a string.

                      Comment


                      • #12
                        Re: King of the Hill Trigger?

                        Oh, new question. With regards to
                        Code:
                        addWest = [] spawn addPointsWest;
                        Does this create a new script running in parallel, or does it simply start a script I can define? What I mean to ask is, how do I go about using this?

                        Comment


                        • #13
                          Re: King of the Hill Trigger?

                          Scope-Is this thread discussing the sniper map we played last night? I wanted to make a suggestion

                          Comment


                          • #14
                            Re: King of the Hill Trigger?

                            Originally posted by Sc[ + ]pe View Post
                            Does this create a new script running in parallel, or does it simply start a script I can define? What I mean to ask is, how do I go about using this?
                            BIS Wiki is your friend

                            Just type the name of the command in the search box and have fun

                            In the case of Inko's example you'd first have to, or it would be very good to since the same code is needed several times, compile the script and assign the resulting code the the variable addPointsWest
                            Code:
                            addPointsWest = compile preProcessFileLineNumbers "PathToScript";
                            after which you could run it in parallel with other stuff and assign the script-handle to a variable called addWest:
                            Code:
                            addWest = [] spawn addPointsWest;
                            or if you didn't compile it first:
                            Code:
                            addWest = [] spawn (compile preProcessFileLineNumbers "PathToScript");
                            addWest would now point to that particular instance of the script as long as it'd be running.

                            Comment


                            • #15
                              Re: King of the Hill Trigger?

                              Just curious though, Fincuan. How is the last example, with spawn and compilation in the same line, different from a standard execVM?



                              Comment

                              Connect

                              Collapse

                              TeamSpeak 3 Server

                              Collapse

                              Advertisement

                              Collapse

                              Twitter Feed

                              Collapse

                              Working...
                              X