Bienvenue visiteur !
|
Désactiver la neige
Statistiques
Liste des membres
Contact
Mentions légales
370 connectés actuellement
30765526 visiteurs depuis l'ouverture
2264 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
❤ 0 Auteur : SephirothSpawn
Logiciel : RPG Maker XP
Nombre de scripts : 1
Source : http://www.creationasylum.net/index.php?showtopic=11253 (Archive du script)
Fonctionnalités
- Permet de définir vos langages avec ses caractères particuliers, et de changer de l'un à l'autre
- Option dans le script pour changer la couleur d'une langue.
Installation
A placer au-dessus de Main.
Compatibilité
- Fonctionne avec la plupart des systèmes de messages (dont l'AMS de Dubealex).
- Cependant, vous ne pouvez pas utiliser des fonctions telles que montrer l'argent avec un message codé.
Version 2.0 (recommandée)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
| #==============================================================================
# ** Multiple Languages
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2
# 2006-08-27
#------------------------------------------------------------------------------
# * Description :
#
# ~ This script was designed to let you simulate multiple languages through
# letter transfers. It allows you to transfer one letter to another, until
# you learn the letter (One Letter = Another Letter). You can set up
# multiple languages and control color of known and unknown letters for
# each language.
#------------------------------------------------------------------------------
# * Instructions :
#
# ~ Place Script Below the SDK and Above Main
#
# ~ Turning on Different Language (Use Before the Text/Message Command):
# $game_languages.language_id = language_id
#
# ~ Turning off multiple langauges (Use After the Text/Message Command):
# $game_languages.language_id = nil
#
# ~ To Learn a letter, use:
# $game_languages.learn_letter(language_id, 'letter')
#
# NOTE: Due to the complexity of message systems, you cannot use special
# commands such as the show gold window when displaying an alternate language.
#------------------------------------------------------------------------------
# * Setting Up A Language
#
# ~ Setting Color for Known and Unknown letters
# Known_Letter_Color = {language_id => text_color, ...}
# Unknown_Letter_Color = {language_id => text_color, ...}
#
# ~ Setting Up Language Table
# Languages = {language_id => <language_table>, ...}
#
# ~ <language_table> is a hash of all letters and symbols that will transfer
# to something else. The keys are what the letter is, and the values are
# how the letters will appear until translated.
#
# Example:
# {'a' => 'j', 'b' => 'k', 'c' => 'l', 'd' => 'm', 'e' => 'n'}
#
# CbaEBac -> LkjNKjl
#------------------------------------------------------------------------------
# * Thanks To Makeamidget For helping me with previous versions
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Multiple Languages', 'SephirothSpawn', 2, '2006-08-28')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Multiple Languages')
#==============================================================================
# ** Game_Languages
#==============================================================================
class Game_Languages
#--------------------------------------------------------------------------
# * Letter Colors
#
# ~ language_id => text_colors
#
# The Text Colors are the colors you would use when you use \c[n].
# By Default, these are the colors:
#
# 0 : White 1 : Dark Blue
# 2 : Red 3 : Green
# 4 : Light Blue 5 : Purple
# 6 : Yellow 7 : Gray
#--------------------------------------------------------------------------
Known_Letter_Color = {
1 => 0
}
Unknown_Letter_Color = {
1 => 6
}
#--------------------------------------------------------------------------
# * Languages
#
# ~ language_id => {a => 'f', 'b' => 'c', ...}
#
# * Template For Letters
# = {'a' => '', 'b' => '', 'c' => '', 'd' => '', 'e' => '',
# 'f' => '', 'g' => '', 'h' => '', 'i' => '', 'j' => '',
# 'k' => '', 'l' => '', 'm' => '', 'n' => '', 'o' => '',
# 'p' => '', 'q' => '', 'r' => '', 's' => '', 't' => '',
# 'u' => '', 'v' => '', 'w' => '', 'x' => '', 'y' => '',
# 'z' => ''}
#--------------------------------------------------------------------------
Languages = {
1 => {'a' => 'y', 'b' => 'p', 'c' => 'l', 'd' => 't', 'e' => 'a',
'f' => 'v', 'g' => 'k', 'h' => 'r', 'i' => 'e', 'j' => 'z',
'k' => 'g', 'l' => 'm', 'm' => 's', 'n' => 'h', 'o' => 'u',
'p' => 'b', 'q' => 'x', 'r' => 'n', 's' => 'c', 't' => 'd',
'u' => 'i', 'v' => 'v', 'w' => 'f', 'x' => 'q', 'y' => 'o',
'z' => 'w'
}
}
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :language_id
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@language_id = nil
@known_letters = {}
end
#--------------------------------------------------------------------------
# * Learn Letter
#--------------------------------------------------------------------------
def learn_letter(language_id, letter)
unless @known_letters.has_key?(language_id)
@known_letters[language_id] = []
end
unless @known_letters[language_id].include?(letter.downcase)
@known_letters[language_id] << letter.downcase
end
end
#--------------------------------------------------------------------------
# * Change To Language
#--------------------------------------------------------------------------
def change_to_language
return_text = ''
text = $game_temp.message_text
last_color = 0
begin
while ((c = text.slice!(/./m)) != nil)
if @known_letters.has_key?(@language_id)
if @known_letters[@language_id].include?(c.downcase)
next_color = Known_Letter_Color[@language_id]
unless next_color == last_color
last_color = next_color
return_text += '\c' + "[#{next_color}]"
end
return_text += c
next
end
end
if Languages[@language_id].include?(c.downcase)
if c.upcase == c
c = Languages[@language_id][c.downcase].upcase
else
c = Languages[@language_id][c]
end
end
next_color = Unknown_Letter_Color[@language_id]
unless next_color == last_color
last_color = next_color
return_text += '\c' + "[#{next_color}]"
end
return_text += c
end
end
$game_temp.message_text = return_text
end
end
#==============================================================================
# ** Window_Message
#==============================================================================
class Window_Message
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_gmlngs_wdmsg_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# If Alternate Languages Isn't Nil
unless $game_languages.language_id.nil?
$game_languages.change_to_language
end
# Original Method Refresh
seph_gmlngs_wdmsg_refresh
end
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_gmlngs_scnttl_cng command_new_game
#--------------------------------------------------------------------------
# * Command : New Game
#--------------------------------------------------------------------------
def command_new_game
# Original Command New Game
seph_gmlngs_scnttl_cng
# Creates Game Languages Game Data
$game_languages = Game_Languages.new
end
end
#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_gmlngs_scnsave_wd write_data
#--------------------------------------------------------------------------
# * Command : New Game
#--------------------------------------------------------------------------
def write_data(file)
# Original Write Data
seph_gmlngs_scnsave_wd(file)
# Saves Game Languages Data
Marshal.dump($game_languages, file)
end
end
#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_gmlngs_scnload_rd read_data
#--------------------------------------------------------------------------
# * Command : New Game
#--------------------------------------------------------------------------
def read_data(file)
# Original Write Data
seph_gmlngs_scnload_rd(file)
# Saves Game Languages Data
$game_languages = Marshal.load(file)
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end |
Version 1 (archive)
Spoiler (cliquez pour afficher) Auteur : makeamidget, SephirothSpawn & Eudliel (modifications et corrections)
Source : http://www.creationasylum.net/index.php?showtopic=3665
[color=orange]Incompatible avec l'AMS de Dubealex, ou tout script modifiant def refresh dans Window_Message.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
| #=================================
# Alternate Language thing by makeamidget & Seph
#=================================
#It's constant setting time..., i made two constants that you will use and it's for the color of the messages
#This one is for when the letter is known
NORMAL_COLOR = Color.new(255, 255, 255, 255)#(White)
#this one is for when the letter is unknown
LANG_COLOR = Color.new(128, 128, 255, 255)#(Blue)
#Make a constant like this:
#[ {'KEY' => 'Letter to be Learned', 'VALUE' => 'What your letter Will be Changed to'}, ...]
#Place Your Language Constants here:
ALBHED = [
{'KEY' => 'A', 'VALUE' => 'Y'}, {'KEY' => 'B', 'VALUE' => 'P'}, {'KEY' => 'C', 'VALUE' => 'L'},
{'KEY' => 'D', 'VALUE' => 'T'}, {'KEY' => 'E', 'VALUE' => 'A'}, {'KEY' => 'F', 'VALUE' => 'V'},
{'KEY' => 'G', 'VALUE' => 'K'}, {'KEY' => 'H', 'VALUE' => 'R'}, {'KEY' => 'I', 'VALUE' => 'E'},
{'KEY' => 'J', 'VALUE' => 'Z'}, {'KEY' => 'K', 'VALUE' => 'G'}, {'KEY' => 'L', 'VALUE' => 'M'},
{'KEY' => 'M', 'VALUE' => 'S'}, {'KEY' => 'N', 'VALUE' => 'H'}, {'KEY' => 'O', 'VALUE' => 'U'},
{'KEY' => 'P', 'VALUE' => 'B'}, {'KEY' => 'Q', 'VALUE' => 'X'}, {'KEY' => 'R', 'VALUE' => 'N'},
{'KEY' => 'S', 'VALUE' => 'C'}, {'KEY' => 'T', 'VALUE' => 'D'}, {'KEY' => 'U', 'VALUE' => 'I'},
{'KEY' => 'V', 'VALUE' => 'J'}, {'KEY' => 'W', 'VALUE' => 'F'}, {'KEY' => 'X', 'VALUE' => 'Q'},
{'KEY' => 'Y', 'VALUE' => 'O'}, {'KEY' => 'Z', 'VALUE' => 'W'}]
SYMBOLS = [
{'KEY' => 'A', 'VALUE' => '`'}, {'KEY' => 'B', 'VALUE' => '~'}, {'KEY' => 'C', 'VALUE' => '!'},
{'KEY' => 'D', 'VALUE' => '@'}, {'KEY' => 'E', 'VALUE' => '#'}, {'KEY' => 'F', 'VALUE' => '$'},
{'KEY' => 'G', 'VALUE' => '%'}, {'KEY' => 'H', 'VALUE' => '^'}, {'KEY' => 'I', 'VALUE' => '&'},
{'KEY' => 'J', 'VALUE' => '*'}, {'KEY' => 'K', 'VALUE' => '('}, {'KEY' => 'L', 'VALUE' => ')'},
{'KEY' => 'M', 'VALUE' => '-'}, {'KEY' => 'N', 'VALUE' => '_'}, {'KEY' => 'O', 'VALUE' => '='},
{'KEY' => 'P', 'VALUE' => '+'}, {'KEY' => 'Q', 'VALUE' => '['}, {'KEY' => 'R', 'VALUE' => '{'},
{'KEY' => 'S', 'VALUE' => ']'}, {'KEY' => 'T', 'VALUE' => '}'}, {'KEY' => 'U', 'VALUE' => '|'},
{'KEY' => 'V', 'VALUE' => ';'}, {'KEY' => 'W', 'VALUE' => ':'}, {'KEY' => 'X', 'VALUE' => '<'},
{'KEY' => 'Y', 'VALUE' => '>'}, {'KEY' => 'Z', 'VALUE' => '?'}]
#Now Begins the Game_Party mod
#Make An attr_accessor Named identical to your Constant in Lower Case
class Game_Party
attr_accessor :albhed
attr_accessor :symbols
alias alt_lang_initialize initialize
def initialize
@albhed = []
@symbols = []
alt_lang_initialize
end
end
#Ends Game Party
#Begins Window_Message
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
x = y = 0
@cursor_width = 0
if $game_temp.choice_start == 0
x = 8
end
if $game_temp.message_text != nil
text = $game_temp.message_text
begin
last_text = text.clone
text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until text == last_text
text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
text.gsub!(/\\\\/) { "\000" }
text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
text.gsub!(/\\[Gg]/) { "\002" }
#Yo, Midge here, explainin what the hell i did... for your amusement...
#This is the new escape that i made just for this... basically this next line makes it so that you
#can just type \Alt[NAME], or \alt[NAME], it deletes that and replaces it with \a[] the $1 is the
#name of the Language that you're gonna use in this message
text.gsub!(/\\[Aa]lt\[([A-Z]+)\]/) { "\a[#{$1}]" }
#End Mod -Midge-
while ((c = text.slice!(/./m)) != nil)
#Okay, remember how \alt[] was replaced with \a? well this is where that whole thing comes into play
#the while statement above makes it go through the message letter by letter... so that it can get to all
#the other escapes and do them accordingly, such as \c[2] since you might have multiple of those...
if c == "\a"
text.sub!(/\[([A-Z]+)\]/, "")
temp = $1 #remember that $1 is the contents of the \Alt[NAME] which is how it works with multiple languages
lang = eval(temp) #eval() de-stringitizes it, so it's no longer a string, it is recognized as the constant that you set up
letters = eval("$game_party." + temp.downcase)#this is getting the name of the attribute for this specific language
alt = true #just a little temp variable to know that this is an alternate language message
end
if alt
#.include? searches all indexes of the array to see if it includes what is in the (), the ! means not
#so it's saying if whatever the current letter is, uppercase, is not in the array, execute the following
self.contents.font.color = NORMAL_COLOR #sets the color to white
if ! letters.include?(c.upcase)
#now we hit the loop.. it goes through each index of the array and executes the code proceeding
#the declaration of the loop.. each iteration is refered to as stuff...
lang.each do |stuff|
#stuff['KEY'] is the value that you set in the hash of the language it's the actual letter, stuff['VALUE']
#is what you want KEY to change into if the language is not known
#basically for each letter in the message it compares it searches the loop for the letter, uppercase and lowercase
#and if it finds the letter then it replaces it with what you set it to, remember that this is after it checks if
#the player knows it or not, when the letter is found it is replaced, the color is changed and the loop is stopped
if stuff['KEY'] == c
self.contents.font.color = LANG_COLOR
c = stuff['VALUE']
break
elsif stuff['KEY'] == c.upcase
self.contents.font.color = LANG_COLOR
c = stuff['VALUE'].downcase
break
end
end
end
end
#End of Mod -Midge-
if c == "\000"
c = "\\"
end
if c == "\001"
text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
next
end
if c == "\002"
if @gold_window == nil
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
next
end
if c == "\n"
if y >= $game_temp.choice_start
@cursor_width = [@cursor_width, x].max
end
y += 1
x = 0
if y >= $game_temp.choice_start
x = 8
end
next
end
self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
x += self.contents.text_size(c).width
end
end
if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
end
end |
Utilisation
Pour ajouter une lettre il faut appeler le script:
1
| $game_party.(the name of your language).push("letter") |
Avant chaque message il faut ajouter [nom de votre langage] et le message doit être en majuscules :
1
| \Alt[NOM DE VOTRE LANGUE] |
Mis à jour le 19 novembre 2020.
|
RPG-man -
posté le 04/08/2008 à 19:17:59 (0 messages postés)
| J'aime mapper mais je sais pas mapper ... | ¨Pas compris comment ça marche, soit plus précis... j'ai testé, y'a une erreur, quand je fais "insérer un script"
Il faut changer quelques trucs dans le script si on veut changer le nom du langage...
Mais quand je veux ajouter une lettre là... y'a une erreur!
|
|
|
|