TextIDs.lua changes

Post Reply
Zerahn
Posts: 18
Joined: Wed Aug 07, 2013 5:52 pm

TextIDs.lua changes

Post by Zerahn » Mon Aug 12, 2013 8:23 pm

Using Bastok Mines as an example, here are the proposed changes to the TextIDs.lua files to get them ready for automated updates.

Code: Select all

-- Variable TextID   Description text

-- General Texts
   ITEM_CANNOT_BE_OBTAINED = 6375; --||Come back after sorting your inventory.||
FULL_INVENTORY_AFTER_TRADE = 6377; --||Try trading again after sorting your inventory.||
             ITEM_OBTAINED = 6378; --||Obtained: <<<Unknown Parameter (Type: 80) 1>>><<<Possible Special Code: 01>>><<<Possible Special Code: 05>>>||
              GIL_OBTAINED = 6379; --||Obtained <<<Numeric Parameter 0>>> gil.||
          KEYITEM_OBTAINED = 6381; --||Obtained key item: <<<Unknown Parameter (Type: 80) 1>>>||
       NOT_HAVE_ENOUGH_GIL = 6383; --||You do not have enough gil.||
            ITEMS_OBTAINED = 6387; --||You obtain <<<Numeric Parameter 1>>> <<<Possible Special Code: 01>>><<<Speaker Name>>>||
             HOMEPOINT_SET = 6436; --||Home point set!||
    FISHING_MESSAGE_OFFSET = 7007; --||You can't fish here.||

-- Conquest System
CONQUEST = 7571; --||You've earned conquest points!||

-- Mission Dialogs
	 YOU_ACCEPT_THE_MISSION = 6446; --||You have accepted the mission.||
	ORIGINAL_MISSION_OFFSET = 6451; --||You can consult the ^"oMission^"c section of the main menu to review your objectives.||
	EXTENDED_MISSION_OFFSET = 7933; --||Go to Ore Street and talk to Medicine Eagle. He says he was there when the commotion started.||

-- Other Dialogs
   ITEM_DELIVERY_DIALOG = 7454; --||Need something sent to a friend's house? Sending items to your own room? You've come to the right place!||

-- Harvest Festival
      TRICK_OR_TREAT = 8056; --||Trick or treat...||
     THANK_YOU_TREAT = 8057; --||And now for your treat...||
      HERE_TAKE_THIS = 8058; --||Here, take this...||
    IF_YOU_WEAR_THIS = 8059; --||If you put this on and walk around, something...unexpected might happen...||
           THANK_YOU = 8060; --||Thank you...<<<Prompt>>>||
  
-- Shop Texts
    SOMNPAEMN_CLOSED_DIALOG = 7365; --||I'm trying to start a business selling goods from Sarutabaruta,||
       YAFAFA_CLOSED_DIALOG = 7366; --||I'm trying to start a business selling goods from Kolshushu,||
     OGGODETT_CLOSED_DIALOG = 7367; --||I'm trying to start a business selling goods from Aragoneu,||

         TEERTH_SHOP_DIALOG = 7468; --||Welcome to the Goldsmiths' Guild shop.^*What can I do for you?||
         VISALA_SHOP_DIALOG = 7469; --||Welcome to the Goldsmiths' Guild shop.^*How may I help you?||
        ZHIKKOM_SHOP_DIALOG = 7470; --||Welcome to the only weaponry store in Bastok,^*the Dragon's Claws!||
         CIQALA_SHOP_DIALOG = 7471; --||A weapon is the most precious thing to an adventurer! Well, after his life, of course.||
      PERITRAGE_SHOP_DIALOG = 7472; --||Hey!^*I've got just the thing for you!||
      BRUNHILDE_SHOP_DIALOG = 7473; --||Welcome to my store!^*You want armor, you want shields?^*I've got them all!||
CHARGINGCHOKOBO_SHOP_DIALOG = 7474; --||Hello.^*What piece of armor are you missing?||
      BALTHILDA_SHOP_DIALOG = 7475; --||Feeling defenseless of late?^*Brunhilde's Armory has got you covered!||
          MJOLL_SHOP_DIALOG = 7476; --||Welcome.^*Have a look and compare! You'll never find better wares anywhere.||
          OLWYN_SHOP_DIALOG = 7477; --||Welcome to Mjoll's Goods!^*What can I do for you?||
          ZAIRA_SHOP_DIALOG = 7478; --||Greetings.^*What spell are you looking for?||
         SORORO_SHOP_DIALOG = 7479; --||Hello-mellow, welcome to Sororo's Scribe and Notary!||
      HARMODIOS_SHOP_DIALOG = 7480; --||Add music to your adventuring life! Welcome to Harmodios's.||
      CARMELIDE_SHOP_DIALOG = 7481; --||Ah, welcome, welcome!^*What might I interest you in?||
          RAGHD_SHOP_DIALOG = 7482; --||Give a smile to that special someone! Welcome to Carmelide's.||
       HORTENSE_SHOP_DIALOG = 7483; --||Hello there!^*We have instruments and music sheets at Harmodios's!||
       OGGODETT_OPEN_DIALOG = 7484; --||Hello there!^*Might I interest you in some specialty goods from Aragoneu?||
         YAFAFA_OPEN_DIALOG = 7485; --||Hello!^*I've got some goods from Kolshushu--interested?||
      SOMNPAEMN_OPEN_DIALOG = 7486; --||Welcome!^*I have goods straight from Sarutabaruta! What say you?||
This includes control codes for polutil's strange characters; instead of <Prompt> for example, it writes (0xE2)(0x89)(0xBA)Prompt(0xE2)(0x89)(0xBB). Due to the way the program runs, it will be necessary to change EVERY TextIDs.lua to this format; however once it's done any further retail updates can have this program run on them instead of manually dredging through the files. As I mentioned on IRC, the source code is BASIC. Here's the current version in the event someone wants to C-ify it. It'd probably run faster, although in present form it's capable of scanning through 14,000 xml tags in about a minute.
Attachments
lua batch update.txt
(9.54 KiB) Downloaded 194 times

Metalfiiish
Developer
Posts: 176
Joined: Tue Jul 31, 2012 7:21 am

Re: TextIDs.lua changes

Post by Metalfiiish » Mon Aug 12, 2013 8:35 pm

I had the same issue when making my script to update them, it was hanging at the '<' 0xe2,0x89,0xba/oxbb '>' . I couldnt get the scraper to be able to logically read those even with a regex for the hex code lol

Zerahn
Posts: 18
Joined: Wed Aug 07, 2013 5:52 pm

Re: TextIDs.lua changes

Post by Zerahn » Mon Aug 12, 2013 8:44 pm

I don't know what you had done, but I'm opening the xml in binary mode and reading one character at a time until it finds both < and > from an xml tag. If it's not 'field = "index"' or 'field = "text' it ignores it and moves to the next until it finds one. Once it does it searches for the </field> close tag, and dumps everything between the two into a string variable, and searches for the lua string as a substring of that.

Metalfiiish
Developer
Posts: 176
Joined: Tue Jul 31, 2012 7:21 am

Re: TextIDs.lua changes

Post by Metalfiiish » Thu Aug 15, 2013 12:30 pm

Ah I was using a pythin module called elementree that inspected the tree for the proper fields and then fed me the info whi ch would then filter through a regex to clean it up and make it match the current comment that is provided next to every current defined variable in each zones txt file. Same though. .rips through the xmls from mass extractor. Kinda halted due to the regex not being able to grab the weird symbol when inpecting the elements from "element tree". Weird enuf it works to find the weird char if I manually copy it into its own string and run it theough the same regex filter. .. that's where I got stuck lol. I was reading the Xor documents from pebbles in hopes to rip it straight from the dat files and possibly bypass the weird char.

Zerahn
Posts: 18
Joined: Wed Aug 07, 2013 5:52 pm

Re: TextIDs.lua changes

Post by Zerahn » Thu Aug 15, 2013 5:51 pm

oh damn, i never thought of doing it that way. Well I did, but I thought it might slow it down a bunch or something. It's totally worth a shot though. could the stuff you were using handle UTF-8 characters? for all i know everything these days is able to, but if it can't that may have been the problem

Metalfiiish
Developer
Posts: 176
Joined: Tue Jul 31, 2012 7:21 am

Re: TextIDs.lua changes

Post by Metalfiiish » Fri Aug 16, 2013 6:06 am

Yeah the encoding was set to utf8. If I didn't the script eould crash when it hit that char lol.

Post Reply