i am trying to use verbs to buy a weopon or armor when standing next to the shopkeep. i am getting errors. i have looked through the help and it did not help me. i think i might just be using the proc wrong but im not sure.
verb
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
if (M.hp <= 0) //if M's HP are at or below 0...,line30
usr << "[M] is already dead!"
else //otherwise...
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send message to everyone else
var/damage = rand(1,10+attack-defense) //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) //what the usr says is passed into "msg" as text
world << "[usr]: [msg]"//line 40
inventory()
usr << "[usr]; [wealth]gold"
if oview(1,mob))=shopkeep // THIS IS LINE 46
buy weapon
wealth-=10
attack+=5
buy armor
wealth-=10
defense+=5
these are the errors:
46:error:missing condition
46:error: ):expected }
if you can help it would be appreciated.
ID:179572
Dec 2 2001, 5:07 pm
|
|
In response to GateGuardian
|
|
Wow, you found that, I couldn't read through that mess of un-needed code.
|
In response to Nadrew
|
|
As a side note, you should read the ZBT tutorial and learn how to write some of those things properly.
If you already have, do it again. |
thx, i didnt realized i put an extra parentheses in there. and i sat here for a hour and a half trying to figure out what was wrong(lol).that fixed that, but now i get a missing condition error. o well, ill try to fix that tommarrow.
and to nadrew, the other code is not un-needed. they are just my other verbs (to attack, talk, and look at your inventory). |
In response to Loduwijk
|
|
I'll be releasing my "Guide to posting" later on, so you people will be able to post and not get mad when someone tells you that you posted something wrong.
|
oview(1,mob)
you have:
oview(1,mob))