Complete Example Scripts: Difference between revisions
Jump to navigation
Jump to search
→SetStage When Picked Up By Player: Added a new script that might come in useful in some general situations
imported>Evernewjoy |
imported>Cipscis (→SetStage When Picked Up By Player: Added a new script that might come in useful in some general situations) |
||
| Line 161: | Line 161: | ||
To extract files from the Skyirm .BSA files you must download something like the Fallout3 Archive Utility, do a google search for this. | To extract files from the Skyirm .BSA files you must download something like the Fallout3 Archive Utility, do a google search for this. | ||
===SetStage When Picked Up By Player=== | |||
<source lang="papyrus">ScriptName SetStageOnPlayerPickUp extends ObjectReference | |||
Quest property QuestToSet auto | |||
int property StageToSet auto | |||
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) | |||
if (akNewContainer == Game.GetPlayer()) | |||
QuestToSet.SetStage(StageToSet) | |||
GoToState("Taken") | |||
endif | |||
EndEvent | |||
State Taken | |||
; Do nothing | |||
EndState | |||
</source> | |||
====To Make This Script Work==== | |||
This script should be attached to an item that the player has to pick up as part of a quest. When the player picks up the item for the first time, the quest's stage it set to a value specified by a parameter. | |||
* Create an item for the player to pick up, and attach this script to that item | |||
* In the dialogue window for that item, right click on this script and select "Edit Properties". You need to specify: | |||
** The associated quest (QuestToSet) | |||
** The stage at which the quest should be set (StageToSet) | |||
* Then just place your item in the world. When the player picks it up, the quest you specified will be set to the stage you specified. | |||