ID:141767
 
Code:
#define DEBUG
mob
var
HP = 30 //declares a new variable called HP, with a value of 30

icon = 'person.dmi'
icon_state = "male"

verb
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

Say(msg as text)
view() << "[usr] says: [msg]"

verb
OOC(msg as text)
world << "[usr] OOC: [msg]"

verb
Emote(msg as text)
world << "*[usr] [msg]*"

verb
Whisper(msg as text)
oview(3) << "[usr] whispers: ]msg]"

turf
Grass
icon = 'turfs.dmi'
icon_state = "grass"

Water
icon = 'turfs.dmi'
icon_state = "water"
density = 1

Path
icon = 'turfs.dmi'
icon_state = "Path"

Wall
icon = 'turfs.dmi'
icon_state = "wall"
density = 1

Roof
icon = 'turfs.dmi'
icon_state = "roof"
density = 1

Cliff
icon = 'turfs.dmi'
icon_state = "cliff"
density = 1
Cliff2
icon = 'turfs.dmi'
icon_state = "cliff2"
density = 1
Water2
icon = 'turfs.dmi'
icon_state = "Water2"
density = 1

Rock
icon = 'turfs.dmi'
icon_state = "rock"
density = 1


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]" //The world sees chatroom-like output


Problem description:

This is starting to annoy me.

It keeps saying inconsistent indentation on icon = 'person.dmi' then i indent and it says it on icon_state = "male" then i indent.

THEN A LOT MORE INCONSISTENT INDENTATIONS! plz help me im so confused
"HP = 30" is indented twice from the looks of it. Take one indent off.
Russelisthebestever2 wrote:
Code:
#define DEBUG
> mob
> var
> HP = 30 //declares a new variable called HP, with a value of 30
>
> icon = 'person.dmi'
> icon_state = "male"


"var" needs to be indented so it is under "mob":

#define DEBUG
> mob
> var
> HP = 30 //declares a new variable called HP, with a value of 30
>
> icon = 'person.dmi'
> icon_state = "male"


Also, you can group all of those verbs under one "verb", instead of randomly breaking it up.

Also also, you can save yourself some typing time by setting all turfs' icon to 'turfs.dmi'

Also also also, you should combine that mob definition at the end of your code with the one above, some of it is redundant (the icon and say definitions)

Here's how I would set it up:

#define DEBUG
mob
var
HP = 30 //declares a new variable called HP, with a value of 30
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
icon_state = "male"

Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!

verb
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
Say(msg as text) //What the usr says is passed into "msg" as text
view() << "[usr] says: [msg]" //The world sees chatroom-like output
OOC(msg as text)
world << "[usr] OOC: [msg]"
Emote(msg as text)
world << "*[usr] [msg]*"
Whisper(msg as text)
oview(3) << "[usr] whispers: ]msg]"


turf
icon = 'turfs.dmi'
Grass
icon_state = "grass"
Water
icon_state = "water"
density = 1
Path
icon_state = "Path"
Wall
icon_state = "wall"
density = 1
Roof
icon_state = "roof"
density = 1
Cliff
icon_state = "cliff"
density = 1
Cliff2
icon_state = "cliff2"
density = 1
Water2
icon_state = "Water2"
density = 1
Rock
icon_state = "rock"
density = 1


Also also also also:
http://www.byond.com/developer/forum/?id=673022#673020