ID:141763
 
Code:
    DeathCheck()
if (HP <= 0)
world << "[src] dies!"
del(src) //delete whatever just died


Problem description:

in this area on the line with

if (HP <= 0)

it keeps saying

Proc definition not allowed inside another proc. I dont understand what it means
Learn how to indent, your indentation is incorrect.
In response to Jeff8500
can you help me understnad how at least?
This error is a bit vague, in this context. It most likely means either your DeathCheck() is indented too far, or the if() and its two lines aren't indented enough. Probably the former. Try:

    DeathCheck()
if (HP <= 0)
world << "[src] dies!"
del(src) //delete whatever just died
In response to Russelisthebestever2
Everything must be under what it is defined under. For example, if you want to change mob/Login(), you indent Login() under mob. Then, if you want to make it do things, you place the commands for those things underneath Login().

Let's say you want to define a new type under /mob. You would put it under mob, and then follow the above.

mob
Login()
world << "Hi"
..() //call the parent, which is the default action of a proc

mob
SubType
Login()
world << "This is another type's login!"
..() //call mob/Login(), so the normal
//behavior is carried out.
In response to Jeff8500
Code:
    Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!






now in that area im having the same problem

where it says

icon_state = gender
In response to Russelisthebestever2
Did you even read what I said? I said everything must be indented below what you want it to belong to. Therefore you have to indent icon_state = gender and ..() one more tab.
In response to Jeff8500
oh i though i had it right srry
In response to Russelisthebestever2
Code:
    Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent


Problem description:

is that right cause if it is I still have the problem
In response to Russelisthebestever2
Try posting the whole block of code so we can see what's actually above Login(), or what block it belongs to.
Also, the <DM> tag has a small bug with indentation that can make it more confusing when you're posting code on the forums. It only happens on the first line though, so you can easily avoid it - just make sure to post your code like this:
Code
Code


(NOT this:)
Code
Code


Just don't use the first line after the tag.
In response to Kaioken
Code:
#define DEBUG
mob
var
HP = 30 //declares a new variable called HP, with a value of 30
Wealth

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
M.DeathCheck() //check for death with a proc
Say(msg as text)
view() << "[usr] says: [msg]"
OOC(msg as text)
world << "[usr] OOC: [msg]"
Emote(msg as text)
world << "*[usr] [msg]*"
Whisper(msg as text)
oview(3) << "[usr] whispers: ]msg]"

obj
gold //define a "gold" prototype, which is a kind of obj
icon = 'Gold.dmi' //set the default icon
icon_state = "Gold"



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

mob
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
del(src) //delete whatever just died

Del()
var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(1,100) //set its amount variable randomly
..() //call the parent

icon = 'person.dmi' //makes it so all mobs will be created with the person icon

bug //new prototype
icon = 'Bug.dmi' //override the parent's icon, which was 'person.dmi'
icon_state = "Bug"


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


attack(mob/M as mob in oview(1))
if (M.HP <= 0) //if M's HP are at or below 0...
usr << "[M] is already dead!"
else //otherwise...
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()

proc
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
del(src) //delete whatever just died


obj
gold
icon = 'gold.dmi'
var
amount
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.wealth += amount //add to usr.wealth
del(src) //delete the gold


Problem description:
ok thats my whole code so if you can help me plz help