this is my code:
obj/gold //define a "gold" prototype, which is a kind of obj
icon='gold.dmi' //set the default icon
var
amount //declare a new variable called "amount"
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.wealth += amount //add to usr.wealth
del(src) //delete the gold
drop()
set src in usr.contents
src.loc = locate(usr.x,usr.y,usr.z)
if(amount<=100)
icon_state="small"
if(amount>100 && amount<=1000)
icon_state="medium"
if(amount>1000)
icon_state="large"
the gold drops from NPCs, and I can pick it up, but there is no icon shown. How can I fix that?
ID:267156
![]() Dec 23 2002, 9:55 am
|
|
![]() Dec 23 2002, 9:56 am
|
|
There are no small, medium, or large icon_states.
|
Example..
<code> mob/Attack(mob/M as mob in oview(1)) world << "[M] dies!" M.drop(M.wealth) </code> At least, I think that's how it works.. Of course, this is only an example. :P |
well I have this code under each NPC that causes them to drop. Maybe it has to be modified to show the icon_states.
Del() var/obj/gold/G=new(loc) //create a new obj from the gold blueprint G.amount=rand(50,500) //set its amount variable randomly ..() //call the parent |