Author Topic: Suggestion - Score modifier  (Read 1838 times)

Offline Jonas

  • Rank: Private
  • *
  • Posts: 60
Suggestion - Score modifier
« on: March 04, 2008, 02:59:52 pm »
Hi,

Similar to headshot extra reward, is it possible to have a setting that is you are shot, you lose a point but still show your deaths as correct?

I.e. if you have earned 20 points for killing, but your overall deaths are 10, your actually score would show as 10-10? Thus giving a more realistic ratio?

Would this be difficult to code? If not, which gsc would need modding?

Thanks,
Jonas

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Suggestion - Score modifier
« Reply #1 on: March 04, 2008, 05:27:32 pm »
The kill/death ratio is not based on your score, but on actual kills and deaths. Adding or subtracting points from your score will not affect your ratio. Also bonus points do not affect the ratio at all.

Offline Jonas

  • Rank: Private
  • *
  • Posts: 60
Suggestion - Score modifier
« Reply #2 on: March 05, 2008, 03:29:30 am »
Thanks Patman, appreciate the response.

OK, understand that is not something that extreme may be interested in doing.
However, we are starting an internal league for our members and I thought that it must be possible to deduct a Kill point upon a death.

I thought this may be a way to get to grips with the coding. Have searched through the script code on IW (link provided by Sniperone) but couldn't find anything in the MP script that would offer any clues....

I also checked the scriptdata for headshot bonus' as I thought this would direct me to the gsc for modding, alas it points to ex_reward...... gsc but can't find it.

Not asking for the code but if there is any tips on which files I need to scrutinise, I would appreciate it.

Thanks,
Jonas

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Suggestion - Score modifier
« Reply #3 on: March 05, 2008, 07:53:33 am »
Bonus points are handled in the game type gsc files, which are located in the client side iwd.

maps\mp\gametypes

dm.gsc, tdm.gsc, sd.gsc, etc.


Locate the Callback_PlayerKilled procedure. Within that procedure you'll find this:

Code: [Select]
// Check if extra points should be given for bash or headshot
reward_points = 0;
if(isDefined(sMeansOfDeath))
{
if(sMeansOfDeath == "MOD_MELEE") reward_points = level.ex_reward_melee;
else if(sMeansOfDeath == "MOD_HEAD_SHOT") reward_points = level.ex_reward_headshot;
}

points = 1 + reward_points;

if(self.pers["team"] == attacker.pers["team"]) // killed by a friendly
{
if(level.ex_reward_teamkill) attacker.score -= points;
else attacker.score--;
}
else
{
attacker.score += points;
attacker.pers["bonus"] += reward_points;
teamscore = getTeamScore(attacker.pers["team"]);
teamscore += points;
setTeamScore(attacker.pers["team"], teamscore);
checkScoreLimit();
}


Remember that not all game type gsc files have the same bonus score handling, because some are team based (team score) and some are not.

Offline Jonas

  • Rank: Private
  • *
  • Posts: 60
Suggestion - Score modifier
« Reply #4 on: March 05, 2008, 09:20:36 am »
Patman,

Thanks so much -  a place to cut my teeth with coding.... appreciate the hints and tips.

Jonas