Out of the Park Developments Online Manuals
 
Title
KeyExisting Key New Key
Create as
Find in this manual
Case sensitive

Replace with
How the Game Processes Text Objects
So, after all that, how does OOTP actually decide which text object to use? We'll talk about game play-by-play more later on, but for now, here's the general process the game follows:

1. When you start OOTP, all text objects are randomized within their categories. (So, if there are 40 messages in the 'Player of the Week' category, they are all shuffled.)

2. In the game, an event occurs that generates a message. For example, it just turned Monday, and the Player of the Week award is announced.

3. OOTP looks for the appropriate text category in the XML file. In this case, it first needs a subject for the message, so it chooses PLAYER_OF_THE_WEEK_HITTER_SUBJECT.

4. OOTP then looks at the shuffled list of objects in this category and chooses the first option.

5. After an object is selected, it checks for any conditions attached to the object. If there is a condition, and the condition is not met, OOTP discards the object and selects the next object. If the condition is met, or if there is no condition, then the game uses this object. The subject of the message has now been decided.

6. Next, OOTP needs a body for the message, so it looks in the PLAYER_OF_THE_WEEK_HITTER category and repeats Steps 4 and 5 above, selecting a message body. Now our news article has both a subject and a body.

7. OOTP also might check the BATTER_SEASON_DESCRIPTION category to get a summary of the player's performance so far this year, and append it to the message body.

8. The game then displays the news article in the game.

9. The next time an article is required, this entire process is repeated. If it's another PLAYER_OF_THE_WEEK_HITTER category, then the game will pick up where it left off in the shuffled list of objects. Once OOTP has gone through all the options in a category, it will start again from the top in the same order, as long as OOTP is not closed. Any time you close and reopen OOTP, the objects are randomized again.

Let's walk through an example, with tokens removed to make it easier to follow. Let's say that 28-year-old hitter Will Smith wins the Player of the Week award, and OOTP is trying to generate that news article.

First it chooses the first PLAYER_OF_THE_WEEK_HITTER_SUBJECT object in the randomized list:

'Smith Wins Player of the Week in NL'

There is no condition assigned to this object, so that option 'passes' and gets selected as the subject header. Next, the game chooses the first PLAYER_OF_THE_WEEK_HITTER object:

CONDITION: PLAYER_AGE_MIN = 33

'Veteran Will Smith slammed 12 RBI this past week, winning the Player of the Week Award.'

Okay, there's a condition assigned to this object. This object should be used only if the player in question is at least 33 years old. Well, Will Smith is 28, so the condition fails. OOTP discards this option and picks the next object in the randomized list:

'Will Smith pounded 12 RBI this past week to win the Player of the Week Award. What a great job!'

There is no condition here, so this object is accepted. The game then moves on to pick a BATTER_SEASON_DESCRIPTION. It chooses this:

CONDITION: PLAYER_AGE_MAX = 32

'Smith is having a great season so far, hitting .360 with 20 HR and 65 RBI. He still has a lot of years left!'

This object also has a condition, but this time the condition says that the player must be under 32 years old, which Smith is, so the object is accepted. The game has now selected the three pieces it needs, and it displays the news article as follows:

Subject: Smith Wins Player of the Week in NL

Will Smith pounded 12 RBI this past week to win the Player of the Week Award. What a great job!

Smith is having a great season so far, hitting .360 with 20 HR and 65 RBI. He still has a lot of years left!