statpanel("inventory",src.contents)
but how do u set the obj to src.contents:
obj
foodicon
icon = 'inventory.dmi'
name = "Food"
icon_state = "food"
ID:176273
![]() Jan 31 2003, 11:10 am
|
|
its not an item you can pickup/drop, its the usrs food(usr:food) like in a var. they start out with 2 food. therefor, there should be 2 icons in the inventory. How would i do that?heres the mob code:
mob PC icon = 'player.dmi' Stat() statpanel("Character",) stat("Name: ",usr.name) stat("Gender: ",usr.gender) stat("Gold: ",usr:gold) stat("Food: ",usr:food) stat("Water: ",usr:water) statpanel("Inventory",src.contents) if(usr:pet1==1) statpanel("Pet",) stat("Name: ",usr:pet1name) stat("Gender: ",usr:pet1gender) stat("Condition: ",usr:pet1con) stat("Hunger: ",usr:pet1hun) var gold = 100 food = 2 water = 1 pet1 = 0 pet1name pet1gender pet pet1con = "Fine" pet1connum = 0 pet1hun = "Full" pet1hunnum = 0 pet1ths = "Ok" pet1thsnum = 0 |
hold on, you mean like:
if("Little Boy") character = new /mob/LittleBoy() var/obj/foodicon/foodicon/ = new(usr) like that? warning: variable defined but not used..... |
KitKate20 wrote:
its not an item you can pickup/drop, its the usrs food(usr:food) like in a var. they start out with 2 food. therefor, there should be 2 icons in the inventory. How would i do that?heres the mob code: I'm not quite sure what you mean by that, but if it is what I *think* you mean, I guess you could try this: obj/Foodobj icon = 'food.dmi' name = "Food" Click() if(usr.food > 0) usr << "Mmm, that was tasty!" usr.food-- else usr << "You don't have anymore food!" var/obj/Foodobj/FoodClickable = new Stat() statpanel("Character",) stat("Name: ",usr.name) stat("Gender: ",usr.gender) stat("Gold: ",usr:gold) stat("Food: ",usr:food) stat("Water: ",usr:water) statpanel("Inventory",src.contents) stat("----FOOD----") var/F = usr.food while(F) stat(FoodClickable) F-- if(usr:pet1==1) statpanel("Pet",) stat("Name: ",usr:pet1name) stat("Gender: ",usr:pet1gender) stat("Condition: ",usr:pet1con) stat("Hunger: ",usr:pet1hun) |
foodicon
icon = 'inventory.dmi'
name = "Food"
icon_state = "food"
verb/Pick_Up()
usr << "You pick up the [src]."
Move(usr)
It explains this in my RPGtutorial, I suggest you download this and it should answer many of your questions about that kind of stuff.