Jump to content
⚠ Known Issue: Media on User Profiles ×

Simple question regarding xMarkers and Quest awareness


aluckymuse

Recommended Posts

Ok so, here's the deal, I'm new to modeling and basically I want to know how to make my new mod (a player home) quest aware.

 

From my basic understanding of mucking around in the CK, this can be done with linking objects to specific xmarkers and using the checkbox "set enable state to opposite of parent". And that worked fine on my previous DB mod when I used the xmarkers in the given cell to add more to the garden and whatnot. But now I have a new mod with a new cell and I'm trying to make it all fancy and quest aware, knowing xmarkers are the key I looked the ones over in the DB cell but they all don't list having anything attached or referencing them and they all looked the same....except for their reference editor id which i assume is what some other part of the creation kit connects the xmarker to the quest.

 

 

So my question: Do you have any tutorial links on this subject OR how do I make a new xmarker in my new cell associate with a quest aka [ Joining the Legion (CW01A) stage 200 ] so that I may use it to toggle some fancypants object?

Link to comment
Share on other sites

Option 1:

Take an immovable or hidden object (can be another xmarker) in the cell that will be enabled by default. Give it a script. On that script it will use OnInit() to register for a single update. The OnUpdate() would check for the quest stage to be set or greater. If it is set or greater then you assign a local bool variable to true. If it isn't set or greater you re-register the single update and check later. Once true, use OnCellAttach() to have the script enable or disable the xmarkers as needed.

 

Option 2:

Similar to option 1 however the script is on the player alias of a dummy quest and instead of using OnCellAttach() it just enables or disables the xmarkers as necessary when the quest stage is found to be set or greater in the OnUpdate() event.

 

Option 3:

Edit the quest in question directly and apply the enable or disable command as needed within the appropriate fragment section.

 

 

Please note that option 3 is highly likely to be most incompatible with other mods. Its only included for "completeness sake". There may also be other methods that I'm not aware of.

Link to comment
Share on other sites

Option 1:

Take an immovable or hidden object (can be another xmarker) in the cell that will be enabled by default. Give it a script. On that script it will use OnInit() to register for a single update. The OnUpdate() would check for the quest stage to be set or greater. If it is set or greater then you assign a local bool variable to true. If it isn't set or greater you re-register the single update and check later. Once true, use OnCellAttach() to have the script enable or disable the xmarkers as needed.

 

Option 2:

Similar to option 1 however the script is on the player alias of a dummy quest and instead of using OnCellAttach() it just enables or disables the xmarkers as necessary when the quest stage is found to be set or greater in the OnUpdate() event.

 

Option 3:

Edit the quest in question directly and apply the enable or disable command as needed within the appropriate fragment section.

 

 

Please note that option 3 is highly likely to be most incompatible with other mods. Its only included for "completeness sake". There may also be other methods that I'm not aware of.

 

 

Ok this gives me a good starting point....even though these concepts kinda go over my head as I haven't done much scripting- so any tutorial links would be useful.

If I am understanding this correctly, this means that vanilla xmarkers, such as the DB ones in the dawnstar sanctuary for example, use option three and were written into the quest?

 

 

EDIT: I would still very much like to use vanilla assets whenever possible, so since I'm just trying to reference basic quest points, like joining guilds and other such things, are there not references that are prewritten that I can "borrow" such as copying the dawnstar xmarker and using it as an enable marker for the home's trapdoor to the sanctuary? If that can be done is there a way I can reference other guilds and things, I would need to know the correct reference ID's inorder to name the xmarkers correctly.

Edited by mysticentity
Link to comment
Share on other sites

I'll use an example I know. Breezehome.

 

Breezehome is empty when bought. It has multiple xmarkers that link various items. These xmarkers are initially disabled with the empty house state assests set as opposite to the xmarker while the full house assests are set to be the same as the xmarker. When a room is purchased via dialog, the papyrus fragment on the dialog quest tells that particular xmarker to become enabled thus disabling the empty house state assests and enabling the full house state assests.

 

Most Breezehome mods edit the placed objects directly and link to the existing xmarkers. Which is why you cannot have many Breezehome mods at the same time. If an author performed a workaround route instead (see option 1 or 2 above) the only conflict would be the actual "physical" location of the object. It would conflict only with those other mods which put something in that spot.

 

Quests like the DB one you are talking about would be done very much the same way. When conditions are right and the quest stage is met & set the papyrus fragment for the quest tells the xmarker to enable or disable.

 

Now if there are existing xmarkers that are triggered at the exact same time you may be able to hook your stuff onto that xmarker or hook your xmarker to it. The conflict then would only be within that cell and the usage of that xmarker. The quest itself would be unaffected. But I would recommend NOT using stock assests due to the fact that many times after a mod has been removed those modified stock assests do not always want to revert to the original status until a new game is started. Rule of thumb is.... Once in the save, that's how it wants to stay.

 

This is the only "tutorial link" that anyone could really give you for Papyrus. Every script is different and can be built in multiple ways and therefore impossible to give a tutorial. That tho is not to say that tutorials do not exist for utilizing existing scripts or pre-built mod scripts within the CK itself.

Link to comment
Share on other sites

I'll use an example I know. Breezehome.

 

Breezehome is empty when bought. It has multiple xmarkers that link various items. These xmarkers are initially disabled with the empty house state assests set as opposite to the xmarker while the full house assests are set to be the same as the xmarker. When a room is purchased via dialog, the papyrus fragment on the dialog quest tells that particular xmarker to become enabled thus disabling the empty house state assests and enabling the full house state assests.

 

Most Breezehome mods edit the placed objects directly and link to the existing xmarkers. Which is why you cannot have many Breezehome mods at the same time. If an author performed a workaround route instead (see option 1 or 2 above) the only conflict would be the actual "physical" location of the object. It would conflict only with those other mods which put something in that spot.

 

Quests like the DB one you are talking about would be done very much the same way. When conditions are right and the quest stage is met & set the papyrus fragment for the quest tells the xmarker to enable or disable.

 

Now if there are existing xmarkers that are triggered at the exact same time you may be able to hook your stuff onto that xmarker or hook your xmarker to it. The conflict then would only be within that cell and the usage of that xmarker. The quest itself would be unaffected. But I would recommend NOT using stock assests due to the fact that many times after a mod has been removed those modified stock assests do not always want to revert to the original status until a new game is started. Rule of thumb is.... Once in the save, that's how it wants to stay.

 

This is the only "tutorial link" that anyone could really give you for Papyrus. Every script is different and can be built in multiple ways and therefore impossible to give a tutorial. That tho is not to say that tutorials do not exist for utilizing existing scripts or pre-built mod scripts within the CK itself.

 

 

Thanks for explaining! I understand now, this is great :D

Although I'm going to look at the tutorial to papyrus language just because I should to expand my knowledge it occurs to me that shouldn't there be pre-build scripts for this since Skyrim utilizes markers in this fashion all the time? If they were going to build another DLC and place xmarkers to disable and enable objects it would be way to time consuming to write out a papyrus fragment each time right?

Link to comment
Share on other sites

There aren't exactly pre-built scripts that you can just use. While you could in some situations get by with using an existing script, most situations will require a script that is tailormade for that specific situation.

 

You can use the existing mining script on a custom made ore vein that gives out salt rocks instead of iron ore. That's a simple property assignment setting on the script. And is what Hearthfire did with clay pits and quarry stone.

 

Quests, dialog and even AI behaviors are handled with fragments of a Papyrus script that are designed to work with only that particular form. These you can't just borrow or use on another quest or form. You can change them to do something else or add something to what they do. (see option 3 posted earlier)

 

Think of it in these terms and it might help. You've got a bucket of legos. Inside are instructions on how to make a car, a boat and an airplane. But you want a dinosaur. The blocks are there you just have to decide how to put them together to achieve what you want.

 

Papyrus is a collection of pre-defined events and functions stored on a series of base scripts. You create a specific script which calls upon these events and functions to do the things you want done.

 

This is a quick example of a script placed on a dummy quest. Its sole purpose is to check for a specific stage of a quest or if that quest is completed. When that happens it sets a global variable which is used by another script located on the player alias of the same dummy quest.

 

Scriptname abIM_FullSaveQuestScript extends Quest

Quest property MQ101 Auto
GlobalVariable Property abIM_FullSaveToggle auto

Event OnInit()
RegisterForSingleUpdate(5)
EndEvent

Event OnUpdate()
If MQ101.GetStageDone(240) || MQ101.GetStageDone(1000)
	Debug.Notification("Initiating Isharas Full Normal Numbered Autosaves")
	abIM_FullSaveToggle.SetValueInt(1)
Else
	RegisterForSingleUpdate(5)
EndIf
EndEvent

The relevance here is that it shows you how you can check for the stages of a quest in a script not tied to that quest and accomplish something that is unrelated to the quest.

Link to comment
Share on other sites

OK...you've been wonderful, but, I do have just one more aspect of this I need to get straight in my head.

If what I'm trying to do is handled with fragments of a Papyrus script...then how come when I fire up the CK and look at vanilla xmarkers that are used for this purpose they don't list any scripts attached to them? Is it just the reference editor id of the xmarker that's important? Using your example if I were to make the reference editor id of an xmarker "abIM_FullSaveToggle" would it work? If not how come the vanilla xmarkers function without any listed attached scripts?

Link to comment
Share on other sites

In my example, no, giving an xmarker the same name as the global variable would not work. There would have to be changes to the code so that it can work with an actual object rather than a variable. However, you are correct that it is the reference ID which is the tie-in between scripts that do not reside on the object and the object itself.

 

The property on the script or script fragment is assigned the specific xmarker or other object. If it is given the same name in the script as it has on the xmarker or object then it will auto-fill. Otherwise the property is manually assigned via the CK. While it seems that it is the xmarker that is doing the job, it is actually a script that is telling the xmarker what to do.

 

 

Hope that helps a little.

Link to comment
Share on other sites

Alright, I think I have enough of a base to start experimenting and figuring out how to build a working script for this. Oh- would it be better to just bundle it all up into one big script or a bunch of small fragments that check specific quests...or is it only possible to do it that way anyway?

Thanks for all the help! :D

Link to comment
Share on other sites

It depends on what you are doing. Some things you can do on one script. Other things you may need to utilize a couple scripts on different objects. As far as fragments, the Creation Kit dictates when those are developed. Usually fragments are made when you work on quests, dialog, AI behavior and possibly some other things. Typically the form in question would state that it is a Papyrus Fragment.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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