Quest to kill with particular weapon

Announcements, support questions, and discussion for Quest Machine.
Post Reply
One8Legend
Posts: 2
Joined: Thu Nov 02, 2023 6:18 am

Quest to kill with particular weapon

Post by One8Legend »

Hey Tony, i have wrote a quest to kill the enemies with particular weapon after equipping it, Equipping is also a part of the quest, it's working fine until Equipping and, when it comes to killing, the quest is also getting successful if i kill the enemies with another weapon, but i only want to Kill enemies through the Equipped weapon i mentioned in the quest, is there any way for that through Quest machine itself or i need to hard code to get the weapon name on kill count.

a quick reply will really help


i'm using Unity 2022.3.4f1,
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest to kill with particular weapon

Post by Tony Li »

Hi,

You'll need to write some code or otherwise configure your game to send a specific message when the player kills the enemy with a particular weapon.

For example, say the quest node requires the player to use the Fire Sword to kill the Ice Elemental.

You could set the quest node's Conditions to listen for "Used Fire Sword To Kill" + "Ice Elemental". Then configure your fire sword to send the message "Used Fire Sword To Kill" + <enemy-name> when the player uses it to kill something.

If you have a similar question for equipping, you could configure the fire sword to send the message "Equipped" + "Fire Sword". Or, more generally, configure your inventory system to send the message "Equipped" + <weapon-name". Then set the quest node's Conditions to listen for "Equipped" + "Fire Sword".
Post Reply