Hey guys, i've run into a trouble.

I'm translating the NPCs titles for my national language (Portuguese Brazilian), and i've run into some gender problem here.

For exemple, the alchemist in english works both for female and male.
In pt-br, the alchemist is "o alquimista" for man and "a alquimista" for woman.

So i've been fussing around, and found on the HireFighter.cs this gender if:
if (this.Female = Utility.RandomBool())
{
this.Body = 0x191;
this.Name = NameList.RandomName("female");
}
else
{
this.Body = 0x190;
this.Name = NameList.RandomName("male");
this.AddItem(new ShortPants(Utility.RandomNeutralHue()));
}

And i tried to do this:
if (this.Female = Utility.RandomBool())
{

this.Name = NameList.RandomName("female");
this.Title = "a alquimista";
}
else
{
this.Name = NameList.RandomName("male");
this.AddItem(new ShortPants(Utility.RandomNeutralHue()));
this.Title = "o alquimista";
}

Obviously it doenst work, and i really dont know what to do here. I tried to change the "this.Title =" for the similar that appears on the alchemist ": base(the alchemist)" but it didnt worked too.

One thing that i tried to do was to move around the ": base(the alchemist)", and i tried to create a utility random aswell but it all went crashes on the servuo console.

I'll update this if i get it right, but some enlightment would be nice !

Thanks in advance
 
Maybe try--you should have this at the top of the script
public Alchemist()
: base("a alquimista")
 
public class Alchemist : BaseVendor
{
private readonly List<SBInfo> m_SBInfos = new List<SBInfo>();
[Constructable]
public Alchemist()
: base("o alquimista")

Yea, but thats just the problem. If the vendor spawn woman, she'll be like " Lilly o alquimista" when it should be "Lilly a alquimista", and vice-versa.

I've found out more on the Actor.cs, there is actually the thing i did up there:

if (this.Female = Utility.RandomBool())
{
this.Body = 0x191;
this.Name = NameList.RandomName("female");
this.AddItem(new FancyDress(Utility.RandomDyedHue()));
this.Title = "a atriz";
}
else
{
this.Body = 0x190;
this.Name = NameList.RandomName("male");
this.AddItem(new LongPants(Utility.RandomNeutralHue()));
this.AddItem(new FancyShirt(Utility.RandomDyedHue()));
this.Title = "o ator";
}

But i still dont know why it works here and no in the Alchemist one. Or in any other at Vendors. There must be another way to do this
 
I am not quite sure I understand what you need here as it's quite late and I am about to go to sleep :)

However I believe you want to set the title of the vendor depending on the gender of the npc.

If that is the case then this will work for you:

Code:
        public Alchemist()
            : base("the alchemist")
        {
            this.SetSkill(SkillName.Alchemy, 85.0, 100.0);
            this.SetSkill(SkillName.TasteID, 65.0, 88.0);
            this.Title = this.Female ? "o alquimista" : "a alquimista";
        }

The blocks of code you were posting have redundant code to set the gender, names etc which is already taken care of elsewhere.
 
Nice dmurphy, works like a charm !

Ps: But if someone is looking for this too, the code dmurphy posted is working, but you have to change the order there in order to male be "o" and female be "a", like this:

[article]this.Title=this.Female?"a alquimista":"o alquimista";[/article]



As soon as i finish translating everything, i can upload here on the archives right?



Thank you
 
Back