Jump to content
Shogun

[HowTo] Colored quest scrolls

Recommended Posts

Hey all,

 

Today I will explain to you how to use different designs for your quest scrolls like WoM.

 

 

Setting up the system

 

1) Copy your scroll designs to ui/game/quest/questicon in the client. I have attached the WoM scrolls as example.

 

2) Open uiCharacter.py and insert the code that appears between comments:

		if questCount > quest.QUEST_MAX_NUM:
			self.questScrollBar.Show()
		else:
			self.questScrollBar.Hide()

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			# start colored scrolls
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			elif questName[0] == '+':
				questName = questName[1:]
			# end colored scrolls
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()

3) Open interfaceModule.py

 

Replace this part:

 

 
		if locale.IsEUROPE():
			btn.SetUpVisual(locale.GetLetterCloseImageName())
			btn.SetOverVisual(locale.GetLetterOpenImageName())
			btn.SetDownVisual(locale.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE
 
with this:
 
 
		if locale.IsSINGAPORE() or locale.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_blue.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				name = name[1:]
			elif name[0] == '~':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_golden.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_green.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '+':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_purple.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(locale.GetLetterCloseImageName())
				btn.SetOverVisual(locale.GetLetterOpenImageName())
				btn.SetDownVisual(locale.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

Usage

 

After you modified your client, there will be 4 color codes that you can use at the start of your quest's title to enable the colored scroll: Blue (*), Golden (~), Green (&) and Purple (+). You also have to add the q.set_icon function containing the filename of the scroll picture. Here is an example of how to make a quest scroll blue:

when login with game.get_event_flag("worldbookday") == 1 begin
	send_letter("*World Book Day")
	q.set_icon("scroll_open_blue.tga")
	local v=find_npc_by_vnum(20023)
	if v!=0 then
		target.vid("__TARGET__", v, "Soon")
	end
end

And it looks like this:

 

 

bb915bbfe9.jpg

 

 

 

That's all you can also add new codes easily or use your own quest scroll designs. Enjoy!

questicon.zip

Edited by Shisui
Link Updated (see edit history)
  • Love 39

Share this post


Link to post

For files 40250:

 

interfacemodule:

		# QUEST_LETTER_IMAGE
		##!! 20061026.levites.Äù½ºÆ®_À̹ÌÁö_±³Ã¼
		import item
		if "item"==iconType:
			item.SelectItem(int(iconName))
			buttonImageFileName=item.GetIconImageFileName()
		else:
			buttonImageFileName=iconName

		if localeInfo.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("locale/cz/icon/scroll_close_green.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_green.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("locale/cz/icon/scroll_close_blue.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_blue.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_blue.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
				if "highlight" == iconType:
					btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
					btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
					btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
				else:
					btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
					btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
					btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

uicharacter:

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()
  • Love 5

Share this post


Link to post

dose not work for me too
can i give you my uicharacter & interfacemodule

and you do it for me ??

Share this post


Link to post

 

For files 40250:

 

interfacemodule:

		# QUEST_LETTER_IMAGE
		##!! 20061026.levites.Äù½ºÆ®_À̹ÌÁö_±³Ã¼
		import item
		if "item"==iconType:
			item.SelectItem(int(iconName))
			buttonImageFileName=item.GetIconImageFileName()
		else:
			buttonImageFileName=iconName

		if localeInfo.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("locale/cz/icon/scroll_close_green.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_green.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("locale/cz/icon/scroll_close_blue.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_blue.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_blue.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
				if "highlight" == iconType:
					btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
					btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
					btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
				else:
					btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
					btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
					btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

uicharacter:

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()

You wrong man ... if you want to work this , you have to add or remove one more variable.

Example :

 in your uicharacter code says:

                 if questName[0] == '*':

                questName = questName[1:]

            elif questName[0] == '&':

                questName = questName[1:]

            elif questName[0] == '~':

                questName = questName[1:]

This means variables for ~ , * and & .. but in interfacemodule is declared only * and &...

 

You have to complete the interfacemodule .. or to remove the line :

                 elif questName[0] == '~':

                questName = questName[1:]

from uicharacter..

 

Sorry for my bad english ^_^

 

Share this post


Link to post

Well .. i've made it for 40k to work perfect...

 

uicharacter.py and interfacemodule.py  made for r40k Client is attached to this reply..

 

Have fun ^_^

test.zip

  • Love 9

Share this post


Link to post

With little changes it works perfectly in the 40250 client you have just to change some little things, go in notepad++ or whatelse you use to edit the .py files and replace all 

locale.

in the code from this system to 

localeInfo.

then it will works perfectly in the 40250 client.

just for the people who doesn´t understand my really bad english here is the code for interfacemodule.py
 

if localeInfo.IsSINGAPORE() or localeInfo.IsEUROPE():
			if name[0] == '&':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_blue.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				name = name[1:]
			elif name[0] == '~':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_golden.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				name = name[1:]
			elif name[0] == '*':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_green.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '+':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_purple.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE
  • Love 2

Share this post


Link to post

How to fix it?

 

050102415_enhqsre.jpg

 

 

You write a no exist file in

q.set_icon("here")

The options for this system are:

q.set_icon("scroll_open_blue.tga")
q.set_icon("scroll_open_golden.tga")
q.set_icon("scroll_open_green.tga")
q.set_icon("scroll_open_purple.tga")

If you are sure that quest side is right check in the icon folder that

scroll_open_blue.tga
scroll_open_golden.tga
scroll_open_green.tga
scroll_open_purple.tga

exists

Share this post


Link to post

I have applyed everything good into my 34k client, no error, but :

 

pbQyfKP.jpg

Share this post


Link to post

I have applyed everything good into my 34k client, no error, but :

 

pbQyfKP.jpg

Scroll files must not be in locale, but in one folder in etc/questicon .

Share this post


Link to post

i have it in ymir work/ui/game/questicon in patch3.epk

 

edit: i got it look here ;)

 

WfKC7l2.jpg

 

thanks

  • Love 1

Share this post


Link to post

Dont work for me.

 

71bc54116c.jpg

 

Quest:

 

5abf4a80b9.png

 

uicharacter: 

27c4307d77.png

Interfacemodule: 

dc5dcde556.png

  • Love 1

Share this post


Link to post

succ in the quest board

but on the left side of the screen it doesn't work

 

and there is an unknown letters under the quests in the quest board

cfQxnV.jpg

Share this post


Link to post

I modified a little bit the function send_letter so you don't need to write q.set_icon(x)

function send_letter(name)
	local files = 
	{
		["*"] = "scroll_open_blue.tga",
		["~"] = "scroll_open_golden.tga",
		["&"] = "scroll_open_green.tga",
		["+"] = "scroll_open_purple.tga",
	}
	local chr = string.sub(name,1,1)
	if chr == '*' or chr == '~' or chr == '&' or chr == '+' then q.set_icon(files[chr]) end
	makequestbutton(name) 
	set_skin(NOWINDOW) 
	q.set_title(name) 
	q.start() 
end
  • Love 4

Share this post


Link to post

 

I modified a little bit the function send_letter so you don't need to write q.set_icon(x)

function send_letter(name)
	local files = 
	{
		["*"] = "scroll_open_blue.tga",
		["~"] = "scroll_open_golden.tga",
		["&"] = "scroll_open_green.tga",
		["+"] = "scroll_open_purple.tga",
	}
	local chr = string.sub(name,1,1)
	if chr == '*' or chr == '~' or chr == '&' or chr == '+' then q.set_icon(files[chr]) end
	makequestbutton(name) 
	set_skin(NOWINDOW) 
	q.set_title(name) 
	q.start() 
end
SCROll_BLUE = "*"
SCROLL_GOLD = "~" 
SCROLL_GREEN = "&"
SCROLL_PURPLE = "+"
SCROLL_TABLE = {SCROll_BLUE = "scroll_open_blue.tga",[SCROLL_GOLD] = "scroll_open_golden.tga" ,[SCROLL_GREEN] = "scroll_open_green.tga",[SCROLL_PURPLE]="scroll_open_purple.tga"}

function send_letter(name,scroll_type=nil)
    if SCROLL_TABLE[scroll_type] then 
		q.set_icon(SCROLL_TABLE[scroll_type]) 
		name = name..scroll_type
	end
    makequestbutton(name)
    set_skin(NOWINDOW)
    q.set_title(name)
    q.start()
end

I think is better using the scroll type as a parameter.

  • Love 1

Share this post


Link to post

Dont work for me.

 

71bc54116c.jpg

 

Quest:

 

5abf4a80b9.png

 

uicharacter: 

27c4307d77.png

Interfacemodule: 

dc5dcde556.png

 

Same here. I use Test client für 40250. 

Share this post


Link to post

Not working :|||||||||

ZIPEcYi.png

Your problem, you should learn to do a client by yourself, this is working 100%, i tested.

Share this post


Link to post

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
  • Recently Browsing   0 members

    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.