Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Item Requirement

How can I make an item required to complete a quest?  For example, you are supposed to find a key by fighting enemies.  Until you have the key in your inventory, you cannot proceed in the quest.  The enemy would have a 10% chance of dropping said key.  Once you have the key, you must talk to someone who will take the key, and then allow you to proceed.
 
There are several ways to do that.
The most simple one would be to set the monsters up to have a 10% chance of dropping the item. (Database)
Than have whoever you talk to have a conditional branch in his event, wich checks if said item is in your posession.
If that's the case: Proceed
If not: Let him say something, about how you need that item.

Finished.

You could also use switches. But try this method first.
 
Well if you have it already It doesnt really matter if you get another one if you are on your way to the place to use the key.

I am reporting this as needs to be closed
 
True... Lets see...

Does anybody know how to make it so that monsters won't drop a specific item, if some requirements are met?
Wouldn't that need a script? Or am I just too tired to figure out?
 
Wouldn't work though, because when you give the key to the man it will be gone and monsters will start dropping it again...
Also I don't remember you can control which items monsters drop, except in the enemies database tab. And conditional branches won't work there...
 
You could also make it so that the monster encounter troop with the key-dropping monster has it set to invisible; do a branch check to see if you have the key or not, and if not, make the monster appear.
 
Set the enemy to not drop anything. When the guy gives you a quest, turn switch 1 on. Then in the enemy troop, have a condition "Switch 1 is on" and "Enemy HP is 0% or Lower" (the Span would be "Moment", I think). Then in the event, put "Gain Item: Key" and then turn Switch 1 off. There you have it, the enemy only gives you the key once.

If you want the enemy to have a chance of giving you the key, put this:
Code:
@>Set Variables [1] = Random 1...10
@>Conditional Branch: Variable [1] == 1
 : @>Gain Item: Key
 : @>Switch 1 = On
 : End

This'll make it so you have a 10% chance of getting the key. Change the values 1-10 to 1-20 for 5%, 1-25 for 4%, etc. to lower or raise the drop rate.
 
Regimos to the rescue!!!  Good call :)

Just a bit sloppy in the details, I think...

If the Switch 1 (let's call it "Key Quest") is used to show that you've started the quest, but haven't completed it, then you'll need another switch ("Need Key") to trigger your battle event. Then when you go back to the man, you check to see if Switch[001: Key Quest] is on, AND the party has a key in inventory to complete the quest.

Make sense?
 
Regimos, you rule!

It needs a genius to think so simple... Just add a message box, that tells you that you have the key. So the player will know he got it. Done.

Abyssal, that's the solution. Forget the crap I told you...Wel not completely, since it is needed to make it work in the end, but it's only part of it.

Regimos was the genius who solved it.

~Dalton~
 
...my way doesn't require any message boxes, you get the key after battle like normal, and you can always make the invisible monster a carbon copy of a different monster but with a different drop. It doesn't even require switches (unless you loose the key after using it).

Why is Regimos' invasive workaround so much better than my way?
 
You don't have to do several same monsters for it? And I find your solution more complicated? It has flaws. What if we wanted to use a troop that is rather big? We can't set infinite invisible monsters. So Regimos's solution is sure to work...

Why would you be angry because people like Regimos's idea better?
 
Hey, calm down peoples, Crazetex's solution is also good. It just depends which one the requester finds more useful. Both take less than a few minutes' time, and as you can have an infinite amount of switches, variables, and troops (you can go over the default amount using scripting), it hardly matters.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top