GS-Zone

Bug de Inventario Ir al Indice

Moderadores: Moderadores de Argentum, Especialistas de Argentum, Especialistas de Programación

9
Este tema se encuentra cerrado.

Nota » 28 Ene 2012 10:24

Buenas, hoy he detectado un bug de inventario, y queria saber a que parte del codigo tengo que reparar para que el inventario funcion perfectamente. Ejemplo del bug:
Cuando llenamos el inventario, salimos, creamos otro personaje(probe en otra cuenta) y saldra todo el inventario anterior en el inventario del nuevo pj creado xDDD pero en realidad no tiene nada, ya que si intentamos equipar, no nos deja. Osea esto me suena a bug mas grafico que otra cosa, sera x el Dx8? y si agarra* algo , ese nuevo item reemplaza el item ficticio xD. Si podeis dar alguna opinion o ayuda, agradecia :P Suerte

Administrador de CruzNegrAO (Servidor Mundial Style IAO Pero Mas Desarrollado...)
http://www.cruznegrao.webs.com
RaZoV - lLider de CruzNegra|
454
Aprendiz [2]
Registrado: Diciembre 2011
Ubicación: Portugal
Mensajes: 259
Aportes: 2

Nota » 28 Ene 2012 10:27

no, solo es el dibujito del item, no se puede "materializar" si por asi decir, el dibujo en un item, es solo el grh.



Santty.- escribió:Si, soy hincha de tu padre, el que te gana cada vez que te cruza, el dueño del barrio, el orgullo nacional, rey de copas y el máximo ganador de copa libertadores

PROBLEM?





La gente que cuando camina mueve un poco los labios está practicando respuestas originales para discusiones que ya perdieron hace dos horas.
YPF etatizada: -Hola q carga? -Deme Néstor Súper
681
Dragon Ancestral [4]
Registrado: Años de membresíaAños de membresía
Ubicación: Mendoza
Mensajes: 3545
Aportes: 40

Nota » 28 Ene 2012 22:42

Creo que es porque este que lo descargue ya venia con el NoSeCae modificado.. osea, que como es ideal para battleserver, pos pondra que no se caigan los items(estilo iao) y por eso pasa eso :P ya que yo con el iao clon probe tmb hacer eso, que un item no se caiga asi x asi, y pasaba lo mismo, al desekipar quedaba la imagen igual :P Borro el nosecae y listo? es que no quiero "cagrla XD "

Administrador de CruzNegrAO (Servidor Mundial Style IAO Pero Mas Desarrollado...)
http://www.cruznegrao.webs.com
RaZoV - lLider de CruzNegra|
454
Aprendiz [2]
Registrado: Diciembre 2011
Ubicación: Portugal
Mensajes: 259
Aportes: 2

Nota » 30 Ene 2012 13:10

ZoLTaR escribió:Creo que es porque este que lo descargue ya venia con el NoSeCae modificado.. osea, que como es ideal para battleserver, pos pondra que no se caigan los items(estilo iao) y por eso pasa eso :P ya que yo con el iao clon probe tmb hacer eso, que un item no se caiga asi x asi, y pasaba lo mismo, al desekipar quedaba la imagen igual :P Borro el nosecae y listo? es que no quiero "cagrla XD "


no entiendo q relacion puede tener con el nosecae. si lo q vos decis es q la imagen se te qeda no el item



Santty.- escribió:Si, soy hincha de tu padre, el que te gana cada vez que te cruza, el dueño del barrio, el orgullo nacional, rey de copas y el máximo ganador de copa libertadores

PROBLEM?





La gente que cuando camina mueve un poco los labios está practicando respuestas originales para discusiones que ya perdieron hace dos horas.
YPF etatizada: -Hola q carga? -Deme Néstor Súper
681
Dragon Ancestral [4]
Registrado: Años de membresíaAños de membresía
Ubicación: Mendoza
Mensajes: 3545
Aportes: 40

Nota » 30 Ene 2012 21:11

Eso mismo tienes razon, es que yo creia que tmb quedaba el item xD una confusion, Osea el bug es ese mismo, que al tirar el item queda la imagen de ese item igualmente pero obvio no nos deja equipar, y si creamos otro pj saldra ese dibujo del item en el inventario igualmente, y igualmente no podremos usar, osea no se actualiza el inventario, no se queda "vacio" el tile del inventario en negro... sugieren algo?

Administrador de CruzNegrAO (Servidor Mundial Style IAO Pero Mas Desarrollado...)
http://www.cruznegrao.webs.com
RaZoV - lLider de CruzNegra|
454
Aprendiz [2]
Registrado: Diciembre 2011
Ubicación: Portugal
Mensajes: 259
Aportes: 2

Nota » 30 Ene 2012 21:50

y si pones para que se actualize el inventario al tirar algun item ?? posteme el modulo de clase graphicalinvetori o como sea

Imagen
Ninja en progreso
914
Dragon Ancestral [5]
Registrado: Años de membresía
Ubicación: • olivos •
Mensajes: 4094
Aportes: 13

Nota » 31 Ene 2012 00:01

  1. Option Explicit
  2.  
  3. Dim InventoryOffset As Long             'Number of lines we scrolled down from topmost
  4. Dim InvSelectedItem As Long             'Currently selected item
  5.  
  6. 'Dim InvSurface As DirectDrawSurface7            'DD Surface used to render everything
  7.  
  8. Dim UserInventory(1 To MAX_INVENTORY_SLOTS) As Inventory    'User's inventory
  9.  
  10. Dim WithEvents InventoryWindow As PictureBox    'Placeholder where to render the inventory
  11.  
  12. #If ConMenuesConextuales = 1 Then
  13.     Dim ItemMenu As Menu    'Menu to be shown as pop up
  14. #End If
  15.  
  16. Private Sub Class_Initialize()
  17. '***************************************************
  18. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  19. 'Last Modify Date: 27/07/04
  20. '
  21. '***************************************************
  22. End Sub
  23.  
  24. Private Sub Class_Terminate()
  25. '***************************************************
  26. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  27. 'Last Modify Date: 27/07/04
  28. '
  29. '***************************************************
  30. End Sub
  31.  
  32. Public Sub ScrollInventory(ByVal up As Boolean)
  33. '***************************************************
  34. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  35. 'Last Modify Date: 27/07/04
  36. 'Scrolls the graphical inventory up / down
  37. '***************************************************
  38.     'Only move if there is something to show up /down
  39.     If up Then
  40.         If (InventoryOffset + (InventoryWindow.ScaleHeight \ TilePixelHeight)) * (InventoryWindow.ScaleWidth \ TilePixelWidth) < MAX_INVENTORY_SLOTS Then _
  41.             InventoryOffset = InventoryOffset + 1
  42.     Else
  43.         If InventoryOffset > 0 Then _
  44.             InventoryOffset = InventoryOffset - 1
  45.     End If
  46. End Sub
  47.  
  48. Public Sub SelectGold()
  49. '***************************************************
  50. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  51. 'Last Modify Date: 27/07/04
  52. 'Sets the gold as the currently selected item
  53. '***************************************************
  54.     Dim prevSelectedItem As Long
  55.    
  56.     'Store preivously selected item
  57.     prevSelectedItem = InvSelectedItem
  58.    
  59.     'Select the gold
  60.     InvSelectedItem = FLAGORO
  61.    
  62.  
  63. End Sub
  64.  
  65. Public Property Get SelectedItem() As Long
  66. '***************************************************
  67. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  68. 'Last Modify Date: 27/07/04
  69. 'Retrieves the selected item index
  70. '***************************************************
  71.     SelectedItem = InvSelectedItem
  72. End Property
  73.  
  74. Public Property Get MaxHit(ByVal slot As Byte) As Integer
  75. '***************************************************
  76. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  77. 'Last Modify Date: 27/07/04
  78. 'Retrieves the max hit of the selected item
  79. '***************************************************
  80.     MaxHit = UserInventory(slot).MaxHit
  81. End Property
  82.  
  83. Public Property Get MinHit(ByVal slot As Byte) As Integer
  84. '***************************************************
  85. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  86. 'Last Modify Date: 27/07/04
  87. 'Retrieves the min hit of the selected item
  88. '***************************************************
  89.     MinHit = UserInventory(slot).MinHit
  90. End Property
  91.  
  92. Public Property Get Def(ByVal slot As Byte) As Integer
  93. '***************************************************
  94. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  95. 'Last Modify Date: 27/07/04
  96. 'Retrieves the defense of the selected item
  97. '***************************************************
  98.     Def = UserInventory(slot).Def
  99. End Property
  100.  
  101. Public Property Get grhindex(ByVal slot As Byte) As Integer
  102. '***************************************************
  103. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  104. 'Last Modify Date: 27/07/04
  105. 'Retrieves the grh index of the selected item
  106. '***************************************************
  107.     grhindex = UserInventory(slot).grhindex
  108. End Property
  109.  
  110. Public Property Get Valor(ByVal slot As Byte) As Single
  111. '***************************************************
  112. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  113. 'Last Modify Date: 27/07/04
  114. 'Retrieves the value of the selected item
  115. '***************************************************
  116.     Valor = UserInventory(slot).Valor
  117. End Property
  118.  
  119. Public Property Get Amount(ByVal slot As Byte) As Long
  120. '***************************************************
  121. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  122. 'Last Modify Date: 27/07/04
  123. 'Retrieves the selected item's amount
  124. '***************************************************
  125.     If slot = FLAGORO Then
  126.         Amount = UserGLD
  127.     ElseIf slot >= LBound(UserInventory) And slot <= UBound(UserInventory) Then
  128.         Amount = UserInventory(slot).Amount
  129.     End If
  130. End Property
  131.  
  132. Public Property Get OBJIndex(ByVal slot As Byte) As Integer
  133. '***************************************************
  134. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  135. 'Last Modify Date: 27/07/04
  136. 'Retrieves the selected item's object index
  137. '***************************************************
  138.     OBJIndex = UserInventory(slot).OBJIndex
  139. End Property
  140.  
  141. Public Property Get OBJType(ByVal slot As Byte) As Integer
  142. '***************************************************
  143. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  144. 'Last Modify Date: 27/07/04
  145. 'Retrieves the selected item's object type
  146. '***************************************************
  147.     OBJType = UserInventory(slot).OBJType
  148. End Property
  149.  
  150. Public Property Get ItemName(ByVal slot As Byte) As String
  151. '***************************************************
  152. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  153. 'Last Modify Date: 27/07/04
  154. 'Retrieves the selected item's name
  155. '***************************************************
  156.     ItemName = UserInventory(slot).Name
  157. End Property
  158.  
  159. Public Property Get Equipped(ByVal slot As Byte) As Boolean
  160. '***************************************************
  161. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  162. 'Last Modify Date: 27/07/04
  163. 'Retrieves True if the item at the given pos is eqiupped
  164. '***************************************************
  165.     Equipped = UserInventory(slot).Equipped
  166. End Property
  167.  
  168. Public Sub SetItem(ByVal slot As Byte, ByVal eOBJIndex As Integer, ByVal eAmount As Integer, ByVal eEquipped As Byte, _
  169.                         ByVal eGrhIndex As Integer, ByVal eObjType As Integer, ByVal eMaxHit As Integer, ByVal eMinHit As Integer, _
  170.                         ByVal eDef As Integer, ByVal eValor As Single, ByVal eName As String, ByVal PuedeUsar As Byte)
  171. '***************************************************
  172. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  173. 'Last Modify Date: 12/04/06
  174. 'Sets all data for a given inventory slot
  175. '***************************************************
  176.     If slot < 1 Or slot > MAX_INVENTORY_SLOTS Then Exit Sub
  177.    
  178.     With UserInventory(slot)
  179.         .Amount = eAmount
  180.         .Def = eDef
  181.         .Equipped = eEquipped
  182.         .grhindex = eGrhIndex
  183.         .MaxHit = eMaxHit
  184.         .MinHit = eMinHit
  185.         .Name = eName
  186.         .OBJIndex = eOBJIndex
  187.         .OBJType = eObjType
  188.         .PuedeUsar = PuedeUsar
  189.         .Valor = eValor
  190.     End With
  191.    
  192. End Sub
  193.  
  194. Private Function ClickItem(ByVal x As Long, ByVal y As Long) As Long
  195. '***************************************************
  196. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  197. 'Last Modify Date: 27/07/04
  198. 'Selects the item clicked if it's valid and return's it's index
  199. '***************************************************
  200.     Dim TempItem As Long
  201.     Dim temp_x As Long
  202.     Dim temp_y As Long
  203.    
  204.     temp_x = x \ 32
  205.     temp_y = y \ 32
  206.    
  207.     TempItem = temp_x + (temp_y + InventoryOffset) * (InventoryWindow.ScaleWidth \ 32) + 1
  208.    
  209.     'Make sure it's within limits
  210.     If TempItem <= MAX_INVENTORY_SLOTS Then
  211.         'Make sure slot isn't empty
  212.         If UserInventory(TempItem).grhindex Then
  213.             ClickItem = TempItem
  214.         Else
  215.             ClickItem = 0
  216.         End If
  217.     End If
  218. End Function
  219.  
  220. Public Sub DrawInventory()
  221.     Dim i As Byte
  222.     Dim x As Integer
  223.     Dim y As Integer
  224.    
  225.     For i = 1 To UBound(UserInventory)
  226.         If UserInventory(i).grhindex Then
  227.             x = ((i - 1) Mod (InventoryWindow.width / 32)) * 32 + 2
  228.             y = ((i - 1) \ (InventoryWindow.width / 32)) * 32 + 2
  229.             If UserInventory(i).PuedeUsar = 0 Then Call engine.Text_Render_ext(y + 20, x, 32, 32, D3DColorXRGB(255, 0, 0), False)
  230.             If InvSelectedItem = i Then
  231.                 Call engine.Draw_FilledBox(x, y, 32, 32, D3DColorXRGB(0, 0, 0), D3DColorXRGB(255, 0, 0))
  232.             End If
  233.             Call engine.Draw_GrhIndex(UserInventory(i).grhindex, x, y)
  234.             If UserInventory(i).PuedeUsar = 0 Then Call engine.Draw_GrhIndex(UserInventory(i).grhindex, x, y, D3DColorXRGB(255, 0, 0))
  235.             Call engine.Text_Render_ext(UserInventory(i).Amount, y, x, 40, 40, D3DColorXRGB(255, 255, 255))
  236.             If UserInventory(i).Equipped Then
  237.                 Call engine.Text_Render_ext("+", y + 20, x + 20, 40, 40, D3DColorXRGB(255, 255, 255))
  238.             End If
  239.         End If
  240.     Next i
  241. End Sub



Estara en draw inventory talvez xd una cosa que nunca lei y talvez dire una gran tonteria pero nose, esto fue pasado a directx 8, y ahi pone directdraw7, no tendria que ser directdraw8? aunque sea tonteria prefiero decir asi aprendo algo mas ^^ XD

Administrador de CruzNegrAO (Servidor Mundial Style IAO Pero Mas Desarrollado...)
http://www.cruznegrao.webs.com
RaZoV - lLider de CruzNegra|
454
Aprendiz [2]
Registrado: Diciembre 2011
Ubicación: Portugal
Mensajes: 259
Aportes: 2

Nota » 31 Ene 2012 00:20

Mira hace algo ^^

Usa esto

inventarios_renderizados_v2_tiAW.html
Seria el code del inventario renderizado mejorado

Imagen
Ninja en progreso
914
Dragon Ancestral [5]
Registrado: Años de membresía
Ubicación: • olivos •
Mensajes: 4094
Aportes: 13

Nota » 31 Ene 2012 18:59

Solucionado

Para el que no sepa, el bug esta en el actualizado del inventario, osea ir al Case CSI y con un retoque queda todo de 10 ^^

Administrador de CruzNegrAO (Servidor Mundial Style IAO Pero Mas Desarrollado...)
http://www.cruznegrao.webs.com
RaZoV - lLider de CruzNegra|
454
Aprendiz [2]
Registrado: Diciembre 2011
Ubicación: Portugal
Mensajes: 259
Aportes: 2

Este tema se encuentra cerrado.

Volver a AO 0.11.5

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados