140 likes | 267 Views
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);
E N D
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 • Object has tons of code • Actor “inherits” this via “extend” • Pawn “inherits” this likewise • So does CBP1_Girl • and also CBP1_Girl_A Actor Pawn UseTrigger x • But CBP1_Girl can replace Pawn’s code CBP1_Girl CBP1_Girl_A
The runtime engine function BeginPlay() { } Your stuff here Runtime Engine function Touch() { } Your stuff here function Bump() { } Your stuff here Invisible Visible for each Actor
Touch function Touch() { }
This and Other Actors Level File : CBP1_Girl.uc class CBP1_Girl extends CBP1_Pawn; function Touch( actor Other ){ } UseTrigger CBP1_Girl
Bump function Bump() { }
File : CBP1_Girl.uc 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
Unreal WotGreal UnrealRuntime2Engine UT2004 Textures Scripts Static Meshes Textures Sounds Sounds
Script 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' }
Unreal & Add-ins Blender Maya 3D studiomax = Character construction UNREAL = UnrealEd + UnrealRuntimeEngine + UT2004 UnrealEd UDE WotGreal = Scripting tool
To Do : • Download and Copy “CBP1” contents replacing existing contents • Download “Maps for Scripting” and copy into “Maps” folder • Check version of Wotgreal before use 3.005 • Only modify of put scripts into CBP1 (or your own folder)