GOOGLEPOX Posted January 2, 2017 Share Posted January 2, 2017 Hey all, I'm starting work on a mod that generates radiant quests for the player. I looked at the tutorial on the Creation Kit website and I think I grasp the basics, however I want a system similar to the Companions, and I'm not sure how to accomplish it. I have several radiant quests, but I don't understand how to give a randomly selected one, e.g. the player has a chance of either killing an animal or gathering pelts. I've looked at the Companions system in the Creation Kit but I don't know how the quests, scripts, and story nodes piece together. For example, in my mod I have a quest for collecting taxes and a quest for delivering a package. How can I decide which quest to give the player at any given time, depending on the circumstances? tl;dr How do I go about randomly selecting a radiant quest through a single dialogue option? Thanks! Link to comment Share on other sites More sharing options...
xcafe Posted January 3, 2017 Share Posted January 3, 2017 My first impression would be to have a script fragment on the dialogue option that sets a quest stage, have a fragment on that stage that adds a magic effect to the player (put an alias of the player on the quest), and have that magic effect run a script that looks like this: Scriptname StartHiddenQuestScript extends MagicEffect FormList Property RadiantQuests Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Int QuestINT = Utility.RandomInt(0, PLACEHOLDER) Form QuestToStart = RadiantQuests.GetAt(QuestINT) If (QuestToStart as Quest) (QuestToStart as Quest).Start() Endif EndEvent With the RadiantQuests being a formlist that you've filled with all the radiant quests you want. (Replace the placeholder with the amount of quests in the formlist.) Link to comment Share on other sites More sharing options...
GOOGLEPOX Posted January 3, 2017 Author Share Posted January 3, 2017 Am I missing something with papyrus? I'm trying to add a magic effect to the player in the quest stage, but I'm getting a weird error. I set a property for the spell in the script fragment for the quest stage, and put MySpell.cast(Game.GetPlayer()), but it says cast is not a function? Thanks for the help! Link to comment Share on other sites More sharing options...
lofgren Posted January 3, 2017 Share Posted January 3, 2017 What is the purpose of adding a spell to the player in this scenario? Or setting a quest stage? The proposed process seems ridiculously complicated. As to your question, you cannot create a property on "a quest stage." The property is created on the script, outside of any stage. I think I know what you are saying so this may not actually be your problem, but I would like clarification on how you created the spell property before I hazard to advise further. Link to comment Share on other sites More sharing options...
xcafe Posted January 3, 2017 Share Posted January 3, 2017 Aha! Forget everything I told you before, I figured out why the CK was giving me a stupid error message, so there's a much easier way to go about this. :laugh: Attach this script to the quest: Scriptname StartHiddenQuestScript extends Quest FormList Property RadiantQuests Auto State Active Event OnBeginState() Int QuestINT = Utility.RandomInt(0, 10) Form QuestToStart = RadiantQuests.GetAt(QuestINT) If (QuestToStart as Quest) (QuestToStart as Quest).Start() Gotostate("") Endif EndEvent EndState Set up an extra stage on whatever quest has the dialogue you want to trigger the radiant quest, and select this script in the kymquest dropdown. Then add this as the script fragment: kmyQuest.GotoState("Active") SetStage(***) Fill in the *** with whatever stage you want to go to, and badabing badaboom, you're in business! I think. Haven't tested this. :laugh: Link to comment Share on other sites More sharing options...
xcafe Posted January 4, 2017 Share Posted January 4, 2017 Just out of curiosity, what are you trying to do with this? :happy: Link to comment Share on other sites More sharing options...
lofgren Posted January 4, 2017 Share Posted January 4, 2017 xcafe, I don't understand why all of your scripts appear to be going out of their way to add more complexity to this process than is necessary. You first script adds an extraneous ability to the player for no reason I can detect. Your second script sets a quest stage and sets the state of a quest script remotely in order to call a function in an OnBeginState() block. Why wouldn't you just execute the function in the dialogue fragment? Or put the function in the quest stage fragment? Or even just call the function directly. Why go through those extra steps? Link to comment Share on other sites More sharing options...
xcafe Posted January 4, 2017 Share Posted January 4, 2017 xcafe, I don't understand why all of your scripts appear to be going out of their way to add more complexity to this process than is necessary. You first script adds an extraneous ability to the player for no reason I can detect. Your second script sets a quest stage and sets the state of a quest script remotely in order to call a function in an OnBeginState() block. Why wouldn't you just execute the function in the dialogue fragment? Or put the function in the quest stage fragment? Or even just call the function directly. Why go through those extra steps?Well the first thing was because the quest fragments kept giving me an error message, but you have to set the stage because dialogue scripts can only interact with its parent quest and aliases on that quest. And the OnBeginState() block is there because for some reason calling a function directly on the quest fragment gives you another error code, and frankly I didn't feel like taking another 5 hours to figure that one out when I have a functional alternative, lol. Link to comment Share on other sites More sharing options...
lofgren Posted January 4, 2017 Share Posted January 4, 2017 (edited) Well your basic method is sound but it sounds like there might be something wrong with your setup. There shouldn't be any limitations on dialogue fragments. Edited January 4, 2017 by lofgren Link to comment Share on other sites More sharing options...
Recommended Posts