Currently this field stores absolute value that depends on the game window size, which seems impossible to determine.
It'd be more useful if we could obtain the cursor position in screen units (e.g. cursor.x/window_width). Maybe even with character being reference point.
game.player.cursorposition should be relative
game.player.cursorposition should be relative
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: game.player.cursorposition should be relative
do these help?
screen2realposition
Translate screen coordinates (position relative to the left top edge of the window) to the map coordinates (what is the map position of the place under the cursor).
real2screenposition
Translate map coordinates to screen coordinates.
screen2realposition
Translate screen coordinates (position relative to the left top edge of the window) to the map coordinates (what is the map position of the place under the cursor).
real2screenposition
Translate map coordinates to screen coordinates.
Re: game.player.cursorposition should be relative
See also: https://forums.factorio.com/forum/vie ... f=7&t=5917
So, take care if you're going to use that method It might not exist forever.
So, take care if you're going to use that method It might not exist forever.
If you want to get ahold of me I'm almost always on Discord.
Re: game.player.cursorposition should be relative
Well, those definitely could be used to pile up a function that achieves the same goal, but I wouldn't want to use it on each tick if a simple table field lookup was possible.jeroon wrote:do these help?snip
Aww. That's sad. Those were nice way of making custom controls in the mods.Rseding91 wrote:See also: https://forums.factorio.com/forum/vie ... f=7&t=5917
So, take care if you're going to use that method It might not exist forever.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: game.player.cursorposition should be relative
After reading their response I don't think the methods are going anywhere but they definitely won't be compatible with MP/replays so you'll want to keep that in mind if you do use them.Adil wrote:Aww. That's sad. Those were nice way of making custom controls in the mods.
If you want to get ahold of me I'm almost always on Discord.