Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
class icu_mut extends Mutator; var bool bAffectSpectators; // If this is set to true, an interaction will be created for spectators var bool bAffectPlayers; // If this is set to true, an interaction will be created for players var bool bHasInteraction; var bool bDrawEnemy; var bool bDrawFriendly; function PreBeginPlay() { Log("ICU Mutator Started"); // Always comment out your logs unless they're errors } simulated function Tick(float DeltaTime) { local PlayerController PC; // If the player has an interaction already, exit function. if (bHasInteraction) Return; // DynamicActors is not very fast, so it's used only when really necessary. Using it once is no big deal. ForEach DynamicActors(Class'PlayerController', PC) { if (Viewport(PC.Player) != None) // Find the local Player { // Run a check to see whether this mutator should create an interaction for the player if ((PC.PlayerReplicationInfo.bIsSpectator && bAffectSpectators) || (bAffectPlayers && !PC.PlayerReplicationInfo.bIsSpectator)) { PC.Player.InteractionMaster.AddInteraction("USARBotAPI.MyInteraction", PC.Player); // Create the interaction bHasInteraction = True; // Set the variable so this lot isn't called again Return; // Exit function, and therefore exit the foreach iteration } } } } DefaultProperties { bAffectSpectators=true bAffectPlayers=true RemoteRole=ROLE_SimulatedProxy bAlwaysRelevant=true } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |