Page 1 of 1

Publishing problem on Mac

Posted: Thu Jun 21, 2018 3:55 pm
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!

Re: Publishing problem on Mac

Posted: Thu Jun 21, 2018 4:52 pm
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.

Re: Publishing problem on Mac

Posted: Thu Jun 21, 2018 4:55 pm
by franfox
Oh! Thanks!

Re: Publishing problem on Mac

Posted: Wed Jan 30, 2019 1:55 pm
by 10YrsScripter
Thanks It also helped!
I searched for this problem for a long time!