This repository was archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
2. Installing: Definitions
Iván Bravo Bravo edited this page Aug 23, 2017
·
2 revisions
The system was created to work with the modifications of InSource (A modification of the engine) so inside the code you could see several conditions of this type:
#ifdef INSOURCE_DLL
If you are making a mod that modifies much of the Source Engine base code, you may already have different classes for the players, the weapons, the rules of the game, etc.
If this is the case it may be convenient for you to modify the classes/definitions used by the Bots system with those of your mod, if this is not the case you can skip this.
In the first lines of the file bot_defs.h you can find the following:
// Derived classes
typedef CBasePlayer CPlayer;
typedef CBaseCombatWeapon CBaseWeapon;
// Similar functions
#define ToInPlayer ToBasePlayer
#define ToBaseWeapon dynamic_cast<CBaseWeapon *>
#define TheGameRules GameRules()
#define GetGameDifficulty() TheGameRules->GetSkillLevel()
#define GetActiveBaseWeapon GetActiveWeapon
// Applied to a [CBaseCombatWeapon] to detect the type of weapon.
#ifdef HL2MP
#define IsSniper() ClassMatches( "crossbow" )
#else
#define IsSniper() ClassMatches( "sniper" )
#endif
#define IsShotgun() ClassMatches( "shotgun" )
#define GetWeaponInfo GetWpnData
// Skill Levels
#define SKILL_VERY_HARD SKILL_HARD
#define SKILL_ULTRA_HARD SKILL_HARD
#define SKILL_IMPOSIBLE SKILL_HARD
#define SKILL_EASIEST SKILL_EASY
#define SKILL_HARDEST SKILL_HARD
This specific code block contains what is required to transform InSource code to Source Engine base code. Feel free to modify these macros to fit your mod.