There is an easy way to assign to a global or local integer variable which language I'm using?
I have some 3d text (text mesh) that I would like to change when player change the language. So, setting the "on variable change" cutscene, I can change them all.
Or some other way to change them "on the fly" when player switch between language cycles.
Tx.
Comments
Options.GetLanguage ();
So to assign this to e.g. a Local integer Variable of ID=2:
LocalVariables.SetIntegerValue (2, Options.GetLanguage ());
Hi, I have to change a scene object based on language. I have created this script and put it in the main camera, but I don't know what I have to do now to be able to detect the language within an action list.
Can someone explain it to me please? I think that this is a very usefull thing.
See the Manual's "Save scripting" chapter. The active language can be read with:
Alternatively, you can use the Custom: Check Language Action.
Thanks! The Custom: Check Language Works fine!
Sorry, I put the CheckLanguage script in the Main Camera and This error appears in the Consoles:
**NullReferenceException: Object reference not set to an instance of an object
AC.LocalVariables.SetIntegerValue (System.Int32 _id, System.Int32 _value) (at Assets/AdventureCreator/Scripts/Variables/LocalVariables.cs:281)**
Can this exception affect to the Action List? I put the Check Language Action in an action list and it seems like it works, but i´m not sure because I don´t have more than a language in my project yet.
Using AC v1.71.4
Thanks
The CheckLanguage script above is separate from the ActionCheckLanguage Action script - the error in the first won't affect the second.
The error is that it cannot find the local variable with the given ID number - which is hard-coded to 41 in 2finger's code. You'll need to change this to the ID of the local variable you want to affect.