ID:163932
![]() Jul 26 2007, 7:34 pm
|
|
I have an NPC that gives you a rare item after going througha hard dungeon. The problem is, he will keep giving it to you even after you already recieved it. Any help?
|
Yeah, but the problem is that they keep dropping it everywhere.
IS there any way I can make the NPC 'ID' whoever had gained the item already? |
It would probably be better to make items gained from NPC's and the like non-droppable, you wouldn't want people getting items without talking to the NPC.
|
You could make a mob list to keep track of which quests they've completed. Then just check the list to see if they've completed the quest before giving them the reward item.
mob |
Ah. One more problem.
Now he says this. "Here's your prize! A portable radio! You already have the radio! stop talking to me!" Is there anyway to make him say that the 2nd time you talk to him? |
Look at the code.
Read the DM Guide. Your just asking "specific" questions, reading the DM Guide for 30 minutes would show you how to do that. |
Um. Well, i'm new at this. And I don't understand the guide. Actually, I don't even know where to look at the guide.
Right now, my code is like this. verb He will just say both lines together, and keep giving radios. |
It would be better to make a var and once you complete the questy the var becomes true, because if you drop it he will give it again, since it loops to see if its inside your inventory.
- Miran94 |
Ugh...This is getting ridiculous. The Byond guide isn't helping much either.
Anyone, can you tell me how to make him stop giving out radios? ;_; |
Let me dissect the snippet you have shown us:
verb If you read the comments, I mentioned how to fix your little problems (per say). |
Wow, I feel like everyone is totally ignoring my whole solution in [link].
|
Foomer wrote:
Wow, I feel like everyone is totally ignoring my whole solution in [link]. lol your solution would require him to integrate that into his game, he wants u to write the whole game code for him lol =P |
If you need help on checking if there is an item already in the inventory, then you can use locate() to determine if an object of a certain type is in a container. In this case, you want to check if an item is in the player's inventory. Therefore, you can do something like this:
However, if you foresee that the item may leave the player's inventory at any time, you will have to use other methods to prevent the player from getting it again after they used the item.