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...
[Mod Request] Flashlight Follows Mouse
-
- Manual Inserter
- Posts: 2
- Joined: Mon Mar 04, 2019 8:58 pm
- Contact:
Re: [Mod Request] Flashlight Follows Mouse
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.
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.
Re: [Mod Request] Flashlight Follows Mouse
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.
Re: [Mod Request] Flashlight Follows Mouse
Sorry for digging up this thread, but I figured it's better to ask here instead of making a new post.
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?
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.
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?
Re: [Mod Request] Flashlight Follows Mouse
I've made a new mod for this request: https://mods.factorio.com/mod/TorchLight
nope :(Would it possible to get the mouse position/direction from the player without shooting a weapon?
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Mod Request] Flashlight Follows Mouse
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.