Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2010-04-12 (original capture). Home · Forum · All archived topics · Downloads

Author Topic: Exponential XP requirements  (Read 170 times)

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Exponential XP requirements
« on: February 20, 2008, 11:06:23 PM »
Is there a way to set the required XP for next level to raise exponentially, instead of by a set amount each time.
For example:
Currently it's set for- Level 1=100, Level 2=200, Level 3=300, Level 4=400, etc.

I would like to set it up as- Level 1=100, Level 2=300, Level 3=1100, Level 4=1900, etc.

Is this possible to do?

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #1 on: February 21, 2008, 01:03:58 AM »
Awesome, thanks for your help!  :mrgreen:

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #2 on: February 22, 2008, 06:46:02 PM »
So this is the only line I could find that corresponded with what you mentioned in your post:

Code: (eventscripts) [Select]
es_math wcs_levelup * server_var(wcs_levelxp)
So I should change this to:

Code: (eventscripts) [Select]
es_math wcs_levelup^2 * server_var(wcs_levelxp)or
Code: (eventscripts) [Select]
es_math wcs_levelup ^2* server_var(wcs_levelxp)
?

Offline Stinkyfax

  • I <3 WCS
  • Level 7 Expert
  • *****
  • Posts: 1902
    • WarCraft III Custom races and more Server
Re: Exponential XP requirements
« Reply #3 on: February 22, 2008, 06:53:00 PM »
es_math can do only 1 operation, u should do es_math again.



Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #4 on: February 22, 2008, 08:58:45 PM »
Is that even the right line Kryptonite said I should change?

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #5 on: March 11, 2008, 03:39:06 PM »
Hm, still having problems finding the exact file and line that I need to change to make this work. Anyone have any ideas?

Offline kryptonite

  • <WCS coder>
  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1110
    • http://wc3source.de
Re: Exponential XP requirements
« Reply #6 on: March 11, 2008, 03:56:13 PM »
hmm yes...this line should be good.
Aren't there some comments in the code?

But try this:
Code: (eventscripts) [Select]
es_mathparse wcs_levelup "wcs_levelup * wcs_levelup * wcs_levelxp"if you use es_math, you can only do A = A % B, not many parameters.

if you have already some XP on the server, there might be some bugs on next levelup....so better try this on a clean server :)
[spoiler=Buy me a ...]  :mrgreen:[/spoiler]

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #7 on: March 11, 2008, 04:22:51 PM »
So should I replace this line:

Code: (eventscripts) [Select]
es_math wcs_levelup * server_var(wcs_levelxp)
with this line:

Code: (eventscripts) [Select]
es_mathparse wcs_levelup "wcs_levelup * wcs_levelup * wcs_levelxp"

Or should I add the 2nd line under the 1st?
Sorry I'm still a bit new to this, but I'm starting to get the hang of it  :)

Offline kryptonite

  • <WCS coder>
  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1110
    • http://wc3source.de
Re: Exponential XP requirements
« Reply #8 on: March 11, 2008, 05:01:47 PM »
yes, just replace.
and make a backup before! or comment the line.

Code: (eventscripts) [Select]
//es_math wcs_levelup * server_var(wcs_levelxp)
es_mathparse wcs_levelup "wcs_levelup * wcs_levelup * wcs_levelxp"

another method:
Code: (eventscripts) [Select]
es_math wcs_levelup * server_var(wcs_levelxp)
es_math wcs_levelup * server_var(wcs_levelup)

its your choice :D

btw, in which block are you? wcs_givexp? (you may need to change block wcs_givelevel too)
[spoiler=Buy me a ...]  :mrgreen:[/spoiler]

Offline Luthic

  • Level 1 Trained Beginner
  • *
  • Posts: 25
Re: Exponential XP requirements
« Reply #9 on: March 11, 2008, 05:09:26 PM »
Yeah I was in the givexp block. It was the only one I could find that had a similar line of code to the one you posted. I will check both blocks and let you know how it goes, thanks a milion!  :mrgreen: