Need a solution to getting cursor position while in map view

Place to get help with not working mods / modding interface.
Post Reply
Dak31
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Jun 25, 2018 11:17 pm
Contact:

Need a solution to getting cursor position while in map view

Post by Dak31 »

Context: I want to chart an area of choice on the map. Since there is no cursor.position information available to us (I would love to be wrong here), I've been led to believe that using events would be the easiest way to get this information (since the event would be at the cursor location). I've tried to modify both the poison capsule and artillery target remote with limited success. For the modified poison capsule I am able to record the event location at time of use and reveal the area around the event, however I cannot use the capsule from the map view. It seems that the capsuleAction of type projectile does not have such an option within its data structure. With the modified artillery targeting remote the capsule action will happen on the map view, but I cannot set the type to nil, so the event would have to be within the range of the artillery cannon (the event is prevented from occurring if there is not one) and if it is within range it would also shoot a projectile shell....

I do not know if copying and modifying a capsule_action type is something that is possible, but I am assuming it is not. I am open to suggestions on how to use capsules to get the cursor position while in map view, other ways to get the cursor position while in map view, or some other means to bypass needing to get the cursor position to reveal the area around the cursor.

User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

Re: Need a solution to getting cursor position while in map view

Post by Cooldude2606 »

I cant offer much help, but here is an older thread with a similar issue.

TL;DR
There is no way to get the current map or cursor position since both are non deterministic.
The only work around is to make a custom capsule.

I would suggest looking at the MIRV mod by Klonan for how he does a custom remote.
--- Developer for Explosive Gaming factorio community. Find our code on GitHub. Please contact me via our Discord. ---

Pi-C
Smart Inserter
Smart Inserter
Posts: 1645
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Need a solution to getting cursor position while in map view

Post by Pi-C »

If only there was a way to marry capsule and selection tool … That would be something i could use for Autodrive. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding help”