forge
icon = 'house_furniture.dmi'
icon_state = "forge"
name = "Forge"
density = 1
verb
Smelt()
set src in oview(1)
var/obj/tin = locate(/obj/tin) in usr.contents
if(tin)
usr << "You begin to smelt."
sleep(25)
if (prob(50))
usr << "You found something!"
sleep(5)
usr << "You smelted your tin ore to a bar!"
usr.contents+=new/obj/tinbar
usr.contents-=/obj/tin
else
usr << "You ruined your ore."
usr.contents-=/obj/tin
else
usr << "You have no ore."
tinbar
icon = 'tin bar.dmi'
What i am doing here is just getting a basic smelting code befoere i start with exp etc. But i am running into a problem. If the Ore is ruined or if its even smelted into a bar the ore isnt taken from the inventory why.
ID:148228
![]() May 18 2003, 8:16 am
|
|
![]() May 18 2003, 8:18 am
|
|
Instead of usr.contents -= /obj/tin try del(tin).
|
First, close your tags. Second, when posting code on the forum, put <DM> before the code, and </DM> after it. Third, everything after <code>usr << "You begin to smelt."</code> and before the tinbar line should be indented so that it's inside that if() block, or you will get errors if they don't have any tin. Fourth, the <code>usr << "You found something!"</code> is entirely out of place. You don't find things when you smelt ore. Just take it out. And fifth, it should be <code>del(tin)</code> instead of <code>usr.contents-=/obj/tin</code>. You should also change <code>usr.contents+=new/obj/tinbar</code> to <code>new /obj/tinbar(usr)</code>. It looks prettier.
|
Cloud54367 wrote:
usr << "You smelted your tin ore to a bar!" http://dictionary.reference.com/search?q=ingot Just thought I'd help out. :) ~>Volte |