Jump to content

[LE] Retrieve the key quest


Recommended Posts

So I'm putting together a very simple quest to go along with a player home I've made. The quest is as simple as retrieve the key to the house and then visit the house. I've read through the ck tutorials for setting up the quest, but I'm a little confused on how I should apply the tutorial to my own quest.

 

The breakdown of the quest is as follows:

1.The player finds and reads one of several notes scattered around the world space.

2.After reading the note, the player is directed towards the location of the key.

3.The player finds the key and retrieves it.

4.The player is then told to visit the house.

5.Upon entering the house, the quest is complete.

 

I know I need scripts and aliases, but I'm not sure to which objects they should be applied to.

 

Do I add a script to the notes, key, and house? And would these also be the aliases?

I'm pretty sure the tutorial has a script I can use for when the player adds the key to their inventory, but I have no idea what the other scripts would be.

 

Any help would be appreciated, but if you could provide the scripts to make this quest work, that would be amazing.

 

Thanks!

 

Link to comment
Share on other sites

If you follow the My First Quest tutorial on the CK wiki it is a basic go and fetch quest which is what you are trying to do. It will give you a basic understanding of how a quest progresses, how to set objectives and the different stages of your quest as well as an idea as to the basic script fragments needed to advance a quest.

Link to comment
Share on other sites

So I'm putting together a very simple quest to go along with a player home I've made. The quest is as simple as retrieve the key to the house and then visit the house. I've read through the ck tutorials for setting up the quest, but I'm a little confused on how I should apply the tutorial to my own quest.

 

The breakdown of the quest is as follows:

1.The player finds and reads one of several notes scattered around the world space.

2.After reading the note, the player is directed towards the location of the key.

3.The player finds the key and retrieves it.

4.The player is then told to visit the house.

5.Upon entering the house, the quest is complete.

 

I know I need scripts and aliases, but I'm not sure to which objects they should be applied to.

 

Do I add a script to the notes, key, and house? And would these also be the aliases?

I'm pretty sure the tutorial has a script I can use for when the player adds the key to their inventory, but I have no idea what the other scripts would be.

 

Any help would be appreciated, but if you could provide the scripts to make this quest work, that would be amazing.

 

Thanks!

 

I assume your breakdown is the essential of this quest? This works fine without any scripting. Simply place the notes, write down the needed information into the notes that direct the player to the key and into the house. If you need a starting point that informs the player about where to search for information, create a start enabled quest with a log entry, that informs the player. But there are more possibilities to get information to the player: You could create a courier or another npc that has a force greet package and delivers the information with dialog. Look into other mods that do the same. It's the best way to learn.

Link to comment
Share on other sites

I've never been able to get OnRead commands to work with books or notes, but I think that's probably operator error. I normally go for an "OnContainerChanged" script, which you will need for the key and could make work for the note. You need to outline your quest in the creation kit, but it would probably be something like:

 

0- Hasn't started

10- Read/Pick up note (Quest Start and go find the key)

20- Key is in inventory, find house

30 - Enter the house and quest complete

 

You would need alias on:

-The key

-The house (Or a triggerbox inside the house, which I'll get to in a minute)

 

At stage

 

At stage 10 your quest objective is the key, so you would need that alias

At stage 20 your quest objective is the house/triggerbox

 

As for the scripts, on the key for example. You would open your key in the object window and click on the scripts tab. Add a new script and call it "MyScriptAdvanceQuestOnContChange"

You need two properties, so click the properties button.

-First is a quest, and name it the editor ID of your quest

-Second is an Int, and name it "QuestStage", then select the quest stage you want you to advance to when you pick up the key (20)

Your actual script would be:

 

[script Name]

 

[Your two properties that you created]

 

EventOnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)

if (newContainer == Game.GetPlayer())

[Name of your quest].SetStage(QuestStage)

Endif

EndEvent

 

The things in brackets will be there based on your name and properties. And you can re-use the script on the note if you want to just change the Int property to 10 when you add the script. The easiest way to do the script when you enter the house would probably be to add a triggerbox that activates when the player enters.

 

Click on something in the house and click the little [T] button to create a triggerbox. You want DefaultActivateSelfTrigger. Resize the triggerbox and stick it in front of the door (but a few steps away from the entrance marker).

 

Like last time, add a script. With the Quest and Int properties of your quest's name and "QuestStage". The Int property value this time is 30. The script is:

 

[script Name]

 

[Your Two Properties]

 

Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
[Name of your quest].SetStage(QuestStage)
Endif
EndEvent

 

And that should do it. There's an onRead script somewhere the in Creation Kit Wiki if you really want the note to have to be read, but OnContainerChanged has always worked better for me.

Link to comment
Share on other sites

I've never been able to get OnRead commands to work with books or notes, but I think that's probably operator error. I normally go for an "OnContainerChanged" script, which you will need for the key and could make work for the note. You need to outline your quest in the creation kit, but it would probably be something like:

 

0- Hasn't started

10- Read/Pick up note (Quest Start and go find the key)

20- Key is in inventory, find house

30 - Enter the house and quest complete

 

You would need alias on:

-The key

-The house (Or a triggerbox inside the house, which I'll get to in a minute)

 

At stage

 

At stage 10 your quest objective is the key, so you would need that alias

At stage 20 your quest objective is the house/triggerbox

 

As for the scripts, on the key for example. You would open your key in the object window and click on the scripts tab. Add a new script and call it "MyScriptAdvanceQuestOnContChange"

You need two properties, so click the properties button.

-First is a quest, and name it the editor ID of your quest

-Second is an Int, and name it "QuestStage", then select the quest stage you want you to advance to when you pick up the key (20)

Your actual script would be:

 

[script Name]

 

[Your two properties that you created]

 

EventOnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)

if (newContainer == Game.GetPlayer())

[Name of your quest].SetStage(QuestStage)

Endif

EndEvent

 

The things in brackets will be there based on your name and properties. And you can re-use the script on the note if you want to just change the Int property to 10 when you add the script. The easiest way to do the script when you enter the house would probably be to add a triggerbox that activates when the player enters.

 

Click on something in the house and click the little [T] button to create a triggerbox. You want DefaultActivateSelfTrigger. Resize the triggerbox and stick it in front of the door (but a few steps away from the entrance marker).

 

Like last time, add a script. With the Quest and Int properties of your quest's name and "QuestStage". The Int property value this time is 30. The script is:

 

[script Name]

 

[Your Two Properties]

 

Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
[Name of your quest].SetStage(QuestStage)
Endif
EndEvent

 

And that should do it. There's an onRead script somewhere the in Creation Kit Wiki if you really want the note to have to be read, but OnContainerChanged has always worked better for me.

Exactly the sort of help I was hoping for! Thank you, Sparky! I'll give her a go and see how it goes.

 

Edit: Ok, I've set up the scripts for the key and the notes, but I'm having trouble getting the script for the trigger box to work right. I have it entered as follows:

 

Quest Property ISMQuest Auto

 

Int Property QuestStage = 30 Auto

 

Event OnTriggerEnter(ObjectReference akActionRef)

If ( akActionRef == Game.GetPlayer())

001ISMQuest.SetObjectiveDisplayed(30)

001ISMQuest.SetStage(30)

Endif

EndEvent

 

I originally entered the script exactly as you had listed, but it did not compile correctly. So I entered some extra pieces that some of the tutorial scripts had to try and fix it. I failed.

 

Can anyone else spot the problem?

Edited by KiokothePirate
Link to comment
Share on other sites

 

So I'm putting together a very simple quest to go along with a player home I've made. The quest is as simple as retrieve the key to the house and then visit the house. I've read through the ck tutorials for setting up the quest, but I'm a little confused on how I should apply the tutorial to my own quest.

 

The breakdown of the quest is as follows:

1.The player finds and reads one of several notes scattered around the world space.

2.After reading the note, the player is directed towards the location of the key.

3.The player finds the key and retrieves it.

4.The player is then told to visit the house.

5.Upon entering the house, the quest is complete.

 

I know I need scripts and aliases, but I'm not sure to which objects they should be applied to.

 

Do I add a script to the notes, key, and house? And would these also be the aliases?

I'm pretty sure the tutorial has a script I can use for when the player adds the key to their inventory, but I have no idea what the other scripts would be.

 

Any help would be appreciated, but if you could provide the scripts to make this quest work, that would be amazing.

 

Thanks!

 

I assume your breakdown is the essential of this quest? This works fine without any scripting. Simply place the notes, write down the needed information into the notes that direct the player to the key and into the house. If you need a starting point that informs the player about where to search for information, create a start enabled quest with a log entry, that informs the player. But there are more possibilities to get information to the player: You could create a courier or another npc that has a force greet package and delivers the information with dialog. Look into other mods that do the same. It's the best way to learn.

 

That is true. I could just use the notes to direct them to the location, but I also want to use this mod as a learning experience, both for building structures and quests.

Link to comment
Share on other sites

I've never been able to get OnRead commands to work with books or notes, but I think that's probably operator error. I normally go for an "OnContainerChanged" script, which you will need for the key and could make work for the note. You need to outline your quest in the creation kit, but it would probably be something like:

 

0- Hasn't started

10- Read/Pick up note (Quest Start and go find the key)

20- Key is in inventory, find house

30 - Enter the house and quest complete

 

You would need alias on:

-The key

-The house (Or a triggerbox inside the house, which I'll get to in a minute)

 

At stage

 

At stage 10 your quest objective is the key, so you would need that alias

At stage 20 your quest objective is the house/triggerbox

 

As for the scripts, on the key for example. You would open your key in the object window and click on the scripts tab. Add a new script and call it "MyScriptAdvanceQuestOnContChange"

You need two properties, so click the properties button.

-First is a quest, and name it the editor ID of your quest

-Second is an Int, and name it "QuestStage", then select the quest stage you want you to advance to when you pick up the key (20)

Your actual script would be:

 

[script Name]

 

[Your two properties that you created]

 

EventOnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)

if (newContainer == Game.GetPlayer())

[Name of your quest].SetStage(QuestStage)

Endif

EndEvent

 

The things in brackets will be there based on your name and properties. And you can re-use the script on the note if you want to just change the Int property to 10 when you add the script. The easiest way to do the script when you enter the house would probably be to add a triggerbox that activates when the player enters.

 

Click on something in the house and click the little [T] button to create a triggerbox. You want DefaultActivateSelfTrigger. Resize the triggerbox and stick it in front of the door (but a few steps away from the entrance marker).

 

Like last time, add a script. With the Quest and Int properties of your quest's name and "QuestStage". The Int property value this time is 30. The script is:

 

[script Name]

 

[Your Two Properties]

 

Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
[Name of your quest].SetStage(QuestStage)
Endif
EndEvent

 

And that should do it. There's an onRead script somewhere the in Creation Kit Wiki if you really want the note to have to be read, but OnContainerChanged has always worked better for me.

It looks like your property name may be named slightly off. You have your quest property named as "ISM Quest" but in the script you refer to it as "001ISMQuest". The program may not know what you're referring to when it tries to get that reference. On the "Properties" tab of your script make sure you have your quest selected as the quest property. You may need to go in and select it with the pull down menu.

 

After that, in your actual script, you need the quest commands to match the property name. So it should look like:

 

Quest Property ISMQuest Auto

 

Int Property QuestStage = 30 Auto

 

Event OnTriggerEnter(ObjectReference akActionRef)

If ( akActionRef == Game.GetPlayer())

ISMQuest.SetObjectiveDisplayed(30)

ISMQuest.SetStage(30)

Endif

EndEvent

 

And if that doesn't work can you post the compiler error? It would help to know what lines the problem is on.

Link to comment
Share on other sites

I got the script working! I'm putting together the aliases now and I think I missed one detail when describing the quest. The key is located in the inventory of a dead NPC. So I would need an alias for the NPC, correct?

 

Secondly, when making the alias for the trigger box, would that be a new location alias or just a reference alias?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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