Difference between revisions of "A beginner's guide, lesson 6 - Quest Dialogue"

→‎Three Problems: editing English
imported>Pyrocow2
(→‎Scripting: Editing English)
imported>Pyrocow2
(→‎Three Problems: editing English)
Line 573: Line 573:
You can now test this mod in the game, but it might be best not to SAVE the game in Oblivion as we will be changing things.
You can now test this mod in the game, but it might be best not to SAVE the game in Oblivion as we will be changing things.


==Three Problems==
==Two Problems==


There are 3 problems with the mod as it stands, (other than the fact it is not finished).
There are two problems with the mod as it stands:


The first problem you may have noticed is that the text does not stay on the screen very long and our NPC will, just look at us. This is due to the way the game handles speech.  
The first problem is that the text does not stay on the screen very long, and our NPC will just look at us. This is due to the way the game handles speech.  
It expects to find for each dialogue response files which we have not created. One is an MP3 which contains the sound files the others control are lip synch files used to animate the actor face as we carry out the dialogue. The text onscreen is set to appear on screen for the duration of these files.  
It expects to find for each dialogue response files, which we have not created. One is an MP3 which contains the sound files, and the others are lip synch files used to animate the actor's face as we carry out the dialogue. The text is supposed to appear on screen for the duration of these files.  
Since we don't have them yet the text runs very quickly. In later tutorials we will look at polishing this mod to include these files. For now these are cosmetic problems. It's irritating not to see the text for any length of time but it can't be helped, until we add those MP3's.  
Since we don't have them yet, the text runs very quickly. In later tutorials we will look at polishing this mod to include these files. For now, these are cosmetic problems. It's irritating not to see the text for any length of time, but it can't be helped until we add those MP3's.  
It doesn't stop the quest running. You can repeatedly play the on-screen text by selecting the topic message for you until you get the message
It doesn't stop the quest running. You can repeatedly play the on-screen text by selecting the topic message for you until you get the message


The second problem deals with the script as it currently stands and may not be so obvious to a non-scripter. Remember the quest script works every 5 seconds. That means that every 5 seconds this script adds the topic BGMMessage4u to the players list. I don't honestly know the effect of repeatedly adding a topic to the player list. I suspect that having done this the first time the rest of the time the script is ignored.  
The second problem deals with the script as it currently stands and may not be so obvious to a non-scripter. A quest script runs every 5 seconds. That means that every 5 seconds this script tries to add the topic BGMMessage4u to the players topic list. I don't honestly know what the effect of repeatedly adding a topic to the player's list is, but I suspect that extra requests to add the topic are simply ignored.  


However, this is still an untidy way to script. If we only want the script to do something once we should write script that does this.
However, this is still an untidy way to script. If we only want something to happen once, we should write our script that way!


This leads us to one of the most important and common scripting ideas. A do once loop.
This leads us to one of the most important and common scripting ideas: a do once loop.
 
This uses an.


==If-EndIf Blocks==
==If-EndIf Blocks==
Anonymous user