FAQ  •  Login

classes need to how to make them

<<

d3athwolf

Private 2
Private 2

Posts: 12

Joined: Wed Dec 31, 2008 10:16 pm

Post Wed Sep 30, 2009 10:56 pm

classes need to how to make them

classes any1 know how to add or make them to a mod like looked on few site's i couldnt find any but then agien i'm totaly **** house at finding them wondering if any1 knows how to make and add some like i wont to make 4 classes a shaman,swordsman,archer and brawler
if some1 could show me how be good :P thxs
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Thu Oct 01, 2009 2:21 am

Re: classes need to how to make them

its actually more simple than you think it is...

if you take on of the current npc files from the code, rename it to what you want and change what you need to then link the file in and your mostly away
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

d3athwolf

Private 2
Private 2

Posts: 12

Joined: Wed Dec 31, 2008 10:16 pm

Post Thu Oct 01, 2009 8:32 am

Re: classes need to how to make them

ok scratch that i found a half tut but i understand wot to do now if any1 eles wonts to see it here u go:



Starting off

Fire up the SDK, and run the "Create a Mod" wizard. Select "Start a Multiplayer mod from a template." Don't worry about the "advanced users" warning, since Valve has made this extremely easy.

Make sure you check "Enable classes" and most likely "Enable teams."


Scripts

Now, most of the configuration for the class itself is done with simple text files. The files that control this are located in $moddir\scripts, under the names playerclass_blue_class1.txt and such.

While most of it is relatively self-explanatory, certain things might be obscure, or not listed.


Variables (on the C++ side)

  Code:
int m_iTeam;          // 0 is unassigned, 1 is spectator, 2 is team 1 (BLUE), 3 is team 2 (RED), etc.
int m_iPrimaryWeapon;      // Index of the weapon, as defined in sdk_shareddefs.h (default is NONE, MP5, SHOTGUN, GRENADE, PISTOL, and CROWBAR
int m_iSecondaryWeapon;   // Same as primary, but for secondary, and allowed to be WEAPON_NONE
int m_iMeleeWeapon;      // Same as secondary, but for melee
int m_iNumGrensType1;      // Number of Type 1 Grenades
int m_iGrenType1;      // Same as secondary, but for Type 1 Grenades
int m_iNumGrensType2;      // Number of Type 2 Grenades
int m_iGrenType2;      // Same as secondary, but for Type 2 Grenades
char m_szLimitCvar[64];   // Name of the cvar that controls the class limit for this class
float m_flRunSpeed;      // Run (normal) speed, in units/second. SDK Default is 220, HL2 uses 190
float m_flSprintSpeed;      // Sprint speed, in units/second. Is usually 150% run speed. SDK default is 330, HL2 uses 327.5
float m_flProneSpeed;      // Prone speed, in units/second. SDK defaults to 50
int m_iArmor;         // Amount of extra armor. It will absorb 80% of the damage (to change that, go to player.cpp)

char m_szClassImage[SDK_PLAYERCLASS_IMAGE_LENGTH];   // According to comments, this is "HUD player status health images (when the player is hurt)"
char m_szClassImageBG[SDK_PLAYERCLASS_IMAGE_LENGTH];   // However, I can't seem to trace the code for it.


Variables (on the .txt side)

  Code:
// Mandatory / Strongly Recommended keyvalues
"printname"      "#class_red_class1"         // the name of the class, usually as a localization string. Not used in sdk_playerclass_info_parse.cpp, but it's used in other places in .res files
"playermodel"      "models/player/red_player.mdl"      // the model of the class
"selectcmd"      "cls_red_class1"         // from what I can tell, the name of the console command used to switch to this class
"team"         "RED"               // The team it goes with. Default code only accepts "BLUE" or "RED"
"primaryweapon"   "pistol"            // The name of the primary weapon. Cannot be "none"
"limitcvar"      "mp_limit_red_class1"         // The console variable that controls the maximum amount of this class allowed
"classimage"      "cls_red_class1_active"         // An image name, apparently for the HUD
"classimagebg"      "cls_red_class1_active_bg"      // Same

// Optional keyvalues
"secondaryweapon"   "none"               // Defaults to none
"meleeweapon"      "crowbar"            // Defaults to none
"grenadetype"      "grenade"            // Defaults to none
"numgrens"      "1"               // Defaults to 0
"grenadetype2"      "grenade"            // Defaults to none
"numgrens2"      "1"               // Defaults to 0
"armor"      "50"               // Defaults to 0
"RunSpeed"      "240"               // Defaults to SDK_DEFAULT_PLAYER_RUNSPEED, which defaults to 220
"SprintSpeed"      "360"               // Defaults to SDK_DEFAULT_PLAYER_SPRINTSPEED, which defaults to 330
"ProneSpeed"      "70"               // Defaults to SDK_DEFAULT_PLAYER_PRONESPEED, which defaults to 50

How it glues together
  Code:
void unused         = "printname"
int m_iTeam;          = "team"
int m_iPrimaryWeapon;      = "primaryweapon"
int m_iSecondaryWeapon;   = "secondaryweapon"
int m_iMeleeWeapon;      = "meleeweapon"
int m_iNumGrensType1;      = "numgrens"
int m_iGrenType1;      = "grenadetype"
int m_iNumGrensType2;      = "numgrens2"
int m_iGrenType2;      = "grenadetype2"
char m_szLimitCvar[64];   = "limitcvar"
float m_flRunSpeed;      = "RunSpeed"
float m_flSprintSpeed;      = "SprintSpeed"
float m_flProneSpeed;      = "ProneSpeed"
int m_iArmor;         = "armor"

char m_szClassImage[SDK_PLAYERCLASS_IMAGE_LENGTH];   = "classimage"
char m_szClassImageBG[SDK_PLAYERCLASS_IMAGE_LENGTH];   = "classimagebg"
Last edited by d3athwolf on Thu Oct 01, 2009 12:10 pm, edited 1 time in total.
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Thu Oct 01, 2009 12:09 pm

Re: classes need to how to make them

you'll need classes to make classes.

that is, you'll need to add some c++ classes to handle character classes in your mod. If you're unsure what c++ classes are, then learning c++ should come first.
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Thu Oct 01, 2009 4:02 pm

Re: classes need to how to make them

i would suggest learning cpp anyway
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

d3athwolf

Private 2
Private 2

Posts: 12

Joined: Wed Dec 31, 2008 10:16 pm

Post Thu Oct 01, 2009 11:13 pm

Re: classes need to how to make them

you'll need classes to make classes.

that is, you'll need to add some c++ classes to handle character classes in your mod. If you're unsure what c++ classes are, then learning c++ should come first.


thxs for your help == ask for some help and this is wot i get this is really nice help here really like hoest i couldn't get anything beter ==

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.