Jump to content

Run not very far away package?

Recommended Posts

Run For Your Lives does a decent job of getting folks to run away and hide. Immersive Citizens does something similar, with a whole lot more work.

With Touring Carriages, we don't want folks (or animals) to hide, we just need them out of the roadway. But I cannot find a package that does this.

Fear doesn't work. Ever notice how fear on a bunch of skeletons causes them to all run out of the same doorway? Same problem here. They run up the prefered navmesh, that happens to be the roadway, the horse is faster, it runs over them, they die.

Sollar (Rick) came up with the idea to push them. They ragdoll, but usually don't die. After 8 years, I'm looking for something better?

Link to comment
Share on other sites

Does the carriage know when it is approaching or bumping into an actor?
Perhaps, there's a way to move actors to a node on the side of carriage. With either an existing node on the mesh or by adding one on either side towards the front. ??

Another mechanism that comes to mind....  In Fast Travel Ambushes we used a form list full of things like trees, rocks bushes, anything that would typically be found next to a roadway. When spawning highwaymen for an ambush the script looks for nearby objects from that list and spawns them there around player.
Maybe try adding something like that to a flee package where the actors would look for something to travel to that is not normally found in the middle of roads. 

Link to comment
Share on other sites

Tried that, simply running into the NPC doesn't register OnHit on the carriage. By the time the NPC knows it's been run into, that usually registers so much damage it dies under the wheels.

Currently, TC scans the road periodically ahead of the horse, selects a random NPC, and pushes the NPC to the side. So fleeing toward an object instead is clever. I'll take a look at Fast Travel Ambushes. Thanks.

Link to comment
Share on other sites

18 hours ago, DayDreamer said:

... TC scans the road periodically ahead of the horse ...

Is that just in a script or quest alias?

I'm thinking a quest alias that is 'In Loaded Area - Closest' and has conditions for IsActor and the horse HasLOS to them. If that alias is filled (or aliases) then they get the flee package. Then you say like OnCellChange and Reset - Stop - Start the quest to refresh. That may be too quick but you'd want to refresh often.

Were just some more thoughts on this. I'd like to try TC out again. Think I tried it in OldRim many years ago. It's amazing all those driver comments were in there and not used.

Link to comment
Share on other sites

On 5/1/2020 at 1:40 AM, Jebbalon said:

Is that just in a script or quest alias?

Script. Currently runs at a variable rate.


;/ CowCatcher from ScenicCarriagesCarriage
;	horse instead of cart & driver for more directional aim
Event OnUpdate()
	Float TrigAngleZ ;the rest of the world's interpretation

	Float GameAngleZ = GetAngleZ() ;the game's version
	if ( GameAngleZ < 90 )
	  TrigAngleZ = 90 - GameAngleZ
	  TrigAngleZ = 450 - GameAngleZ

	float posX = GetPositionX() + Distance * Math.Cos(TrigAngleZ)
	float posY = GetPositionY() + Distance * Math.Sin(TrigAngleZ)
	float posZ = GetPositionZ()
	Actor closest = Game.FindRandomActor(posX,posY,posZ, 275)
;	Actor closest = Game.FindClosestActor(posX,posY,posZ, 200); [Scenic]

	; Don't push the driver, horse, player, or other riders
	if (closest != None && closest != self && closest != tourDriver && !closest.HasKeyword(RidingInCarriage))
		tourDriver.PushActorAway(closest, 5.0); 9.0 [Scenic]
		TourUpdatingRate /= 4.0; check for groups
		Distance = 100.0
	elseif TourUpdatingRate <= 0.70710678
		TourUpdatingRate *= 1.41421356; backoff
		Distance = 125.0
		Distance = 150.0

	If TourUpdating


Had moved this from the driver into the horse, so it worked better as the carriage turned corners. Also, driver has its own OnUpdate for Say() chatter.

But it tends to miss NPCs that move just in front of the seat between the horse and driver. That's also why I've changed from FindClosestActor() to FindRandomActor(), and shifted the coordinates out in front of the horse somewhat. The closest to the horse is usually the driver, and vice versa.

Re-starting the same quest over and over wouldn't work. Could be another quest instead? Can a quest do positioning this fancy?

Link to comment
Share on other sites

On 5/5/2020 at 2:51 AM, DayDreamer said:

float posX = GetPositionX() + Distance * Math.Cos(TrigAngleZ)
float posY = GetPositionY() + Distance * Math.Sin(TrigAngleZ)

I'm okay at understanding math but confidence in knowing I'm right is low...
That, to me, looks like you are checking out to the right of the horse. Switching the Sin and Cos so that Cos is on the posY would be out in front. ? yes ? Is that why you use the TrigAngleZ calculation?

Yeah, My thinking above is to put the move or Flee package on reference aliases in a quest that has conditions to be: in loaded area (which is the entire 5x5 grid), the horse has line of sight to them (which narrows down the list to his view cone) then a distance of 4000 (one cell) if that is all true and the alias is filled then they get the package to flee to some object that is not a road chunk. If they complete that package then the alias can be freed up as long as the horse no longer has LoS on them.

The scripting works but I'm thinking the quest alias can pick up actors way quicker than the Find-Actor functions.
For groups you just duplicate the alias several times. They all get the package if in that cone in front of horse.

Start the quest anytime the horse is moving. That's the TourUpdating yeah?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...