csbx Posted May 28, 2017 Share Posted May 28, 2017 I notice that when I add an onactivate to a door to run a bit of script when a given door opens, the door stops functioning as a door--ie., it doesn't activate when clicked. I tried including 'activate' in the script, but that didn't seem to solve things. Anyone know how to add script to a door using onactivate (or another way) that will leave the door functioning as a door ? Thanks ! Link to comment Share on other sites More sharing options...
Deleted1205226User Posted May 28, 2017 Share Posted May 28, 2017 If you attach a script to a door it will stop working as a simple door (open/close by clicking) because it is waiting for instructions that is supposed to be in the script. You have to tell in the script when the doors should open/close. Link to comment Share on other sites More sharing options...
csbx Posted May 28, 2017 Author Share Posted May 28, 2017 Thanks for responding. That's what I thought I was doing by including 'activate' in the script. But I guess I need to invoke the setopenstate function and set up the conditionals (if open, close; if closed, open). I'll give that a try. Link to comment Share on other sites More sharing options...
Mktavish Posted May 29, 2017 Share Posted May 29, 2017 Hmmm ... that's odd the activate call isn't working. Just did a quick test with a ... Begin OnActivate ShowMessage MyMessage ActivateEnd~~~~~~~~~~~~~~~~ And it worked no problem. So either your door doesn't have an animation , or you didn't flag the reference as persistent ... maybe ? Link to comment Share on other sites More sharing options...
csbx Posted May 29, 2017 Author Share Posted May 29, 2017 Just checked this. It's persistent (though would it even have to be if the script is attached to the object itself ?) and the door has an animation--it's the hotelblanksmL01 door. Bizarre. I'm missing something obvious, probably. Thanks, Mktavish. Link to comment Share on other sites More sharing options...
Deleted1205226User Posted May 29, 2017 Share Posted May 29, 2017 Maybe you could post your script here so we can have a look at it. Link to comment Share on other sites More sharing options...
Mktavish Posted May 29, 2017 Share Posted May 29, 2017 (edited) Just checked this. It's persistent (though would it even have to be if the script is attached to the object itself ?) and the door has an animation--it's the hotelblanksmL01 door. Bizarre. I'm missing something obvious, probably. Thanks, Mktavish. You mean this door "OffDoorHotelBlankSmL01" ? But your right ... it works without the reference being flagged persistent . Did you name the door with prefix numbers ? Base / Ref ? Script name ? Edited May 29, 2017 by Mktavish Link to comment Share on other sites More sharing options...
csbx Posted May 29, 2017 Author Share Posted May 29, 2017 (edited) scn csbxAComplexDoorman begin onActivate if ( IsActionRef Player == 0 ) && ( csbxAComplexLooseGhoul8Doorman.getdead == 0 ) csbxAComplexLooseGhoul8Doorman.AddScriptPackage csbxAComplexdoorman01 endif activate endThe script will check to see that a 'door man' is alive--if he is then he'll close the door when a different npc has left the room. These details require work, but I stopped here given the issue of the door now not opening for anyone. As per script, activate should run regardless of satisfaction of conditionals. csbxdoorclose01 is the ID for the door (OffDoorHotelBlankSmL01 indeed). Base name is similar. The script name is as above. Edited May 29, 2017 by csbx Link to comment Share on other sites More sharing options...
Mktavish Posted May 29, 2017 Share Posted May 29, 2017 (edited) Without seeing your doorman package and a script on them possibly ... I would guess they are shutting the door before it can play the opening animation. Is that a "Find" package ? Using the "Specific Reference" option and selecting your door for it ? Which you could put a condition of "GetOpenState == 1" Select run on reference , and choose your door. But instead of having the door run a script ... put it on an area trigger covering the door mans space using "OnTriggerLeave" excluding the door man ... or with small multiple triggers covering the exit points of the door man space. Add edit : err oh wait ... if the door man has another package ... put a condition on it of GetOpenstate == 3 Then they will switch packages depending on if the door is open. Another add edit : To clarify ... put GetOpenstate == 3 as the only condition between 2 packages.It will give your door man a randomness towards personality.However ... if the timing doesn't line up enough ... may have to put a timer on the package switch ? Edited June 5, 2017 by Mktavish Link to comment Share on other sites More sharing options...
Recommended Posts