+ Reply to Thread
Results 1 to 14 of 14

Thread: Script Question

  1. #1

    Dredge's Avatar
    Join Date
    Oct 2009
    Location
    Keying Boons Car
    Age
    24
    Posts
    1,364
    Blog Entries
    1

    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?
    |TGU Instructor|303rd TGSAD|ArmA Admin|
    |TG Pathfinder|

    DO YOU HAVE WHAT IT TAKES?

    Armis Exposcere Pacem


  2. #2
    Mikee's Avatar
    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    355

    Re: Script Question

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


  3. #3
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

    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.






  4.  
  5. #4

    Dredge's Avatar
    Join Date
    Oct 2009
    Location
    Keying Boons Car
    Age
    24
    Posts
    1,364
    Blog Entries
    1

    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?
    |TGU Instructor|303rd TGSAD|ArmA Admin|
    |TG Pathfinder|

    DO YOU HAVE WHAT IT TAKES?

    Armis Exposcere Pacem


  6. #5
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

    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.





  7. #6

    Dredge's Avatar
    Join Date
    Oct 2009
    Location
    Keying Boons Car
    Age
    24
    Posts
    1,364
    Blog Entries
    1

    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.
    |TGU Instructor|303rd TGSAD|ArmA Admin|
    |TG Pathfinder|

    DO YOU HAVE WHAT IT TAKES?

    Armis Exposcere Pacem



  8.  
  9. #7
    Mikee's Avatar
    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    355

    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.


  10. #8
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

    Re: Script Question

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





  11. #9

    Dredge's Avatar
    Join Date
    Oct 2009
    Location
    Keying Boons Car
    Age
    24
    Posts
    1,364
    Blog Entries
    1

    Re: Script Question

    can we get clarification on that? is there away to check? without actually running the mission
    |TGU Instructor|303rd TGSAD|ArmA Admin|
    |TG Pathfinder|

    DO YOU HAVE WHAT IT TAKES?

    Armis Exposcere Pacem



  12.  
  13. #10
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

    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





  14. #11
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

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





  15. #12
    Fincuan's Avatar
    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    777

    Re: Script Question

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



  16.  
  17. #13
    Inkompetent's Avatar
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    820

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





  18. #14
    Fincuan's Avatar
    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    777

    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


  

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts