Q: How to start a quest from within a other Quest via Script

Post » Sat Jun 23, 2012 10:13 pm

I have a problem figureing out what I'm doing wrong here:

In my quest 1 (docsQ01) I got this script atached to a book that sets the next queststage in quest 1 and fires a storyevent.
QEProperty is a custom Keywoard

Spoiler

Scriptname docsQ01JournalScript extends ReferenceAlias  int Property myStage  Auto  {Quest Stage to Set}Quest Property myQuest  Auto  {Qest that should get it's Stage set}Keyword Property QEProperty  Auto  {Costum Keywoard that should be fired via SendStoryEvent}event onRead()myQuest.setStage(myStage)QEProperty.SendStoryEvent()endEvent

Here's a screenshot from my Story Manager Event Node
Spoiler

[img]https://lh3.googleusercontent.com/-JBIn8T3v9Dw/T1TbK83e8QI/AAAAAAAAAHo/NidgW_G4ecU/s1389/SM_Event.png[/img]

Somehow my 2nd quest (docsQ02) doesn't start.

here's the script code for docsQ02
Spoiler

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 7Scriptname QF_docsQ02_0200289E Extends Quest Hidden;BEGIN ALIAS PROPERTY Container;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Container Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DwemerLocation;ALIAS PROPERTY TYPE LocationAliasLocationAlias Property Alias_DwemerLocation Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY sigilStone;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_sigilStone Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY BanditBoss;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_BanditBoss Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY BanditLocation;ALIAS PROPERTY TYPE LocationAliasLocationAlias Property Alias_BanditLocation Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DwemerCube;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DwemerCube Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DwemerPowerSource;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DwemerPowerSource Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Marker;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Marker Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_6Function Fragment_6();BEGIN CODEDebug.Notification("docsQ02 Stage 40")if (Alias_Marker.TryToEnable())  Debug.Notification("docsQ02 Teleporter Enabled")endifif (Game.GetPlayer().AddSpell(TeleportSpell))  Debug.Notification("Teleportation Ability added to the player")endIfSetObjectiveCompleted(30);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_4Function Fragment_4();BEGIN CODEDebug.Notification("docsQ02 start")PowerOn = 0SetObjectiveDisplayed(10);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_0Function Fragment_0();BEGIN CODEDebug.Notification("docsQ02 Stage 20")SetObjectiveCompleted(10)SetObjectiveDisplayed(20);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_5Function Fragment_5();BEGIN CODEDebug.Notification("docsQ02 Stage 30")SetObjectiveCompleted(20)SetObjectiveDisplayed(30);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_1Function Fragment_1();BEGIN CODEDebug.Notification("docsQ02 Stage 10")SetObjectiveDisplayed(10);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentInt Property PowerOn = 0 Auto  SPELL Property TeleportSpell  Auto  

I can't figure out what's wrong here any help would be great :biggrin:
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Sun Jun 24, 2012 1:21 am

When I start trying to work on quests, I'm going to have a real problem...the alias window is too large, and the OK button is always off the bottom of the screen.
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Sun Jun 24, 2012 2:17 am

When I start trying to work on quests, I'm going to have a real problem...the alias window is too large, and the OK button is always off the bottom of the screen.

look at Doug's tutorial he has a tip about that window to big problem http://www.youtu.be/Qfcet5hf5bs?hd=1
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Sun Jun 24, 2012 1:40 pm

I had all sort of trouble getting my first RQ to fire.

Eventually I set the flags that log story manager events and looked at the log files. The problem was that I wasn't able to fill all of the quest aliases.
User avatar
Lucy
 
Posts: 3362
Joined: Sun Sep 10, 2006 4:55 am

Post » Sat Jun 23, 2012 10:28 pm

Eventually I set the flags that log story manager events and looked at the log files. The problem was that I wasn't able to fill all of the quest aliases.

Oh were is that flag hidden and do I have to enable something in the ini file?
I suspect that this could be the case for my quest as well @ Alias filled
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Sun Jun 24, 2012 3:09 am

From what I've seen, to start a quest from inside another quest, wouldn't you just call a "SetStage(int Whatstage)" on the other quest's script?
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Sun Jun 24, 2012 2:52 am

From what I've seen, to start a quest from inside another quest, wouldn't you just call a "SetStage(int Whatstage)" on the other quest's script?

This would work for a already running quest and also I need the flexebility of the Story Manager.

This first 2 quests are more or less a test of how to get this working before I start to setup the complex stuff.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Sun Jun 24, 2012 12:26 pm

Yep, Quest cannot start if it cannot fill all the declared Alias(s). To avoid it, you need to condition your alias carefully, or use the Flag 'Optional' in the Reference Alias window.

To start a Quest from Story Manager, you need to decide which way to start such quest is best for your design. When actor level up, when kill someone, etc..... I mostly start my quests off from Script. (Quest that start on Script Event). Then create a Node in SM >>> Script, enter a newly defined Keyword. When I want to start the quest, just use the function

http://www.creationkit.com/SendStoryEvent_-_Keyword
User avatar
Emmie Cate
 
Posts: 3372
Joined: Sun Mar 11, 2007 12:01 am

Post » Sun Jun 24, 2012 12:16 pm

Yep, Quest cannot start if it cannot fill all the declared Alias(s). To avoid it, you need to condition your alias carefully, or use the Flag 'Optional' in the Reference Alias window.

To start a Quest from Story Manager, you need to decide which way to start such quest is best for your design. When actor level up, when kill someone, etc..... I mostly start my quests off from Script. (Quest that start on Script Event). Then create a Node in SM >>> Script, enter a newly defined Keyword. When I want to start the quest, just use the function

http://www.creationkit.com/SendStoryEvent_-_Keyword

Yep that's exactly what I did.
I enabled warn on faild to fill alias and made the aliases optional.
Changed all my
Debug.Notification()
to
Debug.trace
I also enabled logging via skyrimcustom.ini

Spoiler

[Papyrus]bEnableLogging=1bEnableTrace=1bLoadDebugInformation = 1

And I found my problem

Papyrus0.log
Spoiler

[03/06/2012 - 12:30:18AM] docsQ01 JournalScript SendStoryEvent[03/06/2012 - 12:30:18AM] error: Cannot call SendStoryEvent() on a None object, aborting function callstack:[alias Journal on quest docsQ01 (210012E4)].docsQ01JournalScript.OnRead() - "docsQ01JournalScript.psc" Line 13

After I reopend my scrip properties in CK and reasigned my event to QEProperty it worked as it should
looks like you should reappy your properties after you mess around in the scripts or strange things can happen :lightbulb:

Anyways thanks to all of you wo tried to help it's working now :banana:
User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am


Return to V - Skyrim