Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 07-16-2004, 10:21 AM   #1 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default Secret door open switch

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)
Attached Files
File Type: cs Switch.cs (6.7 KB, 83 views)
File Type: cs BaseDoor.cs (14.3 KB, 106 views)
File Type: cs SecretDoors.cs (4.3 KB, 100 views)
xApoCx is offline   Reply With Quote
Old 07-16-2004, 10:38 AM   #2 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default Some changes

The view is now changet imedeatly on property change.
Attached Files
File Type: cs Switch.cs (6.8 KB, 36 views)
xApoCx is offline   Reply With Quote
Old 07-16-2004, 10:49 AM   #3 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default monsters can open sec. doors

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
xApoCx is offline   Reply With Quote
Old 07-16-2004, 12:57 PM   #4 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default Wrong Code

I Am Deeply Sorry But Previous Code Is Wron. Here Is The Right Code
Attached Files
File Type: cs Switch.cs (5.7 KB, 34 views)
xApoCx is offline   Reply With Quote
Old 07-16-2004, 01:00 PM   #5 (permalink)
 
Join Date: Mar 2004
Location: Treasure Island, FL
Age: 38
Posts: 548
Send a message via ICQ to Talrol Send a message via MSN to Talrol
Default

Excellent idea for a script Since you seem to be modifying many things with it right now, I'll check back on it in a couple of days and perhaps give it a test run on my shard
Talrol is offline   Reply With Quote
Old 07-16-2004, 01:22 PM   #6 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default

Quote:
Originally Posted by Talrol
Excellent idea for a script Since you seem to be modifying many things with it right now, I'll check back on it in a couple of days and perhaps give it a test run on my shard
Thx
xApoCx is offline   Reply With Quote
Old 07-16-2004, 03:19 PM   #7 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default upgrade

I add the Movable = false; parametr
Attached Files
File Type: cs Switch.cs (5.8 KB, 54 views)
xApoCx is offline   Reply With Quote
Old 08-18-2004, 08:28 PM   #8 (permalink)
Newbie
 
Join Date: Dec 2002
Posts: 63
Default example

can I get an example of how the command should look is it:

[add switch north,3,1 or is it different im sorry im old cant figure out lol, appriciate the help.
mikial is offline   Reply With Quote
Old 08-22-2004, 06:38 AM   #9 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default

Quote:
Originally Posted by mikial
can I get an example of how the command should look is it:

[add switch north,3,1 or is it different im sorry im old cant figure out lol, appriciate the help.
If you look to the scripts you can find that syntax for [add will be

the first argument is door facing this is defined like enum type
Code:
 public enum DoorFacing
 {
  WestCW,
  EastCCW,
  WestCCW,
  EastCW,
  SouthCW,
  NorthCCW,
  SouthCCW,
  NorthCW
 }
the second is doortype (int)

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
xApoCx is offline   Reply With Quote
Old 08-22-2004, 08:34 AM   #10 (permalink)
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 38
Posts: 508
Send a message via ICQ to hudel
Default

Thanks xapox, nice adition to runuo.
I'll trie it on my homeshard.
hudel is offline   Reply With Quote
Old 08-22-2004, 12:18 PM   #11 (permalink)
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 38
Posts: 508
Send a message via ICQ to hudel
Default

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?
Attached Files
File Type: cs Doors.cs (11.1 KB, 24 views)
File Type: cs Switch.cs (7.0 KB, 30 views)
hudel is offline   Reply With Quote
Old 08-22-2004, 02:56 PM   #12 (permalink)
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default

Quote:
Originally Posted by hudel
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?

Thx

You can change the switch looks by [props
xApoCx is offline   Reply With Quote
Old 08-25-2004, 03:19 PM   #13 (permalink)
 
Join Date: Jan 2004
Posts: 70
Default

hmmm.. once u get those files, you cant open doors regularley, unless theres a prop or sumfin, you shud fix it, have 2 types of doors - normal and switch doors


=P
LegolasLuva is offline   Reply With Quote
Old 08-26-2004, 01:35 PM   #14 (permalink)
Dark Elder
 
Dubie's Avatar
 
Join Date: May 2004
Location: Springfield, IL
Age: 36
Posts: 76
Send a message via AIM to Dubie Send a message via MSN to Dubie Send a message via Yahoo to Dubie
Default

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
__________________
Necropolis "City of the Dead" - Coming Soon
Play CS stop by: www.dubie.net
CS Server1: 69.65.18.18
CS-CZ Server: 69.65.18.19
Dubie is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5