Player produce sound

Place to get help with not working mods / modding interface.
Post Reply
KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Player produce sound

Post by KaraUL! »

I have some idea, can u tell me is that possible: can we produce sound in game when certain event occured? For example:

Code: Select all

game.onevent(defines.events.ontick, function()
		local pos = game.player.position
		local ent = game.findentities{{pos.x-2, pos.y-2}, {pos.x+2, pos.y+2}}
		
		for i, e in ipairs(ent) do
			if e.name == "iron-ore" then
              --need produce sound here
             ....

User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

Re: Player produce sound

Post by Xecutor »

You can create custom 'explosion' entity without graphics, but with sound at player's location.

KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Re: Player produce sound

Post by KaraUL! »

Xecutor wrote:You can create custom 'explosion' entity without graphics, but with sound at player's location.
wow thats what i need, thx

Post Reply

Return to “Modding help”