Unreal Scripted Sequences CIS 488/588 Bruce R. Maxim UM-Dearborn

Download Report

Transcript Unreal Scripted Sequences CIS 488/588 Bruce R. Maxim UM-Dearborn

Unreal Scripted Sequences
CIS 488/588
Bruce R. Maxim
UM-Dearborn
5/27/2016
1
NPC Control
• You can tell a bot to use a button to start a
door pressing animation
• Scripted sequences have an Actions list the
controls their behavior under the AIScript
category in their properties list
• Action lists can have conditionals and loops
• Actions can be latent (pause after executing)
or non-latent (no delay before next action)
5/27/2016
2
Using a Scripted Trigger - 1
Tutorial 14.1
• Use the map file Tutorial14_01_Start.ut2
• This tutorial creates a UseTrigger that plays a
sound, opens a door, and turns on a caution
light
• Open the Actor class browser, expand
Triggers, and select UseTrigger
• Add the UseTrigger in front of the door
5/27/2016
3
Using a Scripted Trigger - 2
Tutorial 14.1
• Open the Actor class browser, expand
KeyPoint>AIScript>ScriptedSequence, and
select ScriptedTrigger
• Add the ScriptedTriggeer next to the
UseTrigger in front of the door
• Open the Properties window for the Use
Trigger, expand th Events category, and type
MultiTrigger as the value of Event property
5/27/2016
4
Using a Scripted Trigger - 3
Tutorial 14.1
• Open the Properties window for the
ScriptedTrigger, expand the AIScript, and
enter the actions list
• Rebuild the level, save, and test
5/27/2016
5
ScriptedTrigger Actions
Tutorial 14.1
Index
Actions
Property Values
0
Action_WAITFOREVENT
ExternalEvent = MultiTrigger
1
Action_PLAYSOUND
Sound =
IndoorAmbienceDoor10
2
Action_TRIGGEREVENT
Event = BlastDoor
3
Action_TriggerEvent
Event = CautionLight
5/27/2016
6
Controlling a Pawn - 1
Tutorial 14.2
• Use map file Tutorial14_02_Start.ut2
• The NPC will runs to the Player, beckons for
the player to follow, and then opens the door
(several PathNodes are already in the map)
• Open Actor class browser, expand
Pawn>UnrealPawn, and select xPawn
• Move the xPawn to the lower right of the
level, near the PathNode, rotate the xPawn to
face the PathNode
5/27/2016
7
Controlling a Pawn - 2
Tutorial 14.2
• Open the Actor class browser, expand
Keypoint>AIScript, and select
ScriptedSequence
• Place the ScriptedSequence next to xPawn
• Open Properties window, expand the Events
category, and set Tag to PawnController
• Expand the AIScript category and set the
ControllerClass property to ScriptedController
5/27/2016
8
Controlling a Pawn - 3
Tutorial 14.2
• Open the xPawnProperties window, expand
the AI category, and set AIScriptTag to
PawnController
• Open the Properties window of the
ScriptedSequence, expand the AIScript
category, and add the actions list
• Rebuild the path, save, and test
5/27/2016
9
Actions for ScriptedSequence – 1
Tutorial 14.2
Index Action
Property Values
0
Action_WAITFOREVENT
ExternalEvent = CallNPC
1
Action_MOVETOPOINT
DestinationTag =
CallPoint
2
Action_TURNTOWARDPLAYER N/A
3
Action_WAITFORTIMER
5/27/2016
PuseTime = 0.5
10
Actions for ScriptedSequence – 2
Tutorial 14.2
Index Action
Property Values
4
Action_PLAYANIM
BaseAnim =
gesture_beckon
5
Action_WAITFORANIMEND
N/A
6
Action_SETVIEWTARGET
ViewTargetTag =
ConsoleTarget
7
Action_MOVETOPOINT
PauseTime = 0.2
5/27/2016
11
Actions for ScriptedSequence – 3
Tutorial 14.2
Index Action
Property Values
8
Action_WAITFORTIMER
BaseAnim =
gesture_beckon
9
Action_PLAYANIM
N/A
10
Action_SETVIEWTARGET
BaseAnim = gesture_halt
11
Action_MOVETOPOINT
Event = BlastDoor
5/27/2016
12
Matinee – ScriptedSequences
Tutorial 14.3
• I have not worked with matinee yet
5/27/2016
13
Using if Conditions - 1
Tutorial 14.4
• Use map file Tutorial14_04_Start.ut2
• We’ll set up a scripted sequence to make the
pawn run over to a PathNode to send a
message to a triggered condition
• Add a ScriptedSequence actor next to the
existing Trigger
• Open the Properties window, expand AIScript
category, and set ControllerClass to
ScriptedController
5/27/2016
14
Actions for ScriptedSequence
Tutorial 14.4
Index Action
Property Values
0
Action_WAITFOREVENT
ExternalEvent = CallBot
1
Action_WALK
N/A
2
Action_SETVIEWTARGET
ViewTargetTag = BotPanel
3
Action_MOVETOPOINT
DestinatioonTag =
Switchpoint
5/27/2016
15
Actions for ScriptedSequence
Tutorial 14.4
Index Action
Property Values
4
Action_WAITFORTIMER
PauseTime = 0.2
5
Action_PLAYANIM
BaseAnim = gesture_halt
6
Action_WAITFORANIMEND N/A
7
Action_TRIGGEREVENT
5/27/2016
Eveent = IC_DoorControl
16
Using if Conditions – 2
Tutorial 14.4
• Open the Property window for the xPawn,
expand the AI category, and check the value
of AIScriptTag (should be NPCScript)
• Return to the Property window of the
ScriptedSequence, expand the Events
category, and set Tag ot NPCScript
• Open the Actor class browser, expand
Triggers>TriggeredCondition, and select
TriggeredCondition
5/27/2016
17
Using if Conditions – 3
Tutorial 14.4
• Place the TriggeredCondtion next to the
Trigger and the ScriptedSequence
• Open the Property window for the
TriggeredCondition, expand the category
TriggeredCondition, and set value of
bTriggerContolled to True
• Expand the events category and set the Tag
property to IC_DoorControl
5/27/2016
18
Using if Conditions – 4
Tutorial 14.4
• UseTrigger in front of the second PathNode
send the event TestConsole
• Once the actions for the ScriptedTrigger are
entered, rebuild the path, save, and test
5/27/2016
19
Actions for ScriptedTrigger
Tutorial 14.4
Index
Action
Property Values
0
Action_WAITFOREVENT
ExternalEvent =
TestConsole
1
Action_IFCONDITION
TriggeredConditionTag =
IC_DoorControl
2
Action_PLAYSOUND
Sound =
MenuSounds.J_MouseOver
3
Action_TRIGGEREVENT
Event = OpenDoor
4
Action_ENDSECTION
N/A
5
Action_GOTOACTION
ActionNumber = 0
5/27/2016
20
Using Random Conditions - 1
Tutorial 14.5
• Use map file Tutorial14_05_Start.ut2
• Open the Actor class browser, expand Light,
and select TriggerLight
• Place this TriggerLIght near the corner light
• Open the TriggerLight properties window,
expand the LightColor category and set
– LightBrightness to 200
– LightHue to 150
– LightSaturation to 150
5/27/2016
21
Using Random Conditions - 2
Tutorial 14.5
• Expand the Lighting category and set
LightRadius to 10
• Expand the Events category and set Tag to
FlickerLight
• Expand the Object category and set
InitialState to TriggerToggle
• Open the Actor class browser, expand
KeyPoint>AIScript> and select
ScriptedSequence
5/27/2016
22
Actions for ScriptedSequence
Tutorial 14.5
Index Action
Property Values
0
Action_WAITFORTIMER
PauseTime = 0.10
1
ACTION_IFRANDOMPCT
Probability = 0.50
2
ACTION_TRIGGEREVENT
Event = FlickerLight
3
ACTION_ENDSECTION
N/A
4
ACTION_GOTOACTION
ActionNumber = 0
5/27/2016
23
Using Random Conditions - 4
Tutorial 14.5
• After entering the actions list in AIScript
category, rebuild the level
• Save and test it (trigger lights have not
always worked for me)
5/27/2016
24