Different languages, same game...

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Different languages, same game...

Postby Lyberodoggy » Mon Feb 25, 2008 7:02 pm

Ok, here I am again with a brand new useless idea :P
I came up with this idea during .ini creation in my tutorial about scoreboards.
Before continuing, I would like to say that I recommend this method only for puzzles. It can also be used on adventures, but it is gonna be far more difficult and I don't know if it can be used with dialogues yet...
Well let's get straight to the point: You can supply your game with a language pack by putting a languages.ini file in your project's "External Folder". Open your text editor.
You 'll have to create the file from scratch and it must look like this:
Code: Select all
[1]
1=English_text1
2=English_text2
[2]
1=German_text1
2=German_text2
etc

where English_text1 etc will be replaced by the text you will use for your game...
When finished writing it, save it as languages.ini
You will then have to create a language selection screen. Create a frame and go to advanced...
Type the code
Code: Select all
loadcontrol CheckboxObject(1)
CheckboxObject(1).Visible=true
CheckboxObject(1).Caption=English
CheckboxObject(1).Move x*y,z*d,a*e,t*y
//replace the letters with actual coordinates

for each language you want to include.
In this frame create a hotspot which will be the button for applying the language to an integer variable
create the integer variable named "selected_language"
Now go to the button hotspot.
Under its "Advanced" tab type this piece of code:
Code: Select all
//checking if player has selected more than one languages:
If CheckboxObject(1).value+CheckboxObject(2).value+...=1 Then
If CheckBoxObject(1).value=1 Then
selected_language=1
//where 1 represents English. In your .ini, you have written the English
//text under [1], so it will be used as the index for English.
else If CheckBoxObject(2).value=1 Then
selected_language=2
//where 2 represents German, because in your .ini German text is under [2] index
//same for all languages
end if
else
msgbox "select ONE language"
end if

Add another button hotspot which will be used for going to next frame. Name it "next". Go to its advanced Tab, type
Code: Select all
If selected_language=" " Then
msgbox "Please select your language"
Else
Action.PopupSaveGame
Action.Gotoframe "YourInitialFrame
End If

In the frame of your game, type this code for every text:
Code: Select all
//remember to replace the index of the text and the number of the row of
//the INI every time
Text(1).Caption=Action.ReadFromINI("languages.ini",selected_language,1)
Text(2).Caption=Action.ReadFromINI("languages.ini",selected_language,2)
//etc



Hope you will use it :P
Code: Select all
If facing any problems with the tutorial then
 feel free to ask me...
Else If you liked it then
feel free to let me know
End If :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby GM-Support » Mon Feb 25, 2008 7:45 pm

Thanks for posting this!
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby Lyberodoggy » Mon Feb 25, 2008 7:52 pm

My pleasure to be of help :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Tue Feb 26, 2008 1:38 pm

I think that we could get it to work with dialogues too, using the
Code: Select all
DialogueObject(i).caption=

command...


I 'm not sure yet...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue Feb 26, 2008 7:51 pm

Well, for my Connect 4 game, which is available in English, French, Spanish and German, at the start of the game, I simply use this code:

Code: Select all
Q = ReadINI("Settings.txt", 1, 1)

If Q = 1 then Language = "English"
If Q = 2 then Language = "Spanish"
If Q = 3 then Language = "French"
If Q = 4 then Language = "German"


Then when you set a language:

Code: Select all
WriteINI "Settings.txt", 1, Q


Where Q represents language selected.

This is how the program always starts in the last selected language.
_________________
us economic recessions
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Tue Feb 26, 2008 8:02 pm

I didn't place a writeINI command in purpose, in order for the code not to get to difficult to understand... It's going to anyway load the right language because the language variable is saved along with the player's progress.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Tue Feb 26, 2008 8:06 pm

Ah, I forgot to write this one:
If you want the player to skip the language selecting screen every time he starts a game, create a custom menu and include a "select language" button which transfers the player to the language selection frame apart from the "Start New Game" and "Load" buttons.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue Feb 26, 2008 8:08 pm

You definately have loads of great ideas! I'd love to do a project with you one day...
_________________
Hair Problems Forum
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Tue Feb 26, 2008 8:25 pm

Thanks... The same goes for you, I think you have lots of ideas and solutions too...

And I definitely would like to do a project with you too :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue Feb 26, 2008 8:29 pm

Well, if you have any ideas, get back to me.
_________________
Shinto Forum
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Tue Feb 26, 2008 8:33 pm

Ideas about what? Techs, Projects or... ?
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue Feb 26, 2008 8:35 pm

For a game or project...
_________________
Expatriate insurance Forum
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Chromegloss55 » Tue Feb 26, 2008 8:37 pm

I can't start any NEW PROJECTS at the moment, because I'm way too busy. I've got this Connect 4 to release, then I've got to release 100 VB Techniques. Then I have to pay those who asked for pay in relation to Connect 4. Plus I have Furtive and Hundiendo Isla to work on as well. My schedule is pretty full. But I can help out with an existing project, and when I'm done with these projects, I can help you start a new one.
_________________
Indian Forum
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Tue Feb 26, 2008 8:43 pm

Ok, I will wait for you to be free in order to start a project together... Maybe we could develop the trilogy I 've mentioned here http://www.adventuremaker.com/phpBB2/viewtopic.php?t=3582 or anything you want... But let's not get off-topic this much :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue Feb 26, 2008 8:46 pm

Yep.

I'll of course do anything for free. (I know what it's like to have to shell out money. It's painful!)
_________________
going green
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:12 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Tue Feb 26, 2008 8:56 pm

Chromegloss55 wrote:Well, for my Connect 4 game, which is available in English, French, Spanish and German, at the start of the game, I simply use this code:

Code: Select all
Q = ReadINI("Settings.txt", 1, 1)

If Q = 1 then Language = "English"
If Q = 2 then Language = "Spanish"
If Q = 3 then Language = "French"
If Q = 4 then Language = "German"


Then when you set a language:

Code: Select all
WriteINI "Settings.txt", 1, Q


Where Q represents language selected.

This is how the program always starts in the last selected language.

Thanks for your free-of-charge assistance :P
as for this post, I think I didn't get you (or you didn't get me...)
I created this tutorial, in order to include every single text of the game written in three or four languages... Not just the menus...
I don't get this line: If Q = 1 then Language = "English"
Language is a variable? Or a function? and if it's a variable, how does it work after assigning a value in it?
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron