My translated games work fine, except for this code:
function rm(String st) // used for finding room numbers from names
{ if(st ==GetTranslation("London streets")) return 3;
How it works is this: if a hotspot has the name of a room (e.g. "London streets" is room 3) the game can use "rm(name)" to return its room number. I also list room names in an array of recently visited rooms. This works fine in English, but in other languages it breaks. So I tried this:
function rm(String st) // used for finding exits from names
{ if(st ==GetTranslation("London streets")) return 3;
But get the following error:
misc code.asc(369): Error (line 369): Type mismatch: cannot convert 'String*' to 'string'
Any suggestions?
Try this:
if(st.CompareTo(GetTranslation("London streets")) == 0) return 3;
Brilliant! It works! I am forever in your debt.