{"id":130,"date":"2014-06-03T18:36:24","date_gmt":"2014-06-03T18:36:24","guid":{"rendered":"https:\/\/blogs.scummvm.org\/josejx\/?p=130"},"modified":"2022-05-21T18:37:36","modified_gmt":"2022-05-21T18:37:36","slug":"making-it-easier-to-talk-to-herman","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/josejx\/2014\/06\/03\/making-it-easier-to-talk-to-herman\/","title":{"rendered":"Making it Easier to Talk To Herman"},"content":{"rendered":"<p><i>Continued from the <a href=\"https:\/\/blogs.scummvm.org\/josejx\/2014\/06\/02\/herman-doesnt-want-to-talk\/\" target=\"_blank\" rel=\"noopener\">previous entry<\/a><\/i><\/p>\n<p>In the previous entry, we identified the reason why it&#8217;s hard to start a conversation with Herman Toothrot in the set <i>toc<\/i>. To debug this issue, I took a look at the set <i>gpt<\/i> because it has a variety of sectors, many with the same name. This results in sectors that are easy to move between, but transition in the wrong place. For example, the transition between <i>gpt_village (sector 4)<\/i> and <i>gpt_starbuck (sector 5)<\/i> happens at a different position in the retail version of EMI and ResidualVM, as shown below:<\/p>\n<figure id=\"attachment_132\" aria-describedby=\"caption-attachment-132\" style=\"width: 350px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/WalkSectorStarbuck.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-132\" src=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/WalkSectorStarbuck.png\" alt=\"\" width=\"350\" height=\"100\" srcset=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/WalkSectorStarbuck.png 350w, https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/WalkSectorStarbuck-300x86.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/a><figcaption id=\"caption-attachment-132\" class=\"wp-caption-text\">EMI Retail on the Left, ResidualVM on the Right<\/figcaption><\/figure>\n<p>Let&#8217;s take a look at the sector map for the camera sectors for the set gpt:<\/p>\n<figure id=\"attachment_133\" aria-describedby=\"caption-attachment-133\" style=\"width: 767px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/gptSectors.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-133\" src=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/gptSectors.png\" alt=\"\" width=\"767\" height=\"531\" srcset=\"https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/gptSectors.png 767w, https:\/\/blogs.scummvm.org\/josejx\/wp-content\/uploads\/sites\/23\/2014\/06\/gptSectors-300x208.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/a><figcaption id=\"caption-attachment-133\" class=\"wp-caption-text\">Camera Sectors in the Set gpt<\/figcaption><\/figure>\n<p>In this picture, we can see that the two sectors overlap, resulting in the glitchy behavior we see in the example above. In the retail version, it appears that the higher ID sector takes precedence over a lower sector ID.<\/p>\n<p>As another test, let&#8217;s move Guybrush into the sector marked 4 and check what the result of <i>IsActorInSector(guybrush.hActor, &#8220;gpt_village&#8221;)<\/i> is. We would expect this function to return &#8220;4&#8221; because this sector is named <i>gpt_village<\/i>, but in fact, we are told that Guybrush isn&#8217;t in the sector <i>gpt_village<\/i>. However, if we move Guybrush into the sector marked 16, which is another sector named <i>gpt_village<\/i>, we find that the same command returns 16, indicating that Guybrush is in the sector!<\/p>\n<p>So, it appears that <i>IsActorInSector<\/i>() should only return the sector ID if the name matches the requested name and the ID is the highest of all of the sectors where the name matches. A patch that implements this is found in an update to <a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/883\" target=\"_blank\" rel=\"noopener\">PR #883<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continued from the previous entry In the previous entry, we identified the reason why it&#8217;s hard to start a conversation with Herman Toothrot in the set toc. To debug this issue, I took a look at the set gpt because it has a variety of sectors, many with the same name. This results in sectors [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-130","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/posts\/130\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/josejx\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}