Traceur3RUN 75 Posted January 17, 2019 Share Posted January 17, 2019 Hello, how i can change etc_drop_item load by name to load by vnum? i found const int FILE_NAME_LEN = 256; Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10271 Posted March 26, 2019 Forum Moderator Share Posted March 26, 2019 Using std::ifstream, very easy. http://www.cplusplus.com/reference/fstream/ifstream/ifstream/ DWORD dwItemVnum; float fProb; std::ifstream myfile(c_pszFileName, std::ifstream::in); while (myfile >> dwItemVnum >> fProb) { [...........] } Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
revengertmt 50 Posted April 25, 2019 Share Posted April 25, 2019 On 3/26/2019 at 1:50 AM, VegaS™ said: Using std::ifstream, very easy. http://www.cplusplus.com/reference/fstream/ifstream/ifstream/ DWORD dwItemVnum; float fProb; std::ifstream myfile(c_pszFileName, std::ifstream::in); while (myfile >> dwItemVnum >> fProb) { [...........] } // LOCALE_SERVICE const int FILE_NAME_LEN = 256; char szCommonDropItemFileName[FILE_NAME_LEN]; char szETCDropItemFileName[FILE_NAME_LEN]; char szMOBDropItemFileName[FILE_NAME_LEN]; char szDropItemGroupFileName[FILE_NAME_LEN]; char szSpecialItemGroupFileName[FILE_NAME_LEN]; char szMapIndexFileName[FILE_NAME_LEN]; char szItemVnumMaskTableFileName[FILE_NAME_LEN]; char szDragonSoulTableFileName[FILE_NAME_LEN]; snprintf(szCommonDropItemFileName, sizeof(szCommonDropItemFileName), "%s/common_drop_item.txt", LocaleService_GetBasePath().c_str()); snprintf(szETCDropItemFileName, sizeof(szETCDropItemFileName), "%s/etc_drop_item.txt", LocaleService_GetBasePath().c_str()); snprintf(szMOBDropItemFileName, sizeof(szMOBDropItemFileName), "%s/mob_drop_item.txt", LocaleService_GetBasePath().c_str()); snprintf(szSpecialItemGroupFileName, sizeof(szSpecialItemGroupFileName), "%s/special_item_group.txt", LocaleService_GetBasePath().c_str()); snprintf(szDropItemGroupFileName, sizeof(szDropItemGroupFileName), "%s/drop_item_group.txt", LocaleService_GetBasePath().c_str()); snprintf(szMapIndexFileName, sizeof(szMapIndexFileName), "%s/index", LocaleService_GetMapPath().c_str()); snprintf(szItemVnumMaskTableFileName, sizeof(szItemVnumMaskTableFileName), "%s/ori_to_new_table.txt", LocaleService_GetBasePath().c_str()); snprintf(szDragonSoulTableFileName, sizeof(szDragonSoulTableFileName), "%s/dragon_soul_table.txt", LocaleService_GetBasePath().c_str()); ????? Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10271 Posted April 25, 2019 Forum Moderator Share Posted April 25, 2019 (edited) On 4/25/2019 at 3:40 PM, revengertmt said: ????? Edited May 22, 2019 by VegaS™ added fix 1 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now