|
||
|
|
#1 (permalink) |
|
Join Date: Jun 2004
Age: 25
Posts: 56
|
Hi all,
I make for us this script. It's switch (default ItemID is switch but can be changed through [props command to everything you want) for opening secret doors.DESCRIPTION 1. The switch has two different faces (not pressed and pressed) 2. You can make a lot of "copies" of it for opening the same door (doors) 3. One switch can controll one or more doors 4. Automaticly closes door(s) after 5s. INSTALATION 1. Copy Switch.cs somewhere you want. 2. Replace the BaseDoor.cs and SecretDoors.cs in /items/constructions/doors or in BaseDoor.cs create new virtual property public virtual bool CanOpen {get{return true;}} and use it in Use and OnTelekinesis functions to check for "can open" if if Use function will be the Mobile from = null then open the door in SecretDoors.cs override this property to false USING Create the "Master" switch by [add switch x y z where x = DoorFacing, y = DoorType (1-6) and z = number of doors to control by [props change the MakeDoors property to true, this generate the Z doors on the same place like switch. This doors move by [move where you want and change its properties by [props. If you want to make another switch for the same doors by [props change on the master switch MakeChild to true (it will be the still false, but on the same place as master switch will be created a new one )Move this new switch by [move and set its properties by [props. If you [remove the master switch everything will be deleted (all doors and child switches) |
|
|
|
|
|
#3 (permalink) |
|
Join Date: Jun 2004
Age: 25
Posts: 56
|
If you want to repair this. Edit the BaseAI. Find line
: if ( !door.Locked || !door.UseLocks() ) m_Obstacles.Enqueue( door ); and change to: if ( !door.Locked || !door.UseLocks() ) if (door.CanOpen) m_Obstacles.Enqueue( door ); I think ![]() |
|
|
|
|
|
#9 (permalink) | |
|
Join Date: Jun 2004
Age: 25
Posts: 56
|
Quote:
the first argument is door facing this is defined like enum type Code:
public enum DoorFacing
{
WestCW,
EastCCW,
WestCCW,
EastCW,
SouthCW,
NorthCCW,
SouthCCW,
NorthCW
}
and the last one is count (int) you add switch: [add switch 1 1 2 then in [props set the makedoors to true then move the doors where you want by [move if you want to make another switch which can operate with doors in [props is makechild (set it to true) and move the switch by [move |
|
|
|
|
|
|
#11 (permalink) |
|
Like I said, I tried it on my homeshard. It runs without any problems and I think it's very usefull. Good job xApoCx.
I modified the switch.cs a little bit. So you have now more doors for the switches. You can download it here and put it were ever you want in your scripts folder. You have to replace the door.cs in /items/constructions/doors. Have fun with it. Maybe we can get it so that you can change between some switches / levers? |
|
|
|
|
|
|
#12 (permalink) | |
|
Join Date: Jun 2004
Age: 25
Posts: 56
|
Quote:
Thx ![]() You can change the switch looks by [props |
|
|
|
|
|
|
#14 (permalink) |
|
Dark Elder
|
The 2 types of doors sounds like it would work a lil better or tweak this out a lil more.
How hard would it be to make it when you want to add it to a door, you use the cmd [add switch then it lets you target the door you wish to link it to? So you wouldn't have to use the x y z thingy. Good job on this script so far. Peace, Dubie
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|