Oblivion:Questvariablen nutzen: Unterschied zwischen den Versionen
Keris (Diskussion | Beiträge) K (→Handhabung) |
Keris (Diskussion | Beiträge) K |
||
Zeile 1: | Zeile 1: | ||
== Thema == | == Thema == | ||
− | Questvariablen sind in den meisten Fällen genau das, was man benötigt, um innerhalb einer Quest Informationen zugänglich zu machen. | + | Questvariablen sind in den meisten Fällen genau das, was man benötigt, um innerhalb einer Mod Quest-Informationen für Scripts zugänglich zu machen. |
== Anwendung == | == Anwendung == | ||
=== Aufgabenstellung === | === Aufgabenstellung === | ||
− | Es soll in einer Quest bis 10 gezählt werden, wobei an einer Stelle nur bei geraden Zahlen weiter gezählt wird und an einer anderen Stelle bei den ungeraden. | + | Es soll in einer Quest bis 10 gezählt werden, wobei an einer Stelle nur bei geraden Zahlen weiter gezählt wird und an einer anderen Stelle bei den ungeraden. |
Zeile 15: | Zeile 15: | ||
== Realisierung == | == Realisierung == | ||
=== Umgebung === | === Umgebung === | ||
− | Es gibt einen NPC, auf dem das Script PingPong liegt und eine Quest DemoQuest mit dem Script DemoQuestScript. | + | Es gibt einen [[f3:NPC]], auf dem das Script PingPong liegt und eine Quest DemoQuest mit dem Script DemoQuestScript. |
− | + | ||
=== Script === | === Script === | ||
<tesscript>scn PingPong | <tesscript>scn PingPong | ||
Zeile 24: | Zeile 24: | ||
Begin GameMode | Begin GameMode | ||
− | If DemoQuest.PingPong == 1 | + | If DemoQuest.PingPong == 1 |
Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | ||
− | endif | + | endif |
− | If DemoQuest.PingPong == 3 | + | If DemoQuest.PingPong == 3 |
Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | ||
− | endif | + | endif |
− | If DemoQuest.PingPong == 5 | + | If DemoQuest.PingPong == 5 |
Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | ||
− | endif | + | endif |
− | If DemoQuest.PingPong == 7 | + | If DemoQuest.PingPong == 7 |
Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | ||
− | endif | + | endif |
− | If DemoQuest.PingPong == 9 | + | If DemoQuest.PingPong == 9 |
Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | Set DemoQuest.PingPong to DemoQuest.PingPong + 1 | ||
− | endif | + | endif |
end</tesscript> | end</tesscript> | ||
Zeile 49: | Zeile 49: | ||
Begin GameMode | Begin GameMode | ||
− | If PingPong == 0 | + | If PingPong == 0 |
Set PingPong to PingPong + 1 | Set PingPong to PingPong + 1 | ||
− | endif | + | endif |
− | If PingPong == 2 | + | If PingPong == 2 |
Set Pingpong to Pingpong + 1 | Set Pingpong to Pingpong + 1 | ||
− | endif | + | endif |
− | If PingPong == 4 | + | If PingPong == 4 |
Set PingPong to PingPong + 1 | Set PingPong to PingPong + 1 | ||
− | endif | + | endif |
− | If PingPong == 6 | + | If PingPong == 6 |
Set PingPong to PingPong + 1 | Set PingPong to PingPong + 1 | ||
− | endif | + | endif |
− | If PingPong == 8 | + | If PingPong == 8 |
Set PingPong to PingPong + 1 | Set PingPong to PingPong + 1 | ||
− | endif | + | endif |
− | If Pingpong == 10 | + | If Pingpong == 10 |
Messagebox "Fertig" | Messagebox "Fertig" | ||
Set PingPong to PingPong + 1 | Set PingPong to PingPong + 1 | ||
− | endif | + | endif |
end</tesscript> | end</tesscript> |
Aktuelle Version vom 5. Juni 2009, 14:13 Uhr
Inhaltsverzeichnis
Thema
Questvariablen sind in den meisten Fällen genau das, was man benötigt, um innerhalb einer Mod Quest-Informationen für Scripts zugänglich zu machen.
Anwendung
Aufgabenstellung
Es soll in einer Quest bis 10 gezählt werden, wobei an einer Stelle nur bei geraden Zahlen weiter gezählt wird und an einer anderen Stelle bei den ungeraden.
Theorie
Der Zugriff auf Questvariablen geschieht außerhalb des Questscripts mit <tesscript>Questname.Variablenname</tesscript> Die Variable ist im Questscript deklariert.
Realisierung
Umgebung
Es gibt einen f3:NPC, auf dem das Script PingPong liegt und eine Quest DemoQuest mit dem Script DemoQuestScript.
Script
<tesscript>scn PingPong
- Written by keris
- 30.4.09
Begin GameMode
If DemoQuest.PingPong == 1
Set DemoQuest.PingPong to DemoQuest.PingPong + 1
endif If DemoQuest.PingPong == 3
Set DemoQuest.PingPong to DemoQuest.PingPong + 1
endif If DemoQuest.PingPong == 5
Set DemoQuest.PingPong to DemoQuest.PingPong + 1
endif If DemoQuest.PingPong == 7
Set DemoQuest.PingPong to DemoQuest.PingPong + 1
endif If DemoQuest.PingPong == 9
Set DemoQuest.PingPong to DemoQuest.PingPong + 1
endif
end</tesscript>
<tesscript>scn DemoQuestScript
- Written by keris
- 30.4.09
Short PingPong
Begin GameMode
If PingPong == 0
Set PingPong to PingPong + 1
endif If PingPong == 2
Set Pingpong to Pingpong + 1
endif If PingPong == 4
Set PingPong to PingPong + 1
endif If PingPong == 6
Set PingPong to PingPong + 1
endif If PingPong == 8
Set PingPong to PingPong + 1
endif If Pingpong == 10
Messagebox "Fertig" Set PingPong to PingPong + 1
endif
end</tesscript>
Handhabung
Die Variable wird im Questscript alle 5 Sekunden geprüft und ggf. hochgezählt, im Objectscript jeden Frame (sofern sich der Player in der selben Zelle wie die Referenz befindet.
Weiterführende Hinweise
Weitere Scripts aus dieser Kategorie
{{#if: Sonstiges | }}
{{#if: Level_1_Scripts | }}