class cbp1_girl_a extends cbp1_pawn; var string name; var bool hit1; var bool hit2;
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 PresentationTRANSCRIPT
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
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
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
function Touch() {
}
Touch
class CBP1_Girl extends CBP1_Pawn;
function Touch( actor Other ){
}
File : CBP1_Girl.uc
UseTrigger
CBP1_Girl
Level
This and Other Actors
Bump
function Bump() {
}
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
WotGreal
Unreal
UnrealRuntime2Engine
UT2004
Textures
Static Meshes
Textures
Sounds
Sounds
WotGreal
Scripts
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
UnrealEd
Blender
Unreal & Add-ins
UNREAL = UnrealEd +UnrealRuntimeEngine
+UT2004
Maya
3D studiomax =Character construction
UDE
WotGreal =Scripting tool
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)