Jump to content

[Python] BonusPage - 'tuple' object has no attribute 'has_key'


Recommended Posts

Hi all!

I'm trying to do a bonus page inside the character window but with more pages.
For example one player has to press C or V or B or N, then left click on 'BONUS' (on the right of 'QUEST') and then he can click on various buttons inside the bonus page.

If I put only 1 page with no other buttons in the bonus page it works, but if I try to insert them it gives me the error:

uiCharacter.py(line:424) __LoadWindow
uiCharacter.py(line:161) __LoadScript
ui.py(line:2854) LoadScriptFile
ui.py(line:3072) CheckKeyList

CharacterWindow.__LoadWindow - <type 'exceptions.AttributeError'>:'tuple' object has no attribute 'has_key'

0214 14:44:17942 :: ============================================================================================================
0214 14:44:17942 :: Abort!!!!

 

Can someone help me please?

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

  • Metin2 Dev 1
  • Not Good 1
  • Love 1
Link to comment
Share on other sites

Quote

'tuple' object has no attribute 'has_key'

The method  has_key() returns true if a given key is available in the dictionary, otherwise it returns a false.

You have tuple not a dictionary, so you should do something like:

if number in tupleArgs:
  [....]

Or maybe your code is expecting a dictionary and getting a tuple instead.

Upload the file on

This is the hidden content, please
, i can't download them from attachments.

  • Metin2 Dev 2
  • Sad 1
  • Good 5
  • Love 2
Link to comment
Share on other sites

17 hours ago, Tasho said:

Upload the file on

This is the hidden content, please
, i can't download them from attachments.

This is the hidden content, please

 

17 hours ago, Tasho said:

You have tuple not a dictionary

So i can implement a function or try to do it in a different way..
Meanwhile I will work on it and if it will works I will share it

 

Edit: I think the problem is in characterwindow.py. Pheraps it is written in a bad way but I don't know why..

Edit_2: I managed to insert the buttons in the bonus page area and when I click on them they give me a blank page how did I expect. Now I will try to show the correct content after the click. If someone want to help me I can share the code :)

  • Not Good 1
  • Good 2
  • Love 2
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



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