I love the smell of UnrealEd crashing in the morning. – tarquin

Difference between revisions of "User:Rejecht"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Players who are out can sometimes respawn)
(Nice to know)
Line 5: Line 5:
 
=== Nice to know ===
 
=== Nice to know ===
  
* NumLives is not the number of livesNumLives is the number of deaths (the number of lives used).
+
==== NumLives is not the number of lives ====
* Errors found in Unreal Engine 2.5 may also be present in the UDK.
+
NumLives is the number of deaths (the number of lives used).
 +
 
 +
==== Errors found in Unreal Engine 2.5 may also be present in the UDK ====
  
 
=== Game mechanical errors discovered in Unreal Tournament 2004 ===
 
=== Game mechanical errors discovered in Unreal Tournament 2004 ===

Revision as of 18:31, 26 February 2012

About

Haphazard hobbyist programming sessions.

Nice to know

NumLives is not the number of lives

NumLives is the number of deaths (the number of lives used).

Errors found in Unreal Engine 2.5 may also be present in the UDK

Game mechanical errors discovered in Unreal Tournament 2004

Players who are out can sometimes respawn

Triggers for this error:

  • It must be a TeamGame.
  • (MaxLives > 0) - Assume that this example has (MaxLives == 1)
  • TeamGame.ScoreKill has the errors.

Consequences:

  • The player can respawn despite having died the allotted MaxLives.

Cause:

  • The ScoreKill logic in TeamGame does not always call Super.ScoreKill, which is the one handling the NumLives count and sets bOutofLives accordingly.

First attempt:

  • OK, so let's just override ScoreKill and increment NumLives ourselves, before or after calling ScoreKill, since it expects (NumLives >= MaxLives).

First consequence of the first attempt: While this solved the original problem, it also introduced another problem:

  • This triggers LateEntryLives (which defaults to 1), forcing latecomers to become spectators (bOnlySpectator) at login, and some people losing hair because they now have a new unwanted behaviour.

This is because some players now get (NumLives == 2), and others get (NumLives == 1), depending on the circumstances in TeamGame.ScoreKill. Login checks LateEntryLives against all players and boots the player to a spectator slot when it finds (NumLives (2) > LateEntryLives (1)).

Other possible approaches to solve the first consequence:

  1. Clamp the value in your ScoreKill.
  2. Set LateEntryLives to MAXINT in InitGame to override any ini setting, unless you want to use LateEntryLives.

ToggleScreenShotMode does not restore Handedness

Scope:

  • PlayerController.ToggleScreenShotMode

Type:

  • Save/Restore

Fix:

  1. Remember and restore Handedness.

TakeDrowningDamage

Scope:

  • Pawn.TakeDrowningDamage

Type:

  • Access Error

Fix:

  1. Check (Controller != None) before calling Super.TakeDrowningDamage in a subclass of pawn .

PlayTakeHit never played drowning sound

Scope:

  • xPawn.PlayTakeHit

Type:

  • Class Check Error

Corrections:

  1. Find: DamageType.IsA('Drowned')
  2. Replace With: DamageType == Class'Drowned'

Reminder:

  • Do not use IsA with a class object (Class<DamageType> Class_DamageType).
  • Use IsA with an instance of a class object.

(...) more to come.