Can the player have barks when he kills a npc?

Talk about any Deus Ex game modification here, e.g. maps, package or a total conversion.

Moderator: Forum Guards

Can the player have barks when he kills a npc?

Postby RedDynasty » Sat May 26, 12 9:42 pm

I thinking about this today and i remembered there was a game that ran the unreal engine called postal 2, that if u kill someone, the player will randomize whether he will say something or not.
Moslty it was on weapon specific barks.
If anyone has this game, please send me a uc of the player class, otherwise i will try to find it somewhere.
Or we could just stick with normal dx coding, i dunno.
Image
Your not a gamer until you played this.
User avatar
RedDynasty
Wannabe
 
Posts: 130
Joined: Sun Apr 01, 12 8:12 pm
Location: Portugal

Postby atrey65789 » Sun May 27, 12 1:00 am

I think you can create a script like that.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby SimonDenton » Sat Jul 14, 12 12:21 am

I am trying to implement something like this too but been busy lately. I was going with the easy route of just "emitting" a sound effect like you do for pain. Search in dxplayer for "Killer", that's how it links with MPGame.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby atrey65789 » Sat Jul 14, 12 1:01 am

I think you can find t in the scripted pawn class.. should be havin doing something with the AI.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby SimonDenton » Sun Jul 15, 12 12:21 am

Well, Scripted Pawns call sound functions in particular circumstances e.g


Code: Select all
BeginAttack:
   EnemyReadiness = 1.0;
   ReactionLevel  = 1.0;
   if (PlayerAgitationTimer > 0)
      PlayAllianceHostileSound();


The sound function being called is:
Code: Select all
// ----------------------------------------------------------------------
// PlayAllianceHostileSound()
// ----------------------------------------------------------------------

function PlayAllianceHostileSound()
{
   local DeusExPlayer dxPlayer;

   dxPlayer = DeusExPlayer(GetPlayerPawn());
   if ((dxPlayer != None) && (Enemy == dxPlayer))
      dxPlayer.StartAIBarkConversation(self, BM_AllianceHostile);
}


This calls ANOTHER function back in DeusExPlayer which then makes use of an enum in bark manager to play a conversation with the appropriate name e.g Paul_BarkAllianceHostile. If you can make the killer have a function like this in a custom player class (or mutator maybe), you can call it during kills.

Hope that somehow helped. Only way I learned dx coding was to read A LOT of it! :D
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby atrey65789 » Sun Jul 15, 12 3:19 am

Hmm....
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby SimonDenton » Sun Jul 15, 12 3:29 am

CreateKillerProfile in dxplayer is what you are looking for. The killer is labelled pKiller. This function is called when someone is killed. All you'd have to do is something like this in your custom player class:
Code: Select all
var() Sound killSound1;
var() Sound killSound2;

//
// CreateKillerProfile
//
function CreateKillerProfile( Pawn killer, int damage, name damageType, String bodyPart )
{
Super.CreateKillerProfile();

pKiller.PlayKilledSound()

}

function PlayKilledSound()
{
local float soundRand;

soundRand = FRand();

if(soundRand < 0.33)
 PlaySound(killSound1, SLOT_NONE, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);

else
{
 PlaySound(killSound2, SLOT_NONE, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
}

}

Last edited by SimonDenton on Sun Jul 15, 12 3:30 am, edited 1 time in total.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby atrey65789 » Sun Jul 15, 12 3:35 am

Well arn't you the one wanting to use this? lol
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby SimonDenton » Sun Jul 15, 12 3:49 am

Just trying to help :D So far we can try out using the sound method. Let me know how it goes. I have trial exams this week so I'll be busy. Good luck!
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm


Return to Modifications

Who is online

Users browsing this forum: No registered users and 19 guests