Jump to content

Zetsu

Inactive Member
  • Posts

    122
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    0%

Posts posted by Zetsu

  1. Hello,

    I want to show you a new guide to make a communication between quest and client. Nowdays we can use game source..bla bla... but if you don't want/don't know how to compyle it, you can use this version (old and good :D). So, let's begin:

    ### Send informations to client

    Spoiler

    For quest, we have a command... very simple to use and known by everybody(i guess, haha).

    
    quest communication_test begin -- QUEST NAME MUST BE communication_test.quest !!!	
    	state start begin		
    		when login begin			
    			local number = 5			
    			cmdchat("command_name " .. number ) -- So, we'll find 'command_name' in client, in game.py. This is very important, so use a good name...Check if it doesn't exist		
    		end	
    	end
    end

    For client we have to add in game.py this:

    Look for:

    
    def __ServerCommand_Build(self):		serverCommandList={

    Add under this:

    
    "command_name"                            : self.command_name_python,


    Now we must create the function in python with name command_name_python or everything you used..
    182929TRi3e.jpg.e2aefa098798c5ff6e6f8298

    Be careful! You must align text(functions..etc) with TAB key space.



    ### Start a quest from client (for buttons sometimes...)

    Spoiler

    The quest looks like this:
     

    
    quest communication_test begin -- QUEST NAME MUST BE communication_test.quest !!!	
    	state start begin		
    		when login begin			
    			cmdchat("quest_name_index "..q.getcurrentquestindex()) --- this command send quest index to client, you'll see now why is important		
    		end		
    		
    		when button or info begin			
    			say("Zetsu: It works! Quest is active.")		
    		end	
    	end
    end

    For client we have to add in game.py this:

    Look for:

    
    def __ServerCommand_Build(self):		serverCommandList={

    Add under this:

    
    "quest_name_index"                            : self.YOuCanUseAnyName,

    Now, create a function which must looks like:

    
    	def YOuCanUseAnyName(self, questindex):
    		constInfo.QUESTNAMEINDEX = questindex # you can use int(questindex) but in special cases



    Before the most important thing, we must open constInfo.py and add:

    
    QUESTNAMEINDEX = 0

    Without any space in front!

    Now, everywhere in python you can use this function:

    
        def FunctionName(self):
            import event
            import constInfo
            event.QuestButtonClick(int(constInfo.QUESTNAMEINDEX))



    Especially for buttons...But you can use it anyway. Don't make this function to be started by quest, cause you will get a "loop", so quest will be actived for infinite times(now it depends how did you code it).



    ### Get a variable from client (now for 34 & 40k update)

    Spoiler

    This trick is very important and you must read all the steps carefuly

    Quest looks like:

    
    quest communication_test begin -- QUEST NAME MUST BE communication_test.quest !!!	
    	state start begin		
    		when login begin			
    			cmdchat("quest_name_index "..q.getcurrentquestindex())		
    		end		
    		
    		function GetFromClient()			
    			cmdchat("init_getInfo")			
    			local variables = input(cmdchat("getInfo")) 			
    			cmdchat("ignore_getInfo")			
    			return variables		
    		end		
    		
    		when button or info begin			
    			local things = communication_test.GetFromClient()			
    			say(things) -- you can convert it with tonumber("") tostring(0)		
    		end	
    	end
    end

    For client we have to add in game.py this:

    Look for:

    
    def __ServerCommand_Build(self):		serverCommandList={

    Add under this:

    
    "init_getInfo"                            : self.InitTutorialGetInfo,
    "getInfo"                            : self.GetInfoTutByZetsu,
    "ignore_getInfo"                            : self.IgnoreTutorialGetInfo,

    We should start with constInfo. Add these cariables:

    
    IGNORE_GETINFO = 0INFORMATION_TO_SEND = "m2dev-tutByZetsu"

    Now, we move to interfacemodule.py

    ##########################  For 34k+ versions you have: ########

    
        def OpenQuestWindow(self, skin, idx):
            wnds = ()
                
            q = uiQuest.QuestDialog(skin, idx)
            q.SetWindowName("QuestWindow" + str(idx))
            q.Show()
            if skin:
                q.Lock()
                wnds = self.__HideWindows()
            
                # UNKNOWN_UPDATE
                q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
                # END_OF_UNKNOWN_UPDATE
            
            if skin:
                q.AddOnCloseEvent(q.Unlock)
                    
            q.AddOnCloseEvent(lambda s = self, qw = q: s.__dict__.__getitem__("wndQuestWindow").remove(qw))
            
            # UNKNOWN_UPDATE
            self.wndQuestWindow.append(q)
            # END_OF_UNKNOWN_UPDATE

    Replace it with:
     

    
        def OpenQuestWindow(self, skin, idx):
            chat.AppendChat(chat.CHAT_TYPE_INFO, str(constInfo.WOD_IGNORE))
            if constInfo.IGNORE_GETINFO == 1: # You see :D constInfo variable which stop/start quest window
                return
            else:   
                wnds = ()
                
                q = uiQuest.QuestDialog(skin, idx)
                q.SetWindowName("QuestWindow" + str(idx))
                q.Show()
                if skin:
                    q.Lock()
                    wnds = self.__HideWindows()
            
                    # UNKNOWN_UPDATE
                    q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
                    # END_OF_UNKNOWN_UPDATE
            
                if skin:
                    q.AddOnCloseEvent(q.Unlock)
                    
                q.AddOnCloseEvent(lambda s = self, qw = q: s.__dict__.__getitem__("wndQuestWindow").remove(qw))
            
                # UNKNOWN_UPDATE
                self.wndQuestWindow.append(q)
                # END_OF_UNKNOWN_UPDATE

     

    #########################For lower versions: ########
    -Open uiquest.py
    search:

    
    def __init__(self,skin,idx):

    Under this add:
     

     

    
            import constInfo    
            if constInfo.IGNORE_GETINFO == 1:
                return


    ######################### Lower Version steps end ########

     

    And finally for game.py we have to create these functions:

    
        def InitTutorialGetInfo(self):
            constInfo.IGNORE_GETINFO = 1
        def IgnoreTutorialGetInfo(self):
            constInfo.IGNORE_GETINFO = 0
        def GetInfoTutByZetsu(self):
            #import net # if you work out of game.py (so delete first # if your script doesn't contain "import net")
            net.SendQuestInputStringPacket(str(constInfo.INFORMATION_TO_SEND)) # or any information/variable from any module/file



    If you add functions at the end of the game.py don't forget that any PY file have the last line empty!

     

    ### Send multiple informations to client once

    Spoiler

    The same as we have done at "Send informations to client" but you will use this:

    
    local var1 = 32
    local var2 = "zts"
    local var3 = "m2dev"
    cmdchat("function_name "..var1.."|"..var2.."|"..var3) 

    In the client, the same function,but to get variables you will use something like this:

    
    vararray= fromserver.split("|") # fromserver will be "32|zts|m2dev"
    #for var1:
    constInfo.VAR_1 = vararray[0]
    #for var2:
    constInfo.VAR_2 = vararray[1]
    #and for var3:
    constInfo.VAR_3 = vararray[2]



    Kind regards and i hope you understood me! Sorry for mistakes.

    • Metin2 Dev 2
    • Love 17
  2. It has technical merit of course but I never understood why people make all these big all-in-one maps like "4 worlds" or the giant Illirea map from KillMoves. You are just loading your players RAM with stuff that is not being used at that moment.

     

    One world, go to other village by portals cause mountains and water don't let you go there  :rolleyes: Do you like this idea?

     

    It's stupid when people steal your idea because they don't have a good imagination... It's a little bit sad if you think at that "thiefs".  :unsure: They want a server but by other people ideas... And their server will be closed in few weeks.

  3.  

     

     

     

    Hi, so i have put the quest, the navicat, the item_proto, item_list, the tga how put i can open the box what do i have to do? I'm using game 2089

    You can use the item or button should appear near energy system(old interface)

     

     

     

    Ok but the dowload link for the button is down

     

    It's just an icon. You can use any.

     

     

    But i would like to use that :( can you pls give me in PM?

     

    I'm busy for the next 6 hrs. After that, i'll solve the link.

  4.  

    If you select an image and use right click on it, a tooltip menu will appear. Then, you must click on the "Save image as..." or "Save image...".

     

    If you want to auto-generate images in your page, use js code to generate html codes by files fro your pictures directory.

     

    Now you're a 'hacker' :D

     

    I want to Metin2 GF Gallery.

     

    I use FancyBox but icons are different.

     

    Hahahaha :)

     

    You can edit from html and css.. dafuq :| 

  5. If you select an image and use right click on it, a tooltip menu will appear. Then, you must click on the "Save image as..." or "Save image...".

     

    If you want to auto-generate images in your page, use js code to generate html codes by files fro your pictures directory.

     

    Now you're a 'hacker' :D

  6. 
    
    0605 17:18:26398 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
    0605 17:18:28072 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
    0605 17:18:36121 :: Traceback (most recent call last):
    
    0605 17:18:36122 ::   File "networkModule.py", line 231, in SetGamePhase
    
    0605 17:18:36122 ::   File "system.py", line 130, in __pack_import
    
    0605 17:18:36122 ::   File "
    0605 17:18:36122 :: <string>
    0605 17:18:36122 :: ", line 
    0605 17:18:36122 :: 107
    0605 17:18:36122 :: 
    
    0605 17:18:36122 ::     
    0605 17:18:36122 :: self.stream=stream
    
    0605 17:18:36122 ::     
    0605 17:18:36122 :: ^
    
    0605 17:18:36128 :: SyntaxError
    0605 17:18:36128 :: : 
    0605 17:18:36128 :: invalid syntax
    0605 17:18:36128 :: 
    
    

    hii man wow its rly make u lose ur mind :D

     

     

    but I have some proplem I hope u can fix it :(

     

     

    my syserr:

     

     

    I need your game.py in private.

  7.  

    With

    event.QuestButtonClick(int(questIndex))

    You need

    when button or info begin
        ##DO SOMETHING
    end

    In your quest. Look in uiquest.py and you will see that buttons works like that. Quests are started (don't know how..) and event.QuestButtonClick(int(questIndex)) it's used for gui buttons

     

    You can use event.QuestButtonClick(int(questIndex)) everywhere. In game.py add in def __init__ this:

    self.MyQuestNameIndex = 0

    In ServerCommand...etc

    add:

    "myvalue" : self.InitMyQuestName,

    Then make this function

    def InitMyQuestName(self, id):
         self.MyQuestNameIndex = int(id) # i added int just in case...
         #Be careful! I used SPACE not TAB. You will get syntax errors if you don't replace it.

    then you can use event.QuestButtonClick(self.MyQuestNameIndex)

     

    if you want to use it everywhere in your client, then use constInfo instead of self.MyQuestNameIndex

     

     

    I'm not sure if you understood me... More details: http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2355018-release-client-quest-kommunikation.html

    You have here everything, also how to get a value from client and use it in your quest

     

    I've already done everything you wrote in my first post (it seems that you missunderstood me, otherway you wouldnt post it^^)

    But thanks for the Link, this may be useful.

     

    Is it possible that:

     

    self.ResetChat() or return in my if clause are blocking the quest? (To display it)

    Cuz everything is working without errors and problems, but it doesnt show the quest (Already checked QuestIndex, everything is right)

     

     

    I would like to see self.ResetChat() function.

    If this function isn't right or it doesn't exist, curent function (with event.QuestButtonClick(int(questIndex))) doesn't work.

     

    Syserr would be nice too...!

  8. With

    event.QuestButtonClick(int(questIndex))

    You need

    when button or info begin
        ##DO SOMETHING
    end

    In your quest. Look in uiquest.py and you will see that buttons works like that. Quests are started (don't know how..) and event.QuestButtonClick(int(questIndex)) it's used for gui buttons

     

    You can use event.QuestButtonClick(int(questIndex)) everywhere. In game.py add in def __init__ this:

    self.MyQuestNameIndex = 0

    In ServerCommand...etc

    add:

    "myvalue" : self.InitMyQuestName,

    Then make this function

    def InitMyQuestName(self, id):
         self.MyQuestNameIndex = int(id) # i added int just in case...
         #Be careful! I used SPACE not TAB. You will get syntax errors if you don't replace it.

    then you can use event.QuestButtonClick(self.MyQuestNameIndex)

     

    if you want to use it everywhere in your client, then use constInfo instead of self.MyQuestNameIndex

     

     

    I'm not sure if you understood me... More details: http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2355018-release-client-quest-kommunikation.html

    You have here everything, also how to get a value from client and use it in your quest

    • Love 1
×
×
  • Create New...

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.