how to start a quest after a specified sleep ?

Post » Thu Jun 21, 2012 5:59 am

Bed's quest alias ? I need to make another alias for the quest inside the quest? I attached to the bed if I add to the quest how will recognize the bed is using ? Thx for helping btw...

What I mean was, in your Quest, you should have one (just one Reference Alias) for the bed which player will sleep on. After you hand-place the bed into the render window, you can access your Quest Alias as picture below

http://www.creationkit.com/images/8/8d/FilledFirstAliasWindow.png

Select 'Specific Reference' and force ref to the bed you just placed. On the right, you will see Script Panel, which you can add above Issgard_Shipbed script to it. Again, you will need only 1 Reference Alias for the bed. The above script should work as intended.



Starting 1 compile threads for 1 files...
Compiling "QF_ISSGARDJourney01_0107303D"...
e:\giochi\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_ISSGARDJourney01_0107303D.psc(49,14): no viable alternative at input '.'
No output generated for QF_ISSGARDJourney01_0107303D, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_ISSGARDJourney01_0107303D

This error happened might be one of 2 thing:
- You might put that line under fragment window, not the main quest script. By saying main quest script, I mean the script that stays in the 'Script' tab of the Quest window - NOT under the Quest Stages tab.

- ShipBed_Script.RegisterForSleepEvent() should be placed inside a function. And you should call this function somehow via Fragment, or other script. Something like

;{This function will make the script attach to ReferenceAlias - the bed register for Sleep event remotely. You will need to invoke this 'someFunction() via fragment, or under some other Event}Funtion someFunction()   ShipBed_Script.RegisterForSleepEvent()EndFunction

This way offers more flexibility but ... more complicated. If you just wish to get it done, then the first alternative - in my previous post should work
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm

Post » Thu Jun 21, 2012 9:35 am

I need to have so 2 scripts in the main quest scripts tab? I am creating one purpousely to put this sleep even funtion ?

did new script but


Scriptname Issgardshipscript extends Quest

Issgard_ShipBed Property ShipBed_Script auto

ShipBed_Script.RegisterForSleepEvent()

result


Starting 1 compile threads for 1 files...
Compiling "Issgardshipscript"...
e:\giochi\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Issgardshipscript.psc(5,14): no viable alternative at input '.'
No output generated for Issgardshipscript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Issgardshipscript


http://img850.imageshack.us/img850/6792/67786229.jpg
User avatar
Nikki Hype
 
Posts: 3429
Joined: Mon Jan 01, 2007 12:38 pm

Post » Thu Jun 21, 2012 8:21 pm

No need for 2 scripts, one should be sufficient. If you read my post carefully, you will see why it gives you error...

Your quest script supposes to be like this

Scriptname IssgardshipScript extends QuestIssgard_ShipBed Property ShipBed_Script auto;Some other code goes hereFunction registerBedForSleepEvent()   ShipBed_Script.RegisterForSleepEvent()EndFunction

*** NOTE ***
- make sure the script you attach to the bed (as Reference Alias) must have the name of Issgard_ShipBed & you have to define it in your main Quest Script's Property
- Then, you should use 'mykQuest.registerBedForSleepEvent()' in the fragment script window to trigger it
User avatar
Gracie Dugdale
 
Posts: 3397
Joined: Wed Jun 14, 2006 11:02 pm

Post » Thu Jun 21, 2012 4:26 pm

Maybe this will be great help for you on how to get/set Quests' Variables, Properties remotely:

http://www.creationkit.com/Variables_and_Properties_(Papyrus)#Getting_Properties_of_a_Quest_Script
User avatar
Nathan Barker
 
Posts: 3554
Joined: Sun Jun 10, 2007 5:55 am

Post » Thu Jun 21, 2012 6:08 am

:wallbash: I still get error ...

here is the whole Script And only one I have in the main quest script tag ...


;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 3Scriptname QF_ISSGARDJourney01_0107303D Extends Quest HiddenIssgard_ShipBed Property ShipBed_Script auto;Some other code goes hereFunction registerBedForSleepEvent()   ShipBed_Script.RegisterForSleepEvent()EndFunction;BEGIN ALIAS PROPERTY Timebox;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Timebox Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Bed;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Bed Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_0Function Fragment_0();BEGIN CODE; Start the questDebug.Notification("The Voyage Quest is starting");END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_2Function Fragment_2();BEGIN CODEDebug.Notification("The Journey Quest is 20 ")SetObjectiveCompleted(10)SetObjectiveDisplayed(20);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_1Function Fragment_1();BEGIN CODEDebug.Notification("The Journey Quest is 10 ")Erilarquest.Disable()ErilarCairn.Enable()SetObjectiveDisplayed(10);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentObjectReference Property ErilarCairn  Auto  ObjectReference Property Erilarquest  Auto  


sorry but I am not understanding if I understand you wrong or I do it wrong ....
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Thu Jun 21, 2012 5:40 am

any idea why is not working?
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Thu Jun 21, 2012 9:45 am

Ok I managed to get all scripts compiled , I was just copying ur code and pasting but I saw only after that was with a lot of mistyped function and words so I fixed those now it compile , I am going to try ingame if it works ....
User avatar
Sharra Llenos
 
Posts: 3399
Joined: Wed Jan 17, 2007 1:09 pm

Post » Thu Jun 21, 2012 2:23 pm

Finally now it works ....

there is only one problem left , now everytime I sleep there it sets back the stage to level 10 where it had to be set when sleeping ... I can place a timer or something? like a variable ...

slept = 0

if slept == 0 then bla bla bla script bla bla bla and slept =1

else

nothing ....


that works?
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Thu Jun 21, 2012 1:22 pm

seems not working I need to define a variable that I can write in the stages and pass to the bed script , how can I Do that?
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Thu Jun 21, 2012 7:07 pm

may be is enough to add the condition like && is quest stage XX ?
User avatar
Elena Alina
 
Posts: 3415
Joined: Sun Apr 01, 2007 7:24 am

Post » Thu Jun 21, 2012 4:16 am

Yes that last one fixed :) I guess now I can sett further stages just simply with this && thing :) ...

Btw ... now a more complex quest ....

If I have a map on top of ship and I want the player to :

1) chose a destination by clicking on a small banner on the map

2) then go sleep to activate the travel ....

How could this be setup?
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Thu Jun 21, 2012 11:24 am

Each of the small banners will have a script attached to them. The script would set a variable in the script that controls the traveling. Example:

Scriptname MyQuestScript extends Quest{Script that goes on the quest detecting sleep and controlling travel.}Int Property Destination AutoEvent OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)	if (Destination == 1)		;travel to destination 1	elseif (Destination == 2)		;travel to destination 2	elseif (Destination == 3)		;travel to destination 3	;etc.	endifEndEvent

Scriptname BannerScript extends ObjectReference{Script that goes on the banners.}MyQuestScript Property MyQuest Auto{The quest detecting sleep and controlling travel.}Int Property Destination Auto{What destination does this banner represent?}Event OnActivate(ObjectReference akActionRef)	MyQuest.Destination = DestinationEndEvent
User avatar
Crystal Birch
 
Posts: 3416
Joined: Sat Mar 03, 2007 3:34 pm

Post » Thu Jun 21, 2012 11:39 am

Glad you make it work, although I never myself attempt to edit the auto-generated fragment script :blink:

Just a friendly reminder,
http://img850.imageshack.us/img850/6792/67786229.jpg

QF_IssgardJourney01_xxxx is auto-generated script for whatever you put in Fragment window (Under Quest Stages).
Please never, ever ever edit this one, as it might potentially muck up the whole quest

The codes I mentioned earlier should be inside IssgardShipScript and/or inside the Quest Alias >>> IssgardBedScript

And sorry for typing error, I wasn't using any editor, just typed things out of my bird brain
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Thu Jun 21, 2012 6:16 am

But If I do nto use the QF_Issgardjourney , the script doesnt compile and it doesnt find then the command for the call of sleep register

and I get this error ....

Starting 1 compile threads for 1 files...
Compiling "QF_ISSGARDJourney01_0107303D"...
e:\giochi\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_ISSGARDJourney01_0107303D.psc(49,9): registerBedForSleepEvent is not a function or does not exist
No output generated for QF_ISSGARDJourney01_0107303D, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_ISSGARDJourney01_0107303D


If I make a second script for the quest and I place the stuff in then the QF one dont compile
User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Post » Thu Jun 21, 2012 2:49 pm

If you look closely at the QF_ISSGARDJounry01_0107303D, you will see that everything you put inside the Papyrus Fragment (under Quest Stages), are listed inside a function.
Something like this

;BEGIN FRAGMENT Fragment_1Function Fragment_1()   ;BEGIN CODE   Debug.Notification("The Journey Quest is 10 ")   Erilarquest.Disable()   ErilarCairn.Enable()   SetObjectiveDisplayed(10);END CODEEndFunction

In this case, Function Fragment_1() is created for you, and executed automatically by the quest stage.
You got the above error because
- You have yet to declare RegisterForSleepEvent in the ReferenceAlias script
- You might accidently put IssgardBedScript.RegisterForSleepEvent() outside of the function
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Thu Jun 21, 2012 2:57 pm

mmm no it produces an error if I do not put the fucntion in that script , as it doesn't recognize , like if the function is not found if I call it in the frigment and is not decleared in the same script ....

I put the code stuff at the end of all the code base stuff that is in the fragment that way seems to work ....
User avatar
Ryan Lutz
 
Posts: 3465
Joined: Sun Sep 09, 2007 12:39 pm

Post » Thu Jun 21, 2012 5:45 am

So you put the code at the end of fragment script, and it works? Interesting :D
Anyway, if it work for you then let it be :P Just discard my post earlier
User avatar
marie breen
 
Posts: 3388
Joined: Thu Aug 03, 2006 4:50 am

Post » Thu Jun 21, 2012 3:21 pm

Yes After all the codes , actually in the description of the fragment its written to not write anything between the begin fragment and it's end , so I guess it is fine to place anythingelse after ...

the problem seemed related to the fact that the calling function didn't accept the function definition in the other script that is not the base fragment script because the function was called there and so ended inside one of the fragments .... all suppositions , I amno scripter ...
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Previous

Return to V - Skyrim