ID:150300
 
k, im trying to make it so when "Bob" punches a punching bag his level goes up 1, but if he punches another bag his level goes up 2, and if he punches yet another his level goes up 3.Right now when he punches something his level goes up 6.

heres my code

mob
verb
Punch()
if("pbag1")
usr.Level += 1
if("pbag2")
usr.Level += 2
if("pbag3")
usr.Level += 3
obj
Punching_Bag
icon = 'PunchingBag.dmi'
density = 1
verb
Train_Punch(obj/pbag)
set src in view(1)
set category = "Battle"
usr.Level += 1

Punching_Bag2
icon = 'PunchingBag.dmi'
density = 1
verb
Train_Punch(obj/pbag)
set src in view(1)
set category = "Battle"
usr.Level += 2
Ya thats right... Why are you asking?
Well, as I'm not sure why your doing it in such a simple way, I will tell you why its going up six every time. IT DOESNT KNOW THE DIFFERENCT, THEREFORE IT JUST ADDS UP ALL THOSE NUMBERS YOU GAVE IT ANDS ADDS THAT TO USE.LEVEL. Ahem, this has been another raving mad post by Jotdaniel.
In response to Jotdaniel
Deleted Post
In response to Bonzi
Bonzi wrote:
eh?



You see using the Punch() verb wouldn't be able to tell the difference between Pee-bag1 Pee-bag2 and the broken-nasty-pee-bag3 by using the if("pee-bag1") because you're not specifying what they are.
In response to Nadrew
ok...I get that but It's not me who asked the question about punching bags. I just didn't get whut Jotdaniel said
In response to Bonzi
Sorry about the spelling, i meant that it doesnt know what difference between pbag1-3, so it just takes all 3 numbers and adds it to the usr's level.
In response to Jotdaniel
JOIN MY SUPER AWESOME RPG ITS REALLY REALLY REALLY REALLY REALLY REALLY GOOD JOIN NOW OR YOULL BE SORRY BECAUSE THIS IS THE BEST RPG OF ALL TIME IF YOU DONT JOIN NOW YOULL MISS OUT BECAUSE THIS GAME WONT BE HERE FOREVER JOIN NOW AND SEE IT IN ALL ITS SPENDER! OVER 730 SPELLS, 560 DIFFERENT SKILLS, TOTALLY UNIQUE IN-GAME ITEM CREATION SYSTEM THAT ALLOWS PLAYERS TO CREATE THEIR OWN EQUIPMENT FROM MATERIALS AND ALL SORTS OF COOL THINGS LIKE THAT! OVER 330 DIFFERENT TYPES OF MONSTERS AND 45 TOTALLY UNIQUE AREAS TO EXPLORE! NO STOCK IDEAS, TOTALLY ORIGINAL!!!!! JOIN NOW!!!! FOR A LIMITED TIME ONLY NEW PLAYERS GAIN 3 EXTRA SKILLS AT CREATION TIME!!! NEW PSUEDO-3D GRAPHICS THAT ARE REALLLY KEWL YOUVE GOT TO SEE THEM TO BELIEVE THEM BY ARTIST JOHN MAVORVIAN CHECK THEM OUT COME SEE IT NOW ITS THE BEST RPG OF ALL TIME YOU DONT WANT TO MISS OUT!!!!!!!!!!!!!!!!!!!!

Does this game actually work?
In response to Bonzi
lol
BrollyX wrote:
mob
verb
Punch()
if("pbag1")
usr.Level += 1
if("pbag2")
usr.Level += 2
if("pbag3")
usr.Level += 3

Here is what is happening:
if() is automatically returning true because you set up your if statements wrong. All your if statements are returning true, thus it does this:
usr.Level += 1
usr.Level += 2
usr.Level += 3
1+2+3 = 6. So it's giving the user 6 levels everytime. What you want to do is make it check to see which punching bag it is attack. I would highly suggest reading some tutorials since you obviously had no idea what you were doing when you set up those statements (no offense).
In response to Ebonshadow
Yes thank you...I request Topic CLose
In response to Bonzi
Sure it does.
In response to GateGuardian
you made the game right?

hmm...when I finish making my character it says please wait....and nothin comes up...
You didn't put an infinite sleep command did you?
In response to Bonzi
I think I might have linked it to the next proc, um, improperly.
In response to Bonzi
Infinite sleep?

Is there an infinate sleep proc?

mob/verb/Inf_Sleep()
anchor
sleep(1)
goto anchor
// hehe
In response to Lord of Water
mob/verb/Inf_Sleep()
anchor
sleep(1)
goto anchor
// hehe

And for the non-evil (and shorter) version:

Inf_Sleep()
while(1)sleep(1)

-AbyssDragon
In response to AbyssDragon
AbyssDragon wrote:
Inf_Sleep()
while(1)sleep(1)

Just out of curiosity, do you think this would work?
proc/inf_sleep()
sleep(1.#INF)


=P