Jump to content

[Student Thread] Paulibobo - Matthiaswagg

Recommended Posts

Finally, and apologies for the wait, you can finish this off. 

Not sure if I did this before, but ensure that you GetOwningQuest().SetObjectiveCompleted(20) in the first line of dialogue (Begin) for the Mysterious Bosmer. You're not setting a stage, just completing the objective as it should be, logically. The quest doc says something different but this feels better to me. Do whichever you prefer.

You also have to recreate stage 40 as the stage set once all NPCs are killed from ambush. We'll condition Ila's dialogue to it and set the objective of reporting success.

If I didn't make you add Travel/Sandbox packages to the horse aliases that make them stand still, do so now. They should have a radius of 0 and can be travel to self or sandbox in current location with a radius of 0. Sandbox is probably better.

Very, very lastly, be sure you add a defaultSetStageOnDeathRefAlias script to the alias of Ila, if we haven't already (sorry don't remember) that will set the stage to 108 when she dies, failing the quest. IF you decide to go ahead with the extra steps outlined in blue at the bottom of this post, you will have to make a custom script (YourQuestIDIlaDeathScript) that checks if the stage is less than 50 before setting the stage to 108, to avoid failing the quest if you've actually completed it properly and the Q is just handling other things.

Where we left off, we still need to script the ambush. So, in that End fragment of the Goodbye dialogue, you'll want to set the stage to 30. You ALSO want to akSpeaker.StartCombat(Game.GetPlayer()). It's not strictly necessary as we'll be making the Enemy Faction of your Shady Dealers and Mysterious Bosmer enemy to the player faction anyway, but it's just a precaution and will ensure your Mysterious Bosmer attacks IMMEDIATELY. Stage 30 will govern the ambush. IN stage 30, you should make the Enemy Faction properly enemies with the player at this point, so all of our Shadys and Mysterious people will attack. The function for this is SetEnemy. You need to enable the Shady Characters in the first place, of course. You'll also want to use the function EvaluatePackage on your Shady Character aliases, as well as the Mysterious Bosmer. Evaluate package forces the actors to check their package and see which one they should be running - whereas normally, it just evaluates randomly every in game hour or so. Otherwise, it might take them a few seconds to actually attack you, which is not the kind of fluidity we're looking for.

This will look like:

YourEnemyFactionProperty.SetEnemy(YourPlayerFactionProperty);coincidentally, the player's faction is called PlayerFaction

in the quest stage. Alias_xyorz is a ReferenceAlias property created in the auto generated quest script as soon as you make any aliases, and can be used in quest stages (as stages are contained in the greater, autogenerated script).

So that begins the ambush. Simple enough, yah? Save.

Now we just need to set up the part that sets the stage once the ambush has actually occurred and failed. It involves a few default scripts on your aliases, and it goes like this:

Go to your Mysterious Bosmer alias, and add the defaultCounter script to him (remember the Default Scripts List you and I and a couple of others helped make? Ctrl+F defaultCounter). The defaultCounter should set the stage of your quest to 40 when the counter reaches 3. You can change these values by going to defaultCounter's properties. Then add defaultCounterIncrementOnDeath scratch that, only leaving this here so you can understand why it wouldn't work - defaultCounterIncrementOnDeath extends Actor, and there's no RefAlias version + it only increments when a linked ref is set and that would just be unnecessary to have to set a linked ref pointing to self. So Add a [New Script] to your Mysterious Bosmer alias, YourQuestIDAmbushDeathScript, with a GlobalVariable property pointing to a global (make a new one under Miscellaneous>Globals, not constant, short, and with the name YourQuestIDAmbushDeaths). YourGlobalProperty.Mod(1.0) OnDeath, and in an If, check if that global's value (MyGlobalProperty.GetValue() == 3.0) now is 3. If it is, set the owning quest of the alias to 40. Now add this script to the Shady Characters as well, same script not a new one, and fill the property. During this time, you should also add the Briefing on the plan note to the alias inventories of both Shady Characters, in case I forgot to make you add the note to them in one way or another. If I did have you add them as a Death Item or something on the base actor, nvm.

In stage 40, you want to display the objective of Report success to the stablemaster. Then go to your dialogue view, and create a new branch - a Top-Level branch, like we did way before. Set up the dialogue as it is in the doc, and upon the last dialogue option End, you want to set the stage to 50. In stage 50, complete the "Report success" objective, and add leveled gold to the player with AddItem (you want to add a LeveledItem property with the FavorRewardGoldSmall or whatever-it's-called and add that to the PC). Remember to have the Stop() part to stop the quest AFTER this.

If you want, you can make Ila travel to go get the horses and bring them back. To do this, DON'T Stop the quest at stage 50 (DO complete it, though, completion doesn't mean the quest is over, neither does failure), and add a new travel package to Ila's alias, conditioned to stage 50. She should travel to a decent sized radius of where the main quest-giver horse is, and in the End part of the travel package, you should set the stage to 60. In stage 60, evaluate package for Ila and all the other horses. Add a package to Ila that makes her go back to the stables (In Cell>ID of Stable Interior), conditioned to stage 60 - she'll resume normal schedule when she arrives. You can then add a package to the horses that will make THEM travel to the stable gated area, conditioned to stage 60. You could also make it more complex and make them follow Ila, but once she reaches a certain point outside the stable (with triggerbox, setting a new stage or setting a global that you reference from the package), make them travel to the stables. However, this should all be figured out on your own if you want to do this. However you do it, make sure you Stop() the quest once all that traveling and packaging business is done.

Or you can do it the easier way, the Beth way, (and just because it's easier doesn't make it bad remotely) which is just to disable the horses and the whole camp area once the quest is completed. Regardless of whether you don't do the former, you should do the latter. You can make use of Enable markers and set up one that you can then disable in order to disable the whole camp (fade or not, as you wish). This should be disabled in whatever the ending stage of your quest ends up being.

That's it! Sorry it took so long, as I always say. :P Before testing, ensure you have generated an SEQ file, and, as you have no VA and that can cause issues (though none once it is fully implemented, obviously), be sure you have installed Fuz Ro D-oh. Test it, and before asking me for any help if you need to fix bugs, try to figure out what the issue might be caused by and fix it. If you can't fix it, absolutely come to me though and I'll help you figure it out.

Once you're all done, tell me and I'll conclude with my last lesson for you on "wrapping random stuff up". 

Edited by Matthiaswagg

Share this post

Link to post
Share on other sites

ALSO, before you finish - you may notice some boxes in your dialogue. This is because smart quotes and other weird symbols have been used in the google doc. You'll have to use Player Dialogue to go through topic text and responses, remove any ' " or ... and rewrite them. Do the same in objectives. That will fix it - exit and I are fixing it for implemented quests and unimplemented docs so it won't happen in the future.

EDIT: And did you ever fix Ila's dialogue so it properly said WHERE the horse had gone, directionwise?

Edited by Matthiaswagg

Share this post

Link to post
Share on other sites

Wrap-up Lesson for Quests

Just went ahead and did this, read whenever you are ready and tell me when done

This will be your last official lesson on quests, covering:

Forcegreets, scenes, radiant aliases (loc and ref), create object IN aliases, story manager, globals used in objectives (x/4) and text replacement

Each of these headings is a link to something with more info.


A forcegreet is a type of package that will make an NPC initiate the conversation. However, unlike blocking topics, you don't even have to speak to them for them to initiate it. Using normal forcegreets, they'll simply begin speaking to you when you're near enough, or just walk up to you and start talking (again, if you're near enough - though with some tricky AI stuff you can get them to travel to you and then talk to you all in one package, or just use stages so they'll do a travel package, use the Completion fragment for the package to set a new stage, and with that stage, forcegreet). A forcegreet is used with that one dude-who-sells-fake-stuff-in-Riften who tried to recruit you for the TG. An NPC will continue to attempt to forcegreet you provided that A) the forcegreet package is viable and B) the conditions on the topic that the forcegreet is starting are viable.

With a forcegreet, you have to have the topic set up as needed, and then the forcegreet will forcegreet with the specified topic - and no, it doesn't have to be the starting topic, though usually it will be. 

Scenes: <-- Great link

A scene allows for dialogue, actions, and more between one or more NPCs. They've got a lot of uses, not just limited to cutscenes, reunion scenes, or whatever may spring to mind when you think of them. For example, you could use a scene to have multiple NPCs get to a particular spot, without having to condition a bunch of different packages to "is the stage 60?". You could just Start() the scene from a quest stage or dialogue, and all the NPCs would go, provided the scene is set up correctly. 

Learning scenes will take time, a decent amount of irritation, and some tutorials. They can often be buggy or a bit clunky, so I'll link some tutorials and provide a few tips.


- Don't be afraid to use EvaluatePackage OFTEN during scenes, or just at the beginning, to make sure it looks more fluid

- If a phase isn't starting for some reason, you can try conditioning the start of the phase to start once a certain action is complete (http://www.creationkit.com/IsSceneActionComplete). For example, if the only thing in the prior phase is a travel package, but even when done the next phase won't start, try starting the next scene (start on conditions) if that action number is complete. It often works, because the package IS complete but scenes are stupid

- Make sure you've got Fuz Ro D-oh/VA and an SEQ recently generated before testing scenes, they're often the cause of issues

- Scenes involving "ambient dialogue" (two people talking) involves 4 aliases, and you should take a look at vanilla scenes to see how they work - it's so that, not only does it fill the right NPCs to talk, but IF the NPCs talking AREN'T those they should be, the quest just won't work (not all aliases fill)


Radiance isn't actually all that it's worked up to be. It's really very simple, and it involves the creation of your aliases. Rather than choosing a specific location, NPC, or item, you would have the radiant system pick one for you, based on conditions. For locations, you would simply make a Loc Alias that fills from "Find Matching Location" (not from event), and then specify conditions that need to apply to the location in order for it to fill the alias. For example, I could add the condition LocationHasKeyword LocSetCave == 1.0 Run On Subject && LocationHasRefType Boss == 1.0 Run On Subject &&. This will choose any location that has the LocSetCave keyword (is a cave) and has a boss in it. Those keywords and ref types are set by the location makers (interior and dungeon departments), and there are a WHOLE HOST of other ones we can reference as well as a few custom CYR/BS ones like that for Ayleid Ruins.

Radiance for Ref Aliases is similar. You check the "Find Matching Reference" box, and then add conditions. It will choose a reference that fits those conditions. You can also fill a Ref Alias with a RefType from a location - like filling Alias1 with the Boss in LocAlias1. However, make sure that your RefAlias is BELOW the alias it is being filled from. 

The From Event part allows you to fill an alias with a parameter sent from the Story Manager (NEXT). For example, you could start a quest once you kill someone, and then fill an alias in the quest with the person who you killed. Or fill a location alias with the location you just walked into, starting the quest when you change locations.

Story Manager

The story manager is a system that allows you to start quests based on certain events - when you level up, when you enter a new location, kill someone, craft an item, etc. You can conditionalize it to check WHAT level, WHICH location you left/entered, WHO you killed, WHAT you made and only start the quest then. Or only start a quest if you kill someone and haven't completed X quest, or have done Y thing. It also allows you to fill aliases in your quest based on parameters (data sent with the event). You can also send your own events via script, along with information. I use this method with my mod Simple Taxes, sending a script event and checking if a global value is set before starting the tax collection quest (global being - is it time to collect? can you collect?). As I mentioned before, like filling an alias in a quest with the person you killed that ended up starting the quest. It's a bit complicated to learn, but with time, you'll learn it. Highly recommend reading the link, and the following:


http://www.creationkit.com/Bendu_and_S_M_Nodes< this uses the Bethesda tutorial quest as a base, but just reading it should give you some indication of how the SM works

Create IN/ON Ref Aliases

This type of alias allows you to place another alias into another alias, creating it AT or IN the other alias. For example, I can create a note and place it IN the boss chest in a location alias that has a ref type of a boss chest. Or a more familiar example, placing Meridia's Beacon IN the Boss Chest of a loc alias that has a ref type of a boss chest (always want to check that one actually exists before placing something essential in/at/as it). For At, you'll usually be using a marker. So you could create an NPC at the CenterLocationMarker of a cell (for random encounters, used with an SM node which will place the NPC at the CenterLocationMarker of the area the PC is Change-Locationing into, provided the random encounter conditions are met), or At the Captive-Marker of a cell (captive marker is placed in a jail area of a cell, if there is one, so you can spawn in a captive - like the captive Boethiah-worshipper in that Haunted House quest in Markarth).

Globals Used in Objectives

You may have seen things where you've been gathering ingredients, and the objective will go from "Get some stuff for some lady (1/10)" to "Get some stuff for some lady (2/10)" when you've picked something up. Exact examples can be found in the quest FreeformIvarstead03, Grin and Bear It (see alias and quest script as well as the quest stages), but it uses Text Replacement and UpdateCurrentInstanceGlobal. First, you have to make a non-constant global that will track the 1 part (x/10), with the global tracking x. Then you have to add the global to Text Display Globals in the Quest Data tab - you MUST do this or it won't show properly. Then, in your objective, you put:

"Get some stuff for some lady (<Global=YourGlobalID>/10)" without the quotes

And whenever you pick up ingredients (OnItemAdded on the player alias), you'd call a function that you defined in the quest script that you also call in the first stage when you get the mission:

http://pastebin.com/ZdCuCPXs< made this for someone else, but it applies - for dar'taq'to "find me 10 bear pelts" quest

Again, look at Grin and Bear It for more info, but that would update your global.

Text Replacement

This allows your quest journal entries, objectives (see above), dialogue, and quest-related texts (you can make books/notes have a quest as their parent quest, allowing for text replacement, by making an alias for the book/note and checking the boxes Stores Text and Uses Stored Text). There may also be a bit more to it than that for text, I'll look into it and get back to you as I don't recall.

Anyway, to replace the text, you simply use the tag from the above link as the example shows. Super easy and really useful. Used for things like books saying the player name, journal entries listing locations by names when it's really a radiant loc ref. Dialogue can use it for topic text and I believe responses too, but responses shouldn't use it (because voice acting can't account for changing).


One other thing is invisible continues. I'll just tack this on here:


See the invisible continue part near the bottom, under Link To.

VM quest variables

They're properties just like any other kind, but you can access them using a condition as well, GetVMQuestVariable. You can set them as well, through Advanced Properties 2 Methods (I usually recommend the casting method for quests dialogue fragments and quest stage fragments - GetOwningQuest() as scriptName for example). In order to use them, you have to declare them in a script and add the Conditional tag to the end of the property. You also must add teh Conditional tag after the scriptname declaration of the quest script (must be on a quest script). Then close and reopen your quest, and you can check the value of your property from any quest using GetVMQuestVariable, specifying the quest your quest script containing the property was on, and then choosing the property. Really good when you can't/won't use a stage, for example if you don't want to advance the stage of a quest since it would screw up dialogue but still want to know if the player asked for extra evidence from someone.

Edited by Matthiaswagg

Share this post

Link to post
Share on other sites

BTW, if you DID want the horse to follow you back to the pen by following you when holding the food, you'd do something like this:


And make it so that the stage is set once the horse enters a trigger around the stables pen, and then after that stage the horse has a new package where it stays that. We're not doing this for your quest, but I highly recommend watching that tutorial. It'll teach you custom AI packages, which I didn't, and allow you to see a scene in action.

Share this post

Link to post
Share on other sites

A while back I taught you something wrong, and I just learned that I've thought something wrong for a long time.

When you attach a script to a base object (when you attach a script to a Book, MiscItem, Weapon, Armor, Potion, etc.) it should NOT EXTEND THE TYPE OF THAT BASEOBJECT. You do not extend Book, MiscObject, Weapon, Armor, Potion, or whatever. You should be extending ObjectReference:

"base objects don't have scripts. 
end of story 
what you're doing is binding the script to the base type, and when an instance of that is created 
it gets the script"

-Qazyhn/PurpleLunchbox/one of the SKSE guys

So. Yeah. Sorry. :P 

Share this post

Link to post
Share on other sites

You are officially a graduate of the Arcane University: Implementation section. If you ever have any more questions or want to learn something else in implementation, I can move your thread, but it's now going into archive and you're getting your name as the second in the graduates list.

You're not technically done with your second quest yet but you're doing good and I trust you can do it. So. :celebration: 

  • reaction_title_1 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now