Scenario crashes whenever HTML message is triggered

Discussion about RailWorks scenario creation.

Scenario crashes whenever HTML message is triggered

Unread postby SmeagolTheRailroader » Mon May 31, 2021 5:20 pm

Hello all,

I am attempting to add in an HTML message to my scenario. However, every time that the event with the HTML is triggered, the game immediately freezes and then crashes. I think my LUA is following everything right... anything I'm doing wrong here?

ScenarioScript.lua

Code: Select all
-- true/false defn
FALSE = 0
TRUE = 1

-- condition return values
CONDITION_NOT_YET_MET = 0
CONDITION_SUCCEEDED = 1
CONDITION_FAILED = 2

-- Message types
MT_INFO = 0   -- large centre screen pop up
MT_ALERT = 1  -- top right alert message

MSG_TOP = 1
MSG_VCENTRE = 2
MSG_BOTTOM = 4
MSG_LEFT = 8
MSG_CENTRE = 16
MSG_RIGHT = 32

MSG_SMALL = 0
MSG_REG = 1
MSG_LRG = 2

function OnEvent(event)
   return _G["OnEvent" .. event]();
end

function TestCondition(condition)
   return _G["TestCondition" .. event]();
end

function DisplayRecordedMessage( messageName )
   SysCall("RegisterRecordedMessage", "StartDisplay" .. messageName, "StopDisplay" .. messageName, 1);
end

function StartDisplayIntroText()
   SysCall ( "ScenarioManager:ShowInfoMessageExt", "66a303c2-2040-43da-af5a-c2bb2bd98f96", "firstmessage.html", 0, MSG_VCENTRE + MSG_CENTRE, MSG_REG, FALSE );
end

function StopDisplayIntroText()
end

function OnEventStart()
  SysCall ( "CameraManager:ActivateCamera", "IntroCam", 0 );
end

function OnEventIntoCab()
  SysCall ( "CameraManager:ActivateCamera", "CabCamera", 0);
end

function OnEventFirstMessage()
  DisplayRecordedMessage( "IntroText" )
end


firstmessage.html

Code: Select all
<html>
   <body bgcolor="#feffaa">
      <font color="#000000" face="Arial" size="3">
         <table>
            <tr>
               <td><img src="../Yardmaster&Foreman.png" width="128" height="128"></td>
               <td>
                  <p>Ok gentlemen, everything seems to be in order. You may depart for Laramie when ready. You will recieve train orders at Tower A.</p>
               </td>
            </tr>
         </table>
      </font>
   </body>
</html>

Thanks!
SmeagolTheRailroader
 

Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 1 guest

cron