RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 SVN 199] Stargate Travel System v3.0

FingersMcSteal

Sorceror
I know the post prior to this was December but i'm back to scripting again so thought i'd have a look.

From the few posts above from here it's looking like people wanted it this way (i think)...

Players that have been to a location before will see the address's, players that have not been to a location don't get to know until they have been to a location ?

So those who have been can go back again, those who haven't must first discover the location, if i'm reading right.

I'd have a look now if i could but... where i work have blocked all ZIP file downloads unfortuantly... if someone could PM me with all the CS files in the next hour or so it would be really helpful and i could do less work tonight and more fun stuff instead :)
 

nadious

Sorceror
In my testing, once a gate has been 'discovered', it's added to the list of 'viewable' gates. Now, I only did this on ONE test character, so you might be correct, but I think that once one is found, everyone can see it.
 

jhs59

Sorceror
nadious;755317 said:
In my testing, once a gate has been 'discovered', it's added to the list of 'viewable' gates. Now, I only did this on ONE test character, so you might be correct, but I think that once one is found, everyone can see it.

Right. That is how it is now. But some have requested, as I have, that only once the gate has been discovered by an individual that it shows up for only them on the list while others still see it as undiscovered.
 

espcevan

Sorceror
Dude! I loved watching Stargate SG1 and Atlantis, This jsut makes UO alot better, Thanks for creating this Its effin sweet! keep up the fricken sweet work!
 

jhs59

Sorceror
jhs59;755337 said:
Right. That is how it is now. But some have requested, as I have, that only once the gate has been discovered by an individual that it shows up for only them on the list while others still see it as undiscovered.

Just a little addendum here. I have suggestions for administrative features.. First, the option for staff to choose whether a gate's address is displayed or not automatically without having to be discovered. Another option to have the address shown to everyone as long as at least one person has discovered it. And a third option to keep the gate secret to everyone unless it is discovered by them, in which case the address only shows up to the person who discovered it and is still secret to everyone else.
 

jhs59

Sorceror
Crash Log Report

Well.. I got a crash the other night. I think it was due to my father not knowing how to use the gates properly. (he just plays, doesn't staff) He probably was just clicking all over the place...

Here's the crash log.
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.SG.SGActivatorDevice.SGActivatorDeviceTimer.OnTick() in d:\RunUO\My Shard\Scripts\Custom\Stargate System v3 [2.0]\Items\SGActivatorDevice.cs:line 278
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
 

FingersMcSteal

Sorceror
The timer crash is one thing i've seen once when i had my shard... this happened when there was a server shutdown done while the gate locations had an active field in them, on a restart the timers are no longer there (I.E. expired or null). I'll address this issue once i do updates.

Same sort of thing if house decays enabled on a shard thats been offline for a few months... when the servers restarted all homes fall type thing due to PC's system time. I'll have a look tho.

The other admin bit's you've mentioned are pretty much what people have already asked for tho with address's being shown to certain players etc, which i'll take a look at when i have an active test shard up and running to begin on the updates. Got a couple other idea's i'll add to it too tho.
 

jhs59

Sorceror
Sounds great! Thanks for your work on this system. I use a custom map and used these instead of moongates. Also, once there is the ability to choose whether a location is displayed or not I will have secret locations that players can find. Can't wait!

The error I posted happened just during normal gameplay. Shard had been running fine for days. No shutdowns or restarts were going on during the time of the crash. I hope this helps.
 

FingersMcSteal

Sorceror
Update Time Again...

This is now on Version 3.1, This update allows the hiding of the Crystal Control Devices (CCD's) from players allowing oneway gates and also this update stops staff (GM & higher access level) names going onto the gates as someone who has discovered it.

To hide the CCD you must have the system DISABLED, this NEW option is accessed from the CCD at the stargate in question, the hidden CCD's will remain hidden after a server restart.
Hidden CCD's are moved to the centre of the stargate and placed on top to allow players to walk freely around the platform, GM or above access can click Hidden CCD's to return them, again the system must be DISABLED to do this.

PLEASE READ THE FOLLOWING CAREFULLY before rushing into just installing the scripts...

The v3.1 system (which is attached here) WILL drop into your script folders and run IF IT's A FRESH INSTALL, if your using Version 3.0 already then you'll need to either...

A... Delete the old v3.0 system's scripts folders, including the Stargate Data folder in the Data folder found in the root directory of the RunUO system (C:\RunUO\Data\Stargate Data)... or...

B... If your already using the system on your server and DO NOT WANT TO LOOSE YOUR CURRENT STARGATE's follow the Conversion Steps carefully.

I'll list both methods in as much detail as i can but 1st... MAKE BACKUP'S !!! Mainly the SGData.XML file if you have the system already installed, make and move BOTH the scripts and the XML file to a really really safe location :) so you have the option to return to it if it all goes wrong. :)

INSTALLING FROM NEW (A FRESH START)
Use the following steps to install from new, I.E your 1st ever install of this system.

Download the Stargate System v3.1 RAR file and extract the files into a safe location, this location should have a folder called 'Stargate System v3.1'.
Copy and paste this folder into your RunUO Script folder so you should have 'C:\RunUO\Scripts\Stargate System v3.1'

Start your server and you should be good to go.
[sgadmin takes you to the admin menu for adding stargates.

INSTALLING ON A CURRENT INSTALL OF VERSION 3.0 (A CONVERSION OF v3.0 TO v3.1)
Use the following steps to install this update, I.E your server ALREADY has the Stargate System v3.0 installed on it.

The are a couple of step you will need to follow very carefully before your up and running again, it will also involve a couple of server restarts but if followed in the correct order nothing major, you will be asked to delete server items but this is normal due to the changes that have been made to the CCD's.

1st
MAKE A BACKUP !!! Can't stress this point enough :)
2nd
Download the Stargate System v3.1 RAR file and also the SGConversionXML.cs file.
3rd
Place the SGConversionXML.cs file into the scripts folder and NOT the new Stargate System v3.1 folder just yet.
4th
Start your server and login, then use the add command to add the Conversion Stone (i use [add sgc). Force your server to do a save 1st before clicking this stone to ensure you have all your stargates in your current SGData.XML file (Your old file).
5th
Now click the stone, once clicked check the C:\RunUO\data\Stargate Data folder... you should now have an extra file in there called 'SGData-NEW-FORMAT.XML'.
6th
SHUT THE SERVER DOWN.
7th
Remove from the C:\RunUO\Data\Stargate Data folder the 'SGData.XML' file... don't delete it just put it somewhere safe just incase things went wrong :)
8th
Go back to C:\RunUO\Data\Stargate Data folder and rename the 'SGData-NEW-FORMAT.XML' file to 'SGData.XML'.
9th
Remove the old Stargate System v3 folder from your script's folder and replace the entire folder/system with the new 'Stargate System v3.1' folder into your scripts folder.
10th
Restart the server, you should be asked to delete the SGActivator's from your server and all types of it... answer yes to this, after you have deleted all types of this item you will need to restart the server once more.
11th
Restart the server and everything should be ok, the system should rebuild all of your old gates at there usual locations... All done :)
 

Attachments

  • SGConversionXML.cs
    6 KB · Views: 43
  • Stargate System v3.1.rar
    1.1 MB · Views: 109

datguy

Sorceror
I'm not sure on your system but on the old I had to add a

Code:
public override void OnDoubleClickDead(Mobile from)

routine so dead players could use it.

Also what one could do is on every facet set a safe town as 11111 so
Brit tram
Brit fel
Mistas
Zento
etc all set to 11111

Then to get to a safe town, all player has to do is dclick crystal & hit activate, it's the default :)




Good job on the updates ^_^
 

datguy

Sorceror
In SGGumpActivatorRemoval.cs would it be a good idea to auto shut down the gates when you hide the crystal/reveal/delete & then Re-Activate them instead of going the SGAdmin route? The below seems to work fine but just checking if there are other things that go Boom in the gate

Code:
using System;
using System.Collections;

using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Gumps;

namespace Server.SG
{
    public class SGGumpActivatorRemoval : Gump
    {
        private SGActivatorDevice m_sgactivatordevice;

        public SGGumpActivatorRemoval(SGActivatorDevice m) : base(150, 50)
        {
            m_sgactivatordevice = m;

            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);
            this.AddBackground(0, 0, 398, 188, 9270);
            this.AddLabel(78, 15, 1153, @"Stargate Crystal Control Device Panel");
            this.AddLabel(20, 40, 54, @"To remove this Crystal Control Device from the stargate");
            this.AddLabel(50, 57, 54, @"system correctly please use the remove option.");
            this.AddLabel(60, 85, 84, @"Hide This Dialing Device From The Players");
            this.AddLabel(60, 107, 84, @"Reveal This Dialing Device From The Players");
            this.AddLabel(60, 129, 69, @"Remove This Stargate From The Shard");
            this.AddLabel(60, 151, 33, @"Exit / Cancel");
            this.AddButton(20, 127, 4002, 4004, 0, GumpButtonType.Reply, 0); // Remove
            this.AddButton(20, 149, 4020, 4022, 1, GumpButtonType.Reply, 0); // Exit / Cancel
            this.AddButton(20, 83, 4005, 4007, 2, GumpButtonType.Reply, 0); // Hide Dialing Device
            this.AddButton(20, 107, 4005, 4007, 3, GumpButtonType.Reply, 0); // Reveal Dialing Device
        }

        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 0: // Remove
                    {
                        if (!SGCore.SGSystemEnabled)
                        {
                            from.SendMessage(77, "Crystal & Address removed from the stargate system...");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int removeIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        removeIndex = i;
                                    }
                                }
                            }
                            // Remove Address Entry
                            SGEntry sgeToBeRemoved = (SGEntry)SGCore.SGList[removeIndex];
                            SGCore.SGList.Remove(sgeToBeRemoved);

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();
                        }
                        else
                        {
                            ///////////////////////////////////////////////////////////////////
                            //De-Activate all stargates
                            SGCore.SGSystemEnabled = false;
                            from.SendMessage(77, "Stargate System disabled, any open gates will close down after they are used.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = false;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To DISABLED
                            ArrayList SGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    SGADevice.Add(item);
                            }

                            foreach (Item item in SGADevice)
                                (item).Hue = 39;

                            ///////////////////////////////////////////////
                            //Remove This Gate from the System
                            ///////////////////////////////////////////////
                            from.SendMessage(77, "Crystal & Address removed from the stargate system...");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int removeIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        removeIndex = i;
                                    }
                                }
                            }
                            // Remove Address Entry
                            SGEntry sgeToBeRemoved = (SGEntry)SGCore.SGList[removeIndex];
                            SGCore.SGList.Remove(sgeToBeRemoved);

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();



                            ///////////////////////////////////////////////////////////////////
                            //Activate all stargates
                            SGCore.SGSystemEnabled = true;
                            from.SendMessage(77, "Stargate System enabled.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = true;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To NORMAL
                            ArrayList NORMALSGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    NORMALSGADevice.Add(item);
                            }

                            foreach (Item item in NORMALSGADevice)
                                (item).Hue = 1933;



                            //from.SendMessage(77, "OPERATION ABORTED !!! Stargate System Still ACTIVE, Gates can only be removed IF the stargate system is DISABLED.");
                            //from.SendMessage(77, "Use [SGAdmin option to DISABLE the system 1st");
                        }  
                    }
                    break;

                case 1: // Exit
                    {
                        from.SendMessage(77, "Exit Crystal Device Admin, This Device Remains In The System.");
                    }
                    break;

                case 2: // Hide Dialing Device
                    {
                        if (!SGCore.SGSystemEnabled)
                        {
                            from.SendMessage(77, "Hide/Reveal");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int hidedialIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        hidedialIndex = i;
                                    }
                                }
                            }
                            SGEntry sgeCCDToBeHidden = (SGEntry)SGCore.SGList[hidedialIndex];
                            sgeCCDToBeHidden.SGHideDial = true;

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();
                        }
                        else
                        {
                            ///////////////////////////////////////////////////////////////////
                            //De-Activate all stargates
                            SGCore.SGSystemEnabled = false;
                            from.SendMessage(77, "Stargate System disabled, any open gates will close down after they are used.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = false;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To DISABLED
                            ArrayList SGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    SGADevice.Add(item);
                            }

                            foreach (Item item in SGADevice)
                                (item).Hue = 39;


                            ///////////////////////////////////////////////////////////////////
                            //Hide a gate

                            from.SendMessage(77, "Hide/Reveal");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int hidedialIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        hidedialIndex = i;
                                    }
                                }
                            }
                            SGEntry sgeCCDToBeHidden = (SGEntry)SGCore.SGList[hidedialIndex];
                            sgeCCDToBeHidden.SGHideDial = true;

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();
                ///////////////////////////////////////////////////////////////////
                            //Activate all stargates
                            SGCore.SGSystemEnabled = true;
                            from.SendMessage(77, "Stargate System enabled.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = true;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To NORMAL
                            ArrayList NORMALSGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    NORMALSGADevice.Add(item);
                            }

                            foreach (Item item in NORMALSGADevice)
                                (item).Hue = 1933;
                        }/*
                        {
                            from.SendMessage(77, "OPERATION ABORTED !!! Stargate System Still ACTIVE, Crystal Control Device's can only be hidden IF the systems DISABLED.");
                            from.SendMessage(77, "Use [SGAdmin option to DISABLE the system 1st");
                        }*/
                    }
                    break;

                case 3: // Reveal Dialing Device
                    {
                        if (!SGCore.SGSystemEnabled)
                        {
                            from.SendMessage(77, "Hide/Reveal");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int revealdialIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        revealdialIndex = i;
                                    }
                                }
                            }
                            SGEntry sgeCCDToBeRevealed = (SGEntry)SGCore.SGList[revealdialIndex];
                            sgeCCDToBeRevealed.SGHideDial = false;

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();
                        }
                        else
                        {
                            ///////////////////////////////////////////////////////////////////
                            //De-Activate all stargates
                            SGCore.SGSystemEnabled = false;
                            from.SendMessage(77, "Stargate System disabled, any open gates will close down after they are used.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = false;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To DISABLED
                            ArrayList SGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    SGADevice.Add(item);
                            }

                            foreach (Item item in SGADevice)
                                (item).Hue = 39;



                            from.SendMessage(77, "Hide/Reveal");
                            from.CloseGump(typeof(SGGumpActivatorRemoval));

                            int revealdialIndex = 0;
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                                    {
                                        // this gate
                                        revealdialIndex = i;
                                    }
                                }
                            }
                            SGEntry sgeCCDToBeRevealed = (SGEntry)SGCore.SGList[revealdialIndex];
                            sgeCCDToBeRevealed.SGHideDial = false;

                            // ***************************************************
                            // * Force a Rebuild of Entire Shard Stargate System *
                            // ***************************************************

                            // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                            SGCore.SGTriggerSave();
                            // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                            SGCore.SGTriggerLoad();


                            ///////////////////////////////////////////////////////////////////
                            //Activate all stargates
                            SGCore.SGSystemEnabled = true;
                            from.SendMessage(77, "Stargate System enabled.");
                            for (int i = 0; i < SGCore.SGList.Count; i++)
                            {
                                SGEntry sge = (SGEntry)SGCore.SGList[i];
                                {
                                    sge.SGCanBeUsed = true;
                                    sge.SGBeingUsed = false;
                                    sge.SGEnergy = false;
                                }
                            }
                            // Hue Control Crystals To NORMAL
                            ArrayList NORMALSGADevice = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is SGActivatorDevice)
                                    NORMALSGADevice.Add(item);
                            }

                            foreach (Item item in NORMALSGADevice)
                                (item).Hue = 1933;

                            //from.SendMessage(77, "OPERATION ABORTED !!! Stargate System Still ACTIVE, Crystal Control Device's can only be revealed IF the systems DISABLED.");
                            //from.SendMessage(77, "Use [SGAdmin option to DISABLE the system 1st");
                        }
                    }
                    break;
            }
        }
    }
}


Also your Addon files

Code:
using System;
using System;
using Server;
using Server.Network;
using Server.Items;
using System.Collections;

uses the system a lot :)
 

FingersMcSteal

Sorceror
Most of those using system things are due to copy paste, theres a few but they only cause a warning so those got left, i might clean it up a bit more one day :)

If you mean by auto shut down gates while you edit a platform crystal to be hidden or not, it was done this way because the 'SGData.xml' file gets altered plus the systems surposed to be in a disabled state when this takes place.

The rebuild only takes out the platforms,symbols and crystals then replace's those again from the file after the change to the crystals (Hidden or revealed) since this information is stored in that file now on version v3.1, this is to allow the crystals to remain in whichever state after a shard restart or crash.

The field's and the teleport tiles are left alone since those are actually timers so either way there going to vanish eventually.

EDIT...

Also if you check the code in each case theres this check before it allows any change...

Code:
case 0: // Remove
{
if (!SGCore.SGSystemEnabled)
{

This was put in to ensure that there are no players able to tragger a gate while the admin's are making alterations to the whole system in the first place :)

The chances of a player hitting an activate button at the same time you hit delete/hide/reveal are pretty damn slim but i've always tried to make things i've written as idiot proof as possable, your allowing parts of the system to re-enable in the middle of the editing process's which to be honest... ain't so good me thinks... but it's there to be messed with :)
 

datguy

Sorceror
yea, what I did was

case 0: // Remove
{
if (!SGCore.SGSystemEnabled)
{
//Gates are already shut down
remove it
}
else
{
//GatesSystem is active so shut it down before removing one
shut it down
remove it
start gates back up
}
}

I copy/pasted exactly what the actual shut down & startup do from the other gump & tacked them in before & after the thing I want to do directly with the crystal, be it hide/show/delete. If i select to hide a crystal all gates shut down, the crystal hides, gates are saved, & loaded & all gates startup. All in less than a second. It does the same thing, near as i can tell as doing it with the AdminGump without having to open another gump. So the GateSystem IS shut down during the lengthy.5 second process

Like I said, all seems to be working with the auto shutdown/startup on hiding etc:D
 

seanandre

Sorceror
AWESOME system man! I used your old one too and it was great for it's time. This one is new and improved and we're loving it! It's amazing. It's so much like the TV show of which I'm a HUGE fan of.

Thank you!

Sean
 

LordHogFred

Knight
Awesome system!
Just wondering if it would be possible to make each gate need to be discovered on a per character basis, so only characters who have been to the gates can actually see the destinations.
 

FingersMcSteal

Sorceror
It's in the pipeline but i have other things currently on the go right now.

A few people have asked tho so it will get done eventually.
 

MaG_PaW

Sorceror
I am charmed with this system and work to the perfection.

But i like to be able change like the image of the accionador (the crystals), because in my version of it finalizes online, they are not seen, there goes out a square that it puts unknown, and me gustaria to change it into another thing, though it is a tablet of the game.

That I have to change code? In that I file? In that line?


Thank you.


Original text in spanish:


Me encanta este sistema y funciona a la perfeccion.

Pero me gustaria saber como cambiar la imagen del accionador (los cristales), porque en mi version del ultima online, no se ven, sale un cuadrado que pone unknown, y me gustaria cambiarlo por otra cosa, aunque sea una lapida del juego.

¿que codigo he de cambiar? ¿en que archivo? ¿En que linea?

Gracias.
 

FingersMcSteal

Sorceror
FingersMcSteal;727209 said:
Look in the SGActivatorDevice.cs and find this line just after the GET/SET region of code...

Code:
[Constructable]
public SGActivatorDevice(int sgaxloc, int sgayloc, int sgazloc, string sgafacing, int sgastyle, bool canbeused, bool beingused, bool energy, bool hidden, string discover, string locname, int facetID, int sgac1, int sgac2, int sgac3, int sgac4, int sgac5) : base(13803)
{

13803 at the end of that line is the itemID of the crystal, change to what itemID you require.

That should be it.

The questions been asked before ;)
 
Top