Using the ScriptedSequence Actor

From BiaSDK
Jump to: navigation, search

In the prior steps we used TriggeredScript to play animations, but one of the new Actors in BIA EIB is the ScriptedSequence Actor. Its main purpose is for easily playing animations, without having to mess with TriggeredScripts.

So let’s use one of these Actors to get Friar animated, look in the Actor Class Browser, scroll down on the right column and select the ScriptedSequence Actor, then right click and place it in the level near Friar's character spawner.

It should show up as a box icon with "A.I. Script" text. Let’s open up its properties (f4), expand Events and change the Tag to SS_Friar_Intro. Now select Friar's CharacterSpawner, expand AI and then change AIScriptTag to SS_Friar_Intro. Now Friar knows to use the ScriptedSequence actor that you placed, a blue line should connect the two actors visually.

Let’s select the SS_Friar_Intro ScriptedSequence actor again, Expand AIScript, and then Expand Actions, it should be empty, so click the Add button, there is a drop down list to choose from, click on it, and select ACTION_WaitForEvent, now click the New button.

You’ve just added a new Action “WaitForEvent” to the list, which has a new property, ExternalEvent, it’s currently "None"; Type in EVENT_Friar_Start in the text field.

Now when the map runs, this ScriptedSequence will be waiting for the event EVENT_Friar_Start to be triggered, and then whatever other actions are added to the list will run.

So let’s add more actions!, click back up on Actions, Add, and select ACTION_InitAnimation, then click New. This action sets up a few properties related to how animations will be played, if they will teleport, etc. We need to just set the Boolean bStart to True for now.

Click back up on Actions, Add, and select ACTION_SetAnimSet, then click New. This action works the same as the one we used in TriggeredScript, just defines what animation set to be loading; let’s set the MeshAnimName to a_cin_d08_Eviction_notice.a_cin_d08_Eviction_notice

OK, now to add a list of animations, click up on Actions, Add, then select ACTION_PlayLoopWait, and click New. This action plays the animations inside the property m_AnimList, similar to how the IdleQueue commands work. It also waits for ExternalEvent to be triggered, and then it will move on to the next action in the list.

Set ExternalEvent to EVENT_Friar_Stop, now click on m_AnimList, and Add. We have some properties to set:

AnimRate = 1.0
BaseAnim = Crouched_get_ready_1
BlendInTime = 0.2
BlendOuttime = 0.2

You can just leave the other properties alone

Do the same and add another animation to the list, Crouched_get_ready_2

Now again, click Actions, Add, and select ACTION_PlayAnimWait, then click New. This action plays an animation and waits until it is done playing before moving to the next action in the list.

Set these properties:

BaseAnim = Crouched_get_ready_dismount_2

Then Add another Action, ACTION_ChangeController, and set NewControllerClass to Mind (from the dropdown list). There is also another variable, bDontTransitionToCombat, setting this to True will make the character skip his combat-ready animations, which can be helpful in some situations, but we will leave it False for this one.

Now there is one last Action to add, ACTION_LeaveSequence, this just exits the ScriptedSequence!

OK! We are done with adding Actions for now, it's really a matter of personal preference when using ScriptedSequence actors or plain TriggeredScripts. We need to edit TS_IntroScene and add two lines to trigger those EVENTS_ in the ScriptedSequence Actor.

Add this line in the PostFade state, after Begin:

ACTION_TriggerEvent( 'EVENT_Friar_Start' );

And then add this line before the ChangeControllerDirect commands in our IntroEnd state:

ACTION_TriggerEvent( 'EVENT_Friar_Stop' );

Be sure to delete this line!:

ACTION_ChangeControllerDirect( Pawn_Friar, class'Mind' );

Now compile changed, save your map, and test it. Friar should be crouched checking his equipment etc, and will switch into mind when everyone else does... But there is a problem, Friar was rotated around looking at the hedge!, this is because he gets his initial rotation from the ScriptedSequence actor, so in the editor rotate the ScriptedSequence actor around so it roughly matches his CharacterSpawner.

Back to Main Page