
Hello...
I asume you know basic of C++, we going to write a code for a new episode in Kingpin.
To start you need to have kpsdk, which you can download from kingpinforever.com,
and C++ compiler.

When you opened C++ Compiler(I use MS Visual C++), look at .h files.
C++ has two kinds of files .c and .h
Now find ep_all.h, open it and go to line 17, now write this:

#define EP_DAYTON       7

You just defined number of you episode, which you use when you build maps in KPRadiant.
Now go to line 356, and write this:

#define NAME_MAL               100
#define NAME_DREW              101

What you just did, is defined names(NAME_MAL and NAME_DREW),
100 and 101 is numbers, which C++ Compiler will substitute for names.
Now go to line 530 in ep_all.h, and write this:

qboolean EP_Dayton_EventSpeech          (edict_t *self, edict_t *other);
void EP_DT_Rgister_EPFLAG (edict_t *self, int ep_flag);

Now find ep_all.c, open it and go to line 131, now write this:

"Mal",
"Drew",

Remember names, which you defined in ep_all.h, you just defined them
the way they will look in game not NAME_MAL, but Mal.
Now go to line 353 in ep_all.c file, and write this

case EP_DAYTON
    return EP_Dayton_EventSpeech (self, other);
    break;

Now, we need to create file .c with name of episode you want to create.
In my case it's "Dayton", so you can create file Dayton.c
Now Iam going to use "//" to write comments in the code, "//" this simply
means that C++ Compiler will ignore line with "//".
The other way to use comments is "/*" is by putting text between this simbols "*/".
Now, write or copy this in your dayton.c
file:

/**********************************************************************************

 DAYTON - Episode specific code

***********************************************************************************/

#include "g_local.h"         // Adding library to your code

#include "voice_punk.h"     // Adding library to your code
#include "voice_bitch.h"    // Adding library to your code

// Starting our function

qboolean EP_Dayton_EventSpeech (edict_t *self, edict_t *other)
{
    cast_memory *mem;

    mem = level.global_cast_memory[ self->character_index][ other->character_index ];

	if (self->name_index == NAME_MAL && other->client)    // Call NAME_MAL character
	{
		if (other->episode_flags & EP_DT_MAL_TOOK_WATCH)
		{
			if (mem->inc == 0)
			{
				Voice_Random( self, other, &lenny_table[14], 2);    // Voice from voice_punk.h
				mem->inc++;
			}
			else
			{
				Voice_Specific( self, other, lenny_table, 13 );    // Voice from voice_punk.h
				mem->inc = 0;
			}

			return true;
		}
		if (other->client->pers.inventory[ITEM_INDEX(FindItem("Watch"))])    // Check plauer inventory for item Watch
		{
			int     index;
                        gitem_t *item;
     
                        // Mal takes the watch
	                item = FindItem ("Watch");
	                index = ITEM_INDEX (item);
	                other->client->pers.inventory[ index ] = 0;

                        EP_DT_Register_EPFLAG (other, EP_DT_MAL_TOOK_WATCH);
	    
	                // Mal gives player the key
			Voice_Specific( self, other, lenny_table, 2 );  // here's the key
	                item = FindItem ("StoreRoomKey");
	                index = ITEM_INDEX (item);
	                other->client->pers.inventory[ index ]++;
	                // show icon and name on status bar
	                other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(item->icon);
	                other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS+index;
	                other->client->pickup_msg_time = level.time + 5.5;

			mem->inc = 0;
		}
		else
		{
			if (!mem->inc)
			{
				Voice_Specific( self, other, lenny_table, 3 );    // Voice from voice_punk.h
				mem->inc = 2;
			}
			else if (mem->inc == 2)
			{
				Voice_Random( self, other, &lenny_table[4],5 );    // Voice from voice_punk.h
				mem->inc = 3;
			}
			else
			{
				Voice_Random( self, other, &lenny_table[22], 3 );    // Voice from voice_punk.h
				mem->inc = 2;
			}
		}
		
		return true;
	}

	return false;
}

void EP_DT_Register_EPFLAG (edict_t *self, int ep_flag)
{
	if (self->client->pers.episode_flags & ep_flag)
		return;

	self->episode_flags = self->client->pers.episode_flags |= ep_flag;
		
	EP_Flash_Newflag (self, ep_flag);
}


Every where you see "Dayton" or "DT", substitute your episode name, you don't have to know everything about C++,
you just need to knoe C++ for Quake2 Engine.
In this episode you need to kill ai named "Drew", get watch and bring them to "Mal", I used the same thing as "Lenny" and "Lamont" in Skidrow.

Now go to KPRadiant build a map, press 'n' and find "worldspawn" and write in "Key" "episode", and in "Value" "7".
Remember we put EP_DAYTON       7 in ep_all.h?
Also create two thugs or punks and give them name Mal and Drew, in "Key" put "name" in "Value" put "Mal" and "Drew".

I hope you understand it, if I made some mistake mail me or if you have any questions.
kingpin_xatrix@yahoo.com
