Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/13/21 in all areas

  1. PLEASE NOTE: THIS GUIDE WAS MADE BY @TokiSan AND @arves100 The DungeonBlock is a type assigned to specific objects that are used in dungeons on metin2, are characterized by a lightmap that is associated with the basic texture, giving particular effects, have their own extension in the property and are not interchangeable with the gr2 present in the Building. 1. Foreword I start by saying that the following procedure seems to be very expensive: I will introduce about the DungeonBlock, explaining how it is used in the objects of metin2 and what's the peculiarity. Let's start by saying that the object/mount /pet/monster/weapon/player used on Metin2 have all a .gr2 extension and most of the time, we can simply have a preview of the object through the granny viewer: In the case of the DungeonBlock instead it is not possible to have a preview of the textures, this is because the textures are linked together in a way that the tool cannot process, which is why they are seen white: 2. What changes compared to normal gr2? Let's go and see carefully. If we make a comparison with the textures, we notice that they are present (the path is right!), Except that there is a texture in particular, in common for each object that falls within the DungeonBlock, this texture will not be visible and is the cause of the white texture: The "light_passC_pole.dds", which we see highlighted, corresponds to the light map that allows the object to exploit a combination of lights/shadows present in a separate texture and superimpose them on the base texture, thus creating a particular effect that the normal objects cannot get: The squares highlighted in blue show the light that is obtained from the specific texture Here we have a clear example, it is an object present in the new snake dungeon: In fact, the object cannot be seen with its textures in the granny viewer, but it is possible instead in the world editor. Returning to our DungeonBlock type present in the world editor we can see that they have a different extension: The ".prb" (property building) are the typical extension of the "Building" the normal gr2 that we normally put in the maps (rocks, houses, bridges), the ".prd" (property dungeons) are typical instead of the "DungeonBlock" . Trivially we might think that the gr2 present in the Buildings are the same as those present in the DungeonBlock, but this statement is incorrect, the proof is that creating a .prd with a .gr2 typically classified as a Building, will not show the object. 3. File management inside maps The rendering of our maps on Metin2, as you all know, the map will load different objects based on configurations managed in classic txt. Each of our objects is contained in a particular folder (property) including our dungeon blocks, which differ relatively little from the classic building as regards the format (we have the type change and the gr2 model which has a different name than building ). Dungeonblocks are an extension of Ymir's approach to classic gr2 models. Render of the buildings Normally, during the rendering of a building, the game is limited to rendering the 3d model supporting only one texture in our materials, that is the diffuse map. The rendering of the shadow is managed by drawing the shape of our 3d model on the widespread map of our terrain, that is, based on our vertices, a fusion with a black color is applied in the texture of our terrain (here the ambient light that basic metin2 has). Render of the dungeon block The dungeonblocks, on the other hand, are rendered with the use of a second texture (the "light map"), this texture will be fused (a blend) with the base texture, and will allow us to create lighting effects. The shadow rendering is very particular, because Metin2 invisibly renders a second model (of which only the vertices will be invisible), in this way not only will the rendering of the base shadow be ignored, but the customized settings will also be applied. of the light. Since the color of the light at maximum intensity is white, the alpha of our textures will be ignored and replaced with a highlight color, for this reason (even in the worldeditor) these objects ignore the ambient light. (but theoretically not a problem as we shouldn't see outside the dungeon) 4. Considerations Probably this lightmap was created to be able to exploit multiple points of light without having to touch or change the base ambient light, which could have general problems if it had not been ignored. Of all that I have talked about it is possible to find the operation on EterGrnLib / ThingInstance.cpp for basic objects (including the building), while the dungeonblocks are found in GameLib / DungeonBlock.cpp (which makes special calls to the DirectX8 render) , the render of the map (and of the base shadow) can be found in GameLib / MapOutdoor.cpp 5. 3ds Max To start we need: -3ds max (I use 2018) -A model to export as a dungeonblock -A computer that doesn't explode (preferably) Let's create a new project and import our object. Let's insert the textures and once this is done, head to the quick controls panel on the right, go to the create section (indicated with the "+" sign) and go to the "Photometric" subsection, choosing the type of lighting you want to insert. In my case I will use the "Free Light": Once the light points have been inserted, we go to the bar at the top, click Rendering, then Render to Texture. Once here, a table will appear in which many things are entered. First of all we have to select the object in question, in the input section it will be highlighted. Let's focus on the window called output and click "Add", here we indicate the LightMap as an output map and indicate the path in which we want to save the texture, once this is done, click the render button: PLEASE NOTE: the more complicated the object, the longer the rendering time will be to render the object. For more complex objects it is necessary to have better performing computers (unless you want to make your PCs go to a bad end) In this way we will have created the texture of the LightMap. But that's not all, because metin2 is "special" and has its own way of reading it. We must in fact go to modify the material of our object, and use the blending option to link the normal texture with the lightmap. this operation must be done for each single texture, the result must be this: PLEASE NOTE: while for materials and textures you can leave the default name (Material # 1, Map # 1) for blending operations you must write Blend_x, otherwise the game will not recognize it. Once this part is done, it's time to export our object. We have said in previous times that a dungeonblock cannot be a building, this is because, when the object is to be exported as a dungeonblock it changes a parameter in the mesh. "Coords per vertex" by default is set to one, to make our mesh a dungeonblock it is necessary to set it to at least two: 6. Word Editor Finally, having exported our object, when we go to the word editor just specify that it is a dungeonblock: I leave you with a couple of screenshots of an object that accompanied me during the writing of this guide:
    5 points
  2. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
    2 points
  3. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) [Hidden Content]
    2 points
  4. M2 Download Center Download Here ( Internal ) Ingame video: Download: Password:
    2 points
  5. M2 Download Center Download Here ( Internal ) As the title says, here's how you can synchronize your skill_table from client with skill_proto from server. [1]. First of all we've to rewrite the enum part of tokens (which is used in CPythonSkill::RegisterSkillTable), that means we change the order of index-tab-line with a new order, because ymir didn't used all columns. In that way we keep the file much cleaner and just with necessary columns (9 columns instead of 27). Srcs/Client/UserInterface/PythonSkill.h Search for the next enum: Replace it with: Srcs/Client/UserInterface/Locale_Inc.h [2]. Compile the source client again. [3]. Open Navicat (preferably the latest versions) and do the following things: Open player table Export Wizard -> Mark skill_proto -> Export to ../location/skilltable.txt Export format -> *.txt Unmark All fields then Unselect All Select available fields: -> {'dwVnum', 'bMaxLevel', 'bLevelLimit', 'szPointPoly', 'szSPCostPoly', 'szDurationPoly', 'szDurationSPCostPoly', 'szCooldownPoly', 'dwTargetRange'} Unmark: Include column titles Text Qualifier: None Copy the skilltable.txt from Desktop to ../locale/en/ HOW-TO - VIDEO (The video is just an example, please follow the tutorial from step [3]) [Hidden Content] Thanks to @Syreldar for the idea.
    1 point
  6. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) I would not recommend using this as it's missing many features, head over to Mali's release for an updated version. [Hidden Content]
    1 point
  7. Here're the references to understand how it's working step-by-step: char.cpp [Hidden Content] constants.cpp #define MAX_EXP_DELTA_OF_LEV 31 #define PERCENT_LVDELTA(me, victim) aiPercentByDeltaLev[MINMAX(0, (victim + 15) - me, MAX_EXP_DELTA_OF_LEV - 1)] #define PERCENT_LVDELTA_BOSS(me, victim) aiPercentByDeltaLevForBoss[MINMAX(0, (victim + 15) - me, MAX_EXP_DELTA_OF_LEV - 1)] constants.cpp const int aiPercentByDeltaLevForBoss_euckr[MAX_EXP_DELTA_OF_LEV] = { 1, // -15 0 [...] 180 // 15 30 }; const int aiPercentByDeltaLev_euckr[MAX_EXP_DELTA_OF_LEV] = { 1, // -15 0 [...] 180 // 15 30 }; locale_service.cpp if (!aiPercentByDeltaLevForBoss) aiPercentByDeltaLevForBoss = aiPercentByDeltaLevForBoss_euckr; if (!aiPercentByDeltaLev) aiPercentByDeltaLev = aiPercentByDeltaLev_euckr;
    1 point
  8. Just if you use SQLMsg* pkMsg then it's called a raw pointer and you've to delete it manually, but for std::unique_ptr<SQLMsg>, you don't have to do it, has no effects the reset method in this case. [Hidden Content] [Hidden Content] [Hidden Content] The benefit of using smart pointers like unique_prt || shared_ptr is that they automatically delete the pointed object when no longer needed (i.e. out of scope). [Hidden Content]
    1 point
  9. Thanks for the remark, but I never used this command in game as a player, this should be active just for debug as GM's, no sense for players. About the fix, could be done directly from here too: File: cmd_general.cpp costume Search for: snprintf(buf, bufferSize, FN_point_string(attr.bType), attr.sValue); Replace it with: [Hidden Content] hair Search for: offset = snprintf(buf, bufsiz, FN_point_string(aff->bApplyOn), aff->lApplyValue); Replace it with: const char * cPointString = FN_point_string(aff->bApplyOn); if (!*cPointString) return false; offset = snprintf(buf, bufsiz, cPointString, aff->lApplyValue); There's no sense for showing to a player 'UNK... 23%' since he don't know what it's.. I think it's better just to ignore the type if doesn't exist and don't show it in the chat. If you really want to do something like this, you can add a sys_log as an error to see the bonus missing and add it into the function.
    1 point
  10. Hi guys Fix is --> _vsnprintf lnk2019 visual studio open project -> userinterface (right click) -> properties -> linker -> input -> Additional Dependencies (click and kernel32.lib in left add "legacy_stdio_definitions.lib") save file and build problems is fixed Türkçesi Visual studio ile metin2 projenizi açınız -> userinterface (sağ tıklayın) -> özellikler -> Bağlayıcı -> giriş -> Ek bağımlılıklar ( kernel32.lib'in sol tarafına legacy_stdio_definitions.lib kodunu ekleyin.") kaydedin ve build edin sorun çözülecek. My Additional Dependencies Code (Ek bağımlılıklar Kodum) legacy_stdio_definitions.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
    1 point
  11. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Original system forked from Mali61 Link Adapted by ASIKOO
    0 points
  12. 0 points
  13. I think have easiest way if (true && !false && true != false && false != true) { if(item->GetCount() > 0) item->SetCount(item->GetCount()-0); else item->SetCount(item->GetCount()-(1-1)); } else if (true == false) { if(item->GetCount() > 0) item->SetCount(item->GetCount()-0); else item->SetCount(item->GetCount()-(1-1)); } else { item->SetCount(item->GetCount()-1); }
    0 points
  14. M2 Download Center Download Here ( Internal ) Download: [Hidden Content]
    0 points
×
×
  • 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.