I have multiple mods that require or will require being able to play sounds to a player directly, without the sound having coordinates.
For example if I make some sort of user interface and use the player.play_sound() method, the sound is not audible if the player moves away from the coordinates it was when the method was called.
This has a lot of use cases: for example equipment like metal detector or a geiger counter, a gta-like radio in vehicles, and many more...
positionless player.play_sound()
Re: positionless player.play_sound()
I think you can change https://lua-api.factorio.com/latest/pro ... e_modifier on the sound prototype to make it not affected by distance.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: positionless player.play_sound()
Thank you for the suggestion, sadly the value "must be" in the range [0;1] and 1 is still positioned on the game surface :/
Re: positionless player.play_sound()
Possible duplicate of viewtopic.php?f=221&t=64281
Re: positionless player.play_sound()
I don't think so, I've done a post search before doing this one and it seems like this topic is more about making a sound position follow an entity, which is different from my proposal of not having a position at all.
Re: positionless player.play_sound()
Hello,
Playing the sound as a global when a position is not defined makes sense to me. In fact, it already behaves like that in 2.0, the change happened as a part of some refactoring I was doing. I'll think about it a little more but I think I'll make the change in 1.1.x as well, I don't see a reason why it would need to default to the player's position (audio center, to be precise).
Playing the sound as a global when a position is not defined makes sense to me. In fact, it already behaves like that in 2.0, the change happened as a part of some refactoring I was doing. I'll think about it a little more but I think I'll make the change in 1.1.x as well, I don't see a reason why it would need to default to the player's position (audio center, to be precise).
- Stringweasel
- Filter Inserter
- Posts: 391
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
Re: positionless player.play_sound()
That would be awesome! It's been requested here as well by me 98618
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |Weasel's Demolition Derby
Official Contributor to Space Exploration
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |
Official Contributor to Space Exploration
Re: positionless player.play_sound()
Thank you very muchDonion wrote: ↑Thu Oct 19, 2023 9:51 amHello,
Playing the sound as a global when a position is not defined makes sense to me. In fact, it already behaves like that in 2.0, the change happened as a part of some refactoring I was doing. I'll think about it a little more but I think I'll make the change in 1.1.x as well, I don't see a reason why it would need to default to the player's position (audio center, to be precise).
Re: positionless player.play_sound()
Decision was made to leave it as is for 1.1, so stay tuned for 2.0.