Fixed Gender NPC Bug

Ziru

Citizen
Male npc have female body...
Female npc have male body...


This also occurs with nerun's distro.

GenderBug.png Untitled.jpg

i think that its not "gender" its bodyvalue.

------------------------------------------------------
some males got bodyvalue 401 (female body)
that have male cloth/armor
that have female names.

that must have bodyvalue 400 (male body)

------------------------------------------------------
some females got bodyvalue 400 (male body)
that have female cloth/armor
that have male names.

that must have bodyvalue 401 (female body)

------------------------------------------------------

how this can be fixed?
Thanks.
 
Last edited:

Ravenwolfe

Moderator
ServUO Developer
Fixed.

Overwrite or Merge (if you have edited BaseVendor). You will need to respawn all vendors.

Please test and report back if resolved.

Use the one below please.
 
Last edited:

Hammerhand

Rookie
Found a boo-boo in the fix... Line 44
public override bool CanTeach { get { return false; } }
Needs to be true or else the vendors cant teach the players anything.
 

Hammerhand

Rookie
Another boo-boo... line 51
public virtual bool IsActiveBuyer { get { return false; } } // response to vendor SELL
Should be
public virtual bool IsActiveBuyer { get { return IsActiveVendor; } } // response to vendor SELL
 

Macil

Citizen
Whoever made it might have wanted a player-based economy. 'Thus disabling the option to sell (not sure why buy would be enabled though - or why training would be disabled)..
 

Ravenwolfe

Moderator
ServUO Developer
Yes, sorry. When I posted that I forgot I had modified my basevendor to not teach or buy from players. My shard is based on Siege Perilous rules and that how it is on Siege. The vendors will sell to you but will not buy from you or train you in skills.

Here's a distro one with the fix...
 

Attachments

  • BaseVendor.cs
    36.4 KB · Views: 20
Last edited:

cmileto

Citizen
What I did was use the stock file but move this line:

Utility.AssignRandomFacialHair(this, hairHue); <--- can be found directly underneath this line: Utility.AssignRandomHair(this, hairHue);



down maybe 5 or 6 lines to where vendor sex had already been decided. My basevendor is way to intertwined with other custom scripts to swap it out. Mine now looks like so:


Code:
Utility.AssignRandomHair(this, hairHue);
// line moved to correct female facial hair
if (Female)
{
switch (Utility.Random(6))
{
case 0:
AddItem(new ShortPants(GetRandomHue()));
break;
case 1:
case 2:
AddItem(new Kilt(GetRandomHue()));
break;
case 3:
case 4:
case 5:
AddItem(new Skirt(GetRandomHue()));
break;
}
}
else
{
switch (Utility.Random(2))
{
case 0:
AddItem(new LongPants(GetRandomHue()));
Utility.AssignRandomFacialHair(this, hairHue);
break;
case 1:
AddItem(new ShortPants(GetRandomHue()));
Utility.AssignRandomFacialHair(this, hairHue);
break;
}
}

a quick respawn of my vendors and its right as rain.
 

Fireball

Citizen
I don't want to appear rude, but I just downloaded what says it is the latest ZIP file of ServUO in order to test it and the first thing I noted was that many of the female vendors were bearded, and some of the male vendors had female hair/clothes. I search for this and I find this thread dated November 2013 and it is now September 2014. I also had two main.cs crashes which I also find in another thread with some fix suggestions. Why has the ZIP file not been updated with these changes? If I use git to download instead will I get all of these old fixes which are not in the ZIP file? Again, I really don't wish to offend anyone, especially as a software developer myself, but as someone arriving to look at this software and test it, it is instantly rather off-putting to find it doesn't work right! Can we get the ZIP file updated with all the latest debugged scripts?
 

Ravenwolfe

Moderator
ServUO Developer
Ah yes, this fix was posted before I had access to the main repo for updates. I will get this fix in the main repo.

Not sure about the main.cs crashes, can you be more specific on those, maybe which ones or where you found a fix? Remember that main.cs is the base of any error but the real error is usually in one of the scripts, you have to look at the top of the error report, not the bottom, they are read from the bottom up.
 

Milva

Administrator
Moderator
Fireball please be patient :) As all of our Developer's have been very busy with work and real life issues. Ravenwolfe has stepped up to handle the bugs so that ServUO will be complete, as Ravenwolfe stated he just gained access to the main repo to fix pending bugs.
 

Fireball

Citizen
Hi Milva and Ravenwolfe,

Thank you both for your explanations. I was trying my best not to appear ungrateful for your hard work which you provide for FREE :)

I am, perhaps, just a little confused with this SVN/Git type thing (of which I am a total newbie) because I thought the whole point of it was that these changes and bug-fixes automatically became available to everyone without having to make the code patches manually yourself. I guess I wasn't understanding why I wasn't getting them and I'm still not, really! :)

I am very well aware of the pressures of real life. Got quite a few myself, so you have my sympathy! :)

I have been setting up a UO server which has been an interesting learning process, but rather than using the system I have started with, I wanted to go for your system, ServUO, which has an active team actually working on it <grin> so I will just be patient and wait until you have something I can start building from.

Kind regards
 

Ravenwolfe

Moderator
ServUO Developer
People post bugs here and someone may post a fix for it. However, it doesn't go into the main repo (Github) until someone with write access can update it. I just recently got write access and the others have been missing, so Github had not been updated. When we post a commit to the repo, it will update the zip for you to download. I just sent the fix for female beards to the main repo, so if you download the zip now, it is fixed.

However, you haven't told me the other errors you were referring to, so I can't update those until I know what you are talking about.