Problema sistem armament

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
Goku99
Utilizator interzis !

Utilizator interzis !
Mesaje: 74
Membru din: 16 Dec 2014, 18:28
Server: Smith metin2
Regat: Chunjo
Aprecieri: 16  
Mulţumiri: 0
Medalii

*Problemă: Salut tuturor .. am incercat sa implementez si eu sistemul armament dar am urmatoarea problema .. skin-ul de arma si esarfa nu le pot muta pe inventarul de costume, .. orice index as incerca nu le pot baga in costumeequipmentdialog, ele apar doar in equipmentdialog iar daca incerc sa le mut in inventarul de costume ele apar in aer pana le mut eu. va las cateva poze mai jos pentru a ma intelege, va rog
Tipologie server:
*Resursă folosită: http://just4metin.ro/ghiduri-tutoriale/ ... 67726.html
*ServerFiles utilizat: Zearth 2
*Syserr:
Poză: Imagine Imagine [/b]
*Detalii suplimentare:
Avatar utilizator
.ShadoW
Nivel 4

Nivel 4
Mesaje: 659
Membru din: 14 Noi 2013, 17:54
Server: not yet..
Regat: Jinno
Aprecieri: 379  
Mulţumiri: 32  
Medalii

nici nu trebuie sa le pui in costumeequipmentdialog , si ai un python file in uiscript ce apartine de fereastra de armament cu tot cu costume , acolo trebuiesc aranjate indexurile

edit. uite cum am eu Click aici!
Imagine
Afișează semnătura
Avatar utilizator
Louie
Utilizator interzis !

Utilizator interzis !
Mesaje: 50
Membru din: 26 Dec 2017, 07:18
Server: Louie-mt2
Regat: Jinno
Aprecieri: 4  
Mulţumiri: 9  
Medalii

Probabil ai gresit la tab-uri
Ultima oară modificat 14 Ian 2018, 03:13 de către Louie, modificat de 2 ori în total.
Avatar utilizator
Goku99
Utilizator interzis !

Utilizator interzis !
Mesaje: 74
Membru din: 16 Dec 2014, 18:28
Server: Smith metin2
Regat: Chunjo
Aprecieri: 16  
Mulţumiri: 0
Medalii

Am avut grija la tab-uri :)

Nu prea am inteles din ce mi ai zis :( ... dar am pus continutul tau din pastebin la mn in equipmentdialog.py si este exact acelasi lucru, ... daca il pun in costumeequipmentdialog ma scoate din client .. poti fi putin mai explicit te rog ? iti las fisierele aici mai jos :

costumeequipmentdialog :

Cod: Selectaţi tot

import uiScriptLocale
import item
COSTUME_START_INDEX = item.COSTUME_SLOT_START
window = {
	"name" : "CostumeEquipmentDialog",

	"x" : 0,
	"y" : 0,

	# "width" : 139,
	# "height" : 145,
	"width" : 140,
	"height" : 180 + 47,

	"children" :
	(
		{
			"name" : "ExpandButton",
			"type" : "button",

			"x" : 2,
			"y" : 20,

			"default_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_normal.tga",
			"over_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_over.tga",
			"down_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_down.tga",
			"disable_image" : "d:/ymir work/ui/game/belt_inventory/btn_expand_disabled.tga",
		},

		{
			"name" : "CostumeEquipmentLayer",

			"x" : 5,
			"y" : 0,

			"width" : 140,
			"height" : 180 + 47,

			"children" :
			(
				{
				"name" : "MinimizeButton",
				"type" : "button",

				"x" : 2,
				"y" : 17,

				"default_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_normal.tga",
				"over_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_over.tga",
				"down_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_down.tga",
				"disable_image" : "d:/ymir work/ui/game/belt_inventory/btn_minimize_disabled.tga",
				},

				{
				"name" : "CostumeEquipmentBoard",
				"type" : "board",
				"style" : ("attach", "float"),

				"x" : 10,
				"y" : 0,

				"width" : 129,
				"height" : 195,

				"children" :
				(
					{
						"name" : "Costume_Base",
						"type" : "image",

						"x" : 8,
						"y" : 8,

						"image" : "d:/ymir work/costume_bg.jpg",

						"children" :
						(
							{
							"name" : "CostumeEquipmentSlot",
							"type" : "slot",

							"x" : 3,
							"y" : 3,

							"width" : 127,
							"height" : 195,

							"slot" : (
								{"index":0, "x":61, "y":45, "width":32, "height":64},
								{"index":1, "x":61, "y":45, "width":32, "height":64},
								{"index":2, "x":61, "y":45, "width":32, "height":64},
								{"index":3, "x":61, "y":45, "width":32, "height":64},
								{"index":4, "x":61, "y":45, "width":32, "height":64},
								{"index":5, "x":61, "y":45, "width":32, "height":64},
								{"index":6, "x":61, "y":45, "width":32, "height":64},
								{"index":7, "x":61, "y":45, "width":32, "height":64},
								{"index":8, "x":61, "y":45, "width":32, "height":64},
								{"index":9, "x":61, "y":45, "width":32, "height":64},
								{"index":10, "x":61, "y":45, "width":32, "height":64},
								{"index":11, "x":61, "y":45, "width":32, "height":64},
								{"index":12, "x":61, "y":45, "width":32, "height":64},
								{"index":13, "x":61, "y":45, "width":32, "height":64},
								{"index":14, "x":61, "y":45, "width":32, "height":64},
								{"index":15, "x":61, "y":45, "width":32, "height":64},
								{"index":16, "x":61, "y":45, "width":32, "height":64},
								{"index":17 "x":61, "y":45, "width":32, "height":64},
								{"index":18, "x":61, "y": 8, "width":32, "height":32},
								{"index":19, "x":61, "y":125, "width":32, "height":32},
								{"index":20, "x":13, "y":125, "width":32, "height":32},
								{"index":21, "x":13, "y":20, "width":32, "height":96},
								{"index":22, "x":13, "y":20, "width":32, "height":96},
								{"index":23, "x":13, "y":20, "width":32, "height":96},
								{"index":24, "x":13, "y":20, "width":32, "height":96},
								{"index":25, "x":13, "y":20, "width":32, "height":96},
								{"index":26, "x":13, "y":20, "width":32, "height":96},
								{"index":27, "x":13, "y":20, "width":32, "height":96},
								{"index":28, "x":13, "y":20, "width":32, "height":96},
								{"index":29, "x":13, "y":20, "width":32, "height":96},
								{"index":30, "x":13, "y":20, "width":32, "height":96},
								{"index":31, "x":13, "y":20, "width":32, "height":96},
								{"index":32, "x":13, "y":20, "width":32, "height":96},
								{"index":34, "x":13, "y":20, "width":32, "height":96},
								{"index":35, "x":13, "y":20, "width":32, "height":96},
								{"index":36, "x":13, "y":20, "width":32, "height":96},
								),
								},
							),
						},
					),
				},
			),
		},
	),
} 
equipmentdialog:

Cod: Selectaţi tot

 import uiScriptLocale

window = {
	"name" : "EquipmentDialog",
	"style" : ("movable", "float",),

	"x" : 0,
	"y" : 0,

	"width" : 180,
	"height" : 230,

	"children" :
	(
		{
			"name" : "Board",
			"type" : "board_with_titlebar",

			"x" : 0,
			"y" : 0,

			"width" : 180,
			"height" : 230,

			"title" : "Character Name",

			"children" :
			(
				{
					"name":"EquipmentBaseImage",
					"type":"image",
					"style" : ("attach",),

					"x" : 0,
					"y" : 9,
					"horizontal_align" : "center",
					"vertical_align" : "center",

					"image" : "d:/ymir work/inventar_dnd.tga",

					"children" :
					(

						{
							"name" : "EquipmentSlot",
							"type" : "slot",

							"x" : 3,
							"y" : 3,

							"width" : 150,
							"height" : 182,

							"slot" : (
										{"index":0, "x":44, "y":40, "width":32, "height":64},#armu
										{"index":1, "x":44, "y":2, "width":32, "height":32}, #coif
										{"index":2, "x":44, "y":151, "width":32, "height":32},#papuc
										{"index":3, "x":82, "y":72, "width":32, "height":32},#bratara
										{"index":4, "x":3, "y":3, "width":32, "height":96},#arma		
										{"index":5, "x":117, "y":75, "width":32, "height":32},#colier   			#DnD Works#
										{"index":6, "x":118, "y":41, "width":32, "height":32},#cercei
										{"index":7, "x":7, "y":151, "width":32, "height":32},#special acadea
										{"index":8, "x":79, "y":151, "width":32, "height":32},#special inel
										{"index":9, "x":115, "y":4, "width":32, "height":32},#sageata
										{"index":10, "x":81, "y":42, "width":32, "height":32},#Scut
										{"index":13, "x":117, "y":150, "width":32, "height":32},#Atac
										{"index":14, "x":117, "y":112, "width":32, "height":32},#Aparare
										{"index":15, "x":82, "y":102, "width":32, "height":32},#curea
									),
						},
					),
				},
			),
		},
	),
}
 

uiequipmentdialog.py :

Cod: Selectaţi tot

 
 import ui
import chr
import player

class CostumeEquipmentDialog(ui.ScriptWindow):
	def __init__(self, wndEquipment):
		if not wndEquipment:
			import exception
			exception.Abort("wndEquipment parameter must be set to CostumeEquipmentDialog")
			return

		ui.ScriptWindow.__init__(self)

		self.isLoaded = 0
		self.wndEquipment = wndEquipment;

		self.wndCostumeEquipmentLayer = None
		self.wndCostumeEquipmentSlot = None
		self.expandBtn = None
		self.minBtn = None

		self.__LoadWindow()

	def __del__(self):
		ui.ScriptWindow.__del__(self)

	def Show(self):
		self.__LoadWindow()
		ui.ScriptWindow.Show(self)

		self.CloseCostumeEquipment()

	def Close(self):
		self.Hide()

	def IsOpenedCostumeEquipment(self):
		return self.wndCostumeEquipmentLayer.IsShow()

	def OpenCostumeEquipment(self):
		self.wndCostumeEquipmentLayer.Show()
		self.expandBtn.Hide()

		self.AdjustPositionAndSize()
		self.RefreshSlot()

	def CloseCostumeEquipment(self):
		self.wndCostumeEquipmentLayer.Hide()
		self.expandBtn.Show()

		self.AdjustPositionAndSize()

	def GetBasePosition(self):
		x, y = self.wndEquipment.GetGlobalPosition()
		return x - 139, y + 30

	def AdjustPositionAndSize(self):
		bx, by = self.GetBasePosition()

		if self.IsOpenedCostumeEquipment():
			self.SetPosition(bx, by)
			self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())

		else:
			self.SetPosition(bx + 129, by);
			self.SetSize(10, self.GetHeight())

	def __LoadWindow(self):
		if self.isLoaded == 1:
			return

		self.isLoaded = 1

		try:
			pyScrLoader = ui.PythonScriptLoader()
			pyScrLoader.LoadScriptFile(self, "UIScript/CostumeEquipmentDialog.py")
		except:
			import exception
			exception.Abort("CostumeEquipmentDialog.LoadWindow.LoadObject")

		try:
			self.ORIGINAL_WIDTH = self.GetWidth()
			wndCostumeEquipmentSlot = self.GetChild("CostumeEquipmentSlot")
			self.wndCostumeEquipmentLayer = self.GetChild("CostumeEquipmentLayer")
			self.expandBtn = self.GetChild("ExpandButton")
			self.minBtn = self.GetChild("MinimizeButton")

			self.expandBtn.SetEvent(ui.__mem_func__(self.OpenCostumeEquipment))
			self.minBtn.SetEvent(ui.__mem_func__(self.CloseCostumeEquipment))

		except:
			import exception
			exception.Abort("CostumeEquipmentDialog.LoadWindow.BindObject")

		wndCostumeEquipmentSlot.SetOverInItemEvent(ui.__mem_func__(self.wndEquipment.OverInItem))
		wndCostumeEquipmentSlot.SetOverOutItemEvent(ui.__mem_func__(self.wndEquipment.OverOutItem))
		self.wndCostumeEquipmentSlot = wndCostumeEquipmentSlot

	def RefreshSlot(self):
		equipmentDict = self.wndEquipment.itemDataDict
		for i in [11, 12]:
			if equipmentDict.has_key(i):
				self.wndCostumeEquipmentSlot.SetItemSlot(i, equipmentDict[i][0], equipmentDict[i][1])

class EquipmentDialog(ui.ScriptWindow):
	wndCostumeEquipment = None

	def __init__(self):
		#print "NEW EQUIPMENT DIALOG ----------------------------------------------------------------------------"
		ui.ScriptWindow.__init__(self)
		self.__LoadDialog()

		self.vid = None
		self.eventClose = None
		self.itemDataDict = {}
		self.tooltipItem = None

	def __del__(self):
		#print "---------------------------------------------------------------------------- DELETE EQUIPMENT DIALOG "
		ui.ScriptWindow.__del__(self)

	def __LoadDialog(self):
		try:
			PythonScriptLoader = ui.PythonScriptLoader()
			PythonScriptLoader.LoadScriptFile(self, "UIScript/EquipmentDialog.py")

			getObject = self.GetChild
			self.board = getObject("Board")
			self.slotWindow = getObject("EquipmentSlot")

			self.wndCostumeEquipment = CostumeEquipmentDialog(self)

		except:
			import exception
			exception.Abort("EquipmentDialog.LoadDialog.BindObject")

		self.board.SetCloseEvent(ui.__mem_func__(self.Close))
		self.slotWindow.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		self.slotWindow.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

	def Open(self, vid):
		self.vid = vid
		self.itemDataDict = {}

		name = chr.GetNameByVID(vid)
		self.board.SetTitleName(name)

		self.SetCenterPosition()
		self.SetTop()
		self.Show()

		if self.wndCostumeEquipment:
			self.wndCostumeEquipment.Show()

	def Close(self):
		self.itemDataDict = {}
		self.tooltipItem = None
		self.Hide()

		if self.eventClose:
			self.eventClose(self.vid)

		if self.wndCostumeEquipment:
			self.wndCostumeEquipment.Close()

	def Destroy(self):
		self.eventClose = None

		self.Close()
		self.ClearDictionary()

		self.board = None
		self.slotWindow = None

		if self.wndCostumeEquipment:
			self.wndCostumeEquipment.Destroy()
			self.wndCostumeEquipment = None

	def SetEquipmentDialogItem(self, slotIndex, vnum, count):
		if count <= 1:
			count = 0

		self.slotWindow.SetItemSlot(slotIndex, vnum, count)

		emptySocketList = []
		emptyAttrList = []
		for i in xrange(player.METIN_SOCKET_MAX_NUM):
			emptySocketList.append(0)
		for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
			emptyAttrList.append((0, 0))
		self.itemDataDict[slotIndex] = (vnum, count, emptySocketList, emptyAttrList)

	def SetEquipmentDialogSocket(self, slotIndex, socketIndex, value):
		if not slotIndex in self.itemDataDict:
			return
		if socketIndex < 0 or socketIndex > player.METIN_SOCKET_MAX_NUM:
			return
		self.itemDataDict[slotIndex][2][socketIndex] = value

	def SetEquipmentDialogAttr(self, slotIndex, attrIndex, type, value):
		if not slotIndex in self.itemDataDict:
			return
		if attrIndex < 0 or attrIndex > player.ATTRIBUTE_SLOT_MAX_NUM:
			return
		self.itemDataDict[slotIndex][3][attrIndex] = (type, value)

	def SetItemToolTip(self, tooltipItem):
		self.tooltipItem = tooltipItem

	def SetCloseEvent(self, event):
		self.eventClose = event

	def OverInItem(self, slotIndex):

		if None == self.tooltipItem:
			return

		if not slotIndex in self.itemDataDict:
			return

		itemVnum = self.itemDataDict[slotIndex][0]
		if 0 == itemVnum:
			return

		self.tooltipItem.ClearToolTip()
		metinSlot = self.itemDataDict[slotIndex][2]
		attrSlot = self.itemDataDict[slotIndex][3]
		self.tooltipItem.AddItemData(itemVnum, metinSlot, attrSlot)
		self.tooltipItem.ShowToolTip()

	def OverOutItem(self):
		if None != self.tooltipItem:
			self.tooltipItem.HideToolTip()

	def OnPressEscapeKey(self):
		self.Close()
		return True

	def OnMoveWindow(self, x, y):
		if self.wndCostumeEquipment:
			self.wndCostumeEquipment.AdjustPositionAndSize()
 
Imagine
EDIT : cred ca s-ar putea sa fie din aceasta functie din char.cpp :

Cod: Selectaţi tot

 
 void CHARACTER::SendEquipment(LPCHARACTER ch)
{
	TPacketViewEquip p;
	p.header = HEADER_GC_VIEW_EQUIP;
	p.vid    = GetVID();
    int pos[19] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24, 25, 26 };
    for (int i = 0; i < 19; i++)
	{
		LPITEM item = GetWear(pos[i]);
		if (item)
		{
			p.equips[i].vnum = item->GetVnum();
			p.equips[i].count = item->GetCount();

			thecore_memcpy(p.equips[i].alSockets, item->GetSockets(), sizeof(p.equips[i].alSockets));
			thecore_memcpy(p.equips[i].aAttr, item->GetAttributes(), sizeof(p.equips[i].aAttr));
		}
		else
		{
			p.equips[i].vnum = 0;
		}
	}
	ch->GetDesc()->Packet(&p, sizeof(p));
}
 
acesta :

Cod: Selectaţi tot

    int pos[19] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24, 25, 26 };
    for (int i = 0; i < 19; i++)
	
Eu am 23 de iteme pe care le pot echipa .. am schimbat peste tot unde scrie 19 cu 23 si am modificat si
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24, 25, 26 }; dar nu reusesc sa fac sa se vad Esarfa si skin-ul la arma in chenarul cu costume ... ma poate ajuta cineva ?
Avatar utilizator
-DND-
Utilizatorul Lunii Ianuarie

Utilizatorul Lunii Ianuarie
Mesaje: 1464
Membru din: 22 Ian 2017, 16:40
Server: Serverfiles By DnD
Regat: Jinno
Aprecieri: 116  
Mulţumiri: 2249  
Discord: Copiază ID
 Contact:
Medalii

Incearca sa modifici aci

Cod: Selectaţi tot

(int i = 0; i < 19; i++
cu 26
Avatar utilizator
Goku99
Utilizator interzis !

Utilizator interzis !
Mesaje: 74
Membru din: 16 Dec 2014, 18:28
Server: Smith metin2
Regat: Chunjo
Aprecieri: 16  
Mulţumiri: 0
Medalii

Am incercat tot nu imi arata .. Up :(

EDIT : Ofer 3 euro psf pe loc celui care imi spune rezolvarea

[ Postat de pe iPhone ] Imagine
Avatar utilizator
Goku99
Utilizator interzis !

Utilizator interzis !
Mesaje: 74
Membru din: 16 Dec 2014, 18:28
Server: Smith metin2
Regat: Chunjo
Aprecieri: 16  
Mulţumiri: 0
Medalii

Up
Avatar utilizator
Goku99
Utilizator interzis !

Utilizator interzis !
Mesaje: 74
Membru din: 16 Dec 2014, 18:28
Server: Smith metin2
Regat: Chunjo
Aprecieri: 16  
Mulţumiri: 0
Medalii

Up

[ Postat de pe iPhone ] Imagine
Avatar utilizator
Seby.
Membru Club

Membru Club
Mesaje: 883
Membru din: 02 Feb 2017, 23:00
Server: Metin2Pegasus
Regat: Jinno
Aprecieri: 112  
Mulţumiri: 167  
Discord: Copiază ID
 Contact:
Medalii

Au trecut mai mult de 3 zile, autorul nu a mai dat nici un semn de viaţă, arhivat.
Închis
Răspunsuri
3
Vizualizări
533
Răspunsuri
2
Vizualizări
299
Răspunsuri
13
Vizualizări
713
Răspunsuri
4
Vizualizări
551

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 21 vizitatori