FaceMelter
Member
- ServUO Version
- Publish Unknown
- Ultima Expansion
- None
So, I'm plugging away at my current project and things are going well. I've relearned XmlSpawner (again, lol) and I'm happy with much of the custom things I've done so far. I've been using XmlSpawner for the backbone of my quest system and I want to modify the GUMP that pops up when players talk to my Quest NPC's. I've taken a look at how XmlQuestGump.cs generates the GUMP based on type, and how it adds the buttons based on what you choose. I'm happy with that functionality. I can freely modify the base GUMP graphics and background in the file easily.
What I would like to do, is add custom Portraits to the GUMP. I don't want to just pull up a false paperdoll. I would like to access the NPC's Hair Style, Hair Color, Facial Hair, Facial Hair color and Skin tone. Then use that data to pull up custom art that I will load into the client to generate the Portrait. Some specific NPC's will have fully custom portraits, but mostly just the well known previous companions of the Avatar. To use Ultima 7 for example (I've already slightly modified this one) here's Sentri's:
I understand that there must be a plethora of methods to achieve this, so before I dig deep into making any big changes to XmlQuestGump.cs, I'd like to get some opinions on my approach or gather some advice on the matter.
This first portion of the code references "object invoker". Would this perhaps be the XmlQuestNPC? I see that it is an Object, and not a Mobile. Or is this just a part of XmlSpawner's internal reference? Would I need to alter or expose the NPC's (as a Mobile) data so that I can reference it here?
I know that I can access the player's data by calling it from the Mobile "from" here, so I should be already able to do this for the player. Would there be an easier way to approach this? Or would any one recommend a better way to achieve something similar?
I've done some searching and I haven't seen this done before. I know that if I can access the XmlQuestNPC's data I can get this working. Eventually anyway, lol. Thank you for reading and providing any insight!
EDIT: Small update, I've learned that the item ID's for the GUMP and Mobiles are entirely different. I will have to run a check for what the Mobiles data is, and translate that to the appropriate GUMP ID. I'm able to access the Player's data by referencing "from", but after checking it out, invoker is not a Mobile, so I cannot use that to pull the data from the XmlQuestNPC. I'll have to figure out how to include that data somehow after I get the player's Portrait working.
What I would like to do, is add custom Portraits to the GUMP. I don't want to just pull up a false paperdoll. I would like to access the NPC's Hair Style, Hair Color, Facial Hair, Facial Hair color and Skin tone. Then use that data to pull up custom art that I will load into the client to generate the Portrait. Some specific NPC's will have fully custom portraits, but mostly just the well known previous companions of the Avatar. To use Ultima 7 for example (I've already slightly modified this one) here's Sentri's:
I understand that there must be a plethora of methods to achieve this, so before I dig deep into making any big changes to XmlQuestGump.cs, I'd like to get some opinions on my approach or gather some advice on the matter.
XmlQuestGump.cs:
public XmlSimpleGump( object invoker, string gumptext, string gumptitle, int gumptype, BaseXmlSpawner.KeywordTag tag, Mobile from, XmlGumpCallback gumpcallback) : base( 0, 0 )
{
string maintext = gumptext;
int nselections = 0;
int height = 400;
int width = 369;
Closable = false;
Dragable = true;
m_gumptype = gumptype;
m_invoker = invoker;
m_keywordtag = tag;
m_gumpcallback = gumpcallback;
AddPage( 0 );
This first portion of the code references "object invoker". Would this perhaps be the XmlQuestNPC? I see that it is an Object, and not a Mobile. Or is this just a part of XmlSpawner's internal reference? Would I need to alter or expose the NPC's (as a Mobile) data so that I can reference it here?
I know that I can access the player's data by calling it from the Mobile "from" here, so I should be already able to do this for the player. Would there be an easier way to approach this? Or would any one recommend a better way to achieve something similar?
I've done some searching and I haven't seen this done before. I know that if I can access the XmlQuestNPC's data I can get this working. Eventually anyway, lol. Thank you for reading and providing any insight!
EDIT: Small update, I've learned that the item ID's for the GUMP and Mobiles are entirely different. I will have to run a check for what the Mobiles data is, and translate that to the appropriate GUMP ID. I'm able to access the Player's data by referencing "from", but after checking it out, invoker is not a Mobile, so I cannot use that to pull the data from the XmlQuestNPC. I'll have to figure out how to include that data somehow after I get the player's Portrait working.
Last edited: