Sorry, we don't support your browser.  Install a modern browser
This post is closed.

trySelect and tryPickup events#379

new events that can be hooked into and even cancelled on a per-object basis.

3 years ago

additionally, if tryPickup would work on locked objects too, this would let us have objects as buttons.

Of course this would make the default return not locked so locked objects would not be picked up by default and unlocked objects would, as currently exists.

3 years ago

well, if you return false from the tryPickup essentialy, the object would never be pickep up, so it doesn;t need to be locked to function as a button

3 years ago

trySelect is possible by switching the appropriate toggle in a specific zone.

tryPickup is possible by switching “Lock” toggle in a specific zone.

trySelect and tryPickup seems very hacky and complicated. I don’t think we really need this. And I assume questions like: Why I can’t pick up objects? They aren’t locked! It’s a bug!

3 years ago

@Star
incorrect. onPickup is not fired when you try to pick up a locked object. And there is no onSelect function to hook into.

3 years ago

@ThatRobHuman
But I assume that selecting itself is my business. Scripts shouldn’t know or deal with my choice until I try to do something real (pick up, move, delete, etc).

3 years ago

I’m not seeing a direct use-case for trySelect yet. But tryPickup can be used to prevent players who’s turns it’s not to interact with certain things, or to make player pieces only movable by that player (in addition to the aformentioned button functionality).

3 years ago

direct use-case for trySelect?
this would let us have objects as buttons

arguably just having an onClick event for game objects would be a workable alternative.

3 years ago
Changed the status to
Research
3 years ago
B
Changed the status to
Planned
3 years ago
B
Changed the status to
In Progress
3 years ago
1
Changed the status to
Completed
3 years ago