ID:139234
 
Code:
obj/Buildables
fountain
icon = 'buildables.dmi'
icon_state = "Fountain"
layer = 2
density = 1
Bush
icon = 'land.dmi'
icon_state = "Bush"
layer = 2
density = 1
tree
icon = 'land.dmi'
icon_state = "Palm tree"
layer = 2
density = 1
verb
cut()
set category="Commands"
set src in oview(2)
view(2) << "You cut the tree!"





obj
wood
icon = 'wood.dmi'
icon_state = "wood"
verb
make_wall()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Wall"
get()
set src in oview(1)
src.Move(usr)
make_floor()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Floor"
make_door()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Door"


Problem description:I am a newbie at coding and ive been trying to make a code so that when i press cut the tree turns into wood but im stuck i have no idea what to put in this ive searched around and cant find any tuts or helps or anything about this please can someone tell me what i am doing wrong/what i should put in??? *just copy code and revise it to fix mistakes then point out my mistakes*thank you if you help or not

Shwb1 wrote:
Code:
> obj/Buildables
> fountain
> icon = 'buildables.dmi'
> icon_state = "Fountain"
> layer = 2
> density = 1
> Bush
> icon = 'land.dmi'
> icon_state = "Bush"
> layer = 2
> density = 1
> tree
> icon = 'land.dmi'
> icon_state = "Palm tree"
> layer = 2
> density = 1
> verb
> cut()
> set category="Commands"
> set src in oview(2)
> view(2) << "You cut the tree!"
>
>
>
>
>
> obj
> wood
> icon = 'wood.dmi'
> icon_state = "wood"
> verb
> make_wall()
> set src in usr
> src.Move(usr.loc)
> icon = 'Buildables.dmi'
> icon_state = "Wall"
> get()
> set src in oview(1)
> src.Move(usr)
> make_floor()
> set src in usr
> src.Move(usr.loc)
> icon = 'Buildables.dmi'
> icon_state = "Floor"
> make_door()
> set src in usr
> src.Move(usr.loc)
> icon = 'Buildables.dmi'
> icon_state = "Door"
>

Problem description:I am a newbie at coding and ive been trying to make a code so that when i press cut the tree turns into wood but im stuck i have no idea what to put in this ive searched around and cant find any tuts or helps or anything about this please can someone tell me what i am doing wrong/what i should put in??? *just copy code and revise it to fix mistakes then point out my mistakes*thank you if you help or not

also im trying to make it so you can only cut it down with axe so if you could do the same and tell me what i need to fix?
obj
axe
icon = 'wood.dmi'
icon_state = "axe"


please tell me what im doing wrong thank you again for helping me / not
In response to Shwb1
obj/Buildables
fountain
icon = 'buildables.dmi'
icon_state = "Fountain"
layer = 2
density = 1
Bush
icon = 'land.dmi'
icon_state = "Bush"
layer = 2
density = 1
tree
icon = 'land.dmi'
icon_state = "Palm tree"
layer = 2
density = 1
verb
cut()
var/obj/axe = locate(/obj/axe) in usr.contents
if(axe)
set category="Commands"
set src in oview(2)
view(2) << "You cut the tree!"
new/obj/wood(usr)
else
usr<<"You need an axe to cut this tree!"





obj
wood
icon = 'wood.dmi'
icon_state = "wood"
verb
make_wall()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Wall"
get()
set src in oview(1)
src.Move(usr)
make_floor()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Floor"
make_door()
set src in usr
src.Move(usr.loc)
icon = 'Buildables.dmi'
icon_state = "Door"

obj
axe
icon = 'wood.dmi'
icon_state = "axe"


That should fix it? You seem to switch around with the src and usr vars alot, so I just used "usr" for the verb.
In response to Shaoni
omfg thanks ima re-read it a few times to make sure that i dont make the same mistake problem with it the first time was i had no idea how to make wood appear - axe problem THANKS!!!
In response to Shaoni
btw like i said im a newbie so if you could possible tell me how to make thing wait like is it just wait(time)?? i wanna make it say You start cutting the tree wait(10) you cut the tree!

well thanks again for the help!
In response to Shwb1
try this where you want it to show up,

src << "You start chopping the tree"
sleep(20)
src << "You chopped the tree down"