public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

XPXP SGD | Zalgo-Inspired Text

BMM Archive · July 16, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: XP SGD | Zalgo-Inspired Text
  • Original author: SGD
  • Original date: September 1, 2025
  • Source thread: https://forums.rpgmakerweb.com/threads/sgd-zalgo-inspired-text.179884/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS Scripts (RMXP)

Summary

Zalgo-Inspired Text Version 2.0 (2.1 ish) SGD​ Note before we start: Below this post is a reply with a fix for choices. Choices did not display correctly and lost their functionality. You can simply replace the part of the code. The Demos (V1 and V2) have not been updated. The original codes in here have. So if you are using the Demo as refference you have to manually tweak it. Please use the Fix for Version 2.0 of the Script down below. I just finished a new script that lets...

Archived First Post

Zalgo-Inspired Text Version 2.0 (2.1 ish)
SGD

Note before we start: Below this post is a reply with a fix for choices. Choices did not display correctly and lost their functionality. You can simply replace the part of the code. The Demos (V1 and V2) have not been updated. The original codes in here have. So if you are using the Demo as refference you have to manually tweak it. Please use the Fix for Version 2.0 of the Script down below.

I just finished a new script that lets you create Zalgo-inspired stacked text in RPG Maker XP. It’s designed to work per-line and integrates seamlessly with RMXP’s message system

zalgo.jpg


Features:

  • UP, MID, and DOWN diacritics applied to every character.
  • Per-line control via \z[n] (intensity n ranges 0–15). (Recommended not to go higher than 6 on a lot of text.)
  • Fully compatible with RMXP’s message system—normal messages, choices, and pauses all work.
  • No global toggling required; just use \z[n] wherever you want Zalgo text.

Usage:

Insert \z[n] at the start of any line in your message to activate Zalgo text for that line:
Ruby:
\z[6]This line will appear in Zalgo style at intensity 6
Normal lines remain unaffected

You can mix normal and Zalgo lines in the same message:
Ruby:
Normal line
\z[4]Zalgo line
Back to normal

Demo here (Version 1.0)

Ruby:
#==============================================================================
# ** Z A L G O  S T A C K E D  T E X T  F O R  R M X P
#------------------------------------------------------------------------------
#  Zalgo-Inspired Text by SGD
#------------------------------------------------------------------------------
#  Use \z[n] in message text to activate Zalgo with intensity 'n' per line:
#      \z[6] This line will appear in Zalgo style
#      Normal lines remain unaffected.
#
#  Hint: would not got too high, affects Frames and can cause stuttering.
#------------------------------------------------------------------------------
#  Features:
#    - UP, MID, and DOWN marks applied per character
#    - Per-line control with \z[n], no global toggle needed
#    - Fully compatible with RMXP messages (no freezing)
#------------------------------------------------------------------------------
#  Credits & Alterations:
#    By SGD
#    Based on SGD's previous Zalgo scripts
#------------------------------------------------------------------------------
#  Date: 2025-09-01
#  For: RPG Maker XP (RGSS, Ruby 1.8.1)
#==============================================================================


module Zalgo
  @intensity = 4

  UP   = %w( ̍ ̎ ̄ ̅ ̿ ̑ ̆ ̐ ͒ ͗ ͑ )
  DOWN = %w( ̞ ̟ ̠ ̤ ̥ ̦ ̩ ̪ ̫ ̬ ̭ )
  MID  = %w( ̕ ̛ ̡ ̢ ̧ ̨ ̴ ̵ ̶ ͘ ͝ )

  def self.intensity; @intensity; end
  def self.intensity=(n); @intensity = [[n.to_i,0].max,15].min; end

  def self.sample_up;   UP[rand(UP.size)]; end
  def self.sample_down; DOWN[rand(DOWN.size)]; end
  def self.sample_mid;  MID[rand(MID.size)]; end
end

#------------------------------------------------------------------------------
# Extend Bitmap to draw Zalgo letters with stacked marks
#------------------------------------------------------------------------------
class Bitmap
  def draw_zalgo_char(x, y, ch, intensity, char_width, char_height)
    draw_text(x, y, char_width, char_height, ch)
    return if ch == ' '

    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y - rand(char_height/2)
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_up)
    end

    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y + rand(char_height/2)
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_down)
    end

    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y + rand(char_height/2) - char_height/4
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_mid)
    end
  end

  def draw_zalgo_text_stacked(x, y, text, height)
    cx = x
    text.scan(/./m) do |ch|
      char_width = self.text_size(ch).width
      char_height = height

      if ch == ' '
        cx += char_width
        next
      end

      draw_zalgo_char(cx, y, ch, Zalgo.intensity, char_width, char_height)
      cx += char_width
    end
  end
end

#------------------------------------------------------------------------------
# Patch Window_Message for RMXP to support \z[n] inline
#------------------------------------------------------------------------------
class Window_Message < Window_Selectable
  alias zalgo_old_refresh refresh
  def refresh
    text = $game_temp.message_text
    return zalgo_old_refresh unless text

    self.contents.clear
    self.contents.font.color = normal_color
    x = 4
    y = 0

    text.split("\n").each do |line|
      intensity = nil

      # Detect \z[n] at the start of the line
      if line =~ /^\\z\[(\d+)\]/i
        intensity = $1.to_i
        line = line.gsub(/^\\z\[\d+\]/i, "")
      end

      if intensity
        Zalgo.intensity = intensity
        self.contents.draw_zalgo_text_stacked(x, y * 32, line, 32)
      else
        self.contents.draw_text(x, y * 32, 480, 32, line)
      end

      y += 1
    end
  end
end

UPDATE: VERSION 2.0

Ruby:
#==============================================================================
# ** Z A L G O  S T A C K E D  T E X T  F O R  R M X P
#------------------------------------------------------------------------------
#  Zalgo-Inspired Text by SGD
#------------------------------------------------------------------------------
#  Use \z[n] in message text to activate Zalgo with intensity 'n' per line:
#      \z[6] This line will appear in Zalgo style
#      Normal lines remain unaffected.
#
#  Hint: Do not set intensity too high — it affects FPS and can cause stuttering.
#------------------------------------------------------------------------------
#  Features:
#    - UP, MID, and DOWN marks applied per character
#    - Independent colors and offsets for UP / MID / DOWN marks
#    - Optional per-symbol random color variation
#    - Optional slight random variation for main Zalgo text
#    - Per-line control with \z[n], no global toggle needed
#    - Fully compatible with RMXP messages (no freezing)
#------------------------------------------------------------------------------
#  Credits & Alterations:
#    By SGD
#    Based on SGD's previous Zalgo scripts
#------------------------------------------------------------------------------
#  Version 2.0
#  Date: 2025-09-02
#  For: RPG Maker XP (RGSS, Ruby 1.8.1)
#==============================================================================

module Zalgo
  @intensity = 4

  # -------------------------------
  # Configurable settings
  # -------------------------------
  COLOR_MAIN = Color.new(255, 100, 255) # main Zalgo character color
  RANDOM_COLOR_MAIN = true              # slight random variation for main Zalgo character

  COLOR_UP   = Color.new(255, 100, 100) # reddish for UP marks
  COLOR_MID  = Color.new(100, 255, 100) # greenish for MID marks
  COLOR_DOWN = Color.new(100, 100, 255) # bluish for DOWN marks

  OFFSET_UP_Y   = 0  # vertical offset for UP marks
  OFFSET_MID_Y  = 0  # vertical offset for MID marks
  OFFSET_DOWN_Y = 0  # vertical offset for DOWN marks

  RANDOM_COLOR_VARIATION = true
  RANDOM_VARIATION_RANGE  = 50   # max +/- change per RGB channel

  # Marks
  UP   = %w( ̍ ̎ ̄ ̅ ̿ ̑ ̆ ̐ ͒ ͗ ͑ ̇ ̈ ̊ ̋ ̌ ̏ ᷄ ᷅ ᷆ ᷇ ᷈ )
  DOWN = %w( ̞ ̟ ̠ ̤ ̥ ̦ ̩ ̪ ̫ ̬ ̭ ̡ ̢ ̧ ̰ ̱ ̲ ̳ ̹ ̺ ̻ ͅ )
  MID  = %w( ̕ ̛ ̡ ̢ ̧ ̨ ̴ ̵ ̶ ͘ ͝ ̽ ̾ ͜ ͝ ͞ ͟ ͠ ͢ ͣ ͤ )

  #---------------------------------------------------------------------------
  # Helpers
  #---------------------------------------------------------------------------
  def self.intensity; @intensity; end
  def self.intensity=(n); @intensity = [[n.to_i,0].max,15].min; end

  def self.sample_up;   UP[rand(UP.size)]; end
  def self.sample_down; DOWN[rand(DOWN.size)]; end
  def self.sample_mid;  MID[rand(MID.size)]; end

  # Randomize a Color object slightly
  def self.randomize_color(base_color)
    return base_color unless RANDOM_COLOR_VARIATION
    r = [[base_color.red   + rand(RANDOM_VARIATION_RANGE*2+1) - RANDOM_VARIATION_RANGE, 0].max, 255].min
    g = [[base_color.green + rand(RANDOM_VARIATION_RANGE*2+1) - RANDOM_VARIATION_RANGE, 0].max, 255].min
    b = [[base_color.blue  + rand(RANDOM_VARIATION_RANGE*2+1) - RANDOM_VARIATION_RANGE, 0].max, 255].min
    Color.new(r, g, b, base_color.alpha)
  end
end

#------------------------------------------------------------------------------
# Extend Bitmap to draw Zalgo letters with stacked marks
#------------------------------------------------------------------------------
class Bitmap
  def draw_zalgo_char(x, y, ch, intensity, char_width, char_height)
    return if ch == ' '

    # ---- Draw main Zalgo character ----
    main_color = Zalgo::COLOR_MAIN
    main_color = Zalgo.randomize_color(main_color) if Zalgo::RANDOM_COLOR_MAIN
    self.font.color = main_color
    draw_text(x, y, char_width, char_height, ch)

    # ---- Draw UP marks ----
    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y - rand(char_height/2) + Zalgo::OFFSET_UP_Y
      self.font.color = Zalgo.randomize_color(Zalgo::COLOR_UP)
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_up)
    end

    # ---- Draw DOWN marks ----
    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y + rand(char_height/2) + Zalgo::OFFSET_DOWN_Y
      self.font.color = Zalgo.randomize_color(Zalgo::COLOR_DOWN)
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_down)
    end

    # ---- Draw MID marks ----
    intensity.times do
      ox = x + rand(char_width/2) - char_width/4
      oy = y + rand(char_height/2) - char_height/4 + Zalgo::OFFSET_MID_Y
      self.font.color = Zalgo.randomize_color(Zalgo::COLOR_MID)
      draw_text(ox, oy, char_width, char_height, Zalgo.sample_mid)
    end
  end

  def draw_zalgo_text_stacked(x, y, text, height)
    cx = x
    text.scan(/./m) do |ch|
      char_width  = self.text_size(ch).width
      char_height = height

      if ch == ' '
        cx += char_width
        next
      end

      draw_zalgo_char(cx, y, ch, Zalgo.intensity, char_width, char_height)
      cx += char_width
    end
  end
end

#------------------------------------------------------------------------------
# Patch Window_Message for RMXP to support \z[n] inline (line-level)
#------------------------------------------------------------------------------
class Window_Message < Window_Selectable
  alias zalgo_old_refresh refresh
  def refresh
    # If this is a choice message, skip Zalgo and use normal refresh
    if $game_temp.choice_max > 0
      return zalgo_old_refresh
    end

    text = $game_temp.message_text
    return zalgo_old_refresh unless text

    self.contents.clear
    x = 4
    y = 0

    text.split("\n").each do |line|
      intensity = nil

      # Detect \z[n] at the start of the line
      if line =~ /^\\z\[(\d+)\]/i
        intensity = $1.to_i
        line = line.gsub(/^\\z\[\d+\]/i, "")
      end

      if intensity
        Zalgo.intensity = intensity
        self.contents.draw_zalgo_text_stacked(x, y * 32, line, 32)
      else
        self.contents.font.color = normal_color
        self.contents.draw_text(x, y * 32, 480, 32, line)
      end

      y += 1
    end
  end
end

New Features for Version 2.0:
  • Independent mark offsets: Vertical adjustments for UP, MID, and DOWN marks (OFFSET_UP_Y, etc.).
  • Independent colors for marks: COLOR_UP, COLOR_MID, COLOR_DOWN.
  • Optional random color variation: Slight per-symbol color changes for marks.
  • Main Zalgo text color: COLOR_MAIN, with optional random variation (RANDOM_COLOR_MAIN).
  • Marks and main text fully separated: Randomization for marks does not affect normal or main text.
  • Expanded mark sets: More symbols for UP, MID, and DOWN marks for a richer effect.

Screenshot Version 2.0

zalgov2.jpg


Download Demo here (Version 2.0)

Credits:

  • By SGD
  • Based on SGD’s previous "SGD | Zalgo-Inspired Text" script

Features Mentioned

  • UP, MID, and DOWN diacritics applied to every character.
  • Per-line control via \z[n] (intensity n ranges 0–15). (Recommended not to go higher than 6 on a lot of text.)
  • Fully compatible with RMXP’s message system—normal messages, choices, and pauses all work.
  • No global toggling required; just use \z[n] wherever you want Zalgo text.
  • Usage:​Insert \z[n] at the start of any line in your message to activate Zalgo text for that line:
  • Ruby:
  • \z[6]This line will appear in Zalgo style at intensity 6
  • Normal lines remain unaffected
  • You can mix normal and Zalgo lines in the same message:
  • Normal line
  • \z[4]Zalgo line
  • Back to normal
  • Demo here (Version 1.0)
  • Spoiler: CODE VERSION 1.0
  • #==============================================================================
  • # ** Z A L G O S T A C K E D T E X T F O R R M X P

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

License / Terms Note

# Credits & Alterations: # By SGD # Based on SGD's previous Zalgo scripts #------------------------------------------------------------------------------

Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rgss#script-archive

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar