can some help me out with a code please?
hi i was reading a tutorial on byond
here is how to get in the tutorial
developer/turtorials/zbt(Zilal's beginner tutorial)
now i have been fallowing along and i came up to this problem this is my code:
mob
verb
say(msg as text)
world << "[usr]:[msg]"
obj
gold
icon = 'gold.dmi'
var
amount
verb
get()
set src in view(1)
usr << "you picked up [amount] gold"
usr.wealth += amount
del(src)
mob
icon = 'person.dmi'
Login()
icon_state = gender
..()
proc
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
Del()
mob
del()
var/obj/gold/G = new(loc)
G.amount = rand(1,100)
..()
bug //new protoytipe
icon = 'bug.dmi' //override the parants icon,which was person.dmi
mob
var
HP = 30 //declares a new variable called HP, with a value of 30
mob
verb
attack(mob/M as mob in oview(1)) //attack the mob 1 tile from you
if (M.HP <= 0)
usr << "[M] is alrady dead"
else //otherwise....
usr << "you attacker [M]" //send this masseg to the usr
oview() << "[usr] attacks [M]"//send the massage to everyone ealse
var/damage = rand(1,10) //asign and random number 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 dead with a proc
turf
grass //defines a "grass" prototype, which is a kind of turf...
icon = 'grass.dmi' //and has an icon named 'grass.dmi'. In single quotes!
world //we set one of our world's characteristics:
turf = /turf/grass //its default turf is the grass turf.
im sorry for the comments but you can copy paste this in your dream maker so it is more clear
when i compile this i get this
loading testworld.dme
testworld.dm:40:error::empty type name (indentation error?)
testworld.dm:40:error:del :instruction not allowed here
testworld.dm:24:error:usr.wealth:undefined var
testworld.dm:41:error:G :unknown variable type
testworld.dm:41:error:= :expected a constant expression
testworld.dm:42:error:G.amount:undefined type: G.amount
testworld.dm:41:error::empty type name (indentation error?)
testworld.dmb - 7 errors, 0 warnings (double-click on an error to jump to it)
i dont get it???
ID:173550
![]() Dec 19 2003, 12:36 pm
|
|
There are six of your errors right there. What you need to do it change Del() to del(), and del() to Del(), in that section of code only. See, BYOND is case-sensitive, and del() is the thing you use to delete something, and Del() is what you call to do stuff whenever it gets deleted.
Your other error is that you haven't defined the wealth variable for mobs.