Navigation

 Changing Messages on Death Feature Type: Coding Tutorials     Added: 24/01  
  Author: Corven 

How to change the messages the players receive on death.

Tell me how I died

cg_event.c

First look in the CG_Obituary function that is where all the MOD message are stored and what they will say to the players when they are fragged. Let's go through them.

Starting with message that are given from natural and environmental deaths, look for the:

switch( mod ) {
case MOD_SUICIDE:
message = "suicides";
break;
case MOD_FALLING:
message = "cratered";
break;
case MOD_CRUSH:
message = "was squished";
break;
case MOD_WATER:
message = "sank like a rock";
break;
case MOD_SLIME:
message = "melted";
break;
case MOD_LAVA:
message = "does a back flip into the lava";
break;
case MOD_TARGET_LASER:
message = "saw the light";
break;
case MOD_TRIGGER_HURT:
message = "was in the wrong place";
break;
default:
message = NULL;
break;
}

Then we have the messages that are told to everyone when you accidentally (ofcourse) kill yourself, from splash damage:

if (attacker == target) {
gender = ci->gender;
switch (mod) {
#ifdef MISSIONPACK
case MOD_KAMIKAZE:
message = "goes out with a bang";
break;
#endif
case MOD_GRENADE_SPLASH:
if ( gender == GENDER_FEMALE )
message = "tripped on her own grenade";
else if ( gender == GENDER_NEUTER )
message = "tripped on its own grenade";
else
message = "tripped on his own grenade";
break;
case MOD_ROCKET_SPLASH:
if ( gender == GENDER_FEMALE )
message = "blew herself up";
else if ( gender == GENDER_NEUTER )
message = "blew itself up";
else
message = "blew himself up";
break;
case MOD_PLASMA_SPLASH:
if ( gender == GENDER_FEMALE )
message = "melted herself";
else if ( gender == GENDER_NEUTER )
message = "melted itself";
else
message = "melted himself";
break;
case MOD_BFG_SPLASH:
message = "should have used a smaller gun";
break;
#ifdef MISSIONPACK
case MOD_PROXIMITY_MINE:
if( gender == GENDER_FEMALE ) {
message = "found her prox mine";
} else if ( gender == GENDER_NEUTER ) {
message = "found it's prox mine";
} else {
message = "found his prox mine";
}
break;
#endif
default:
if ( gender == GENDER_FEMALE )
message = "killed herself";
else if ( gender == GENDER_NEUTER )
message = "killed itself";
else
message = "killed himself";
break;
}
}

Then further down still we move onto messages given if they are not suicides or environmental deaths, then that means someone else has just fragged you:

if ( attacker != ENTITYNUM_WORLD ) {
switch (mod) {
case MOD_GRAPPLE:
message = "was caught by";
break;
case MOD_GAUNTLET:
message = "was pummeled by";
break;
case MOD_MACHINEGUN:
message = "was machinegunned by";
break;
case MOD_SHOTGUN:
message = "was gunned down by";
break;
case MOD_GRENADE:
message = "ate";
message2 = "'s grenade";
break;
case MOD_GRENADE_SPLASH:
message = "was shredded by";
message2 = "'s shrapnel";
break;
case MOD_ROCKET:
message = "ate";
message2 = "'s rocket";
break;
case MOD_ROCKET_SPLASH:
message = "almost dodged";
message2 = "'s rocket";
break;
case MOD_PLASMA:
message = "was melted by";
message2 = "'s plasmagun";
break;
case MOD_PLASMA_SPLASH:
message = "was melted by";
message2 = "'s plasmagun";
break;
case MOD_RAILGUN:
message = "was railed by";
break;
case MOD_BFG:
case MOD_BFG_SPLASH:
message = "was blasted by";
message2 = "'s BFG";
break;
#ifdef MISSIONPACK
case MOD_NAIL:
message = "was nailed by";
break;
case MOD_CHAINGUN:
message = "got lead poisoning from";
message2 = "'s Chaingun";
break;
case MOD_PROXIMITY_MINE:
message = "was too close to";
message2 = "'s Prox Mine";
break;
case MOD_KAMIKAZE:
message = "falls to";
message2 = "'s Kamikaze blast";
break;
case MOD_JUICED:
message = "was juiced by";
break;
#endif
case MOD_TELEFRAG:
message = "tried to invade";
message2 = "'s personal space";
break;
default:
message = "was killed by";
break;
}

Now armed with this knowledge, you know where to look when you want to change any death messages in the game, to suit your own mod style.

Comments »



  Page 1

  Comments ( 0 )


  Features Index

  Home

Copyright © 2001 MGON International AB - Privacy statement