Page 1 of 1

Read whether stone/concrete/ground is under mouse cursor?

Posted: Tue Jul 19, 2016 6:59 pm
by Tinyboss
I've made the Picker mod which behaves like the middle mouse button in Minecraft: put your cursor over an entity and activate Picker with a hotkey, and it selects the corresponding item from your inventory. I'd like to extend it to be able to pick stone, concrete, and hazard concrete as well, but I don't see how to do it. I'm using player.selected to get the entity currently under the cursor--is there a corresponding pointer to the tile under the cursor?

I thought I found the answer with player.cursor_position, but that's a write-only property. I guess there are synchronization issues?

Re: Read whether stone/concrete/ground is under mouse cursor?

Posted: Wed Jul 20, 2016 9:17 am
by Rseding91
You can't. The mouse position is not part of the game state and as such can't be read from mods.

Re: Read whether stone/concrete/ground is under mouse cursor?

Posted: Wed Jul 20, 2016 12:47 pm
by Tinyboss
Rseding91 wrote:You can't. The mouse position is not part of the game state and as such can't be read from mods.
Thanks for the definitive answer.

Re: Read whether stone/concrete/ground is under mouse cursor?

Posted: Wed Jul 20, 2016 2:40 pm
by DedlySpyder
Rseding91 wrote:You can't. The mouse position is not part of the game state and as such can't be read from mods.
Then what is the point of cursor_position?

Re: Read whether stone/concrete/ground is under mouse cursor?

Posted: Wed Jul 20, 2016 2:41 pm
by Rseding91
DedlySpyder wrote:
Rseding91 wrote:You can't. The mouse position is not part of the game state and as such can't be read from mods.
Then what is the point of cursor_position?
It's write only. It was put in to make the game trailer and never removed.