Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-28-2008, 01:31 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Cant figure this formula out.

So I slept through this chapter in math class (Really I did, when I looked at this pattern I KNEW I remembered it somewhere)
I need to write a experience system formula but to find the exp of the next level. Something like clientr.nextlvl=7+((clientr.level*2)+1);
Obviously thats wrong but its as close as I got...
Heres how I wanted to have it progress as you level:
NPC Code:

level1 - 7
+3
level2 - 10
+5
level3 - 15
+7
level4 - 22
+9
level5 - 31
+11
level6 - 42
+13
level7 - 55

Reply With Quote
  #2  
Old 07-28-2008, 01:47 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
clientr.nextlvl= 7 + clientr.level^2 - 1;
Reply With Quote
  #3  
Old 07-28-2008, 01:51 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Thanks a TON. n_n
Reply With Quote
  #4  
Old 07-28-2008, 07:38 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
See what happens when you sleep during class?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #5  
Old 07-28-2008, 09:11 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Most character level systems I've read use a predefined list. Usually there aren't going to be more than a hundred levels anyway, so constructing the list isn't particularly tedious.
Reply With Quote
  #6  
Old 07-28-2008, 09:17 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by DustyPorViva View Post
clientr.nextlvl= 7 + clientr.level^2 - 1;
So 6 + clientr.level^2? lol
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 07-28-2008, 09:27 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by zokemon View Post
So 6 + clientr.level^2? lol
I counter such things pretty often, and I often have to choose between making a more simple formula or one that makes more sense (when looking at things belonging to the formula) and I usually choose the latter. I would use Dusty's formula.
__________________
Reply With Quote
  #8  
Old 07-28-2008, 10:25 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by zokemon View Post
So 6 + clientr.level^2? lol
Good point! I flunked math... though he wanted a base of 7, so...
Reply With Quote
  #9  
Old 07-29-2008, 12:49 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
lol Dusty's was fine, works exactly like I wanted to. I even learned something (sorta).
Reply With Quote
  #10  
Old 07-29-2008, 12:58 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
They both do the same thing. One just does it with less operations (Zero's).
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #11  
Old 07-29-2008, 06:28 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
It makes more sense to use less operations when it comes to algorithms. You can always put the original, unsimplified algorithm in a comment on the side.
__________________
Do it with a DON!
Reply With Quote
  #12  
Old 07-30-2008, 03:44 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Im having more problems with formulas. Im trying to get the maxhp to be itself + a percentage of it per each point of vitality. The way I have it setup now adds on the percentage each time you add to vitality manually. At level 1 your maxhp is 100 so I guess the base is 100.
clientr.maxhp=int(clientr.maxhp+(clientr.maxhp*0.0 8));
What I'm aiming for a script to check it and adjust it automatically which if I used my formula it would increase nonstop...
Reply With Quote
  #13  
Old 07-30-2008, 04:33 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by wild8900 View Post
Im having more problems with formulas. Im trying to get the maxhp to be itself + a percentage of it per each point of vitality. The way I have it setup now adds on the percentage each time you add to vitality manually. At level 1 your maxhp is 100 so I guess the base is 100.
clientr.maxhp=int(clientr.maxhp+(clientr.maxhp*0.0 8));
What I'm aiming for a script to check it and adjust it automatically which if I used my formula it would increase nonstop...
You need to have the stats (vitality) determine part of it.
For example
clientr.maxhp=int(clientr.vitality*5*2+(clientr.vi tality*0.08));
If you start with 10 vitality, this'd equal 100hp (I forget if int rounds xD)
Then with 11 vitality it'd be 110
Then with 12 vitality it'd be 120
Then with 13 vitality it'd be 131
etc.
You can't have clientr.maxhp part of it because that's a loop.
How much do you want the HP to go up by, though? That's the real issue.

Edit:
clientr.maxhp=int(100*player.level+(clientr.vitali ty*0.08));
Base = 100 so that should work. xD
You'd need more than 8 percent for the vitality to take effect.

Edit 2:
You'd need to have an "onVitalityUp()" for each time vitality goes up so you can use clientr.maxhp as a percentage without looping.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 07-30-2008 at 04:45 AM..
Reply With Quote
  #14  
Old 07-30-2008, 01:23 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
People who got C in elementary mathematics ITT.
Reply With Quote
  #15  
Old 07-30-2008, 01:47 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by drakilorp2p View Post
people who got c in elementary mathematics itt.
Hehe
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.