- 220
- Posts
- 10
- Years
- Portugal
- Seen Apr 15, 2024
Hello everyone!
Here is my first and simple script made by me and i don't want credits for this, i only want to help to improve pokemon essentials by expanding it with other features.
How to install:
Put this script above MAIN;
Put the required graphics in GRAPHICS/PICTURES folder.
Call with: Unown.show("your text here").
Note: The download contains the required graphics and this script.
Download: https://www.mediafire.com/?y33v9701fyrh8ue
Script:
Here is my first and simple script made by me and i don't want credits for this, i only want to help to improve pokemon essentials by expanding it with other features.
How to install:
Put this script above MAIN;
Put the required graphics in GRAPHICS/PICTURES folder.
Call with: Unown.show("your text here").
Note: The download contains the required graphics and this script.
Download: https://www.mediafire.com/?y33v9701fyrh8ue
![[PokeCommunity.com] Unown Text Tablet [PokeCommunity.com] Unown Text Tablet](https://i59.servimg.com/u/f59/18/66/78/26/unown_10.png)
Script:
Spoiler:
################################################################################
# Unown Script
# By Richard PT
# Credits Required
################################################################################
# Turns a normal string into a Unown string and displays it.
#
# NOTICE: Yes, I know the unown graphics aren't the best, but they work.
#
# How to use:
# - Insert the graphics provided to: YourGameFolder/Graphics/Pictures OR add
# your own graphics (to the same folder)
# - Customize the settings to make sure everything works the way it should
# - Test it out
# - Report any problems
#
#
# Call with: Unown.show("Text")
################################################################################
class Unown
BackgroundFile = "UnownBackground" # Background of the Unown (EG a stone tablet)
FilePrefix = "Unown" # The prefix of the Unown characters (EG if the prefix
# is "Unown_" then it will look for "Unown_A",
# "Unown_B", "Unown_C", ect.)
# THESE OPTIONS ARE MEASURED IN PIXELS!
UnownStartX = 32 # The Starting X (per line) on which a Unown character is shown
UnownStartY = 32 # The Starting Y point on which Unown is shown
UnownNewLineAt = Graphics.width - UnownStartX # The maximum X before we go to
# a new line
# THESE OPTIONS ARE MEASURED IN PIXELS!
UnownPaddingX = 10 # Padding between each Unown character (Left to Right)
UnownPaddingY = 10 # Padding between each Unown character (Top to Bottom)
def self.show(text)
scene = Unown.new(text)
scene.main
end
def initialize(text)
@text = unownAlphabetString(text)
@exit = false
end
# Converts a normal string into an unown alphabetical string
# Removes all uneeded characters, converts numbers into the correct format
# ect.
def unownAlphabetString(input)
input[/([A-Za-z0-9# ]*)/]
input = $1
output = ""
char = "A"
for i in 0...input.length
prev_char = char
charI = input
char = " "
char[0] = charI
# Check to see if we are at the start of an integer
if (char == "0" || char.to_i != 0) &&
(prev_char != "0" && prev_char.to_i == 0 && prev_char != "#")
output += "#" # Add a number sign to the start of numbers
end
# Convert each integer into a letter, because this is how it is in Unown
if char == "1"
output += "A"
elsif char == "2"
output += "B"
elsif char == "3"
output += "C"
elsif char == "4"
output += "D"
elsif char == "5"
output += "E"
elsif char == "6"
output += "F"
elsif char == "7"
output += "G"
elsif char == "8"
output += "H"
elsif char == "9"
output += "I"
elsif char == "10"
output += "J"
elsif char == "11"
output += "K"
elsif char == "12"
output += "L"
elsif char == "13"
output += "M"
elsif char == "14"
output += "N"
elsif char == "15"
output += "O"
elsif char == "16"
output += "P"
elsif char == "17"
output += "Q"
elsif char == "18"
output += "R"
elsif char == "19"
output += "S"
elsif char == "20"
output += "T"
elsif char == "21"
output += "U"
elsif char == "22"
output += "V"
elsif char == "23"
output += "W"
elsif char == "24"
output += "X"
elsif char == "25"
output += "Y"
elsif char == "0"
output += "Z"
else # If it's not a letter, just add the character.
output += char
end
end
return output
end
def create_spriteset
@sprites = {}
@sprites["background"] = IconSprite.new
@sprites["background"].setBitmap("Graphics/Pictures/" + BackgroundFile)
x = UnownStartX + UnownPaddingX
y = UnownStartY + UnownPaddingY
for i in [email protected]
file = "Graphics/Pictures/" + FilePrefix + "A"
t = @text
if t == "#"[0]
t = "NS"
elsif t == " "[0]
t = "Space"
end
file[file.length - 1] = t
if FileTest.image_exist?(file)
@sprites["letter#{i}"] = IconSprite.new(x, y)
@sprites["letter#{i}"].setBitmap(file)
x += @sprites["letter#{i}"].bitmap.width + UnownPaddingX
if x >= UnownNewLineAt - UnownPaddingX
x = UnownStartX + UnownPaddingX
y += @sprites["letter#{i}"].bitmap.height + UnownPaddingX
end
else
c = "A"
c[0] = @text
c = c.upcase
t = "Could not find the file Unown file for the character: #{c}!"
raise t
end
end
end
def main
create_spriteset
loop do
Graphics.update
Input.update
update
break if @exit
end
pbDisposeSpriteHash(@sprites)
end
def update
pbUpdateSpriteHash(@sprites)
if Input.trigger?(Input::C) || Input.trigger?(Input::B)
@exit = true
end
end
end
# Unown Script
# By Richard PT
# Credits Required
################################################################################
# Turns a normal string into a Unown string and displays it.
#
# NOTICE: Yes, I know the unown graphics aren't the best, but they work.
#
# How to use:
# - Insert the graphics provided to: YourGameFolder/Graphics/Pictures OR add
# your own graphics (to the same folder)
# - Customize the settings to make sure everything works the way it should
# - Test it out
# - Report any problems
#
#
# Call with: Unown.show("Text")
################################################################################
class Unown
BackgroundFile = "UnownBackground" # Background of the Unown (EG a stone tablet)
FilePrefix = "Unown" # The prefix of the Unown characters (EG if the prefix
# is "Unown_" then it will look for "Unown_A",
# "Unown_B", "Unown_C", ect.)
# THESE OPTIONS ARE MEASURED IN PIXELS!
UnownStartX = 32 # The Starting X (per line) on which a Unown character is shown
UnownStartY = 32 # The Starting Y point on which Unown is shown
UnownNewLineAt = Graphics.width - UnownStartX # The maximum X before we go to
# a new line
# THESE OPTIONS ARE MEASURED IN PIXELS!
UnownPaddingX = 10 # Padding between each Unown character (Left to Right)
UnownPaddingY = 10 # Padding between each Unown character (Top to Bottom)
def self.show(text)
scene = Unown.new(text)
scene.main
end
def initialize(text)
@text = unownAlphabetString(text)
@exit = false
end
# Converts a normal string into an unown alphabetical string
# Removes all uneeded characters, converts numbers into the correct format
# ect.
def unownAlphabetString(input)
input[/([A-Za-z0-9# ]*)/]
input = $1
output = ""
char = "A"
for i in 0...input.length
prev_char = char
charI = input
char = " "
char[0] = charI
# Check to see if we are at the start of an integer
if (char == "0" || char.to_i != 0) &&
(prev_char != "0" && prev_char.to_i == 0 && prev_char != "#")
output += "#" # Add a number sign to the start of numbers
end
# Convert each integer into a letter, because this is how it is in Unown
if char == "1"
output += "A"
elsif char == "2"
output += "B"
elsif char == "3"
output += "C"
elsif char == "4"
output += "D"
elsif char == "5"
output += "E"
elsif char == "6"
output += "F"
elsif char == "7"
output += "G"
elsif char == "8"
output += "H"
elsif char == "9"
output += "I"
elsif char == "10"
output += "J"
elsif char == "11"
output += "K"
elsif char == "12"
output += "L"
elsif char == "13"
output += "M"
elsif char == "14"
output += "N"
elsif char == "15"
output += "O"
elsif char == "16"
output += "P"
elsif char == "17"
output += "Q"
elsif char == "18"
output += "R"
elsif char == "19"
output += "S"
elsif char == "20"
output += "T"
elsif char == "21"
output += "U"
elsif char == "22"
output += "V"
elsif char == "23"
output += "W"
elsif char == "24"
output += "X"
elsif char == "25"
output += "Y"
elsif char == "0"
output += "Z"
else # If it's not a letter, just add the character.
output += char
end
end
return output
end
def create_spriteset
@sprites = {}
@sprites["background"] = IconSprite.new
@sprites["background"].setBitmap("Graphics/Pictures/" + BackgroundFile)
x = UnownStartX + UnownPaddingX
y = UnownStartY + UnownPaddingY
for i in [email protected]
file = "Graphics/Pictures/" + FilePrefix + "A"
t = @text
if t == "#"[0]
t = "NS"
elsif t == " "[0]
t = "Space"
end
file[file.length - 1] = t
if FileTest.image_exist?(file)
@sprites["letter#{i}"] = IconSprite.new(x, y)
@sprites["letter#{i}"].setBitmap(file)
x += @sprites["letter#{i}"].bitmap.width + UnownPaddingX
if x >= UnownNewLineAt - UnownPaddingX
x = UnownStartX + UnownPaddingX
y += @sprites["letter#{i}"].bitmap.height + UnownPaddingX
end
else
c = "A"
c[0] = @text
c = c.upcase
t = "Could not find the file Unown file for the character: #{c}!"
raise t
end
end
end
def main
create_spriteset
loop do
Graphics.update
Input.update
update
break if @exit
end
pbDisposeSpriteHash(@sprites)
end
def update
pbUpdateSpriteHash(@sprites)
if Input.trigger?(Input::C) || Input.trigger?(Input::B)
@exit = true
end
end
end
Last edited: