Building your own signals - Gmax and coding instructions

 
  KRviator Moderator

Location: Up the front
Well, not quite, but after much head scratching and even more Bundy consumption, I finally managed to create a working, of sorts, NSW Double Colour Light signal.

Now I know that TRS2006 already has them. But it doesn't have tunnel-mounted signals, nor 6-Aspect Gantry mounted signals, nor the "searchlight" type as found in the inner west, nor does it have fixed reds like you'll find at Blacktown and a few other places.

So, after ripping off a pommy signal and bastardising that, I've come up with the following



I know it looks nothing like a proper NSW signal, yet, but it is a work in progress. Now  I know what I'm doing, things should move along a bit quicker. And for those who want to make their own QR, NSW or Victorian signals, or even theathre route indicators couppled to signals, I managed to dig up the Signal Creation Guide from TRS2004. It ain't as good as 2006, but it should do to start you off. I'll copy it across shortly after I've had a tinker with the signal some more and decided exactly what it is I want to do tonight...

Till then, you lot can make plans to build your very own Trainz signals..

EDIT Renamed thread to more appropriate title, given depth whith which we've gone into it.

EDIT JUNE 2013 Fotopic went belly-up in 2011, and that was where the image files for this tutorial were hosted. However, I have managed to resurrect them after they (finally) allowed users to recover their files, so hopefully, I can recreate the tutorial in a more meaningful way soon.

Sponsored advertisement

  KRviator Moderator

Location: Up the front
Okay... Assuming you konw how to build the actual signal in Gmax out of boxes and cylinders and the like (IF you don't click HERE, or see page 3), what you need to do is, in the very centre of your lens, where the globe would be for real, is place those little green attachment points. Think of these as globes, and if you want to build a "searchlight" style, with 3 or more colours in the single lens, you need to put three there. One on top of the other.

Name these, from the top (or bottom) a.light0, a.light1, a.light2 and so on, until you get to the bottom or have run out of attachment points. If you are making a theatre style, you can have as many as you like, I suppose in a square 5x5 or whatever. In my case, I used A.light0-a.light5, from top to bottom.

Basically, for TRS2004 signalling, you had 10 differnt aspects you can display to the AI Driver's, and your train.

0 STOP
1 STOP THEN PROCEED
2 CAUTION AND LEFT DIVERGE
3 CAUTION AND RIGHT DIVERGE
4 CAUTION
5 PROCEED AND LEFT DIVERGE
6 PROCEED AND RIGHT DIVERGE
7 ADVANCED CAUTION
8 PROCEED
9 SLOW
10 MEDIUM SPEED

#'s 9 and 10 are only used in scenarios. Now, refer to the code below and you'll see where it refers to "signals" then 0, 2, 3, 4, 5, 6, 8 and another pair of numbers. If you look at "Signal 0" you'll see it wants to light up "carona's" #2 and #5. In this case, these are the lower carona's in each signal.

For those who don't know, a Carona is basically the "glow" from the attachment point you created in Gmax. They can be any colour, red, green, yellow, blue, purple, pink, whatever you want. You specify what Carona is assigned to what attachment point below the "signals" text, in the "lights" area.

So, "Light.0 = Carona Green", "Light 2 = Carona Red" and so on and so forth. If you are making a normal signal, you only really need 3 coronas, for Red, Green and Yellow. Think of the Lightpoints as the Attachment Points in Gmax, whatever colour you want that particular attachment point to be, you need to specify it here.

The Signal text decides what lights are illuminated for a given signal state, in the code below this is shown by "Signal state 0 (being "STOP") illuminating lightpoint's 2 and 5. And lightpoint 2 and lightpoint 5 use the Red carona. If you want to get festive, you can quite easily illuminate every colour in the signal by replacing "Signal0, 2,5" with "Signal0, 0,1,2,3,4,5" and that will light up all the attachment points, and their respective colours.

Most of the coding below is fairly self explanatory, but a couple of things need to be covered.

"Trackside" is the distance from the track centreline. Negative number for LH signals, positive number for RH signals.

"Mysignal.im" is the name of yur Gmax  file. This is the actual "thing" you've built.

If ou want a flashing light, you can do that by adding an "effects" tag to your carona. When I find that in the manual, I'll edit this post to show what to do.

Till then, feel free to copy and modify the code below, tinker around in Gmax, and see what you can come up with for your own custon signals...


username "The DLS name you'll give your signal, ie NSW 5ASP Tunnel Auto"
kind "mosignal"
light 1
trackside -2.5
function "TrackSignal"
kuid
region "AU"
type "TEST mysignal"
mesh-table
{
  default
{
mesh "MYSIGNAL.IM"
auto-create 1
effects
{
0
{
kind "name"
fontsize 0.3
fontcolor 255,255,255
att "a.name0"
name "name"
}
}
}
}
trainz-build 2
category-region-0 "AU"
category-era-0 1980
category-era-1 1990
category-era-2 2000
category-class "WA"
signals {
0
{
 light 2,5
}
2
{
 light 1,5
}
3
{
 light 1,5
}
4
{
 light 0,5
}
5
{
 light 1,4
}
6
{
 light 1,4
}
8
{
 light 0,3
}
}

lights
{
 0
 {
   corona "corona_green.tga"
 }
 1
 {
   corona "corona_yellow.tga"
 }
 2
 {
   corona "corona_red.tga"
 }
 3
 {
   corona "corona_green.tga"
 }
 4
 {
   corona "corona_yellow.tga"
 }
 5
 {
   corona "corona_red.tga"
 }

}
author "KRVIATOR"
contact-email "KRVIATOR"
organisation "NORVEN KOAL"
kuid-table {
}


Edit: Fixed incorrect code for "Username" - It's not your name, it's what the DLS will refer to your signal as.

Edit2: Added link to Gmax tutorial on page 3.
  V544 Chief Train Controller

Location: Melbourne
Well done KR!

I certaintly enjoyed reading that little tutorial of yours. We all start somewhere when it comes to making models, and this is a good example of what can be done with limited modelling skills and quite a bit of patience. Well Done

You've just prompted me to get off my duff and finish off that RQZY set I started earlier this year. Even if I am just working off photos alone (no access to plans unfortunately).
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
They are looking really good, what about something with low speeds IE RED RED GREEN? I need a few custom ones for a route I am doing if your up for it.
  KRviator Moderator

Location: Up the front
I'm having a little trouble with the way Trainz is recognising the "Advance Caution" or, in NSW-Speak, "Medium" indication. Actually, being honest, I'm not having a problem with it. Trainz is having a problem, as it won't give me a Double-Yellow even if I put the default QR 4-aspect signals in place. As you can see from the photo below.

Right now, I've got the above as my "learning" signal, a NSW "5-Aspect Auto" tunnel signal, complete with the little blue light at the bottom, and am working on a couple of "Fixed-Red" and "Fixed-Red with Calling on / Low Speed" aspects. The tunnel signal also has a little way to go, as it is simply a collection of matt-black shapes with the lightpoints in it, you don't have a place to "name" it yet, nor does it have the appearance of un-illuminated lamps yet, as you can see in the comparison, the QR ones do...


The biggest problem with having multiple aspects on a single signal is simply Trainz can't cope with them, being a generic worldwide program. For example, if you want a signal that can display "Clear", "Caution" and "Stop" that only really leaves you with "Slow" indication, and that can be used for "Low Speed" or "Calling On" but not both. evil

The Fixed-Red's aren't too much of a problem, as you can make the "Proceed", "Caution" and "Clear" aspects of that signal show the "Low Speed" light, and then have the "Slow" aspect show the "Calling On" light, and so on and so forth, there's nothing wrong with having a single indication on the signal corrospond with multiple signal aspects.

Something else I'm building is a NSW Intermediate shunting signal. Like you get at Rhodes on the DM, leaving Kooragang and heaps of other places. This is basicall going to be a standard NSW shunting signal, but in place of one of the route indicators, you'll get a green light for a through movement, and if you have a divirging route set, you'll get the yellow light, with the route indicator. I dunno how to have you chaps specify what route letter is displayed through scripting yet, but might just have an illiminated whte box as a generic one. Most I see up here are just that anyway with the black paint fading.  8) A variattion on this can be having a NSW Vertical shunting signal display RYG lights as a repeater signal, like you see at Strathfield. IIRC, there's a rule on the DLS that allows you to assign "repeater" status to a signal so long as both are named.

Plenty of options out there, and when I get a few more afternoons off that I'm not trying to catch up on sleep, I'll do some more work on them. Till then, you lot have Gmax, have a go yourselves. You'll get it to work eventually.
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
Whould you know how to get something from gmax to trainz?
  KRviator Moderator

Location: Up the front
Yep.

You've gotta go download the "Gmax Trainz Gamepack" and that allows you to export Gmax content into Trainz. Baically you deselect everything in the main window of Gmax, then File->Export and name it whatever you want with a .IM extension.
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
Ahh cool iv got an object that I need to put into trazin and have bugga all idear how to do it, I didnt build it someone else did and they cant be arsed doing it for me, where do ya get the gamepack from?
  KRviator Moderator

Location: Up the front
IIRC, the GamePack is available from the Auran website. If not, a quick Google search will set you right.

Once you've got the object exported, you need to create a Config file for it, and that will depend on what it is you've exported. As above for a Signal, though if it's a piece of rollingstock with you-beaut animating doors and pans then you'll need a whole lot more code.
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
thanks ill have a look, the building I have its the flying junct at central.
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
Righty-o iv exported it, what folder in trains do I put in, its currently a IM file how whould I get it to a cmp?
  KRviator Moderator

Location: Up the front
Righty-o iv exported it, what folder in trains do I put in, its currently a IM file how whould I get it to a cmp?
"nazarail"
Cmp? Or CDP?

CMP is the Content Managet program, while a CDP is what the Content Manager uses to package the objects, kinda like a self-installing *.ZIP file.

Anyway, open up Trainz, then click on Manage Content and you should get the Content Manager openup in a new window. From there, click File -> Import and find your way to the folder that contains your stuff. You'll need to have your IM file, TGA textures and Config file all in the one folder for it to import it successfully.

Once it has done that, you should get the "xxxxxx successfully installed" message, then click on the Edit tab, right-click on your object, then click "Commit" and then Control+L to launch Trainz to go find it and play.
  KRviator Moderator

Location: Up the front
Right. Time for a bit of an update. After even more bundy consumption, I have managed to come up with the following:

My collection of "Fixed Reds" and "Rixed Red with Calling On" signals.



My "NSW Intermediate Shunting Signals"

And finally my "NSW Dwarf Repeaters"

Of note, I have yet to "script" any of the above, as I would like to have the user specify what stencil is shown on the shunting signal, as you can do now with Natvander's NSW signals. I also want the Repeaters to have the ability to flash the yellow light for when you are taking the turnout.

As I have absolutely zero knowledge about how to script in Trainz, these are a little way off from being released, although they are functional as they are now, and the user can change the stencil by changing the *.TGA file showing the U.

The Fixed Reds do have the lampshades in place, but the coronas appear to overpower and shine through them. Same for the Intermediate dollies, the green light shows through the sunshades. Still working on a fix for this problem. Bang Head
  Raichase Captain Rant!

Location: Sydney, NSW
Holy hell, just found this thread then...

...Rob, you're like some kind of genius! Some of those signals I've been looking for for some time now! Great work mate!
  nazarail Chief Commissioner

Location: Between BN 80 UL and BN 87 UL
I can so use them with-in my routes! cool stuff!
  prometheus_au Chief Train Controller

I'm in the middle of converting some Natvander's NSW signals to Victorian convention thanks to this thread....

Thanks very much guys.

Anyone know how to get in touch with the creator of the signals? I need permission to upload them to the DLS.

Oh and those fixed reds and fixed red with "calling on" would come in handy too if they were uploaded Very Happy

Cheers all.
  SteamtoStay Chief Commissioner

Location: Building floorplates
You could try finding the email adress on his profile page.
  S 301 Chief Commissioner

Location: in front of the computer
Just be careful guys. If I remember right (will test it tomorrow), Natvander's signals don't work in 09.

Also, as a side note, for Natvander's and Davido's stuff, you can contact them via the Auran forums. However, they are very strict on what happens with their creations. So don't be too disheartened if they say no Smile

Zec
  Raichase Captain Rant!

Location: Sydney, NSW
Just be careful guys. If I remember right (will test it tomorrow), Natvander's signals don't work in 09.
"S 301"


G'day Zec, this is very disappointing. Is this something that needs to be fixed on Nats end or Aurans do you think?
  S 301 Chief Commissioner

Location: in front of the computer
Nat's if they do fail (as I said, needs testing).

I know they were giving errors on the Wadalbavale map, but not sure if they are the actual cause...

The problem is that Auran have tightened the scripting in 09, and many of the 'work arounds' from 04/06 are now broken. This is most obvious in signals, where people were using a different script 'class' to the one that TRS actually needed. Or something like this anyway.
Zec
  Raichase Captain Rant!

Location: Sydney, NSW
Thanks for the info Zec. Hopefully Nat will have everything all fixed up, as he and Davido strike me as perfectionists, I can't see them letting it fly for long.

Will do some testing when my copy arrives in the mail. Thanks for the info mate.
  KRviator Moderator

Location: Up the front
I'm in the middle of converting some Natvander's NSW signals to Victorian convention thanks to this thread....
"Prometheus_au"
I'm just wondering what ones you're porting over? Most of Natvander's stuff seems to be very NSW-specific. To my mind, it would be simpler to build Victorian-specific signals. Once you get the hang of Gmax, you can knock out a working, almost-good-enough-for-release signal in a few hours, so if that's what you want, install Gmax from your CD and 'ave a go.

Now for a bit of an update on my signals. The Fixed-Reds are at a stage where I'm 99% happy with them. The ladder is installed, the nameplate works, they all light up as they are supposed to, and the names corrospond to what the signal actually is.

I haven't been able to find a work-around for the corona's shining through the sunshades, but even Natvander's signals do that, so I'm not particularly fussed about it at this time.

The only issues I've found are the backing plate is a fraction bigger than expected and no matter what I've done thus far, if I put a white texture on the backing plate, it will flicker through the black while you're approaching the signal, so at this stage, I've just left the whole thing black. You're not going to be approaching a fixed-red from the rear end very often anyway. Unless you drive through Blacktown on the Up Main.


The Fixed-Red Calling On signals are working, however, they are not scripted at all, they simply use the default commands for signal control as described previously. They are not turnout-direction-specific, and so will display a proceed aspect so long as the track is unoccupied between the signal and the next, irrespective of how the points are laying. It will not give you a proceed aspect if there is a train in the way, which is the whole point of this signal design exercise, so you can do one of two things. Use a Rule to set the signal to Proceed, or install a Signal Invisible a couple of feet in rear of the signal, but you will then have the problem of the signal displaying a proceed aspect 24/7 except when the 2-foot block between the visible and invisible signals are occupied so some experimentation with appropriate placement may be required.
  superheatedsteam Deputy Commissioner

Location: Perth, WA
... no matter what I've done thus far, if I put a white texture on the backing plate, it will flicker through the black while you're approaching the signal,
"KRviator"


Without seeing the geometry or the flickering you are referring it’s hard to be sure but I suspect you may have a slight case of Z fighting. This can occur if the graphics engine encounters a 3D object with 2 or more faces co-existing on the same plane.  It can’t determine which one/s have preference and draws all of them, which can cause flickering.

Here is an example of how you can induce Z fighting.  If you create a box (box1) and texture it black, then clone the box (box2) but don’t move it and texture the clone white. Now you have 2 boxes with all faces on box1 co-existing in the same planes as box2. If you imported that box shape into Trainz and then started to drive towards the boxes the graphic engine has to sort which faces of 3D objects are facing the camera so it knows which ones to draw. Faces facing away from the camera can be quickly determined so that they are not part of the rendering process. Then the graphics engine does Z sorting which determines which faces are closer to the camera to determine which ones to draw and which ones not to draw (because some faces are smaller and will be behind other faces that are larger and closer to the camera). When it gets to your box there are 4 faces (2 for each box side) at the same distance from the camera. The graphic engine now starts Z fighting trying to work out which of the 4 faces should be drawn, ends up drawing all 4 and flickering results.

Check the part on the signal that is flickering and ensure you do not have any co-plainer faces.  Either delete the faces if redundant or move them slightly apart from each other so the graphics engine knows which ones to draw.
  KRviator Moderator

Location: Up the front
I'm of the opinion that's what Trainz is doing. I'd made 4 seperate objects for the backing plate, two textured black and the other two white, with the white ones moved back a quarter-inch, and it still did it. I tried moving the boxes so they were overlapping, and no joy either.

Mucking around with it, I got to the stage where I completely seperated them leaving a .01-cm gap between and it still did it, so short of learning how to UVW-Map an object, I took the lazy way out. For now. 8)

When I finish the other two signals, I'll package them as a CDP, buy a copy of TRS2009 and re-register on the Auran Forums with a slightly more discreet username then release them all. So they should be out in no more than a month.
  S 301 Chief Commissioner

Location: in front of the computer
Trainz generally needs a gap of about 1cm to stop the Z fighting.

May I ask what the back looks like? You might be able to get away with a simple square texture that has the 4 sides lining up with the extremities of the 'disc'.
Zec

Sponsored advertisement

Display from:   

Quick Reply

We've disabled Quick Reply for this thread as it was last updated more than six months ago.