AI Package Getting Stuck on Steps. Work-arounds?

Post » Wed Jun 20, 2012 10:40 am

The player, following an NPC with the follow AI package seems to get stuck on steps. 75% of my tests so far following an NPC up the steps in Riften to the castle end up with the initial NPC not having any problems but the player getting stuck on the steps indefinitely.

I tried to TCL my way out but that just makes you sink vertically downwards. I'd like to allow the player to jump, but no other movement controls but I don't think that's possible. I could put a trigger box there, where if the player is in it for a certain length of time it would teleport the player to the top of the steps, but won't that make my mod incompatible with any mod that modifies Riften? Also, I'd have to do this for every area where it is possible to get stuck, not to mention ruining immersion.

Any suggestions how to fix this or get around it would be greatly appreciated.
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Post » Wed Jun 20, 2012 11:37 am

Put a timer on it...say, Registerforupdate(5) - if his location doesn't change by more than 50, do a MoveTo to the NPC's location.

Won't be pretty, but it should get him unstuck. Or you could have him do a MoveTo his own location with a +50 Z axis component...that should be the equivalent of jumping.
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Wed Jun 20, 2012 11:45 am

Redwood Elf, you are currently my favourite person in the world. Adding +50 to the Z component worked like a charm, and as you're walking up steps it's not even noticeable.
User avatar
Nicholas
 
Posts: 3454
Joined: Wed Jul 04, 2007 12:05 am

Post » Wed Jun 20, 2012 7:24 pm

I thought I'd solved this issue, apparently I haven't. The above strategy helped a little on the Whiterun steps, but the steps in Castle Dour in Solitude are much steeper. This is the last thing I need to fix for my mod that I've been working on for ages and it's driving me crazy.

An NPC, with the travel AI package walks up the steps normally, but the player, after disableplayercontrols and SetPlayerAIDriven(true) and the Follow AI package applied with the first NPC as the target, follows the NPC perfectly on the flat, but as soon as the NPC walks up the steps the player just gets completely stuck right at the bottom. The player does the walking up steps animation on the spot as if there is clipping in front. What is it that allows an AI driven NPC to walk up steps but not an AI driver player?
User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Wed Jun 20, 2012 3:18 am

Well, if you're up to a bit of trigonometry, you can have it check a second time, and if the player STILL is in more or less the same place (Same check as before) Move the player not only up (by about 200.0 in the Z this time) but towards the target NPC (Get the heading angle, and I think This would work)

Import MathFloat XOffset = 100.0*Cos(Game.GetPlayer().GetHeadingANgle(NPC))Float YOffset = 100.0*Sin(Game.GetPlayer().GetHeadingAngle(NPC))Float ZOffset = 200.0Game.GetPlayer().MoveTo(Game.getPlayer(),XoffSet,YOffset,ZOffset)

If the direction i swrong, reverse the SIN and COS functions.
User avatar
SamanthaLove
 
Posts: 3565
Joined: Mon Dec 11, 2006 3:54 am

Post » Wed Jun 20, 2012 3:58 am

Thanks again Redwood. I'll have a play around with this while I continue to look for a more permanent solution.
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm


Return to V - Skyrim