Rabb1tof / NCRPG

https://hlmod.ru/resources/ncrpg-jadro-i-moduli.1745/
GNU General Public License v3.0
4 stars 4 forks source link

У меня проблема с включаемыми файлами #4

Closed NotJustin closed 4 years ago

NotJustin commented 4 years ago

Я написал этот плагин: https://github.com/NotJustin/SkillAutoBalance

BaFeR добавил поддержку NCRPG в мой плагин. Моя проблема в том, что я не могу скомпилировать, если я не использую "nc_rpg.inc". Это плохо, потому что мне также нужно добавить все другие включения для NCRPG в мой github, иначе другие люди не смогут скомпилировать.

Это звучит как проблема для меня - я хочу использовать только один нативный, почему я должен использовать еще 13 включенных файлов?

Я не могу поддержать такую ​​поддержку NCRPG. Я попробовал другой способ здесь: https://github.com/NotJustin/SkillAutoBalance/issues/3#issuecomment-639967981 (извините, это на английском, потому что я не знаю русский)

Спасибо за помощь. Я надеюсь, вы понимаете. Я использовал переводчик для этого.

Rabb1tof commented 4 years ago

You can post issue on english. Due to the crooked translation, it isn't clear what you want.

NotJustin commented 4 years ago

I want to add support for your plugin in my auto balance pugin. I want to use the NCRPG_GetLevel native. I cannot use it unless I compile the plugin with all include files listed below. My request is for you to do one of these.

  1. Move these from nc_rpg.inc to NCRPG.sp. Then, I only need to use nc_rpg.inc to compile, as this is where you mark all the natives as optional.
#include < sdktools >
#include < sdkhooks >
#include < cstrike >
#include " NCIncs / ncrpg_Constants "
#include " NCIncs / ncrpg_GameCheck "
#include " NCIncs / ncrpg_Effects "
#include " NCIncs / ncrpg_XP_Credits "
#include " NCIncs / ncrpg_Messages "
// # include "NCIncs / ncrpg_Messages_css"
// # include "NCIncs / ncrpg_Menu"
#include " NCIncs / ncrpg_Buffs "
#include " NCIncs / ncrpg_Skills "
#include " NCIncs / ncrpg_Damage "
#include " NCIncs / ncrpg_Configs "
#include " NCIncs / ncrpg_PrecacheDownload "
  1. Move these MarkNativeAsOptional into the files these natives are created in. Currently, if I try to use only NCIncs/ncrpg_XP_Credits, the natives are not marked as optional and when I try to run my plugin it fails to start because it could not find the native I want to use NCRPG_GetLevel.
public  __pl_nc_rpg_SetNTVOptional ()
{
    MarkNativeAsOptional ( "NCRPG_RegSkill" );
    MarkNativeAsOptional ( "NCRPG_DisableSkill" );
    MarkNativeAsOptional ( "NCRPG_IsSkillDisabled" );
    MarkNativeAsOptional ( "NCRPG_IsValidSkill" );
    MarkNativeAsOptional ( "NCRPG_IsValidSkillID" );
    MarkNativeAsOptional ( "NCRPG_GetSkillMaxLevel" );
    MarkNativeAsOptional ( "NCRPG_GetSkillName" );
    MarkNativeAsOptional ( "NCRPG_GetSkillDesc" );
    MarkNativeAsOptional ( "NCRPG_GetClientSkillCost" );
    MarkNativeAsOptional ( "NCRPG_GetSkillCost" );
    MarkNativeAsOptional ( "NCRPG_GetSkillCostSales" );
    MarkNativeAsOptional ( "NCRPG_GetSkillCount" );
    MarkNativeAsOptional ( "NCRPG_GetEmptySkills" );
    MarkNativeAsOptional ( "NCRPG_FindSkillByShortname" );
    MarkNativeAsOptional ( "NCRPG_SetSkillLevel" );
    MarkNativeAsOptional ( "NCRPG_GetSkillLevel" );
    MarkNativeAsOptional ( "NCRPG_SetMaxHP" );
    MarkNativeAsOptional ( "NCRPG_GetMaxHP" );
    MarkNativeAsOptional ( "NCRPG_SetMaxArmor" );
    MarkNativeAsOptional ( "NCRPG_GetMaxArmor" );
    MarkNativeAsOptional ( "NCRPG_DealDamage" );
    MarkNativeAsOptional ( "NCRPG_FreezePlayer" );
    MarkNativeAsOptional ( "NCRPG_SetIsPlayerFrozen" );
    MarkNativeAsOptional ( "NCRPG_IsPlayerFrozen" );
    MarkNativeAsOptional ( "NCRPG_SlowPlayer" );
    MarkNativeAsOptional ( "NCRPG_SpeedPlayer" );
    MarkNativeAsOptional ( "NCRPG_SetSlow" );
    MarkNativeAsOptional ( "NCRPG_GetSlow" );   
    MarkNativeAsOptional ( "NCRPG_SetPlayerSpeed" );
    MarkNativeAsOptional ( "NCRPG_GetPlayerSpeed" );
    MarkNativeAsOptional ( "NCRPG_SetColor" );
    MarkNativeAsOptional ( "NCRPG_GetColor" );  
    MarkNativeAsOptional ( "NCRPG_SetSpeed" );
    MarkNativeAsOptional ( "NCRPG_GetSpeed" );      
    MarkNativeAsOptional ( "NCRPG_SetMaxSpeed" );
    MarkNativeAsOptional ( "NCRPG_GetMaxSpeed" );   
    MarkNativeAsOptional ( "NCRPG_SetGravity" );
    MarkNativeAsOptional ( "NCRPG_GetGravity" );
    MarkNativeAsOptional ( "NCRPG_SetReqXP" );
    MarkNativeAsOptional ( "NCRPG_GetReqXP" );
    MarkNativeAsOptional ( "NCRPG_GetXP" );
    MarkNativeAsOptional ( "NCRPG_SetXP" );
    MarkNativeAsOptional ( "NCRPG_GetLevel" );
    MarkNativeAsOptional ( "NCRPG_SetLevel" );
    MarkNativeAsOptional ( "NCRPG_SetCredits" );
    MarkNativeAsOptional ( "NCRPG_GetCredits" );
    MarkNativeAsOptional ( "NCRPG_GiveExp" );
    MarkNativeAsOptional ( "NCRPG_SetExp" );
    MarkNativeAsOptional ( "NCRPG_TakeExp" );
    MarkNativeAsOptional ( "NCRPG_ResetPlayer" );
    MarkNativeAsOptional ( "NCRPG_ResetAllPlayers" );
    MarkNativeAsOptional ( "NCRPG_OpenMenuMain" );
    MarkNativeAsOptional ( "NCRPG_OpenMenuHelp" );
    MarkNativeAsOptional ( "NCRPG_OpenMenuStats" );
    MarkNativeAsOptional ( "NCRPG_OpenMenuPlayersInfo" );
    MarkNativeAsOptional ( "NCRPG_LogMessage" );
    MarkNativeAsOptional ( "NCRPG_GetDbHandle" );
    MarkNativeAsOptional ( "NCRPG_GetGravity" );
    MarkNativeAsOptional ( "NCRPG_SetAlpha" );
    MarkNativeAsOptional ( "NCRPG_GetAlpha" );  
    MarkNativeAsOptional ( "NCRPG_SetMaxAlpha" );
    MarkNativeAsOptional ( "NCRPG_GetMaxAlpha" );   
    MarkNativeAsOptional ( "NCRPG_SkillActivate" );
    MarkNativeAsOptional ( "NCRPG_SkillActivated" );    
    MarkNativeAsOptional ( "NCRPG_GetSkillShortName" ); 
    MarkNativeAsOptional ( "NCRPG_GetParamStringBySteamID" );
    MarkNativeAsOptional ( "NCRPG_GetParamIntBySteamID" );  
    MarkNativeAsOptional ( "NCRPG_SetParamIntBySteamID" );  
    MarkNativeAsOptional ( "NCRPG_GiveCredits" );   
    MarkNativeAsOptional ( "NCRPG_ChatMessage" );   
    MarkNativeAsOptional ( "NCRPG_GiveExpBySteamID" );  
    MarkNativeAsOptional ( "NCRPG_SetExpBySteamID" );   
    MarkNativeAsOptional ( "NCRPG_TakeExpBySteamID" );  
}

I am sorry if this is a bigger request than I think.

Rabb1tof commented 4 years ago

What's problem use nc_rpg.inc for your plugin?

NotJustin commented 4 years ago

It forces me to use all of these also.


#include " NCIncs / ncrpg_Constants "
#include " NCIncs / ncrpg_GameCheck "
#include " NCIncs / ncrpg_Effects "
#include " NCIncs / ncrpg_XP_Credits "
#include " NCIncs / ncrpg_Messages "
#include " NCIncs / ncrpg_Buffs "
#include " NCIncs / ncrpg_Skills "
#include " NCIncs / ncrpg_Damage "
#include " NCIncs / ncrpg_Configs "
#include " NCIncs / ncrpg_PrecacheDownload "```
Rabb1tof commented 4 years ago

No, I am writed plug-in for testing utilities and it only uses #include <NCIncs/nc_rpg.inc> - it works well:


#include <NCIncs/nc_rpg>

public void OnPluginStart()
{
    RegConsoleCmd("sm_resetall", Cmd_Reset);
}

public Action Cmd_Reset(int client, int args)
{
    NCRPG_ResetAllPlayers();
    return Plugin_Handled;
}
NotJustin commented 4 years ago

Example: https://youtu.be/nMKuDOHkD-o

I hope the video is more clear.

Try to compile plug-in for testing utilities. Remove all other includes, keep #include <NCIncs/nc_rpg.inc>.

Rabb1tof commented 4 years ago

Dude, you didn't understand me. You do not need to delete the remaining files, you just write #include NCIncs/nc_rpg.inc in the source code of the module.

WhyFaust commented 4 years ago

@NotJustin I thinkб the NCIncs folder should be in the scripting folder, not in the includes folder. image

Rabb1tof commented 4 years ago

@NotJustin I thinkб the NCIncs folder should be in the scripting folder, not in the includes folder. image

I don't think so, 'cause i'm using folder NCIncs in folder inlude and all works.

WhyFaust commented 4 years ago

@NotJustin I thinkб the NCIncs folder should be in the scripting folder, not in the includes folder. image

I don't think so, 'cause i'm using folder NCIncs in folder inlude and all works.

Значит это не имеет никакой роли, понял, принял.

Я так понял он хочет, чтобы компиляция происходила без 1000 лишних файлов, он не хочет заливать все файлы на свой гитхаб, когда ему нужно всего лишь 1-2. Поэтому он просит реализовать так, чтобы подключать можно было только те, которые нужны, а не все сразу.

Rabb1tof commented 4 years ago

@NotJustin I thinkб the NCIncs folder should be in the scripting folder, not in the includes folder. image

I don't think so, 'cause i'm using folder NCIncs in folder inlude and all works.

Значит это не имеет никакой роли, понял, принял.

Я так понял он хочет, чтобы компиляция происходила без 1000 лишних файлов, он не хочет заливать все файлы на свой гитхаб, когда ему нужно всего лишь 1-2. Поэтому он просит реализовать так, чтобы подключать можно было только те, которые нужны, а не все сразу.

Значит пусть использует те файлы, которые ему нужны и их прописывает (так работает). В качестве примера @inklesspen1scripter закинул файл, использующий только 1 требуемую библиотеку.

NotJustin commented 4 years ago

Okay. Rather than force you to write the includes in each .sp file individually, I will remove the includes I am not using from nc_rpg.inc.

I can compile if I keep these two: #include "NCIncs/ncrpg_Constants" #include "NCIncs/ncrpg_XP_Credits"

as well as using #include <NCIncs/nc_rpg.inc> in my plugin.

I have to use 3 includes instead of 13. I hope it still works with the edited file. Sorry to bother. It looks like it is a bigger request than I thought.

NotJustin commented 4 years ago

I asked on on AlliedModders discord.

They told me, what you do is normal and I should be using all includes.

So I was just wrong. I will use all of them and only have #include <NCIncs/nc_rpg.inc> in my plugin.