This tutorial presents how to create a nekker encounter zone that ceases to spawn monsters when you destroy their nest with a grapeshot bomb. Mechanically, it is quite simple.
This tutorial again requires the Geralt spawning tutorial to be done first. Also you should know how to make Encounters, as I won't go into deep detail with this.
1. Open the Asset Browser and search for the "neccer_nest" entity template. Place it into your world and change in the properties:
2. Create a encounter zone around the nest and the closer area. Add at least one monster type (as example, game\gameplay\monsters\nekker\nekker.w2ent) and change:
3. Now create a trigger area around everything. Right click on the ground and click Gameplay -> Add Trigger Area. Change:
Your location should look similar to this now:
The trigger area can be bigger, depending on your map layout. It should be bigger than your encounter zone, though. Just in case.
4. Now open your quest file from the Geralt spawning tutorial. Add the following three elements:
- Flow control -> Pause, change:
- Flow control -> Condition, change:
- Scripting -> Script, change:
5. Now connect everything like on the image below:
From START to our PAUSE object IN, from the PAUSE object to our CONDITION IN, from the CONDITION TRUE to our SCRIPT IN and from our CONDITION FALSE back to PAUSE IN, so we created a loop until the condition is set to true.
That's it. If you now enter the encounter zone, monsters will be spawned. As soon as you destroy the nekker nest, a fact will be added / set to 1, if the player walks into the trigger, we are checking if the fact is 0 or 1. If it is 1, we disable the encounter zone and no new monsters will spawn. You can add as many nekker nests as you wish, you just have to change the numbers and tags accordingly. Also keep in mind, that you can only destroy nekker nests with a grapeshot bomb, if you have deeper knowledge about nekkers. That means, you either have to kill around 10 nekkers first or you need to read the book about nekkers to learn that you can kill them with the grapeshot bomb.
Knowledge about monsters: Geralt's knowledge about monsters (that allows him to destroy nests as described above) can be managed by adding facts to the database. To skip condition of killing 10 nekkers/reading about them in-game, use FactsDB Change quest block with "Knowledge_5_2" entered as a factID and "1" as a value.
ALTERNATIVE (original, in-game) WAY
1. Create a nekker nest as described above and tag it (e.g. "nekker_nest01");
Point 2. stays the same. Skip point 3. (creating trigger area).
4. Open quest file and add the following elements:
- Flow control -> Pause, change:
- Flow control -> Condition, change:
- Flow control -> Pause, change:
- Scripting -> Script, change:
5. Now connect everything as follows:
From START to (Interaction) PAUSE block IN, from (Interaction) PAUSE block to CONDITION block IN, from CONDITION block FALSE back to (Interaction) PAUSE block IN and from TRUE to (FactsDB) PAUSE block IN, from (FactsDB) PAUSE block to SCRIPT block IN.
This tutorial again requires the Geralt spawning tutorial to be done first. Also you should know how to make Encounters, as I won't go into deep detail with this.
1. Open the Asset Browser and search for the "neccer_nest" entity template. Place it into your world and change in the properties:
- nestNumber = 1
2. Create a encounter zone around the nest and the closer area. Add at least one monster type (as example, game\gameplay\monsters\nekker\nekker.w2ent) and change:
- CNode / tags = "nekker_nest_guardians01"
3. Now create a trigger area around everything. Right click on the ground and click Gameplay -> Add Trigger Area. Change:
- CNode / tags = "nekker_nest01_trigger"
Your location should look similar to this now:
The trigger area can be bigger, depending on your map layout. It should be bigger than your encounter zone, though. Just in case.
4. Now open your quest file from the Geralt spawning tutorial. Add the following three elements:
- Flow control -> Pause, change:
- Add a new condition, "CQuestInsideTriggerCondition"
- tag = "nekker_nest01_trigger", which is our trigger area.
- Flow control -> Condition, change:
- questCondition = "CQuestFactsDBCondition" and then:
- factId = "nekker_nest_1_destroyed" - the 1 is our nestNumber from our placed neccer_nest entity template. If your nestNumber is 2, then you have to write "nekker_nest_2_destroyed", etc.
- queryFact = "QF_Sum"
- value = "1"
- compareFunc = "CF_Equal"
- Scripting -> Script, change:
- functionName = "QEnableEncounters" and:
- encounterTag = "nekker_nest_guardians01", which is our encounter area.
- enable = "false"
5. Now connect everything like on the image below:
From START to our PAUSE object IN, from the PAUSE object to our CONDITION IN, from the CONDITION TRUE to our SCRIPT IN and from our CONDITION FALSE back to PAUSE IN, so we created a loop until the condition is set to true.
That's it. If you now enter the encounter zone, monsters will be spawned. As soon as you destroy the nekker nest, a fact will be added / set to 1, if the player walks into the trigger, we are checking if the fact is 0 or 1. If it is 1, we disable the encounter zone and no new monsters will spawn. You can add as many nekker nests as you wish, you just have to change the numbers and tags accordingly. Also keep in mind, that you can only destroy nekker nests with a grapeshot bomb, if you have deeper knowledge about nekkers. That means, you either have to kill around 10 nekkers first or you need to read the book about nekkers to learn that you can kill them with the grapeshot bomb.
Knowledge about monsters: Geralt's knowledge about monsters (that allows him to destroy nests as described above) can be managed by adding facts to the database. To skip condition of killing 10 nekkers/reading about them in-game, use FactsDB Change quest block with "Knowledge_5_2" entered as a factID and "1" as a value.
ALTERNATIVE (original, in-game) WAY
1. Create a nekker nest as described above and tag it (e.g. "nekker_nest01");
Point 2. stays the same. Skip point 3. (creating trigger area).
4. Open quest file and add the following elements:
- Flow control -> Pause, change:
- Add a new condition, "CQuestInteractionCondition"
- interactionName = "destroy_nest_interaction", which is a default name of Interaction Component from "neccer_nest" entity template.
- ownerTags = "nekker_nest01", which is a tag of our nekker nest.
- Flow control -> Condition, change:
- questCondition = "CQuestActorCondition" and then:
- actorTag = "PLAYER"
- checkType = "CQCHasItem"
- item = "Grapeshot"
- quantity = "1"
- presenceFlag = "true"
- Flow control -> Pause, change:
- questCondition = "CQuestFactsDBCondition" and then:
- factId = "nekker_nest_1_destroyed" - the 1 is our nestNumber from our placed neccer_nest entity template. If your nestNumber is 2, then you have to write "nekker_nest_2_destroyed", etc.
- queryFact = "QF_Sum"
- value = "1"
- compareFunc = "CF_Equal"
- Scripting -> Script, change:
- functionName = "QEnableEncounters" and:
- encounterTag = "nekker_nest_guardians01", which is our encounter area.
- enable = "false"
5. Now connect everything as follows:
From START to (Interaction) PAUSE block IN, from (Interaction) PAUSE block to CONDITION block IN, from CONDITION block FALSE back to (Interaction) PAUSE block IN and from TRUE to (FactsDB) PAUSE block IN, from (FactsDB) PAUSE block to SCRIPT block IN.