How do I get a obj to have vars? for instance;
obj
mushroom
quantity=2
ID:267031
![]() Oct 22 2002, 10:04 pm
|
|
Argh, damnit.
Another question, how do i make the user activate a proc when he picks it... for instance; obj Marijuana name="Marijuana Plant" icon='turfs.dmi' icon_state="mary" var/quantity=12 verb Pick() set category="Pick" set src in oview(1) src:QuantityCheck() src.quantity-=1 usr.mary+=1 but it doesn't work. |
To add a bit to the current answer, you can also setup "parent" vars that will be carried over to the "children" datums, example:
obj |
It really depends on how you have the proc defined, if you don't see it from my other post this should help:
obj That will call the parent's "someproc" for the child's variables and/or settings, depends on how you have it set up. |
Not exactly what i was looking for, examine;
mob/proc QuantityCheck() if(src.quantity<=0) src.quantity=0 usr<<"There is no more [src]" obj Marijuana name="Marijuana Plant" icon='turfs.dmi' icon_state="mary" var/quantity=2 verb Pick() set category="Pick" set src in oview(1) if(src.quantity<=0) usr<<"There is no more leaves on this plant." else src.quantity-=1 usr.mary+=1 I've set up a temporary if statement for the time being, just to see if the proc would run correctly and apparently it should.. i'd rather have a universal proc for objs instead of rewriting the if command over and over. |
Your best bet would probably be something like:
mob OR obj And, call it like you were trying to call it in your previous code. |
var/IM_A_VAR = "Hi!"