disbeliever Posted May 11, 2009 Share Posted May 11, 2009 I am making my new taris middle city area. I am able to get working doors in game, however, I click on one, it opens i enter and it takes me to another module. However, when i warp back to my area to continue testing, the doors are still in the open position. Is it possible to make the doors reset to closed once you leave the module? Thanks! Link to comment Share on other sites More sharing options...
Malxados Posted May 11, 2009 Share Posted May 11, 2009 Well, I'm not sure about that but it might work with a script. I was thinking about a script with a time delay to close the door possibly attached to the OnOpen script field for the door (or if it already has one you might be able to add it on). I'm not exactly sure what the script function would be either, possibly ActionCloseDoor. (I'm more of a big picture guy ) Hope this helps Malxados Link to comment Share on other sites More sharing options...
zbyl2 Posted May 11, 2009 Share Posted May 11, 2009 You could add this few lines into your module's OnEnter script: object oDoor = GetObjectByTag("your_door_tag"); AssignCommand(oDoor, ActionCloseDoor(oDoor)); It will close door with tag "your_door_tag" after you enter module. Link to comment Share on other sites More sharing options...
Demongo Posted May 12, 2009 Share Posted May 12, 2009 Yes zbyl2's script works, and if you want to open a door use this: object oDoor = GetObjectByTag("your_door_tag"); AssignCommand(oDoor, ActionCloseDoor(oDoor)); or if you want to close all doors try this: ( ( GetDistanceBetween( OBJECT_SELF, oDoor ) < 10.00 ) && ( GetIsOpen( oDoor ) ) ) { AssignCommand( oDoor, ActionCloseDoor( oDoor ) ); } this will close the dorr swithin 10 metres.Just edit the 10.00 number to any other number EDIT: urgh...I'm not really sure about the second script so if you want to make sure you won't have any bugs use zbyl2's script:) Link to comment Share on other sites More sharing options...
R2-X2 Posted May 12, 2009 Share Posted May 12, 2009 I made a module where all doors closed a short time after opened. I took the stunt12_close.ncs script from the STUNT_12 Module, and put the script into all my doors' OnOpen srcipt. Link to comment Share on other sites More sharing options...
disbeliever Posted May 12, 2009 Author Share Posted May 12, 2009 So for give me, I am new at modding, where would the doors on open script go? In what file? Link to comment Share on other sites More sharing options...
glovemaster Posted May 12, 2009 Share Posted May 12, 2009 To have all the doors close when you enter the module (so if you leave the module and come back the same applies) you need to place this script in the modules ARE file in the struct "OnEnter". void main() { object oDoor = GetFirstObjectInArea(GetArea(), OBJECT_TYPE_DOOR); while(oDoor != OBJECT_INVALID) { if(GetIsOpen(oDoor)) AssignCommand(oDoor, ActionCloseDoor(oDoor)); oDoor = GetNextObjectInArea(GetArea(), OBJECT_TYPE_DOOR); } } Hope that helps If you need any help just ask. Or if that doesn't compile... I can't see any syntax errors from here Link to comment Share on other sites More sharing options...
R2-X2 Posted May 13, 2009 Share Posted May 13, 2009 Open a door file (name of your door) + .utd ending, and select the sripts tab. There you'll find a OnOpen script line, which is normally empty. Then compile your script (/or extract the stunt12_close.ncs from Kotor Tool/Kotor/Rims/Modules/STUNT_12.s_rim/Scripts, compiled) save the script you choosed at the same direction as your door is saved, and then test it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.