Mirage Engine
Show Item-Data - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Show Item-Data (/showthread.php?tid=1624)



Show Item-Data - Sebalon - 17-03-2008

Hi, i have a smal problem to get the Itemdata. I used the Vis-Inv Tutorial fom the Tut-Section.
I dont realy know how i can make it else:

Code:
Dim d As Long
For d = 1 To 12
On Error Resume Next
If Index = d Then
    lstInv.Selected(d) = True
    If Item(GetPlayerInvItemNum(MyIndex, lstInv.SelCount + d - 1)).Name = "" Then
        IName.Caption = ""
    Else
        If Item(GetPlayerInvItemNum(MyIndex, d)).Type = ITEM_TYPE_CURRENCY Then
            IName.Caption = Trim(Item(GetPlayerInvItemNum(MyIndex, d)).Name) & " (" & GetPlayerInvItemValue(MyIndex, d) & ")"
            
        Else
                ' Check if this item is being worn
            If GetPlayerWeaponSlot(MyIndex) = d Or GetPlayerArmorSlot(MyIndex) = d Or GetPlayerHelmetSlot(MyIndex) = d Or GetPlayerShieldSlot(MyIndex) = d Then
                IName.Caption = Trim(Item(GetPlayerInvItemNum(MyIndex, d)).Name) & " (angelegt)"

                'Here i want to show the Damage/Armor
                Me.lbl_wert.Caption = "Schaden/Rüstung: " & Trim(Item(GetPlayerInvItemNum(MyIndex, d).Data2))
                
            Else
                IName.Caption = Trim(Item(GetPlayerInvItemNum(MyIndex, d)).Name)
                
            End If
        End If
    End If
End If
Next d

And every Time the Value i get is 0.


Re: Show Item-Data - William - 17-03-2008

Please post it with code tags and indents, then I will help.


Re: Show Item-Data - Sebalon - 17-03-2008

k, i editet it....


Re: Show Item-Data - William - 17-03-2008

Where do you have this code?


Re: Show Item-Data - Sebalon - 17-03-2008

frmMirage.... On the picInv_Click... Imade with a Tutorial a visual Inventory and the code shows what happend when i click on one of the Inv_Slots.


Re: Show Item-Data - William - 17-03-2008

Then start with remoing the for loop, cause you get the index from the inv slot you pressed on.