{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidbfr5njamesidafgkd2qhkgarolalcpg3ausb2ngrmhgaxxzezei",
    "uri": "at://did:plc:i7budt2wflrcfy6jtvfocbix/app.bsky.feed.post/3mfcd7xc3hf62"
  },
  "path": "/viewtopic.php?p=1278192#p1278192",
  "publishedAt": "2026-02-20T09:58:31.000Z",
  "site": "https://www.tt-forums.net",
  "tags": [
    "GoldMine"
  ],
  "textContent": "> You should use the railtypes that are supported by the engines you want to build.\n\nI see thanks, now I'm having problem understanding the difference between CanRunOnRail and HasPowerOnRail.\n\nSteam locomotive can run on both normal railroad and electrified railroad rails so CanRunOnRail (and HasPowerOnRail too?) should return true for multiple rail types, therefore, how do I know which one is normal railroad to select it?\n\nFor instance the following code will return first railroad that returns true, but that may not be rail type I want (if multiple are possible):\n\n\nCode:\n\n\n    // Assume this is steam locomotivelocal engine_id = AIEngineList(AIVehicle.VT_RAIL).Begin();foreach(rail_type, v in AIRailTypeList()) {if (AIEngine.HasPowerOnRail(engine_id, rail_type)) {AIRail.SetCurrentRailType(rail_type);break;}}\n\nI'd appreciate if somebody can tell the difference between CanRunOnRail and HasPowerOnRail and whether they may return true for multiple rail types for e.g. steam locomotive.\n\nStatistics: Posted by GoldMine — 20 Feb 2026 09:58\n\n* * *",
  "title": "OpenTTD AIs and Game Scripts • Re: RailType enum is not documented",
  "updatedAt": "2026-02-20T09:58:31.000Z"
}