Jan 1, 2100

Introduction



Welcome to the CC's script archive.
I would be happy if these are useful for you.

Steam: http://steamcommunity.com/id/yellow09/

Jan 1, 2099

Aug 23, 2014

CC_Text_RTL_v2



<< Download Demo >>

--------------------------------------------------------------
 History
--------------------------------------------------------------
 v2.0 : RTL on several windows.
 v1.0 : RTL on message window only.

--------------------------------------------------------------
 Video and Screenshot
--------------------------------------------------------------

https://www.youtube.com/watch?v=0G0I6QScD-8







(Version 2.0)





--------------------------------------------------------------
 Features
--------------------------------------------------------------
This script allows you to show text from Right To Left(RTL).

Windows under effect:
- 'Show Text' in Event Command.
- Item/Skill Description
- BattleLog
- Choice List
- The window on the top of the Save Menu.
- Character description in Status Menu.
- 'Show Scrolling Text' in Event Command.

--------------------------------------------------------------
 How to use
--------------------------------------------------------------
[1] Settings
  By default, effects are controled by switches.
   Switches[1] => RTL, Show text from Right To Left.
   Switches[2] => RL, Reverse letters in line.
   Switches[3] => RS, Reverse the order of words in line.
 
  IDs of those switches are determined in CC::TEXT_RTL controls ON/OFF.
  See CC::TEXT_RTL if you want to change.
  
[2] Control Characters in RTL + Reverse-Letter mode
  Default Control Characters(\C{n], \I[n], \{, \}) will be reserved.
  But you need some attention since numbers also be reserved.
 
  ex. "\C[1]Lorem\C[0] Ipsum\n" => "muspi \eC[0]meroL\eC[2]\n" = white text.

[3] Examples
    (Mode)        : (Text)
    Default                : "Lorem Ipsum" (Left To Right, LTR)
    RTL           : "muspi meroL" (RTL)
    RTL + RL      : "Lorem ipsum" (RTL)
    RTL + RS      : "muspi meroL" (RTL)
    RTL + RL + RS : "ipsum Lorem" (RTL)
    RL            : "muspi meroL" (LTR)
    RS            : "ipsum Lorem" (LTR)
    RL + RS       : "meroL muspi" (LTR)
  
    trial and error.

[4] In-Battle Text
    if CC::TEXT_RTL.enable_in_battle? is true, effects on battle-log will be shown.

[5] Conflict Warning
  This script rely on overwriting methods heavily.
  It may cause conflict against other message scripts.
--------------------------------------------------------------
 Reference
--------------------------------------------------------------
 Bulletxt, "Arabic Reading Right to left", http://sourceforge.net/p/lodestone2d/code/HEAD/tree/.

--------------------------------------------------------------
 Thanks
--------------------------------------------------------------
 q8fft3 for advices (at RPGMakerWeb).

--------------------------------------------------------------
 Compatbility
--------------------------------------------------------------
    This script has partial compability with:
        Yanfly, "Yanfly Engine Ace - Ace Message System v1.05"
         (http://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/)
        modern algebra, "ATS: Message Options [VXA]", v1.0.7
         (http://rmrk.net/index.php/topic,46770.0.html)
        CC, "CC_FGMSG"
         (http://yellow-mantaray.blogspot.jp/2014/08/CCFGv4.html)
    Place this script under them.
 
--------------------------------------------------------------
 Order of Control Characters
--------------------------------------------------------------
 In RL mode, every control characters will be reversed before processed backward.
 And it may cause error.
 ( Ex. "\C[1]Colored Text\C[0]." => reversed as "\e.C[0]txeT deroloC\eC[1]\n" => appear as "Colored Text]0[C" )
// Please try changing order of Control Characters if it happen.

--------------------------------------------------------------
 Q&A
--------------------------------------------------------------
Q. How to make effects auto enabled?

A. Find "return $game_switches[ * ]" and change them to "return true". It's around line 120.
   By default, $game_switches[ 1 ] controls RTL, $game_switches[ 2 ] => RL, $game_switches[ 3 ] => RS.
   They are written in "module TEXT_RTL".


 ('w')

Aug 21, 2014

personal note 8 - Debug

(1) What happened:
I wanted to see callstack.

(2) Solution
 module DebugView
    def parse_caller(at)
      if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
        return [$2, $3] #file = $1; line = $2.to_i; method = $3
      end
    end
  
    def track
    return if !$TEST
        stack = []
      caller.each { |arr| stack.push( parse_caller(arr) ) }
      stack.pop; stack.pop
      self.trace(stack)
    end
end

call DebugView.track

(3) Remained Problems
caller returns [filename, line, method].
but in rgss3, filename has no meaning since all scripts are loaded in single file.

Q. why DebugView?
A. ('w') < because it was there.

Aug 19, 2014

personal note 7

(1) What happened:
Bias in the random movement.
If you use "Options: Direction Fix" and "Movement Type: Random" simultaneously,
The event biased to move to the fixed direction.

(2) Cause
In the line 114 of Game_Event,

  def move_type_random
    case rand(6)
    when 0..1;  move_random
    when 2..4;  move_forward
    when 5;     @stop_count = 0
    end
  end

Since direction is fixed, that "move_forward" goes to always same direction.



If I remember correctly,

in RPG Maker 2000, inner direction values can be changed even if direction if fixed.
And some crazy people used the direction of events as a substitute of variables.
VX Ace not allow it.


(3) Solution
when 2..4;  @direction_fix ? move_random : move_forward



('w') < ...harmless.