Objectives
From FleshWorks
by David
Intro
This tutorial will deal with making objectives. Objectives are a combination of Conversations and Trigger Scripts. We'll start with something simple, like stealing a goblet. First we need to give your map a "Conversation Package" - this is the group of conversations the level can use. You can assign more than one package to a map.
Steps
Note: by Ziemanskye
In order to make the conversations actually save, you need to add these lines to your user.ini file:
[Conversations] SchemaChangesAllowed=true
- From the View menu choose Level Properties. From there expand the bottom rung and choose LevelInfo > Conversation Package. If your mission is comprised of two maps called MyMap1.gmp and MyMap2.gmp then a good choice for a conversation package is MyMap.
- Now we need to create the objective conversation, so open the Conversation Browser (View > Conversations). Expand the PlayerGarrett node, right-click it and choose Add Conversation. Give the conversation a name - something simple like MyMapObjectives is good. Check the box Remain in First Person.
- Click the "Add Map" button and type the name you entered into the Conversation Package in #1 into the box at the top, and click Add Map. Select the new map and click Ok, it will now appear in the Usage listbox.
- Click the OK button and select your conversation which now appears under the PlayerGarrett section. In the right hand section right-click > Add > Goal.
- Enter a goal name, objStealGoblet would be good. Note this down as you will need it later.
- Ensure that Initial State is set to Pending and the other listbox is set to Objective.
- Enter some goal text, the player will see this when they start the mission. For now enter "Steal the goblet"
- Click Ok and then right-click Add > End to the same coversation.
- Click File > Save, File > Compile and File > Export Mission Objectives. If your objective shows up as only an empty tick box in the objectives list, try also File > Generate Schemas
- Close the Conversation Browser.
- Add a goblet of your choice to your map. These can be found in the Actor Class browser under WorldObj > InventoryObject > Loot.
- Open the goblet's properties and Scripts > TriggerScripts to the bottom rung. Expand the new node that appears and click "Add". Now click the "..." button. This will open the trigger script browser
- Create a new script and give it a name.
- Click the Condition button and choose
Frob > When I am frobbed by player.
- Click the Action button and choose
Goals > Set goal [String] to [Enum:eGoalState] and Click ok.
- Click [String] and enter the name of your objective, objStealGoblet.
- Now click [Enum:eGoalState] and change it to kGS_Success and click ok.
- Now we need to initialise the conversation when you start the map. Find the PlayerStart for your map and add a new trigger script.
- Choose the condition
Player > When player starts map, arriving from a different map.
- Choose the action
Conversations > Queue conversation [string] to play and click OK.
- Click [String] and enter the name of your objectives conversation, in this case MyMapObjectives.
- Click ok until you are back at the editor. Now save your map and give it a go, when you frob your goblet it should now do the standard "Objetive Complete" routine!
Back to Mission Design: Gameplay Tutorials Page
