Difference between revisions of "Global Scripts"
Jump to navigation
Jump to search
Major Edit : Merged with the Quest Scripts article.
imported>Shademe m (Removed underscores from links) |
imported>Shademe (Major Edit : Merged with the Quest Scripts article.) |
||
|
If you're used to [[scripting]] in [http://www.elderscrolls.com/games/morrowind_overview.htm The Elder Scrolls III: Morrowind], you may be familiar with a concept known as "global scripts". In Morrowind, the way to run a global script — at least if you have the [http://www.elderscrolls.com/games/tribunal_overview.htm Tribunal] or [http://www.elderscrolls.com/games/bloodmoon_overview.htm Bloodmoon] expansions, or if you have the [http://www.elderscrolls.com/games/goty_overview.htm Morrowind Game of the Year Edition] — is to create your script as normal, then specify it is a Start Script in the Construction Set.
In Oblivion, however, all scripts must be attached to objects of some kind. This, of course, presents a problem: how can
==What is a
A
Quest scripts can be created by selecting ''Quest script'' type in the script editing window. They must be designated as quest scripts in order to be attached to [[:Category:Quests|quests]].
A few basic facts about quest scripts and their interaction with [[:Category:Quests|quests]] :
==Should I use a global script?==▼
* Quest scripts run only when the quest is running (which can be determined in-game by using sqv QUEST_NAME in the [[Glossary#C|Console]]). Quests can be started and stopped using the [[StartQuest]] and [[StopQuest]] script commands. Note that this is independent of a quest being complete or not. Completing a quest means that it is moved to the Completed Quest tab in the player's journal -- It will still be running unless a StopQuest command is used to turn it off.
* The rate at which a Quest script is processed can be changed by defining the [[fQuestDelayTime]] variable of the script. Each Quest can have its own fQuestDelayTime variable.
**The '''fQuestDelayTime''' variable of a particular Quest script may be set from another script by addressing the quest, e.g. '''set MyQuest.fQuestDelayTime to 0.01'''.
** Since quest scripts run based on time intervals, they will not necessarily frame sync, even when '''fQuestDelayTime''' is set to a very low value. For some effects (e.g. those using [[SetPos]]), this can have undesired effects. In such cases, Object or/and Magic scripts may be more appropriate to achieve an effect smoothly.
*Quest scripts are [[non-reference scripts]] and are therefore somewhat restricted in the function syntax they can use.
* Quest scripts are the only scripts which actually process a [[MenuMode]] block while the player is resting or using fast travel.
* In general, quests should be stopped when they are completed, in order to keep their scripts from processing. If there is need to keep a completed quest running (for some post-quest dialogue or script processing), the task of creating a second quest can be considered.
* Quest variables can still be accessed and modified when a quest is not running. When a quest is stopped, it's script will stop being processed, but it will still exist and the state of it's variables will remain intact.
* Quests automatically turn on when an entry is written to the player's journal. So if the line ''[[SetStage]] QUESTNAME 10'' is executed and the entry 10 has journal text, the corresponding Quest will start automatically.
If you have to ask, then the answer is a very emphatic '''''no'''''!▼
▲If you have to ask, then the answer is a very emphatic '''''no'''''!
Quest scripts are inefficient and are ''not'' the recommended solution to most problems. However, if the creation of a quest script is necessary, the scope of the script should be reduced to prevent the wastage of CPU cycles.
''For example'' : If your script only affects [[Actor]]s inside a certain inn, you could easily get the job done by using an [[Activator]], with a script attached to it, and placing it inside each cell of that inn '''or''' include provisions in your quest script to stop it's processing once the job is done.
==
===Create a Quest===
| |||