Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: geork on Tue 01/06/2010 20:21:30

Title: Unresolved Script?
Post by: geork on Tue 01/06/2010 20:21:30
 I have a function in GlobalScript.asc which goes:
  function unitUPG(String Type, bool UPGable){

Then I have a function in GlobalScript.ash which goes:
  import function UnitUPG(String, bool);

But when I try to run the game, a message box (!) comes up and tells me:
  "Unable to create local script: Runtime error: unresolved import 'Unit UPG' "

  I am calling UnitUPG from other rooms,  but I doubt that makes a difference
   How can I fix this?
   Thanks
Title: Re: Unresolved Script?
Post by: Ryan Timothy B on Tue 01/06/2010 20:24:53
Look up Modules in the manual.

You need the import to be like this:

import function unitUPG(String Type, bool UPGable);


Which is odd because Import in the manual states otherwise.
Title: Re: Unresolved Script?
Post by: geork on Tue 01/06/2010 20:31:14
 The manual is a bit two sided on that one...
   Unfortunately, I tried this but it still comes up with the same error. Are there any other causes for the message box?
   Thanks
Title: Re: Unresolved Script?
Post by: Kweepa on Tue 01/06/2010 20:35:41
Look carefully at the names... make sure the capitalization is the same! :=
To spell it out, you have unitUPG and UnitUPG.
Title: Re: Unresolved Script?
Post by: geork on Tue 01/06/2010 20:40:41
 Nope, still doesn't work.
  Would it be helpful to note that in brackets the window says:
  "ACI version 3.12.1074" ?
  Thanks
Title: Re: Unresolved Script?
Post by: Kweepa on Tue 01/06/2010 20:46:28
Once you have matched up the function names, make sure the rooms are recompiled.
Title: Re: Unresolved Script?
Post by: geork on Tue 01/06/2010 20:52:35
 ...
I
Am
So
Sorry
About
This
Post  :(
unitUPG, NOT UnitUPG (capitol "U")
  sorry guys, that was quite the mistake I just made ;D
   Forgive me (please!) :=
  But thanks for all the help!
Title: Re: Unresolved Script?
Post by: Wyz on Tue 01/06/2010 20:54:32
Lol it happens ;D Usually it's a sign you either need some sleep, or more caffeine ;)
Title: Re: Unresolved Script?
Post by: Khris on Tue 01/06/2010 22:43:03
I always copy-paste the declaration that needs to be imported. "import " Ctrl-V ";" done.