missing EOF at While

Post » Fri May 10, 2013 1:26 am

Not sure what I am doing wrong here. Have I missed some punctuation or am I just not using While correctly?

Scriptname LoopScene extends QuestInt Property p Auto  While getstage() == 40         If (game.getplayer().GetDistance(Alias_Marker) >=150)             p=1         EndifEndWhile While p==1          If (game.getplayer().GetDistance(Alias_Marker) <=50)             InnScene.Start()              p=0         EndIfEndWhile  
User avatar
Stacey Mason
 
Posts: 3350
Joined: Wed Nov 08, 2006 6:18 am

Post » Thu May 09, 2013 11:30 pm

Most anything you do with Papyrus, including while loops, must be within events/functions. You'll want to find appropriate events to trigger stage setting/scene starting in which case you'll find you don't need while loops.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Fri May 10, 2013 4:43 am

The scene starts at stage 30. At the end of the scene the stage is set to 40. I want the player to have a choice of starting the scene again, when they move towards the marker. But they will already be at the marker at the end of the scene. So I need to only trigger the scene if they walk away from the marker and then decide to walk back to it.

I will have another look at functions and events on the creation kit wiki and be back.

User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Fri May 10, 2013 12:55 am

You don't need that script to trigger the scene :) just add conditions stack in your scene.

User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Thu May 09, 2013 11:51 pm

I'm not sure what conditions I would add.

I have managed to get the script to compile and I've added a function (thank you JustinOther!)

Scriptname aaaLoopScene extends Quest   Int Property p Auto  ReferenceAlias Property Marker Auto  Scene Property InnScene Auto Function StartLoop()               If (getstage() ==40)                     RegisterForSingleUpdate(1.0)               EndIfEndFunction Event OnUpdate()           If (game.getplayer().GetDistance(Marker.GetRef()) >=150)               p=1           Else               RegisterForSingleUpdate(1.0)                     If (game.getplayer().GetDistance(Marker.GetRef()) <=50 && p==1)                          p=0                         InnScene.Start()                     Endif            EndIFEndEvent 

I am hoping that with this script at the end of the InnScene (which has already played) if the player stays near the marker nothing will happen, but if the player walks away from the marker and decides to go back to the marker the scene will play again?

User avatar
Ysabelle
 
Posts: 3413
Joined: Sat Jul 08, 2006 5:58 pm

Post » Thu May 09, 2013 2:07 pm

sigil79: Download my mod (http://skyrim.nexusmods.com/mods/30506 - It needs Lanterns of Skyrim mod too), open in CK and check the scenes. All the scenes have conditions based on distance.

User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am


Return to V - Skyrim