cdo947214 Posted May 8, 2015 Share Posted May 8, 2015 I know how to advance a quest stage through dialogue and when someone dies, but how do I do it when I pick up an object. I want to make it so when I walk in a room, and pick up a book, (which is set as the target ref for quest objective 55) it goes to objective 60 and an assassin appears. How do I do this? Link to comment Share on other sites More sharing options...
Jokerine Posted May 8, 2015 Share Posted May 8, 2015 scn AdvanceStageBookScript int DoOnce ;makes script only run when book is taken for the first time BEGIN onAdd player ;script will only run when book is taken by the player if (DoOnce == 0) ;if book is taken for the first time SetObjectiveCompleted myQuest 55 1 ;complete previous objective SetObjectiveDisplayed myQuest 60 1 ;display new objective AssassinREF.Moveto Player, 50, 0, 0 ;move assassin behind player AssassinREF.enable ;make assassin visible (you have to make them initially disabled) Set DoOnce to 1 ;prevent code from kicking in again Endif END Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted May 9, 2015 Share Posted May 9, 2015 Alternatively, and the way the game devs usually do this, is to make all of the code in a quest stage, and have the object simply activate the stage. The plus side of stage activation is that your object can then check if the stage has been completed. Since the stage can only ever be completed once, this will prevent oddities from happening, such as if two copies of the item exist. So the code for the object would be something like: if (GetStageDone YourQuest 60 == 0 && GetStageDone YourQuest 55 == 1) SetStage YourQuest 60 endif Then in the stage you'll move the assassin, probably to a special xmarker that will make them appear near the player somewhere that you want, such as around a corner or something. Either way will work of course, but I find it easier to follow the progression of a quest if you can step through the stages and see most of what they do there, instead of across lots of object scripts. In the end it's whatever you find easiest, of course. Link to comment Share on other sites More sharing options...
Recommended Posts