Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visual Spells - Error
#1
Hey there,
Well basically, while making Visual Inventory (which now works) and Visual Spells (with icons) I encountered an error. The spells icon won't save so I always end up with the blank one...

What I did was remove the frame from the spell editor. I called the icon's variable "Frame" as it is easier to remember since scrlFrame already existed. Spell casting works, learning spells works but not getting the proper icons. So, if anyone could list up all the places I need to add stuff to make a new variable in spells so I can see if I am misssing some, please do so.

Thanks,
AkselJ
Reply
#2
Follow your save and edit spell packets.
Reply
#3
I tried that, but I couldn't find anything there...
Reply
#4
Is this the byte array packets version or the original method?

Either way, you have to send in the exact same order and when it comes to the byte array method, if you write a long, you have to read a long.
Reply
#5
I tried following the packets again, and noticed somplace i forgot to add the new variable. Now, though, the pictures won't load in the spells list, it only returns the spell as 0 loading the empty spell frame... Any ideas?
Reply
#6
Possibly not setting the scrlframe value to whatever the value you saved to the item, properly.
Reply
#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
#8
Why are you subtracting 1 from i at the start of it, but not anywhere else? That makes no sense..
Reply
#9
It makes perfect sense as the index for the picSpell starts with 0 and spell indexes starts with 1

Edit: Figured out I was wrong, I was supposed to use Trim$(Spell(PlayerSpells(i)).Frame) and not Trim$(Spell(i).Frame).. Thanks, you got me on the tought Big Grin

Still suffering from the error though.... :S
Reply
#10
Bump
Reply
#11
Bump =(
Reply
#12
Bump

C'mon someone must know
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)