class cbp1_girl_a extends cbp1_pawn; var string name; var bool hit1; var bool hit2;

13
class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2; function Touch( actor Other ){ // Get the name of the Other actor touched and display the name name = Other.GetPropertyText("Name"); ClientMessage("CBP1_Girl_A::Touch: Touched Actor " $ name); // Test to see if we've touched UseTrigger0 if(name == "UseTrigger0") { Hit1 = true; } // Test to see if we've touched Spotlight0 if(name == "Spotlight0") { Hit2 = true; } if ( (Hit1 == true) && (Hit2==true) ) ClientMessage("GOAL ACHIEVED"); } function BeginPlay() { // Initialize variables Hit1 and Hit2 to false - they're NOT yet hit Hit1 = false; Scripting = Programmin g

Upload: juliet-sanford

Post on 05-Jan-2016

52 views

Category:

Documents


2 download

DESCRIPTION

class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2; function Touch( actor Other ){ // Get the name of the Other actor touched and display the name name = Other.GetPropertyText("Name"); ClientMessage("CBP1_Girl_A::Touch: Touched Actor " $ name); - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

class CBP1_Girl_A extends CBP1_Pawn;

var string name;var bool Hit1;var bool Hit2;

function Touch( actor Other ){

// Get the name of the Other actor touched and display the name name = Other.GetPropertyText("Name"); ClientMessage("CBP1_Girl_A::Touch: Touched Actor " $ name);

// Test to see if we've touched UseTrigger0 if(name == "UseTrigger0") { Hit1 = true; } // Test to see if we've touched Spotlight0 if(name == "Spotlight0") { Hit2 = true; }

if ( (Hit1 == true) && (Hit2==true) ) ClientMessage("GOAL ACHIEVED");

}

function BeginPlay() {

// Initialize variables Hit1 and Hit2 to false - they're NOT yet hit Hit1 = false;

Scripting = Programming

Page 2: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

The Concept of Classes

Object

Actor

Pawn UseTrigger

CBP1_Girl CBP1_Girl_A

• Object has tons of code

• Actor “inherits” this via “extend”

• Pawn “inherits” this likewise

• So does CBP1_Girl

• and also CBP1_Girl_A

• But CBP1_Girl can replace Pawn’s code

x

Page 3: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

The runtime engine

Runtime Engine

function BeginPlay() {

}

Your stuff here

function Touch() {

}

function Bump() {

}

Your stuff here

Your stuff here

Invisible Visible for each Actor

Page 4: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

function Touch() {

}

Touch

Page 5: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

class CBP1_Girl extends CBP1_Pawn;

function Touch( actor Other ){

}

File : CBP1_Girl.uc

UseTrigger

CBP1_Girl

Level

This and Other Actors

Page 6: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

Bump

function Bump() {

}

Page 7: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

function Bump( actor Other ) {

name = Other.GetPropertyText("Name");

ClientMessage("CBP1_Girl_A::Bump: Bumped Actor " $ name);

}

Get the name of the Other actor touched

Displays the name

File : CBP1_Girl.uc

Page 8: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

WotGreal

Page 9: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

Unreal

UnrealRuntime2Engine

UT2004

Textures

Static Meshes

Textures

Sounds

Sounds

WotGreal

Scripts

Page 10: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

class CBP1_Girl extends CBP1_Pawn;

var string name;

function Touch( actor Other ){

}

function BeginPlay() {

}

function Bump (actor Other) {

}

defaultproperties {… JumpZ=2048.000000 CrouchHeight=72.000000 Mesh=SkeletalMesh'UDN_CharacterModels_K.GenericFemale'}

Script

Page 11: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

UnrealEd

Blender

Unreal & Add-ins

UNREAL = UnrealEd +UnrealRuntimeEngine

+UT2004

Maya

3D studiomax =Character construction

UDE

WotGreal =Scripting tool

Page 12: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;

To Do :

1. Download and Copy “CBP1” contents replacing existing contents

2. Download “Maps for Scripting” and copy into “Maps” folder

3. Check version of Wotgreal before use 3.005

4. Only modify of put scripts into CBP1 (or your own folder)

Page 13: class CBP1_Girl_A extends CBP1_Pawn; var string name; var bool Hit1; var bool Hit2;