![Smile :)](./images/smilies/icon_e_smile.gif)
Additionally, if it's not too inconvenient to implement, return a handle to the new sound instance with which you can stop and destroy it. I want full control over it.
Yes but the sound needs to follow the car.Bilka wrote: Mon Jan 07, 2019 9:36 pm https://lua-api.factorio.com/latest/Con ... #SoundPath already supports build, close and various other sounds.
You can add sounds to entities no problem, how do you think the base entities have sounds?
The way virtually all of those one-shot sounds work is the game just does "play sound" and then doesn't care about ever stopping it. It plays until the sound ends and then it's done playing.slikts wrote: Sun May 10, 2020 11:30 am The base entities have sounds for specific events like being opened, mined, dying, working, etc. If a use case doesn't fit those events (like for the mod I linked to), then I don't see how it could be done, at least in a simple way without creating a dummy entity and moving it with the character. The surface sound API also doesn't allow stopping sounds, so it's overall very limiting.
Saying it wasn't deterministic was completely incorrect on my part no idea what I was thinking as it has to be to work in multiplayer. As for the saved/loaded with the game. I swear I read somewhere that LuaRendering wasn't saved with the game (probably imagined it in my sleepiness last night or dreamt it after going to bed) while trying to figure out why my sprite would disappear after every server restart. Testing in singleplayer yield the same result.Rseding91 wrote: Thu Aug 06, 2020 5:00 am Uhhh.... LuaRendering *is* saved/loaded and is deterministic.
Sorry and thanks. It was in my train of thought while making my post and they ended up posted together.Bilka wrote: Thu Aug 06, 2020 8:51 am Credomane, I split off your LuaRendering suggestion to a different post since it is a good point/idea, but completely unrelated to sounds: 87608
Other than that, I'd like to put emphasis on the fact that LuaRendering is save/loaded and deterministic, as Rseding says. I hope no mod is attempting to recreate render objects on every tick or on load or something because they assumed the objects are not save/loaded.