Counting mobs kills and creating quest around it

+
Counting mobs kills and creating quest around it

Hey again :)
so i wanted to create quest where You need to kil x monstera but i dont know how to attack this problem. Should i create templete with encounter area or smth ? PLs help i'm Lost with this (Also is similar problem i would like to progress quest when You Puck something or interact with smth is there a way(probably is) to track this from quest ?
 
I'm writing o phone and cant find edit button. Exactly i have encounter i spawn enemies but i dont know hot to create objective to make 0/5 killed and track those kills. Is there are some global variables or Maybe a way to watch encounter area for kills ?
 
Berail;n9174621 said:
I'm writing o phone and cant find edit button.

Sorry that I can't help you with the actual issue, but try turning your phone sideways. You should then see the "edit" option.
 
Hi,
I went through almost all original witcher 2 quest logs to see, if there is "counting" as you describe, but didn't find anything.
Only thing that was injected to quest short TODOs were key bindings, but I am not sure where are they loaded from.

But it is still possible to count for some actions, e.g. killing monsters.
There are two approaches that I know.

You can spawn monsters by encounter area or community.
As I understand it, encounter area spawns its entities automatically at the start of the game, so it servers more like to "spawn all non important monsters, which will spawn and respawn all the time not depending on story or quests state".
With community you have better control about what you want to spawn, despawn, if you want to respawn, and so on. It enables you to spawn monsters to kill only at certain moment of quest.
So for this kind of quest, it may be better to use community.

Anyway:
1 - a) area environment solution
Open monster entity you are spawning and add tag to it.
1 - b) community solution
Open monster entity you are spawning and add tag to it OR
define "entity spawn tag" in community definition. It disables all tags from entity template and sets only tag(s) specified here - it may be good in some situations.

2 - for both 1 solutions)
In quest file, create condition block by right clicking to blank space and selecting flow control - pause, or condition.
Condition processes instantly and returns true/false, pause waits till condition is true.

You can use CquestFightCondition and specify:
tag - entity template tag
reference value - how many entities with tag should be "damage mode"
damage mode - list of actions, eg. killed, aarded, and so on...

or CquestActorCondition:
actor tag - tag of entity template
check type - e.g. is killed,...

CquestFightCondition is probably meant for many entities, while CquestActorCondition is probably only for only single one.

You could also store value of killed to factsDb, for other quests, but i will not mention it now.

3) Rendering
As I mentioned above, I think it is not possible to render value, e.g. from factsDb to quest log short TODO.,
but as brute force, you can create many quest phases and track them for each unit or unit sequence kill.
 
Thanks i found those 2 scripts but didn't know how to use it :) You helped me a lot :) Also today also i found original witcher 2 files but didn't dig to much yet in there but found couple interesting solutions to other my problems :) But REALLY THANK YOU MY SAVIOR !! :D

Also do i need to add facts via quests or is there a file i can add them ? (i understand that facts are global variables ?)
 
Last edited:
Yes, facts are like global variables, but i dont know, if they can be predefined from file.
As brute force, you can add them to factsdb at the start of the game,
or better, dont add them, assume default quest flow and in conditions look if the fact exists and its value.
 
Ok last question because you are helpful :) To make item interactible i need to add interactible component right ? And to loot something from it like Puck up coin from body i need to add other component ? And if i want to jus serach body and get quest updated is there a script that track this interactivity (i found that there is that script but i have hard time to use it), Also is there a file with every item i can loot ? or i can just write "coin" and it will pick up coin item and i will can check if player have this item.
 
Last edited:
Hi,
I tried something like this, but was unable to make it work.

If you want to loot npc, add desired items in inventory tab of entity template and when it dies (or i think flees from combat), it will spawn lootable bag.
You can define probabilites, count and such in entity template inventory tab.

Also, there are loot tables for chests. Basically set of items, again with probabilities and count, just to make it easier to manage and add to multiple chests in game.
I haven't tried this, so I dont know exact setup.

To make "random" thing interactible, you can use CInteractionComponent in entity template.
I was not able to make this work either.
There are sections as actionName, and report to script; and I know, there is interaction condition in quest condition block.
Try to experiment, and if you make it work, there is block "reward player" in quest file. Set it to item and it should work.

EDIT:
If the interaction quests starts, you know that the item is being looted.
 
Last edited:
Thanks for Your help will try it. About items i found some quests from main game where you could take troll head and there is just name there anD i was thinking it is a physical item name or just imaginary id. Will try you advices Thanks again :)
 
Top Bottom