config.lua help.

I just purchased my Devs license so I can start testing on a real device, but I’m having problems adapting my config.lua to the latest “ultimate config.lua”.
 

Here is the original config:

application = {     content = {         width = 768,         height = 1024,         scale = "letterBox",         fps = 60,                  imageSuffix = {             ["-hd"] = 2,             ["-ipadhd"] = 4         }     },            LevelHelperSettings = {                     imagesSubfolder = "images",          levelsSubfolder = "levels"      },     SpriteHelperSettings = {                  imagesSubfolder = "images"     }    }  

And the updated version:

application = { &nbsp;&nbsp;&nbsp; content = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scale = "letterBox", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fps = 60, &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imageSuffix = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ["-hd"] = 1.5, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ["-ipadhd"] = 3.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LevelHelperSettings = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imagesSubfolder = "images", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; levelsSubfolder = "levels" &nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp; &nbsp;SpriteHelperSettings = { &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;imagesSubfolder = "images" &nbsp;&nbsp; &nbsp;}&nbsp; &nbsp; } &nbsp;

When I run the simulator I get this error:
**"Line: 30

Attempt to compare number with nil"**

Line #30 -
width = aspectRatio > 1.5 and 800 or math.ceil( 1200 / aspectRatio ),

Anyone have a suggestion on how to fix this?
 

-Saer

Edit: I should probably clarify about the -hd, -ipadhd
-hd - suffix for HD images.
-ipadhd - suffix for 2x HD images.

Hi there!

You’ve forgotten to define the variable: aspectRatio. Add the following line at the beginning of your config.lua:

local aspectRatio = display.pixelHeight / display.pixelWidth;

Hi there!

You’ve forgotten to define the variable: aspectRatio. Add the following line at the beginning of your config.lua:

local aspectRatio = display.pixelHeight / display.pixelWidth;