| Home Page | Recent Changes | Preferences

# TouchableObjective

UT2003 >> Actor >> NavigationPoint >> JumpDest >> JumpSpot >> GameObjective >> TouchableObjective

A TouchableObjective must be touched by a player of the attacking team (the team that's not the one specified by the DefenderTeamIndex property) to be disabled. In other words, it more or less acts as a TriggeredObjective with a TeamTrigger built in.

## Usage

- Download http://mb.link-m.de/download/Comp-TouchableObjective.zip.
- Load the map in the archive, Comp-TouchableObjective.ut2, in UnrealEd.
- Then, without quitting UnrealEd, load your map.

You'll find TouchableObjective in the actor browser then. Its code will automatically be saved with your map when you save it.

See Embedding Code for more information.

## Source

    // ============================================================================
    // TouchableObjective
    // Copyright 2002 by Mychaeel <mychaeel@planetjailbreak.com>
    // $Id: TouchableObjective.uc,v 1.2 2003/01/03 15:40:52 mychaeel Exp $
    //
    // GameObjective that must be touched to be disabled. TriggeredObjective
    // requires an additional trigger for that.
    //
    // Originally developed for Jailbreak mapping support.
    // ============================================================================

    class TouchableObjective extends GameObjective
      placeable;

    // ============================================================================
    // DisableObjective
    //
    // Disables this objective if instigated by a player not of the defending team.
    // ============================================================================

    function DisableObjective(Pawn PawnInstigator) {

      if (PawnInstigator                            == None ||
          PawnInstigator.PlayerReplicationInfo      == None ||
          PawnInstigator.PlayerReplicationInfo.Team == None ||
          PawnInstigator.PlayerReplicationInfo.Team.TeamIndex == DefenderTeamIndex)
        return;

      SetCollision(False, False, False);

      Super.DisableObjective(PawnInstigator);
      }

    // ============================================================================
    // Reset
    //
    // Resets this actor to its default state. Restores its collision properties.
    // ============================================================================

    function Reset() {

      Super.Reset();

      SetCollision(Default.bCollideActors,  // resetting the collision will
                   Default.bBlockActors,    // implicitly call Touch again if a
                   Default.bBlockPlayers);  // player is still touching this actor
      }

    // ============================================================================
    // Touch
    //
    // Disables this objective when touched by a player.
    // ============================================================================

    event Touch(Actor ActorOther) {

      if (Pawn(ActorOther) != None)
        DisableObjective(Pawn(ActorOther));
      }

    // ============================================================================
    // Defaults
    // ============================================================================

    defaultproperties {

      bCollideActors = True;
      bBlockActors  = False;
      bBlockPlayers = False;
      }

Category Custom Class
Category Class (UT2003)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In