Home   Help Search Login Register  

Author Topic: Multi tasking  (Read 864 times)

0 Members and 1 Guest are viewing this topic.

Offline Blacknite

  • Members
  • *
  • Chiefs runs the navy!
Multi tasking
« on: 09 Jun 2007, 21:39:57 »
I am going to start working on a new mission, but I need some more info to do it.  What I want is the player to go to see somebody, and they will tell him to do something and come back, when they do that and come back, how do I make them give another task or something?

For an example:

Player comes up to Bob, and they talked and player left but comes back, how do I make them talk again on a different subject?

And to better yet, if Bob gives player an assignment, but player comes back without completing it, how do I make Bob either repeat the assignment or say something else?

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Multi tasking
« Reply #1 on: 09 Jun 2007, 22:33:22 »
Here's one way....

In the init.sqs, initialize these global variables:

Code: [Select]
gTask1Complete = false;
gTask1AssignmentComplete = false;
gTask2Complete = false;
gTask2AssignmentComplete = false;

Then define these triggers via the editor:

First trigger for when player talks to Bob to get assignment:

- Condition:  (player distance Bob) <= 4 && NOT gTask1Complete && NOT gTask1AssignmentComplete

Execute script from here for conversation where Bob assigns task to player.  At end of this script you will
set gTask1AssignmentComplete = TRUE.   That gurantees the first trigger will only be true once, so task 1 assignment only happens once.

Second trigger for when player returns to Bob without completing first assignment:

- Condition:  (player distance Bob) <= 4 && NOT gTask1Complete && gTask1AssignmentComplete

Execute script where Bob scolds player for not completing his first assigned task.

Third trigger for when player returns to Bob after completing first assignment:

This trigger assumes that when Bob completes his first assignment, you have another trigger or script that will set
gTask1Complete = TRUE. 

- Condtion:  (player distance Bob) <= 4 && gTask1Complete && NOT gTask2AssignmentComplete && NOT gTask2Complete

Execute script where Bob praises player for completion of first task, and gives player a second task.  At end of this script you will set gTask2AssignmentComplete = TRUE. 

Fourth trigger for when player returns to Bob without completing second assignment:

- Condtion:  (player distance Bob) <= 4 && gTask1Complete && gTask2AssignmentComplete && NOT gTask2Complete

Execute script where Bob scolds player for NOT completing second task.

Etc....


« Last Edit: 09 Jun 2007, 22:36:40 by johnnyboy »
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...