When Guybrush enters Herman Toothrot's camp (the set toc) for the first time, Guybrush should be able to trigger a conversation with Herman by walking up towards him. In ResidualVM, this conversation is never triggered! Let's find out why.
Guybrush can't get Herman's attention! |
- toc.herman_obj.range = 4.3
- dd = glob.herman_talk_status
- dd = toc:current_setup()
First of all, are we sure that the setup_change function is being run? Yes! We can prove this by checking the range on Herman's note in this scene. If we check from the setup toc_wide, the interaction range for the note is 0, but when we change to the setup toc_close, the interaction range is changed to 1.8. This change is implemented in the setup_change function, so it's certainly being run.
How about if we force the current setup to toc_log?
- toc:current_setup(toc_log)
Talking to Herman, with a bit of hackery... |
Let's check to see what sector Guybrush is in with find_sector_type:
- system.currentActor:find_sector_type(CAMERA)
How about IsActorInSector()? Both toc_wide and toc_log both are matched as valid setups when Guybrush is near the log. However, in the retail version, only toc_log matches, with IsActorInSector(ActorHandle, "toc_wide") returning a nil, even when the setup toc_wide is showing! Trying this test again with the set gpt also resulted in nil values for IsActorInSector when in setups gtp_arial and gpt_dock, while ResidualVM reported that Guybrush was in the sectors of the same name.
First, let's see if the sectors actually overlap. To visualize the sectors in a set, I rewrote a utility in perl from residualvm-tools to work with EMI and GRIM. This new version can be found here. The input of this tool is a text based set (so you'll have to convert binary sets with setb2set first), and the output is a fig file, compatible with xfig. I also added the ability to filter by sector type.
For the set toc, I filtered by type camera, which is the type used to pick the view and got the following result:
Camera Sectors in the Set toc |
So, why does this bug arise? When the camera change function is called, it checks to see if Guybrush is still in the same sector by calling IsActorInSector(). This call succeeds when it should fail because the sectors are overlapped, so the camera change function thinks Guybrush hasn't left the sector.
This post is going on a bit long, so in the next post, we'll come up with a solution to this problem.
No comments:
Post a Comment