Jump to content

Quest Help: Disable starting item if starting stage is skipped.


Taiine

Recommended Posts

Okay I need some quest making help.

I have a very basic quest that plays out like this:

 

A. You find a dropped note hinting at a location, you get quest to go to said location

B. You go to said location, find a bandit outside, quest advances to now go inside the location and clear out the rest of the bandits.

C. You clear the bandits, quest is done.

 

Now this whole thing works out just fine, if you go from A,B,C. However I am having trouble setting it up to still work if started from B. (you can't progress to C with out going through B)

 

I wanted to make it that if you went to B first, than A would do nothing. However I couldn't find away to do that, I tried a

if (GetStageDone(0))

;do nothing

Else
SetActive()
SetObjectiveDisplayed(0)
EndIf

 

Though I couldn't really find away to make the note well... do nothing and just be a normal note. So even if you went to B first, or finished C, A would still try and start the quest. So after a few weeks of scanning through existing quests and watching hours of quest tutorials and not finding an answer I settled to just disable the note if you go to B, so it just don't exist anymore. But now my issue is it isn't disableing.

 

So here is what I have:

 

Three quest Aliases:

One for the starting quest note - pointing at the note for refrence

One for a trigger box at the location - pointing at the trigger box for refence

One for the bandit leader inside. - pointing at yep.. the bandit npc.

 

Two objectives:

0 - Go to location - Pointed to Location Aliases

10 - Kill bandit boss. - Pointed to bandit Aliases.

 

Three stages:

0 - Triggered when notes picked up: Quest start

SetActive()
SetObjectiveDisplayed(0)

 

10 - Triggerd from trigger box when crossed at location: Location found, kill bandit leader

If GetStageDone(0) == 0
Alias_TGQuestNote01.GetRef().Disable() --- Points to Starting note Aliases with Aliases Name: TGQuestNote01
EndIf
SetObjectiveCompleted(0)
SetActive() --- this one is if you go right to the trigger. with out the quest starts but isn't made active, thus no quest marker
SetObjectiveDisplayed(10)

Trigger box at location when crossed sets stage to 10. The above should disable the note if you cross the trigger. It don't.

 

20 - Triggers on bandit death: Quest finished.

Compleat Quest Checked

 

 

 

I don't know what I am doing wrong. Given that most of what I am doing in this quest is based of what I seen done in others, I can only assume I am grasping things but it seems like I'm not. I'm pondering if GetRef().Disable() only works if you are in the same cell as the object, as a test cell I made with everything in one place does indeed disable the note. But here it isn't?

 

If anyone wants to give this a good hearty look at here you go:

-removed, no point keeping something up if it's just going to 'waste peoples times with this crap"-

 

The starting quest item (A) is a note found in Riften by Brynjolf's stall in the market.

You can go right to the cave (B) with:

coc aaowlrockext

(turn to your right and you'll be at it)

 

 

Bonus help: If anyone can tell me why the bookcase by the alch station is allowing you to pick up books placed with out going through the bookcase trigger I would be greatful. It seems to be ignoring the collossion box placed in front even if I make it huge, even moving the trigger to cover the whole front isn't helping. The other bookcase I made in there is working fine. Never had this issue before making bookcases.

Edited by Taiine
Link to comment
Share on other sites

Why are you using SetActive() ? All that does is makes an already running quest active in the journal and have its associated quest markers show up. The player can easily turn that on or off in the journal. Your quest shouldn't be running at all until the conditions for it to start take place.

 

So your note would have a small script attached to it and it can be removed as an alias on your quest.

 

 

Scriptname CUSTOM_OnReadStartQuestNotAlias extends ObjectReference  

int Property myStage = -1  Auto

int Property myObjective = -1 Auto  

Quest Property myQuest  Auto  

Bool DoOnce = false

Event OnRead()
	If !(myQuest.IsRunning()) && DoOnce == false
		myQuest.Start()
		If myStage != -1
			myQuest.setStage(myStage)
		EndIf
		If myObjective != -1
			myQuest.SetObjectiveDisplayed(myObjective)
		EndIf
		DoOnce = true
	Else
		;quest already running - do nothing
	EndIf
EndEvent

Event OnCellAttach()
	If DoOnce == false && (myQuest.IsRunning() || myQuest.IsCompleted())
		;quest is running or completed but I have not been read
		(Self as ObjectReference).Disable()
	EndIf
EndEvent 

 

 

 

Your trigger box would have a script similar to this

 

 

Scriptname CUSTOM_TriggerBoxStartContinueQuest extends ObjectReference

int Property myOldStage = -1 Auto
int Property myNewStage = -1 Auto

int Property myOldObjective = -1 Auto  
Int Property myNewObjective = -1 Auto

Quest Property myQuest  Auto  

Bool DoOnce = false

Event OnTriggerEnter(ObjectReference akActionRef)
	If akActionRef == Game.GetPlayer() && DoOnce == false
		;player has not entered before
		If myQuest.IsRunning()
			;quest is running
			If myOldObjective != -1
				SetObjectiveCompleted(myOldObjective)
				; completes objective if there was one
			EndIf
			If myNewStage != -1
				myQuest.SetStage(myNewStage)
				; advances stage if there is a new one
			EndIf
			If myNewObjective != -1
				SetObjectiveDisplayed(myNewObjective)
				; displays new objective if there is one
			EndIf
			DoOnce = true
		Else
			;quest is not running
			myQuest.Start()
			; start quest & advance to necessary point
			If myOldStage != -1
				myQuest.setStage(myOldStage)
				; sets old stage if there is one
			EndIf
			If myOldObjective != -1
				SetObjectiveCompleted(myOldObjective)
				; completes old objective without displaying it first
			EndIf
			If myNewStage != -1
				myQuest.SetStage(myNewStage)
				; sets new stage if there is one
			EndIf
			If myNewObjective != -1
				SetObjectiveDisplayed(myNewObjective)
				; displays new objective if there is one
			EndIf
			DoOnce = true
		EndIf
	EndIf
EndEvent 

 

 

I wrote those scripts without knowing your specific stage/objective values. You can adjust/rewrite as needed or you can assign values to the properties that will override the default -1.

 

What they should do, is when the note is picked up it starts the quest, sets the stage and displays the objective. When the trigger is reached, if the note was read then it completes the objective, sets a new stage if you have one, and displays the next objective. If however the note was not read, the trigger will start the quest, set the starting stage, complete the objective, advance the stage if there is a new one, and finally display the new objective.

 

You finish the quest up as you already are.

 

The note should disable itself when the cell it is in is attached to the currently loaded cell under the following conditions, when the quest is running and the note hasn't been read, when the quest is completed and the note hasn't been read. If the note has been read, it should remain in game even after the quest is over.

 

Hopefully, maybe, that helps. If someone else comes along with another idea, feel free to experiment and try it out as well. I'm definitely no expert in quests.

Link to comment
Share on other sites

I'm using SetActive() as that makes the quest active when you pick it up. Plus well.. the conditions have taken place for it. If there not added no quest marker at all shows up. I personally don't care to be given an objective in a quest and not have anything to show for it. As you said, they can turn it off if they want.

 

The post I gave also does show my stage/objective values, the two stages 0 and 10, the three stages and their numbers. All my stuff in the mod is also labled with TIB for easy finding.

 

I also don't see a need for custom scrips for this. This same kind of stage skipping and object disableing happens in the default game, but I can't sort out how to do it myself.

 

Even seen stuff like

 

if (!GetStageDone(20))
SetObjectiveCompleted(10, 1)
endif

 

I would think something like that would work, but I don't have a clue how to set it up proper, as said I tried something like that before, but have no idea how to set it so the note does nothing. Everything I tried failed and still tried to start the quest when picked up.

 

Like from the quest in the CK Flavor001, in stage 200 I found

;Disable the quest item if the player never accepted the quest
If GetStageDone(10) == 0
Alias_QuestItem.GetRef().Disable()
EndIf

 

that is where I got that bit from and thought it would work fine with disableing my note if the first stage was set to finished... but again it's not doing such.

 

In quest MS14 I also see

Alias_Helgi.GetReference().Disable()

on stage 60. So I'm hoping I'm on the right track with using such a line to try and make my note bdisabled. But why isn't it being disabled? How am I doing it wrong?

Edited by Taiine
Link to comment
Share on other sites

if (GetStageDone(0))

;do nothing

Else

SetActive()

SetObjectiveDisplayed(0)

EndIf

Most likely you should have been fine with

if (GetStageDone(10))

 

Playtest it using console command sqs to confirm you are handling your quest stages as you intended.

Edited by simtam
Link to comment
Share on other sites

 

if (GetStageDone(0))

;do nothing

Else

SetActive()

SetObjectiveDisplayed(0)

EndIf

Most likely you should have been fine with

if (GetStageDone(10))

 

Playtest it using console command sqs to confirm you are handling your quest stages as you intented.

 

 

10? But it's stage 0 that gets finished, stage 10 is just starting?

The stages are working fine. I've tested this quest a number of times, it's just if you skip the first part, going back readd's the quest. So if yiou already did B and C, finishing it, A will restart it and welp.. no getting rid of it sense you already finished it.

 

Why I wanted the note bto do nothing, or to just disable. But it's not disableing.

Edited by Taiine
Link to comment
Share on other sites

Then why confuse us with all this crap about stages and objectives. If all you want is to prevent the quest from restarting after it has already been completed (no matter how it started). Either set the quest to Run Once or use a global variable as a condition to starting it. If 0, it can be started. If 1, it cannot be started.

Link to comment
Share on other sites

 

 

10? But it's stage 0 that gets finished, stage 10 is just starting?

 

"I wanted to make it that if you went to B first, than A would do nothing."

 

B == entering the cave == stage 10

A == finding note == stage 0

 

so it makes sense to check if B (10) has been done in the script fragment for A (0)

Link to comment
Share on other sites

Then why confuse us with all this crap about stages and objectives. If all you want is to prevent the quest from restarting after it has already been completed (no matter how it started). Either set the quest to Run Once or use a global variable as a condition to starting it. If 0, it can be started. If 1, it cannot be started.

 

Because I'm having trouble and wasn't sure at what part I was messing up?! I Thus I chose to give you everything I had done to see if I'm overlooking something vs asking then later being ask 'what did you do'? I clearly started at the start I was having issues getting the quest to not show the first objective if you already finished the 2nd, or last one.

I don't know -how- to make the quest run once. The script added to the book just sets stage to 0. There's nothing in it to tell it run once.. and even if it ran once, if the first stage never was ran, wont it still run it?

 

Thus why I gave the mod to poke at, and why I wrote down the quest stages and what all I did. Cause I don't know -what part of it I am messing up on- or -what part i need to change to make it work-. I never freaking messed with quests before and my basic coding logic seems to go out the door with this.

 

As is the other guys telling me. 'oh starting a stage is seen as finishing it, even though you haven't finished it but starting it.'

Setting the stage to 10 and finishing the first objective would in my mind mean stage 0 is finished, 10 is starting.. so you check if 0 is finished. and I keep reading quests never go backwards in stages. But mine is. It isn't so much restarting, it's displaying the first part of the quest you skipped if you pick the note up for the first time after you have already finished the rest of the quest.

 

I mean I only have existing quests to go by, and looking through how they are doing things with no guide to really grasp how they are doing it, but if its working the way they have it then?

 

Sorry for being that idiot who thought to get a beginners idea of quests to do something very simple, but ends up being something I've struggled with for close to two months now. Two months of people telling me 'oh you don't need a quest, screw immersion! or 'just goggle it' or 'just sit through tutorial videos that run over an hour in hope they may have an answer to your issue'. Or 'go to the wiki even though you really don't know what your looking for and the tutorial there isn't anything at all like what you're trying to do."

 

Sorry that I'm stuck and thought giving as much info to what I tried to do would help find what I am doing wrong. -.-

Link to comment
Share on other sites

A quest has several stages, numbered as you like it. Initially every stage is Not Done. When a stage is set, it becomes Done. The console command showqueststages, or sqs for short, displays all the stages of given quest and their state as number, 0 (Not Done) or 1 (Done). In case of doubt, use sqs to see how your quest fares.

 

Notice that a stage changes from Not Done to Done, but there is no way to get it back (unless the whole quest is Reset, which changes all stages back to Not Done). This is what you may have heard as "quests never go backwards in stages". Stages are numbered, and for our convenience usually the higher the number, the later the stage gets set during a playthrough, but it is not a strict rule (and it couldn't be, because some quests are not linear - their stages could not be totally ordered).

 

The option to flag the quest as "Run only once" is in the Quest Data Tab, it is not changeable at runtime I think. There are more interesting options there, so feel free to have a look and read the appropriate creationkit.com documentation page to learn what they do.

Link to comment
Share on other sites

  • 8 months later...

Why are you using SetActive() ? All that does is makes an already running quest active in the journal and have its associated quest markers show up. The player can easily turn that on or off in the journal. Your quest shouldn't be running at all until the conditions for it to start take place.

 

 

If I remove the 'setactive()' command from a quest script will change anything other than removing the journal and quest markers? Or does it ONLY affect the journal and quest markers. Reason I'm asking is I want to disable quest markers for all quests instead of having to do it manually every time in-game - but I don't want to break the quests in case it affects anything else. thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

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