antstubell Posted October 27, 2019 Share Posted October 27, 2019 (edited) Title should be WITHOUT sleep. I've tried a few ways around this without luck. I want a NPC to use a coffin - go to sleep in it as vampires do - but when player interacts with the coffin I don't want a message saying "Already being used" or the prompt "Sleep" . I want it to say "Open Coffin" and when you do there is sleeping NPC which you can wake up and chat with, etc. On all the coffins in my mod I don't want player to sleep in them just open and close them.If I remove the marker model from the object then NPC can't use it. I removed the script from a coffin and unchecked the Sleep checkbox in Active Markers and still asks "Sleep?". I tried to finder the marker in CK, it isn't there. I though ok a static coffin with a lay down marker. The Lay Down marker makes NPC lie on her side like in a bed not like Vampire lying on her back.I'm stuck! In my mod player will never sleep in a coffin or become a Vampire. Edited October 27, 2019 by antstubell Link to comment Share on other sites More sharing options...
Evangela Posted October 28, 2019 Share Posted October 28, 2019 Sounds like coffin needs to be turned into an activator. The name of activator will also be the prompt in game. Can also try making a perk that changes the activation prompt based on some conditions. You could probably change the prompt on the furniture itself, but I can't open the CK right now to check. Link to comment Share on other sites More sharing options...
antstubell Posted October 28, 2019 Author Share Posted October 28, 2019 (edited) What I've done so far.Attaching this script... Event OnCellAttach()Self.SetDestroyed(True)EndEvent To an activator, in my case furniture, prevents any text appearing but the object still retains complete functionality and appears as normal in game but as I said without any means of interaction. This can be reversed through script. maxarturo pointed me to this.So now in order to make the coffin open/close requires a primitive activator, or other type, with a script that I am currently working on like this... bool property isOpen = TRUE autoobjectReference property objectToAnimate autostring property animClose autostring property animOpen autobool busyEvent OnActivate(ObjectReference akActionRef)if !busyif animClose && isOpen == TRUEbusy = FALSEobjectToAnimate.playAnimationAndWait(animClose,"done")ElseIf animClose && isOpen == FALSEbusy = TRUEobjectToAnimate.playAnimationAndWait(animOpen,"done")EndifEndifEndEvent Needs 'fine tuning' because coffin will close but not open. Edited October 28, 2019 by antstubell Link to comment Share on other sites More sharing options...
antstubell Posted October 28, 2019 Author Share Posted October 28, 2019 Having issues with opening the coffin. Coffin starts open and player can close it but it won't open.Shed some light on this? bool property isOpen = TRUE autoobjectReference property objectToAnimate autostring property animClose autostring property animOpen autobool busyEvent OnActivate(ObjectReference akActionRef)if !busyif animOpen && isOpen == TRUEbusy = FALSEobjectToAnimate.playAnimationAndWait(animClose,"done")isOpen == FALSEElseIf !busyIf animOpen && isOpen == FALSEbusy = TRUEobjectToAnimate.playAnimationAndWait(animOpen,"done")isOpen == TRUEEndifEndifEndifEndEvent Link to comment Share on other sites More sharing options...
maxarturo Posted October 29, 2019 Share Posted October 29, 2019 (edited) The bool Function PlayAnimationAndWait(string asAnimation, string asEventName) nativerequires :asEventName: The name of the event to wait for.Caution: If the event you send it doesn't exist, the function will never return.Source :https://www.creationkit.com/index.php?title=PlayAnimationAndWait_-_ObjectReference Try this approach.Your script simplified a little bit, you might need to tweak it a little according to what your needs might be.* Did not test or compile it, i did it during a long boring break i had. Example:bool property StartClosed = False auto{If checked TRUE it will start in a CLOSED state} bool property DoOnce = false auto{If check TRUE it will fire the StartClosed only the first time the cell loads} bool Property isTriggered = false auto hidden Auto STATE waitingEvent OnActivate(ObjectReference akActionRef) If ( !isTriggered ) isTriggered = True Self.PlayAnimation("YOUR ANIMATION NAME TO CLOSE") elseif ( isTriggered ) isTriggered = False Self.PlayAnimation("YOUR ANIMATION NAME TO OPEN") EndIf gotoState("waiting")EndEventEndState Event OnLoad() If StartClosed == True Self.PlayAnimation("YOUR ANIMATION NAME TO CLOSE") isTriggered = True Else Self.PlayAnimation("YOUR ANIMATION NAME TO OPEN") isTriggered = False EndIf if DoOnce == true gotoState("waiting") EndIfEndEvent If is going to be place in an external Activator that will sendthe Open/Close animation to the coffin, then : ObjectReference property objectToAnimate auto bool property StartClosed = False auto{If checked TRUE it will start in CLOSED state} bool property DoOnce = false auto{If check TRUE it will fire the StartClosed only the first time the cell loads} bool Property isTriggered = false auto hidden Auto STATE waitingEvent OnActivate(ObjectReference akActionRef) If ( !isTriggered ) isTriggered = True objectToAnimate.PlayAnimation("YOUR ANIMATION NAME TO CLOSE") elseif ( isTriggered ) isTriggered = False objectToAnimate.PlayAnimation("YOUR ANIMATION NAME TO OPEN") EndIfEndEventEndState Event OnLoad() If StartClosed == True objectToAnimate.PlayAnimation("YOUR ANIMATION NAME TO CLOSE") isTriggered = True Else objectToAnimate.PlayAnimation("YOUR ANIMATION NAME TO OPEN") isTriggered = False EndIf if DoOnce == true gotoState("waiting") EndIfEndEvent Edit : Forgot a STATE Edited October 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted October 29, 2019 Author Share Posted October 29, 2019 Ran script on external acitvtor - worls perfect, thanks :thumbsup: Link to comment Share on other sites More sharing options...
Recommended Posts