Black mesa:How would i get a working train

So i was playing on a rail uncut mod then i tought that i would like to make a map with trains like on a rail uncut. so dose anyone know how to get the train and how you would do the track

You can look at the source files for the current On A Rail maps- the technique used there is (nearly?) exactly the same as that used in OAR Uncut.

ummm and where would i get those

They’re shipped with the retail game, in the “mapsrc” folder.

but i dont have the retail game i have the mod

so i found a decompiler looked at the map and i have no idea how to do it

The VDC has you covered - combine the info there with the prop_oar_tram_awesome entity*. As for the track, it’s mainly a collection of prop_statics using the rail model set, and some brushwork for the sides.

*IIRC that’s what it’s called. I don’t have a either version of BM on this machine to check.[/size][/size]

I have a train related question as well. I’m currently attempting to set a level on a moving train for at least part of the level, so I tried to set up the bridge the train is traveling on as a repeating loop of a func_tracktrain. However, when doing the reset of the loop and teleporting back, the whole model “jumps” a bit before resetting. I’ve gotten the timing of the actual movements of the bridge on a good loop, but no matter how close together it looks, or how much I modify the bridge’s look, there’s still a strange visual glitch when the train resets. Anyone have any insight on a fix or an alternative strategy?

I think you’re sort of running up against the fundamental limitations of the Source Engine here, in that I don’t think teleporting things was ever designed to be seamless. One thing you might try is having two train models that the player is teleported back and forth between, so that the train itself is not teleported. Then, have the one the player is not currently on move from the end of the level to the beginning outside of the player’s view, and repeat when the player is off the first train and it reaches the end.

Or, I could split up the prop into several, have them mapped to trains in sequence, and loop it that way with a z clip to mask the ends.

I seem to recall a few goldsource maps that did that, as well as a few others on various engines.

You could also have that add variation by making a few extra landscape sections and randomly swapping them.

A few meaning 22 separate pieces all moving in tandem.

I feel quite clever for pulling that off.

Have the train stationary and just move the background… you’ll have way more control over things

The train itself right now is static world geometry and the track moves on a loop below it. It’s quite good looking!
However, I’m trying to add a scrolling cloud layer above the map to match. When it’s scrolling properly, it actually approaches looking decent once I fix the texture lines, but for some reason I keep seeing a gap in my train so suddenly there’s no cloud for a few seconds. Can’t really figure out why.

You could possibly do the cloud layer as just a scrolling material in the 3D skybox.

How do you do a scrolling material? Does that need to be in the texture data? Or can an entity hack it?

It’s one of the material proxies - Texturescroll

Here’s an example from one of the BM conveyor materials-

"Proxies" { "TextureScroll" { "texturescrollvar" "$baseTextureTransform" "texturescrollrate" 0.98 "texturescrollangle" -90.00 } }You can also put in a duplicate of this using “$bumptransform” to scroll a normal map.

I’m fairly sure that this will make it automatic ingame, unlike a few other proxies like the one used in eyescanner in Kleiner’s lab in HL2.

God, I’ve been using the SDK for a decade and I’ve never seen this entity used before. I tracked down the map from the old examples that shipped with the editor in sdk_d1_trainstation_05 and found material_modify_control.
Name ModifyFrame
Material to modify- models/props_lab/eyescanner_disp
Material variable to modify- $frame

Six inputs- three reserved for the player trying to use Kleiner’s eyescanner and failing, three for Kleiner’s scrpted scene where he submits his eyes to the scanner and unlocks it. Hoo boy. I had always thought the game had that as three skins for the eye scanner prop, not a separate texture.

So what I’d need to make this entity do is make a huge brush in the skybox with the texture nature/forest_clouds001a scroll in one direction to represent movement perpetually. I also need the ability to hide the brush or change it’s scrolling direction if the direction of movement in the level changes. My current plan is that the main playable portion of the level is the player fighting their way along the train against enemy forces to the second car, housing the train’s automated controls. The player activates a virus that takes over the train’s computer and diverts it onto another track., letting go the previous cars in the process. I will probably be using two separate instances of the car the player is in- when the virus infects the computer, it causes a power surge and blacks out the car, exploding a lamp. I will probably black out the player’s screen momentarily to mask the transition to the second instance of the car, where the rest of the train is represented as brushes and props parented together to be let go as the train transfers to a second track. Since Source doesn’t support multiple skyboxes, if I want the scrolling sky to be in the skybox, it would have to be changeable on the fly to fit the change in direction of the train.

Come to think of it, I could have used something like this to make the train track material scroll to further exaggerate the feel of motion. How have I not seen this entity before?!?

Alright, my bridge is having problems. Parts seem to get hung up somehow and I’m having a hell of a time troubleshooting it.

Cut it out of the map and PM me the .vmf and I could take a look at it.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.