Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visual Spells - Error
#7
Matt Wrote:Possibly not setting the scrlframe value to whatever the value you saved to the item, properly.

Whenever I save an spell, I can open it fine and it displays the correct picture.

Code:
' :::::::::::::::::::
' :: Spells packet ::
' :::::::::::::::::::
Private Sub HandleSpells(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim i As Long
Dim j As Long
Dim n As Long
Dim k As Long
Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer
    
    Buffer.WriteBytes Data()
    
    With frmSpells
        .Visible = True
                
        For i = 1 To MAX_PLAYER_SPELLS
           k = Buffer.ReadLong
           PlayerSpells(k) = Buffer.ReadLong
        Next
        
        ' Put spells known in player record
        For i = 1 To MAX_PLAYER_SPELLS
            If PlayerSpells(i)  0 Then
                .picSpell(Int(i - 1)).Picture = LoadPicture(App.Path & "\gfx\spells\icons\" & Trim$(Spell(i).Frame) & ".bmp")
            Else
                .picSpell(Int(i - 1)).Picture = Nothing
            End If
        Next
    End With
End Sub
Apparently, this line returns 0 as the frame...
Code:
.picSpell(Int(i - 1)).Picture = LoadPicture(App.Path & "\gfx\spells\icons\" & Trim$(Spell(i).Frame) & ".bmp")
And, obviously, this line from the Sub SpellEditorInit loads the picture the same way, and it works fine there...
Code:
.scrlFrame = Spell(EditorIndex).Frame
So I have no idea what's wrong.... Well I am a newb in working with MS though...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)