Oblivion:Questvariablen nutzen: Unterschied zwischen den Versionen

Aus Skript-Wiki
Wechseln zu: Navigation, Suche
K
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.
 +
  
 
== 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.
 +
  
 
=== Theorie ===
 
=== Theorie ===
 +
Der Zugriff auf Questvariablen geschieht mit
 +
<tesscript>Questname.Variablenname</tesscript>
 +
Die Variable ist im Questscript deklariert.
 +
  
 
== Realisierung ==
 
== Realisierung ==
 
=== Umgebung ===
 
=== Umgebung ===
 +
Es gibt einen NPC, auf dem das Script PingPong liegt und eine Quest DemoQuest mit dem Script DemoQuestScript.
  
 
=== Script ===
 
=== 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 ===
 
=== Handhabung ===
 +
Die Variable wird im Questscript alle 5 Sekunden hochgezählt, im Objectscript jeden Frame (sofern sich der Player in der selben Zelle wie die Referenz befindet.
  
 
== Weiterführende Hinweise==
 
== Weiterführende Hinweise==
 +
* [[ob:Variablen|Variablen]]
 +
 +
{{ Scriptkategorie |Sonstiges|Level_1_Scripts|Questvariablen nutzen}}

Version vom 30. April 2009, 22:15 Uhr

Thema

Questvariablen sind in den meisten Fällen genau das, was man benötigt, um innerhalb einer Quest Informationen 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 mit <tesscript>Questname.Variablenname</tesscript> Die Variable ist im Questscript deklariert.


Realisierung

Umgebung

Es gibt einen 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 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 | }}