Jump to content

Quest Categories


Recommended Posts

  • Developer

M2 Download Center

This is the hidden content, please
( Internal )

Spoiler

2829519eedbf683f.jpg.43163abb1e6184e5620

 

Hi there.

 

While cleaning out "my closet", I found this thing I developed between 2014-2015 - maybe(?) - for my, at that moment, server. Since it's now closed, and I won't use it, I'm sharing it with you guys.

Note: Didn't do the scrollbar, wasn't needed for me, so yeah.

 

Now, let's start with opening your locale_game.txt and adding these lines:

QUESTCATEGORY_0	Main Quests
QUESTCATEGORY_1	Sub Quests
QUESTCATEGORY_2	Collect Quests
QUESTCATEGORY_3	Levelup Quests
QUESTCATEGORY_4	Scroll Quests
QUESTCATEGORY_5	System Quests

Alright, now find your characterwindow.py (uiscript?) and you can either comment Quest_Page children or simply remove them all.

Moving on to your interfaceModule.py find this line self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName()) and replace it with self.wndCharacter.questCategory.RecvQuest(self.BINARY_RecvQuest, index, name)

Ok, then we are at the most, let's say, difficult part of this. Open your uiCharacter.py and just as you did in your characterwindow.py, remove or simply comment any single line related to quests. You can just search for these vars:

	        self.questShowingStartIndex
	        self.questScrollBar
	        self.questSlot
	        self.questNameList
	        self.questLastTimeList
	        self.questLastCountList


Once you did that, you just:

# Find these lines
        self.soloEmotionSlot = self.GetChild("SoloEmotionSlot")
        self.dualEmotionSlot = self.GetChild("DualEmotionSlot")
        self.__SetEmotionSlot()

# And add the following
        import uiQuestCategory
        self.questCategory = uiQuestCategory.QuestCategoryWindow(self.pageDict["QUEST"])

# Find this
    def OnUpdate(self):
        self.__UpdateQuestClock()

# Replace it with
    def OnUpdate(self):
        self.questCategory.OnUpdate()


And we're done with the client-side. I attached some extra elements needed (such as the main python file (uiQuestCategory.py) and some image resources).
Remember to edit the path linked to these images in that file.

For the server-side... Well, screw it, uploaded it too. Too lazy to write.
It has only a new quest function (q.getcurrentquestname()) and a few things to add in your questlib.lua.

Btw, not sure if  you have it, but if not, just add this extra function in ui.Button() (ui.py - class Button).

	def SetTextAlignLeft(self, text, height = 4):

		if not self.ButtonText:
			textLine = TextLine()
			textLine.SetParent(self)
			textLine.SetPosition(27, self.GetHeight()/2)
			textLine.SetVerticalAlignCenter()
			textLine.SetHorizontalAlignLeft()
			textLine.Show()
			self.ButtonText = textLine

		#Äù½ºÆ® ¸®½ºÆ® UI¿¡ ¸ÂÃç À§Ä¡ ÀâÀ½
		self.ButtonText.SetText(text)
		self.ButtonText.SetPosition(27, self.GetHeight()/2)
		self.ButtonText.SetVerticalAlignCenter()
		self.ButtonText.SetHorizontalAlignLeft()

Forgot the source part, fml, here it is. Add it to your questlua_quest.cpp.

	int quest_get_current_quest_name(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		PC* pPC = q.GetCurrentPC();
	
		lua_pushstring(L, pPC->GetCurrentQuestName().c_str());
		return 1;
	}

	void RegisterQuestFunctionTable()
	{
		luaL_reg quest_functions[] = 
		{
			{ "getcurrentquestname",	quest_get_current_quest_name},
			{ NULL,						NULL						}
		};

		CQuestManager::instance().AddLuaFunctionTable("q", quest_functions);
	}

 

Now, finally, have fun and bye!

  • Metin2 Dev 36
  • Sad 2
  • Confused 1
  • Scream 4
  • Good 18
  • Love 1
  • Love 155

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

12 hours ago, PACI said:

There you go, uiCharacter.py and characterwindow.py for you to compare with yours.

characterwindow.py

uicharacter.py

Thx, but check this https://metin2.download/picture/Cyu98hSgqT9tleCD1N6YNdVDbE6UX5jC/.gif and scroll?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 9
Link to comment
Share on other sites

It's beautiful!

I have a problem:

 

1)

https://metin2.download/picture/GQXRNr55Gxg0U21QhSvfutFn6eP969Mr/.png

 

https://metin2.download/picture/DzNlHRTakE08whl8RyZ30q11dd3XiR7u/.png

 

Ps: How do I assign a mission its type? (Main quests, sub quests)

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 2 months later...
  • Premium

 

		search : self.__questCategorySlot[i].openImage.Show() y paste 

			self.__questCategorySlot[i].closeImage = ui.Button()
			self.__questCategorySlot[i].closeImage.SetParent(self.__questCategorySlot[i])
			self.__questCategorySlot[i].closeImage.SetUpVisual("Other/questcategory/quest_category_open.tga")
			self.__questCategorySlot[i].closeImage.SetOverVisual("Other/questcategory/quest_category_open.tga")
			self.__questCategorySlot[i].closeImage.SetDownVisual("Other/questcategory/quest_category_close.tga")
			self.__questCategorySlot[i].closeImage.SetPosition(10,5)
			self.__questCategorySlot[i].closeImage.SAFE_SetEvent(self.__CloseCategories, i)

closed y open 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

German:

Hey Community,

habe mal eine Frage bzg. des Systems (Quest Categories).
Screen:
e76f5bc3ee.PNG

Hab bei mir das eingefügt nur weiß ich gar nicht wie man da Queste erstellt bzw.
wie Queste dort auftauchen.

Habe eine Function in der Src eingefügt, un zwar folgende:
------------------------------------
getcurrentquestname
------------------------------------

Habe in der quest_function (Serverside) das eingefügt:
q.getcurrentquestname

Kann mir vllt. einer ein Beispiel machen wie ich es zum laufen bringen kann das meine Queste dort angezeigt werden
bzw. wie man Sie dort einfügen kann.

MFG.

 

English:

 

Hey Community,

have a question. of the system (Quest Categories).
Screen:e76f5bc3ee.PNG

I have inserted this only I do not know how to create Queste or
like quests appear there.

Have a function in the Src inserted, namely the following:
------------------------------------
getcurrentquestname
------------------------------------

I inserted in the quest_function (Serverside):
q.getcurrentquestname

I can probably. Let me give you an example of how I can make my quest appear there
or how you can insert it there.

Best regards

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 3 weeks later...

Hello there.

I have a little problem on client

1213 19:45:05627 :: 
networkModule.py(line:200) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:25) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiCharacter.py, line 767)

1213 19:45:05627 :: ============================================================================================================
1213 19:45:05627 :: Abort!!!!

Someone know to help me?

Link to comment
Share on other sites

  • 5 months later...

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.