Announcement

Collapse
No announcement yet.

Script Question

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

  • Script Question

    I Have a big scale mission set up that starts with only 3 task/objectives. They are to man the OP's 1,2,&3. After thay as per the brief you pull security. 5-7mins later there is an all out assault by our little russian friends.

    My question is this

    How do I update the objectives once the assault starts? I need something to pop up and say "Hey they are attacking hold the line, yadda yadda"

    The catch is. I dont want the players to be able to see that task in the brief....Can anyone help me with this? Would it have to be like a side task like in our Domi missions?

    [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...

  • #2
    Re: Script Question

    Originally posted by Dredge View Post
    I Have a big scale mission set up that starts with only 3 task/objectives. They are to man the OP's 1,2,&3. After thay as per the brief you pull security. 5-7mins later there is an all out assault by our little russian friends.

    My question is this

    How do I update the objectives once the assault starts? I need something to pop up and say "Hey they are attacking hold the line, yadda yadda"

    The catch is. I dont want the players to be able to see that task in the brief....Can anyone help me with this? Would it have to be like a side task like in our Domi missions?
    It depends how you want to do it. If you played any of my missions, there is a pop up coming out with informations.

    Create trigger and in On activation put:

    Code:
    HintC "Reds are attacking, hold the line, then move to the town. Bla, bla bla".

    OR

    http://www.armaholic.com/page.php?id=7377.

    You can use taskmaster, which will add tasks during the mission. However, we don't have always time to open map, look on briefing during gameplay, etc... So, I advice to use the first option.

    Comment


    • #3
      Re: Script Question

      The same createSimpleTask-stuff that you have in the briefing.sqf can be added anywhere in a mission. Just put the needed code into a trigger or script run when you want to add the new tasks and/or remove the old ones. :)



      Comment


      • #4
        Re: Script Question

        so what i can do is place an area trigger and have OPFOR present to activate it right where the assault begins and basically the script will be something like this

        On Act

        player createSimpleTask ["Hold The Line"];
        setSimpleTaskDescription ["The Russians Are Attacking!", "HOLD!", "Hold Here"];Hint "The Russians Are Attacking Us";


        look abouts right?

        [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


        • #5
          Re: Script Question

          Yep. That looks to me like it should work perfectly.

          If you want to you can start by changing the old objectives to cancelled, and automatically set the 'Hold the line'-task to the current one. :)



          Comment


          • #6
            Re: Script Question

            the other objectives are updated and "crossed" off the list as soon as players enter the bunker OP's so thats not really an issue.

            im just going to make a small trigger radius where the enemy walksthough,should be able to see them by then, and have the task update.

            [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


            • #7
              Re: Script Question

              Yes, but if you do it this way, then JIP and respawn will not see updated tasks.

              Taskmaster, has everything you need with JIP/respawn synchronization.

              Comment


              • #8
                Re: Script Question

                I thought they had fixed that so that triggers automatically sync with the server when a new player joins?



                Comment


                • #9
                  Re: Script Question

                  can we get clarification on that? is there away to check? without actually running the mission

                  [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


                  • #10
                    Re: Script Question

                    Investigating this atm. Hope to have a definite answer soon. There are alternative solutions with publicVariable, but I guess not having that would be nicer :)



                    Comment


                    • #11
                      Re: Script Question

                      Okido! Tested and done, and thanks to GeneralCarver and Gr!mReeper for being test subjects.

                      Triggers do NOT sync on JIP, so to get around this you'll have to use for example the publicVariable command.


                      In this mission's case, on the OPFOR Present trigger, just set its On Activation to east_present = true; publicVariable "east_present". Then have another trigger with east_present as its one and only condition in the condition field, and make that trigger update peoples' briefing.

                      Alternatively force-run a script that processes the state of certain variables of your choosing, possibly through waitUntil, or through if-checks within a loop (with a sleep duration of a few seconds this is MUCH nicer on the computer than a trigger is. This is true in general for servers as well.)



                      Comment


                      • #12
                        Re: Script Question

                        Originally posted by Inkompetent View Post
                        Alternatively force-run a script that processes the state of certain variables of your choosing, possibly through waitUntil, or through if-checks within a loop (with a sleep duration of a few seconds this is MUCH nicer on the computer than a trigger is. This is true in general for servers as well.)
                        A perfect time for some FSM use, although I'm not sure if the effect of a normal waitUntil or trigger is that bad either. A sleep is a sort of waitUntil too after all, and triggers are only checked every 0.5 seconds.

                        Comment


                        • #13
                          Re: Script Question

                          Well, if looking at it at a lower level a trigger checking once every 0.5 seconds is essentially in a sleep 0.5; pause, making neither more effective than the other. The bonus with scripts is that you can make five or ten second pauses, or even longer, before checking against the condition.

                          For missions that aren't any resource-hogs I guess it doesn't matter which one chooses. With lots of AI and stuff one has to become more resource-concious. ^^



                          Comment


                          • #14
                            Re: Script Question

                            No need to be afraid of this really. 120 FSMs each checking two to four conditions every frame resulted in no noticeable performance hit whatsoever, and I doubt you'll ever use that many in a real mission. There's stuff like AI that'll eat resources much quicker than any sleeps or condition checks you need in the mission.

                            edit: From the FSM thread
                            Code:
                            FSM running for 120 AI and one player
                            Average fps over 60 seconds 36.9902
                            
                            No FSM(stock Arma2)
                            Average fps over 60 seconds 37.2029
                            
                            FPS measured using diag_frameno and diag_ticktime
                            So I lied, we lost about 0.21 frames over 60 seconds :)

                            Comment

                            Connect

                            Collapse

                            TeamSpeak 3 Server

                            Collapse

                            Advertisement

                            Collapse

                            Twitter Feed

                            Collapse

                            Working...
                            X