Well for my game i want to have quests so that you can speak to npc and he will check if you have the item. And if you do have the item he gives you a reward, and if you dont he says go get them.
And well i need help making the part about the npc checking for the number of the item and taking the item if you have it. If anyone knows how i could do this please help it would be much apreciated.
ps
The item i want him to check for is: obj/DemonWings
And the number they need is: 10
thanks for reading this,
Setox
ID:162531
Dec 26 2007, 5:34 am
|
|
In response to DivineO'peanut
|
|
Thanks alot ^^ my quest is done now.
|
In response to Setox
|
|
The item checking is working, but i dont know how to make it take the items away. By the way what are the dm tags soi can so you what i have done and show you what errors i have
|
In response to Setox
|
|
proc/getOfType(var/source, var/type) Then, to delete them: var/list/L = getOfType(src, /obj/item/batwing) |
In response to Garthor
|
|
I now have 2 errors
proc/getOfType(var/source, var/type) the errors i know have are: error:isatom:undefined proc error:islist:undefined proc please help. |
In response to Setox
|
|
I think those are just shortcuts Garthor used to check if <code>source</code> is an atom or a list.
|
In response to DivineO'peanut
|
|
So i can get rid of it?. By the way thanks for replying. ^^
|
In response to DivineO'peanut
|
|
I'd guess #defines he's been using so long he forgot they aren't part of the software :)
#define islist(l) istype(l, /list) Put that at the top of your .dm file and it should work. |
In response to Flick
|
|
Thanks i know have no errors but he dosnt take the wings this is what i have done.
mob/wingermerchant That is what i have done for for the npc quest guy code no errors but for some wierd reason he dont take the demon wings. |
In response to Setox
|
|
In your finish_quest verb, you call the 'getOfType' verb with an argument of 'src'. The src in this case is the wingermerchant since the verb finish_quest actually belongs to him. The person using the verb would be the person you want to get the wings from. That would be 'usr'.
|
In response to Flick
|
|
I changes src to usr i still seem to have the same problem. This is what i now done. I have no errors though
mob/wingermerchant What do? i apreciate what you have told me so far.^.^ |
In response to Flick
|
|
Actually, I just made them up and forgot to look up if they were actually one of the istype()s. Strangely enough, islist() was used in the reference (under IsBanned()) but wasn't actually listed as a proc. The 4.0 reference changed it to istype(., /list) though.
|
In response to Garthor
|
|
Oh lol. Anyway how do i change
for(var/obj/DemonWings/w in usr.contents) So that it only deleted 10 of them? Thanks for reading this |
In response to Setox
|
|
for(var/v = 1 to 10) |
In response to Garthor
|
|
Yay! Thanks everyone my quest is now done.
B |
You can use this proc to do this, where 'source' is the location you're seeking [type] in. E.g.