Code:Does the tree have to be turf or a mob so that i can have a verb that cuts the tree, and then the tree disappears?
Problem description:anyone have a code for that? or know where i can find it?
ID:162530
Dec 26 2007, 6:39 am
|
|
Dec 26 2007, 7:26 am
|
|
The code?
|
Couldnt be bothered to indent. This is basically it.
obj |
In response to Obs
|
|
i need to know if the tree must be a turf or a mob and whats the proc that deletes the tree if i make the verb for cutting it
i.e( verb Attack(mob/M as mob in oview(1)) usr << "you cut the tree!!!" world << "[usr] cut the tree!" instead of "attack" its "cut tree"..what do i put in the () after cut tree. do i have to have the tree as a mob or a turf? |
In response to Scizzees
|
|
Scizzees wrote:
Couldnt be bothered to indent. This is basically it. > obj thnks scizzees |
In response to Iraqii
|
|
lol indentation error i have this
obj tree name="Tree" icon='tree.dmi' verb Cut_Tree() set src in oview(1) usr<<"You cut the [src]" del(src) wheres the indentation error? |
In response to Iraqii
|
|
look at cut proc
|
In response to Iraqii
|
|
proc lifecheck() if(life <= 50) usr << "You cut the [src]!" del(src) verb Cut_Tree() set src in oview(1) var/life = 50 usr << "You strike at the [src] usr << "The [src] will live for [life] more cuts." lifecheck() |
In response to Iraqii
|
|
You have a indentation error because I used space instead of tab.
|
In response to Iraqii
|
|
so should i just type it in again?
|
In response to Iraqii
|
|
Yeah, but use tabs. <_<
|
In response to Iraqii
|
|
whenever im near anything(bug or tree) the command cut tree is still there...how do i make it so that it only works with trees not with bugs?
proc lifecheck() var/life = 50 if (life <= 0) usr << "You cut the [src] down!" del(src) verb Cut_Tree() set src in oview(1) usr << "You strike at the tree!" var/life = 50 var/damage = rand(1,10) life -= damage usr << " The tree will live [life] life points longer." lifecheck() |
In response to Iraqii
|
|
and also whenever i cut tree, a message says the life will live 46 points longer...and then another one comes up again except a different number...it doesnt make sense. it does life-damage= again and again
|
In response to Iraqii
|
|
That's because you define var/life within the verb. Each time you run the verb, a variable life is defined to be fifty, and then you subtract 1 to 10 from it. Each time you run the verb, you do it again. And again. And again. The life variable has to be defined under obj/tree, not in the verb.
|
In response to Iraqii
|
|
life(50)-damage(1-10 random)
|