Resource icon

Daat99's World Omniporter For ServUO 2.5

No permission to download

Fireball

Citizen
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.
 

kfritz411

Citizen
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
 

Lokai

Moderator
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.
 

kfritz411

Citizen
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
 

Fireball

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

Lokai

Moderator
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.
 

kfritz411

Citizen
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.
 

Fireball

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

kfritz411

Citizen
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: 4

Fireball

Citizen
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
 

kfritz411

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

kfritz411

Citizen
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
 

Lokai

Moderator
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
 

kfritz411

Citizen
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
 

Lokai

Moderator
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 ---