Jump to content

Home

Replace Galak_Mech with Custom NPC


r2003p

Recommended Posts

:confused:

 

Hi!

 

I am trying to replace galak_mech with a custom model, but everytime I spawn him, he usually has a lightsaber in his crotch while firing an imperial repeater. How can I make it so that the lightsaber is in his hand and he uses it?

Link to comment
Share on other sites

:p

 

Here is one response from another post that discovered the

weapon attached to the name. The question is where or what file contains this information in the game. From there, I can simply replace his repeater with the lightsaber. Thanks!

 

From Chang about the weapon setup:

 

"where you see a "stricmp" it's looking for the exact name, where you see a "strncmp", it's only looking for the NPC's name to start with those letters...

 

int NPC_WeaponsForTeam( team_t team, int spawnflags, const char *NPC_type )

{

switch(team)

{

case TEAM_ENEMY:

if ( Q_stricmp( "tavion", NPC_type ) == 0 ||

Q_strncmp( "reborn", NPC_type, 6 ) == 0 ||

Q_stricmp( "desann", NPC_type ) == 0 ||

Q_strncmp( "shadowtrooper", NPC_type, 13 ) == 0 )

return ( 1 << WP_SABER);

 

if ( Q_strncmp( "stofficer", NPC_type, 9 ) == 0 )

{

return ( 1 << WP_FLECHETTE);

}

if ( Q_stricmp( "stcommander", NPC_type ) == 0 )

{

return ( 1 << WP_REPEATER);

}

if ( Q_stricmp( "swamptrooper", NPC_type ) == 0 )

{

return ( 1 << WP_FLECHETTE);

}

if ( Q_stricmp( "swamptrooper2", NPC_type ) == 0 )

{

return ( 1 << WP_REPEATER);

}

if ( Q_stricmp( "rockettrooper", NPC_type ) == 0 )

{

return ( 1 << WP_ROCKET_LAUNCHER);

}

if ( Q_strncmp( "shadowtrooper", NPC_type, 13 ) == 0 )

{

return ( 1 << WP_SABER); }

if ( Q_stricmp( "imperial", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER_PISTOL);

}

if ( Q_strncmp( "impworker", NPC_type, 9 ) == 0 )

{

return ( 1 << WP_BLASTER_PISTOL);

}

if ( Q_stricmp( "stormpilot", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER_PISTOL);

}

if ( Q_stricmp( "galak", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER);

}

if ( Q_stricmp( "galak_mech", NPC_type ) == 0 )

{

return ( 1 << WP_REPEATER);

}

if ( Q_strncmp( "ugnaught", NPC_type, 8 ) == 0 )

{

return WP_NONE;

}

if ( Q_stricmp( "granshooter", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER);

}

if ( Q_stricmp( "granboxer", NPC_type ) == 0 )

{

return ( 1 << WP_MELEE);

}

if ( Q_strncmp( "gran", NPC_type, 4 ) == 0 )

{

return (( 1 << WP_THERMAL)|( 1 << WP_MELEE));

}

if ( Q_stricmp( "rodian", NPC_type ) == 0 )

{

return ( 1 << WP_DISRUPTOR);

}

if ( Q_stricmp( "rodian2", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER);

}

 

if (( Q_stricmp( "interrogator",NPC_type) == 0) || ( Q_stricmp( "sentry",NPC_type) == 0) || (Q_strncmp( "protocol",NPC_type,8) == 0) )

{

return WP_NONE;

}

 

if ( Q_strncmp( "weequay", NPC_type, 7 ) == 0 )

{

return ( 1 << WP_BOWCASTER); }

if ( Q_stricmp( "impofficer", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER);

}

if ( Q_stricmp( "impcommander", NPC_type ) == 0 )

{

return ( 1 << WP_BLASTER);

}

if (( Q_stricmp( "probe", NPC_type ) == 0 ) || ( Q_stricmp( "seeker", NPC_type ) == 0 ))

{

return ( 1 << WP_BOT_LASER);

}

if ( Q_stricmp( "remote", NPC_type ) == 0 )

{

return ( 1 << WP_BOT_LASER );

}

if ( Q_stricmp( "trandoshan", NPC_type ) == 0 )

{

return (1<<WP_REPEATER);

}

if ( Q_stricmp( "atst", NPC_type ) == 0 )

{

return (( 1 << WP_ATST_MAIN)|( 1 << WP_ATST_SIDE));

}

if ( Q_stricmp( "mark1", NPC_type ) == 0 )

{

return ( 1 << WP_BOT_LASER);

}

if ( Q_stricmp( "mark2", NPC_type ) == 0 )

{

return ( 1 << WP_BOT_LASER);

}

if ( Q_stricmp( "minemonster", NPC_type ) == 0 )

{

return (( 1 << WP_MELEE));

}

if ( Q_stricmp( "howler", NPC_type ) == 0 )

{

return (( 1 << WP_MELEE));

}

//Stormtroopers, etc.

return ( 1 << WP_BLASTER);

break;

 

//allies

case TEAM_PLAYER:

 

if(spawnflags & SFB_RIFLEMAN)

return ( 1 << WP_REPEATER);

 

if(spawnflags & SFB_PHASER)

return ( 1 << WP_BLASTER_PISTOL);

 

if ( Q_strncmp( "jedi", NPC_type, 4 ) == 0 || Q_stricmp( "luke", NPC_type ) == 0 )

return ( 1 << WP_SABER);

 

if ( Q_strncmp( "prisoner", NPC_type, 8 ) == 0 )

{

return WP_NONE;

}

if ( Q_strncmp( "bespincop", NPC_type, 9 ) == 0 )

{

return ( 1 << WP_BLASTER_PISTOL);

}

 

if ( Q_stricmp( "MonMothma", NPC_type ) == 0 )

{

return WP_NONE;

}

 

//rebel

return ( 1 << WP_BLASTER);

break;

 

case TEAM_NEUTRAL:

 

if ( Q_stricmp( "mark1", NPC_type ) == 0 )

{

return WP_NONE;

}

if ( Q_stricmp( "mark2", NPC_type ) == 0 )

{

return WP_NONE;

}

if ( Q_strncmp( "ugnaught", NPC_type, 8 ) == 0 )

{

return WP_NONE;

}

if ( Q_stricmp( "bartender", NPC_type ) == 0 )

{

return WP_NONE;

}

if ( Q_stricmp( "morgankatarn", NPC_type ) == 0 )

{

return WP_NONE;

}

 

break;

 

default:

break;

}

 

return WP_NONE;

}

 

 

Next time I'll put these in the NPCs.cfg... heh

 

Michael Chang Gummelt

 

Gameplay Programmer: Jedi Knight II

 

Raven Software

 

http://www.ravensoft.com"

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...