obj
T-Shirt
name = "T-Shirt"
icon = 'T-Shirt.dmi'
worn = 0
verb
Wear()
if(!src.worn)
src.worn=1
usr.overlays += 'T-Shirt.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"
else
src.worn = 0
usr.overlays -= 'T-Shirt.dmi'
usr << "You remove the [src.name]."
src.suffix = ""
usr.overlays -= 'T-Shirt.dmi'
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up some [src]"
and it says i have an error can you see the error?
It says Objs.dm:1:error: obj: expected end of statement
Also ive set the veriables on an other page they are mob/var
worn = 0
have = 0
ID:163629
Aug 13 2007, 2:35 am
|
|
In response to Fint
|
|
Ty for the help and also ty for improving my origianal code : D but the error hasnt gone anyone else want to have to have a try?
|
In response to Chrislee123
|
|
Well since it expects obj to be the end of the statement, look at your code directly above "obj"
And if you can, check the debug information for what line is causing the error, and post coder arround that region. Ill gladly look at it again, but in your code, I can't find much wrong (besides the use of obj:worn, which should be obj.worn) |
In response to Fint
|
|
How do i check the de-bug info??
|
In response to Chrislee123
|
|
When in dreammaker.
Press "build" (like you would if you want to compile) Then "preferences for [world name] ..." And make sure "generate debugging information" is checked. Now each error should contain a line number. This nuber tells you at what line the error occures. Now you can go to the correct dm file (should also say in your error in what dm file the error was generated) Press "Edit" And sellect "Go to..." (Or press CTRL+G) Input the line number. This way you know exactly what line of code generates the error. |
In response to Fint
|
|
It says Objs.dm:1:error: obj: expected end of statement look at the top it already said it was in line 1. |
In response to Chrislee123
|
|
Yeah but whats causing the error is above that line.
|
You cant use -, you should use _ or something else
Also, your removing the icon twice (not needed)
And might want to change:
usr.overlays -= 'T-shirt.dmi'
To:
Since if you change the icon, that way you wont have to scan trough your code and change everything.