Shard icon indicating copy to clipboard operation
Shard copied to clipboard

cryptic error when shard_include can't load a file

Open eronoobos opened this issue 9 years ago • 5 comments

I think that's what the error message is telling me:

[f=-000001] <SkirmishAI: Shard git (team 0)>: ...\Spring\AI\Skirmish\Shard\git\ai\preload/globals.lua:31: loop or previous error loading module 'taskqueuebehaviour'
stack traceback:
    [C]: ?
    [C]: ?
    [C]: in function 'require'
    ...\Spring\AI\Skirmish\Shard\git\ai\preload/globals.lua:31: in function 'shard_include'
    ...es\Spring\AI\Skirmish\Shard\git\ai\BA\behaviours.lua:1: in main chunk
    [C]: in function 'require'
    ...\Spring\AI\Skirmish\Shard\git\ai\preload/globals.lua:31: in function 'shard_include'
    ...Spring\AI\Skirmish\Shard\git\ai\behaviourfactory.lua:4: in main chunk
    [C]: in function 'require'
    ...\Spring\AI\Skirmish\Shard\git\ai\preload/globals.lua:31: in function 'shard_include'
    ...ents\My Games\Spring\AI\Skirmish\Shard\git\ai\ai.lua:4: in main chunk

This is the result of my attempt to test the compatibility of my fork https://github.com/eronoobos/Shard with the Spring Skirmish AI library.

eronoobos avatar May 12 '16 03:05 eronoobos

hmmm how do you know it's recursing? It's loading a file that immediatley loads another file, the problem was that it couldn't be found for whatever reason

tomjn avatar May 12 '16 11:05 tomjn

Ahh, okay, that's what it means. Why "loop"? And why "previous error"?

If taskqueuebehaviour isn't found, that's odd, because it's in both the game subdirectory and the ai directory.

eronoobos avatar May 12 '16 14:05 eronoobos

ahhhh, i see, i just had to send the error of pcall to the console when it fails. the file is found, but can't be loaded for reasons within the code within the file:

[f=-000001] <SkirmishAI: Shard git (team 0)>: require can't load BA/commonfunctions error: ...ring\AI\Skirmish\Shard\git\ai\BA/commonfunctions.lua:39: attempt to index global 'ai' (a nil value)
[f=-000001] <SkirmishAI: Shard git (team 0)>: require can't load commonfunctions error: ...ring\AI\Skirmish\Shard\git\ai\BA\commonfunctions.lua:39: attempt to index global 'ai' (a nil value)
[f=-000001] <SkirmishAI: Shard git (team 0)>: require can't load BA/taskqueues error: ...es\Spring\AI\Skirmish\Shard\git\ai\BA/taskqueues.lua:17: attempt to index global 'game' (a nil value)
[f=-000001] <SkirmishAI: Shard git (team 0)>: require can't load taskqueues error: ...es\Spring\AI\Skirmish\Shard\git\ai\BA\taskqueues.lua:17: attempt to index global 'game' (a nil value)

(aka my BA config's fault)

eronoobos avatar May 12 '16 15:05 eronoobos

Ah, we should work that into the shard_include function so that it's less cryptic :) Good catch!

tomjn avatar May 12 '16 15:05 tomjn

https://github.com/eronoobos/Shard/commit/fa9b25e9252243004fe26b5226430f0b35c90ade whenever i can resolve the incompatibility, these changes might make it to this repo :-P

eronoobos avatar May 12 '16 15:05 eronoobos