Jump to content
  • 0

Python and Quest communication


Strzikjav

Question

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

7 answers to this question

Recommended Posts

  • 0

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
  • 0

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
  • 0

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
  • 0

 

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
  • 0

Fail... totally forgott to look into the syserr....

 

global name 'event' is not definied

This means that i've forgot to import the File where the event-Function is in, am i right?

And where is the event-Function :)

ty

Link to comment

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


  • Read our Rules
  • Activity

    1. 0

      Help with quest

    2. 0

      Will anyone modify the mount?Mounts need to be mounted to increase their stats.

    3. 11

      Lock Picking Skill + Missions

    4. 4

      Quest Deleter

    5. 1

      [SOLUTION IN TOPIC]Loading locale_game.txt raises KeyError

    6. 1

      Binary functions: "GetSlotLocalPosition" & "GetSlotGlobalPosition"

    7. 1

      Binary functions: "GetSlotLocalPosition" & "GetSlotGlobalPosition"

    8. 1

      [SOLUTION IN TOPIC]Loading locale_game.txt raises KeyError

    9. 6

      Skill Book Combination System

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