Any idea why Defold doesn't recognise this address?


image

The path worked fine earlier, but for some reason It now decides now that it is given indirectly through a dictionary that I can’t find the file.

this line functions correctly

require("!!Scripts.CharacterScripts.Marina")

but this version which I need for my project to work

local CharacterTable = {
        [1] = {"!!Scripts.CharacterScripts.Marina", "Sprites.Marina.Marina.atlas"},
    }

    local Character = tostring(CharacterTable[GetCurrentPlayerCharacters()[self.ID]][1])
    require(Character)

for perspective, the line outputted by Character is

!!Scripts.CharacterScripts.Marina

which is exactly the same. HELP!

Defold parses your scripts to determine what to include in a build. You need to explicitly require the module somewhere in order for Defold to know to include it.

1 Like

You can do that easily by having the table store the module directly:

local CharacterTable = {
    [1] = {require("!!Scripts.CharacterScripts.Marina"), "Sprites.Marina.Marina.atlas"},
}
1 Like

but would that trigger the require??

Yes, that’s the idea.