[Mod Request] Flashlight Follows Mouse

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

[Mod Request] Flashlight Follows Mouse

Post by AngelSkyheart »

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: 30
Joined: Tue Jan 09, 2018 3:01 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by unhott »

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: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by steinio »

Image

Transport Belt Repair Man

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

Re: [Mod Request] Flashlight Follows Mouse

Post by darkfrei »

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: 13
Joined: Fri May 03, 2019 8:12 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by arZic »

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: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by darkfrei »

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: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Mod Request] Flashlight Follows Mouse

Post by eradicator »

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: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
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”