Yxxe Posted June 17, 2010 Author Share Posted June 17, 2010 Basically what I want to do in this piece of code is to display different pieces of lore to read, depending on whether the lore scripture is in their inventory. You click the label, it checks the inventory and updates labels (i'll add the pictures bit later). The only problem is that when I click the button, I come up with "Subscript out of range" error. I was wondering if anyone could help me. Here is the code so far:```Private Sub lblLore_Click()Dim i As Integer'check through inventory'maybe use select case?For i = 1 To MAX_ITEMS If GetPlayerInvItemNum(MyIndex, i) = 10 Then frmLore.lblVol2.Caption = "Volume 2 - " 'show image End If If GetPlayerInvItemNum(MyIndex, i) = 11 Then frmLore.lblVol3.Caption = "Volume 3 - " 'show image End If If GetPlayerInvItemNum(MyIndex, i) = 12 Then frmLore.lblVol4.Caption = "Volume 4 - " 'show image End If If GetPlayerInvItemNum(MyIndex, i) = 13 Then frmLore.lblVol5.Caption = "Volume 5 - " 'show image End If Next frmLore.Visible = TrueEnd Sub```When I go into debug, it points to the "GetPlayerInvItemNum" function, and has a value of zero.Thanks for your time. Link to comment Share on other sites More sharing options...
Robin Posted June 17, 2010 Share Posted June 17, 2010 MAX_ITEMS is how many items the game can handle. 255 or something.MAX_INV is the size of the inventory. Link to comment Share on other sites More sharing options...
Yxxe Posted June 17, 2010 Author Share Posted June 17, 2010 Thanks for the help Robin, works fine now. :) 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