Reverse Text script request

Started by AlphusBetus, July 31, 2015, 09:46:07 am

Previous topic - Next topic

AlphusBetus

July 31, 2015, 09:46:07 am Last Edit: August 08, 2015, 03:48:13 am by AlphusBetus
---

KK20

To make matters even worse, the RMXP Editor won't even allow you to input Arabic characters. They just immediately turn into question marks. There are ways to work around it such as using a script that replaces a variable with a string containing Arabic characters (Localization might help).

Seeing as RMXP is drawing the characters from right to left, the logical solution is to purposefully make the characters be drawn left to right. Now I don't see why a script is really necessary if that third-party program does this mirroring for you.



As you can see, the first string of Arabic text was taken from the youtube video you posted. I then mirror'd the text and used a Show Message to give me the above result.

To even get my message to display Arabic, I created this module, used a Script Call in my event

$game_variables[100] = Arabic.text

And then used Show Message:

\V[100]

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

Copied the second to last and it did this in the editor. But it appeared to have not flipped in the end.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

Quote from: KK20 on August 01, 2015, 12:04:15 am
To make matters even worse, the RMXP Editor won't even allow you to input Arabic characters. They just immediately turn into question marks.

Spoiler: ShowHide


Quote from: KK20 on August 01, 2015, 12:04:15 am
There are ways to work around it such as using a script that replaces a variable with a string containing Arabic characters (Localization might help).


By the way, I'm fairly confident none of those scripts you posted did anything. The third-party program is all you need.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

After playing around with RMVXA, turns out that the font VL Gothic (which is the default font for all new projects) doesn't support Arabic characters. Changing the Font.default_name to Tahoma (or any other font that supports Arabic characters) fixes that.

Thus all you really need to do is go to Main and put this line just above the "rgss_main"

Font.default_name = ["Tahoma", "PLUS ANY OTHER FONTS THAT SUPPORT ARABIC", "SEPARATED BY COMMAS OF COURSE"]


Clearly, RMVXA's Editor has Unicode support (finally) while RMXP's does not. If you are asking for a script that makes the Show Message command NOT convert the characters to question marks, we need to have a long talk about what exactly you can do with scripts.

EDIT:
This is about as helpful as a script will get

module Arabic
  @all_arabic_strings ={
  #---------------------------------------------------------------------------
  # Begin Configuration
  #---------------------------------------------------------------------------
    "1" => "ﺏﺮﻌﻤﻟﺍ",
    "2" => "ﺏﺮﻌﻤﻟﺍ",
    "System" => "ﺏﺮﻌﻤﻟﺍ"
  #---------------------------------------------------------------------------
  # End Configuration
  #---------------------------------------------------------------------------
  }
  def self.text(key)
    @all_arabic_strings[key]
  end
end

class Window_Message < Window_Selectable
 
  alias refresh_for_arabic refresh
  def refresh
    if $game_temp.message_text != nil
      $game_temp.message_text.gsub!(/\\[Aa]\[(.+)\]/) { Arabic.text($1) }
    end
    refresh_for_arabic
  end
 
end

In between the rectangles for configuration, assign a keyword on the left to correspond to the actual Arabic sentence/word on the right. Just follow the example I provided. Then, in a Show Text command, you can do

\A[1]
\a[2]
\a[System]

And this will print out your Arabic characters. Note this only applies to the Message Window and nothing else in the game.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

1. Does your project contain the class Window_Selectable?
2. Did you put my script somewhere below Scene_Debug and above Main?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

Yeah, Pokemon Essentials is a whole different system. If I remember right, they don't have Window_Selectable.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Yeah, I'm not too familiar with the project in general. Can't help you with that :\

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!