Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Quest Pains


DsoS
 Share

Recommended Posts

I'm trying to setup a small quest and I've got it mostly done, but I'm lost on how to do something...

I've got my Quest setup like so...

Start Game Enabled

Priority 75

Quest Script


scn aaDSoSFNSJournalQuestScript


short BookCount

float fQuestDelayTime


Begin Gamemode


	If BookCount == 9

		message "Journals have been removed and placed on the bookshelf upstairs!"

		player.removeitem aaDSoSFNSMinersJournal01 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal02 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal03 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal04 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal05 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal06 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal07 1

			message " "

			message " "

		Player.removeitem aaDSoSFNSMinersJournal08 1

			message " "

			message " "

		player.removeitem aaDSoSFNSMinersJournal09 1

			message " "

			message " "

		aaDSoSFNSMinersJournal01BookShelfREF.enable

		set fQuestDelayTime to 0

		set BookCount to 10

		Setstage aaDSoSFNSJournalQuest 100

	Endif

End

Stages: 0 - Nothing here 50 - Result Script

Set aaDSoSFNSJournalQuest.fQuestDelayTime to 1

100 - Quest Complete - Result Script

StopQuest aaDSoSFNSJournalQuest

----------- Code on ALL 9 Journals

scn aaDSoSFNSJournalAddScript


short triggered


Begin OnAdd Player

	if triggered == 0

		Activate

		set aaDSoSFNSJournalQuest.BookCount to aaDSoSFNSJournalQuest.BookCount +1

		set triggered to 1

	endif

End

-----------------

I have a scroll that the player should read BEFORE the journals are removed from their inventory but I'm not sure how I would script it to do so.

As of right now, when I pick up all 9 journals, the books are instantly removed and journals are added to the bookshelf. I don't want this to happen until the player reads the scroll.

So I'm now lost.

I'm not sure how to get the quest to puase/stop and then continue when the player has read the scroll.

Edited by DsoS
Link to comment
Share on other sites

It looks like the problem is in the journal codes. The BookCount short gets increased by 1 whenever a journal is added to the Player's inventory. The journal code should look more like this:

scn aaDSoSFNSJournalAddScript


short ReadOnce


Begin OnActivate Player

        if ReadOnce == 0

                set aaDSoSFNSJournalQuest.BookCount to aaDSoSFNSJournalQuest.BookCount +1

                set ReadOnce to 1

        endif

End


Begin OnEquip Player

        if ReadOnce == 0

                set aaDSoSFNSJournalQuest.BookCount to aaDSoSFNSJournalQuest.BookCount +1

                set ReadOnce to 1

        endif

End

Note: This setup will require that a different copy of this script be placed on each journal (i.e., you'll need scn aaDSoSFNSJournalAdd01Script, scn aaDSoSFNSJournalAdd02Script, etc.)

That will ensure that aaDSoSFNSJournalQuest.BookCount only increases when the Player reads each journal for the first time.

Link to comment
Share on other sites

The way I have it scripted right now, works just like your script does. It only increases the BookCount the first time its read.

Though, I would like to figure out how to decrease the book count incase the player removes a book or more.

What I'm needing to do is to have that Scroll setup so that when the player reads the scroll, the books are then removed and added to the bookshelf, not when the player gets all 9 books initially. Maybe something with QuestStages or something, I'm not sure.

Link to comment
Share on other sites

The way I have it scripted right now, works just like your script does. It only increases the BookCount the first time its read.

Not entirely the same. The way yours is set up, the scroll is added and immediately read by the Player (at least, that's what it looks like). The alternate script requires the Player to select it from the inventory or "activate" it outside of their inventory. Either way, the script won't run until the Player decide to read the scroll.

Though, I would like to figure out how to decrease the book count incase the player removes a book or more.

You can use the OnDrop command for this. You'd need to add another block to the script that would look something like this:

Begin OnDrop Player

  set  aaDSoSFNSJournalQuest.BookCount to aaDSoSFNSJournalQuest.BookCount -1

End
What I'm needing to do is to have that Scroll setup so that when the player reads the scroll, the books are then removed and added to the bookshelf, not when the player gets all 9 books initially. Maybe something with QuestStages or something, I'm not sure.
That script would look something like this:
scn BookRemovalAndShelfPlacementScript


Short DoOnce


Begin OnEquip Player ; this block runs if the Player reads the scroll from their inventory


 If DoOnce == 0

  Player.RemoveItem Book01 1 ; Replace Book01 with the EditorID of the first book and then do the same for the rest of the books

  Player.RemoveItem Book02 1

  Player.RemoveItem Book03 1

  Player.RemoveItem Book04 1

  Player.RemoveItem Book05 1

  Player.RemoveItem Book06 1

  Player.RemoveItem Book07 1

  Player.RemoveItem Book08 1

  Player.RemoveItem Book09 1


  ShelfBook01Ref.Enable ; the corresponding books on the bookshelf must be persistent references with their own RefIDs for this to work

  ShelfBook02Ref.Enable

  ShelfBook03Ref.Enable

  ShelfBook04Ref.Enable

  ShelfBook05Ref.Enable

  ShelfBook06Ref.Enable

  ShelfBook07Ref.Enable

  ShelfBook08Ref.Enable

  ShelfBook09Ref.Enable

  Set DoOnce to 1

 Endif

End


Begin OnActivate Player ; this block runs if the Player reads the scroll from outside their inventory


 If DoOnce == 0

  Player.RemoveItem Book01 1

  Player.RemoveItem Book02 1

  Player.RemoveItem Book03 1

  Player.RemoveItem Book04 1

  Player.RemoveItem Book05 1

  Player.RemoveItem Book06 1

  Player.RemoveItem Book07 1

  Player.RemoveItem Book08 1

  Player.RemoveItem Book09 1


  ShelfBook01Ref.Enable

  ShelfBook02Ref.Enable

  ShelfBook03Ref.Enable

  ShelfBook04Ref.Enable

  ShelfBook05Ref.Enable

  ShelfBook06Ref.Enable

  ShelfBook07Ref.Enable

  ShelfBook08Ref.Enable

  ShelfBook09Ref.Enable

  Set DoOnce to 1

 Endif

End

^That should get you what you want.

Link to comment
Share on other sites

okay I think I see what your doing now. Sorry about that, my head has been other places (work related)

How would I place the BookCount Global to make sure that the player has all the books in inventory in the Placement Script?

something like this maybe? (copied the first part of the script you wrote)



Begin OnEquip Player ; this block runs if the Player reads the scroll from their inventory


 If DoOnce == 0

   if BookCount == 9   <----- Addition Here

  Player.RemoveItem Book01 1 ; Replace Book01 with the EditorID of the first book and then do the same for the rest of the books

Thank you very much Vyper for all the help :pints:

Link to comment
Share on other sites

okay I think I see what your doing now. Sorry about that, my head has been other places (work related)

Perfectly understandable. I've been in that position myself many times (seems like too many :lmao: ).

How would I place the BookCount Global to make sure that the player has all the books in inventory in the Placement Script?

something like this maybe? (copied the first part of the script you wrote)



Begin OnEquip Player ; this block runs if the Player reads the scroll from their inventory


 If DoOnce == 0

   if BookCount == 9   <----- Addition Here

  Player.RemoveItem Book01 1 ; Replace Book01 with the EditorID of the first book and then do the same for the rest of the books

That should do it. :thumbup: Just remember you'll need to type it as aaDSoSFNSJournalQuest.BookCount so it knows exactly what it's supposed to be referencing.

Thank you very much Vyper for all the help :pints:

You're welcome. :D Glad I could help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...