1
2
ID:169934
Apr 10 2005, 2:10 pm
|
|
I was wondering how do I make a person after they reach a certain level they gain more stats. For example lets say they reach level 50, how do I make it so when they reach level 50 they get more hp, defense etc.
|
In response to Jay1
|
|
Thanks, now I'm getting hang of this programming language.Also does this make it so every level after 50 will gain that number of hp, defense etc?
|
In response to Broly103
|
|
Not the one I gave you, but where you see:
if(usr.level == 50) ..you can just add more such as: if(usr.level == 150) ..and add more procs called "Level150Up()" and "usr.Level200Up()", and you can copy the Lvl50Up() proc but edit whatever you want. I didn't copy everything because i thought you mightve wanted the stat increases to change every 50 levels and etc. Tell me if you have any problems. |
In response to Jay1
|
|
Jay1 wrote:
> obj Make more procs for every level and stuff, and add vars so that no one can cheat and level up to 50 more than once (unless its a gm with an edit verb).Thanks you did, here is another one. I'm haveing mutiple races in my game, I want each race to have unique leveling system. For example the human race will be skilled in attack while an alien race will be skilled in speed for example. How do I make it so each race will gain those stats, do I create mutiple leveling systems? |
In response to Broly103
|
|
Use an if() statement.
-Ryan |
In response to Jay1
|
|
You should NEVER EVER use usr in proc.
~>Jiskuha |
In response to Jiskuha
|
|
Jiskuha wrote:
You should NEVER EVER use usr in proc. I use src. |
In response to Jiskuha
|
|
Uses usr in Click() stuff like that... >.<
-Ryan |
In response to Jay1
|
|
That is such a crappy way of doing it. You could simply just use something like:
mob |
In response to Ryne Rekab
|
|
Click(), Dblclick(), North(), Center() and other procedures like them are actually verbs. You can use usr in them safely.
Although... Does North(), South() etc. get called by movement procedures? Maybe they're not safe... |
In response to Jp
|
|
They are proc not verbs.
-Ryan |
In response to N1ghtW1ng
|
|
What happens if their exp goes above their max exp?
*cough*>=*cough* |
In response to Hell Ramen
|
|
Hell Ramen wrote:
*cough*>=*cough* You seem to be sick. You coughed all over me yesterday. >.> -Ryan |
In response to Hell Ramen
|
|
Good catch =P. I meant to do that, I guess my hand slipped >.>
|
As opposed to doing what Jay1 suggested, a far more efficient system is to have a formula for the amount of each statistic a character gains upon gaining a level. Something like this:
mob |
In response to Ryne Rekab
|
|
The way Click() and DblClick() occurs means that they are verbs. They are only ever triggered by player input, so usr is always the player doing the input.
I think North(), South(), Center() etc. work in the same way too. Anyway, verbs are procs. :P. |
In response to Ryne Rekab
|
|
Ryne Rekab wrote:
They are proc not verbs. This is kind of splitting hairs. atom/Click() is a proc, but it's called directly by client/Click() so its behavior can be entirely assumed to be verb-safe as long as you haven't screwed with client/Click(). Lummox JR |
In response to Jay1
|
|
Jay1 wrote:
Hope I solved your question. Unfortunately you haven't. I appreciate that you're trying to help, but you just don't know what you're doing. Let's examine: proc There's way too much wrong with this. For starters, making these procs global is totally bogus. They should belong to a mob. When they're defined correctly as belonging to a mob, you can use src. In any case you should not use usr for this, because it's not safe in procs. Rule of thumb:And this line makes no sense, since it won't even compile:
var/usr.gotlvl50 = 1
It's a bit late to define mob vars, so that will fail. But if you had mob/var/highestlevel which just kept track of the highest level gained, you could simply check that every time you wanted to detrmine if stats should increase or not. Having on/off vars like gotlvl50, gotlvl100, etc. is bad; having a var that says you got up to level 55 so far (even if you've lost levels since) is good. For example: if(++level > highestlevel) As for something happening at level 50, you don't need separate procs for that sort of thing. In fact, it's more common to do something every nth level, like perhaps gain certain innate skills at level 5, 10, 15, etc. In those cases you have the handy % operator. So all in all, none of this is good code and needs to be seriously redone. It's great that you want to help, but you really need to learn more before you can do that. Lummox JR |
In response to Broly103
|
|
Broly103 wrote:
Jay1 wrote: > > obj Make more procs for every level and stuff, and add vars so that no one can cheat and level up to 50 more than once (unless its a gm with an edit verb).Thanks you did, here is another one. I'm haveing mutiple races in my game, I want each race to have unique leveling system. For example the human race will be skilled in attack while an alien race will be skilled in speed for example. How do I make it so each race will gain those stats, do I create mutiple leveling systems? Okay, that gets a little harder now mob/Login() Thats where my knolwage of the situation goes out of reach. Ask one of these other peoples. |
1
2
Make more procs for every level and stuff, and add vars so that no one can cheat and level up to 50 more than once (unless its a gm with an edit verb).
Hope I solved your question.