obj/armor
name = "chain Mail"
icon = 'chainmail.dmi'
verb
wear()
call(weararmor)
remove()
call(removearmor)
proc
weararmor()
overlays += 'pcarmored.dmi'
usr << "you put on the Chain mail"
removearmor()
overlays -= 'pcarmored.dmi'
usr << "you remove the chain mail"
thats my code, it give me the error
371:error: expected syntax: call([Object,]Proc)(Args)
but i think it's all the right stuff, i put an ("argument") at the end of the call() things, but that made all my Vars bad...
(after 2 years of programming in 2 languages, i still suck really bad)
ID:180231
Aug 5 2001, 6:45 pm
|
|
In response to Nebathemonk
|
|
Please don't change the fonts or modify the HTML unless you're adding emphasis, and even then only do it sparingly... it makes it hard to read.
Anyway, since this topic has probably already been solved in a later post, I'm going to point out something else... one very, very, very bad thing with your code. DON'T USE CALL()! Call is even more evil than anything having to do with the colon operator, because call() completely and utterly ignores that entirely. If the mob doesn't have that proc, call will fail miserably. The compiler at least compares to see if you have a proc by that name anywhere in your code when you have a colon. Call? Doesn't. Anywhere you use: call("myprocname") You should ALWAYS, ALWAYS, ALWAYS use src.myprocname() You'll avoid tons of errors and frustration. If you're incredibly ornery or belligerent, and still want to use call() despite my extreme warning, be sure to use it with its accompanying procedure, hascall(). You'll have to look that up on your own, because I don't encourage using call unless it is a particular exact circumstance, which I won't get into here. |
<font color="blue"><h3> MY NEW CODE </h3></font>
obj/armor
name = "chainmail"
icon = 'pcarmored.dmi'
verb
wear()
src.overlays += /obj/armor
remove()
src.overlays -= /obj/armor
<font color="green"> this has no erros or warnings, but it doesn't do anything! it still doesn't overlap, and it doesn't even underlap! so what the heck is the problem.</font>