Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTDom.DOMSeqEvent_ControlPointEvent


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
/**
 * Control Point Kismet Event
 * Triggered when there is a new ControllingTeam
 * 
 * Writen by Brian 'Snake' Alexander. Copyright(c) 2008-2010 All Rights Reserved.
 */
class DOMSeqEvent_ControlPointEvent extends SequenceEvent;

/** The current Controlling Team Index Red=0 Blue=1 Green=2 Gold=3 */
var int TeamNum;
/** The current Controlling Teams score */
var int TeamScore;

/** attempts to activate the event with the appropriate output for the given event type and instigator */
function Trigger(name EventType, Controller EventInstigator)
{
   local array<int> ActivateIndices;
   local int i;
   local UTGameReplicationInfo GRI;
   local SeqVar_Int IntVar, IntVarScore;
   local DominationFactory DF;

   for (i = 0; i < OutputLinks.length; i++)
   {
      if (EventType == name(OutputLinks[i].LinkDesc))
      {
         ActivateIndices[ActivateIndices.length] = i;
      }
   }
   
   if (Originator == none || DominationFactory(Originator) == none)
   {
      `Warn("No DominationFactory connected to" @ self);
      return;
   }

   DF = DominationFactory(Originator);
   if (DF != None)
   {
      if (ActivateIndices.length == 0)
      {
         ScriptLog("Not activating" @ self @ "for event" @ EventType @ "because there are no matching outputs");
      }
      else if (CheckActivate(Originator, EventInstigator, false, ActivateIndices))
      {
         TeamNum = DF.GetTeamNum();
         if (TeamNum > 3)
            TeamNum = 4;

         if (TeamNum < 4)
         {
            GRI = UTGameReplicationInfo(GetWorldInfo().GRI);
            if (GRI != none && GRI.Teams[TeamNum] != none)
            {
               TeamScore = GRI.Teams[TeamNum].Score;
            }
         }

         foreach LinkedVariables(class'SeqVar_Int', IntVar, "Team Number")
         {
            IntVar.IntValue = TeamNum;
         }
         foreach LinkedVariables(class'SeqVar_Int', IntVarScore, "Score")
         {
            IntVarScore.IntValue = TeamScore;
         }
      }
   }
`if(`isdefined(DEBUG))
   if (EventInstigator != none)
      `log("******************* TeamScore="@TeamScore@" / TeamNum="@TeamNum@" / EventInstigator="@EventInstigator.GetHumanReadableName()@" / ControlPoint="@DF.GetHumanReadableName(),,self.Name);
   else if (DF.myControlPoint.HolderPRI != none)
      `log("******************* TeamScore="@TeamScore@" / TeamNum="@TeamNum@" / EventInstigator="@DF.myControlPoint.HolderPRI.GetCallSign()@" / ControlPoint="@DF.GetHumanReadableName(),,self.Name);
   else
      `log("******************* TeamScore="@TeamScore@" / TeamNum="@TeamNum@" / EventInstigator=None / ControlPoint="@DF.GetHumanReadableName(),,self.Name);
`endif
}

defaultproperties
{
   ObjName="Control Point Event"
   ObjCategory="Objective"
   bPlayerOnly=false
   MaxTriggerCount=0
   ObjClassVersion=7
   OutputLinks[0]=(LinkDesc="Red")
   OutputLinks[1]=(LinkDesc="Blue")
   OutputLinks[2]=(LinkDesc="Green")
   OutputLinks[3]=(LinkDesc="Gold")
   OutputLinks[4]=(LinkDesc="Neutral")
   OutputLinks[5]=(LinkDesc="Disabled")
   VariableLinks(1)=(ExpectedType=class'SeqVar_Int',LinkDesc="Team Number",PropertyName=TeamNum,MaxVars=1,bWriteable=true)
   VariableLinks(2)=(ExpectedType=class'SeqVar_Int',LinkDesc="Score",PropertyName=TeamScore,MaxVars=1,bWriteable=true)
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Wed 8/12/2010 21:17:38.000 - Creation time: Fri 23/12/2011 20:31:26.369 - Created with UnCodeX