ID:147074
 
ok my code looks like this:

turf
grass
icon = 'grass.dmi'
world
turf = /turf/grass

mob
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!

verb
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]"
var
HP = 30 //declares a new variable called HP, with a value of 30
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M

the problem is the var for the Hp of thirty says theirs a problem. It also says that theirs a problem with the line before last. any help?
Jasucus wrote:
ok my code looks like this:
 turf
grass
icon = 'grass.dmi'
world
turf = /turf/grass

mob
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!

verb
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]"
var
HP = 30 //declares a new variable called HP, with a value of 30
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M

the problem is the var for the Hp of thirty says theirs a problem. It also says that theirs a problem with the line before last. any help?

it seems to me your var line isn't indented correctly.
    verb
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]"
var
HP = 30 //declares a new variable called HP, with a value of 30


And you have a Verb in your variable tree.
     var
HP = 30 //declares a new variable called HP, with a value of 30
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M


So put the Verbs together in the verb tree.
and fix the indentation..
so it should look like this
 turf
grass
icon = 'grass.dmi'
world
turf = /turf/grass

mob
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!

verb
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]"
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M

var
HP = 30 //declares a new variable called HP, with a value of 30

Some things may need reindented with tabs as I used spaces for indentation dm and /dm tags (with <> around them) are used to put the code in those fancy little boxes that look amazingly like the DM editor :)
Maybe that will fix some errors.
In response to Vermolius
ok thanks that fixed the HP problem, but when it fixed that it gave me a new error.
It still has the error with the M.HP -= damage, but now its warning me that this iw wrong: oview() << "[usr] attacks [M]!" //send this message to everybody else

it says statement has no effect.
In response to Jasucus
try putting oview(usr) or oview(M)

And please, when putting in coding use DM tags ( <_DM> <_/DM> without the _)
In response to Jasucus
to Jasucus:

It must not be indented right. Can't really help you.

to GhostAnime:

oview defaults center is usr. So...what's the point in putting in usr, eh?
In response to GhostAnime
ok i had incorrect indentation. i figured it out though. thank you for your help. I am indebted to each of you.