Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles

Similar presentations


Presentation on theme: "Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles"— Presentation transcript:

1 Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles

2 Thus far We’ve played lots with the game dynamics to change how UT2003 runs. But, we’ve done little to nothing on how to cause a chain or sequence of events.

3 Today This, boys and girls is the land of the scripted sequence. We’re going to look at what it takes to include one in our game.

4 “I’m a programmer Jim, not a level designer” What are they and why do I care? Scripted Sequences are great tools to that allow the game to tell a story, set a mood or have something happen that “makes sense”.

5 “I’m a programmer Jim, not a level designer” Look a some of the other games that have used them to great effect…

6 Half-life

7 Max Payne

8

9 And of course…UT2003

10 UT2003

11 Fine, Fine… Enough about the story…why do I care…Me programmer! As programmers, we should and do care about these sequences since we could quite realistically be asked to build tools for them.

12 Our Goal For the next few lessons is to look at and develop an understanding of how these work. Then, develop a action sequence or two of our very own.

13 Oh, yeah You can also use the AIScript component of the scripted sequence to affect to behaviour of a bot in game. Thus changing it’s AI properties… e.g. it’s behaviour.

14 Getting started Today, our play in UScript is going to be minimal. We’re back in the Editor. But first, some set up info…

15 Getting started All bots in the game derive from Scripted controller, which is what allows our bots to follow other scripts. It is the AI controller which is the “brains” for the pawn. Achieved through a scripted sequence specified by an AIScript.

16 Getting started These work in close conjunction with AIScript’s which are placeable into the level. Used by Level Designers to specify special AI scripts for pawns placed in a level, and to change which type of AI controller to use for a pawn.

17 Getting started AIScripts can be shared by one or many pawns. Game specific subclasses of AIScript will have editable properties defining game specific behavior and AI.

18 Getting started The one we’re interested in is the UnrealScriptedSequence. This derives from ScriptedSequence provides the core functionality for setting up scripted sequences for pawns. A ScriptedController is spawned to carry out the scripted sequence.

19 Getting started Lastly, we have our actions list… It’s a rather long list of scripted actions available to the scripted controller These are the Actions that are used by a ScriptedSequence script which are the commands that tell the script what to do.

20 Getting started For a really good look and description of these actions, consult the wiki. http://wiki.beyondunreal.com/wiki/ScriptedSequence

21 Getting started Now that’s out of the way, time to build our own basic sequence. In short, we’ll get a bot to run around the room and then do something at each corner.

22 Getting started Start off with a simple test level, a box. Then add a XPawn and an UnrealScriptedSequence.

23 Simple Script At this point, the Script and Bot have no knowledge of each other, they need to be linked. If we run it now, the game will run as normal with this xPawn spawning in with us.

24 Linking the xPawn to the Script To link a pawn to a UnrealScriptedSequence, you need to set the pawn's AIScriptTag to the Tag of the UnrealScriptedSequence. This will cause the sequence to start executing as soon as the pawn is active in the level (usually as soon as the level begins).

25 Linking the xPawn to the Script AIScript tag must match the xPawns events Tag.

26 Linking the xPawn to the Script If all goes well, when the xPawn is selected a blue line will link the pawn to it’s script.

27 Linking the xPawn to the Script Lastly, we need to tell the UnrealScriptedSequence which controller this script affects. For now, just set it to ScriptedController so that we have total control over our pawn. It will have no brain of its own.

28 Linking the xPawn to the Script If you run the level now, you should have a dumb bot that simply stands there playing it’s idle animation.

29 Add some actions In your UnrealScriptedSequence actor, under AIScript is a dynamic array of Actions. These actions determine how the bot will behave. Notice that it starts with a default set of actions.

30 Add some actions Initially, your Actions array will be empty. To add a new action, click on Add. This will create an empty element in the array (Add will always create elements at the end of the array).

31 Add some actions Caution: If, at any point, you click on Empty, it will clear the whole array, and you will lose any data that was in it. We don’t want the default actions, so empty the list.

32 Add some actions Once you have an empty element in the array, you can expand it, and get a drop-down box which lists all the items which can be added into the array. To create a specific item for the array, select the item you wish to use from the drop-down-box, and click on New. The item that has been created can then be expanded to allow access to its variables.

33 Getting our dude to move So in the AIScript pull down, add an action from the pull down menu. In this case ACTION_MoveToPoint and hit new. Lastly set the destination tag.

34 Getting our dude to move Of course we need a destination. I’m going to use pathnodes. But really, we could use anything. Place one in the far corner and give its tag the same name as the destinationTag in the ACTION_MoveToPoint

35 Getting our dude to move And our dude springs into action, running to the path node of matching tag.

36 Getting our dude to move Now, if we place a node in each corner and string them together, we can make our bot do laps. Simply by adding new move to actions and pathnodes with matching tags.

37 Doing laps

38 Cool! Your very first scripted sequence. The bot does one lap of the room and then runs in place at the last node. We can get him to stop that by adding another action at the end of the list, say ACTION_TurnTowardPlayer

39 Doing laps But, better idea, there’s a goto action where we can jump to any action in the list. I’m going to jump to the first on so he goes in circles….forever.

40 Doing laps Let’s make the circuit a bit more interesting and make him do something unique at each corner.

41 Doing laps Corner 1: Jump Easy to set up, Just insert the Action_Jump, select the jump type and move to corner 2.

42 Doing laps Corner 2: play a sound Like above, real easy. Select a sound from the list.

43 Doing laps Corner 3: pause then seek the player A bit different, but still easy to set up. But there are 2 Actions here, ACTION_WaitForTimer and ACTION_MoveToPlayer

44 Doing laps Once the player is touched, the bot will return to its circuit.

45 Doing laps Corner 4: Wait for an event, repeat the circuit. The bot will remain at this location until an event is received. We’ll just set up a trigger to broadcast one.

46 Doing laps And use ACTION_WaitForEvent to hold until the event is broadcast.

47 Doing laps Now, setting up the trigger is a bit different as it’s looking for an event an not the usual broadcast tag. This causes an error to be generated but it works fine. You can make the error go away by using the tag in the triggers event also.

48 That’s a wrap This is only scraping the surface of what can be done via scritped sequences. But it’s a good starting point. And remember, these can be used to influence / over ride regular bot AI too.

49 Next Day… We’ll be looking at another item know as the scripted trigger which functions in a similar manner to the scripted sequences. But can be used for timing / triggering or setting off a series of sequential events.


Download ppt "Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles"

Similar presentations


Ads by Google