Jump to content

A Script to begin quest by entering a cell


antstubell

Recommended Posts

Depending on the way you want the message to display, the script will change.

 

- Create a new global variable, wich will be the counter for the weapons

 

- Put this script on every weapon

 

GlobalVariable property WeaponCount auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

Fill the properties accordingly, put it on all the weapons and test it. There's no message for now until you tell me what type of message you want. So when testing you have to get the global value via console.

 

Type of message are:

- message box ---> pop up message which stops the game

- notification ---> message on the top right (like when you receive gold etc.)

- objective ---> showing a completed objective out of thin air, without it being displayed before.

In the WeaponCount property the name of the weapon does not appear in the drop down menu.

Link to comment
Share on other sites

Find the GlobalVariable objects in the object window.

 

Simply create a new one following this http://www.creationkit.com/Global

 

Only things you need are "initial value" 0, type float and the name.

 

EDIT: and "constant" unchecked.

Ok made the Global called SEW02Global (just for reference in this reply)

In properties for the script on each weapon are:

 

myquest SEW02

preReqStage 10 (I used 10 because that's when quest begins and the popup "Find weapons" appears)

StageToSet 20 (the popup will be "You've found a weapon"). I used stage 20 for all the weapons.

GlobalVariable SEW02Global

 

Done all that, what is it you need me to do in the console in game? Sorry to keep asking but if there were decent tutorials I would happily learn EVERYTHING!

Link to comment
Share on other sites

Ok so the stage 20 will be the completion of the quest. Mark it as "complete quest" and make it complete the initial objective (find weapons). No other objectives

 

Now, if you want different type of pop ups when you pick up a weapon:

 

- pop up message

 

 

GlobalVariable property WeaponCount auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        Debug.MessageBox("You've found a weapon")
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

- notification

 

 

GlobalVariable property WeaponCount auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        Debug.Notification("You've found a weapon")
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

- Objective

 

 

GlobalVariable property WeaponCount auto

Int property Objective auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        myQuest.SetObjectiveCompleted(Objective)
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

For the last one, you can make 3 different objective showing up different names. Just fill the new "Objective" property with the correct index number.

 

To test it write "GetGlobalValue Sew02Global". It should return 1 after the 1st pickup, 2 after the 2nd and then you'd see the "find weapon" objective completed with the quest.

 

EDIT: You DON'T need to call a stage everytime you pickup. The stage is called only when you reach counter 3. So your stage 20 will be called the last time you pickup a weapon and thus complete the quest.

Edited by gasti89
Link to comment
Share on other sites

 

Compiling failed. Here's the script I inputed. cell's name is skinnermineint01 and quest bane is SEW02

 

....................................

if (SEW02.GetStage) = 0

.....................................

 

Should be:

 

if (SEW02.GetStage) == 0

Link to comment
Share on other sites

Ok so the stage 20 will be the completion of the quest. Mark it as "complete quest" and make it complete the initial objective (find weapons). No other objectives

 

Now, if you want different type of pop ups when you pick up a weapon:

 

- pop up message

 

 

GlobalVariable property WeaponCount auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        Debug.MessageBox("You've found a weapon")
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

- notification

 

 

GlobalVariable property WeaponCount auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        Debug.Notification("You've found a weapon")
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

- Objective

 

 

GlobalVariable property WeaponCount auto

Int property Objective auto

Quest property myQuest auto

Int property preReqStage auto

Int property StageToSet auto

Auto State Ready

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 if myQuest.GetStage() == preReqStage   
    if akNewContainer == Game.GetPlayer()
        WeaponCount.Mod(1)
        myQuest.SetObjectiveCompleted(Objective)
        if WeaponCount.GetValue() == 3
            myQuest.SetStage(StageToSet)
        endif
        GoToState("Picked")
    endif
 endif
EndEvent

EndState

State Picked
EndState    

 

 

For the last one, you can make 3 different objective showing up different names. Just fill the new "Objective" property with the correct index number.

 

To test it write "GetGlobalValue Sew02Global". It should return 1 after the 1st pickup, 2 after the 2nd and then you'd see the "find weapon" objective completed with the quest.

 

EDIT: You DON'T need to call a stage everytime you pickup. The stage is called only when you reach counter 3. So your stage 20 will be called the last time you pickup a weapon and thus complete the quest.

So to what do I attach each script? In the line WeaponCount.Mod(1) do I leave it as it is or does "Mod" require me to make a change?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...