LuaForce.play_sound{surface=}

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

LuaForce.play_sound{surface=}

Post by eradicator »

Because just "position" plays on every surface...

Happy New Year!
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.


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

Re: LuaForce.play_sound{surface=}

Post by eradicator »

Is not force sensitive obviously.
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.

PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: LuaForce.play_sound{surface=}

Post by PyroFire »

eradicator wrote:
Tue Dec 31, 2019 1:13 pm
Is not force sensitive obviously.
You got me there.

I was looking at an old post where i made a similar suggestion.
Guess we really do need surface specification on luaforce.playsound, if you want force-specific surface-specific sounds

*Edit

Gave it some thought and you could do the processing and conditions in lua and play it individually per player (if you really needed to):
https://lua-api.factorio.com/latest/Lua ... play_sound

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: LuaForce.play_sound{surface=}

Post by Squelch »

Could a surface be considered to be part of the environment? I do understand that there may be occasions where a sound may need to be exclusive to a force, or even an individual player, but when it comes to environmental sounds made by other entities such as other players, biters etc, it seems strange that they may be silently performed - unless stealth actions are indeed the intention.

I may be misunderstanding of course :)

Happy New Year!

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

Re: LuaForce.play_sound{surface=}

Post by eradicator »

PyroFire wrote:
Tue Dec 31, 2019 1:39 pm
Gave it some thought and you could do the processing and conditions in lua and play it individually per player (if you really needed to):
https://lua-api.factorio.com/latest/Lua ... play_sound
You can do all sorts of stuff by looping. My point is that LuaForce.play_sound is incomplete in a three-dimensional coordinate system (x,y,surface) if i can only specify two coordinates. With just position the sound will *never* be played as expected, because nobody expects stuff to happen on all surfaces simultaneously.
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 “Modding interface requests”