To Have and Have Not [Solved]

I've just discovered that Got (object) only returns 'true' if the object held is visible, i.e. not in a closed container held by the player. Is there an easy way to test if an object is in the possession of the player even if not immediately visible?


Different types of inventory…

  • Contains (game.pov, object) - does the player contain the object
  • Contains (game.pov, object) and object.visible - might be advisable because some libraries seem to make objects invisible instead of destroying them
  • ContainsReachable (game.pov, object) - is the object inside the player and not blocked by an invisible or closed container
  • ContainsVisible (game.pov, object) - As above, but allows objects that are inside transparent containers
  • Got (object) - Exactly the same result as ContainsVisible, but a lot slower (because it calls ContainsVisible on every object, makes a list of those that return true, and then checks if the object you want is in the list)

Thanks mrangel, ...for the solution, explanation and rapid response!


Log in to post a reply.

Support

Forums