Jump to content

Possible to have a static move along a "path" ("working" train / subway)?


Recommended Posts

Good evening everybody!

 

I am currently working on a little "custom worldspace" mod.

 

As I completely hate the concept of "fast travel", I wanted an immersive alternative to get around the worldspace quickly, because it is rather large ....

 

So, I thought maybe a "working" train or subway system would be possible to implement?

 

 

Basically the question is this:

 

Can I somehow move a static (or multiple statics) (like a "train car") along a "path"?

 

 

I know that it has to be possible somehow, because when you first arrive in the NukaWorld worldspace, you arrive with that Monorail - thing. And that moves along a certain "path" and is a static object. (as far as I know)

(Or maybe that is just a "moveable static" with an animation that plays when the player enters ...)

Link to comment
Share on other sites

You certainly could use a script for this.

 

Have a list (array) of parameter sets that can be used with TranslateTo().

Assuming a known/defined starting point for the object to translate, you begin with the first parameter set (pos x, y, z / angles x, y, z, speed, rotspeedlimit).

There's an event that notifies the translation has completed (the object arrived at the destination coords). So when that fires, you pick the next parameter set for use with TranslateTo(), etc.

When you reach the end of the list, you either stop or restart from the beginning.

 

Instead of the array, you could probably also use xmarkers (or xheadingmarkers even) that are reflinked in a chain/ring.

 

Protip: If you're going to use TranslateTo() for transportation purposes, construct an indirect drive. If you use TranslateTo() to directly drive the platform/thing that the Player is standing/riding on, movement can be extremely jerky in 1st person (esp up/down). Solution is to use TranslateTo() on some intermediate object and to RefAttach the platform to the intermediate object. Movement will be smooth as Butter, altho RefAttach is a finicky beast by itself.

 

Also don't expect too much. Since FO4 has no concept of car physics (in fact, there can be no physics at all for your movable statics, when you use TranslateTo() on them), movement will look extremely unnatural, if not disconcerting. And if the terrain isn't flat and you want at least *somewhat* realistic performance where your bus doesn't cut straight through small hills, large rocks etc, you're going to need a lot of datapoints (xmarkers).

 

A different approach is to use an NPC as the vehicle, as most car mods do. That way, you can at least get the thing to follow terrain. But using an NPC brings with it a whole new set of problems.

Link to comment
Share on other sites

How did they do the monorail to Nuka World??

I just had a look at it.

It is an activator (the monorail - car - thing and the "rail") that has an animation to move along the "rail".

I mean I could probably somehow make something like this in 3DSMAX (can't be more difficult then a "door", because that is also a "moving static", kind of ...)

For short distances something like that can wok, but not for traveling from one side of a worldspace to another (move about 60 cells ...) ...

 

At least there are only two "train stations" in my mod, on on the north end of the worldspace, one on the south end, so that makes it a bit easier ....

 

I will mess around a bit with that "move to a point, move to another point, ......." - solution to see if I can get it to work properly ...

 

 

Can you move an object to a point outside the "loaded area" with this?

(Because I have a few long straight lines that are longer then the default "UGrids to load" - distance ...)

 

 

I will attach this "movement control script" to a quest, so that it is "always loaded" and then use the quest stages to determine if the train is currently at station A or at station B.

Link to comment
Share on other sites

You certainly could use a script for this.

 

Have a list (array) of parameter sets that can be used with TranslateTo().

Assuming a known/defined starting point for the object to translate, you begin with the first parameter set (pos x, y, z / angles x, y, z, speed, rotspeedlimit).

There's an event that notifies the translation has completed (the object arrived at the destination coords). So when that fires, you pick the next parameter set for use with TranslateTo(), etc.

When you reach the end of the list, you either stop or restart from the beginning.

 

Instead of the array, you could probably also use xmarkers (or xheadingmarkers even) that are reflinked in a chain/ring.

 

Protip: If you're going to use TranslateTo() for transportation purposes, construct an indirect drive. If you use TranslateTo() to directly drive the platform/thing that the Player is standing/riding on, movement can be extremely jerky in 1st person (esp up/down). Solution is to use TranslateTo() on some intermediate object and to RefAttach the platform to the intermediate object. Movement will be smooth as Butter, altho RefAttach is a finicky beast by itself.

 

Also don't expect too much. Since FO4 has no concept of car physics (in fact, there can be no physics at all for your movable statics, when you use TranslateTo() on them), movement will look extremely unnatural, if not disconcerting. And if the terrain isn't flat and you want at least *somewhat* realistic performance where your bus doesn't cut straight through small hills, large rocks etc, you're going to need a lot of datapoints (xmarkers).

 

A different approach is to use an NPC as the vehicle, as most car mods do. That way, you can at least get the thing to follow terrain. But using an NPC brings with it a whole new set of problems.

I know, I don't expect too much.

If you expect nothing, you will never get dissapointed.

 

I will not use the "attach the player to the NPC" - thing because I personally don't like that. Might as well have just a "load screen" then ....

 

About the physics ...

I don't really care about that.

 

About the "following the terrain" ...

Yes, I have a few parts of the train track that go up and down a bit, but with the "move to positon" - thing that won't be a problem (just adjust the Z value a bit) .

 

About the "indirect drive" ....

So I should have like a X-Marker that gets moved by the script and then all the other statics get "RefAttached" to that marker. So kind of what they did with those "improvised elevators" in the vanilla game. (You know, those yellow things that are used to get on top of the elevated highways ...)

Link to comment
Share on other sites

You'll have to create your own marker, using a customized xmarker NIF. Your NIF must have a NiNode in it named REF_ATTACH_NODE (iirc), or you won't be able to RefAttach anything to it.

 

Wanna see some real elevators?

https://www.nexusmods.com/fallout4/videos/10848

https://www.nexusmods.com/fallout4/videos/10877

https://www.nexusmods.com/fallout4/videos/11152

Link to comment
Share on other sites

The biggest issue with a fast moving platform in a horizontal direction is that you get "micro nudging" problem on the camera from Havok, as well as unnatural jumping. Like niston said, I think using an NPC as train car is probably the most trouble free in this context, but not being able to move around in a train for the entire trip probably won't be fun, lol.

 

Here's a very simple script I was using earlier this year to test a train moving through a long distance in a worldspace :

 

 

 

Scriptname TestSubject:ChainedTranslate extends ObjectReference

ObjectReference[] Property Dest Auto Const
Float Property MoveSpeed = 100.00 Auto Const
Sound Property MotorSFX Auto Const
ObjectReference Property Motor Auto Const
Int MotorSFXID = -1

int Pos = 0


auto state StartUp

	Event OnActivate(ObjectReference akActionRef)
		MotorSFXID = MotorSFX.Play(Motor)
		GotoState("Loop")
	EndEvent
	
EndState

state Loop

	Event OnBeginState(string asOldState)
			Self.TranslateToRef(Dest[Pos], MoveSpeed)
			Pos += 1
	EndEvent
	
	Event OnTranslationAlmostComplete()
	
		If Pos < Dest.length
			GotoState("Loop")
		Else
			Sound.StopInstance(MotorSFXID)
			GotoState("End")
		EndIf
		
	EndEvent

EndState

state End

EndState 

 

 

 

This one follows an array of target destination refs like this :

 

 

 

34555-1585654575-1797598607.png

 

 

 

Having a destination in an unloaded cell worked just fine (I've tested a distance of 23 cells). The issue with Havok, though, is bad enough that I'm not sure if I can use this in my project. I was also testing a firefight between two moving platforms, and that didn't feel all that exciting either (the enemies end up being in the same positions on screen = boring).

 

While watching a video of the Train quest mod, it looked to be somehow moving the environment rather than the platform, since I didn't see any of the Havok behaviors that would happen on a moving platform. I haven't downloaded that mod, but maybe you'll find a different/better solution there.

 

I think another issue is that there aren't that many objects for the tunnel to create an interesting environment.

 

Anyway, good luck with your project! :smile:

 

Edit : I was attaching a train car to an activator, as activators seem to be a better host for attach ref in this context.

Edited by DiodeLadder
Link to comment
Share on other sites

You'll have to create your own marker, using a customized xmarker NIF. Your NIF must have a NiNode in it named REF_ATTACH_NODE (iirc), or you won't be able to RefAttach anything to it.

 

Wanna see some real elevators?

https://www.nexusmods.com/fallout4/videos/10848

https://www.nexusmods.com/fallout4/videos/10877

https://www.nexusmods.com/fallout4/videos/11152

Ohhh f#### that is awsome!

At first I was like "wait a second, are you sure this is in Fallout 4?".

Because it looks so awsome!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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