ID:150418
 
Hello, again. I was wondering how I use one stat to change another. I want for every 100 powerlevels you gain, you get a certain number of other stats. Like, maybe if you get 100 Powerlevel, then you will get +5 strength. And then if you get 100 more, you get +5 strength again and stuff like that.
Another thing is my HitCheck proc. Here it is:

HitCheck(mob/M as mob in oview(range))
if ((Strength - M.Defense) > 0)
damage = Powerlevel / (Strength - M.Defense)
if ((Strength - M.Defense) <= 0)
damage = Powerlevel / ((Strength + 20) - M.Defense)
if (Dexterity > (10 + M.Speed))
usr << "[hitmsg]"
M.Health -= damage
if (Dexterity <= (10 + M.Speed))
hit = rand(1,3)
if (hit == 2)
usr << "[hitmsg]"
M.Health -= damage
if (hit != 2)
usr << "[missmsg]"
Stamina -= weakness
if (M.Health <= 0)
world << "[M] has been killed by [usr]!!"
del(M)

I get a couple warnings, and all of the variables are defined either here or in verbs. The problem I'm getting is it won't run the proc, because it reads M.Defense as null.Defense. I think I'm doing the proc right, but when I test it what I've already explained happens. I don't understand why I'm getting this, and since this is not addressed while compiling it, I don't know exactly which line has something wrong with it.
On a last note, how do I make punching bags work? I don't know how to make things happen when the object is clicked upon, so it makes it impossible for me to make punching bags. Any help would be appreciated. Thanks for your time.

On a last note, how do I make punching bags work? I don't know how to make things happen when the object is clicked upon, so it makes it impossible for me to make punching bags. Any help would be appreciated. Thanks for your time.

No, it makes it impossible for you to make punching bags that work the exact same way as everyone else's. Is there some particular reason you need to have clickable punching bags? Do most things in your game work by clicking? My guess is not, because you say you don't know how to use mouse clicks... so if you do everything else in your game by typing in verbs or selecting them from panels, but use punching bags by clicking on them... how much sense does that make??? Isn't that completely inconsistent?

The problem here is that instead of thinking about what your game is really like and staying true to that (being consistent), you're thinking about what other peoples' games are like, and you're trying to stay true to that (being, in simple terms, a copy-cat.)
In response to LexyBitch
I haven't made the most part of my game. I'm still trying to code the player's verbs, and I am still only using a test world. There is no "game" of mine that I can see to keep "trends" with or anything. The only thing that can be classified as a game is the world that's only grass with a saibaman to hit, but the HitCheck proc doesn't even work.
In response to Freitar
Just because you haven't coded anything yet doesn't mean it's too early to start thinking about consistency... in fact, if you start later, it may be too late.

So ask yourself, what's the interface going to be: mostly clicking, or mostly verbs? A lot of games use verbs for most things and then throw in clicking for one tiny thing (like opening/closing doors), and instead of being cool, that actually sucks, because if you're using the keyboard to type in verbs, you have to stop, grab the mouse, and click to open the door. Think about things like that.
In response to LexyBitch
This is very true. I usualy allow two different styles of play:

1: all-keyboard. This means that everything is manipulated by verbs.

2: all-mouse. This means that clicking on a spot will move you there, and clicking on somthing will automatically call it's most used verb (for example, for any money, the "get" verb.) and all other verbs for that obj avalable in the right click menu. In most of my games, clicking on yourself activates say, and other verbs are avalable in stat panels or in your right click menu.

This way, you can play either style without having to switch back and forth.
In response to LexyBitch
Okay, I've figured out how to do punching bags with a verb, BUT can you help me with the actual HitCheck proc? That's the thing that I really need help on.
I still need help with the null.Defense thing. Actually, it says it can't read null.Defense, if that helps any. If you guys need to see what I'm talking about, go to the first post.
In response to Freitar
HitCheck is a proc, and not a verb, right? So when you call it, are you actually putting a variable that corresponds to a mob in the parantheses? For instance:

verb/tap(mob/B as mob in orange(1))
B.tapped(src)

proc/tapped(mob/M)
src << "[M] taps you."

Note that in the verb, it takes the variable src, which refers to the mob that owns the verb, and passes it along as an argument to B.tapped. If it didn't do that, then mob/M would be meaningless.
In response to LexyBitch
Thanks. I didn't remember that.