Bluarchon Posted February 13, 2013 Share Posted February 13, 2013 Hi, I'm creating a quest mod which allows the character to keep a journal in his inventory which is used throughout the quest. The thing is, I do not want the player to lose the journal so I made a Quest Alias to reference it and made it a Quest Object so they cannot get rid of it. The thing is, once the quest is done, will they be able to get rid of the journal? I wanted to give the players an option to get rid of the journal once it has served its purpose after the quest. Is this possible through scripting? Any kind of help is appreciated. Link to comment Share on other sites More sharing options...
kromey Posted February 13, 2013 Share Posted February 13, 2013 Ending the quest (not merely setting it completed, but actually stopping it) should remove that quest item status. Another option would be to use a script on the item itself that uses the OnContainerChanged() event to put itself right back into the player's inventory should it be removed, unless the quest as progressed past a certain stage. Then you don't have to make the alias a quest object. Yet another option (that's maybe a bit of a cheat) is, when the quest is done, use a script to remove the quest alias from the player, but then immediately add another copy of the item to the player's inventory. Something like this: Player.RemoveItem(Alias_Journal, 1, True) ;Remove it, but suppress any message Player.AddItem(Alias_Journale.GetBaseItem(), 1, True) ;Add a non-quest duplicate, also silently And yet one more option (maybe) would be to use Clear() on the alias, which if I understand correctly leaves the item where it is but the alias no longer points to it (have to make sure the alias is optional for this to work). Link to comment Share on other sites More sharing options...
Bluarchon Posted February 16, 2013 Author Share Posted February 16, 2013 (edited) Awesome! Thanks a lot kromey! You wouldn't happen to know much about detecting when a player enters a cell? If so, I'll send you a private message! Edited February 19, 2013 by Bluarchon Link to comment Share on other sites More sharing options...
kromey Posted February 16, 2013 Share Posted February 16, 2013 There's the OnLocationChange event, but that goes on an actor and triggers for every single location change. There's got to be a more efficient/more better way of doing it, but I don't know what it would be. Link to comment Share on other sites More sharing options...
Bluarchon Posted February 18, 2013 Author Share Posted February 18, 2013 (edited) Thanks kromey. I've tried the OnLocationChange event but had troubles triggering with my custom locations. I'm using OnCellAttach() now. The problem is that the area of a cell is too big and general to determine if the player is in the exact spot you want him to be. Edited February 19, 2013 by Bluarchon Link to comment Share on other sites More sharing options...
kromey Posted February 18, 2013 Share Posted February 18, 2013 If there's a specific spot you want to detect the player entering, why not set up a trigger and use the OnTriggerEnter and OnTriggerLeave events? Link to comment Share on other sites More sharing options...
Bluarchon Posted February 19, 2013 Author Share Posted February 19, 2013 I'm not sure how this works. If I attach a ReferenceAlias to a rock in the worldspace and use an OnTriggerEnter event, when will the event trigger? When you get near the rock? The description on the CK site doesn't really make sense to me. Also I appreciate you staying with me all this time to help with scripting. I'm thinking of releasing my mod within the week. If you don't mind, I will mention your help on the credits. Link to comment Share on other sites More sharing options...
kromey Posted February 19, 2013 Share Posted February 19, 2013 Try this tutorial, it looks like it's doing exactly what you're trying to accomplish. Link to comment Share on other sites More sharing options...
Bluarchon Posted February 19, 2013 Author Share Posted February 19, 2013 This seems exactly what I need. Thank you so much kromey! Link to comment Share on other sites More sharing options...
Recommended Posts