Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monsieur OUXX on Thu 27/02/2014 16:31:38

Title: [SOLVED] script link failed: runtime error: unresolved import 'character'
Post by: Monsieur OUXX on Thu 27/02/2014 16:31:38
I had my game working fine.
Then I decided to tidy up my gazillion Editor folders and started moving assets around inside the game Editor: subfolders, etc.
Now I run my game and I get this : "script link failed: runtime error: unresolved import 'cMainCharacter'.

cMainCharacter is my main character in the game. It's character 0. It's still here, I can open it and view it.
Moreover, I believe character aliases are global (by AGS design). So I fail to see how it could not be imported somewhere.

Could AGS be complaining that this character is unknown to a specific script? Or is it complaining that the character doesn't exist altogether? I hope I didn't corrupt my game.


Title: Re: script link failed: runtime error: unresolved import 'character'
Post by: Khris on Thu 27/02/2014 16:42:12
Did you make a backup before rearranging lots of things?
Title: Re: script link failed: runtime error: unresolved import 'character'
Post by: Monsieur OUXX on Thu 27/02/2014 17:06:15
Quote from: Khris on Thu 27/02/2014 16:42:12
Did you make a backup before rearranging lots of things?

I have a backup, but from one week ago (a lot of things changed since then). I didn't think creating subfolders inside the game would cause issues :(  I could re-do everything Ive done since then, but if anyone has an idea of another possible cause for the issue, I'd be very happy.

EDIT: there must definitely be another cause, most likely a human mistake; I deleted that character and re-created it, the issue persists. Could this error happen if there is a mistake made at some point with SetAsPlayer, or if the character is not in the current room, etc.?

Title: Re: script link failed: runtime error: unresolved import 'character'
Post by: monkey0506 on Thu 27/02/2014 17:14:38
It's probably not recompiling the rooms properly. Have you tried doing a Rebuild all?
Title: Re: script link failed: runtime error: unresolved import 'character'
Post by: Monsieur OUXX on Thu 27/02/2014 17:17:56
Quote from: monkey_05_06 on Thu 27/02/2014 17:14:38
It's probably not recompiling the rooms properly. Have you tried doing a Rebuild all?

I just tried. I really thought that would work, because I noticed that the rooms were not compiled in the same order as before (because of the folders I created), so I thought there was probably a dirty symbol "cMainCharacter" stuck in some chunk of formerly-compiled data...

...But the issue is still there :(
Title: Re: script link failed: runtime error: unresolved import 'character'
Post by: Monsieur OUXX on Thu 27/02/2014 17:25:10
RESOLVED!

Here is what I did:
1) I re-built all the rooms, as recommended (I don't know if it helped but I'd rather mention it)
2) I closed and re-open AGS.
3) I compiled : the Editor complained that the game is set to start in room 0 (it didn't, before)
4) I opened my cMainCharacter and clicked on "Set as player character"
5) I ran the game and it ran fine.

Hurray!