Help with Papyrus

Post » Thu Jun 21, 2012 3:45 pm

Somebody could help me with it? I dont know English well, so...
How it'll be on Papyrus? -

scn ExampleScript

Short DoOnce

Begin OnTriggerEnter Player

Set DoOnce to 0
If Player.GetItemCount ExampleKey
If GetStage ExampleQuest 10
SetStage ExampleQuest 20
Set DoOnce to 1
EndIf
EndIf
End
User avatar
Schel[Anne]FTL
 
Posts: 3384
Joined: Thu Nov 16, 2006 6:53 pm

Post » Thu Jun 21, 2012 7:20 pm

Here is hopefully an examle that covers what you're looking for. I'm not sure what your DoOnce variable is for... My thought is you don't need it and instead use the Stage instead... but, if you need it, this example shows it as a property so you can pass in the value. (If it's suppose to be a Global value, then you'll need to change it accordingly.)

Define the properties in the script you are extending:

Quest Property ExampleQuest AutoMiscObject Property ExampleKey AutoInt Property DoOnce Auto

Then call this function in the event you want to respond to:

Function DoThis()  If Game.GetPlayer().GetItemCount(ExampleKey) && ExampleQuest.GetStage()== 10	ExampleQuest.SetStage(20)	DoOnce=1  EndIfEndFunction

Disclaimer: I didn't actually get to test this code... so ask if there are any errors you don't understand.
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm

Post » Fri Jun 22, 2012 1:24 am

Oh, thank you. i'll try it.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Thu Jun 21, 2012 11:59 pm

You can do without the DoOnce given the quest stage is checked/changed.
ScriptName ExampleScript extends ObjectReferenceActor Property PlayerREF AutoKey Property ExampleKey AutoQuest Property ExampleQuest AutoEvent OnTriggerEnter(ObjectReference akActionRef)	If akActionRef != PlayerREF	ElseIf ExampleQuest.GetStage() != 10	ElseIf PlayerREF.GetItemCount(ExampleKey)		ExampleQuest.SetStage(20)	EndIfEndEvent
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am


Return to V - Skyrim