How do you add custom locations to the omniporter? Not add to custom locations, but add to the top level like where Malas, Trammel, and the other facets are?
 
That would be difficult and require a complete rewrite. Alternatively, you could rename one of the core facets, keeping the same number of them intact, and it would be considerably easier. To do that, you would need to rename it both in the declaration part starting around line 508, and also in the m_Entries array, and in the gump pages.
 
Umm....why would it take a complete rewrite? I'd like to see what parts of it need to be rewritten and if it can be done i'm willing to do it.
 
If you look through WorldOmniporter.cs it has Thanimur and Sosaria setup in it already but commented out. You should be able to edit those to be able to do what your wanting to do.
 
This piece of code throws an error if added on to.

Code:
private static string[] m_Entries = new string[]
        {
            "Trammel", "Trammel Dungeons", "Felucca", "Felucca Dungeons",
            "Public Moongates", "Ilshenar", "Ilshenar Shrines", "Malas",
            "Tokuno", "TerMur", "Custom"
        };

Any idea why?
 
to add more pages you also have to increase the 12 and the 13 in the following sections:
Code:
if ( page < 0 || page > 12 ) // If you add a page, you need to raise the last number here....

and:
Code:
//Change the below line every time you add a page....
            for ( int x=0; x<=13; x++ )

I'd need to see what you have in the script to be able to assist further if it still isn't working.
 
Its still crashing. Majorly. I attached my copy of the omniporter.
 

Attachments

  • WorldOmniporter.cs
    69.4 KB · Views: 7
Give this a try. I ended up moving the 3 sections you wanted added over to a new file to get it to work. I'm not sure really what was wrong with the one you uploaded. I tested it out and it loads up and I can port around just fine so I think you should be good to go.

It now has "Guardia Towns" "Guardia Sites" and "Guardia Dungeons" all pointing to the "Luna Hub" that you had setup. You will need to add in the locations you want to be able to gate to (starting at line 760).
 

Attachments

  • WorldOmniporter.cs
    69.2 KB · Views: 5
I tried to add another facet, "Guardia Shrines" and it crashed again.
 

Attachments

  • [ServUO.com]-WorldOmniporter.cs
    73.5 KB · Views: 2
The main thing you missed was increasing the numbers in 3 spots for the extra section. If you happen to add another one search for:
//Change the below line every time you add a page....
and you should find them just increase the larger number on the line below it and it'll add room for the new spot.

The other thing was adding in the GlobalEntries section.

I increased the numbers and added the GlobalEntries section you'll still need to add the locations you want it to go to however. (line 834)
 

Attachments

  • WorldOmniporter.cs
    73.7 KB · Views: 5
The main thing you missed was increasing the numbers in 3 spots for the extra section. If you happen to add another one search for:
//Change the below line every time you add a page....
and you should find them just increase the larger number on the line below it and it'll add room for the new spot.

The other thing was adding in the GlobalEntries section.

I increased the numbers and added the GlobalEntries section you'll still need to add the locations you want it to go to however. (line 834)

Change the below everytime I add a page? What am I to change it to?
I tried the fixed script and Guardia Shrines doesn't show up.
 
Your main problem was in the construction of your Option Flags. They operate on Bitwise values, so each position must be unique. When you use values like 401, 402, 403, what you are actually saying is 400 and 001, 400 and 002, or 400 and 003 (which is 001 and 002.) So, GuardiaSites - option 402, would be the same as Custom (400) and Trammel (002) both being True. Give me a few minutes and I will pull your custom entries together in a working script.
 
OK. This one works. I have included comments for readability. I used the Sosaria and Thanimur locations as examples of how to add additional locations. Everywhere something needs to be changed, I have it marked with "/// -- LOKAI CUSTOM CHANGE"
 

Attachments

  • WorldOmniporter.cs
    76 KB · Views: 26
When I use the custom one you made it fatally crashes my shard because I am guessing I do not have the regions you added or maybe I was just deleting to quickly and need to slow down and go over it with a comb. I will check it out and work more with it later when I understand it better, for now, I am just going to be using the simple one
 
Curiously i havent been able to check this out because i keep getting this error when trying to compile


+ Custom/Systems/World Omniporter v2.5/WorldOmniporter.cs:
CS0115: Line 393: 'WorldOmniporter.OnSingleClick(Mobile)': no suitable method found to override

Any ideas or helpful pushes in the right direction would be amazing. <3
 
They recently removed onsingleclick from servuo so you should just need to comment out or delete that section.
 
I've read the announcement now and understand what's happening. Fair enough. At least we have the last snapshot for those that want to build an era accurate shard.
 
How difficult would it be to restrict travel if carrying a town sigil? I tried looking at the publicmoongate.cs but I can't seem to wrap my head around how to copy those restrictions and apply to worldomniporter.cs
 
How difficult would it be to restrict travel if carrying a town sigil? I tried looking at the publicmoongate.cs but I can't seem to wrap my head around how to copy those restrictions and apply to worldomniporter.cs
Something like:

Code:
            if (Factions.Sigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }

Basically, just adding another if clause. This code was taken from Moongate.cs, so it won't just plug and play directly into the Omniporter. The variable 'm' might need to be changed to something else. You might need to insert this into the section where other "if" or "else if" conditions are being checked.
 
Something like:

Code:
            if (Factions.Sigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }

Basically, just adding another if clause. This code was taken from Moongate.cs, so it won't just plug and play directly into the Omniporter. The variable 'm' might need to be changed to something else. You might need to insert this into the section where other "if" or "else if" conditions are being checked.
Hey Lokai, I have been toying around with this and sadly the only thing I've been able to do is crash the server, and make the system say "You can't do that while carrying the sigil" when you open the gump and have a sigil on you. I've tried working in the factions.sigil.existson piece but I can't get it to jive. I then had the idea to add it as an "OptFlag" so I could just add it as an argument, but I don't understand where these numbers are coming from:

1604424861330.png
 
What is the error? Might just be a missing null check?

I don't use WorldOmniPorter so I don't know how it works, but I would put a new flag in there under AllowRed called AllowSigil for which the value would be 0x09000400 to allow Sigil carriers and 0x00000000 to not allow Sigil carriers. Then find the section where AllowReds is tested and add in there a section with the "ExistsOn" test from Moongates.cs which Lokai provided.

Here you are, I have done it but this is untested

Add this line under "AllowReds" in the OptFlags section
AllowSigil = 0x09000400, ///-- When 'true' transport is allowed while carrying a faction sigil

and then find the CanUse method and underneath the AllowReds line add
if ( !AllowSigil && Factions.Sigil.ExistsOn(m))
{
m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
return false;
}

Let us know if that works.
Post automatically merged:

What is the error? Might just be a missing null check?

I don't use WorldOmniPorter so I don't know how it works, but I would put a new flag in there under AllowRed called AllowSigil for which the value would be 0x09000400 to allow Sigil carriers and 0x00000000 to not allow Sigil carriers. Then find the section where AllowReds is tested and add in there a section with the "ExistsOn" test from Moongates.cs which Lokai provided.

Here you are, I have done it but this is untested

Add this line under "AllowReds" in the OptFlags section
AllowSigil = 0x09000400, ///-- When 'true' transport is allowed while carrying a faction sigil

and then find the CanUse method and underneath the AllowReds line add
if ( !AllowSigil && Factions.Sigil.ExistsOn(m))
{
m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
return false;
}

Let us know if that works.

Sorry, that will ALLOW travel with the sigil. As mentioned above, male the value 0x00000000 to prevent travel with a sigil
 
Last edited:
Hey Lokai, I have been toying around with this and sadly the only thing I've been able to do is crash the server, and make the system say "You can't do that while carrying the sigil" when you open the gump and have a sigil on you. I've tried working in the factions.sigil.existson piece but I can't get it to jive. I then had the idea to add it as an "OptFlag" so I could just add it as an argument, but I don't understand where these numbers are coming from:

View attachment 16958
To be honest I have no idea what they did to my flags. The flags operate on a bitwise check, so there should be a unique placeholder for each flag, and the numbers they have there with all the ones starting with 0x09.... just don't make any sense to me. Each flag should be Double the one below it. So the progression would be 1, 2, 4, 8 for each digit. In Hexadecimal, there are 16 digits, so the last one "16" is actually the 1's place of the next position to the left. This gives us 4 possible "flags" for each place value in the number, and there are 8 place values in the number, giving us 32 possible flags that can be generated. Since there are 26 flags here, they could have continued the correct sequence, but for some reason decided to break it. I have no idea why.

Why Double? Because if you add any of the flags together, you always know which ones are "active" because the sum will always yield the values included. Think of it this way: if you are given the number 11, you know that ONLY the combination of 1, 2, and 8 will come out to 11. NO OTHER COMBINATION of numbers will give you that answer. You can do that with ANY number using this method. So if the value for the flags was 11, you know that travel is only allowed to Felucca, Trammel and Malas, and you know all the other flags are turned off.
 
Thanks for the info! Sadly, I'm stuck at work for the next 12hours on this fine Wednesday (or as I call it Hostage Situation: Day 3)

I will test this as soon as I am out of here.
 
The United Kingdom goes into LockDown 2.0 starting tomorrow until 2nd December so things are a bit funky for us too.
Post automatically merged:

To be honest I have no idea what they did to my flags. The flags operate on a bitwise check, so there should be a unique placeholder for each flag, and the numbers they have there with all the ones starting with 0x09.... just don't make any sense to me. Each flag should be Double the one below it. So the progression would be 1, 2, 4, 8 for each digit. In Hexadecimal, there are 16 digits, so the last one "16" is actually the 1's place of the next position to the left. This gives us 4 possible "flags" for each place value in the number, and there are 8 place values in the number, giving us 32 possible flags that can be generated. Since there are 26 flags here, they could have continued the correct sequence, but for some reason decided to break it. I have no idea why.
I didn't realise you wrote that originally. I just assumed the author left gaps for future expansion. I looked at it years ago when I changed my moongates from the era-accurate random destination, to the menu system. It was too complex for me to get my head around at that time though! More recently I put in the stargate system which I like, but I wanted to change the numbers system that it uses. But then my shard went dead and there seemed little point in spending time developing it further.
 
Last edited:
It loads, no errors, no crashes, still works for everyone....... sadly..... it works for everyone......

I used a "red" char and the menu is properly restricted, but still, holding a sigil, I can go anywhere I want. Omniporter is properly restricted by a RED character carrying a sigil, so I'm assuming I've missed or done something incorrectly. I added everything to the best of my knowledge and then tried to mimic the m_Reds, !m_Reds, and AllowReds entries in hopes it just restrict it the same way it currently does "reds" but no dice.

If someone smarter than me could take a look at tell me what I missed, that would be super awesome.

Thanks!
 

Attachments

  • WorldOmniporter.cs
    67.8 KB · Views: 5
Yes that is set to allow travel with the sigil. Like I said in my message, you need to set the flag to 0x00000000, for AllowSigil to block sigil traffic
 
setting it to all 0's still let's them use the omniporter it just shows the message. What I'm trying to achieve is the same limitation that's applied to reds
1604579668417.png

I need to get it to restrict like this when carrying the sigil
Post automatically merged:

Currently, with the way it's set in the above file, when carrying the sigil, you get options for Tram, Ilsh, Malas, etc, I'm trying to break it down so if you're carrying the sigil you're restricted to Fel locations just like a red
 
Last edited:
That's what I thought I did, but it's not restricting the sigil carrier to only fel locations, it still allows someone carrying the sigil to travel anywhere they'd like
 
I think this has gone away from your original request. You want to simply block travel if they are carrying the sigil? Or do you want to have the OPTION of blocking using one of the flags. You don't need to use the flags if you are just trying to block carrying the sigil through the omniporter. All you need is to add the "else if" statement above to the "OnResponse" method. If you want I also have an earlier version of the script before the flags were changed and everything works on it. I even added the Sigil part. Here is a screenshot:

1604587603286.png
 
Hey Lokai,

Sorry, I know sometimes I'm not the best at expressing what I'm trying to do :)

I can completely block them, I got that working, but I'd like them to be able to still use it to travel to Fel locations. When using Omniporter as a "red" I'm restricted to only Fel locations, that's what I'm trying to do to Sigil holder
 
Here is the code in context:

C#:
                from.SendLocalizedMessage( 1019002 );                 // You are too far away to use the gate.
            else if ( from.Criminal )
                from.SendLocalizedMessage( 1005561, "", 0x22 );     // Thou'rt a criminal and cannot escape so easily.
            else if ( Server.Spells.SpellHelper.CheckCombat( from ) )
                from.SendLocalizedMessage( 1005564, "", 0x22 );     // Wouldst thou flee during the heat of battle??
            else if ( from.Spell != null )
                from.SendLocalizedMessage( 1049616 );                 // You are too busy to do that at the moment.
            else if (Factions.Sigil.ExistsOn(from) && m_Entry.Map != Map.Felucca)
                from.SendMessage("You can only travel to Felucca while carrying the Sigil.");     // <<<<< THIS WAS CHANGED. <<<<<
            else if ( from.Map == m_Entry.Map && from.InRange( m_Entry.Destination, 1 ) )
                from.SendLocalizedMessage( 1019003 );                 // You are already there.
            else if ( message == msg )
                DoTravel( from );                                    // --- Travel ---
 

Active Shards

Donations

Total amount
$80.00
Goal
$1,000.00
Back