Making Quests Part 3 collecting objects
In this Tutorial we will make it possible to trigger an event when we've collected some items.
Imagine recieving a Quest from a NPC in the game. After accepting the Quest, let Kismet spawn some objects (or spawn triggers on top of the objects)
After we've collected the required amount of objects we get a reward. In this tutorial We will concentrate on collecting items and recieving a reward (It will be a sniperrifle in this tutorial). You can simple change the Kismet we're going to make by inserting UIscenes
(for more info read the tutorials:
Making Quests Part 1
Making Quests Part 2)
Let's start out by creating a simple level. I've used:
- 1 subtracted box (1024x1024x512)
- textures on the walls
- 1 PlayerStart
- 4 StaticMeshes inserted as InterpActors scattered across the floor
- 4 Triggers on top of each of the InterpActor (you can use toggleable triggers if you want to enable them through a Quest)
- 1 LightPoint
Now all we have to do is link everything together through Kismet.
All of the Kismet explained underneath is visible in this screenshot.
- Create a TriggerTouch object for each of the triggers (New Event using Trigger_x > Touch)
- Create a ToggleHidden obect for each of the triggers (Action > Toggle > ToggleHidden)
- Connect the triggers with the toggle objects (from touched to hide)
- Select 1 of the interpActors and asign it to the right ToggleHidden object by right-clicking on the square under "target" and select New Object Var using InterpActor_x. Do this for all of the InterpActors, each on it's own ToggleHidden object.
- Create 4 Modify ObjectList objects (for each of the ToggleHidden objects) (Action > ObjectList > Modify ObjectList)
- Connect each of the InterpActor Variables underneath the ToggleHidden objects with the ObjectRef square in each of the ModifyObjectLists
- Connect each of the ToggleHidden objects with 1 of the Modify ObjectList objects (Toggle Hidden "out" to ObjectList "add to list")
- Right-click one of the triangles underneath ObjectListVar in one of the Modify ObjectList objects, and select "Create New ObjectList Variable".
- Connect this variable with the three other Modify ObjectList objects in the same way (click and drag a line from the little triangle to the new variable)
- Create one new Int Variable underneath "List EntriesCount" and set it's "int value" to "0" (inside it's properties)
- Connect the Int Variable with the three other Modify ObjectList objects
- Create a new CompareInt object ( New Condision > Comparison > Compare Int)
- Connect the Int Variable with value "0" with the "A" block in the CompareInt object.
- Create a new IntVariable underneath "B" and set it's value to "3"
- Create a new GiveInventory object (Action > Pawn > Give Inventory) and set it's InventoryList to SniperRifle
- Create a new variable underneath Target (New Variable > Object > Player) and connect it with the target block.
- Connect A == B from the Compare Int object with the "in" from the GiveInventory object.
Save your game as something like DM-test (DM is needed to show weapons in the in-editor-game)
Have fun!





