Active Member Thorek 280 Posted March 4, 2023 Active Member Share Posted March 4, 2023 This is the hidden content, please Sign In or Sign Up Another Download : This is the hidden content, please Sign In or Sign Up BlendItemRenewal Completely new and fresh approach to load blend items using JSON. Better than previous versions? I suppose so. The source file for this version has only about 50 lines so it is very slim. I have decided to adhere to the YMIR coding style, so there are no classes or structures. So - how to install this „system”? Make sure the compiler you are using supports (at least) C++11. Install This is the hidden content, please Sign In or Sign Up parser. Replace blend_item.h and blend_item.cpp with the old ones, and that is it. If you want hot-reloading the JSON file, you can add the cmd_gm.cpp part (recommended). Example blend.json file content below. { "50821": { "type": "CRITICAL_PCT", "value": [ 8, 10, 12, 15, 20 ], "duration": [ 60, 120, 180, 300, 600 ] }, "50822": { "type": "PENETRATE_PCT", "value": [ 8, 10, 12, 15, 20 ], "duration": [ 60, 120, 180, 300, 600 ] }, "50823": { "type": "ATTACK_SPEED", "value": [ 2, 3, 4, 5, 8 ], "duration": [ 60, 120, 180, 300, 600 ] }, "50824": { "type": "RESIST_MAGIC", "value": [ 8, 10, 12, 15, 20 ], "duration": [ 60, 120, 180, 300, 600 ] }, "50825": { "type": "ATT_BONUS", "value": [ 30, 50, 70, 90, 120 ], "duration": [ 60, 120, 180, 300, 600 ] }, "50826": { "type": "DEF_BONUS", "value": [ 40, 70, 100, 150, 200 ], "duration": [ 60, 120, 180, 300, 600 ] }, "51002": { "type": "ENERGY", "value": [ 1, 3, 5, 7, 10 ], "duration": 1800 // It is possible to use only one duration (and value). } } 98 5 15 1 26 Link to comment Share on other sites More sharing options...
Premium filipw1 1926 Posted March 4, 2023 Premium Share Posted March 4, 2023 Good stuff, but I've got it already for 30 minutes. You should use map instead of vector to save some time on finding the right blend data in you data pool. Nice to see people getting rid of some old and ugly code. 2 Link to comment Share on other sites More sharing options...
Active Member Thorek 280 Posted March 4, 2023 Author Active Member Share Posted March 4, 2023 (edited) 12 minutes ago, filipw1 said: Good stuff, but I've got it already for 30 minutes. You should use map instead of vector to save some time on finding the right blend data in you data pool. Nice to see people getting rid of some old and ugly code. You should fix all your systems to comments my topics!!! Thanks, fixed. Edited March 4, 2023 by Thorek 1 1 Link to comment Share on other sites More sharing options...
BadRomani 14 Posted March 4, 2023 Share Posted March 4, 2023 GetApplyType was not declared Link to comment Share on other sites More sharing options...
Active Member Thorek 280 Posted March 4, 2023 Author Active Member Share Posted March 4, 2023 37 minutes ago, BadRomani said: GetApplyType was not declared Ah yes, change to FN_get_apply_type. Link to comment Share on other sites More sharing options...
BadRomani 14 Posted March 4, 2023 Share Posted March 4, 2023 (edited) 13 minutes ago, Thorek said: Ah yes, change to FN_get_apply_type. Edited March 4, 2023 by Metin2 Dev International Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member Thorek 280 Posted March 4, 2023 Author Active Member Share Posted March 4, 2023 (edited) 8 minutes ago, BadRomani said: Wops, sorry - contains function comes from C++20. Change return in CBlendItem::Find to return items.find(item) != items.end(); Edited March 4, 2023 by Metin2 Dev International Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
BadRomani 14 Posted March 4, 2023 Share Posted March 4, 2023 2 minutes ago, Thorek said: Wops, sorry - contains function comes from C++20. Change return in CBlendItem::Find to return items.find(item) != items.end(); Thank you bro. Thanks to your help, the build was created successfully. "value": [ 1, 3, 5, 7, 10 ], "duration": [ 1800, 1800, 1800,180 1800 ] when used in this way, the server will not boot. "value": [ 1, 3 ], "duration": [ 1800, 1800 ] This is how the server opens. How can I add more? As in blend.txt. Link to comment Share on other sites More sharing options...
Active Member Thorek 280 Posted March 4, 2023 Author Active Member Share Posted March 4, 2023 (edited) 40 minutes ago, BadRomani said: Thank you bro. Thanks to your help, the build was created successfully. "value": [ 1, 3, 5, 7, 10 ], "duration": [ 1800, 1800, 1800,180 1800 ] when used in this way, the server will not boot. "value": [ 1, 3 ], "duration": [ 1800, 1800 ] This is how the server opens. How can I add more? As in blend.txt. After every item in JSON array, you must put a comma (except for the last one). For example, if you have: [ 1800, 1800, 1800,180 1800 ] Server not booting because after 180 comma wasn't found. Edited March 4, 2023 by Thorek Link to comment Share on other sites More sharing options...
BadRomani 14 Posted March 4, 2023 Share Posted March 4, 2023 15 minutes ago, Thorek said: After every item in JSON array, you must put a comma (except for the last one). For example, if you have: [ 1800, 1800, 1800,180 1800 ] Server not booting because after 180 comma wasn't found. I made a mistake while editing Ok, now the server is opening. Link to comment Share on other sites More sharing options...
Assembly 0 Posted May 1 Share Posted May 1 @ThorekWhat if we want to give more than one enchantment? Link to comment Share on other sites More sharing options...
josehdelaro 5 Posted May 2 Share Posted May 2 (edited) ty some problems but work Edited May 2 by josehdelaro Link to comment Share on other sites More sharing options...
Active Member Thorek 280 Posted May 7 Author Active Member Share Posted May 7 On 5/2/2024 at 12:15 AM, Assembly said: @ThorekWhat if we want to give more than one enchantment? Well, if you want do this like YMIR, you can extend sockets count. On 5/2/2024 at 5:46 AM, josehdelaro said: ty some problems but work What problems? I'll take a look. Link to comment Share on other sites More sharing options...
josehdelaro 5 Posted May 7 Share Posted May 7 2 hours ago, Thorek said: Well, if you want do this like YMIR, you can extend sockets count. What problems? I'll take a look. is my fail bro dont worry Link to comment Share on other sites More sharing options...
Recommended Posts