[Mod Request] Flashlight Follows Mouse

This is the place to request new mods or give ideas about what could be done.
Post Reply
AngelSkyheart
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Mar 04, 2019 8:58 pm
Contact:

[Mod Request] Flashlight Follows Mouse

Post by AngelSkyheart » Mon Mar 04, 2019 9:10 pm

I would like for the flashlight to follow the mouse rather than face the direction my character is facing. Can this be done?

Alternatively, if the flashlight and my character could face the mouse and just move backwards/sideways in the direction I'm going that would be even better, though I realize that would require additional animations, or at least reversing some of the animations.

I ask because there are a lot of top down shooting games that do this so you can see what the heck you're aiming at, though at the very least this would also have your character at least following your focus in a way that doesn't seem disconnected from your own.

A little side idea to add a touch of realism would be to have the character move slightly slower the further away they're moving in the direction they're not facing, so they're slightly slower when side stepping, and slower when backing up. Though I figure that part should be optional if added at all...

unhott
Inserter
Inserter
Posts: 21
Joined: Tue Jan 09, 2018 3:01 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by unhott » Wed Mar 06, 2019 11:17 pm

Modders have no ability to track where your mouse is at-- we can only listen for certain events. one of those events is on_selection_changed, which kind of tells us the position of your cursor, if it happens to hover over an entity.

I would love to be able to read mouse position, but there is probably a performance related reason why we can't read mouse position on the fly. And, even if it wouldn't be too performance heavy we are still at the mercy of the devs to be able to take the time to implement it.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2267
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by steinio » Thu Mar 07, 2019 5:47 am

Image
Transport Belt Repair Man
My little mods: Link | My favourite mods: Bob's Mods | Angel's Mods | Yuoki Railway Core | EvoGUI | Logistic Train Network
Factorio Cheat Sheet by Denis Zholob

View unread Posts

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2234
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by darkfrei » Thu Mar 07, 2019 8:09 am

Maybe laser target pointer with the color of player? Add parameter last_selected and set the beam (rendering.line) from player to this entity. Some of entities are not selectable in the game.

arZic
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 03, 2019 8:12 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by arZic » Fri Sep 13, 2019 2:22 pm

Sorry for digging up this thread, but I figured it's better to ask here instead of making a new post.
unhott wrote:
Wed Mar 06, 2019 11:17 pm
Modders have no ability to track where your mouse is at-- we can only listen for certain events. one of those events is on_selection_changed, which kind of tells us the position of your cursor, if it happens to hover over an entity.

I would love to be able to read mouse position, but there is probably a performance related reason why we can't read mouse position on the fly. And, even if it wouldn't be too performance heavy we are still at the mercy of the devs to be able to take the time to implement it.
Mods that change combat seems to be able to track the mouse to a degree. (https://mods.factorio.com/mod/Aim and https://mods.factorio.com/mod/KS_Combat)
These mods change the combat so that it's actual projectiles that are shot, so it requires to know where you are aiming the mouse cursor to actually hit something.

So my question is: Would it possible to get the mouse position/direction from the player without shooting a weapon?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2234
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by darkfrei » Fri Sep 13, 2019 2:28 pm

I've made a new mod for this request: https://mods.factorio.com/mod/TorchLight
Would it possible to get the mouse position/direction from the player without shooting a weapon?
nope :(

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3654
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by eradicator » Sun Sep 15, 2019 9:23 pm

unhott wrote:
Wed Mar 06, 2019 11:17 pm
Modders have no ability to track where your mouse is at
In some ancient version (0.13?) this was actually possible. That it was removed means that it's unlikely to come back. It was probably removed to reduce network traffic.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Ideas and Requests For Mods”

Who is online

Users browsing this forum: No registered users