Finding light names in shape files

Sometimes you have a .GeoPcDx file and you want to write a script for it. If you deal with default signals, your starting point will be the default scripts. But there is also the following method.

You copy the .GeoPcDx to a safe place outside the RW folder hierarchy.
Append .bin to the extension.
Apply serz.exe to it, creating a file with .GeoPcDx.xml at the end.
View it using Notepad or any other editor.
Search for transformname, you will see something like this:

<transformname>
<e type="cDeltaString">Mod_hd_3asp</e>
<e type="cDeltaString">Mod_hd3_Red</e>
<e type="cDeltaString">Mod_hd3_green</e>
<e type="cDeltaString">Mod_hd3_orange</e>
</transformname>

Clearly, you need to use you imagination to guess what is what, and clearly, it is not such a challenge.

You can use RW-Tools for the conversion, I believe.

In the above example,
Call ( "ActivateNode", "Mod_hd3_Red", 0)
will switch off the red light.

Cloning a signal

Since this gets asked so often, here is my base recipe to signal adaptation. The basic idea is to make a copy of a signal, and of the associated Lua script, so you are free to modify it without influencing default content.

Major uses are modifications of aspects, adding links, adding yard entries, changing the way a signal clears for the train, etc. etc.

  1. Locate a signal that comes close to what you want.
  2. Find the .bin file under Assets\Kuju\RailSimulator\RailNetwork\signals.
  3. Make a copy of this file and give it a meaningful name, e.g., by appending "new" to the name.
  4. Open it in RW-Tools or apply serz.exe to convert it to .xml.
  5. Append "new" or similar to all the names in the various languages.
  6. Find <_script> a bit down the file. The second line after that contains the name of the Lua script which needs to be duplicated, too. Note the name, then append "new" or similar. In case the name has an extension (.lua), you need to insert the "new" before that, of course.
  7. Save and close the file. If you used serz.exe before, you use it on the .xml now to create the corresponding .bin.
  8. Find the Lua file referenced above and duplicate it. Append "new" or whatever you appended in the .bin file, to make the file name look exactly like it is in the .bin file.
  9. Open the Lua file and edit it in which ever way you wish. This strongly depends on what you want and can be any of a dozen small modifications, to be discussed separately.
  10. Save and close the Lua file.
  11. Start RW. You should find the "new" version next to the original.

Be sure to put a backup of the files in a safe place. Since your copy still lives in the Kuju folder, it may or may not look like default stuff to Steam and get lost on some update in the future.

You can as well transfer the copies into another folder, under your Provider and Product name, but you need to take care about changing the references in the .bin file. Basically, this is just the path part of the script name. It is not hard to do, but make this changes only after you established that the basic cloning process worked well.