Changes between Version 23 and Version 24 of code/doc/Questsystem
- Timestamp:
- Mar 20, 2010, 9:46:58 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/Questsystem
v23 v24 16 16 17 17 == More details == 18 The project essentially consists of the Quest entity which is the quest itself (and sub- or helper-entities, such as QuestHint (hints for quests) or QuestDescription (descriptions for quests and hints, to separate content from function)) and the QuestEffect and QuestListener entities which are the only tools for quests to have any influence on the game world. By enabling quests to have QuestEffects their are able to (for example) fail or complete other quests, activate hints give rewards or even add a quest to a player. QuestListeners on the other hand can be used by any objetcto react to a status change of a Quest.18 The project essentially consists of the Quest entity which is the quest itself (and sub- or helper-entities, such as QuestHint (hints for quests) or QuestDescription (descriptions for quests and hints, to separate content from function)) and the QuestEffect and QuestListener entities which are the only tools for quests to have any influence on the game world. By enabling quests to have QuestEffects their are able to (for example) fail or complete other quests, activate hints give rewards or even add a quest to a player. QuestListeners on the other hand can be used by any object to react to a status change of a Quest. 19 19 The QuestEffectBeacon is the physical entity which finally makes quests available for the player in the game, by being able to invoke a QuestEffect on a player (under some conditions). 20 20 … … 26 26 27 27 ==== LocalQuest ==== 28 A LocalQuest is a Quest which has different states for each player, that means each LocalQuest can be obtained and completed (or failed) by each player parallely.28 A LocalQuest is a Quest which has different states for each player, that means each LocalQuest can be obtained and completed (or failed) by each player in parallel. 29 29 For generating the questId you can [http://www.google.com/search?q=guid+generator google] or you can use this [http://www.famkruithof.net/uuid/uuidgen generator]. 30 30 … … 95 95 96 96 ==== QuestHint ==== 97 QuestHints can be used to give a player useful (or just funnily unuseful) information for Quests he is working on completing. The cannot have any sideeffects but also have an identifier which follows the same form as in the Quests.97 QuestHints can be used to give a player useful information for Quests he is working on completing. The cannot have any side effects but also have an identifier which follows the same form as in the Quests. 98 98 99 99 … … 113 113 }}} 114 114 115 === Creating Sideeffects ===116 Quests can have side effects, this means that they can have an influence on the game world. Quests can do that through two distinct devices, QuestEffects and QuestListeners (active and passive).115 === Creating side effects === 116 Quests can have side effects, this means that they can have an influence on the game world. Quests can do that through two distinct devices, QuestEffects and QuestListeners (active and passive). 117 117 118 118 ==== QuestEffect ==== 119 A QuestEffect is the first (and probably most important) device for Quests to have side effects. There are two entities that can have QuestEffects: Quests and QuestEffectBeacons (which will be explained later on).119 A QuestEffect is the first (and probably most important) device for Quests to have side effects. There are two entities that can have QuestEffects: Quests and QuestEffectBeacons (which will be explained later on). 120 120 QuestEffects, for example, start a Quest for a player, complete/fail Quests for a player, add a QuestHint or a Reward to a player. 121 121 … … 162 162 163 163 ==== QuestListener ==== 164 The QuestListener is the second device you can use to create side effects. But other than QuestEffects (that are executed (or invoked) eighter as a result of failing or completing a Quest or by a QuestEffectBeacon) QuestListeners are passive. QuestListeners have a certain mode (all, start, complete or fail) and a Quest to which they belong to (resp. to which they react). You then can use QuestListeners to make basically any object aware of when the status of the given Quest changes (the way you defined through the mode) and take any action you may think of.164 The QuestListener is the second device you can use to create side effects. But other than QuestEffects (that are executed (or invoked) eighter as a result of failing or completing a Quest or by a QuestEffectBeacon) QuestListeners are passive. QuestListeners have a certain mode (all, start, complete or fail) and a Quest to which they belong to (resp. to which they react). You then can use QuestListeners to make basically any object aware of when the status of the given Quest changes (the way you defined through the mode) and take any action you may think of. 165 165 166 166 {{{ … … 174 174 }}} 175 175 176 I hope this example has made the QuestListener a little clearer. The QuestListener actually reacts exactly as any Trigger or EventListener would (al lthough the QuestListener is really neighter the one nor the other) whcih means you can use it in exactly the same as you would use one of the above, it just reacts to a different thing. Namely to the change ina Quests status.176 I hope this example has made the QuestListener a little clearer. The QuestListener actually reacts exactly as any Trigger or EventListener would (although the QuestListener is really neighter the one nor the other) which means you can use it in exactly the same as you would use one of the above, it just reacts to a different thing. Namely to the change in a Quests status. 177 177 178 178 === Putting the Quests in the game world === … … 202 202 203 203 The QuestEffectBeacon can only be executed a defined number of times (where -1 times stands for an infinite number of times) and the QuestEffects are invoked whenever the method 'execute' is called, which is (indirectly through an EventListener, because I wanted to attach the PlayerTrigger so that his position is always relative to the QuestEffectBeacons position) done by the PlayerTrigger. 204 A PlayerTrigger is a special sort of Trigger that knows the player that triggered the Trigger and therefore can be asked who triggered him and that way allows the QuestEffects to be executed on the right player. So far only DistanceTrigger is a PlayerTrigger and the target of the DistanceTrigger is a ControllableEntity (or an object that is derived form the ControllableEntity).204 A PlayerTrigger is a special sort of Trigger that knows the player that triggered the Trigger and therefore can be asked who triggered him and that way allows the QuestEffects to be executed on the right player. So far only DistanceTrigger is a PlayerTrigger and the target of the DistanceTrigger is a ControllableEntity (or an object that is derived form the ControllableEntity). 205 205 206 206 == Example Quest == 207 To get your head around all of this and see some of the things mention d here in action you might want to check out the "The Tale Princess Aeryn"-Quest (Levelfile: princessaeryn.oxw) in the level-folder of the media repository.207 To get your head around all of this and see some of the things mentioned here in action you might want to check out the "The Tale Princess Aeryn"-Quest (Levelfile: princessaeryn.oxw) in the level-folder of the media repository.