Jump to content
×
×
  • Create New...
  • 0

Quest problem


AlCapone

Question

Hi so I put a sistem of Shang to delet your items in inventory and after delet the item I see a window in game here a gif.

Sysser server : Input: no quest running for pc, cannot process input : 57787

Sysser client : No error

b3eec48fd46881d8257561816374df4d.gif

Tutorial

### ConstInfo.py

BorrarItems = {
	"QID" : 0,
	"BORRAR" : "",
}

### Game.py

En el __ServerCommand_Build, pegar esto:

			"BORRAR"				: self.ManagerBorrar,

Al final del game.py pegar esto:

	def ManagerBorrar(self, cmd):
		cmd = cmd.split("|")
		if cmd[0] == "QID":
			constInfo.BorrarItems["QID"] = int(cmd[1])
		elif cmd[0] == "SEND":
			net.SendQuestInputStringPacket(str(constInfo.BorrarItems["BORRAR"]))
			constInfo.BorrarItems["BORRAR"] = ""
		elif cmd[0] == "INPUT":
			constInfo.INPUT_IGNORE = int(cmd[1])
			
### uiInventory.py
import event
Debajo de 

			wndEquip = self.GetChild("EquipmentSlot")

Pegar esto:

			wndBorrar = self.GetChild("BorrarSlot")
			
Debajo de:

			self.costumeButton = self.GetChild2("CostumeButton")

Pegar:

			self.borrar_items = self.GetChild2("BorrarItems")
			
Debajo de:

		self.attachMetinDialog.Hide()

Pegar esto:

		self.drag = ui.Bar()
		self.drag.SetPosition(13+50,538)
		self.drag.SetParent(self)
		self.drag.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.0))
		self.drag.SetSize(32,32)
		self.drag.OnMouseLeftButtonUp = lambda: self.Add_Item()
		self.drag.Show()

		wndBorrar.SetOverInItemEvent(ui.__mem_func__(self.OverBorrarIn))
		wndBorrar.SetOverOutItemEvent(ui.__mem_func__(self.OverBorrarOut))
		
		self.RemoveQuestion = uiCommon.QuestionDialog()
		self.RemoveQuestion.SetAcceptEvent(lambda arg = TRUE: self.Borrar_Item(arg))
		self.RemoveQuestion.SetCancelEvent(lambda arg = FALSE: self.Borrar_Item(arg))
		self.RemoveQuestion.Close()
		
Debajo del def Close(self):

Pegar esto:

	def OverBorrarIn(self):
		self.ShowToolTip(0)
		
	def OverBorrarOut(self):
		self.tooltipItem.HideToolTip()
		
	def Add_Item(self):
		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedSlotVnum = mouseModule.mouseController.GetAttachedItemIndex()
				
			# item.SelectItem(attachedSlotVnum)
			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				item.SelectItem(attachedSlotVnum)
				self.RemoveQuestion.SetText("¿Seguro que quieres borrar "+str(item.GetItemName())+"?")
				self.RemoveQuestion.Open()
				constInfo.BorrarItems["BORRAR"] = ""
				constInfo.BorrarItems["BORRAR"] = "BORRAR|"+str(attachedSlotPos)+"|"+str(attachedSlotVnum)
				#chat.AppendChat(1, constInfo.BorrarItems["BORRAR"])
				
			mouseModule.mouseController.DeattachObject()
		
	def Borrar_Item(self, arg):
		if arg:
			event.QuestButtonClick(constInfo.BorrarItems["QID"])
			
		self.RemoveQuestion.Close()

### locale/inventorywindow.py

Debajo de:

				## Item Slot
				{
					"name" : "ItemSlot",
					"type" : "grid_table",

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

					"start_index" : 0,
					"x_count" : 5,
					"y_count" : 9,
					"x_step" : 32,
					"y_step" : 32,

					"image" : "d:/ymir work/ui/public/Slot_Base.sub"
				},
				
Pegar esto:

				## Borar Items Slot
				{
					"name" : "BorrarItems",
					"type" : "image",

					"x" : 13,
					"y" : 538,

					"image" : "locale/es/ui/inventario/borrar_items.tga",

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

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

							"width" : 32,
							"height" : 32,

							"slot" : (
										{"index":0, "x":0, "y":0, "width":32, "height":32},
									),
						},
					),
				},

Quest

quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
		end
	end
end

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Hi so I put a sistem of Shang to delet your items in inventory and after delet the item I see a window in game here a gif.

Sysser server : Input: no quest running for pc, cannot process input : 57787

Sysser client : No error

b3eec48fd46881d8257561816374df4d.gif

Tutorial

 

Hidden Content

Quest

 

Hidden Content

open root/game.py

 

def BINARY_ServerCommand_Run(self, line):

Add on:

 

	def ItemRemoveGetInputOff(self):
		constInfo.INPUT_IGNORE = 0


Search:

 

"MyShopPriceList"        : self.__PrivateShop_PriceList,

 

Add on

 
"InputStringEnd" : self.ItemRemoveGetInputOff,






New quest :

 

quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
			cmdchat("InputStringEnd")
		end
	end
end

 

Edited by Rideas
  • Love 2
Link to comment
Share on other sites

  • 0

0926 18:49:30578 :: AttributeError
0926 18:49:30578 :: : 
0926 18:49:30578 :: 'GameWindow' object has no attribute 'ItemRemoveGetInputOff'
0926 18:49:30578 :: 

open game.py

Add:

	def ItemRemoveGetInputOff(self):
		constInfo.INPUT_IGNORE = 0

 

  • Love 1
Link to comment
Share on other sites

  • 0

I still have the same problem whit the new window, and I put the new quest :)

 

game.py

    def OpenQuestWindow(self, skin, idx):

Function all change:

 

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		elif constInfo.INPUT == 1:
			return
		else:
			self.interface.OpenQuestWindow(skin, idx)

 

  • Love 1
Link to comment
Share on other sites

  • 0

RIDEAS I have a big problem I put the last function

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		elif constInfo.INPUT == 1:
			return
		else:
			self.interface.OpenQuestWindow(skin, idx)

And now Ignore all the quest I intent to open for example the change kingndom and dont open me quest..

1002 20:38:38193 :: AttributeError
1002 20:38:38193 :: : 
1002 20:38:38193 :: 'module' object has no attribute 'INPUT_IGNORE'
1002 20:38:38194 :: 

1002 20:38:44487 :: Traceback (most recent call last):

1002 20:38:44488 ::   File "game.py", line 717, in OpenQuestWindow

Link to comment
Share on other sites

  • 0

Change

 

    def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)

Open constinfo.py and add this:

 

INPUT_IGNORE = 0

  • Love 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 1

      core crash (GetName, SaveSingleItem?)

    2. 879

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    3. 879

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    4. 0

      Autopatcher not working in my friends pc but working in everyone else's

    5. 9

      Top Metin2 - Changelogs

    6. 0

      Dungeon Info System - compile Error

    7. 1

      core crash (GetName, SaveSingleItem?)

    8. 4

      [TUT] Increase MAX yang FULL

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.