Publishing problem on Mac

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
franfox
Prole
Posts: 11
Joined: Fri Feb 09, 2018 3:48 pm

Publishing problem on Mac

Post by franfox »

Hello,

I'm following the instructions for publishing my game but when I try to execute on Mac I got the following error:

Code: Select all

Error

src/defs_dependencies.lua:73: bad argument #2 to 'newSource' (string expected, got no value)


Traceback

[C]: in function 'newSource'
src/defs_dependencies.lua:73: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
I'm using this syntax for requiring files:

Code: Select all

somepath.somepath.somefile
But seems that the problem is with these lines:

Code: Select all

gSounds = {
    ['select'] = love.audio.newSource('assets/sound/select.wav'),
    ['switchOn'] = love.audio.newSource('assets/sound/swOn.wav'),
    ['switchOff'] = love.audio.newSource('assets/sound/swOff.wav'),
    ['doorCheck'] = love.audio.newSource('assets/sound/doorCheck.wav'),
    ['doorBlocked'] = love.audio.newSource('assets/sound/doorBlocked.wav'),
    ['doorOpened'] = love.audio.newSource('assets/sound/doorOpened.wav'),
    ['doorSwift'] = love.audio.newSource('assets/sound/doorSwift.wav'),
    ['wow'] = love.audio.newSource('assets/sound/wow.wav'),
    ['explosion01'] = love.audio.newSource('assets/sound/explosion01.wav'),
    ['explosion02'] = love.audio.newSource('assets/sound/explosion02.wav'),
    ['endBad1'] = love.audio.newSource('assets/sound/endBad1.wav'),
    ['endBad2'] = love.audio.newSource('assets/sound/endBad2.wav'),
    ['endBad3'] = love.audio.newSource('assets/sound/endBad3.wav'),
    ['escape'] = love.audio.newSource('assets/sound/escape.wav'),
    ['intro'] = love.audio.newSource('assets/sound/bso_pocketmaster_intro.ogg'),
    ['music'] = love.audio.newSource('assets/sound/bso_pocketmaster_ride.ogg'),
    ['ending'] = love.audio.newSource('assets/sound/bso_pocketmaster_win.ogg')
}
For my research I know using dot sintax for paths could resolve this problem but I can't do it with the love.audio.newSource, it's not working. Any idea?

Thanks!
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: Publishing problem on Mac

Post by pgimeno »

This is an 11.0 thing, not a Mac thing. The second argument is no longer optional, see love.audio.newSource.

Note the error message says bad argument #2, and you're not passing a 2nd argument.
User avatar
franfox
Prole
Posts: 11
Joined: Fri Feb 09, 2018 3:48 pm

Re: Publishing problem on Mac

Post by franfox »

Oh! Thanks!
10YrsScripter
Prole
Posts: 1
Joined: Wed Jan 30, 2019 11:57 am

Re: Publishing problem on Mac

Post by 10YrsScripter »

Thanks It also helped!
I searched for this problem for a long time!
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], pgimeno and 8 guests