Jump to content

Python and Quest communication


Recommended Posts

Hey Guys,

 

hope to get fast help with myQuestion^^

Acutal i have a question:

 

event.QuestButtonClick(ARGUMNT)

Is this just a call to the function to open the Quest with Questindex as ARGUMNT or do i really need a button to call this function?

 

Actual i am calling this method without a button, but nothing happens (even no error) so i was wondering.

The Quest to get the Questindex looks like this:

quest test begin
    state start begin
        when login begin
            cmdchat("myvalue "..q.getcurrentquestindex())
        end
    end
end

I'm saving my Questindex in a var in constinfo (yes, i know ho to read out the cmdchat value via game.py)

Regards

 

 

 

€dit:

 

i'm calling my quest like this:

when button or info begin
    ##DO SOMETHING
end
Link to comment
Share on other sites

Did you save the value as int()?And no you don't need a button to call the function

 

Yeah, this is my called function (from serverCommandList):

def TestWarpFunction(self, id)
       constInfo.VARIABLE = int(id)

I'm calling my my method in a if-loop (sry 4 bad englisch)

#SOME OTHER SOURCE...

elif BLABLA:
      event.QuestButtonClick(constInfo.VARIABLE)
      self.__ResetChat()
      return

Is the ___ResetChat() or return maybe disturbing my Quest?

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

 

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...!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

    8. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.