ID:171732
 
Alright I have an attack system where you hit attack it changes your icon ya know the simple stuff BUT in my game you will have various people and each person will have their own animation or w/e you wanna call it and it works fine WITHOUT the branch so... anyways I put this
mob

verb
attack(mob/M in oview (1))
if(mob="Naruto")
flick("youhit",usr)
flick("npchit",src)
M.hp -= usr.str

M<<"You were hit for [usr.str] damage!"
usr<<"You inflicted [usr.str] on [M]."
deathcheck()

if(mob="Sasuke")
(same stuff as the other one just for test)

and I get these errors:

fight.dm:4:error:mob:undefined type: mob = if(mob="Naruto")

fight.dm:12:error:mob:undefined type: mob = if(mob="Sasuke")

fight.dm:4:error::missing expression = if(mob="Naruto")

fight.dm:12:error::missing expression = if(mob="Sasuke")

so if you can help me with any of this I'd appreciate it ^^
VcentG wrote:
Alright I have an attack system where you hit attack it changes your icon ya know the simple stuff BUT in my game you will have various people and each person will have their own animation or w/e you wanna call it and it works fine WITHOUT the branch so... anyways I put this
mob

verb
attack(mob/M in oview (1))
if(mob="Naruto")
flick("youhit",usr)
flick("npchit",src)
M.hp -= usr.str

M<<"You were hit for [usr.str] damage!"
usr<<"You inflicted [usr.str] on [M]."
deathcheck()

if(mob="Sasuke")
(same stuff as the other one just for test)

and I get these errors:

fight.dm:4:error:mob:undefined type: mob = if(mob="Naruto")

fight.dm:12:error:mob:undefined type: mob = if(mob="Sasuke")

fight.dm:4:error::missing expression = if(mob="Naruto")

fight.dm:12:error::missing expression = if(mob="Sasuke")

so if you can help me with any of this I'd appreciate it ^^


May sure you under stand the difference between = and ==
My computer teacher taught me this:
== equals =
but
= equals assignment...
(sounds funny when you say it...)

your if statement needs to have ==

In response to Jik
thanks that fixed half the problem now I just got
fight.dm:13:error:mob:undefined type: mob but I think I can fix that ^^