UE2 - UT2kX Altering Player Class Functions in Mutator

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

bengreenwood

New Member
Jun 23, 2008
16
0
1
Hi,

I'm making a mutator that alters the effects that occur when a player dies. I understand that you can alter the properties of the xPawn objects via the ModifyPlayer function in the Mutator class.

However, to alter the way the player dies it seems like I need to alter some functions in xPawn. e.g. FellOutOfWorld. Do I need to subclass xPawn to do this or is there another way you can do it as a mutator?

And assistance would be appreciated.

Thanks.
 

meowcat

take a chance
Jun 7, 2001
803
3
18
Depends on what function/result is. If is simply a different effect upon pawn death, there may be an easy way of handling this without subclassing xPawn. If you are trying to alter some other behavior (like how physics notification like 'landed' or 'hitwall' are handled) then you will probably need to subclass.

(the following is all from memory, so it might not be completely correct) When an xPawn dies the bTearOff flag is set to true, this means that clients no longer receive any networks updates about the "dead" pawn. The reason why this matters is that I'm not sure if you will be able to set "bHidden" to true before the replication is broken off with other clients.

This matters because you can always try spawning "dummy" actors that look/behave like a pawn that has just died (using a GameRule subclass spawned by a mutator), and hide the original dead pawn. I may have some example code lying around to post later.


What is the function/effect you are going for?
 

bengreenwood

New Member
Jun 23, 2008
16
0
1
Depends on what function/result is. If is simply a different effect upon pawn death, there may be an easy way of handling this without subclassing xPawn. If you are trying to alter some other behavior (like how physics notification like 'landed' or 'hitwall' are handled) then you will probably need to subclass.

(the following is all from memory, so it might not be completely correct) When an xPawn dies the bTearOff flag is set to true, this means that clients no longer receive any networks updates about the "dead" pawn. The reason why this matters is that I'm not sure if you will be able to set "bHidden" to true before the replication is broken off with other clients.

This matters because you can always try spawning "dummy" actors that look/behave like a pawn that has just died (using a GameRule subclass spawned by a mutator), and hide the original dead pawn. I may have some example code lying around to post later.


What is the function/effect you are going for?

Hi.Thanks for the reply.

Well there are a few things I'm going for. I took a look through the xPawn code to see which functions I might need to use. Turns out there are quite a few. Here are my ideas/ a rough idea of the functions I'll need to alter:

1. When a player gets blown to pieces/ skeletized, death screams should keep playing all the way through. In the film Army of Darkness, a load of zombies get blown apart at the end of the film and their screams continue as they get blown to bits. It's hilarious. I'm planning on adding those screams into this mod. PlayDyingSound().

2. Players should be able to get set on fire and stay on fire for a while when they're still alive if they get shot by a rocket launcher/ shock rifle/ link gun/ lightning gun. TakeDamage().

3. Corpses should not disappear unless they take a lot of damage. DoRezEffect(), TakeDamage().

4. A lot more gibs should come out when someone dies. ProcessHitFX(), DoDamageFX().

5. Corpses should go flying further and more spectacularly. PlayDying(), PlayDyingAnimation().

6. Giblets should stay around for longer. SpawnGiblet(), SpawnGibs().

7. More blood should come out when you shoot someone, and should stay around longer. PlayHit().

8. It should be harder to gib someone with the flak cannon. Instead they should get blasted backward with great force, so they go flying off into the distance, while a load of blood splatters out of their body. Alternately, they could get skeletized, with a load of gibs splattering everywhere, and the skeleton getting blasted backward. PlayHit().

9. Corpses should convulse randomly when something happens nearby. KSkelConvulse().

It seems like it would be quite hard to do all that with just a mutator! I'm guessing I'm going to have to subclass xPawn after all, right?

Again, thanks for replying.

BTW it would be interesting to hear what anyone thinks to the proposed features I mentioned.

Cheers.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
You cannot override functions of a class from an unrelated class. The only thing your mutator could do would involve replacing the class with a custom subclass. That, however, means incompatibility to a number of other mods that also want to replace the same class. The Pawn class in particular is replaced by e.g. UTComp and game types such as Betrayal, 3SPN (TAM), 4-team games and even built-in Mutant. (But since it's built-in, you could probably come up with a solution that would be compatible to xPawn and xMutantPawn.)