Unresolved Script?

Started by geork, Tue 01/06/2010 20:21:30

Previous topic - Next topic

geork

 I have a function in GlobalScript.asc which goes:
 
Code: ags
 function unitUPG(String Type, bool UPGable){ 


Then I have a function in GlobalScript.ash which goes:
 
Code: ags
 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

Ryan Timothy B

Look up Modules in the manual.

You need the import to be like this:
Code: ags

import function unitUPG(String Type, bool UPGable);


Which is odd because Import in the manual states otherwise.

geork

 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

Kweepa

#3
Look carefully at the names... make sure the capitalization is the same! :=
To spell it out, you have unitUPG and UnitUPG.
Still waiting for Purity of the Surf II

geork

 Nope, still doesn't work.
  Would it be helpful to note that in brackets the window says:
  "ACI version 3.12.1074" ?
  Thanks

Kweepa

Once you have matched up the function names, make sure the rooms are recompiled.
Still waiting for Purity of the Surf II

geork

 ...
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!

Wyz

Lol it happens ;D Usually it's a sign you either need some sleep, or more caffeine ;)
Life is like an adventure without the pixel hunts.

Khris

I always copy-paste the declaration that needs to be imported. "import " Ctrl-V ";" done.

SMF spam blocked by CleanTalk