ID:146511
 
Code://This is a test world created by Jakken109 on 5/29/05.

mob
icon = 'person.dmi' //make 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'
var
HP = 30 //define a new variable called HP, with a value of 30
wealth



Login()
icon_state = gender //when a player logs in, get them the right icon state for
..() //the gender of their key. Then call the parent!

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

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
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
Del()
var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(0,100) //set its amount variable randomly
..() //call the parent

say(msg as text) //what the usr says is passed into "msg" as text
world << "[usr] says: [msg]" //the world sees chatroom-like output

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

turf
grass //define a "grass" prototype, which is a kind of turf...
icon = 'grass.dmi' //that has an icon named 'grass.dmi'. In single quotes!

world //set one of our world's characteristics:
turf = /turf/grass //its default turf is the grass turf.



Problem description:I got the errors G invalid proc definition and = invalid proc def.. I did the zilal tutorial and its not working, can someone help me?

change the line
var/obj/gold/G = new(loc)

to
var/obj/G = new /obj/gold(loc)

i think that should take the errors away
In response to Zero's Baby
var/obj/>>G<< = new /obj/gold(loc)

var/obj/gold/>>G<< = new(loc)

those are whats wrong.. the G, duno whats wrong with it

G.amount >>=<< rand(0,100)

and that = sign
   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
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
Del()
//****Look Here***indentation error you have G on the same step as the verb so indent and it should give no more errors about the G.
var/obj/gold/G = new(loc)
/*same effect as var/obj/G=new/obj/G(loc) this is used
for different type casting techniques
like var/obj/O=new/mob/whatever
thats what this ismob() proc
and its counterparts are used
for, to make sure something like that does'nt slip out.
*/

G.amount = rand(0,100) //set its amount variable randomly
..()
//**Look Here** And why call the parent this isnt a sub-type this IS the parent of the verb.

Other than that.The only things that may lead to more problems in the future is the way you are coding this game.
-Intel
Please put your code inside the <dm> tags, not before them, so the code will display correctly. Please also put your problem description after the closing </b> tag, because that doesn't need to be in bold. You can edit your post to make it display correctly.

Lummox JR
I don't remember Zilal's tutorial using the : operator instead of the . operator. o.O
In response to Zero's Baby
That actually makes it worse.