[SOLVED] set_traversable_by issue

Started by MetalZelda, October 16, 2015, 12:59:00 AM

Previous topic - Next topic
October 16, 2015, 12:59:00 AM Last Edit: October 16, 2015, 01:14:44 PM by Username
Hello

I'm facing a issue with a basic custom entity (rewriting the chests), in on_created, i do follow the instructions by adding

Code (lua) Select
  self:set_can_traverse("hero", false)
  self:set_traversable_by("hero", false)
  self:set_traversable_by("hookshot", false)
  self:set_traversable_by("arrow", false)
  self:set_traversable_by("destructible", false)


the thing is, the hero cannot traverse the door, except if he has a certain item, but the hookshot,arrow and destructible don't work, they go through the entity, even if set_traversable_by is false.

I'm using Christopho's LUAs'd hookshot and bow scripts, that might be the issue, but I don't understand why it don't work for the destructible

Oh by the way, do you know a way to disable menu access during a cutscene ? hero:freeze() still allow to access the pause menu  ???

thanks for the answer

- The scripted hookshot and arrows are custom entities, they are not entities of built-in type "hookshot" or "arrow". So you need self:set_traversable_by("custom_entity", function() ........ end), passing a callback that decides.
- There might be a bug if destructibles can traverse your entity. However, it is not usual to move destructibles (recall that destructibles are bushes/pots/skulls).
- There is a function game:set_pause_allowed (see the doc).

Quote from: Christopho on October 16, 2015, 01:49:45 AM
- The scripted hookshot and arrows are custom entities, they are not entities of built-in type "hookshot" or "arrow". So you need self:set_traversable_by("custom_entity", function() ........ end), passing a callback that decides.
- There might be a bug if destructibles can traverse your entity. However, it is not usual to move destructibles (recall that destructibles are bushes/pots/skulls).
- There is a function game:set_pause_allowed (see the doc).

Ah, everything works great now, thanks  ;)