Who is ready to see some effed up stuff?

I’ve added in a secondary level system that activates once a player hits max level called Prestige Levels that accumulating once you’ve reached base max level.

derp. fixed.

NEW ERROR!

Any character already made is fine but upon loading a new character, there is a subscript out of range error 9 on the If PGenerate.Experience line.

here’s the code:

Function GetPlayerNextPLevel(ByVal index As Long) As Long

If GetPlayerPLevel(index) < MAX_PLEVELS Then

If PGenerate.Experience(GetPlayerPLevel(index)) > 0 Then

GetPlayerNextPLevel = PGenerate.Experience(GetPlayerPLevel(index))

Else

GetPlayerNextPLevel = 18500 + ((GetPlayerLevel(index) - 20) + 1250)

End If

End If

End Function

inModDatabase

Public Sub LoadPExpFile()

Dim filename As String

Dim F As Long

Call CheckPExpFile

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

F = FreeFile

Open filename For Binary As #F

Get #F, , PGenerate

Close #F

End Sub

Public Sub CheckPExpFile()

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

Call SavePExpFile

End If

End Sub


Public Sub SavePExpFile()

Dim filename As String

Dim F As Long

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

F = FreeFile

Open filename For Binary As #F

Put #F, , PGenerate

Close #F

End Sub

Yes, I havePublic PGenerate As PLevelRecat the top of modTypes and```
Public Type PLevelRec

Experience(1 To MAX_PLEVELS) As Long

End Type

I broke it again.

The source of the EXP Generator has to be the same as your eclipse source (In ModTypes).

Like said in the shoutbox, the Generator creates the file by those Types which then the game has to read.

There’s 2 ways you can do this, edit the Exp Gen to suit the new types, or re-work the game source to suit the Generator types.

The following will be something to think about if and only if the player begins the game a prestige 0.

You define PGenerate.Experience as being 1 to max p levels however when you create the new character, the p level is 0. SO, when you try to get PGenerate.Experience(0) it will throw a subscript out of range because 0 is less than 1.

PS If that was already fixed than I apologize… I have absolutely no idea what Richy is talking about in the post above.

The following will be something to think about if and only if the player begins the game a prestige 0.

You define PGenerate.Experience as being 1 to max p levels however when you create the new character, the p level is 0. SO, when you try to get PGenerate.Experience(0) it will throw a subscript out of range because 0 is less than 1.

PS If that was already fixed than I apologize… I have absolutely no idea what Richy is talking about in the post above.

Thanks! I hadn’t thought about that and that’s one possible source of an error.

The data its reading was generated by his EXP program that he created that allows for custom exp levels instead of scaling math stuff. So PLVL 1 = 3600, plvl 2 = 3700, while plvl 3 can be 3701 and plvl 4 3702. etc. It just makes it much easier than boundless codes of “if player plvl < 2 then nextexp = this” and so forth.

As it is, I was using his editor and I can’t use it twice in one program without editing it. Thanks though, the 1 to max would have actually thrown me off later down the line!

Log in to reply