Similiar to ‘onObjectPeek’ or ‘onObjectPickUp’, add ‘onFlip’ events which fire when an object is flipped (eg. selecting an object and pressing “F”).
Being able to return true or false to allow/disallow the flip would be very useful as well.
A million times this please.
– Recipe for modders & devs ;)
local function isOpen(obj) --for cards, tiles, etc
local rot = obj.getRotation()
return (rot.z < 90 or rot.z > 270)
end
@Star I don’t want to know whether an object is flipped or not, I want to know if a player clicks “flip” on an object - which player it is, and additionally, control whether that player is allowed to flip the object in the first place.
Yes please
I’m also asking for this. I’m creating a mod with some similarity to “Memory” (the kids game) and onFlip would make that one immensely easier to user. Right now I have to put a button on each tile…
@Janschmitte that is possible to achieve using the onUpdate event as noted above. It’s just ineffective and complicated compared to adding a New event. I can’t imagine it being very complicated to add.
@Eirikmun Yes, I could theoretically use the onUpdate event to compare the state of the last iteration to the new one. But as you said it’s ineffective, clunky and way too complicated. Also, as it runs every frame, it will eat CPU resources like cookies…
I want to catch the act of flipping something. Comparing new states to old states of up to a hundred objects (which is my use case) is not a solution here.
I don’t mean to attack you here, I’m just trying to clarify why that event will be helpful to me
Hurrah!
Tried onFlip and onObjectFlip. Nothing happens.
function onObjectFlip(a,b,c,d)
print(a,b,c,d)
end
Had there been a patch yet? Pretty sure they need to patch that in first.