ID:150432
Sep 25 2001, 1:48 pm
|
|
OK, i need to make my verb only accesible if the usr has a few certain obj's in thier inventory, but it wont let me, when i use usr.contents it tells me iether bad var or if i make a list after it it tells me bad proc, can anyone tell me how to do this?
|
In response to FIREking
|
|
Or if you prefer to avoid countless variables in your code, you could search contents after each get operation. This will take a few eaxtra nanoseconds when you get something, but frees up memory and makes smaller save files. It's also not as prone to errors caused by forgetting to flag a variable.
var/list/McBiggun_ingredients = list(/obj/all_beef_patty, /obj/special_sauce, /obj/lettuce, /obj/cheese, /obj/pickle, /obj/onion, /obj/sesame_seed_bun) You'll want to make sure to remove the verb if they drop or use up an ingredient. In the McBiggun() proc, you should remove the objects and see if they still have enough for another McBiggun. Also, don't forget to ask if they want fries with that ;) |
for each object, make a proc check some variables, those variables will be variables that are equal to 1 when you get the items you need, when the person gets all the objects he or she needs, and that proc is called, and all the variables equal 1, then you can add the verb like this
mob
proc
something()
src << "You got this new verb!"
verb
getnewverb()
src.verbs += /mob/proc/something()
--FIREking