Introdu ction to Level Design in Unreal Technology 77
This will plac e a Setter for the EastDoor1Location variable.
65. Make the following conne ctions:
Get Actor Loca tion Return Value outpu t EastDoor1Locatio n input.
2
nd
Set exec (white) output 3
rd
Set exec (white) input.
66. Go back to the main editor by eith er minimizing the Blueprint Editor o r moving
it out of the way, momentarily.
67. In the main edito r, Left-cl ick on the EastDoor2 glass door mesh to select it.
68. With the EastDoor2 selected, go back to th e Blueprint Editor.
69. Right-click on the Even t Graph below the Get Actor Location.
70. From the m enu select the Add Reference to EastDoor2.
71. Drag a wire out from the EastDoor2. This will open up the p opup menu again.
72. Make sure the Context Sensitive checkbox is unchecked and type Get
Actor Location in the search bar.
73. Place the Get A ctor Location node to the right of the Eas tDoor2 actor refer-
ence.
74. Drag the EastDoor2Location variable you created earlier onto the Event Graph
to the right of the G et Ac tor Location node and choose Set from th e menu.
This will plac e a Setter for the EastDoor2Location variable.
75. Make the following conne ctions:
Get Actor Loca tion Return Value outpu t EastDoor2Locatio n input.
3
rd
Set exec (white) output 4
th
Set exec (white) input.
76.
Your network for settin g the fo ur doors’ initial location should look similar to
Figure 2.37.
FIGURE 2.37: The Complete Network for Setting Door Locations.
77. Marquee drag around all of the graph for settin g the four door locations and pr ess
the C key on your keyboard to create a comment section for this network. Na me
the section to Set Doors Initial Locations.
78 Game Development and Simulation with Unreal Technology
PROGRAMMING WITH THE TIMELINE
Now with our sliding glass doors initial location established in the ir respective
variables, we are ready to progra m the doors in such a way that when a player
walks up towards them they slide open.
In order to do this, we will use a begin overlap and an end overlap events for
each trigger. On begin overlap (which happens when a player enters the trigger
box) we will play th e tim eline. On end overlap event (which happens wh en the
player leaves th e trigg er box) we reverse the timeline.
Remember that we created a vector track in our timeline. We will use the
values of this vector track to add from the location of on e of the doors to update
its location along the timeline’s timing. This will slide the door out. For the
other door, we wish to slide it in the opposite direction. To achieve this, we will
subtract th e second door’s location from the vector track of the timeline to slide
the door to th e opposite direction.
78. Go back to the main editor by either minimizing the Blueprint Editor or moving
it out of the way, momentarily.
79. In the main editor, Left-click on the WestDoor1 glass door mesh to select it.
80. Change the Mob ility of the mesh to Movable, if it is static.
81. Change the Mobility of the other three glass door meshes and their handles to
Movable as well.
82. In the main editor Left-click on the WestTriggerBox glass door me sh to se-
lect it.
83. With the WestTriggerBox selected, scroll to the Collision section of its De ta ils
rollout.
84. Left-cli ck on the Collision Preset and fro m the dropdown list select
Custom.
85. Set the Coll ision Responses of everything to Ignore except for the Pawn.
86. Set the Coll ision Responses of the Pawn to Overlap (see Figure 2.38(a)).
87. With the WestTriggerBox still selec te d in the main editor, open the Blueprint
Editor.
88. Right-cl ick on the Event Graph to the left of the WestDoorTim eline and type
Actor Begin Overlap in the search box.
89. Select and p la ce the OnActorB eginOverlap event to the left of the
WestDoorTimeline.
90. Connect the exec(white) output of the OnActorBe ginOverlap even t to the Play
input of the WestDoorTimeline.
91. Right-cl ick on the Event Graph below of the OnActorBeg inOverlap and type
Actor End Overlap in the search box.
92. Select and place the OnActorEndOverlap event to th e left of the WestDoorTimelin e.
93. Connect the exec(white) output o f the OnActorEndOverla p event to the
Reverse input of the WestDoorTimeline.
94. Your network should look similar to Figure 2.38(b) so far.
95. Go back to the main editor by either minimizing the Blueprint Editor or moving
it out of the way, momentarily.
Introdu ction to Level Design in Unreal Technology 79
(a) (b)
FIGURE 2.38: (a) Only Pawn’s Collision is Set to Overlap. (b) Play and Reverse t he Timeline
on Begin Overlap and End Overlap Events.
96. In the main editor Left-click on the EastTrigger Box glass door mesh to se-
lect it.
97. With the Ea stTriggerBox selected, scroll to the Collision section of its Details
rollout.
98. Left-click on the Collision Preset and from the dropdown list select
Custom.
99. Set the Collision Responses of everything to Ignore except for the Pawn.
100. Set the Col lision Responses of the Pawn to Overlap.
101. With the E astTriggerBox still selected in the m ain editor, open the Blueprint
Editor.
102. Right-click on the Event Gr aph to the left of the EastD oorTimeline and type
Actor Begin Overlap in the search box.
103. Select and place the OnActorBeg inOverlap event to the left of the
EastDoorTimeline.
104. Connect the exec(white) output of the OnActorBeginOv erlap event to the Pla y
input of the EastDoorTimeline.
105. Right-click on the Event Graph below of the OnActorBeg inOverlap and type
Actor End Overlap in the search box.
106. Select and place the OnActorEndOverlapevent to the left of the EastDoorTimelin e.
107. Connect the exec(white) output of the OnActorEndOverlap event to the
Reverse input of the EastDoorTimeline.
108. Compile your blue print to save your progress so far.
80 Game Development and Simulation with Unreal Technology
UPDATING DOOR LOCATIONS FROM THE TIMELINE
109. Find the WestDoor1 reference (the blue node) in the graph editor from the Set
Doors Initial Locations section we created in Step 38 on page 74.
110. Duplicate this refere nce by either pressing Control +W on your keyboa rd or c opy-
ing and pasting it.
111. Place the duplicate referenc e to WestDoor1 sligh tly above and to the right of the
WestTimeline.
112. Drag a wire out from this WestDoor 1 reference and check the Context
Sensitive checkbox.
113. Type Set Actor Location in th e search bar and place the Set Actor
Location to the right of the WestDo or1 reference .
114. Drag a c opy of the WestDoor1Location variable onto the event graph from the
My Bluepri nt tab to the left.
115. Select Get fr om the p opup menu.
116. Place the WestDoor1Location getter node below the WestDoor1 refere nce.
117. Drag a wire out from the WestDoor1Location getter no de and type - in the
search bar.
118. Place a Vector-Vector expression. This should connect the output of the
WestDoor1Location getter node to the A input of the - expression.
119. Make the following connections (see Figure 2.39):
Upda te of WestDoorTimeline exec(white) input o f Set Location
WestDoorWay Track of WestDoorTimeline B input of
Output of New Locatio n input of Set Location
FIGURE 2.39: Updating West Door 1 Location.
120. Drag a copy of the WestDoor2Location variable onto th e event graph from the
My Bluepri nt tab to the left.
121. Select Get fr om the p opup menu.
122. Place the WestDoor2Location getter node below the - (subtract) expression.
123. Drag a wire out from the W estDoor2Location and ty pe + in the search bar.
Introdu ction to Level Design in Unreal Technology 81
124. Place a Vector+Vector node below the Set Actor Locati on node.
125. Drag a wire from the WestDoorway Track to the B input of the + node.
126. Find the WestDoor2 reference (the blue node) in the graph edito r from the Set
Doors Initial Locations section.
127. Duplicate this refere nce by either pressing Control+W on your keyboard or co py-
ing an d pasting it.
128. Place the duplicate r eference to WestDoor2 slightly below the first Set Actor
Location expression.
129. Drag a wire out from this WestDoor2 referenc e and make sure that the Context
Sensitive checkbox is checked.
130. Type Set Actor Lo cation in the search bar and place the Set Actor
Location to the rig ht of the WestDoor2 reference .
131. Connect the output of the + expression to the New Location input of the Set
Actor Location of the WestDoor2.
132. Connect the exec(white) output o f the Set Actor Locat ion of the first door to
the exec(white) input of the Set Actor Location of the WestDoor2.
133. Marquee drag around all of the graph for u pdating the two west door locations a nd
press the C key on your keyboard to c reate a com ment section for this network.
Name the section to Updat e West Door Locatio n.
134. Your network should loo k similar to Figure 2.40
FIGURE 2.40: Updating Both West Door Locations.
135. Compile your blue print and save yo ur level and progress.
136. Close or minimiz e the bluepr int editor.
137. Play the level by pressing Control+ P or the Play button in the main edito r.
138. Walk up to the West entrance of the lobby to ch eck out and see if the doors open
properly.
139. If the doors opened the wrong way, swap the - expre ssion and + expression places
in the calculations network. This may be caused due to your naming of the doors
in a different order than what we have done in this ch apter.
140. Perform Steps 109–139 for the East Doors to create the network that updates their
location from the EastDoorT imeline.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.227.4