Jump to content

Recommended Posts

Hello,

I've got an issue related to compiling quests... I made a quest for item exchange with some select options and every time I use Czech language symbols I keep getting an error while compiling...

 

quest smena_receptu begin
    state start begin
        when 20003.chat."Směna receptury" begin
            say_title("Ah-Yu:")
            say("Mohu ti směnit receptury.")
            say("Přines mi recepturu, a můžeš si vybrat jednu")
            say("z ostatních receptur.")
            say("Kolik receptur chceš směnit?")
            local count = tonumber(input())
            
            if count == nil or count <= 0 then
                say("Zadej platný počet!")
                return
            end

            if pc.count_item(30128) < count then
                say("Nemáš dostatek receptur.")
                return
            end
            
			local selected = select("Receptura brnění", "Receptura bot", "Receptura naušnic", 
                        "Receptura náhrdelníků", "Receptura štítů", "Receptura helem", 
                        "Receptura náramků", "Receptura zbraní")

            
            local recept_map = {
                [1] = 30120,
                [2] = 30121,
                [3] = 30122,
                [4] = 30123,
                [5] = 30124,
                [6] = 30125,
                [7] = 30126,
                [8] = 30127
            }
            
            local selected_recept = recept_map[selected]
            
            pc.remove_item(30128, count)
            pc.give_item2(selected_recept, count)
            
            say_title("Ah-Yu:")
            say("Získal jsi "..count.." ks receptur "..selected_recept.."!")
        end
    end
end

What am I doing wrong? Some of my quests keep working just fine with latin1 / cp1250, but this one doesnt... Even the text outside of the buttons keeps working fine, but the text inside the select() is causing problems. When I remove the letters such as ěščřžýáíé it starts working fine.

 

How do I fix this?

Link to comment
https://metin2.dev/topic/32984-quest-charset-causing-errors/
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Active+ Member

The issue you're encountering is likely related to the encoding mismatch between the quest compiler and the Czech characters you're using. The ěščřžýáíé symbols are not part of the standard ASCII character set and can cause issues during compilation if the compiler doesn't properly support the encoding you're using.

 

Make sure your quest file is saved using UTF-8 encoding, as it's widely supported for extended character sets, including Czech characters.

If you're using a text editor, ensure that the file is saved as UTF-8. You can do this by going to "Save As" and selecting the encoding format.
 

Sometimes, escaping special characters can help. You can try escaping the Czech characters in the text to avoid the encoding issue.

For example, ě could be written using its Unicode escape sequence if supported by the compiler: \u011B.

If the quest compiler only supports specific encodings like CP1250 (used for Central European languages), make sure your text file is saved in this encoding. Some text editors (like Notepad++ or Sublime) allow you to convert files between encodings.

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.