Continued from the previous entry
In the last post, we learned that the code for skipping the introduction movie is different between the demo and the full version of EMI. In this post, we'll delve into how this works in the demo and see if we can fix the problem in ResidualVM.
I first tried to inject my Z button debug script into the main demo file with all of the scripts (MagDemo.lab), but I was only able to get a dialog box in ResidualVM. Undaunted, I tried to modify the _system.lua script to load different scenes depending on the state of the system.buttonHandler variable, which does key mapping. In short, I wanted to see if the default button handler was loaded during the intro cut scene. However, whatever I tried to do, nothing was changing! Even things like removing BOOT, the first function called in the game, weren't having any effect.
As it turns out, the demo has an extra lab file (i9n.lab) which contains a slightly different version of the _system.lua script. This file is apparently loaded after or perhaps instead of the _system.lua script in the main object file. With this sorted, I went back to testing to see what the state of system.buttonHandler was.
As it turns out, in ResidualVM, the default handler is set, likely by the _system.lua script, when it loads the default controls in _control.lua. In the demo, there is no handler! I checked for this using the following test:
That said, how can we fix this in ResidualVM?
A simple patch was pushed, but I'm not sure this is the right way to do it. If not, there will be a follow up post describing how to fix the issue the right way!
In the last post, we learned that the code for skipping the introduction movie is different between the demo and the full version of EMI. In this post, we'll delve into how this works in the demo and see if we can fix the problem in ResidualVM.
I first tried to inject my Z button debug script into the main demo file with all of the scripts (MagDemo.lab), but I was only able to get a dialog box in ResidualVM. Undaunted, I tried to modify the _system.lua script to load different scenes depending on the state of the system.buttonHandler variable, which does key mapping. In short, I wanted to see if the default button handler was loaded during the intro cut scene. However, whatever I tried to do, nothing was changing! Even things like removing BOOT, the first function called in the game, weren't having any effect.
As it turns out, the demo has an extra lab file (i9n.lab) which contains a slightly different version of the _system.lua script. This file is apparently loaded after or perhaps instead of the _system.lua script in the main object file. With this sorted, I went back to testing to see what the state of system.buttonHandler was.
As it turns out, in ResidualVM, the default handler is set, likely by the _system.lua script, when it loads the default controls in _control.lua. In the demo, there is no handler! I checked for this using the following test:
- Inserted code after the call to StartMovie("intro") to save if the buttonHandler was set or not
- Changed the set that you switch to depending on the state of that variable.
That said, how can we fix this in ResidualVM?
A simple patch was pushed, but I'm not sure this is the right way to do it. If not, there will be a follow up post describing how to fix the issue the right way!
No comments:
Post a Comment