Jump to content

Human

Inactive Member
  • Posts

    167
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by Human

  1. Excellent guide it works good ... 
    but i have problem with converting item proto using convertproto.py 
    if any1 can correct it will be good 
     

    Error while converting

      Hide contents

      File "convert_proto.py", line 857, in item_proto
        item_proto_line = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (row[0], "\"" + row[1] + "\"", "\""  + get_item_type(row[3], row[0]) + "\"" , "\""  + get_item_subtype(row[3], row[4], row[0]) + "\"", row[6] , get_antiflag(row[7], row[0]), get_flag(row[8], row[0]), get_wearflag(row[9], row[0]), get_immuneflag(row[10]), row[11], row[12], row[13], row[14], row[16], get_limittype(row[17]), row[18], get_limittype(row[19]), row[20], get_apply(row[21]), row[22], get_apply(row[23]), row[24], get_apply(row[25]), row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[39], row[40], row[41])
    TypeError: cannot concatenate 'str' and 'long' objects
     


    I tell you why it is happening normal convert proto the vnum_range will be last so it wont make problem but here we added vnum_range next to vnum that is row 2... so its making problem So any one who correct this will be helpful i tried but it says 

    " TypeError: not enough arguments for format string " 

    Here is my Convert proto.py 

    Error section 
     

      Hide contents

        out_file_itemproto = open("item_proto.txt", "w")
        out_file_itemnames = open("item_names.txt", "w")
        print "Converting item_proto..."
        for row in rows:
            item_proto_line = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (row[0], "\"" + row[1] + "\"", "\""  + get_item_type(row[3], row[0]) + "\"" , "\""  + get_item_subtype(row[3], row[4], row[0]) + "\"", row[6] , get_antiflag(row[7], row[0]), get_flag(row[8], row[0]), get_wearflag(row[9], row[0]), get_immuneflag(row[10]), row[11], row[12], row[13], row[14], row[16], get_limittype(row[17]), row[18], get_limittype(row[19]), row[20], get_apply(row[21]), row[22], get_apply(row[23]), row[24], get_apply(row[25]), row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[39], row[40], row[41])
            item_names_line = "%s\t%s" % (row[0], row[2])
            out_file_itemproto.write(item_proto_line + "\r\n")
            out_file_itemnames.write(item_names_line + "\r\n")
        out_file_itemproto.close()


    Thanks in Advance 

    • Good 1
  2. Excellent guide it works good ... 
    but i have problem with converting item proto using convertproto.py 
    if any1 can correct it will be good 
     

    Error while converting

    Spoiler

      File "convert_proto.py", line 857, in item_proto
        item_proto_line = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (row[0], "\"" + row[1] + "\"", "\""  + get_item_type(row[3], row[0]) + "\"" , "\""  + get_item_subtype(row[3], row[4], row[0]) + "\"", row[6] , get_antiflag(row[7], row[0]), get_flag(row[8], row[0]), get_wearflag(row[9], row[0]), get_immuneflag(row[10]), row[11], row[12], row[13], row[14], row[16], get_limittype(row[17]), row[18], get_limittype(row[19]), row[20], get_apply(row[21]), row[22], get_apply(row[23]), row[24], get_apply(row[25]), row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[39], row[40], row[41])
    TypeError: cannot concatenate 'str' and 'long' objects
     


    I tell you why it is happening normal convert proto the vnum_range will be last so it wont make problem but here we added vnum_range next to vnum that is row 2... so its making problem So any one who correct this will be helpful i tried but it says 

    " TypeError: not enough arguments for format string " 

    Here is my Convert proto.py 

    Error section 
     

    Spoiler

        out_file_itemproto = open("item_proto.txt", "w")
        out_file_itemnames = open("item_names.txt", "w")
        print "Converting item_proto..."
        for row in rows:
            item_proto_line = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (row[0], "\"" + row[1] + "\"", "\""  + get_item_type(row[3], row[0]) + "\"" , "\""  + get_item_subtype(row[3], row[4], row[0]) + "\"", row[6] , get_antiflag(row[7], row[0]), get_flag(row[8], row[0]), get_wearflag(row[9], row[0]), get_immuneflag(row[10]), row[11], row[12], row[13], row[14], row[16], get_limittype(row[17]), row[18], get_limittype(row[19]), row[20], get_apply(row[21]), row[22], get_apply(row[23]), row[24], get_apply(row[25]), row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[39], row[40], row[41])
            item_names_line = "%s\t%s" % (row[0], row[2])
            out_file_itemproto.write(item_proto_line + "\r\n")
            out_file_itemnames.write(item_names_line + "\r\n")
        out_file_itemproto.close()


    Thanks in Advance 

  3. well i compiled with that but i get this bug in database mysql 
     

    Spoiler
    socket0 socket1 socket2 socket3 socket4 socket5 specular socket_pct addon_type vnum_range
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 80 3 0
    -1 -1 -1 -1 -1 -1 0 65 3 0
    -1 -1 -1 -1 -1 -1 0 50 3 0
    -1 -1 -1 -1 -1 -1 0 40 3 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 80 3 0
    -1 -1 -1 -1 -1 -1 0 65 3 0
    -1 -1 -1 -1 -1 -1 0 50 3 0
    -1 -1 -1 -1 -1 -1 0 40 3 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 80 3 0
    -1 -1 -1 -1 -1 -1 0 65 3 0
    -1 -1 -1 -1 -1 -1 0 50 3 0
    -1 -1 -1 -1 -1 -1 0 40 3 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 3 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 30 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 0 0 0
    -1 -1 -1 -1 -1 -1 0 100 23 0
    -1 -1 -1 -1 -1 -1 0 100 17 0
    -1 -1 -1 -1 -1 -1 0 100 17 0
    -1 -1 -1 -1 -1 -1 0 100 17 0
    -1 -1 -1 -1 -1 -1 0 100 3 0
    -1 -1 -1 -1 -1 -1 0 100 3 0

    look that specular moves to socket_pct position and socket_pct moves to addon :S

  4. Hey devs,

    I Have a stranger problem that is 
    In my Item proto db side whenever i reboot or reload proto the Specular value, Socket0 , socket1, socket 2 values went to 0 ... 
    Im reading from Mysql DB not txt... 
    when i check clientManagerBoot.cpp i found that there is no specification for specular or socket

    Before adding

    Spoiler

    bool CClientManager::InitializeItemTable() {
        char query[4096];
        snprintf(query, sizeof(query),
            "SELECT vnum, vnum_range, name, %s, type, subtype, gold, shop_buy_price, weight, size, flag, wearflag, "
            "antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, "
            "limittype0, limitvalue0, limittype1, limitvalue1, "
            "applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, "
            "value0, value1, value2, value3, value4, value5 "
            "FROM item_proto%s ORDER BY vnum",
            g_stLocaleNameColumn.c_str(), GetTablePostfix());

    so i added in specular and socket1 etc... 
    After adding

    Spoiler

    bool CClientManager::InitializeItemTable() {
        char query[4096];
        snprintf(query, sizeof(query),
            "SELECT vnum, vnum_range, name, %s, type, subtype, gold, shop_buy_price, weight, size, flag, wearflag, "
            "antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, "
            "limittype0, limitvalue0, limittype1, limitvalue1, "
            "applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, "
            "value0, value1, value2, value3, value4, value5 "
            "socket0, specular, socket1, socket2, "
            "FROM item_proto%s ORDER BY vnum",
            g_stLocaleNameColumn.c_str(), GetTablePostfix());

        std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
        SQLResult * pRes = pkMsg->Get();

    Db and game compiled successfully 

    but game is not starting
    connect: Connection refused

     i get error from db syserr

     

    Spoiler

    SYSERR: Mar 22 16:23:44 :: pid_init: 
    Start of pid: 732

    SYSERR: Mar 22 16:23:44 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM item_proto  ORDER BY vnum' at line 1
    query: SELECT vnum, vnum_range, name, locale_name, type, subtype, gold, shop_buy_price, weight, size, flag, wearflag, antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, limittype0, limitvalue0, limittype1, limitvalue1, applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, value0, value1, value2, value3, value4, value5 socket0, specular, socket1, socket2, FROM item_proto  ORDER BY vnum
    SYSERR: Mar 22 16:23:44 :: InitializeItemTable: Could not load item_proto. No results!
    SYSERR: Mar 22 16:23:44 :: InitializeTables: InitializeItemTable FAILED
    SYSERR: Mar 22 16:23:44 :: Initialize: Table Initialize FAILED
    SYSERR: Mar 22 16:23:44 :: pid_deinit: 
    End of pid

    Any Solution for this ?
     

    Thanks in advance

  5. Well sorry i found the solution
    its that item for opening shop... 
    item vnum i specified in it..offline shop config..

    I got another bug

    The change price of opened shop item I changed the price but the item at 1st slot say pos '0' is changing even if i change 3rd slot item I show in pic clearly

    In this Picture i click change price for foundation stone 
    aig7jz

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

    Once i done the price of battle sword is changed 
    aig89j

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

    Check the foundation stone price is unchanged 

    aig8j6

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

    Here is my Offlineshopmanager.cpp

    Spoiler

    void COfflineShopManager::ChangePrice(LPCHARACTER ch, BYTE bPos, DWORD dwPrice)
    {
        if (!ch)
            return;

        if (bPos >= OFFLINE_SHOP_HOST_ITEM_MAX_NUM)
        {
            sys_err("Offlineshop overflow slot count [%s][%d]", ch->GetName(), bPos);
            return;
        }

        LPOFFLINESHOP pkOfflineShop = FindOfflineShop(FindMyOfflineShop(ch->GetPlayerID()));
        if (pkOfflineShop)
            pkOfflineShop->BroadcastUpdatePrice(bPos, dwPrice);

        DBManager::instance().DirectQuery("UPDATE %soffline_shop_item SET price = %u WHERE owner_id = %u and pos = %d", get_table_postfix(), dwPrice, ch->GetPlayerID(), bPos);

        sys_log(0, "PRET: %u | ITEM ID: %u | POZITIE: %d", dwPrice, ch->GetPlayerID(), bPos);
    }
     

    any solution for this ?
    thanks 

  6. i already did that and let me show what error i get when i click create character 
     

    Spoiler

    0310 11:02:18924 :: 
    networkModule.py(line:190) SetCreateCharacterPhase
    system.py(line:115) __pack_import

    networkModule.SetCreateCharacterPhase - exceptions.SyntaxError:invalid syntax (line 689)

    0310 11:02:18925 :: ============================================================================================================
    0310 11:02:18925 :: Abort!!!!
     

    when i correct those 
    i get this error 

    Spoiler


    0310 12:07:09274 ::   File "uiPhaseCurtain.py", line 51, in OnUpdate

    0310 12:07:09275 ::   File "networkModule.py", line 137, in __ChangePhaseWindow

    0310 12:07:09275 ::   File "introCreate.py", line 316, in Open

    0310 12:07:09275 ::   File "introCreate.py", line 417, in EnableWindow

    0310 12:07:09275 ::   File "introCreate.py", line 430, in __GetSlotChrID

    0310 12:07:09275 :: KeyError
    0310 12:07:09275 :: : 
    0310 12:07:09275 :: 4
    0310 12:07:09275 :: 

    Well i corrected the RACE_DECT = { and RACE_NAME  those 4 ... now i able to see create windows but female is not working and i get sys err 

    Spoiler

    0310 13:06:48808 :: Traceback (most recent call last):

    0310 13:06:48808 ::   File "introCreate.py", line 690, in OnUpdate

    0310 13:06:48808 :: IndexError
    0310 13:06:48808 :: : 
    0310 13:06:48808 :: list index out of range
    0310 13:06:48808 :: 
     

    its like a lot and that line 690  is not On update anyway i checked OnUpdate i cant find it anything wrong 
    **Still need to be solved

    Spoiler

        def OnUpdate(self):
            chr.Update()
            (xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
            event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
            self.descriptionBox.SetIndex(self.descIndex)
            SLOT_COUNT_TWO = 4
            #if constInfo.WOLF_WOMEN != "DISABLED" and constInfo.WOLF_WOMEN == "ENABLED":
               # SLOT_COUNT_TWO += 1
            #else:
               # if constInfo.WOLF_MAN != "DISABLED" and constInfo.WOLF_MAN == "ENABLED":
                   # SLOT_COUNT_TWO += 1
            
            #if SLOT_COUNT_TWO > 5:
                #SLOT_COUNT_TWO = 5
            
            for page in xrange(PAGE_COUNT):
                SLOT_COUNT_RES = 5
                for i in xrange(SLOT_COUNT_RES):
                    self.curNameAlpha += (self.destNameAlpha - self.curNameAlpha) / 10.0
                    self.NameList.SetAlpha(self.curNameAlpha)
                
                for i in xrange(4):
                    self.curGauge += (self.destGauge - self.curGauge) / 10.0
                    if abs(self.curGauge - self.destGauge) < 0.005:
                        self.curGauge = self.destGauge
                    self.GaugeList.SetPercentage(self.curGauge, 1.0)
            
            if -1 != self.reservingRaceIndex:
                if app.GetTime() - self.reservingStartTime >= 1.5:
                    chrSlot=self.stream.GetCharacterSlot()
                    textName = self.editCharacterName.GetText()
                    raceIndex = self.reservingRaceIndex
                    shapeIndex = self.reservingShapeIndex
                    
                    startStat = self.START_STAT[self.slot]
                    statCon = self.stat[0] - startStat[0]
                    statInt = self.stat[1] - startStat[1]
                    statStr = self.stat[2] - startStat[2]
                    statDex = self.stat[3] - startStat[3]
                    
                    net.SendCreateCharacterPacket(chrSlot, textName, raceIndex, shapeIndex, statCon, statInt, statStr, statDex)
                    self.reservingRaceIndex = -1
     

     getting this error while in create char window and also in select char window
    ade9zihttps://metin2.download/picture/uDcoigc0T1UTLcqin6IuHVKCA9iEduII/.png

    and error is 
     

    Spoiler

    0310 14:03:09372 :: invalid idx 0
    0310 14:04:16809 :: 
    introEmpire.py(line:189) __LoadScript
    ui.py(line:2906) GetChild

    SelectEmpireWindow.__LoadScript.BindObject - exceptions.KeyError:EmpireName

    0310 14:04:16809 :: ============================================================================================================
    0310 14:04:16809 :: Abort!!!!

    ##Solved

    Error 2 : 
    Here Ninja is selected but female sura is showing 
    adeb7qhttps://metin2.download/picture/Ac4J3Kd24X22eMoOLWh8dCarCf5ln6WX/.jpg
    **Still needed to be solve

    I will be happy if anyone correct these 
    thanks in advance 

  7. I get error with wolfman cant correct it
    I want without wolfman can anyone edit this ? 
    my introcreate.py is

    http://pastebin.com/awBRZjBx

    Thanks in advance
    I am getting error 

    Spoiler


    networkModule.SetCreateCharacterPhase - exceptions.AttributeError:'module' object has no attribute 'RACE_WOLF_M'

    i need to remove the wolf man else i need playersettingmodule.py with wolfman race added so i can disable in constinfo.py 
    anyone provide me official playersettingmodule.py with wolfman or introcreate.py without wolfman
    thanks in advance 

    • Metin2 Dev 1
  8. Hey all , 
    well i want to compile quest using pre_qc with make command sh make_locale i get this error 

    Spoiler

    make_locale: import: not found
    make_locale: import: not found
    make_locale: 5: Syntax error: word unexpected (expecting ")")

    my Pre_qc is 

    Spoiler

    # -*- coding: 949 -*-
    # 말 그대로 pre qc.
    # 우리 퀘스트 언어에는 지역 변수만이 있고,
    # state나, 심지어 when, function을 아우르는 전역 변수를 사용할 수 없다.
    # 전역 '변수'의 사용은 언어의 구조상 사용이 불가하고, 별 의미가 없다.
    # 하지만 전역 '상수'의 사용은 퀘스트 view 상으로 꼭 필요하기 때문에,
    # fuction setting () 과 같은 함수를 이용하여, 
    # 매번 테이블을 생성하여 전역 상수를 흉내내어 사용하였다.
    # 이는 매우 비효율적이므로,
    # c의 preprocesser와 같이 pre qc를 만들어 전역 상수를 사용할 수 있도록 하였다.
    # 퀘스트를 qc로 컴파일 하기 전에 pre_qc.py를 통과하면,
    # pre_qc.py는 define 구문을 처리하고, 그 결과를
    # pre_qc/filename에 저장한다.

    import sys

    def split_by_quat (buf):
        p = False
        l = list (buf)
        l.reverse()
        s = ""
        res = []
        while l:
            c = l.pop()
            if c == '"':
                if p == True:
                    s += c
                    res +=
                    s = ""
                else:
                    if len (s) != 0:
                        res +=
                    s = '"'
                p = not p
            elif c == "\\" and l[0] == '"':
                s += c
                s += l.pop()
            else:
                s += c
        
        if len (s) != 0:
            res +=
        return res

    def AddSepMiddleOfElement (l, sep):
        l.reverse()
        new_list = [l.pop()]
        while l:
            new_list.append (sep)
            new_list.append (l.pop())
        return new_list

    def my_split_with_seps(s, seps):
        res =
        for sep in seps:
            new_res = []
            for r in res:
                sp = r.split (sep)
                sp = AddSepMiddleOfElement (sp, sep)
                new_res += sp
            res = new_res
        new_res = []
        for r in res:
            if r != '':
                new_res.append (r)
        return new_res

    def my_split(s, seps):
        res =
        for sep in seps:
            new_res = []
            for r in res:
                sp = r.split (sep)
                new_res += sp
            res = new_res
        new_res = []
        for r in res:
            if r != '':
                new_res.append (r)
        return new_res
    def MultiIndex (list, key):
        l = []
        i = 0
        for s in list:
            if s == key:
                l.append (i)
            i = i + 1
        return l

    def Replace (lines, parameter_table, keys):
        r = []
        for string in lines:
            l = split_by_quat (string)
            for s in l:
                if s[0] == '"':
                    r +=
                else:
                    tokens = my_split_with_seps (s, ["\t", ",", " ", "=", "[", "]",'-','<','>','~','!','.','(',')'])
                    for key in keys:
                        try:
                            idices = MultiIndex(tokens, key)
                            for i in idices:
                                tokens = parameter_table[key][0]
                        except:
                            pass
                    r += tokens
        return r

    def MakeParameterTable(lines, parameter_table, keys):
        names = []
        values = []
        group_names = []
        group_values = []
        idx = 0
        for line in lines:
            idx += 1
            line = line.strip("\n")
            if (-1 != line.find("--")):
                line = line[0:line.find("--")]
            
            tokens = my_split(line, ["\t", ",", " ", "=", "[", "]", "\r", "\n"])
            if len(tokens) == 0:
                continue
            if cmp (tokens[0], "quest") == 0:
                start = idx
                break
            if cmp (tokens[0], "define") == 0:
                if cmp (tokens[1],  "group") == 0:
                    group_value = []
                    for value in tokens[3:]:
                        if parameter_table.get(value, 0) != 0:
                            value = prameter_table[value]
                        group_value.append (value)
                    parameter_table [tokens[2]] = group_value
                    keys.append(tokens[2])
                elif len(tokens) > 5:
                    print "%d %s" % (idx, "Invalid syntax")
                    print "define [name] = [value]"
                    print "define group [name] = \"[\"[v0],[v1], ... \"]\""
                else :
                    if tokens[1] == "rgd_kill_num":
                        print "mybad"
                    value = tokens[2]
                    if parameter_table.get(value, 0) != 0:
                        value = prameter_table[value]
                    parameter_table[tokens[1]] = [value]
                    keys.append (tokens[1])
        parameter_table = dict (zip (group_names, group_values))
        return start

    def run(filename):
        parameter_table = dict()
        keys = []

        filename = filename.strip("\n")
        if filename == "":
            return
        lines = open (filename).readlines()
        start = MakeParameterTable (lines, parameter_table, keys)
        if len (keys) == 0:
            return False

        lines = lines [start-1:]
        r = Replace (lines, parameter_table, keys)
        f = file ("pre_qc/"+filename, "w")
        for s in r:
             f.write(s)
        return True
     


    my make_locale

    Spoiler

    #!/usr/local/bin/python
    import pre_qc
    import os
    import sys
    os.system('rm -rf object')
    os.system('mkdir object')
    #os.system('rm -rf pre_qc')
    os.system('mkdir pre_qc')
    os.system('chgrp quest object')
    for line in file('locale_list'):
        r = pre_qc.run (line)
        if r == True:
            filename = 'pre_qc/'+line
        else:
            filename = line

        if os.system('./qc '+filename):
            print 'Error occured on compile ' + line
            os.system('chmod -R 770 object')
            import sys
            sys.exit(-1)

    os.system('chmod -R 770 object')

    Thanks in Advance

  9. Hello guys
    While i trying dragon alchemy i m able to do upgrade class and clarity ..but level of dragon stone ( strength) cant be increase...
    Here is the picture

    http://dragon.jpg

    If i click too nothing happens..
    In sys error i get this

    any solution for this ?
    Thanks in advance...

    DoRefineStrength: INVALID DRAGON SOUL(114410)

  10. Hi everyone,

    I have problem in Watery Cavern or Dragon room while in party that is group leveling they receive more exp.. in Level distribution than even distribution...
    exp is so much than while levelling alone... some bug in that party...or what is the problem in that??

    may i know where i can change that group party distirbution values??

    Very urgent

    Need Help...

    Thanks in advance...

     

     

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