lfnetwork.com mark read register faq members calendar

Thread: Reset opened doors?
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-11-2009, 04:36 PM   #1
disbeliever
Junior Member
 
disbeliever's Avatar
 
Join Date: Dec 2008
Location: Maryland
Posts: 335
Helpful! 
Reset opened doors?

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!
disbeliever is offline   you may: quote & reply,
Old 05-11-2009, 05:01 PM   #2
Malxados
Rookie
 
Malxados's Avatar
 
Join Date: Feb 2009
Location: Mandalore
Posts: 224
Current Game: Warframe, SC Blacklist, KOTOR1
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


"But God demonstrates His own love toward us, in that while we were still sinners, Christ died for us." (Romans 5:8, NKJV)
"For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord." (Romans 6:23, NKJV)

Ask me about my sig!

Bao-Dur: I'll take the one who was stupid enough to threaten us instead of shoot us when he had the chance.

k_inc_force bothers me.
Malxados is offline   you may: quote & reply,
Old 05-11-2009, 06:35 PM   #3
zbyl2
Junior Member
 
zbyl2's Avatar
 
Join Date: May 2008
Location: a galaxy far far away...
Posts: 320
Contest winner - Modding Veteran Modder 
You could add this few lines into your module's OnEnter script:
Code:
object oDoor = GetObjectByTag("your_door_tag");
AssignCommand(oDoor, ActionCloseDoor(oDoor));
It will close door with tag "your_door_tag" after you enter module.
zbyl2 is offline   you may: quote & reply,
Old 05-12-2009, 09:11 AM   #4
Demongo
Afro Skeleton
 
Demongo's Avatar
 
Join Date: Apr 2009
Posts: 963
Current Game: Street Fighter IV
Yes zbyl2's script works, and if you want to open a door use this:
Code:
object oDoor = GetObjectByTag("your_door_tag");
AssignCommand(oDoor, ActionCloseDoor(oDoor));
or if you want to close all doors try this:
Code:
( ( 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



Bink's Sake

"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"

"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."

Last edited by Demongo; 05-12-2009 at 09:19 AM.
Demongo is offline   you may: quote & reply,
Old 05-12-2009, 09:32 AM   #5
R2-X2
Junior Member
 
R2-X2's Avatar
 
Join Date: Dec 2008
Location: Above Lehon
Posts: 352
Current Game: KotOR again. F*** yeah.
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.



Beep.
R2-X2 is offline   you may: quote & reply,
Old 05-12-2009, 09:34 AM   #6
disbeliever
Junior Member
 
disbeliever's Avatar
 
Join Date: Dec 2008
Location: Maryland
Posts: 335
Helpful! 
So for give me, I am new at modding, where would the doors on open script go? In what file?
disbeliever is offline   you may: quote & reply,
Old 05-12-2009, 12:31 PM   #7
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
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".

Code:
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


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 05-13-2009, 04:03 PM   #8
R2-X2
Junior Member
 
R2-X2's Avatar
 
Join Date: Dec 2008
Location: Above Lehon
Posts: 352
Current Game: KotOR again. F*** yeah.
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.



Beep.
R2-X2 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Reset opened doors?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:32 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.