Author Topic: show headshot image  (Read 3385 times)

Offline Konig

  • Rank: Private
  • *
  • Posts: 5
show headshot image
« on: June 20, 2010, 02:33:34 pm »
Hello
On a only-sniper server v2.5, I'd like a invoke a picture  which is show up by a headshot, when the Extra point for headshot kills displays. Could be solve it? The image/iwi , material is ready.

Thanks
Konig

Offline Konig

  • Rank: Private
  • *
  • Posts: 5
Re: show headshot image
« Reply #1 on: June 22, 2010, 01:30:29 pm »
Has anybody a good solution to my problem?

Offline 4peterjan4

  • Rank: Private
  • *
  • Posts: 505
    • http://www.specialforces-clan.com
Re: show headshot image
« Reply #2 on: June 22, 2010, 01:55:02 pm »
Quote from: "Konig";p="34075"
Has anybody a good solution to my problem?

Hi M8,

I am not sure what u mean..

Where do you want the image to show up?

Greetings PhoeniX  8)

Offline Konig

  • Rank: Private
  • *
  • Posts: 5
Re: show headshot image
« Reply #3 on: June 23, 2010, 01:14:14 am »
[align=justify]Hi Phoenix!

Gets a specific image only for Headshots for attacker.

case "MOD_HEAD_SHOT":
               {
                  obitad(attacker, "headshotkill", "headshotdeath", "", sMeansOfDeath, sWeapon);
                  if(isWeaponType(sWeapon, "sniper")) obitstat(attacker, "sniperkill", "sniperdeath");
                  obitmain(attacker, sWeapon, sHitLoc, false);
                  if(self.ex_obmonpmsg) attacker iprintlnbold(&"OBITUARY_HEADSHOT");                  
                  if(self.ex_obmonpsound) attacker playLocalSound("headshot");
                                                                                                    ?headshot_image?          
                  break;
                                           }
What do I think of for you?[/align]
I thank you for wanting to help me

Offline Konig

  • Rank: Private
  • *
  • Posts: 5
Re: show headshot image
« Reply #4 on: June 26, 2010, 04:08:48 am »
Hey PatmanSan ... Would you be able to help me please?

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: show headshot image
« Reply #5 on: June 27, 2010, 07:41:15 am »
Open _ex_obituary.gsc in your favorite text editor

Go to the very end of this file, and add the following procedure:

Code: [Select]
showHeadshotImage()
{
if(!isdefined(self.headshot_img))
{
self.headshot_img = newClientHudElem(self);
self.headshot_img.horzAlign = "fullscreen";
self.headshot_img.vertAlign = "fullscreen";
self.headshot_img.alignX = "center";
self.headshot_img.alignY = "middle";
self.headshot_img.x = 320;
self.headshot_img.y = 240;
self.headshot_img.archived = false;
self.headshot_img.sort = 100;
self.headshot_img.alpha = 1;
self.headshot_img setShader("exg_crybaby", 64, 64);
}

if(isdefined(self.headshot_img))
self.headshot_img scaleOverTime(1, 384, 384);

wait( [[level.ex_fpstime]](1.5) );

if(isPlayer(self) && isdefined(self.headshot_img))
self.headshot_img destroy();
}

This example is using the "exg_crybaby" image, so make sure to change it to the name of your material file, and change the dimensions if needed.

Go to the section where the headshot is handled, and add a call to the new procedure:

Code: [Select]
case "MOD_HEAD_SHOT":
{
obitad(attacker, "headshotkill", "headshotdeath", "", sMeansOfDeath, sWeapon);
if(isWeaponType(sWeapon, "sniper")) obitstat(attacker, "sniperkill", "sniperdeath");
obitmain(attacker, sWeapon, sHitLoc, false);
//if(self.ex_obmonpmsg) attacker iprintlnbold(&"OBITUARY_HEADSHOT");
if(self.ex_obmonpmsg) attacker thread showHeadshotImage();
if(self.ex_obmonpsound) attacker playLocalSound("headshot");
break;
}

I disabled the code that shows the HEADSHOT text by placing // in front of it.
I added this line:

if(self.ex_obmonpmsg) attacker thread showHeadshotImage();

This will only show the image if you have an obituary mode that includes personal messages. If you want to show the image regardless of mode and settings, replace that line with:

attacker thread showHeadshotImage();

Offline Konig

  • Rank: Private
  • *
  • Posts: 5
Re: show headshot image
« Reply #6 on: June 28, 2010, 02:07:11 pm »
PatmanSan many many THANKS!! Great mod - great man! World Champion  :D

Offline Andrissimo

  • Rank: Private
  • *
  • Posts: 145
Re: show headshot image
« Reply #7 on: December 29, 2010, 11:13:08 pm »
that was working with x4 3.0 rc5 mod files?

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: show headshot image
« Reply #8 on: December 30, 2010, 04:14:28 pm »
No, this is X2 for COD2 m8

Offline Andrissimo

  • Rank: Private
  • *
  • Posts: 145
Re: show headshot image
« Reply #9 on: January 03, 2011, 02:38:59 am »
okay patmansan,but how can i add image to x4 3.0 files?

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: show headshot image
« Reply #10 on: January 03, 2011, 06:25:48 am »
You can increase your chances on getting an answer by posting this question in the correct forum.
No offense... just trying to keep it clean and simple. Thanks

Offline sevendust

  • Rank: Private
  • *
  • Posts: 6
Re: show headshot image
« Reply #11 on: November 20, 2011, 05:00:58 pm »
How do we just edit or modify the text that is there now for the various obituary messages i.e. HEADSHOT! KILLING SPREE! HUMILIATION! and so on? We want to change the color and sizes. I assume its html format syntax?

Thanks in advance!

[TFC]Sevendust

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: show headshot image
« Reply #12 on: November 21, 2011, 10:39:06 am »
inside the IWD:

localizedstrings\killspree.str
localizedstrings\obituary.str
etc.

Offline sevendust

  • Rank: Private
  • *
  • Posts: 6
Re: show headshot image
« Reply #13 on: November 24, 2011, 02:01:30 am »
I see where I can change colors using standard game stuff, but is there any syntax for changing size? Or font face? etc?

Thanks!

You the man PatmanSan! :)

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: show headshot image
« Reply #14 on: November 24, 2011, 12:00:24 pm »
It depends on where the localized string are for. Could be a menu or a script. If used for "iprintln" and "iprintlnbold" in a script, you cannot change the size; only the coloring. If used in a HUD element, you can change the size (.fontscale), and color (.color) if not overridden by color codes in the localized string itself.