ID:140761
 
Code:

mob/NPC_Rouge
icon = 'NPC.dmi'
HP = 99999999999999
verb/Talk()
set src in oview(1)
switch(alert("What!?? The Tutorial Lady sent you!! For God Sake Lady!! I dont want anything to do with this... Well your here now i might aswell tell you a few things about being a rogue. Wanna listen?","Rogue Expert","Yes","No"))
if("Yes")
var/s = input("Ok, lets make this quick. We Rogues rely on our speed and cunning ability to steal other peoples money. My job is to teach you a move for rogues only and then send you off to the Food fanatic. Wanna learn HeartSteal?")in list("Yes","no")
if(s=="Yes")
if(usr.Class=="1")
alert("HeartSteal damages the enemy then steals their life to heal yours.","","Ok")
usr << sound('Unforgiven.mid')
usr << "<b> You learn HeartSteal!"
usr.verbs+=new/mob/Skills/verb/HeartSteal
usr.mana -= 1
else
alert("Bother someone else.","","Ok")
return



mob
Skills
verb
HeartSteal(mob/M as mob in oview(3))
desc = "Deals damage to an enemy and heals you with it!"
var/damage = usr.str
if(usr.mana>=8)
view() << "<I>\red You use HeartSteal on the [M]!"
M.overlays += 'overmonst.dmi'
spawn(20)
M.overlays -= 'overmonst.dmi'
M << "<I>\red Your HP Drains as [usr.name] Hits you with HeartSteal!"
M.HP -= damage
usr.mana -= 8
Health_Bar()
mana_Bar()
M.Deathcheck()
usr.DeathCheck()
else
usr << "<I>\blue You need more MP to use this Skill!"


Problem description:

I dont see whats wrong, i mean all the vars check out with the character i use...

i get no errors but the verb wont create.





Reevesy93 wrote:
i get no errors

Good to hear! Problem solved.
In response to Garthor
Let me rephrase.......

I Get no error 'Message'

Its just the verb will not create.
In response to Reevesy93
Does it reach the line at all? That is: do you get the alert, get the sound, get the message, lose the mana?
No, it stops dead.
In response to Reevesy93
Then your class variable is not equal to "1". Note that "1" is a text string and 1 is a number.

Furthermore, whenever you have an error like this, where something that should happen doesn't happen, the FIRST thing you should be doing is asking, "is the line even reached?" You can narrow down where the problem is very quickly that way.
In response to Garthor
oops, i posted that in the wrong spot..

But no it doesn't reach the music or message.

What could be stopping it?
In response to Reevesy93
Already answered: the if() statement is false. Your class variable is not the text string "1". Most likely, it is the number 1, which is not equal to "1".
In response to Garthor
Ok so how would i state my Class=1 var?
In response to Reevesy93
Reevesy93 wrote:
Ok so how would i state my Class=1 var?

It says
if(usr.Class=="1")

Remove the quotes if it fails to work class is set to
something unexpected.
In response to Chowder
Aha tyvm
It was the var..

I put class = 1
class = 2

etc for each class, stupidly.
Should have been stated class1= 1 class2 = 1 etc etc..

I have another question though.. Now the verb creates, how do i get it to set category automatically.
In response to Garthor
Thanks, next time i should be able to find problems easier.
Why, exactly does the NPC have such high health? Can't you just prevent players from attacking them?
In response to Reevesy93
The category setting is something you set where you declare the verb, not when you add it. So you'd put "set category = "blah"" in the verb itself.
In response to Vic Rattlehead
Probably because there might be a loop hole in one of the attack codes that lets them attack the npc, or just to be safe, I guess?
In response to Megelic
So, you're telling me giving the NPC some insane HP amount is okay, but doing this (or something similar):
mob
var/canbeattacked=1
NPC
canbeattacked=0
proc/attack()
var/mob/m=locate(get_step(src,src.dir))
if(m&&m.canbeattacked)
...

Isn't okay, at all?
In response to Vic Rattlehead
No what I'm saying is, it's probably just in-case they made a error or mistake on accident in there attack verbs(if they have more then one).
In response to Megelic
verb
kick()
var/mob/m=get_step(src,src.dir)
if(m) m.TakeDamage(5)
Punch()
var/mob/m=get_step(src,src.dir)
if(m) m.TakeDamage(15)


Generally speaking, that's how attack verbs should look, find the mob, if it exists, run a proc to make it take damage.
In response to Vic Rattlehead
Games normally have to check for more then one thing.
For example, a naruto game might have to see if there doing something and if there frozen or if there doing something at the same time.
In response to Megelic
Why would you need several variables to explain the simple "I can't move" situation when one would do fine?
Page: 1 2