[EO] Experience Generator

A small program I did which allows developers to generate custom Experience (To Next Levels) Without being bound to a formula.

Firstly, download the attached program and place the application in your server folder.

Open it up and set your levels/experience needed, click Generate when you’re finished.

I’ve included the source so you can add levels or build off it or whatever.

This also requires some server side source edits, follow the tutorial below.

Server, modTypes… Before the Public Types;


Public Generate As LevelRec

Under Public Type OptionRec


Public Type LevelRec

Experience(1 To MAX_LEVELS) As Long

End Type

Server, ModDatabase, you need these; Put these on the bottom.


Public Sub LoadExpFile()

Dim filename As String

Dim F As Long

Call CheckExpFile

filename = App.Path & "\data\Experience" & ".dat"

F = FreeFile

Open filename For Binary As #F

Get #F, , Generate

Close #F

End Sub

Public Sub CheckExpFile()

If Not FileExist("\data\Experience.dat") Then

Call SaveExpFile

End If

End Sub

Public Sub SaveExpFile()

Dim filename As String

Dim F As Long

filename = App.Path & "\data\Experience" & ".dat"

F = FreeFile

Open filename For Binary As #F

Put #F, , Generate

Close #F

End Sub

In server, ModGeneral - LoadGameData, Before the end sub.


Call SetStatus("Loading Experience Sheet...")

Call LoadExpFile

In server, ModPlayer, replace GetPlayerNextLevel with this;


Function GetPlayerNextLevel(ByVal index As Long) As Long

If Generate.Experience(GetPlayerLevel(index)) > 0 Then

GetPlayerNextLevel = Generate.Experience(GetPlayerLevel(index))

Else

GetPlayerNextLevel = (50 / 3) * ((GetPlayerLevel(index) + 1) ^ 3 - (6 * (GetPlayerLevel(index) + 1) ^ 2) + 17 * (GetPlayerLevel(index) + 1) - 12)

End If

End Function

Working because you know ^^ …

By the way Hp /mp generator would be nice no? :P (suggestion)

Yea Hp and Mp if you did that it would be the awesomest :D

Yup, you just set the MAX property of the level scrollbar to whatever your max level is - That’s why I included the source.

As for the HP/MP… It’s possible, just add the types and scrollbars to the generator for HP/MP. Make it save on clicking Generate and then edit the GetPlayerMaxVital to read from the generator types. You homies gonna have to learn sometime so I’m just gonna leave this as a base. ;)

You should make a tut atleast how to convert it to HP/Mp atleast because you are the maker of the program :D would help

Better say because some people (like me) are going to mess things and tell : not working *Hahahaha :D *

He doesn’t have to, you two are just lazy and can’t be bothered to learn. Nor do you have any right to nag him if you change it into something it was never intended for.

Anyway, nice work… Although I’d personally still prefer to stick to a formula. Math isn’t THAT hard. :]

Being lazy no . Actually it’s easy saying where to look etc… but when you don’t know the code you need to use it’s hard…

(for exp = getplayernextlevel) actually for hp mp i don’t even know how it’s called so no it’s not being lazy it’s just don’t know everything to do it… and i’m still learning the vb6

(my messager is not provocating sorry that’s my english don’t let me tell it without that feeling of being angry ^^ )

He doesn’t have to, you two are just lazy and can’t be bothered to learn. Nor do you have any right to nag him if you change it into something it was never intended for.

Anyway, nice work… Although I’d personally still prefer to stick to a formula. Math isn’t THAT hard. :]

Thanks, it was requested more than once so I just posted it here, personally I don’t mind a formula but customs are alright also if you don’t want it to look like a pattern.

Being lazy no . Actually it’s easy saying where to look etc… but when you don’t know the code you need to use it’s hard…

(for exp = getplayernextlevel) actually for hp mp i don’t even know how it’s called so no it’s not being lazy it’s just don’t know everything to do it… and i’m still learning the vb6

(my messager is not provocating sorry that’s my english don’t let me tell it without that feeling of being angry ^^ )

Smallville. It’ll be in modCombat, Function - GetPlayerMaxVital

They’re split up by classes, in essence, Knight’s have more HP than Mages but Mages have more MP than Knights.

And I personally think it’s silly to give multiple values per level like this program does for Experience.

So check that Function and the last number in the formula is the base for which you’re giving per level, the rest of the formula is just adding a Stat and Level mix to it to break pattern.

Omg no.more sitting infront of my calculator… thanks for sharing richy this is cool

@Brandon: gtfo Would you kindly leave this topic good Sir?

Congratulations, this is really useful, thanks for sharing.

Thanks Richy That’s all i needed to know ;) !

Best way I have seen in forum for custom exp for lvl.

Thanks. :)

Lol thanks everyone, I didn’t think many would really use it but it was a very easy program to make, it saves a crapload of case coding, and also faster than the old fashioned .ini I/O. Of course, a formula is the most effecient way to do it but each to their own. :P

I have a problem, my settings:

Level 1: 50exp

Level 2: 80exp

Level 3: 120exp

Level 4: 180exp

Level 5: 240exp

but in game i need only 15 exp for level 2, 30 for level 3, 45 for level 4, whats wrong?

1. You need to place the Experience Generator inside your server folder, it will redirect the Experience.dat file to the data folder.

2. Then you need to set the level/experience within the Experience Generator, then save it once you’re finished.

3. Then you need to add the code that is instructed in the OP inside your servers source.

@clark; This doesn’t cause DX8 issues, it doesn’t even mess with any DX components; The vital addition must be causing the DX8 issue. Talk to the dude who added that.

@Anyone else; If these instructions don’t work, then you’re doing it wrong.

Aight I stand corrected, apologies. There was a relatively small bug that came with this application which I’ve fixed in the OP. Just redownload the application and it should work.

Just wanted to say thanks, Richy. I love it.

This is sweet man, nice one 🙂

Log in to reply