balliztik1 Posted June 1, 2010 Author Share Posted June 1, 2010 The older versions of Eclipse had experience tables that were editable through a .ini file in the server. It's a fairly simple edit to recreate this.**Please note: If you have access to the source code (which is pretty much assumed if you're here), and your experience table is based on a formula, it's much easier just to change the GetPlayerNextLevel function and MAX_LEVELS constant to suit your needs rather than having to implement a .ini system.**_All edits are server-side._The first thing that needs to be done is to get rid of the old experience system. It is very loosely integrated, so it's not too hard to do. Find and delete the following:```Function GetPlayerNextLevel(ByVal index As Long) As Long GetPlayerNextLevel = (GetPlayerLevel(index) + 1) * (GetPlayerStat(index, Stats.strength) + GetPlayerStat(index, Stats.endurance) + GetPlayerStat(index, Stats.intelligence) + GetPlayerStat(index, Stats.spirit) + GetPlayerPOINTS(index)) * 25End Function``````Public Const MAX_LEVELS As Byte = 100```Now, we just need to add in our new system. We'll need to set up two variables to do this. Add the following to the source (preferably in modGlobals if you value organization):```Public MAX_LEVELS As BytePublic Experience() As Long```Now, a simple loading sub will set everything up. Add this, preferably in modDatabase:```Sub LoadExperience() Dim I As Byte If Not FileExist("data\Experience.ini") Then Call SetStatus("Generating experience table...") MaxLevel = 100 Call PutVar(App.Path & "\data\Experience.ini", "Max", "MaxLevel", CStr(MaxLevel)) ReDim Experience(1 To MaxLevel) For I = 1 To MaxLevel Experience(I) = I * 25 Call PutVar(App.Path & "\data\Experience.ini", "Exp", CStr(I), CStr(Experience(I))) Next Else Call SetStatus("Loading experience...") MaxLevel = CByte(GetVar(App.Path & "\data\Experience.ini", "Max", "MaxLevel")) ReDim Experience(1 To MaxLevel) For I = 1 To MaxLevel Experience(I) = CLng(GetVar(App.Path & "\data\Experience.ini", "Exp", CStr(I))) Next End IfEnd Sub```Now, all that needs to be done is to make sure this is called. Find Sub LoadGameData and add this to it somewhere:```Call LoadExperience```As a last touch, just make sure to replace the old GetPlayerNextLevel (located in modPlayer) with this new one that reflects the proper values:```Function GetPlayerNextLevel(ByVal Index As Long) As Long If GetPlayerLevel(Index) = MAX_LEVELS Then GetPlayerNextLevel = 9999999 Else GetPlayerNextLevel = Experience(GetPlayerLevel(Index) + 1) End IfEnd Function```To note, there's nothing in place yet to stop players from gaining experience once they've hit the level cap, so a slight change might be in order to the way SetPlayerExp works. Consider changing it to this:```Sub SetPlayerExp(ByVal Index As Long, ByVal EXP As Long) If GetPlayerLevel(Index) = MAX_LEVELS Then EXP = 0 Player(Index).EXP = EXPEnd Sub```Either do that, or restrict experience from accruing at the max level somehow. How you do it really doesn't matter, though.That's that - a simple edit that allows a custom experience table. Just fire up the server and it will auto-create the .ini for you. All you need to do is alter it. Link to comment Share on other sites More sharing options...
Mulkaar Posted July 6, 2010 Share Posted July 6, 2010 Surprised no one has commented on this excellent work as usual Ballie can't wait to see more EO edits. Link to comment Share on other sites More sharing options...
L0lz Posted July 7, 2010 Share Posted July 7, 2010 Didn't even see this. Great stuff, it'll be way easier to modify exp tables now. Link to comment Share on other sites More sharing options...
adr990 Posted July 12, 2010 Share Posted July 12, 2010 ~~This is so useful. :) Thanks for this, it really makes it easier to change it, and you have less risk messing stuff up.Edit:I get the follow error while trying to compile.I've double checked everything, but everything should be correct.Image:>! ![](http://img594.imageshack.us/img594/6488/maxlvlerror.png)What to do?~~Sloved. Link to comment Share on other sites More sharing options...
Robin Posted July 12, 2010 Share Posted July 12, 2010 You need to stop posting such huge screenshots. -_-Add 'Dim MaxLevel as long' under 'Dim I as Byte'. Link to comment Share on other sites More sharing options...
adr990 Posted July 12, 2010 Share Posted July 12, 2010 Oh yes, sorry about that. I either will make them smaller or put them in spoilers next time.But thanks again, this fixed it. :)Also, if I did use this "Dim MaxMap as long" and change a little few other things on the MaxMaps scripts (If I found it.) I could have more maps than 255, right? (Also for NPC, Shops, etc.)And again, this is so far the best Eclipse MMORPG Maker I worked with. :)I'm getting used to it quickly also.Edit:My level up system is borken. I keep remaining op lvl1 with 25exp.Anyone else having this too?I'm messing with it now, though no success yet. Link to comment Share on other sites More sharing options...
DarkSpine Posted July 19, 2010 Share Posted July 19, 2010 I found the error!!Do NOT delete:```Public Const MAX_LEVELS As Byte = 100```But rather change it to what you want your max level to be.Now, search for```Public Const MAX_LEVELS As Byte = 100```in the client, and change it to match what's in the server. Also, in the server, search and delete```Public MAX_LEVELS As Byte```I tested it myself, now the EXP in the .ini loads, updates when you level, and leveling works.Note: To change the max level, you'll have to change the```Public Const MAX_LEVELS As Byte = 100```in the client and server again. But hey, it works!~Urame Link to comment Share on other sites More sharing options...
Sir Cid Posted August 23, 2010 Share Posted August 23, 2010 Many thanks to the OP, but also to Urame Hinote, without his fixes this wouldn't have worked properly. Link to comment Share on other sites More sharing options...
DarkSpine Posted August 26, 2010 Share Posted August 26, 2010 @Sir:> Many thanks to the OP, but also to Urame Hinote, without his fixes this wouldn't have worked properly.No problem, but now I know how to send data from server to client, sooo…Here's a better fix which allows the .ini to work setting max level![http://www.touchofdeathforums.com/smf/index.php/topic,64180.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,64180.0.html)Hope that helps everyone =D~Urame Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 > As a last touch, just make sure to replace the old GetPlayerNextLevel (located in modPlayer) with this new one that reflects the proper values:> > ```> Function GetPlayerNextLevel(ByVal Index As Long) As Long> If GetPlayerLevel(Index) = MAX_LEVELS Then> GetPlayerNextLevel = 9999999> Else> GetPlayerNextLevel = Experience(GetPlayerLevel(Index) + 1)> End If> End Function> ```I cannot find GetPlayerNextLevel as a function. Has this been updated in Origins? I have the latest version.Here is what I find in "modplayer" on the "server" source when I search GetPlayerNextLevel:``` Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) expRollover = GetPlayerExp(Index) - GetPlayerNextLevel(Index)``` Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 If you can't find it you're doing something wrong, because it's quite clearly being called there. xD Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> If you can't find it you're doing something wrong, because it's quite clearly being called there. xDLmfao, Ikr? I see it's being called, but I can't find the function code to save my life.. XD Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 Search the _entire project_. Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> Search the _entire project_.I searched the entire "server source". Nothing… o_O?EDIT:Now I'm just scamming through it again, still not finding it. Should I be searching "GetPlayerNextLevel" or something else? Because that's what I am searching for. Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 @viciousdead:> I searched the entire "server source". Nothing… o_OPost exactly what you're searching for. Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> @viciousdead:> > > I searched the entire "server source". Nothing… o_O> > Post exactly what you're searching for.I did, sorry I edit almost everytime I make a post… :icon_alabanza:"GetPlayerNextLevel" Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 The only thing I can think of is that you haven't loaded up the project properly. Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> The only thing I can think of is that you haven't loaded up the project properly.Any suggestions? :sad: Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 @viciousdead:> Any suggestions? :sad:Give up. Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> @viciousdead:> > > Any suggestions? :sad:> > Give up.I love your positive outlook..Here is a screenie of the maddness..:>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/00b5c43b7a507dc62ad52c927163c97a.png) Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 ```dim MaxLevel as byte```That wasn't hard now, was it? Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> ```> dim MaxLevel as byte> ```> That wasn't hard now, was it?EDIT: ROBIN CHECK OUT THIS MADNESS:>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/22b134eefeee9b8c5ce4dfac585cd81e.png) Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2010 Share Posted September 10, 2010 You accidentally the entire function. Well done. Link to comment Share on other sites More sharing options...
viciousdead Posted September 10, 2010 Share Posted September 10, 2010 @Robin:> You accidentally the entire function. Well done.Lmfao, I didn't know I already deleted it XD XD XD XD!!!!EDIT EDIT:Nvm, I fixed it using google.. XDANDDD, I learned a new concept. :)EDIT EDIT EDIT: I found a new bug, when your playing in game your experience starts out as 50 and it does not change. When you level up, your exp til next level is still 50… Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now