GetTranslation - can it translate pointers?

Started by EnterTheStory (aka tolworthy), Tue 04/01/2011 17:15:30

Previous topic - Next topic

EnterTheStory (aka tolworthy)

My translated games work fine, except for this code:
Code: ags
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:
Code: ags
function rm(String st) // used for finding exits from names
{	if(st ==GetTranslation("London streets"))        return 3;

But get the following error:
Code: ags
misc code.asc(369): Error (line 369): Type mismatch: cannot convert 'String*' to 'string'

Any suggestions?

Khris

Try this:

Code: ags
  if(st.CompareTo(GetTranslation("London streets")) == 0)        return 3;

EnterTheStory (aka tolworthy)

Brilliant! It works! I am forever in your debt.

SMF spam blocked by CleanTalk