Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Amir on Mon 06/06/2022 21:18:15

Title: Translation does not change in winsetup and in game as well
Post by: Amir on Mon 06/06/2022 21:18:15
Hi,

When I use Game.ChangeTranslation("English"); the translation does not change in winsetup and in the game as well, when I change it and exit the game then start it again, it hasn't changed. When I do that from the winsetup then I change it again in game then I get a mixture of English and German sprites in the game. Is that a bug in 3.5.1.18 version or am I doing something wrong? I thought it was all auto-saved  ??? I didn't have this problem with AGS 3.4.3. Does anyone know why? please help, I can not release it like that.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 09:29:46
QuoteI get a mixture of English and German sprites in the game

No, I am stupid, that happens because I use ctr x to change the room to the menu, actually I don't really leave the game. Sorry  :-[
But the problem that the language doesn't change everywhere, is still there.

It looks like a bug. That's sad because like I said, I didn't have this problem with older versions.

CW, are you there? or anyone whos working on AGS?

I hope there is a quick fix for this. My game is almost done.

EDIT:
I noticed another problem. Mouse dosn't lock to windows. It's checked and all over auto_lock=1, speed=0
I've tried deleting everything in Data and Window folders and rebuild again but it dosn't want to lock to window.  (wtf)
Title: Re: Translation does not change in winsetup and in game as well
Post by: eri0o on Tue 07/06/2022 12:34:54
@Amir, most of the recent work has been in finalizing 3.6.0, so I think until a new 3.6.0 is out it will be a bit difficult to find time to look into this without a test game that reproduces the issue for Game.ChangeTranslation("English") - if I understood one needs to build a 3.4.3 game that does this and then run it with 3.5.1.18 engine or rebuild it with that editor (didn't understood specifically which, but I guess second one) to see the difference in behavior.

I could not understand how Ctrl+X factors into this. What do you mean everywhere?

Also if some lines are translated and others are not, can you verify if the ones that are translated have something in common - like, neither of those have a german specific character like ü.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 15:10:04
Quote from: Amir on Mon 06/06/2022 21:18:15
When I use Game.ChangeTranslation("English"); the translation does not change in winsetup and in the game as well, when I change it and exit the game then start it again, it hasn't changed.

Game.ChangeTranslation is meant to only change translation in the current running game. It does not change anything in game config, therefore won't automatically be saved for winsetup or next game.
In the few earlier versions (I believe somewhere between 3.3 and 3.4) engine would automatically save config on exit, but that was disabled around 3.5.0 after complaints that engine writes over config unexpectedly.
Since 3.5.1 you need to explicitly call System.SaveConfigToFile() if you want to write current game options to config file. Another, more precise option is to implement your own config writing, e.g. using wyz's IniFile module; but i guess that may be complicated now if you're too close to release.

Quote from: Amir on Mon 06/06/2022 21:18:15
But the problem that the language doesn't change everywhere, is still there.

Is this the same problem as above, or a separate one where you get e.g. text in one language in one place and text in another language elsewhere?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 15:31:07
Quotemost of the recent work has been in finalizing 3.6.0, so I think until a new 3.6.0 is out it will be a bit difficult to find time to look into this without a test game that reproduces the issue for Game.ChangeTranslation("English")

The funny thing is that I tested it in 3.6.0 and it doesn't work there either. I tried alpha and beta, both have this bug. It only works with 3.4.... versions.
So, in 3.6.0 Alpha and Beta the mouse locks to windows, that's good but the language dos not change in winsetup after you change it in script. In 3.5.0 neither mouse lock to window nor language changing work. I find 3.4.0 the most stable version till now  ;-D but unfortunately I can't create it with 3.4.0 because it was made by 3.5.0. I hope maybe others have a solution for this bug. I don't want to do it without the buttons English Deutsch in the main menu :(

Quoteit will be a bit difficult to find time to look into this without a test game that reproduces the issue for Game.ChangeTranslation("English")

You can create a test game in 10 minutes  ;-D  to see that the language in winsetup dos not change when you change it in script.

QuoteAlso if some lines are translated and others are not, can you verify if the ones that are translated have something in common - like, neither of those have a german specific character like ü.

No no the translation works perfectly. Only the change does not work. You choose default language (German) in winsetup then save and play, in the main menu you click on the button English, it changes to English, everything is cool until now, you quit the game and look into winsetup, the language is still default language (German) NOT English as u changed it in script, when you start again you will have german main menu but the whole game is in English. That's just the problem.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 15:49:01
QuoteIs this the same problem as above, or a separate one where you get e.g. text in one language in one place and text in another language elsewhere?

Yes, the same problem.

Quotecall System.SaveConfigToFile() if you want to write current game options to config file.

Where? I put it in game start and still have the problem, it always stays at default in winsetup. as I said you will have german main menu but the whole game is in English when you start the game again.

QuoteIn the few earlier versions (I believe somewhere between 3.3 and 3.4) engine would automatically save config on exit, but that was disabled around 3.5.0 after complaints that engine writes over config unexpectedly.

That was handy. I had no problem with that.



Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 15:50:10
Quote from: Amir on Tue 07/06/2022 15:49:01
Quotecall System.SaveConfigToFile() if you want to write current game options to config file.

Where? I put it in game start and still have the problem, it always stays at default in winsetup. as I said you will have german main menu but the whole game is in English when you start the game again.

This function saves the current settings state. So you need to call it after you changed the settings.

Quote from: Amir on Tue 07/06/2022 15:49:01
That was handy. I had no problem with that.

Other people had, and complained, so I had to make this change.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 16:02:56
Quote from: Crimson Wizard on Tue 07/06/2022 15:50:10
Quote from: Amir on Tue 07/06/2022 15:49:01
Quotecall System.SaveConfigToFile() if you want to write current game options to config file.

Where? I put it in game start and still have the problem, it always stays at default in winsetup. as I said you will have german main menu but the whole game is in English when you start the game again.

This function saves the current settings state. So you need to call it after you changed the settings.

Quote from: Amir on Tue 07/06/2022 15:49:01
That was handy. I had no problem with that.

Other people had, and complained, so I had to make this change.

Finally it works again, thank u :) I have to read the updates regularly, I don't do that. and what about the mouse? Is there also a new function? it dosn't lock to window.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 16:04:24
Quote from: Amir on Tue 07/06/2022 16:02:56
and what about the mouse? Is there also a new function? it dosn't lock to window.

I just tried it in a random 3.5.1 game, it it works if i check the option in the winsetup, in "Advanced" - "Mouse options". Is this how you do that?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 16:10:25
Quote from: Crimson Wizard on Tue 07/06/2022 16:04:24
Quote from: Amir on Tue 07/06/2022 16:02:56
and what about the mouse? Is there also a new function? it dosn't lock to window.

I just tried it in a random 3.5.1 game, it it works if i check the option in the winsetup, in "Advanced" - "Mouse options". Is this how you do that?

Yes AND in Default Setup is true. Hmmmm that's weird  (wtf)
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 16:12:26
As far as I remember, I had the problem last time, but suddenly it worked without me doing anything.

Edit: and like I said it worked half an hour ago with 3.0.6.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 16:21:17
Does it depend on how do you run the game (from the editor, from built exe, and so on)?

Also, Ctrl+Alt combination toggles the lock, do you press it for any reason during the game?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 16:34:09
Quote from: Crimson Wizard on Tue 07/06/2022 16:21:17
Does it depend on how do you run the game (from the editor, from built exe, and so on)?

Also, Ctrl+Alt combination toggles the lock, do you press it for any reason during the game?

I'm trying from both but it dosn't work.

I have heard about Ctrl+Alt combination and I pressed them several times, still so slow at Default, not like my mouse speed. Maybe will help a PC restart?  (laugh)
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 16:37:33
Quote from: Amir on Tue 07/06/2022 16:34:09still so slow at Default, not like my mouse speed.

Wait, is the problem mouse lock or speed? or both?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 18:30:33
Quote from: Crimson Wizard on Tue 07/06/2022 16:37:33
Quote from: Amir on Tue 07/06/2022 16:34:09still so slow at Default, not like my mouse speed.

Wait, is the problem mouse lock or speed? or both?

I guess mouse lock  ;-D I just meant it's slow because it's not locked to my window, my mouse is faster. I have now tried another test game, no chance. it's all HD games, 1280x720. Is your test game HD too?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 18:43:21
Quote from: Amir on Tue 07/06/2022 18:30:33
Quote
Wait, is the problem mouse lock or speed? or both?

I guess mouse lock  ;-D I just meant it's slow because it's not locked to my window, my mouse is faster.

Sorry, but I'm still not sure what do you mean. Is cursor movement in game is slower than the movement of the system cursor?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 18:55:52
Quote from: Crimson Wizard on Tue 07/06/2022 18:43:21
Quote from: Amir on Tue 07/06/2022 18:30:33
Quote
Wait, is the problem mouse lock or speed? or both?

I guess mouse lock  ;-D I just meant it's slow because it's not locked to my window, my mouse is faster.

Sorry, but I'm still not sure what do you mean. Is cursor movement in game is slower than the movement of the system cursor?

Yes slow and like a heavy stone. This is probably the default speed 1. The movement speed of my system cursor is almost 2.2.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Tue 07/06/2022 19:47:19
It works now, I don't know what I did  :-\ I just tried it several times. What is the best speed that most people use do you think?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Tue 07/06/2022 21:17:54
Quote from: Amir on Tue 07/06/2022 18:55:52
Yes slow and like a heavy stone. This is probably the default speed 1. The movement speed of my system cursor is almost 2.2.

As far as I recall, mouse speed is not applied by default in the windowed mode, only in fullscreen, and should not depend on mouse lock (it's a completely separate setting).
I also remember that by default the engine tries to make mouse speed in fullscreen close to the system cursor speed, but maybe this does not work well if the system cursor is sped up somehow (not sure).

IMHO the best is to not guess about other people by your system behavior, and leave the speed setting on default position, and let players adjust it only if really necessary.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Wed 08/06/2022 11:41:25
QuoteI also remember that by default the engine tries to make mouse speed in fullscreen close to the system cursor speed, but maybe this does not work well if the system cursor is sped up somehow (not sure).

Apparently not. It's always very slow by default but it's not bad.

QuoteIMHO the best is to not guess about other people by your system behavior, and leave the speed setting on default position, and let players adjust it only if really necessary.

Yes, but I've noticed most people don't look at winsetup, they start the game right away then curse because the mouse slow. Some have asked me why it's so slow. Some haven't seen "Advanced" at all. People are not used to adjusting the mouse before playing. I believe Visionaire and Unity set the speed automatically as fast as the system.
I'm considering making Mouse.Speed in the options in game but the problem, there is no more space for another slider.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Thu 16/06/2022 15:06:04
Hi,
I have a question. My default language is German. I created English Translation then I put the English translation in English.trs, and then I put the German speech in script with &number. AGS has now created new lines for me with &number in the .trs and the English translation no longer appears.

Should I have inserted the German speech first and then the English translation?  :-X

Do I now have to insert the English translation again for the new sentences with &number? If yes, I will have 2 texts, one with &number and the old one without &number. Should I leave them all like that or delete some? I don't think they will cause problems if I leave them all, but should I delete the old texts without &number just to be safe?
Title: Re: Translation does not change in winsetup and in game as well
Post by: Crimson Wizard on Thu 16/06/2022 15:29:06
It's a well known problem that when you change text in script, the translation system thinks it is a different text and adds it separately to the TRS file. In fact, if you change even a single letter it will be considered a different line from now on. That's why people often suggest to not create translations until your default text in script is all ready.
This can only be fixed by changing how translation system works in AGS, sometime in the future.

So yes, you will need to use new lines with & signs now; and may delete all lines without & signs as they will no longer be useful for anything.

Alternatively, you could backup your trs, delete everything from the one in the project folder, tell to update, then you will have a clean trs to where you may then paste translations from backup correspondingly.
Title: Re: Translation does not change in winsetup and in game as well
Post by: Amir on Thu 16/06/2022 16:54:21
Quotethe translation system thinks it is a different text and adds it separately to the TRS file. In fact, if you change even a single letter it will be considered a different line from now on.

I knew that, but I thought AGS can differentiate the &number from the other letters.

QuoteAlternatively, you could backup your trs, delete everything from the one in the project folder, tell to update, then you will have a clean trs to where you may then paste translations from backup correspondingly.

I'm afraid it will change the order. Now the order is the same. I can copy line by line and paste under the new ones, it's faster. I'll just delete the top old ones.