WorldArd Posted January 30, 2015 Report Share Posted January 30, 2015 Buenas a todos/as Aqui les vengo a enseñar como abrir una funcion de quest en python Guia: 1.-vamos a hacer la quest que seria algo asi : ejemplo: when login begin cmdchat("SendQuestIndex "..q.getcurrentquestindex()) end when info or button begin cmdchat("input1") local primero_button = input(cmdchat("button1")) cmdchat("input0") if primero_button == "1" then chat("comienzo") elseif primero_button == "2" then chat("final") end 2.vamos a root y abrimos game.py, bucamos def Open(self): y debajo de self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) colocamos el button el cual vamos a ejecutar la funcion de la quest self.Button1 = ui.Button() self.Button1.SetUpVisual("d:/ymir work/ui/public/slot_cover_button_01.sub") self.Button1.SetOverVisual("d:/ymir work/ui/public/slot_cover_button_02.sub") self.Button1.SetDownVisual("d:/ymir work/ui/public/slot_cover_button_03.sub") self.Button1.SetEvent(self.pruebas) self.Button1.SetPosition(11, 13) self.Button1.Show() 3.-luego buscamos "item_mall" en ese mismo .py , debajo de eso colocamos "SendQuestIndex" : self.SetQIndex, "button1" : self.button1, "input0" : self.__Input0, "input1" : self.__Input1, 4.-luego vamos a lo ultimo del .py y agregamos esto def SetQIndex(self, idx): constInfo.QIDX = int(idx) def __Input0(self): constInfo.INPUT_IGNORE = 0 def __Input1(self): constInfo.INPUT_IGNORE = 1 def button1(self): info = constInfo.SendInfo net.SendQuestInputStringPacket(str(info)) def pruebas(self): import event,constInfo eq = constInfo.QIDX constInfo.SendInfo = "1" event.QuestButtonClick(int(eq)) El def pruebas es el que va a ejecutar la funcion de la quest , entonces ese def pruebas se agrega en el button el cual van a ejecutar la funcion. 4.-Luego vamos a constinfo y agreamos : INPUT_IGNORE = 0 QIDX = 0 SendInfo = 0 ya con eso cuando presionen el boton llamado button1 que han puesto en el .py ejecutara la funcion de la quest : chat("hola") /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Extras: si quieren agregar mas opciones simplementes hacen un elseif en la quest y le asignan el valor 2 ejemplo: if primero_button == "1" then chat("comienzo") elseif primero_button == "2" then chat("final") end luego en el game.py agregan un def como el anterior pero el 1 lo cambian por 2 que es el valor el cual pusieron en la quest ejemplo: def pruebas(self): import event,constInfo eq = constInfo.QIDX constInfo.SendInfo = "1" event.QuestButtonClick(int(eq)) def pruebas1(self): import event,constInfo eq = constInfo.QIDX constInfo.SendInfo = "2" event.QuestButtonClick(int(eq)) y ese def pruebas1 lo asignan en el siguiente button como : self.Button2.SetEvent(self.pruebas1) Eso seria una breve explicacion de como abrir una funcion de quest en python pd: perdonar , pero no soy el mejor explicando .Cualquier cosa decirme y con gusto les ayudare con el tema Break, Digital-RBK, Johan™ and 4 others 7 Quote Link to comment Share on other sites More sharing options...
WorldArd Posted January 30, 2015 Author Report Share Posted January 30, 2015 ---- Quote Link to comment Share on other sites More sharing options...
Frontier Posted January 30, 2015 Report Share Posted January 30, 2015 Buena +1 Quote Link to comment Share on other sites More sharing options...
Johan™ Posted January 30, 2015 Report Share Posted January 30, 2015 Justo lo que necesitaba. gracias Quote Link to comment Share on other sites More sharing options...
WorldArd Posted January 30, 2015 Author Report Share Posted January 30, 2015 xd , ok Saludos! Quote Link to comment Share on other sites More sharing options...
No Soy Jeo Posted January 30, 2015 Report Share Posted January 30, 2015 Que grande Felipe. +1 Quote Link to comment Share on other sites More sharing options...
WorldArd Posted January 30, 2015 Author Report Share Posted January 30, 2015 Que grande Felipe. +1 Gracias , Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.