So I made a custom welcomer NPC and I am trying to get him to spawn facing south so he is actually facing players. I tried setting Direciton = South, (and Direction = south;) right here.

public Welcomer() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = NameList.RandomName("male");
Title = "The Welcomer";
Body = 0x190;
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
CantWalk = true;
Direction = south;

But it just errors out. I have checked the RunUO forums with no success in an answer. Is there any way at all to do this?
 
You can also [set direction south in game, click on npc but every time it spawns you would need to do it again :)
 
  • Like
Reactions: ExX
Yea I didn't want to have to redo that everytime it spawned. :) Thank you so so so much dmurphy.

Direction = Direction.South;

This script I have been working on for like a week and it's just a normal NPC that will face you, talk to you, send gump info etc. I thought it was going to be so simple but I have learned more from this one script than any other one I've deconstructed / edited in the last month I have been workng on the emulator. A big thank you to everyone that is helping new players. /end rambling
 
Use the xml spawner and check the props on it after the npc is spawned, there just might be a direction listed there
 
  • Like
Reactions: ExX
it's just a normal NPC that will face you, talk to you,

There is a method that you can use if a player triggers a spawn, that will face the mobile to the player.

Something like "GetDirectionTo(Point3d p)"

So, if your player's variable is "from" the script would look like this:

Code:
Mobile mob = new MySpawnedMobile();
mob.Direction = GetDirectionTo(from.Location);
 
  • Like
Reactions: ExX
If you're using Xmlspawner, you can set the direction as a property for that mob:
Code:
Ogre/Name/Bilge/Direction/South/Frozen/True

That's how the spawn entry looks on the Xmlspawner.
 
  • Like
Reactions: ExX
Back