Jump to content

XML code - quests - Not giving kill credits


BFT2020

Recommended Posts

So I been trying to figure out what I am doing wrong here and afraid I am missing something obvious:

 

This code makes a quest to kill 4 different types of animals to get two of the hunting perk books as a reward when you turn it in to the trader

        <quest id="quest_Hunter_pt2">
            <property name="name" value="Hunter - Hostile game"/>
            <property name="subtitle" value="Hostile Animals"/>
            <property name="description" value="Kill them before they kill you."/>
            <property name="icon" value="ui_game_symbol_armor_leather"/>
            <property name="shareable" value="false"/>
            <property name="category" value="Challenge"/>
            <property name="difficulty" value="hard"/>
            <property name="completiontype" value="TurnIn"/>

            <objective type="AnimalKill" id="animalSnake" value="10" phase="1"/>            
            <objective type="AnimalKill" id="animalBoar" value="10" phase="1"/>
            <objective type="AnimalKill" id="animalCoyote" value="10" phase="1"/>
            <objective type="AnimalKill" id="animalWolf" value="10" phase="1"/>


            <objective type="InteractWithNPC">
                <property name="phase" value="2"/>
            </objective>

            <reward type="Item" id="bookHuntingJournalCoyotes" value="1"/>
            <reward type="Item" id="bookHuntingJournalWolves" value="1"/>
        </quest>

 

The specific issue I am seeing is with the snakes.  I kill snakes in the game, but the count stays at 0/10.  For the other animals on the list, they increase by 1 every time I kill one of them and I get the green checkmark once I reach 10.  I got 3 other hunter quests that have no issues as far as I can tell (one of the easiest ones is to kill rabbits, chickens, and stags/does and I see the count increasing for all 3 types and got the books once I completed it).

 

There are zero errors from the quest file when it gets overridden by my mod, and I don't get any errors  or warnings when I kill a snake in game.  For some reason, the game is not advancing the kill count for snakes.  I even compared the snake entity with the wolf entity in entityclasses to see if I noticed something obviously different between the two to account for the wolves count advancing while the snakes count does not.

 

Any help or insight would be appreciated.  I also don't mind canceling the quest and giving me a new one to try different ideas or suggestions.

 

Thanks

 

(p.s. - The Interact works fine as the traders are currently the only NPCs in the game, but realize I might have to update that part of the code for future development versions / final game).

Link to comment
Share on other sites

I'm not sure why... I've tried several things now that would usually be the culprit such as entity type and what not on the actual snake. But nothing works. I did get it to work using the zombiekill objective though. Possibly something hardcoded in the actual class of the snake as it uses something different than others.

 


			<objective type="ZombieKill" id="animalSnake" value="10" phase="1"/>
            <objective type="AnimalKill" id="animalBoar" value="10" phase="1"/>
            <objective type="AnimalKill" id="animalCoyote" value="10" phase="1"/>
            <objective type="AnimalKill" id="animalWolf" value="10" phase="1"/>



This works. With proof:

A Dead Snake

Link to comment
Share on other sites

I just looked in the code. @Telric You were on exactly the right track with "ZombieKill" vs. "AnimalKill".

 

The kills are handled by the QuestEventManager.EntityKilled method. That method fires of one of two events:

  1. If the entity class descends from EntityZombie, EntityZombieDog, or EntityVulture, then it calls the ZombieKilled method.
  2. Otherwise, if the entity class descends from EntityAnimal or EntityEnemyAnimal (other than EntityZombieDog) , it calls the AnimalKilled method.

But, snakes - for whatever reason - have a class that descends from EntityZombie. All the other animals use either the EnitityEnemyAnimal class (bears, wolves, coyotes, boars) or the EntityAnimal class (rabbits, chickens, deer).

 

So you have to use the "ZombieKill" objective with snakes, vultures and zombie dogs - the "AnimalKill" objective won't work with those. On the other hand, you have to use the "AnimalKill" objective with zombie bears too.

Link to comment
Share on other sites

Thanks for the assistance.  I made the change and restarted the quest.  Spawn in a snake and killing it advanced the counter by one.

 

The weird thing is, the first thing I tried when it wasn't working was changing AnimalKill to ZombieKill.  I know I made that change, but now wondering if I forgot to save the file when I made the change in Notepad++ therefor the file itself was never updated and applied.

Link to comment
Share on other sites

On 7/25/2022 at 11:45 PM, khzmusik said:

So you have to use the "ZombieKill" objective with snakes, vultures and zombie dogs - the "AnimalKill" objective won't work with those. On the other hand, you have to use the "AnimalKill" objective with zombie bears too.

 

I found that one out by accident

 

            <objective type="ZombieKill" id="animalZombieDog" value="10" phase="1"/>    
            <objective type="ZombieKill" id="animalZombieVulture,animalZombieVultureRadiated" value="50" phase="1"/>
            <objective type="AnimalKill" id="animalZombieBear" value="3" phase="1"/>

 

A previous version of my quest just had the survivor killing bears with a specific weapon.  I had AnimalKill and listed both bear entities for the id.  Noticed that it worked and been using AnimalKill for Zombie bears since.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...