Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV

Apprendre
RPG Maker

Guides
Tutoriels
Making-of

Dans le
Forum

Section Entraide

News: Cérémonie des Alex d'or 2020 / Jeux: Beetle Ninja / Jeux: Le Miroir de Philéas / Tutos: Améliorer les rencontres (...) / Tutos: Quelques tests géométriques (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

99 connectés actuellement

10801671 visiteurs
depuis l'ouverture

95 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Hellsoft

Planète Glutko

RPG Fusion

RPG Maker - La Communauté

Guelnika & E-magination

Tashiroworld

Tous nos partenaires

Devenir
partenaire



Nouvelle langue
Script pour RPG Maker XP
Ecrit par Cetais
Publié par cetais (lui envoyer un message privé)
Signaler un script cassé

Script crée par SephirothSpawn, revu et corrigé par Eudliel (merci à lui).

Tout d'abord créer un script "Alternate_Language" au-dessus de "Main":

Portion de code : Tout sélectionner

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



Pour ajouter une lettre il faut appeler le script:

Portion de code : Tout sélectionner

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 :

Portion de code : Tout sélectionner

1
\Alt[NOM DE VOTRE LANGUE]





RPG-man - posté le 04/08/2008 à 19:17:59 (0 messages postés)

❤ 0

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!

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Articles perso | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Jeux complets | Tous les jeux | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers