[BUG/User Error] Creating a new Sprite() results in doc::Sprite error

Hey everyone,

I’ve recently started scripting Asesprite,. In the latest version (v1.3.13-x64) if I attempt to create a new Sprite() like this:

local newSprite = Sprite(1024, 1024) 

… it results in the following error:

image

I’m experienced with other programming languages, but not LUA - I don’t know whether this is a type collision, but the official docs say this is the way you should create a new sprite, and when I look at other people’s scripts they use the same method.

If anyone can point out where I am going wrong, I would be very appreciative!

EDIT: See @dacap 's reply below for likely cause

Hi @ChrisRaadjes, it’s strange as the trial version doesn’t have the scripting capabilities/menu available. I think that probably you were testing something and doing a simple:

Sprite = Sprite(1024, 1024)

Broke the scripting engine (as the Sprite() function was replaced). Then rewriting the test to:

local newSprite = Sprite(1024, 1024)

Will bring the exact same error message until you restart Aseprite.

Hey Dacap,

Double checked, and that was exactly it - I had a utility script that imported a Sprite = app.sprite.

Definitely my unfamiliarity with LUA biting me there.

I’ll edit my post above to avoid misleading people. Thanks so much for your help!