diff --git a/src/playermat/ClueCounter.ttslua b/src/playermat/ClueCounter.ttslua index 3f75f750..2e0539e8 100644 --- a/src/playermat/ClueCounter.ttslua +++ b/src/playermat/ClueCounter.ttslua @@ -5,6 +5,7 @@ local searchLib = require("util/SearchLib") exposedValue = 0 local playmat +local searchParam = {} function onLoad() self.createButton({ @@ -22,6 +23,13 @@ function onLoad() local matColor = playmatApi.getMatColorByPosition(self.getPosition()) playmat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") + -- get search parameters (threat area excluded) + local localPos = playmat.positionToLocal(playmat.getPosition()) + searchParam.pos = playmat.positionToWorld(localPos + Vector(0, 0, 0.4)) + searchParam.rot = playmat.getRotation() + Vector(0, 90, 0) + searchParam.size = Vector(8, 1, 27) + searchParam.filter = "isClue" + -- start loop Wait.time(countItems, 1.5, -1) end @@ -43,5 +51,5 @@ function removeAllClues(trash) end function getClues() - return searchLib.onObject(playmat, "isClue") + return searchLib.inArea(searchParam.pos, searchParam.rot, searchParam.size, searchParam.filter) end