ID:172967
 
i made a new deathchecksystem for my battle system and all of a sudden i get these errors
loading Superhero.dme
Battlesystem.dm:65:error::bad assignment
Battlesystem.dm:86:error::missing expression
Battlesystem.dm:89:src :warning: unused label
Battlesystem.dm:89:repop :warning: unused label

Superhero.dmb - 2 errors, 2 warnings (double-click on an error to jump to it)


basically what its suppose 2 do is check either if its a monster, or a player and then choose accordingly

mob
verb
Attack()
set src in oview(1)
set category = "Battle"
set name = "Attack"
usr.random = rand(1,10)
if(usr.hp > 1)
if(usr.random == 1)
view(6) << "[usr.name] kicks [src.name]!"
src.hp -= usr.str/3
sleep(20)
deathcheckplayer()
deathcheckmon()
if(usr.random == 2)
view(6) << "[usr.name] punches [src.name]!"
src.hp -= usr.str/4
sleep(20)
deathcheckplayer()
deathcheckmon()
if(usr.random == 3)
view(6) << "[usr.name] misses [src.name]!"
// Nothing happens and no power is lost.
if(usr.random == 4 && src.agility >= usr.agility)
view(6) << "[src.name] is to fast for [usr.name] and he misses."
if(usr.random == 5 && usr.def>= src.def)
view(6) << "[src.name] is like a brick and [usr.name] attacks do nothing."
if(usr.random == 10 && src.luck >= usr.luck)
view(6) << "[src.name] seems like hes to lucky to be hit by [usr.name] so he misses."

mob
proc
gecheck()
if(src.ge <= 0)
usr.alignment = "Good"
if(src.ge <= 0)
evil = good



mob
proc
deathcheckplayer()
if(src.hp <= 0 & player = 1)
src << "You have died!"
dead = 1
if(src == evil && usr == good)
usr.good += 1
if(evil >= 0)
usr.evil -= 2
gecheck()
if(src == evil && usr == evil)
usr.good -= 2
if(evil >= 0)
usr.evil += 4
gecheck()
if(src == good && usr == good)
usr.good -= 5
if(evil >= 0)
usr.evil += 3
gecheck()
src.loc=locate(20,10,2)
deathcheckmon()
if(src.hp <=0)
if(usr.player = 0)
del(src)
sleep(500)
src.repop


thanks alot again



[edit]...heh i figured out the whole assignment thing i was missing an = sign but now the label thing in src.repop is messed up still sorry....if anyone can help i'll appreciate it
ok i have done something like this the first thing to do is remove the (usr.) this can **** up your game and make it hard to fix (i know i started out like that) and the test it to see if it works

i will post the one i did when i get back home
In response to Madpeter
hmm wat usr thing? the problem is the src.repop thing i think...am i even using repop the way its suppose 2 be used?
No put usr in proc. Ungh.

Lummox JR
In response to Lummox JR
You want src.repop()? Don't forget the parentheses for calling procedures.

"if(usr.player = 0)", you should have == there.
In response to Yota
yea thats wat i wanted heh forgot
In response to N1ghtW1ng
mob
verb
Attack(mob/Trg as mob in view(1))
set src in oview(1)
set category = "Battle"
set name = "Attack"
usr.random = rand(1,10)
if(usr.hp > 1)
if(src.random == 1)
view(6) << "[src.name] kicks [Trg.name]!"
Trg.hp -= src.str/3
sleep(20)
deathcheckplayer()
deathcheckmon()
if(src.random == 2)
view(6) << "[src.name] punches [Trg.name]!"
Trg.hp -= src.str/4
sleep(20)
deathcheckplayer()
deathcheckmon()
if(src.random == 3)
view(6) << "[src.name] misses [Trg.name]!"
// Nothing happens and no power is lost.
if(src.random == 4 && Trg.agility >= src.agility)
view(6) << "[Trg.name] is to fast for [src.name] and he misses."
if(src.random == 5 && src.def>= Trg.def)
view(6) << "[Trg.name] is like a brick and [src.name] attacks do nothing."
if(src.random == 10 && Trg.luck >= src.luck)
view(6) << "[Trg.name] seems like hes to lucky to be hit by [src.name] so he misses."



thats the new code but now when ever i attack it lists me in it also...how i fix that
In response to N1ghtW1ng
Good gads, man, you need to keep your vars straight. You're mixing usr and src and Trg indiscriminately.

First of all, why is random even a mob var? It should be local to the proc. By doing this wrong you left the door open to mix up usr.random and src.random, which you did.

Let's review what the vars are in this verb:

  • usr is the player who called the verb.
  • src is the target, since you used "set src in oview(1)".

    And that's it. You don't need Trg at all. What you do need is to keep usr and src straight here. When your output statements say src is the killer, you're not doing that.

    Lummox JR
In response to Lummox JR
oh lol thanks i fixed it now