1. What you want to do
a) Make a quest start by activating an item
b) Make the journal update when a person dies
c) Make a door open on certain conditions
d) Make a magic chest that will ask if you want gold
and will give you a riddle if you say "Yes".
2. Scripting
a) Quest-updating ( 1.a and 1.b )
b) More on conditions ( 1.c )
c) Questions to the PC ( 1.d )
1. What you want to do:
---------------------------
a) You pick up object A and it will update your journal to the first stage ( or stage B )
b) When person A dies your journal will update to stage B
c) Example: Door A will only open if your Bounty is higher than amount B, chest C will only open if you're rank D in faction E.
d) When you activate chest A, you will be asked question B. If you answer "Yes", it will ask you question C. If you answer
alternative D, you will be able to open the chest.
2. Scripting
---------------
a) Quest-updating
Here's the script for the object ( don't write what's after the semicolons! ( ; ) :
Begin [ your preferred name of the script ]
If ( OnActivate == 0 ) ; This is so you need to activate the object before the script runs.
Return
Endif ; Ends the conditional statement
If ( GetJournalIndex [ the name of your quest ] = 0 ) ; It will only run if you haven't started the quest
Journal [ the name of your quest ] [ the number of the first stage in your quest ] ; Updates the journal
Activate
Endif
End ; Ends the script
Here's the script for the person ( again, don't write what's after the semicolons! ( ; ) :
Begin [ your preferred name of the script ]
If ( OnDeath == 1 ) ; The functions after this line will react when the person the script is attached to dies
Journal [ your quest name ] [ number of the stage where the person has died ] ; Updates your journal
Endif ; Ends the conditional statement
End ; Ends your script
b) More on conditions...
This is from my example; the script for the door CAN look like:
Begin [ your preffered scriptname ]
If ( GetPCCrimeLevel == 0 ) ; If you aren't a criminal, you can't access the hideout ( or whatever place behind).
"[ your ID on the door ]"-> Lock 100 ; Locks the door.
Endif ; Ends the conditional statement
If ( GetPCCrimeLevel > 0 ) ; On the opposite, if you are a criminal, feel free to enter at any time!
"[ your ID on the door ]"-> Unlock ; Unlock the door for you :P
Endif
End ; Ends your script
c) Ok... Now it's time for the big script...
Here's a script for the magic gold-chest... :
Begin [ yadda, yadda, you know how to start the script by now! ]
Short button
Short QuestionState
If ( OnActivate == 0 )
If ( QuestionState == 0 )
Return
Endif
Return
Endif
If ( OnActivate == 1 )
If ( QuestionState == 0 )
MessageBox "What atronach do you get the most gold for ( the salts)?" "Fire" "Frost" "Storm"
Set QuestionState to 1
Elseif ( QuestionState > 1 )
Activate
Endif
Endif
If ( QuestionState == 1 )
Set button to GetButtonPressed
If ( button == 2 )
MessageBox "Correct!" "Ok"
Player-> AddItem gold_001 100
Set QuestionState to 2
Else
MessageBox "Wrong!" "Ok"
Set QuestionState to 0
Endif
Return
Endif
End
I hope you got something out of this tutorial, and that you liked it!
P.S. Sorry for not writing any comments on that last script; it's long you see :(