ID:143001
 
Code:
    verb 
Super_Slash (mob/M as in oview (2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr <<"[M] barely dodges your attack!"
M <<" You BARELY dodge [usr]'s attack!"
else M.hp -= damage
view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
M:deathcheck()


Problem description:
loading Codes practiced.dme
C:\Documents and Settings\Guest\My Documents\test game.dm:111:error: missing left-hand argument to in.
C:\Documents and Settings\Guest\My Documents\test game.dm:111:error: ): expected }
C:\Documents and Settings\Guest\My Documents\test game.dm:110:error: location of top-most unmatched {
i am having a problem with something its a few tiny errors i have been trying to fix
the line where it says super slash is where every single error seems to come from
mob


You need to either remove the "as" or change it to "as mob".
In response to Garthor
it gave me 75 errors but when i changed it to as mob it said the same thing
In response to Choka
Oh, it should be oview(2), not oview (2)
In response to Garthor
same thing
In response to Choka
Same thing as what? You're going to have to post what you have now and what errors you're getting.
In response to Garthor
Code:
mob
verb
Super_Slash(as mob/M in oview(2))

loading Codes practiced.dme
C:\Documents and Settings\Guest\My Documents\test game.dm:111:error: missing left-hand argument to in.
C:\Documents and Settings\Guest\My Documents\test game.dm:111:error: ): expected }
C:\Documents and Settings\Guest\My Documents\test game.dm:110:error: location of top-most unmatched {
In response to Choka
mob
verb
Super_Slash(mob/M in oview(2))
In response to Zuglilth
thx i have but one error but i can fix it i think its a mystery how byond codes reply so quickly in forums o.o
In response to Choka
inconsistent indentation
In response to Choka
Do this:

dont tab mob, tab verb, tab Super_Slash twice.

Make sure any if/else checks are then tabbed one over under Super_Slash.
In response to Zuglilth
i got lost when u were trying to explain making a template as tabbing guide for super slash
In response to Choka
Code:
mob
verb
Super_Slash(mob/M in oview(2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr <<"[M] barely dodges your attack!"
M <<" You BARELY dodge [usr]'s attack!"
else M.hp -= damage
view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
M:deathcheck()

C:\Documents and Settings\Guest\My Documents\test game.dm:111: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:112: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:114: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:115: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:117: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:118: Inconsistent indentation.
In response to Choka
Choka wrote:
Code:
> mob
> verb
> Super_Slash(mob/M in oview(2))
> var/damage = usr.str - usr.def + 5
> if(damage <= 0)
> usr <<"[M] barely dodges your attack!"
> M <<" You BARELY dodge [usr]'s attack!"
> else M.hp -= damage
> view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
> M:deathcheck()
>

C:\Documents and Settings\Guest\My Documents\test game.dm:111: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:112: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:114: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:115: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:117: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:118: Inconsistent indentation.

mob
verb
Super_Slash(mob/M in oview(2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr<<"//etc

Make sure that else is on the same indentation level as if.
In response to Zuglilth
Code:
mob
verb
Super_Slash(mob/M in oview(2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr <<"[M] barely dodges your attack!"
M <<" You BARELY dodge [usr]'s attack!"
else M.hp -= damage
view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
M:deathcheck()

Problems
loading Codes practiced.dme
C:\Documents and Settings\Guest\My Documents\test game.dm:112: Inconsistent indentation.
C:\Documents and Settings\Guest\My Documents\test game.dm:113: Inconsistent indentation.
In response to Choka
Else is not on the same indentation level...also, dont just copy code and paste. You could copy, paste, delete all indentation and tab each line to the indentation desired.
mob
verb
Super_Slash(mob/M in oview(2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr <<"[M] barely dodges your attack!"
M <<" You BARELY dodge [usr]'s attack!"
else M.hp -= damage
view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
M:deathcheck()



Also, : is not to be used so lightly. deathcheck() being a proc should take an arguement. Try this:

proc
deathcheck(mob/M)
if(M.HP <=0)
//etc


Then change that M:deathcheck() to deathcheck(M).
In response to Zuglilth
calls it inconsistent indentation when i bring else
back one tab
In response to Choka
Are you using spaces, or tabs? This is why we don't usually copy and paste as is. How you indent needs to be the same for each line of a proc/verb/etc.

Trust me, that else needs to be on the same intentation level as the if.
In response to Zuglilth
Code:
mob
verb
Super_Slash(mob/M as (in oview(2))
var/damage = usr.str - usr.def + 5
if(damage <= 0)
usr <<"[M] barely dodges your attack!"
M <<" You BARELY dodge [usr]'s attack!"
else M.hp -= damage
view() <<"[M] takes [damage] damage from [usr]'s Super Slash!!!"
M:deathcheck()

Code Problem:
loading Codes practiced.dme
C:\Documents and Settings\Guest\My Documents\test game.dm:111:error: missing left-hand argument to in.




whenever i change the sequence of parents and arguments around it gives me less errors
In response to Choka
http://www.byond.com/docs/guide/
http://www.byond.com/docs/ref/

For crying out loud, you REALLY have to learn about indentation and programming grammar!
Page: 1 2