ID:149617
 
client/var/my_turf = get_step(src,mob.dir)
client/var/canAttack = TRUE as num
client/var/mob_found = 0
client/Northeast(mob/M in oview(1))
if (canAttack)
canAttack = FALSE
for(M in var/my_turf)
flick('Attack.dmi',usr)
if(mob_found = 1)
usr<<sound('Enemy-Attack.wav')
M.PCDeathCheck()
sleep(10)
canAttack = TRUE
if (mob_found = 0)
usr<<sound('Attack.wav')
M.PCDeathCheck()
sleep(10)
canAttack = TRUE

I seem to be having a problem, i have checked the help but i still get the same errors. Please someone help me.
Tazor07 wrote:
client/var/my_turf = get_step(src,mob.dir) <font color=yellow>if defined here, this must be a constant</font>
client/var/canAttack = TRUE as num <font color=yellow>"as num" doesn't do anything for you here</font>
client/var/mob_found = 0
client/Northeast(mob/M in oview(1)) <font color=yellow>Your parameter makes no sense. What are you trying to set to M??</font>
if (canAttack)
canAttack = FALSE
for(M in var/my_turf) <font color=yellow>you tried to set my_turf outside of this proc, so it's not going to equal where you mob is now.</font>
flick('Attack.dmi',usr)
if(mob_found = 1) <font color=yellow>This block will never execute because you never set mob_found to 1</font>
usr<<sound('Enemy-Attack.wav')
M.PCDeathCheck()
sleep(10)
canAttack = TRUE
if (mob_found = 0)
usr<<sound('Attack.wav')
M.PCDeathCheck()
sleep(10)
canAttack = TRUE

I seem to be having a problem, i have checked the help but i still get the same errors. Please someone help me.

So what do you want this code to do, anyway?
In response to Skysaw
I added a couple other problems in red...

client/var/my_turf = get_step(src,mob.dir) <font color=yellow>if defined here, this must be a constant</font>
client/var/canAttack = TRUE as num <font color=yellow>"as num" doesn't do anything for you here</font>
client/var/mob_found = 0
client/Northeast(mob/M in oview(1)) <font color=yellow>Your parameter makes no sense. What are you trying to set to M??</font>
if (canAttack)
canAttack = FALSE
for(M in var/my_turf) <font color=yellow>you tried to set my_turf outside of this proc, so it's not going to equal where you mob is now.</font>
flick('Attack.dmi',usr)
if(mob_found = 1) <font color=yellow>This block will never execute because you never set mob_found to 1</font> <font color=red>Plus, you need "==", not "="</font>
usr<<sound('Enemy-Attack.wav')
M.PCDeathCheck()
sleep(10)
canAttack = TRUE
if (mob_found = 0) <font color=red>That should probably be 'else' -- and there's still the "==" problem</font>
usr<<sound('Attack.wav')
M.PCDeathCheck() <font color=red>If there's no mob there, why are you checking to see if you've killed a mob?</font>
sleep(10)
canAttack = TRUE

I seem to be having a problem, i have checked the help but i still get the same errors. Please someone help me.


So what do you want this code to do, anyway?

He wants to press client/Northeast() and grab the turf in front of him, then hurt the mob that is in that turf, if any.
In response to Spuzzum
hmmmm, i'll try and figure it out and get it running, it will be cool :)
In response to Spuzzum
if(mob_found = 1) <font color=yellow>This block will never execute because you never set mob_found to 1</font> <font color=red>Plus, you need "==", not "="</font><font color=yellow>Actually, that doesn't matter because, as I said it will never execute! ;-)</font></font>
In response to Skysaw
Skysaw wrote:
if(mob_found = 1) <font color=yellow>This block will never execute because you never set mob_found to 1</font> <font color=red>Plus, you need "==", not "="</font><font color=yellow>Actually, that doesn't matter because, as I said it will never execute! ;-)</font> <font color=red>Well of course it will never execute if it doesn't even compile. =P</font>
In response to Spuzzum
Spuzzum wrote:
Skysaw wrote:
if(mob_found = 1) <font color=yellow>This block will never execute because you never set mob_found to 1</font> <font color=red>Plus, you need "==", not "="</font><font color=yellow>Actually, that doesn't matter because, as I said it will never execute! ;-)</font> <font color=red>Well of course it will never execute if it doesn't even compile. =P</font> ... <font color=yellow>Score one for the red team!</font>
As Spuzzum pointed out, you need == instead of = for those if() statements. That's probably responsible for the error you're getting.

Of course, we'll never know, since you didn't tell us what those errors were.

Lummox JR