Quick Q. NPC with horse, regular visit to pub, puts horse in

Post » Fri Dec 02, 2011 2:23 pm

Ok, sorry if this is a question that I could answer myself with a few hours of testing. However I am on a really tight schedule wanting to get the mod uploaded as soon as possible. I would really appreciate a "ickle baby simple guide" something I cant fail to get right, of how to do the following.

1. NPC on an evening from 1800 goes outside of his cottage, goes into his stables, gets on his own horse thats waiting there.
2. Rides his own horse a few cells to a pub.
3. Horse and rider arrive at stables, horse stays at stables.
4. Man goes into pub and stands drinking or eating. (preferably randomly one or the other)
5. Man leaves pub, goes and gets his own horse.
6. Man rides horse home to his own stables.
7. Horse left at own stable, man goes indoors and goes to bed.

I need a real simple step by step of everything I need for the horse and the man.

If someone could help it would be fantastic. Sorry I just dont have the time to F@rt around testing and retesting to discover it myself.

Thanks in advance to anyone who can help.
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Fri Dec 02, 2011 9:20 am

Assuming you're OK with the general AI packages for that sequence without the horse, the only additions are:
1) Horse is owned by NPC
2) NPC has Travel Horse set to the same horse.
3) Travel packages between stable and pub specify "Uses Horse"
4) Horse's own AI keeps it at current location by default, so it doesn't wander home without him, or leave the stable at home.
5) There's an Xmarker at the stable to use as a waypoint

You'll need separate AI travel packages for the NPC for house<->stable (without use horse) and stable<->pub (with use horse) - i.e. don't send the NPC directly from house to pub and vice versa without collecting the horse or dropping it off.

The second part of each journey would be triggered by distance from the stable Xmarker. Scheduled travel (with must reach) sends NPC to Xmarker at stable, then when close enough, another one send him to house or pub as applicable. Because the same Xmarker is used in both directions, you'll need a quest variable to pick where he's going next. Set that with OnPackageStart block in NPC's object script for the scheduled ones. e.g.
OnPackageStart NPCGoToPub   Set TowardsPub to 1endOnPackageStart NPCGoHome   Set TowardsPub to 0end

And then use that variable in the package conditions along with the GetDistance Xmarker test.
User avatar
Nathan Hunter
 
Posts: 3464
Joined: Sun Apr 29, 2007 9:58 am

Post » Fri Dec 02, 2011 10:56 am

Couldnt I just use a set timed package.
1. 1700 leave house and go to pub, always ride.
2. arrive at x marker.
3 check to see if at x marker then next package
4 into pub and eat package
5. back to home x marker always ride.
6 at x marker home, go indoors and sleep?

Rather than scripts?

Also which horse to use? I take it I create a new horse? or do I just drag one of them from the Creature, horse list, such as "horse paint" then adjust the variables in the new article window rather than making a copy of the horse paint? As you can see this bit is a bit new to me.
User avatar
chinadoll
 
Posts: 3401
Joined: Tue Aug 22, 2006 5:09 am

Post » Fri Dec 02, 2011 10:24 am

Anyone? I know it looks like a daft question, but Im spinning dozens of plates, trying to get lots of different jobs done in the mod and up against the clock.
User avatar
Charity Hughes
 
Posts: 3408
Joined: Sat Mar 17, 2007 3:22 pm

Post » Fri Dec 02, 2011 5:10 pm

The need for the script is because you need two separate packages for the "near the stables XMarker" situation, and you have to choose the one for the right direction. Otherwise when your NPC gets to the stables, he'll always go to the pub, which won't be too good on the way home. It's possible that you could use a test on GameHour instead, but that can break if he's delayed by anything in starting the journey, and then he'd get stuck at the stables for 24 hours.

You can probably create a new copy of one of the horses just by dragging it into place. Then you edit it for ownership, and select it as the NPC's TravelHorse. It's only necessary to create a new form if you need different AI from the original horse, but I haven't checked to see if they all have a "return to base" package. If they do, then you might have to make a clone first, so you can delete that for yours. If all they have is "Wander at current location", you're good to go.
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm


Return to IV - Oblivion