Open Source/ScoreAwardTrigger: Difference between revisions
From Unreal Wiki, The Unreal Engine Documentation Site
Created Custom Class Page. |
Marked For Deletion (Old License Complications) |
||
Line 1: | Line 1: | ||
{{delete}} | |||
__TOC__ | __TOC__ | ||
==About== | ==About== |
Revision as of 05:11, 8 April 2008
This page has been proposed for deletion. If you think this page should be kept, please state a reason on its talk page. |
About
A trigger that, when triggered, will add points to a player's score.
Properties
Visible
- int ScorePointsAdded
- Amount of points to add.
- sound TriggeredSound
- Sound played when triggered.
Source Code
<uscript> /* Written by Jon Steadman */
class ScoreAwardTrigger extends Trigger;
var() int ScorePointsAdded; var() sound TriggeredSound;
function PostBeginPlay() {
ReplaceText( Message , "%p", string( ScorePointsAdded ) ); Super.PostBeginPlay();
}
simulated event TriggerEvent( Name EventName, Actor Other, Pawn EventInstigator ) {
if( Role == ROLE_Authority && EventInstigator != None && !Level.Game.bGameEnded ) { if( EventInstigator.PlayerReplicationInfo != None ) Level.Game.ScoreObjective( EventInstigator.PlayerReplicationInfo,ScorePointsAdded ); else if( EventInstigator.Controller != None && EventInstigator.Controller.PlayerReplicationInfo != None ) Level.Game.ScoreObjective( EventInstigator.Controller.PlayerReplicationInfo, ScorePointsAdded );
if( TriggeredSound != None ) PlaySound( TriggeredSound ); }
Super.TriggerEvent( EventName, Other, EventInstigator );
}
defaultproperties { TriggerType=TT_PawnProximity Message="%p points awarded!" bTriggerOnceOnly=True ScorePointsAdded=2 } </uscript>