Jump to content

[LE] Followers walk/run underwater instead of swimming


Recommended Posts

In the mod I'm creating, one of the quests takes place almost completely underwater. One of the many issues I'm running into but haven't been able to resolve yet is that followers often don't realize they're underwater and use the normal walk/run instead of the swimming animations.

 

The problem only presents itself if the followers are teleported fully submerged (for instance via an auto load door) from one underwater location to another. But if they get to an area where it's possible to surface and they do so, they immediately start swimming, and they also continue to swim if they submerge again.

 

The other way around, if they start on the surface and then go underwater, they always use the swim animations.

 

I've already checked all the navmeshes, and they seem to be fine, meaning followers have no issues following the player through a door from one location to another. But, like I said, they usually wind up walking instead of swimming.

 

I don't need to tell you guys how annoying this can be, since it totally breaks immersion. On the other hand, you might find it hilarious. LOL

 

Can anyone think of a way to resolve this issue?

 

Link to comment
Share on other sites

Sounds like one of them go with the flow things. May have to redesign a few teleport locations.

Looked around a bit wasn't able to find what I was looking for. I'm sure there is a command to set state.

Edited by NexusComa2
Link to comment
Share on other sites

Thanks for responding, NexusComa2, but I'm afraid I didn't understand a word of what you were saying. What are "flow things"? Why do I need to redesign a few teleport locations? In what way? And how do you mean, "set state"?

 

I really do appreciate you trying to help me out, but is there any way you could be a bit more explicite about what you're trying to tell me?

 

What I tried was to check if the follower is swimming and use Actor.PlayIdle( SwimStart ) to get them to swim if they aren't, but that only works if you find a way to do it after they teleport to the new location. I did try to add an OnLocationChange to my followers, but I'm afraid that doesn't really work because it often returns None for the locations.

 

If you or anyone else has any further advice, I would sure appreciate it.

Link to comment
Share on other sites

Actor.PlayIdle(SwimStart) was what I was looking for. Add that to the portal script on them portals. No need to check state if you know where they are going. Just going to need a custom portal script for that portal. As in copy the portal script as it is and for them portals add the set state creating a custom script with just that added to it.

Edited by NexusComa2
Link to comment
Share on other sites

Hmmm...well, I actually did try that using OnActivate(). But I'm using normal auto load doors, and I'm not sure what to use in the script that will work when the NPC lands on the *other* side of the door. Normal triggers around the door's teleport marker on the other side don't seem to work for NPCs, even says so in the online CK reference. Any other suggestions?

Link to comment
Share on other sites

Whatever the variable is that triggers the portal the one that aims at the actor .. just state that with a .PlayIdle(SwimStart) added.

right after where the script is porting them.

 

1st copy the script and rename it. So you are using a custom script for just them portals that need them to end up swimming.

Edited by NexusComa2
Link to comment
Share on other sites

Really sorry, I should have responded but got busy. Anyway, the solution with the portal was, I'm afraid, no solution. When you activate the door, the system doesn't know the NPC's state after they pass through to the other side, so using Follower.PlayIdle(SwimStart) doesn't work. I even tried it with a Wait( 2.0 ), still didn't work.

 

I did, however, get the OnLocationChange to work. I attached the script to the follower, and now the follower always swims. The script is a bit more complicated than putting the SwimStart on each door, and you also have to ensure each cell that has a door also has a location added. Here's the script, in case anyone is interested:

 

 

 

Scriptname N79MS_SunkenRealmSwimScript extends ReferenceAlias

ReferenceAlias Property PlayerRef Auto

Location Property Lornensel Auto
Location Property LornenselArboretum Auto
Location Property LornenselCatacombs Auto
Location Property LornenselCathedral Auto

Location Property TempleRan Auto
Location Property TempleBara Auto
Location Property TempleUnnr Auto
Location Property TempleHiminglaeva Auto

Location Property SunkenRealm Auto
Location Property SunkenRealmCavern Auto

Location Property GhostHoldingCell Auto ; Used as a bogus location if None

Idle Property SwimStart Auto


Actor Function GetFollower()

	Actor _follower = Self.GetRef() as Actor
	Return _follower

EndFunction


Function FollowerSwim()

	RegisterForSingleUpdate( 2.0 )

EndFunction


Event OnLocationChange( Location OldLocation, Location NewLocation )

	Actor _follower = GetFollower()

	If ( Self != PlayerRef )

		If ( NewLocation == None )

			NewLocation = GhostHoldingCell

		EndIf

		If ( OldLocation == None )

			OldLocation = GhostHoldingCell

		EndIf

		String _text = OldLocation.GetName() + ", New : " + NewLocation.GetName()

		Debug.Trace( "[N79MS_SunkenRealmSwimScript][OnLocationChange] Old: " + _text )

		If ( NewLocation.IsSameLocation( SunkenRealm ) && !OldLocation.IsSameLocation( LornenselArboretum ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( LornenselArboretum ) && !OldLocation.IsSameLocation( SunkenRealm ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( TempleRan ) && OldLocation.IsSameLocation( SunkenRealmCavern ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( SunkenRealmCavern ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( TempleBara ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( TempleUnnr ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( TempleHiminglaeva ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( Lornensel ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( LornenselCatacombs ) )

			FollowerSwim()

		ElseIf ( NewLocation.IsSameLocation( LornenselCathedral ) )

			FollowerSwim()

		EndIf

	EndIf

EndEvent


Event OnUpdate()

	Debug.Trace( "[N79MS_SunkenRealmSwimScript][OnUpdate] Follower should now be swimming" )

	Actor _follower = GetFollower()
	_follower.PlayIdle( SwimStart )

EndEvent

 

 

Link to comment
Share on other sites

Yeah, it would have been nice to be able to just attach a simple script to the doors. But you'd have to be able to attach it at the source where the OnActivate() happens. Since that's no help because the SwimStart effect doesn't reach the destination, and you can't attach a script to the destination teleport box, the only other way you might be able to solve it would be by creating a trigger box at the destination teleport box. But the CK says that doesn't work for NPCs, only the player. Was able to prove it, too.

 

For whatever reason, the player characters don't have any issues realizing they're underwater when they arrive. Wonder why the NPCs don't work the same. Anyway, thanks for the assist.

Link to comment
Share on other sites

I meant to replace the actual port script with the same script with just a few lines added to put the player in swim state. That script would be the same script and the only script used for them portals just with them added lines ... making it a custom script for them portals only.

 

Anyways back to my 1st comment for the NPCs ... you may have to redesign the portals (as in not ending up underwater).

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...