External Text v3.3.4 (Write your game in an organized manner! Translate with ease!)

ディーノス

Make a new destiny!
Veteran
Joined
Jul 3, 2012
Messages
187
Reaction score
19
First Language
Indonesian
Primarily Uses
i don't understand how to use it....

i'm little dizzy after read this...

@_@

and using .txt file...

@_@

DIZZZZZYYYY.... @_@
 

Enelvon

Slumbering Goddess
Veteran
Joined
Nov 29, 2012
Messages
240
Reaction score
139
First Language
English
Primarily Uses
What part don't you understand? I thought I explained everything thoroughly, and I included a properly formatted example. If you can explain your problems, I'll try to clarify.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
whoa... you add multi language nice one :D . last night after posting my post i try to fiddle your script again and made my own multi language add on. i'm using hash instead of array. then set the default language in the module. and have msg box warning to the developer if that language files not exist. for the scene.... i use normal show message and show choices :D . then do the script call to change language.

here's my version if you're interested. (but it's messy)

Code:
module SES
module ExternalText
	LANGUAGE={ #do not touch this line
	english: "English",
	indonesian: "Indonesian",
	} #do not touch this line
	#hash for defining what language files you have
	#format=> key: "string",

	DEFAULT_LANGUAGE = :english
	#set the default language. format=> :key
end
end

module DataManager

#modify it to convert txt to rvdata2 based on key send
def self.create_text(key)
	language = SES::ExternalText::LANGUAGE[key]
	text = {}
	key = ""
	File.open("Data/"+language+".txt", "r") do |file|
	 file.readlines.each_with_index do |v, i|
		next if v =~ /(^\s*(#|\/\/).*|^\s*$)/
		SES::ExternalText::Tags.each_pair do |k,p|
		 (eval(p); v = "") if v =~ k
		end
		text[key][1] << v unless v.empty?
	 end
	end
	File.open("Data/"+language+".rvdata2", "w") do |file| Marshal.dump(text, file) end
end

#change it to convert txt to rvdata2 for all language hash member
#there's also msg box warning if default language files missing
def self.load_normal_database
	en_et_dm_lnd
	SES::ExternalText::LANGUAGE.each_key{|key|
	language = SES::ExternalText::LANGUAGE[key.to_sym]
	create_text(key) if FileTest.exist?("Data/"+language+".txt")
	}
	default_language = SES::ExternalText::LANGUAGE[SES::ExternalText::DEFAULT_LANGUAGE]
	if !FileTest.exist?("Data/"+default_language+".rvdata2")
	return msgbox("Missing Default Language Files!!")
	end
	$game_text = load_data("Data/"+default_language+".rvdata2")
end

def self.load_battle_test_database
	en_et_dm_lbd
	SES::ExternalText::LANGUAGE.each_key{|key|
	language = SES::ExternalText::LANGUAGE[key.to_sym]
	create_text(key) if FileTest.exist?("Data/"+language+".txt")
	}
	default_language = SES::ExternalText::LANGUAGE[SES::ExternalText::DEFAULT_LANGUAGE]
	if !FileTest.exist?("Data/"+default_language+".rvdata2")
	return msgbox("Missing Default Language Files!!")
	end
	$game_text = load_data("Data/"+default_language+".rvdata2")
end

#change language function. there's also msg box warning if that
#language files not exist
def self.change_language(key)
	language = SES::ExternalText::LANGUAGE[key.to_sym]
	return if !language
	if !FileTest.exist?("Data/"+language+".rvdata2")
	return msgbox("Language Files Not Exist!!")
	end
	$game_text = load_data("Data/"+language+".rvdata2")
end

end
i guess i will grab your scene and combine both :D . thx for the update. especially the choice fix. this is really great script.
 
Last edited by a moderator:

Enelvon

Slumbering Goddess
Veteran
Joined
Nov 29, 2012
Messages
240
Reaction score
139
First Language
English
Primarily Uses
Interesting way of doing things. With mine, the default language is automatically set to the first one in the array, and I chose to allow it to crash if the file does not exist, as it will tell the developer that fact in the popup. I certainly see a benefit in using events to change the language, but I believe doing it as a scene (especially an RGSS3 one, as they can be modified more easily than RGSS2 ones due to most methods being contained in their windows) gives it a bit more flexibility for those who might want to work it into, say, an options menu. Another slight advantage my script has is that it will remember the last language the player changed it to, allowing you to use custom title text (among other things). Note that every time you save the game in the editor it will reset to the default language - this is because I store the selected language in $data_system, which gets overwritten by the editor's saving. Players will not face the same issue, obviously.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
nice advice enelvon. i learn a lot from your sentence :D . i guess it's better to store it at data system. i didn't think when people change the language and save then resetting the games. since $game_text is not saved. i still need a lot to learn about rgss3 :D .

and i also agree with using scene is better. since you could add it to menu. it's not i prefer using show choice... it's just i'm still not good at creating scene :D .

edit: found incompatibility with neon black ruby console

http://forums.rpgmak...eloper-console/

it''s solved by adding this

def start

super #<<<<

create_background

@text_window = Window_Help.new(1)

set_help_text

@select_window = Window_LanguageSelect.new

end

since neon black modify the scene_base.

and by not calling super the window used by that script is nil. thus throw error.

second bug.

def update

super

set_help_text

SceneManager.return if Enelvon.inputno #<<<<this line

end

Enelvon is not defined.

throw error uninitialized constant Scene_LanguageSelect::Enelvon

edit2:

got it work by adding editable variable to check when to exit scene. and change that when call ok handler in window class



Code:
class Window_LanguageSelect < Window_Command
def call_ok_handler
$data_system.set_language(command_name(@index))
activate
SceneManager.scene.exit = true
end

def make_command_list; @list = SES::ExternalText::Languages; end
end
class Scene_LanguageSelect < Scene_Base
attr_accessor :exit
def start
super
@exit = false
create_background
@text_window = Window_Help.new(1)
set_help_text
@select_window = Window_LanguageSelect.new
end
end
i think i learn something new in the way you create window command. i never know it could used that way :D .

only little lines and do the tricks
 
Last edited by a moderator:

Enelvon

Slumbering Goddess
Veteran
Joined
Nov 29, 2012
Messages
240
Reaction score
139
First Language
English
Primarily Uses
Ah, oops. I have a custom input module, and forgot to update it to not rely on that (hence the Enelvon.inputno). I also *should* have called super in the scene - that was a careless mistake. I'm sorry - I've been exhausted lately, since I've had a huge workload. I have a brief vacation through this weekend, so hopefully I'll be able to catch up on my sleep. Anyway, MultiLang is now v1.1, which fixes a few small mistakes (including those two).

Ah, and I'm glad you learned something from my script! I'm always happy when my scripts teach someone something.
 

Enelvon

Slumbering Goddess
Veteran
Joined
Nov 29, 2012
Messages
240
Reaction score
139
First Language
English
Primarily Uses
MultiLang has been updated to v1.2! 1.2 removes the placeholder method of remembering the last selected language (that did *not* work in encrypted archives) and replaces it with a line in Game.ini, which does. That and it looks nicer.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
just want to report. you forgot the 'super' again :D . so neon black script crashed again.

edit: checked and the language change not saved in save files.

so i change the language to indonesian in game. then save. then hit f12. then load game. the language revert back to english.

and my ini files didn't have language section too.

previous version save the language when saving and loading the files. it stay indonesian.
 
Last edited by a moderator:

Enelvon

Slumbering Goddess
Veteran
Joined
Nov 29, 2012
Messages
240
Reaction score
139
First Language
English
Primarily Uses
...of course I forgot it again. Silly me. *sighs*

Thank you, fixed that.

As far as it not adding language to the .ini... that's... because I forgot handling to add it initially, apparently. A quick fix is to add a Language= line to the .ini file, but I'm going to upload a fix in one second, so there's that too.

Edit: Fix uploaded. Sorry for the inconvenience!
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
great. i will try it later at home. i will report if i found something again :D . thx for this great script.
 

neoscully

Villager
Member
Joined
Dec 13, 2012
Messages
10
Reaction score
6
First Language
german
Primarily Uses
There is an error with German, using German letters: Script '...' line 347: ArgumentError occured. Invalid byte sequence in UTF-8

i.e. letters like "ä" in texts like "Dies wäre also ein Test".
 

neoscully

Villager
Member
Joined
Dec 13, 2012
Messages
10
Reaction score
6
First Language
german
Primarily Uses
Ok..found it out by myself... reading is power... :)

Is it possible to use some comments in the text file, like:

========================

- ACTOR 1

========================

or anything else? So far I only found spaces possible beside the key tags and text.
 
Last edited by a moderator:

neoscully

Villager
Member
Joined
Dec 13, 2012
Messages
10
Reaction score
6
First Language
german
Primarily Uses
I feel like a comlete noob... probably because I am...

Could you please be so kind and post an example for an event that includes choices? I am not sure if I need an additional script, if it is not included yet or still possible.

And sorry for my terrible English, probably one of the reasons why I can't follow everything here.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
for choices you can set the choice using event editor.

then in choice box you can use \t[yourkey]

example:

\t[Choice 1]

or alternatively you can also use multiple choices script (from raizen or tsukihime)

then call some script call BEFORE adding BLANK / ANY choice command from editor:



Code:
a = get_text("Choice 1")
@get_choices = [a,"No!"]
this will result to:

first choice : choice1 key content

second choice : No!

hope this help :D .
 

DeleteMe

Veteran
Veteran
Joined
Dec 30, 2012
Messages
55
Reaction score
0
First Language
English
Primarily Uses
Hello, I think this is a really awesome script. Aside from crediting, what are the other terms of use? Thanks.
 

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
248
Primarily Uses
Hello, I think this is a really awesome script. Aside from crediting, what are the other terms of use? Thanks.
The terms of use (the license, really) is clearly explained under the Author's Notes, just like every other SES script. Essentially, you're free to do whatever you want with any SES script as long as credit and the license terms are maintained (which means anyone else can also modify your modifications under the same terms). Both commercial and non-commercial use is allowed as well.
 

Asejia

Veteran
Veteran
Joined
Dec 13, 2012
Messages
61
Reaction score
0
First Language
German
Is there any script which let me also translate the database? Unfortunately I can't find one. :|
 

DeleteMe

Veteran
Veteran
Joined
Dec 30, 2012
Messages
55
Reaction score
0
First Language
English
Primarily Uses
The terms of use (the license, really) is clearly explained under the Author's Notes, just like every other SES script. Essentially, you're free to do whatever you want with any SES script as long as credit and the license terms are maintained (which means anyone else can also modify your modifications under the same terms). Both commercial and non-commercial use is allowed as well.
WOW. My bad. I can't believe I missed it. I opened the script and tried to ctrl F "terms" lol. Thanks for pointing it out solistra!

------------------------------------------------------------------------------------------------------------

Edit:

I made a simple event as shown below with choices. After the text is displayed the choices are displayed. How can i Make it so that the text stays there while the choices are there?

[IMG]http://i.imgur.com/UMrTd.png[/IMG]

[IMG]http://i.imgur.com/nfkTL.png[/IMG]
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,483
Reaction score
721
First Language
indonesian
@Dhobby: you could use normal show message instead of calling text(key).

then in that normal show message use

\t[intro 1]

but it will only grab the text (not grabbing the face etc). so you need to set the face with your message system's escape code inside the show message too.

(i try adding the escape code in key text but using \t[key] will not recognize escape codes since it already escape code. unless someone add the function to look for escape codes inside escape codes :D )

example if using yanfly ace message system:

\af[1]\t[intro 1]

and you also have to remember... using \t[key]. new line in the text is really new line in the message.

ex:

i am

english

will shown in two line instead of one line using text(key) command.

hope this help.
 

DeleteMe

Veteran
Veteran
Joined
Dec 30, 2012
Messages
55
Reaction score
0
First Language
English
Primarily Uses
Thanks estriole. It works but the no word wrapping thing is ;_; .

Edit:

Is this the only way of doing choices? I just realized that if I ever changed the font I would have to reformat all my choice text boxes and that would be more inconvenient as the game gets larger and larger.
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Zaj
Hey morning all! I got another quick question..I just switched to RMMZ from VX Ace..so I am wondering why default scripts(is that how u call it) of VXAce is available, but not in MZ's case? How do I figure out ahh I mean could you show me
Sometimes im the biggest fool alive... Ah well, ce la vie
The worst feeling in the world is going for a walk on a nice summer day, seeing an ice cream truck, and realizing you don't have any money with you :(
Mike running through an area that's influenced by his thoughts, thus his drawings are infused into the land.
We're playing Omori by OMOCAT starting at 2pm est :D

Forum statistics

Threads
111,343
Messages
1,060,326
Members
144,669
Latest member
kINGFreak13
Top