Jump to content

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


Recommended Posts

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.

Yeah, I am not planning on doing a subway, just a normal train on the "surface" to 'quickly' get from one end of the worldspace to another ...

"Moving the environment" might work "underground" but not in an exterior worldspace, so I won't be doing that ...

 

 

I think I should start thinking about "what will this add to the 'experience'?".

Like, "is this worth all the trouble just to have a weird crappy kind-of-working thing in the end?".

 

 

Because I am starting to think if I should just make a script that, on activation, passes some time, moves the player to the destination and shows a loadscreen during that.

Would be easier and would actually work.

I mean this is done in the vanilla game, for example the "Vertibird" that you can use to get from the Brotherhood airship to the "ground" is basically just a "load door".

So, why not ....

 

 

This might just be too much work for too little "reward" ...

I think I will rather spend my time on other things ...

(Like the "Multiple Playable Actors" - Thing ...)

 

 

But thanks for all the help anyway .....

Link to comment
Share on other sites

The train mod I mentioned takes place in an "exterior", BTW :

 

 

I thought I'd mention it because it looked like what you are looking for. I don't know how this is done at all, though. I think the environment is in a loop (well looked that way when I saw it the last time).

 

 

I think I should start thinking about "what will this add to the 'experience'?".

Like, "is this worth all the trouble just to have a weird crappy kind-of-working thing in the end?".

 

 

That's more or less my line of thinking as well. It's so easy for me to get excited about details, lol. :laugh:

Link to comment
Share on other sites

 

 

Because I am starting to think if I should just make a script that, on activation, passes some time, moves the player to the destination and shows a loadscreen during that.

Would be easier and would actually work.

 

 

When I gave up on trying to intercept the vertibird fast travel AI to cut teleport travel between worldspaces (objective Habah < direct > Nuka) thats exactly what I did.

 

If your doing realtime XYZ movement speeds, dont forget to factor pTimescale to pass GameTime.

fTravelGameHours = ((fTravelDistance / 1000) / 3600) * pTimescale.GetValue() ; Vertibird 1000 units/second
pGameHour.Mod(fTravelGameHours)
Utility.WaitMenuMode(1.0) ;events
Link to comment
Share on other sites

@diodeladder: Using the "indirect drive" approach should fix the "micro nudging" from havok.

 

Hello niston,

 

I'm not sure what you mean by "indirect drive" - would you mind elaborating on this? I'm using TranslateToRef on a dummy activator that acts as a attach host to train car mesh. The micro nudge happens mostly when the train car is climbing up, and when things are horizontal, it's usually smooth (but not always, somehow). This can get worse at faster speed, however.

 

What I was trying to do was to have a firefight like in the "On the Rail" section of Black Mesa, where the player and marines would exchange fire on trolley cars. This isn't really the most important section of my project, so it's on the back burner at the moment (and probably get cut). The initial testing of a firefight between 2 moving platforms ended up pretty boring. Passing through the 23 worldspace cells I've tested didn't feel all that long, either, and that's another issue. So, even if I didn't have the Havok issue, I may still have a much bigger problem of the whole scene not being fun. Just like YouDoNottKnowMyName said earlier, for me, I'm not sure all this is worth the time and effort. :turned:

Link to comment
Share on other sites

 

 

 

Because I am starting to think if I should just make a script that, on activation, passes some time, moves the player to the destination and shows a loadscreen during that.

Would be easier and would actually work.

 

 

When I gave up on trying to intercept the vertibird fast travel AI to cut teleport travel between worldspaces (objective Habah < direct > Nuka) thats exactly what I did.

 

If your doing realtime XYZ movement speeds, dont forget to factor pTimescale to pass GameTime.

fTravelGameHours = ((fTravelDistance / 1000) / 3600) * pTimescale.GetValue() ; Vertibird 1000 units/second
pGameHour.Mod(fTravelGameHours)
Utility.WaitMenuMode(1.0) ;events

Yes...

 

I personally always have timescale set to 4 because I like the longer days and nights.

 

And the distance is a "static" value, it does not change, so I don't have to calculate it every time that the script executes ...

 

But thanks for that anyway!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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