Vert-I-Go

Squire
ServUO Version
Publish Unknown
Ultima Expansion
None
Ok I am making a new type of training for pets and im using my animal lore gump. not to get into all the details I have most of it worked out. The problems im having are that I am using a custom general type of mobile a BaseTameable mobile (Which I will include). In the OnResponse section i can get it to add strength points to the basecreature part but I am having issues with it trying to subtract points from the basetameable section. and I am also having issues with getting it to open a new gump getting the
Errors:
+ Skills/AnimalLore.cs:
CS0103: Line 738: The name 'from' does not exist in the current context.
I will post the code I think is relevant not entire code and i will attach files that this uses see if I can get some help. So close to getting this to work lol

The two areas I am having issues with are
m_BT.TrainingPoints -= 1;
m.SendGump( new AnimalLoreGump( from, m_Pet ) );
I think I have a clue but not really sure about how to fix it if there is a script I can look at to give me a push in correct direction that would even help

Animal Lore Gump sections:
    public class AnimalLoreGump : Gump
    {
        private BaseCreature m_Pet;

        private BaseTameable m_BT;
     

        public AnimalLoreGump( Mobile from, BaseCreature c ) : base( 250, 50 )
        {
            m_Pet = c;
         
            BaseTameable BT = c as BaseTameable;

        public override void OnResponse( NetState sender, RelayInfo info )
        {
            Mobile m = sender.Mobile;
            //BaseTameable BT = m as BaseTameable;
         
            if ( m == null )
                return;

            switch ( info.ButtonID )
            {
                case 0:
                {
                    break;
                }
                case 1:
                {
                    m.SendMessage( 0x5, "You Raised the Strength of your pet." );
                    m_Pet.Str += 1;
                    m_BT.TrainingPoints -= 1;
                    m.SendGump( new AnimalLoreGump( from, m_Pet ) );
                    break;
                }
                case 2:
                {
                    break;
                }
                case 3:
                {
                    break;
                }
            }
        }
Ok I figured out the Subtracting from the BaseTameable now just need to figure out how to open the gump back up when clicking on button or on response lol
the
Errors:
+ Skills/AnimalLore.cs:
CS0103: Line 738: The name 'from' does not exist in the current context
which is this line of code
m.SendGump( new AnimalLoreGump( from, m_Pet ) );
 

Attachments

  • AnimalLore.cs
    29.2 KB · Views: 3
  • BaseTameable.cs
    6.5 KB · Views: 4
Last edited:
OP
Vert-I-Go

Vert-I-Go

Squire
OMG lol i did that before with a bunch of other changes got a crash but just tried it now and bam worked just fine lol thanks for a simple fix heheh
What it looks like yay working
animal training.jpg
 
Last edited:

jinh86

Citizen
Not really connected to the thread but...blue font on blue background it's a very, very bad idea for contrast and accessibility (e.g. "Strength").
Please revise that :p
 
OP
Vert-I-Go

Vert-I-Go

Squire
Not really connected to the thread but...blue font on blue background it's a very, very bad idea for contrast and accessibility (e.g. "Strength").
Please revise that :p
I have played around alittle bit with color but cant seem to find a good almost white to contrast. didnt really look that hard but here is line of code i use.
AddHtmlLocalized( 153, 168, 160, 18, 1028335, 152, false, false ); // Strength
the 152 is the blue i tried the 1152 which is white in hue pallet but doesnt come out white which is wierd but if have any ideas what a good color would be I am willing to try stuff never set on colors lol.
 

jinh86

Citizen
Correct on the +1!
Anyway white for sure works, but also any light (not much saturated) green can contrast that deep blue.
You can also use a very light blue, but you already use it for the title (e.g., "Physical Attributes" kind of aquamarine).

A non-shocking (lil dirt) white would be the best. But anyway my point was just, no blue on blue ^=^
 
OP
Vert-I-Go

Vert-I-Go

Squire
1153 doesnt come out as white. I think it has to do with it being a HTML Localized why colors arent from hue pallet ots probably a hex code color here is what 1153 looks like on gump dark green almost
Untitled.jpg
 

Kita

Rookie
Come to think about it, I remember something about the Html fields acting like this, but labels don't, not sure if that is still the case, been a long time since I made a gump lol
 
OP
Vert-I-Go

Vert-I-Go

Squire
800 is a bright green so that works. so much better but ya didnt fiddle with it to much was more worried about function right now ill play around with colors later but yes blue on blue isnt greatest so i was keeping that in mind trying to get it so can view my two different types of tameable creatures with training abilities my BaseTameable and regular BaseCreature finnaly in home stretch lol.