Differences

This shows you the differences between the selected revision and the current
version of the page.


wmebook:ch7 2007/12/07 15:02 wmebook:ch7 2008/01/10 12:06 current
Line 88: Line 88:
This is the typical way how can player traverse the dialogue tree. He can either ask about Weather or Book or he can ask about his colleagues which opens him a path to ask about specific colleagues and moreover Peter opens up way to some plot like elements. This is the typical way how can player traverse the dialogue tree. He can either ask about Weather or Book or he can ask about his colleagues which opens him a path to ask about specific colleagues and moreover Peter opens up way to some plot like elements.
-Also we’d like to define some other rules to our dialogue. Weather is very stupid topic so we’d let our player as about it only once per the whole game. Marc and Dirac are not important for the story, so we’ll let the player ask about them only once per dialogue. +Also we’d like to define some other rules to our dialogue. Weather is very stupid topic so we’d let our player as about it only once per the whole game. Marc and Dirac are not important for the story, so we’ll let the player ask about them only once per dialogue. Lastly “Book” topic will be opened to player only when Molly picks up the book.
-Lastly “Book” topic will be opened to player only when Molly picks up the book.+
So let’s get moving. We have to be familiar with a few new methods: So let’s get moving. We have to be familiar with a few new methods:
Line 154: Line 153:
</code> </code>
-First we’ve created an array called options. This is very useful not only for the keeping texts tidy and in one place, but also because when the value is selected our actor can easily say the words player selected. +First we’ve created an array called options. This is very useful not only for the keeping texts tidy and in one place, but also because when the value is selected our actor can easily say the words player selected. Then comes the logic of the dialogue. The dialogue itself is a loop, which loops until player selects the option 3 (Bye). So every time the loop iterates, the dialogue box is recreated and player can choose again his options.
- +
-Then comes the logic of the dialogue. The dialogue itself is a loop, which loops until player selects the option 3 (Bye). So every time the loop iterates, the dialogue box is recreated and player can choose again his options.+
We can see that inside of this loop we first assign 3 responses (we didn’t solve the book issue yet) and then set the game to interactive mode. But it was already interactive, so why? Because we don’t want our player to roam around while chatting, so we set the game to interactive mode only for the dialogue selecting. We wait for the player’s input and then use the switch logic to choose the response. As I already outlined, you can do anything as a response. If you decided that after certain option game unexpectedly quits to the desktop, simply put there Game.QuitGame(); but don’t blame me if players torture you afterwards. We can see that inside of this loop we first assign 3 responses (we didn’t solve the book issue yet) and then set the game to interactive mode. But it was already interactive, so why? Because we don’t want our player to roam around while chatting, so we set the game to interactive mode only for the dialogue selecting. We wait for the player’s input and then use the switch logic to choose the response. As I already outlined, you can do anything as a response. If you decided that after certain option game unexpectedly quits to the desktop, simply put there Game.QuitGame(); but don’t blame me if players torture you afterwards.
Line 302: Line 299:
</code> </code>
-The only difference in this one is that we set a global variable which will influence something in the game. This is the key stone on the game logic (sometimes referred as a gaming butterfly effect – someone tells you something and completely unrelated drawer in another town suddenly mysteriously opens – but we’re not discussing game design related flaws, right? Right???).+The only difference in this one is that we set a global variable which will influence something in the game. This is the key stone on the game logic (sometimes referred as a gaming "butterfly effect" – someone tells you a piece of information and completely unrelated drawer in another town suddenly mysteriously opens – but we’re not discussing game design related flaws, right? Right???).
The only remaining change is to the function basic(); but I’m going to post the whole script now because I believe you will be able to spot that easily. The only remaining change is to the function basic(); but I’m going to post the whole script now because I believe you will be able to spot that easily.
 
wmebook/ch7.1197036154.txt.gz · Last modified: 2007/12/07 15:02 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki