greyday01 Posted September 28, 2018 Share Posted September 28, 2018 I want something to activate that activator but only when it is open. I'm not sure how to make a condition to test for that.Would you need a property that points to the activator or the script that the activator has?GetState seems to refer to scripts not objects and I'm unsure how to use it from outside the script itself Would it be easier to make a custom version of that default script that has a internal condition that ignores activations if it is closed and activated by my trigger? Specifically I want to put the dunPinesomethingShelf with a triggerbox around it that uses a OnTriggerLeave Event to cause it to automatically close if you move away from it but not cause it to open. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 28, 2018 Share Posted September 28, 2018 There is GetOpenState which you can use to determine if the object is opened or closed when the player leaves the trigger, if it is open then close it with SetOpen. Something like: Event OnTriggerLeave(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ;we only care if it is the player that leaves the trigger int myObjectState = myObject.GetOpenState() If myObjectState == 1 || myObjectState == 2 ; is open or opening myObject.SetOpen(false) ;close it EndIf EndIf EndEventReplace "myObject" with whatever variable you wish to use for whatever object reference you're wanting to close. Don't forget to set up a property or otherwise obtain the correct object reference to assign to your variable.Replace "myObjectState" with whatever variable you wish to use in your check for the object's open / close status. Link to comment Share on other sites More sharing options...
greyday01 Posted September 29, 2018 Author Share Posted September 29, 2018 I want something to activate that activator but only when it is open. I'm not sure how to make a condition to test for that.Would you need a property that points to the activator or the script that the activator has?GetState seems to refer to scripts not objects and I'm unsure how to use it from outside the script itself Would it be easier to make a custom version of that default script that has a internal condition that ignores activations if it is closed and activated by my trigger? Specifically I want to put the dunPinesomethingShelf with a triggerbox around it that uses a OnTriggerLeave Event to cause it to automatically close if you move away from it but not cause it to open. Thank you. This almost worked. When I tested this happened:button opened shelfbutton closed shelfbutton opened shelfexited trigger closed shelfbutton opened shelfexited trigger again nothing happened and buttons no longer opening or closing shelf either I'm going to try a triggerbox with a modified DefaultactivateSelf script and a modified Default2State script on the shelf.It's frustrating. I had a portcullis set up that worked perfectly. Then I changed things so it wasn't needed and deleted the script I had used.Don't know why I'm having so much trouble recreating it. OK. I've modified the DefaultActivateSelf script so it activates the triggerbox only when I leave and I've set up the shelf with 2 buttons and the triggerbox to be activate parents to the shelf.Leaving the triggerbox or using either of the buttons opens and closes the shelf.Now I need to set a condition that when it is the closed state only the buttons will cause it to go to open. Link to comment Share on other sites More sharing options...
Recommended Posts