Difference between revisions of "Quest Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>Jog
Line 19: Line 19:


== Member Functions ==
== Member Functions ==
*Function [[CompleteAllObjectives - Quest|CompleteAllObjectives]]()
'''Function [[CompleteAllObjectives - Quest|CompleteAllObjectives]]()'''
**Completes all a quests objectives.
*Completes all a quests objectives.
*Function [[CompleteQuest - Quest|CompleteQuest]]()
 
**Flags this quest as completed.
'''Function [[CompleteQuest - Quest|CompleteQuest]]()'''
*Function [[FailAllObjectives - Quest|FailAllObjectives]]()
*Flags this quest as completed.
**Flags all quest objects as failed.
 
*Alias Function [[GetAlias - Quest|GetAlias]](int aiAliasID)
'''Function [[FailAllObjectives - Quest|FailAllObjectives]]()'''
**Obtains the [[Alias Script|Alias]] attached to this quest associated with the specified ID.
*Flags all quest objects as failed.
*int Function [[GetCurrentStageID - Quest|GetCurrentStageID]]()
 
**Obtains the highest completed stage on this quest.
'''Alias Function [[GetAlias - Quest|GetAlias]](int aiAliasID)'''
*int Function [[GetCurrentStageID - Quest|GetStage]]()
*Obtains the [[Alias Script|Alias]] attached to this quest associated with the specified ID.
**Alias for GetCurrentStageID().
 
*bool Function [[IsStageDone - Quest|GetStageDone]](int aiStage)
'''int Function [[GetCurrentStageID - Quest|GetCurrentStageID]]()'''
**Alias for IsStageDone().
*Obtains the highest completed stage on this quest.
*bool Function [[IsActive - Quest|IsActive]]()
 
**Is this quest "active"? (Tracked by the player).
'''int Function [[GetCurrentStageID - Quest|GetStage]]()'''
*bool Function [[IsCompleted - Quest|IsCompleted]]()
*Alias for GetCurrentStageID().
**Returns whether this quest is completed or not.
 
*bool Function [[IsObjectiveCompleted - Quest|IsObjectiveCompleted]](int aiObjective)
'''bool Function [[IsStageDone - Quest|GetStageDone]](int aiStage)'''
**Obtains whether the specified objective is completed or not.
*Alias for IsStageDone().
*bool Function [[IsObjectiveDisplayed - Quest|IsObjectiveDisplayed]](int aiObjective)
 
**Obtains whether the specified objective is displayed or not.
'''bool Function [[IsActive - Quest|IsActive]]()'''
*bool Function [[IsObjectiveFailed - Quest|IsObjectiveFailed]](int aiObjective)
*Is this quest "active"? (Tracked by the player).
**Obtains whether the specified objective is failed or not.
 
*bool Function [[IsRunning - Quest|IsRunning]]()
'''bool Function [[IsCompleted - Quest|IsCompleted]]()'''
**Returns whether this quest is currently running or not.
*Returns whether this quest is completed or not.
*bool Function [[IsStageDone - Quest|IsStageDone]](int aiStage)
 
**Checks to see if the specified stage is done or not.
'''bool Function [[IsObjectiveCompleted - Quest|IsObjectiveCompleted]](int aiObjective)'''
*bool Function [[IsStarting - Quest|IsStarting]]()
*Obtains whether the specified objective is completed or not.
**Returns whether this quest is currently enabled but not running yet.
 
*bool Function [[IsStopping- Quest|IsStopping]]()
'''bool Function [[IsObjectiveDisplayed - Quest|IsObjectiveDisplayed]](int aiObjective)'''
**Returns whether this quest is currently not enabled anymore but still shutting down.
*Obtains whether the specified objective is displayed or not.
*bool Function [[IsStopped- Quest|IsStopped]]()
 
**Returns whether this quest is currently fully stopped.
'''bool Function [[IsObjectiveFailed - Quest|IsObjectiveFailed]](int aiObjective)'''
*bool Function [[ModObjectiveGlobal - Quest|ModObjectiveGlobal]](float afModValue, GlobalVariable aModGlobal, int aiObjectiveID, float afTargetValue, bool abCountingUp, bool abCompleteObjective, bool abRedisplayObjective)
*Obtains whether the specified objective is failed or not.
**Mods a global variable in a threadsafe way. Optional parameters allow automatic redisplay and completion (or failure) of a quest objective using this global variable.
 
*Function [[Reset - Quest|Reset]]()
'''bool Function [[IsRunning - Quest|IsRunning]]()'''
**Resets this quest.
*Returns whether this quest is currently running or not.
*Function [[SetActive - Quest|SetActive]](bool abActive)
 
**Sets or clears this quest as "active". (Tracked by the player)
'''bool Function [[IsStageDone - Quest|IsStageDone]](int aiStage)'''
*bool Function [[SetCurrentStageID - Quest|SetCurrentStageID]](int aiStageID)
*Checks to see if the specified stage is done or not.
**Sets the quest to the requested stage, returning true if it succeeded.
 
*Function [[SetObjectiveCompleted - Quest|SetObjectiveCompleted]](int aiObjective, bool abCompleted)
'''bool Function [[IsStarting - Quest|IsStarting]]()'''
**Sets whether the specified objective is completed or not.
*Returns whether this quest is currently enabled but not running yet.
*Function [[SetObjectiveDisplayed - Quest|SetObjectiveDisplayed]](int aiObjective, bool abDisplayed)
 
**Sets whether the specified objective is displayed or not.
'''bool Function [[IsStopping- Quest|IsStopping]]()'''
*Function [[SetObjectiveFailed - Quest|SetObjectiveFailed]](int aiObjective, bool abFailed)
*Returns whether this quest is currently not enabled anymore but still shutting down.
**Sets whether the specified objective is failed or not.
 
*bool Function [[SetCurrentStageID - Quest|SetStage]](int aiStage)
'''bool Function [[IsStopped- Quest|IsStopped]]()'''
**Alias of SetCurrentStageID().
*Returns whether this quest is currently fully stopped.
*bool Function [[Start - Quest|Start]]()
 
**Starts this quest.
'''bool Function [[ModObjectiveGlobal - Quest|ModObjectiveGlobal]](float afModValue, GlobalVariable aModGlobal, int aiObjectiveID, float afTargetValue, bool abCountingUp, bool abCompleteObjective, bool abRedisplayObjective)'''
*Function [[Stop - Quest|Stop]]()
*Mods a global variable in a threadsafe way. Optional parameters allow automatic redisplay and completion (or failure) of a quest objective using this global variable.
**Stops the quest.
 
*bool Function [[UpdateCurrentInstanceGlobal - Quest|UpdateCurrentInstanceGlobal]](GlobalVariable aUpdateGlobal)
'''Function [[Reset - Quest|Reset]]()'''
**Updates the value for the given global for the quest's current instance.
*Resets this quest.
 
'''Function [[SetActive - Quest|SetActive]](bool abActive)'''
*Sets or clears this quest as "active". (Tracked by the player)
 
'''bool Function [[SetCurrentStageID - Quest|SetCurrentStageID]](int aiStageID)'''
*Sets the quest to the requested stage, returning true if it succeeded.
 
'''Function [[SetObjectiveCompleted - Quest|SetObjectiveCompleted]](int aiObjective, bool abCompleted)'''
*Sets whether the specified objective is completed or not.
 
'''Function [[SetObjectiveDisplayed - Quest|SetObjectiveDisplayed]](int aiObjective, bool abDisplayed)'''
*Sets whether the specified objective is displayed or not.
 
'''Function [[SetObjectiveFailed - Quest|SetObjectiveFailed]](int aiObjective, bool abFailed)'''
*Sets whether the specified objective is failed or not.
 
'''bool Function [[SetCurrentStageID - Quest|SetStage]](int aiStage)'''
*Alias of SetCurrentStageID().
 
'''bool Function [[Start - Quest|Start]]()'''
*Starts this quest.
 
'''Function [[Stop - Quest|Stop]]()'''
*Stops the quest.
 
'''bool Function [[UpdateCurrentInstanceGlobal - Quest|UpdateCurrentInstanceGlobal]](GlobalVariable aUpdateGlobal)'''
*Updates the value for the given global for the quest's current instance.


== Events ==
== Events ==

Revision as of 12:58, 20 February 2012


Extends: Form Script

Script for the manipulation of quests.

Definition

ScriptName Quest extends Form

Properties

None

Global Functions

None

Member Functions

Function CompleteAllObjectives()

  • Completes all a quests objectives.

Function CompleteQuest()

  • Flags this quest as completed.

Function FailAllObjectives()

  • Flags all quest objects as failed.

Alias Function GetAlias(int aiAliasID)

  • Obtains the Alias attached to this quest associated with the specified ID.

int Function GetCurrentStageID()

  • Obtains the highest completed stage on this quest.

int Function GetStage()

  • Alias for GetCurrentStageID().

bool Function GetStageDone(int aiStage)

  • Alias for IsStageDone().

bool Function IsActive()

  • Is this quest "active"? (Tracked by the player).

bool Function IsCompleted()

  • Returns whether this quest is completed or not.

bool Function IsObjectiveCompleted(int aiObjective)

  • Obtains whether the specified objective is completed or not.

bool Function IsObjectiveDisplayed(int aiObjective)

  • Obtains whether the specified objective is displayed or not.

bool Function IsObjectiveFailed(int aiObjective)

  • Obtains whether the specified objective is failed or not.

bool Function IsRunning()

  • Returns whether this quest is currently running or not.

bool Function IsStageDone(int aiStage)

  • Checks to see if the specified stage is done or not.

bool Function IsStarting()

  • Returns whether this quest is currently enabled but not running yet.

bool Function IsStopping()

  • Returns whether this quest is currently not enabled anymore but still shutting down.

bool Function IsStopped()

  • Returns whether this quest is currently fully stopped.

bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID, float afTargetValue, bool abCountingUp, bool abCompleteObjective, bool abRedisplayObjective)

  • Mods a global variable in a threadsafe way. Optional parameters allow automatic redisplay and completion (or failure) of a quest objective using this global variable.

Function Reset()

  • Resets this quest.

Function SetActive(bool abActive)

  • Sets or clears this quest as "active". (Tracked by the player)

bool Function SetCurrentStageID(int aiStageID)

  • Sets the quest to the requested stage, returning true if it succeeded.

Function SetObjectiveCompleted(int aiObjective, bool abCompleted)

  • Sets whether the specified objective is completed or not.

Function SetObjectiveDisplayed(int aiObjective, bool abDisplayed)

  • Sets whether the specified objective is displayed or not.

Function SetObjectiveFailed(int aiObjective, bool abFailed)

  • Sets whether the specified objective is failed or not.

bool Function SetStage(int aiStage)

  • Alias of SetCurrentStageID().

bool Function Start()

  • Starts this quest.

Function Stop()

  • Stops the quest.

bool Function UpdateCurrentInstanceGlobal(GlobalVariable aUpdateGlobal)

  • Updates the value for the given global for the quest's current instance.

Events

  • Event OnReset()
    • Event received when this quest is started up (either the first time or subsequent times - this will fire in parallel with your startup stage!).

These events are fired in parallel with the quest's startup stage, and are only fired if this quest is started by a story manager event.

  • Event OnStoryActivateActor(Location akLocation, ObjectReference akActor)
    • Sent when this quest is started by an activate actor story manager event.
  • Event OnStoryAddToPlayer(ObjectReference akOwner, ObjectReference akContainer, Location akLocation, Form akItemBase, int aiAcquireType)
    • Sent when this quest is started by an add to player story manager event.
  • Event OnStoryArrest(ObjectReference akArrestingGuard, ObjectReference akCriminal, Location akLocation, int aiCrime)
    • Sent when this quest is started by an arrest story manager event.
  • Event OnStoryAssaultActor(ObjectReference akVictim, ObjectReference akAttacker, Location akLocation, int aiCrime)
    • Sent when this quest is started by an assault actor story manager event.
  • Event OnStoryBribeNPC(ObjectReference akActor)
    • Sent when this quest is started by a bribe NPC story manager event.
  • Event OnStoryCastMagic(ObjectReference akCastingActor, ObjectReference akSpellTarget, Location akLocation, Form akSpell)
    • Sent when this quest is started by a cast magic story manager event.
  • Event OnStoryChangeLocation(ObjectReference akActor, Location akOldLocation, Location akNewLocation)
    • Sent when this quest is started by a change location story manager event.
  • Event OnStoryCraftItem(ObjectReference akBench, Location akLocation, Form akCreatedItem)
    • Sent when this quest is started by a craft item story manager event.
  • Event OnStoryCrimeGold(ObjectReference akVictim, ObjectReference akCriminal, Faction akFaction, int aiGoldAmount, int aiCrime)
    • Sent when this quest is started by a crime gold story manager event.
  • Event OnStoryCure(Form akInfection)
    • Sent when this quest is started by a cure story manager event.
  • Event OnStoryDialogue(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)
    • Sent when this quest is started by a dialogue story manager event.
  • Event OnStoryDiscoverDeadBody(ObjectReference akActor, ObjectReference akDeadActor, Location akLocation)
    • Sent when this quest is started by a discover dead body story manager event.
  • Event OnStoryEscapeJail(Location akLocation, Form akCrimeGroup)
    • Sent when this quest is started by an escape jail story manager event.
  • Event OnStoryFlatterNPC(ObjectReference akActor)
    • Sent when this quest is started by a flatter NPC story manager event.
  • Event OnStoryHello(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)
    • Sent when this quest is started by a hello story manager event.
  • Event OnStoryIncreaseLevel(int aiNewLevel)
    • Sent when this quest is started by an increase level story manager event.
  • Event OnStoryIncreaseSkill(string asSkill)
    • Sent when this quest is started by an increase skill story manager event.
  • Event OnStoryInfection(ObjectReference akTransmittingActor, Form akInfection)
    • Sent when this quest is started by an infection story manager event.
  • Event OnStoryIntimidateNPC(ObjectReference akActor)
    • Sent when this quest is started by an intimidate NPC story manager event.
  • Event OnStoryJail(ObjectReference akGuard, Form akCrimeGroup, Location akLocation, int aiCrimeGold)
    • Sent when this quest is started by a jail story manager event.
  • Event OnStoryKillActor(ObjectReference akVictim, ObjectReference akKiller, Location akLocation, int aiCrimeStatus, int aiRelationshipRank)
    • Sent when this quest is started by a kill actor story manager event.
  • Event OnStoryNewVoicePower(ObjectReference akActor, Form akVoicePower)
    • Sent when this quest is started by a new voice power story manager event.
  • Event OnStoryPickLock(ObjectReference akActor, ObjectReference akLock)
    • Sent when this quest is started by a pick lock story manager event.
  • Event OnStoryPayFine(ObjectReference akCriminal, ObjectReference akGuard, Form akCrimeGroup, int aiCrimeGold)
    • Sent when this quest is started by a pay fine story manager event.
  • Event OnStoryPlayerGetsFavor(ObjectReference akActor)
    • Sent when this quest is started by a player gets favor story manager event.
  • Event OnStoryRelationshipChange(ObjectReference akActor1, ObjectReference akActor2, int aiOldRelationship, int aiNewRelationship)
    • Sent when this quest is started by a relationship change story manager event.
  • Event OnStoryRemoveFromPlayer(ObjectReference akOwner, ObjectReference akItem, Location akLocation, Form akItembase, int aiRemoveType)
    • Sent when this quest is started by a remove from player story manager event.
  • Event OnStoryScript(Keyword akKeyword, Location akLocation, ObjectReference akRef1, ObjectReference akRef2, int aiValue1, int aiValue2)
    • Sent when this quest is started by a script story manager event.
  • Event OnStoryServedTime(Location akLocation, Form akCrimeGroup, int aiCrimeGold, int aiDaysJail)
    • Sent when this quest is started by a served time story manager event.
  • Event OnStoryTrespass(ObjectReference akVictim, ObjectReference akTrespasser, Location akLocation, int aiCrime)
    • Sent when this quest is started by a trespass story manager event.

Related Fragments