To Have and Have Not [Solved]

DavyB
06 Jul 2020, 12:19I'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?
mrangel
06 Jul 2020, 14:11Different types of inventory…
Contains (game.pov, object)
- does the player contain the objectContains (game.pov, object) and object.visible
- might be advisable because some libraries seem to make objects invisible instead of destroying themContainsReachable (game.pov, object)
- is the object inside the player and not blocked by an invisible or closed containerContainsVisible (game.pov, object)
- As above, but allows objects that are inside transparent containersGot (object)
- Exactly the same result asContainsVisible
, but a lot slower (because it callsContainsVisible
on every object, makes a list of those that return true, and then checks if the object you want is in the list)

DavyB
06 Jul 2020, 20:10Thanks mrangel, ...for the solution, explanation and rapid response!