Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Experience Generator


Richy420Rich
 Share

Recommended Posts

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

```
Link to comment
Share on other sites

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. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)
Link to comment
Share on other sites

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. :]
Link to comment
Share on other sites

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 ^^ )
Link to comment
Share on other sites

> 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.
Link to comment
Share on other sites

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](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
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.
Link to comment
Share on other sites

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...