Jump to content
Fomar0153

Albhed Translator (Alternate Language)

Recommended Posts

Albhed Translator

Version 1.1

by Fomar0153

Introduction

Allows you to insert a new language into your game in the style of FFX's Albhed.

 

Features

+ Switch controlled, you turn the language on and off with it.

+ Can collect items which translate the language.

+ Translated text appears in a different colour

+ Can leave some text untranslated by using { }

 

Screenshot

SS0018.png

I wonder what he said?

 

How to Use

Instructions are in the script.

 

Script

The most update version of this script can always be found on my blog.

 

F.A.Q.

No questions asked.

 

Credits and Thanks

Fomar0153

Edited by Fomar0153

Share this post


Link to post
Share on other sites

Whoa, thats supercool man!

 

EDIT: I tested here, and its really SUPERCOOL! Just a question: There is a way to turn the translated letters into a different color?

Example:

 

I got the item that translates A into B.

Then, in the message that before was "CAC" became "CBC"?

Edited by Wendell

Share this post


Link to post
Share on other sites

Oh my, here's something really nice...at least in theory, so let me test it by myself now xD.

 

And seeing the code I am already planning to add other languages by myself for my own use xD

 

Thanks man :3

Share this post


Link to post
Share on other sites

Whoa, thats supercool man!

 

EDIT: I tested here, and its really SUPERCOOL! Just a question: There is a way to turn the translated letters into a different color?

Example:

 

I got the item that translates A into B.

Then, in the message that before was "CAC" became "CBC"?

I'll look into it. Sorry I didn't see your edit before.

Is it possible to add more language?

Er, not by default but it's not hard to slightly edit it for more. I'll do an example later.

Share this post


Link to post
Share on other sites

Updated to 1.1:

I added the alternate color and the ability to not translate anything between {}

 

Also an example of how you could go about having two of these languages (honestly I quite like knowing what NPCs have to say):

 

=begin
Albhed Translator
by Fomar0153
Version 1.1
----------------------
Notes
----------------------
Adds an Albhed style language to your game.
----------------------
Instructions
----------------------
Follow the instructions in the Albhed module
turn your chosen switch on to have people speak
Albhed.
----------------------
Change Log
----------------------
1.0 -> 1.1 Added the ability to not translate sections
          of a message. Use { and } to keep part of the message untranslated.
          Added the ability to have the translated text appear in another 
          colour.
----------------------
Known bugs
----------------------
None
=end
module Albhed

 # Id of the switch to translate the text to Albhed
 ALBHED_SWITCH = 5
 ALBHED_COLOR = 16 # system color

 ALBHED_CHARS = {}
 # ALBHED_CHARS['letter'] = ['replacementletter', itemid to translate]
 ALBHED_CHARS['a'] = ['b', 1]
 ALBHED_CHARS['b'] = ['c', 1]
 ALBHED_CHARS['c'] = ['d', 1]
 ALBHED_CHARS['d'] = ['e', 1]
 ALBHED_CHARS['e'] = ['f', 1]
 ALBHED_CHARS['f'] = ['g', 1]
 ALBHED_CHARS['g'] = ['h', 1]
 ALBHED_CHARS['h'] = ['i', 1]
 ALBHED_CHARS['i'] = ['j', 1]
 ALBHED_CHARS['j'] = ['k', 1]
 ALBHED_CHARS['k'] = ['l', 1]
 ALBHED_CHARS['l'] = ['m', 1]
 ALBHED_CHARS['m'] = ['n', 1]
 ALBHED_CHARS['n'] = ['o', 1]
 ALBHED_CHARS['o'] = ['p', 1]
 ALBHED_CHARS['p'] = ['q', 1]
 ALBHED_CHARS['q'] = ['r', 1]
 ALBHED_CHARS['r'] = ['s', 1]
 ALBHED_CHARS['s'] = ['t', 1]
 ALBHED_CHARS['t'] = ['u', 1]
 ALBHED_CHARS['u'] = ['v', 1]
 ALBHED_CHARS['v'] = ['w', 1]
 ALBHED_CHARS['w'] = ['x', 1]
 ALBHED_CHARS['x'] = ['y', 1]
 ALBHED_CHARS['y'] = ['z', 1]
 ALBHED_CHARS['z'] = ['a', 1]

 # Id of the switch to translate the text to OTHER
 OTHER_SWITCH = 5
 OTHER_COLOR = 16 # system color

 OTHER_CHARS = {}
 # OTHER_CHARS['letter'] = ['replacementletter', itemid to translate]
 OTHER_CHARS['a'] = ['b', 1]
 OTHER_CHARS['b'] = ['c', 1]
 OTHER_CHARS['c'] = ['d', 1]
 OTHER_CHARS['d'] = ['e', 1]
 OTHER_CHARS['e'] = ['f', 1]
 OTHER_CHARS['f'] = ['g', 1]
 OTHER_CHARS['g'] = ['h', 1]
 OTHER_CHARS['h'] = ['i', 1]
 OTHER_CHARS['i'] = ['j', 1]
 OTHER_CHARS['j'] = ['k', 1]
 OTHER_CHARS['k'] = ['l', 1]
 OTHER_CHARS['l'] = ['m', 1]
 OTHER_CHARS['m'] = ['n', 1]
 OTHER_CHARS['n'] = ['o', 1]
 OTHER_CHARS['o'] = ['p', 1]
 OTHER_CHARS['p'] = ['q', 1]
 OTHER_CHARS['q'] = ['r', 1]
 OTHER_CHARS['r'] = ['s', 1]
 OTHER_CHARS['s'] = ['t', 1]
 OTHER_CHARS['t'] = ['u', 1]
 OTHER_CHARS['u'] = ['v', 1]
 OTHER_CHARS['v'] = ['w', 1]
 OTHER_CHARS['w'] = ['x', 1]
 OTHER_CHARS['x'] = ['y', 1]
 OTHER_CHARS['y'] = ['z', 1]
 OTHER_CHARS['z'] = ['a', 1]

 def self.translate(c)
   return c if ALBHED_CHARS[c.downcase].nil?
   return c if $game_party.has_item?($data_items[ALBHED_CHARS[c.downcase][1]])
   return ALBHED_CHARS[c.downcase][0].downcase if c.downcase!.nil?
   return ALBHED_CHARS[c.downcase][0].upcase
 end


 def self.othertranslate(c)
   return c if OTHER_CHARS[c.downcase].nil?
   return c if $game_party.has_item?($data_items[OTHER_CHARS[c.downcase][1]])
   return OTHER_CHARS[c.downcase][0].downcase if c.downcase!.nil?
   return OTHER_CHARS[c.downcase][0].upcase
 end

end

class Window_Base < Window
 #--------------------------------------------------------------------------
 # ◠通常文字ã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias albhed_process_normal_character process_normal_character
 def process_normal_character(c, pos)
   if @trans.nil?
     @trans = true
   end
   return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH] or
     $game_switches[Albhed::OTHER_SWITCH]
   if c == "{"
     @trans = false
     return
   end
   if c == "}"
     @trans = true
     return
   end
   c = Albhed.translate(c) if @trans and $game_switches[Albhed::ALBHED_SWITCH]
   c = Albhed.othertranslate(c) if @trans and $game_switches[Albhed::OTHER_SWITCH]
   change_color(text_color(Albhed::ALBHED_COLOR)) if @trans and $game_switches[Albhed::ALBHED_SWITCH]
   change_color(text_color(Albhed::OTHER_COLOR)) if @trans and $game_switches[Albhed::OTHER_SWITCH]
   text_width = text_size(c).width
   draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
   change_color(normal_color)
   pos[:x] += text_width
 end
end

 

Share this post


Link to post
Share on other sites

This is really great! THanks once again fomor =)

 

 

 

PS:

 

I was trying to add one more language on there so i attempted... ya thats the word... LoL i attempted to add another on the script and heres what i got but didnt work? please make the correction =)

 

=begin
Albhed Translator
by Fomar0153
Version 1.1
----------------------
Notes
----------------------
Adds an Albhed style language to your game.
----------------------
Instructions
----------------------
Follow the instructions in the Albhed module
turn your chosen switch on to have people speak
Albhed.
----------------------
Change Log
----------------------
1.0 -> 1.1 Added the ability to not translate sections
	   of a message. Use { and } to keep part of the message untranslated.
	   Added the ability to have the translated text appear in another
	   colour.
----------------------
Known bugs
----------------------
None
=end
module Albhed
 # Id of the switch to translate the text to Albhed
 ALBHED_SWITCH = 5
 ALBHED_COLOR = 16 # system color
 ALBHED_CHARS = {}
 # ALBHED_CHARS['letter'] = ['replacementletter', itemid to translate]
 ALBHED_CHARS['a'] = ['b', 1]
 ALBHED_CHARS['b'] = ['c', 1]
 ALBHED_CHARS['c'] = ['d', 1]
 ALBHED_CHARS['d'] = ['e', 1]
 ALBHED_CHARS['e'] = ['f', 1]
 ALBHED_CHARS['f'] = ['g', 1]
 ALBHED_CHARS['g'] = ['h', 1]
 ALBHED_CHARS['h'] = ['i', 1]
 ALBHED_CHARS['i'] = ['j', 1]
 ALBHED_CHARS['j'] = ['k', 1]
 ALBHED_CHARS['k'] = ['l', 1]
 ALBHED_CHARS['l'] = ['m', 1]
 ALBHED_CHARS['m'] = ['n', 1]
 ALBHED_CHARS['n'] = ['o', 1]
 ALBHED_CHARS['o'] = ['p', 1]
 ALBHED_CHARS['p'] = ['q', 1]
 ALBHED_CHARS['q'] = ['r', 1]
 ALBHED_CHARS['r'] = ['s', 1]
 ALBHED_CHARS['s'] = ['t', 1]
 ALBHED_CHARS['t'] = ['u', 1]
 ALBHED_CHARS['u'] = ['v', 1]
 ALBHED_CHARS['v'] = ['w', 1]
 ALBHED_CHARS['w'] = ['x', 1]
 ALBHED_CHARS['x'] = ['y', 1]
 ALBHED_CHARS['y'] = ['z', 1]
 ALBHED_CHARS['z'] = ['a', 1]
 # Id of the switch to translate the text to OTHER
 OTHER_SWITCH = 6
 OTHER_COLOR = 11 # system color
 OTHER_CHARS = {}
 # OTHER_CHARS['letter'] = ['replacementletter', itemid to translate]
 OTHER_CHARS['a'] = ['ba', 1]
 OTHER_CHARS['b'] = ['ca', 1]
 OTHER_CHARS['c'] = ['da', 1]
 OTHER_CHARS['d'] = ['ea', 1]
 OTHER_CHARS['e'] = ['fa', 1]
 OTHER_CHARS['f'] = ['ga', 1]
 OTHER_CHARS['g'] = ['ha', 1]
 OTHER_CHARS['h'] = ['i', 1]
 OTHER_CHARS['i'] = ['j', 1]
 OTHER_CHARS['j'] = ['k', 1]
 OTHER_CHARS['k'] = ['l', 1]
 OTHER_CHARS['l'] = ['m', 1]
 OTHER_CHARS['m'] = ['n', 1]
 OTHER_CHARS['n'] = ['o', 1]
 OTHER_CHARS['o'] = ['p', 1]
 OTHER_CHARS['p'] = ['q', 1]
 OTHER_CHARS['q'] = ['r', 1]
 OTHER_CHARS['r'] = ['s', 1]
 OTHER_CHARS['s'] = ['t', 1]
 OTHER_CHARS['t'] = ['u', 1]
 OTHER_CHARS['u'] = ['v', 1]
 OTHER_CHARS['v'] = ['w', 1]
 OTHER_CHARS['w'] = ['x', 1]
 OTHER_CHARS['x'] = ['y', 1]
 OTHER_CHARS['y'] = ['z', 1]
 OTHER_CHARS['z'] = ['a', 1]
# Id of the switch to translate the text to OTHER
 ANOTHER_SWITCH = 7
 ANOTHER_COLOR = 14 # system color
 ANOTHER_CHARS = {}
 # OTHER_CHARS['letter'] = ['replacementletter', itemid to translate]
 ANOTHER_CHARS['a'] = ['baA', 1]
 ANOTHER_CHARS['b'] = ['caA', 1]
 ANOTHER_CHARS['c'] = ['daA', 1]
 ANOTHER_CHARS['d'] = ['eaA', 1]
 ANOTHER_CHARS['e'] = ['faA', 1]
 ANOTHER_CHARS['f'] = ['ga', 1]
 ANOTHER_CHARS['g'] = ['ha', 1]
 ANOTHER_CHARS['h'] = ['i', 1]
 ANOTHER_CHARS['i'] = ['j', 1]
 ANOTHER_CHARS['j'] = ['k', 1]
 ANOTHER_CHARS['k'] = ['l', 1]
 ANOTHER_CHARS['l'] = ['m', 1]
 ANOTHER_CHARS['m'] = ['n', 1]
 ANOTHER_CHARS['n'] = ['o', 1]
 ANOTHER_CHARS['o'] = ['p', 1]
 ANOTHER_CHARS['p'] = ['q', 1]
 ANOTHER_CHARS['q'] = ['r', 1]
 ANOTHER_CHARS['r'] = ['s', 1]
 ANOTHER_CHARS['s'] = ['t', 1]
 ANOTHER_CHARS['t'] = ['u', 1]
 ANOTHER_CHARS['u'] = ['v', 1]
 ANOTHER_CHARS['v'] = ['w', 1]
 ANOTHER_CHARS['w'] = ['x', 1]
 ANOTHER_CHARS['x'] = ['y', 1]
 ANOTHER_CHARS['y'] = ['z', 1]
 ANOTHER_CHARS['z'] = ['a', 1]


 def self.translate(c)
return c if ALBHED_CHARS[c.downcase].nil?
return c if $game_party.has_item?($data_items[ALBHED_CHARS[c.downcase][1]])
return ALBHED_CHARS[c.downcase][0].downcase if c.downcase!.nil?
return ALBHED_CHARS[c.downcase][0].upcase
 end

 def self.othertranslate(c)
return c if OTHER_CHARS[c.downcase].nil?
return c if $game_party.has_item?($data_items[OTHER_CHARS[c.downcase][1]])
return OTHER_CHARS[c.downcase][0].downcase if c.downcase!.nil?
return OTHER_CHARS[c.downcase][0].upcase
 end

 def self.anothertranslate(c)
return c if ANOTHER_CHARS[c.downcase].nil?
return c if $game_party.has_item?($data_items[ANOTHER_CHARS[c.downcase][1]])
return ANOTHER_CHARS[c.downcase][0].downcase if c.downcase!.nil?
return ANOTHER_CHARS[c.downcase][0].upcase
 end
end
class Window_Base < Window
 #--------------------------------------------------------------------------
 # ◠通常文字ã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias albhed_process_normal_character process_normal_character
 def process_normal_character(c, pos)
if @trans.nil?
  @trans = true
end
return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH] or
  $game_switches[Albhed::OTHER_SWITCH]
if c == "{"
  @trans = false
  return
end
if c == "}"
  @trans = true
  return
end
return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH] or
  $game_switches[Albhed::ANOTHER_SWITCH]
if c == "{"
  @trans = false
  return
end
if c == "}"
  @trans = true
  return
end
c = Albhed.translate(c) if @trans and $game_switches[Albhed::ALBHED_SWITCH]
c = Albhed.othertranslate(c) if @trans and $game_switches[Albhed::OTHER_SWITCH]
c = Albhed.anothertranslate(c) if @trans and $game_switches[Albhed::ANOTHER_SWITCH]
change_color(text_color(Albhed::ALBHED_COLOR)) if @trans and $game_switches[Albhed::ALBHED_SWITCH]
change_color(text_color(Albhed::OTHER_COLOR)) if @trans and $game_switches[Albhed::OTHER_SWITCH]
change_color(text_color(Albhed::ANOTHER_COLOR)) if @trans and $game_switches[Albhed::ANOTHER_SWITCH]
text_width = text_size(c).width
draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
change_color(normal_color)
pos[:x] += text_width
 end
end

Share this post


Link to post
Share on other sites

Though I'm no scripter, I recommend trying this:

def process_normal_character(c, pos)
	if @trans.nil?
	  @trans = true
	end
	return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH] or
	  $game_switches[Albhed::OTHER_SWITCH] or $game_switches[Albhed::ANOTHER_SWITCH]
	if c == "{"
	  @trans = false
	  return
	end
	if c == "}"
	  @trans = true
	  return
	end
    ...etc

Edited by Greensburg

Share this post


Link to post
Share on other sites

Ok, maybe this was already covered elsewhere.

 

Can you change the font between translations, so if I had Celtic Runes as a font and its all gibberish, it becomes Normal on translation. This would be pretty cool, if so.

 

Edit: By the way, very awesome script. I re-read my post and realized I didnt once say thanks for making it. So, thanks and glad to see something new out there.

Edited by SirCumferance

Share this post


Link to post
Share on other sites

Ok, maybe this was already covered elsewhere.

 

Can you change the font between translations, so if I had Celtic Runes as a font and its all gibberish, it becomes Normal on translation. This would be pretty cool, if so.

I second this, I love Celtic Runes and wanted to use them.

 

Can you please, please :P hehe

Edited by Rosenblack

Share this post


Link to post
Share on other sites

Replace the Window_Base section of the default script with:

class Window_Base < Window
 #--------------------------------------------------------------------------
 # ◠通常文字ã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias albhed_process_normal_character process_normal_character
 def process_normal_character(c, pos)
   if @trans.nil?
     @trans = true
   end
   return albhed_process_normal_character(c, pos) unless $game_switches[Albhed::ALBHED_SWITCH]
   if c == "{"
     @trans = false
     return
   end
   if c == "}"
     @trans = true
     return
   end
   c = Albhed.translate(c) if @trans
   change_color(text_color(Albhed::ALBHED_COLOR)) if @trans
   font_name = Font.default_name
   Font.default_name = "Comic Sans MS" if @trans # edit the font name here
   text_width = text_size(c).width
   draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
   change_color(normal_color)
   Font.default_name = font_name
   pos[:x] += text_width
 end
end

Share this post


Link to post
Share on other sites

Fun script! Thanks fomar =)

 

One question: Is there a way to do something like

 

 ALBHED_CHARS['shi'] = ['ã—', 1]
 ALBHED_CHARS['SHI'] = ['ã‚·', 1]

 

You know, so that it checks for a string instead of a letter?

 

I'd love to implement some Japanese translation there, as you can see. The Japanese characters already work in my variant of your script and I've already added a upcase/downcase check, so all I'd need would be a string check.

Share this post


Link to post
Share on other sites

The script still changes the color of the ENTIRE message when a special color is used, rather than only changing the color of translated letters. Bummer.

 

Also, with Yanfly's Message System, name windows are impossible to translate, even when the name code is wrapped in { and }.

Share this post


Link to post
Share on other sites

Would it be possible to set another colour of translated text when using items to translate? For example, without the item the letter is red, with the item that translates it, it becomes green or whatever.

Share this post


Link to post
Share on other sites

Would it be possible to set another colour of translated text when using items to translate? For example, without the item the letter is red, with the item that translates it, it becomes green or whatever.

 

I personally think that untranslated should be color = 16 and translated should be color = 27.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×